@aiquants/markdown 8.1.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -6
- package/dist/{abnfDiagram-VRR7QNED-COhNzXNE.cjs → abnfDiagram-VRR7QNED-BlcBSkWc.cjs} +1 -1
- package/dist/{abnfDiagram-VRR7QNED-C8c6opKu.js → abnfDiagram-VRR7QNED-DPvv0JN7.js} +3 -3
- package/dist/{arc-B7dJeCE2.cjs → arc-DnEVH7-N.cjs} +1 -1
- package/dist/arc-b3PXY3wd.js +83 -0
- package/dist/{architectureDiagram-ZJ3FMSHR-DkPnUyg2.js → architectureDiagram-ZJ3FMSHR-BPDNqRgJ.js} +2 -2
- package/dist/{architectureDiagram-ZJ3FMSHR-CEKrAopq.cjs → architectureDiagram-ZJ3FMSHR-BPesVaHB.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-8SbxgSPX.js → blockDiagram-677ZJIJ3-Bif7ObTM.js} +3 -3
- package/dist/{blockDiagram-677ZJIJ3-CjkHADz7.cjs → blockDiagram-677ZJIJ3-D1wkf-um.cjs} +1 -1
- package/dist/{c4Diagram-LMCZKHZV-yyFJx8cz.js → c4Diagram-LMCZKHZV-BTR45GVa.js} +2 -2
- package/dist/{c4Diagram-LMCZKHZV-DNA2nQGH.cjs → c4Diagram-LMCZKHZV-ByUwS5Pa.cjs} +1 -1
- package/dist/{channel-AU6Wl3tM.js → channel-BjDEP12v.js} +1 -1
- package/dist/{channel-BmWKcNRa.cjs → channel-s9lqY49F.cjs} +1 -1
- package/dist/{chunk-2Q5K7J3B-piQwYJQ4.js → chunk-2Q5K7J3B-3Yxool5g.js} +1 -1
- package/dist/{chunk-2Q5K7J3B-CNGMKVwn.cjs → chunk-2Q5K7J3B-GdBcW8di.cjs} +1 -1
- package/dist/{chunk-32BRIVSS-BqVwiyb1.cjs → chunk-32BRIVSS-B08XoiLi.cjs} +1 -1
- package/dist/{chunk-32BRIVSS-UYOJ_0zk.js → chunk-32BRIVSS-CVTMS7GT.js} +1 -1
- package/dist/{chunk-5VM5RSS4-D2uhPXpB.cjs → chunk-5VM5RSS4-BQoi-IrE.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-BW4JCEEi.js → chunk-5VM5RSS4-D9iWNvvu.js} +1 -1
- package/dist/{chunk-EX3LRPZG-0d4k1nQH.cjs → chunk-EX3LRPZG-BXIZ7mJ_.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-iHiCfad6.js → chunk-EX3LRPZG-CRf3FYTC.js} +21 -21
- package/dist/{chunk-JWPE2WC7-B0wbe9kC.cjs → chunk-JWPE2WC7-BziKhEzJ.cjs} +1 -1
- package/dist/{chunk-JWPE2WC7-BIvGQze3.js → chunk-JWPE2WC7-D2PL9wSE.js} +1 -1
- package/dist/{chunk-MOJQB5TN-D_szn4LO.cjs → chunk-MOJQB5TN-BZPg0rA4.cjs} +1 -1
- package/dist/{chunk-MOJQB5TN-ClyJPR3N.js → chunk-MOJQB5TN-DcKI-L1a.js} +7 -7
- package/dist/{chunk-PUDLZKDR-DCWC9BV3.js → chunk-PUDLZKDR-DDUAtfaX.js} +6 -6
- package/dist/{chunk-PUDLZKDR-Da8ALohe.cjs → chunk-PUDLZKDR-DtwY_vfa.cjs} +1 -1
- package/dist/{chunk-RYQCIY6F-D-fL7Arm.cjs → chunk-RYQCIY6F-BczXRQc_.cjs} +1 -1
- package/dist/{chunk-RYQCIY6F-BJunVYHV.js → chunk-RYQCIY6F-CrSm-DUq.js} +5 -5
- package/dist/{chunk-V7JOEXUC-dOvhhSJR.cjs → chunk-V7JOEXUC-DHDaKlaz.cjs} +1 -1
- package/dist/{chunk-V7JOEXUC-CKvcevsF.js → chunk-V7JOEXUC-fKZqn2BY.js} +15 -15
- package/dist/{chunk-VR4S4FIN-UyLNi7_d.js → chunk-VR4S4FIN-CB1TUCm-.js} +3 -3
- package/dist/{chunk-VR4S4FIN-BXb1KkES.cjs → chunk-VR4S4FIN-CbOikBFH.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-CrK2v0cI.cjs → chunk-XXDRQBXY-BNQCeyB9.cjs} +1 -1
- package/dist/{chunk-XXDRQBXY-BR25mC1D.js → chunk-XXDRQBXY-K8anqUB1.js} +1 -1
- package/dist/{classDiagram-v2-EOCWNBFH-Dk9Cb1P_.js → classDiagram-OUVF2IWQ-0DLLfHtC.js} +2 -2
- package/dist/{classDiagram-OUVF2IWQ-Dd8K3APq.cjs → classDiagram-OUVF2IWQ-D1vfgcCB.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-Dk9Cb1P_.js → classDiagram-v2-EOCWNBFH-0DLLfHtC.js} +2 -2
- package/dist/{classDiagram-v2-EOCWNBFH-Dd8K3APq.cjs → classDiagram-v2-EOCWNBFH-D1vfgcCB.cjs} +1 -1
- package/dist/code-blocks.cjs +1 -0
- package/dist/code-blocks.d.ts +12 -0
- package/dist/code-blocks.js +36 -0
- package/dist/components/MarkdownRenderer.d.ts +6 -1
- package/dist/components/MarkdownViewer.d.ts +5 -1
- package/dist/components/SpreadsheetBlock.d.ts +24 -0
- package/dist/components/SpreadsheetToolbar.d.ts +21 -0
- package/dist/components/controlStyles.d.ts +3 -0
- package/dist/components/mdastNodes/CodeNode.d.ts +1 -0
- package/dist/components/spreadsheetClipboard.d.ts +16 -0
- package/dist/components/spreadsheetLabels.d.ts +33 -0
- package/dist/components/spreadsheetModel.d.ts +31 -0
- package/dist/components/viewerLabels.d.ts +6 -1
- package/dist/converter.wasm +0 -0
- package/dist/{cose-bilkent-JH36ORCC-R8-QyE8i.js → cose-bilkent-JH36ORCC-DSrvI7Rp.js} +5 -5
- package/dist/{cose-bilkent-JH36ORCC-BabWDfU-.cjs → cose-bilkent-JH36ORCC-Flvn8Q3R.cjs} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-DA9Y86zK.js → cynefinDiagram-TSTJHNR4-BGtSNTPQ.js} +56 -56
- package/dist/{cynefinDiagram-TSTJHNR4-DkOQZ78i.cjs → cynefinDiagram-TSTJHNR4-BxqOgmm9.cjs} +1 -1
- package/dist/{dagre-VKFMJZFB-DDd8r_DC.js → dagre-VKFMJZFB-Bq5NKuKi.js} +26 -26
- package/dist/{dagre-VKFMJZFB-CgbTP0Wx.cjs → dagre-VKFMJZFB-CIQyEWnl.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-BAgBAvgs.js → diagram-FQU43EPY-B4shMan7.js} +31 -31
- package/dist/{diagram-FQU43EPY-CxfNu2-7.cjs → diagram-FQU43EPY-C-3vCuEY.cjs} +1 -1
- package/dist/{diagram-G47NLZAW-CB93NFXX.js → diagram-G47NLZAW-BnJ5uYMd.js} +49 -49
- package/dist/{diagram-G47NLZAW-CkiymCo7.cjs → diagram-G47NLZAW-BnVPH5jd.cjs} +1 -1
- package/dist/{diagram-NH7WQ7WH-p6Y93aOD.cjs → diagram-NH7WQ7WH-4RGgOu7p.cjs} +1 -1
- package/dist/{diagram-NH7WQ7WH-B9v-kVbL.js → diagram-NH7WQ7WH-9s11j-Nx.js} +15 -15
- package/dist/{diagram-OA4YK3LP-COWMD9b-.cjs → diagram-OA4YK3LP-BBtbKikh.cjs} +1 -1
- package/dist/{diagram-OA4YK3LP-sJRwAzB_.js → diagram-OA4YK3LP-CgqOV0tg.js} +25 -25
- package/dist/{diagram-WEI45ONY-C8T5giSx.js → diagram-WEI45ONY-CvzP7VJ3.js} +67 -67
- package/dist/{diagram-WEI45ONY-DpIxbF21.cjs → diagram-WEI45ONY-DZKSviH2.cjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-BeltWCbi.js → ebnfDiagram-CCIWWBDH-CJSyu4o9.js} +3 -3
- package/dist/{ebnfDiagram-CCIWWBDH-C3mX3xi4.cjs → ebnfDiagram-CCIWWBDH-DpiouxMS.cjs} +1 -1
- package/dist/{erDiagram-Q63AITRT-CEJEnlDH.cjs → erDiagram-Q63AITRT-BT1bGFxN.cjs} +1 -1
- package/dist/{erDiagram-Q63AITRT-BDRv2ZL5.js → erDiagram-Q63AITRT-BxRdYBzJ.js} +19 -19
- package/dist/extractHeadings-B-v1O82x.cjs +314 -0
- package/dist/{extractHeadings-4Twze1a2.js → extractHeadings-SqtThWou.js} +6481 -5975
- package/dist/flowDiagram-23GEKE2U-C-drHfAk.js +7 -0
- package/dist/flowDiagram-23GEKE2U-Cr8_S21X.cjs +1 -0
- package/dist/{ganttDiagram-NO4QXBWP-D8PJGFBA.cjs → ganttDiagram-NO4QXBWP-BXUukgtA.cjs} +1 -1
- package/dist/{ganttDiagram-NO4QXBWP-ufXjgu_J.js → ganttDiagram-NO4QXBWP-BbNFbubH.js} +2 -2
- package/dist/{gitGraphDiagram-IHSO6WYX-CIFUIlyT.js → gitGraphDiagram-IHSO6WYX-BY7URUuV.js} +10 -10
- package/dist/{gitGraphDiagram-IHSO6WYX-B_0MTo_P.cjs → gitGraphDiagram-IHSO6WYX-CtRl8SF8.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.d.ts +3 -1
- package/dist/index.client.js +38 -36
- package/dist/index.js +38 -36
- package/dist/{infoDiagram-FWYZ7A6U-D6Gz3U8C.js → infoDiagram-FWYZ7A6U-BwM_aV37.js} +3 -3
- package/dist/{infoDiagram-FWYZ7A6U-Kc-I0YS9.cjs → infoDiagram-FWYZ7A6U-DjbpQufv.cjs} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-DhiZcFc2.js → ishikawaDiagram-FXEZZL3T-CWHT2wjh.js} +35 -35
- package/dist/{ishikawaDiagram-FXEZZL3T-D6HwKFYQ.cjs → ishikawaDiagram-FXEZZL3T-D0k3NpJW.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-BM9CUgjl.cjs → journeyDiagram-5HDEW3XC-BAzrW3sk.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-C7RWP4gW.js → journeyDiagram-5HDEW3XC-CTBamWVg.js} +30 -30
- package/dist/{kanban-definition-HUTT4EX6-BuOwUllf.js → kanban-definition-HUTT4EX6-DX8ATmyc.js} +47 -47
- package/dist/{kanban-definition-HUTT4EX6-GHkiFLFG.cjs → kanban-definition-HUTT4EX6-vEBxhqy3.cjs} +1 -1
- package/dist/{linear-CFU1TjYA.js → linear-CUPbFHK0.js} +5 -5
- package/dist/{linear-CfqknxqH.cjs → linear-DO7t2MIy.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-DIl1G8VF.cjs → mindmap-definition-LN4V7U3C-CPgbGhe0.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-HAxXHmB6.js → mindmap-definition-LN4V7U3C-CZiyButG.js} +11 -11
- package/dist/{pegDiagram-2B236MQR-BDNdKFri.js → pegDiagram-2B236MQR-BTTxMeDC.js} +3 -3
- package/dist/{pegDiagram-2B236MQR-BMcKIFEC.cjs → pegDiagram-2B236MQR-DFSWh2UC.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-7MKargq5.js → pieDiagram-ENE6RG2P-5OqZWuO-.js} +49 -49
- package/dist/{pieDiagram-ENE6RG2P-DkoMk8N8.cjs → pieDiagram-ENE6RG2P-DWsTb8I9.cjs} +1 -1
- package/dist/{quadrantDiagram-ABIIQ3AL-DzHTxI0w.cjs → quadrantDiagram-ABIIQ3AL-BnIKvRMS.cjs} +1 -1
- package/dist/{quadrantDiagram-ABIIQ3AL-D9WiLVW4.js → quadrantDiagram-ABIIQ3AL-DimV94Rb.js} +45 -45
- package/dist/{railroadDiagram-RFXS5EU6-DqqU0Jzd.js → railroadDiagram-RFXS5EU6-CO_q8JT9.js} +3 -3
- package/dist/{railroadDiagram-RFXS5EU6-Bh7sCsCx.cjs → railroadDiagram-RFXS5EU6-D7cUshy0.cjs} +1 -1
- package/dist/{requirementDiagram-TGXJPOKE-BoMZfE4l.js → requirementDiagram-TGXJPOKE-Ceitr12-.js} +3 -3
- package/dist/{requirementDiagram-TGXJPOKE-DAHoWz6v.cjs → requirementDiagram-TGXJPOKE-CjPsjAsx.cjs} +1 -1
- package/dist/{sankeyDiagram-HTMAVEWB-DEozFb2a.js → sankeyDiagram-HTMAVEWB-CAfuQjzU.js} +47 -47
- package/dist/{sankeyDiagram-HTMAVEWB-DwacVzcw.cjs → sankeyDiagram-HTMAVEWB-CQhx84em.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-3bp9kw3C.js → sequenceDiagram-DBY2YBRQ-BZ2yIdO6.js} +3 -3
- package/dist/{sequenceDiagram-DBY2YBRQ-BOF7BGz4.cjs → sequenceDiagram-DBY2YBRQ-Cr1VcoK2.cjs} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-Dxg1anpP.cjs → sizeCapture-X5ZJPWSS-B5X1945u.cjs} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-DI71KO2Z.js → sizeCapture-X5ZJPWSS-CA-VZP1J.js} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-BvJAkHvW.cjs → stateDiagram-2N3HPSRC-BeP4b2HS.cjs} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-CRtqzCvL.js → stateDiagram-2N3HPSRC-CbAk-IE5.js} +13 -13
- package/dist/{stateDiagram-v2-6OUMAXLB-ykYcMSNc.js → stateDiagram-v2-6OUMAXLB-C5uUx1aU.js} +2 -2
- package/dist/{stateDiagram-v2-6OUMAXLB-KiBzbGzx.cjs → stateDiagram-v2-6OUMAXLB-L_ypLgkx.cjs} +1 -1
- package/dist/styles/markdown.css +1 -1
- package/dist/styles/markdown.standalone.css +1 -1
- package/dist/{swimlanes-5IMT3BWC-ZT-jPiq7.js → swimlanes-5IMT3BWC-BOKZHjmn.js} +313 -313
- package/dist/{swimlanes-5IMT3BWC-D_bRoBJj.cjs → swimlanes-5IMT3BWC-DGpEXqaM.cjs} +1 -1
- package/dist/{swimlanesDiagram-G3AALYLV-TRdFQTHr.js → swimlanesDiagram-G3AALYLV-BG07hh3H.js} +2 -2
- package/dist/{swimlanesDiagram-G3AALYLV-DfmI7K4T.cjs → swimlanesDiagram-G3AALYLV-DqChJVS9.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-zQVxGI0F.js → timeline-definition-FHXFAJF6-Ct3xWe_j.js} +40 -40
- package/dist/{timeline-definition-FHXFAJF6-1LlewnX0.cjs → timeline-definition-FHXFAJF6-O0HVNX0c.cjs} +1 -1
- package/dist/{vennDiagram-L72KCM5P-Zx_75FNg.cjs → vennDiagram-L72KCM5P-BqOqbGRA.cjs} +1 -1
- package/dist/{vennDiagram-L72KCM5P-DsfKtIWC.js → vennDiagram-L72KCM5P-DCY6NWkD.js} +124 -124
- package/dist/{wardleyDiagram-EHGQE667-D11yaIHG.cjs → wardleyDiagram-EHGQE667-B2Civob5.cjs} +1 -1
- package/dist/{wardleyDiagram-EHGQE667-DfKCyD8F.js → wardleyDiagram-EHGQE667-CYStGsZi.js} +25 -25
- package/dist/{xychartDiagram-FW5EYKEG-CDJtv7Wv.js → xychartDiagram-FW5EYKEG-BifGB5it.js} +40 -40
- package/dist/{xychartDiagram-FW5EYKEG-uuIDwc70.cjs → xychartDiagram-FW5EYKEG-C4GuhADi.cjs} +1 -1
- package/package.json +16 -7
- package/dist/arc-R4utbJ-t.js +0 -83
- package/dist/extractHeadings-CqbucFeq.cjs +0 -311
- package/dist/flowDiagram-23GEKE2U-BUEdVRzZ.cjs +0 -1
- package/dist/flowDiagram-23GEKE2U-D34IusSc.js +0 -7
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use strict";var zx=Object.create;var Fh=Object.defineProperty;var jx=Object.getOwnPropertyDescriptor;var Wx=Object.getOwnPropertyNames;var Hx=Object.getPrototypeOf,Yx=Object.prototype.hasOwnProperty;var Ux=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Wx(t))!Yx.call(e,s)&&s!==r&&Fh(e,s,{get:()=>t[s],enumerable:!(i=jx(t,s))||i.enumerable});return e};var Ah=(e,t,r)=>(r=e!=null?zx(Hx(e)):{},Ux(t||!e||!e.__esModule?Fh(r,"default",{value:e,enumerable:!0}):r,e));const E=require("react"),ze=require("./linkCards-Bjd_vW39.cjs"),Mr=require("./providers-DO2t7ks4.cjs"),Di=require("./viewer-settings.cjs"),Tt=require("html-react-parser"),_i=require("./code-blocks.cjs"),dr=require("./embeds.cjs"),us=require("./source-lines.cjs"),rn=require("./simple-logger-9yf7ypyB.cjs"),Xx=require("shiki"),mi=require("dompurify"),go=require("@aiquants/spreadsheet/tsv"),Vr=require("@aiquants/spreadsheet/view"),Gx=require("github-slugger"),Vx=require("katex"),xe=require("unist-util-visit"),Go=(e,t)=>{const r={};for(const i of Object.keys(e)){const s=t?.[i];if(s===void 0){r[i]=e[i];continue}if(typeof s!="string")throw new TypeError(`[@aiquants/markdown] label "${i}" must be a string; got ${s===null?"null":typeof s}`);r[i]={text:s,lang:void 0}}return Object.freeze(r)},dl=e=>{const t={};for(const r of Object.keys(e))t[r]=e[r].text;return Object.freeze(t)},Vo=Object.freeze({embeddedVideo:{text:"embedded video",lang:"en"},embeddedPost:{text:"embedded post",lang:"en"},embeddedFrame:{text:"Embedded content",lang:"en"}}),Zx=dl(Vo),Fd=e=>Go(Vo,e),Kx=Fd(void 0);function Ad(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Is={exports:{}},Ni={};var Mh;function Qx(){if(Mh)return Ni;Mh=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,s,o){var a=null;if(o!==void 0&&(a=""+o),s.key!==void 0&&(a=""+s.key),"key"in s){o={};for(var n in s)n!=="key"&&(o[n]=s[n])}else o=s;return s=o.ref,{$$typeof:e,type:i,key:a,ref:s!==void 0?s:null,props:o}}return Ni.Fragment=t,Ni.jsx=r,Ni.jsxs=r,Ni}var qi={};var $h;function Jx(){return $h||($h=1,process.env.NODE_ENV!=="production"&&(function(){function e(L){if(L==null)return null;if(typeof L=="function")return L.$$typeof===R?null:L.displayName||L.name||null;if(typeof L=="string")return L;switch(L){case y:return"Fragment";case C:return"Profiler";case x:return"StrictMode";case _:return"Suspense";case B:return"SuspenseList";case O:return"Activity"}if(typeof L=="object")switch(typeof L.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),L.$$typeof){case m:return"Portal";case v:return L.displayName||"Context";case k:return(L._context.displayName||"Context")+".Consumer";case S:var X=L.render;return L=L.displayName,L||(L=X.displayName||X.name||"",L=L!==""?"ForwardRef("+L+")":"ForwardRef"),L;case T:return X=L.displayName||null,X!==null?X:e(L.type)||"Memo";case D:X=L._payload,L=L._init;try{return e(L(X))}catch{}}return null}function t(L){return""+L}function r(L){try{t(L);var X=!1}catch{X=!0}if(X){X=console;var U=X.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&L[Symbol.toStringTag]||L.constructor.name||"Object";return U.call(X,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),t(L)}}function i(L){if(L===y)return"<>";if(typeof L=="object"&&L!==null&&L.$$typeof===D)return"<...>";try{var X=e(L);return X?"<"+X+">":"<...>"}catch{return"<...>"}}function s(){var L=H.A;return L===null?null:L.getOwner()}function o(){return Error("react-stack-top-frame")}function a(L){if(Y.call(L,"key")){var X=Object.getOwnPropertyDescriptor(L,"key").get;if(X&&X.isReactWarning)return!1}return L.key!==void 0}function n(L,X){function U(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",X))}U.isReactWarning=!0,Object.defineProperty(L,"key",{get:U,configurable:!0})}function l(){var L=e(this.type);return z[L]||(z[L]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),L=this.props.ref,L!==void 0?L:null}function c(L,X,U,G,q,K){var Z=U.ref;return L={$$typeof:p,type:L,key:X,props:U,_owner:G},(Z!==void 0?Z:null)!==null?Object.defineProperty(L,"ref",{enumerable:!1,get:l}):Object.defineProperty(L,"ref",{enumerable:!1,value:null}),L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(L,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(L,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(L,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L}function h(L,X,U,G,q,K){var Z=X.children;if(Z!==void 0)if(G)if(P(Z)){for(G=0;G<Z.length;G++)d(Z[G]);Object.freeze&&Object.freeze(Z)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(Z);if(Y.call(X,"key")){Z=e(L);var J=Object.keys(X).filter(function(ut){return ut!=="key"});G=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",N[Z+G]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,G,Z,J,Z),N[Z+G]=!0)}if(Z=null,U!==void 0&&(r(U),Z=""+U),a(X)&&(r(X.key),Z=""+X.key),"key"in X){U={};for(var dt in X)dt!=="key"&&(U[dt]=X[dt])}else U=X;return Z&&n(U,typeof L=="function"?L.displayName||L.name||"Unknown":L),c(L,Z,U,s(),q,K)}function d(L){f(L)?L._store&&(L._store.validated=1):typeof L=="object"&&L!==null&&L.$$typeof===D&&(L._payload.status==="fulfilled"?f(L._payload.value)&&L._payload.value._store&&(L._payload.value._store.validated=1):L._store&&(L._store.validated=1))}function f(L){return typeof L=="object"&&L!==null&&L.$$typeof===p}var u=E,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),v=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),R=Symbol.for("react.client.reference"),H=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,P=Array.isArray,A=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(L){return L()}};var $,z={},I=u.react_stack_bottom_frame.bind(u,o)(),M=A(i(o)),N={};qi.Fragment=y,qi.jsx=function(L,X,U){var G=1e4>H.recentlyCreatedOwnerStacks++;return h(L,X,U,!1,G?Error("react-stack-top-frame"):I,G?A(i(L)):M)},qi.jsxs=function(L,X,U){var G=1e4>H.recentlyCreatedOwnerStacks++;return h(L,X,U,!0,G?Error("react-stack-top-frame"):I,G?A(i(L)):M)}})()),qi}var Oh;function tC(){return Oh||(Oh=1,process.env.NODE_ENV==="production"?Is.exports=Qx():Is.exports=Jx()),Is.exports}var w=tC();const Rh=Object.freeze({display:"flex",flexDirection:"row",inlineSize:"100%",blockSize:"100%",minInlineSize:0,minBlockSize:0}),eC=Object.freeze({flex:"1 1 0%",minInlineSize:0,minBlockSize:0,overflow:"clip"}),rC=Object.freeze({display:"flex",flex:"none",minBlockSize:0}),iC=Object.freeze({position:"absolute",insetBlock:0,insetInline:0,overflowY:"scroll",visibility:"hidden",pointerEvents:"none"}),sC=Object.freeze({scrollbarWidth:"none"}),oC=.01,Ih=Object.freeze({scroller:null,barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1}),Ta=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},aC=(e,t,r)=>{const i=getComputedStyle(e),s=Ta(i.width),o=e.getBoundingClientRect();if(s<=0||o.width<=0)return{barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1};const a=o.width/s,n=(o.width-t.getBoundingClientRect().width)/a-Ta(i.borderLeftWidth)-Ta(i.borderRightWidth),l=Math.max(0,Math.ceil(n-oC));return{barInlineSize:r.getBoundingClientRect().width/a,nativeBarInlineSize:l,overlaysScrollbars:l===0&&t.offsetWidth>0&&t.offsetWidth===t.clientWidth}},nC=(e,t,r,i,s)=>{const[o,a]=E.useState(Ih),n=E.useRef(s),l=E.useRef(0);return E.useLayoutEffect(()=>{n.current=s}),E.useLayoutEffect(()=>{const c=m=>{l.current!==m&&(l.current=m,n.current?.(m))},h=t.current,d=r.current,f=i.current;if(!e||h===null||d===null||f===null){a(Ih),c(0);return}const u=()=>{const{barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x}=aC(h,d,f);a(C=>C.scroller===h&&C.barInlineSize===m&&C.nativeBarInlineSize===y&&C.overlaysScrollbars===x?C:Object.freeze({scroller:h,barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x})),c(m)};u();const p=new ResizeObserver(u);return p.observe(h),p.observe(d),p.observe(f),window.addEventListener("resize",u),()=>{p.disconnect(),window.removeEventListener("resize",u)}},[e,t,r,i]),o},lC=(e,t)=>{if(typeof e=="function"){const r=e(t);return typeof r=="function"?r:()=>e(null)}return e!=null?(e.current=t,()=>{e.current=null}):()=>{}};function Md({scrollerProps:e,scrollerRef:t,children:r,renderScrollBar:i,rowClassName:s,rowStyle:o,onBarInlineSizeChange:a}){const n=E.useRef(null),l=E.useRef(null),c=E.useRef(null),h=i!==void 0,d=nC(h,n,l,c,a),f=E.useCallback(m=>{n.current=m;const y=lC(t,m);return()=>{n.current=null,y()}},[t]),u=h?{...e.style,position:"relative",boxSizing:"border-box",overflowY:"scroll",width:`calc(100% + ${d.nativeBarInlineSize}px)`,...d.overlaysScrollbars?sC:void 0}:e.style,p=w.jsxs("div",{...e,ref:f,style:u,children:[r,h&&w.jsx("span",{ref:l,"data-aqmd-scroll-bar-probe":!0,"aria-hidden":"true",style:iC})]});return h?w.jsxs("div",{"data-aqmd-scroll-row":!0,className:s,style:o===void 0?Rh:{...Rh,...o},children:[w.jsx("div",{"data-aqmd-scroll-clip":!0,style:eC,children:p}),w.jsx("div",{ref:c,"data-aqmd-scroll-bar":!0,style:rC,children:d.scroller!==null&&i(d.scroller)})]}):p}const hC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),Ph=e=>{const t=cC(e);return t.charAt(0).toUpperCase()+t.slice(1)},$d=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim(),dC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var uC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const fC=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:s="",children:o,iconNode:a,...n},l)=>E.createElement("svg",{ref:l,...uC,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:$d("lucide",s),...!o&&!dC(n)&&{"aria-hidden":"true"},...n},[...a.map(([c,h])=>E.createElement(c,h)),...Array.isArray(o)?o:[o]]));const Lt=(e,t)=>{const r=E.forwardRef(({className:i,...s},o)=>E.createElement(fC,{ref:o,iconNode:t,className:$d(`lucide-${hC(Ph(e))}`,`lucide-${e}`,i),...s}));return r.displayName=Ph(e),r};const gC=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],pC=Lt("image-off",gC);const mC=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],yC=Lt("building-2",mC);const xC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Dh=Lt("globe",xC),CC=/^[a-z]{2,3}$/u,bC=e=>{const t=e.trim().split("-",1)[0]?.toLowerCase()??"";return CC.test(t)?t:null},kC=()=>()=>{},wC=e=>{const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>t.disconnect()},ul=()=>E.useSyncExternalStore(kC,()=>window.location.origin,()=>null),SC=()=>E.useSyncExternalStore(wC,()=>bC(document.documentElement.lang),()=>null),vC=/^[1-9]\d{0,4}$/u,Nh=e=>e!==void 0&&vC.test(e.trim())?Number(e.trim()):null,TC=({embed:e,label:t,insideAnchor:r,children:i})=>{const s=ul(),o=new URL(e.src);if(s!==null&&o.origin!==s&&!r)return i;const a=Nh(e.attributes.width),n=Nh(e.attributes.height),l=a!==null&&n!==null?{width:"100%",maxWidth:`${a}px`,aspectRatio:`${a} / ${n}`}:void 0,c=e.attributes.title,h=c===void 0?t.lang:void 0;return w.jsx("span",{"data-embed-frame":s===null?"pending":"refused","data-aqmd-embed-surface":l===void 0?void 0:"",style:l,className:l===void 0?void 0:"flex items-center justify-center rounded-lg p-2 text-center",children:r?w.jsx("span",{lang:h,children:`${c??t.text}: ${o.hostname}`}):w.jsx("a",{href:o.href,target:"_blank",rel:"noreferrer",lang:h,children:c??`${t.text}: ${o.hostname}`})})},Od=({concurrency:e,capacity:t,timeoutMs:r})=>{for(const[h,d]of Object.entries({concurrency:e,capacity:t,timeoutMs:r}))if(!Number.isInteger(d)||d<=0)throw new RangeError(`[@aiquants/markdown] request queue ${h} must be a positive integer; got ${String(d)}`);const i=new Map,s=new Map,o=[];let a=0;const n=(h,d,f)=>{if(s.get(h)===d&&(s.delete(h),f!==null)){i.set(h,f);for(const u of i.keys()){if(i.size<=t)break;i.delete(u)}for(const u of d.subscriptions)u.listener(f)}},l=()=>{for(;a<e;){const h=o.shift();if(h===void 0)return;const d=s.get(h);if(d===void 0)continue;const f=new AbortController;d.controller=f,a+=1,new Promise(u=>u(d.start(AbortSignal.any([f.signal,AbortSignal.timeout(r)])))).then(u=>n(h,d,{ok:!0,value:u}),()=>n(h,d,f.signal.aborted?null:{ok:!1})).finally(()=>{a-=1,l()})}};return Object.freeze({subscribe:(h,d,f)=>{const u=i.get(h);if(u!==void 0)return i.delete(h),i.set(h,u),f(u),()=>{};let p=s.get(h);p===void 0&&(p={start:d,subscriptions:new Set,controller:null},s.set(h,p),o.push(h));const m=p,y={listener:f};return m.subscriptions.add(y),l(),()=>{m.subscriptions.delete(y),!(m.subscriptions.size>0||s.get(h)!==m)&&(s.delete(h),m.controller===null?o.splice(o.indexOf(h),1):m.controller.abort())}}})},_C=Od({concurrency:2,capacity:256,timeoutMs:15e3}),BC="[data-aqmd-scroll-container]",LC=async(e,t)=>{let r;try{r=await fetch(e,{credentials:"same-origin",redirect:"error",headers:{accept:"application/json"},signal:t})}catch(o){if(t.aborted)throw o;return{kind:"error",cause:"network error"}}if(r.status===204){const o=ze.linkCardSkipReasonOf(r.headers.get(ze.LINK_CARD_SKIP_HEADER));return o===null?{kind:"error",cause:"HTTP 204 without a known skip reason"}:{kind:"skip",reason:o}}if(!r.ok)return{kind:"error",cause:`HTTP ${r.status}`};let i;try{i=await r.json()}catch(o){if(t.aborted)throw o;return{kind:"error",cause:`HTTP ${r.status}, not JSON`}}const s=ze.linkCardMetadataOf(i);return s===null?{kind:"error",cause:`HTTP ${r.status}, not a JSON object`}:{kind:"card",metadata:s}},EC=e=>e.ok?e.value.kind==="card"?null:e.value.kind==="skip"?e.value.reason:e.value.cause:"network error",qh=(e,t)=>e!==null&&new URL(e).hostname!==t?e:null,_a=({tile:e,tileKind:t,primary:r,secondary:i})=>w.jsxs("span",{className:"flex min-w-0 flex-auto items-center gap-3 px-3",children:[w.jsx("span",{"aria-hidden":"true","data-link-card-icon":t,className:`flex size-8 shrink-0 items-center justify-center rounded-md bg-(--aqmd-link-card-bg-hover) text-(--aqmd-link-card-muted) ${t==="pending"?"motion-safe:animate-pulse":""}`,children:e}),w.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[w.jsx("span",{className:"truncate font-semibold text-[0.875rem] leading-5",children:r}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:i})]})]}),FC=({href:e,endpoint:t,size:r,fallback:i})=>{const s=ul(),o=E.useRef(null),a=new URL(e),n=`${t}
|
|
7
|
+
${a.href}`,[l,c]=E.useState(null);E.useEffect(()=>{const x=o.current;if(x===null||s===null)return;let C=null;const k=new IntersectionObserver(v=>{C!==null||!v.some(S=>S.isIntersecting)||(k.disconnect(),C=_C.subscribe(n,S=>LC(ze.linkCardRequestOf(t,new URL(e),s),S),S=>{c({key:n,outcome:S});const _=EC(S);_!==null&&rn.linkCardLogger.info(`No link card for ${e} (${_})`)}))},{root:x.closest(BC),rootMargin:"100% 0px"});return k.observe(x),()=>{k.disconnect(),C?.()}},[n,t,e,s]);const h=l!==null&&l.key===n?l.outcome:null;if(h!==null&&!h.ok)return i;const d=h===null?null:h.value;if(d!==null&&d.kind==="error")return i;if(d===null||s===null)return w.jsx("a",{ref:o,href:e,target:"_blank",rel:"noreferrer","aria-busy":"true","data-link-card":"pending","data-link-card-size":r,children:r==="compact"?w.jsx(_a,{tile:null,tileKind:"pending",primary:a.hostname,secondary:e}):w.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-2 px-4 py-3.5",children:[w.jsx("span",{"aria-hidden":"true",className:"block h-3.5 w-2/3 rounded bg-(--aqmd-link-card-border) motion-safe:animate-pulse"}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem]",children:a.hostname}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:e})]})});if(d.kind==="skip"){const{reason:x}=d,C=x==="private-network",k=C?yC:Dh;return w.jsx("a",{ref:o,href:e,target:"_blank",rel:"noreferrer","data-link-card":"compact","data-link-card-reason":x,"data-link-card-size":"compact",children:w.jsx(_a,{tile:w.jsx(k,{"aria-hidden":"true",className:"size-4"}),tileKind:C?"internal":"link",primary:a.hostname,secondary:e})})}const{metadata:f}=d,u=new URL(s).hostname,p=qh(f.image,u),m=qh(f.icon,u),y=f.siteName===null?a.hostname:`${f.siteName} · ${a.hostname}`;return r==="compact"?w.jsx("a",{ref:o,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":"compact",children:w.jsx(_a,{tile:m===null?w.jsx(Dh,{"aria-hidden":"true",className:"size-4"}):w.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 rounded-[3px]"}),tileKind:m===null?"link":"favicon",primary:f.title??e,secondary:y})}):w.jsxs("a",{ref:o,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":r,children:[w.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1 px-4 py-3.5",children:[w.jsx("span",{className:"wrap-anywhere line-clamp-2 font-semibold text-[0.9375rem] leading-5",children:f.title??e}),f.description===null?null:w.jsx("span",{className:`wrap-anywhere text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem] ${r==="banner"?"line-clamp-1":"line-clamp-2"}`,children:f.description}),w.jsxs("span",{className:"mt-1 flex items-center gap-1.5 text-(--aqmd-link-card-muted) text-xs leading-4",children:[m===null?null:w.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 shrink-0 rounded-[3px]"}),w.jsx("span",{className:"truncate",children:y})]})]}),p===null?null:w.jsx("img",{src:p,alt:"",loading:"lazy",referrerPolicy:"no-referrer"})]})},Rd=e=>{if(!Array.isArray(e.providers))throw new RangeError(`[@aiquants/markdown] embeds.providers must be an array of provider ids; got ${typeof e.providers}`);for(const t of e.providers)if(!Mr.isEmbedProviderId(t))throw new RangeError(`[@aiquants/markdown] embeds.providers holds an unknown provider id ${JSON.stringify(t)}; known ids are ${Mr.EMBED_PROVIDER_IDS.join(", ")}`);if(e.linkCardEndpoint!==null&&!ze.isLinkCardEndpoint(e.linkCardEndpoint))throw new RangeError(`[@aiquants/markdown] embeds.linkCardEndpoint must be null or an absolute path without a trailing "/" (segments of A-Z a-z 0-9 . _ ~ -, no "." or ".."); got ${JSON.stringify(e.linkCardEndpoint)}`);if(e.linkCardSize!==void 0&&!ze.isLinkCardSize(e.linkCardSize))throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${ze.LINK_CARD_SIZES.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);return e},Zi=new WeakMap;let Ps=0;const zh=e=>{if(e.source===null)return;const t=Zi.get(e.source);if(t===void 0||e.origin!==t.watch.origin)return;const r=t.watch.heightOf(e.data,t.watch.src);if(r===null||!Number.isFinite(r))return;const i=Math.min(Mr.EMBED_FRAME_HEIGHT_LIMITS.max,Math.max(Mr.EMBED_FRAME_HEIGHT_LIMITS.min,Math.ceil(r)));i!==t.last&&(t.last=i,t.watch.set(i))},AC=(e,t)=>{const r={watch:t,last:null};return Zi.has(e)||(Ps+=1,Ps===1&&window.addEventListener("message",zh)),Zi.set(e,r),()=>{Zi.get(e)===r&&(Zi.delete(e),Ps-=1,Ps===0&&window.removeEventListener("message",zh))}},MC=Od({concurrency:2,capacity:256,timeoutMs:5e3}),$C=async(e,t)=>{const r=await fetch(e,{credentials:"omit",redirect:"error",referrerPolicy:"no-referrer",headers:{accept:"application/json"},signal:t});if(!r.ok)throw new Error(`[@aiquants/markdown] embed lookup answered ${r.status}`);return await r.json()},OC=(e,t)=>{const r=e.maxWidth===null?void 0:`${e.maxWidth}px`;switch(e.kind){case"aspect":return{width:"100%",maxWidth:r,aspectRatio:`${e.ratio[0]} / ${e.ratio[1]}`};case"fixed":return{width:"100%",maxWidth:r,height:`${e.height}px`};case"message":return{width:"100%",maxWidth:r,height:`${t??e.initialHeight}px`}}},RC=Object.freeze({marginInline:0}),Ba=Object.freeze({kind:"pending"}),IC=Object.freeze({kind:"narrow"}),PC=Object.freeze({kind:"fallback"}),DC=(e,t,r,i,s)=>{if(t===null)return Ba;let o;if(e.kind==="frame")o=e.srcOf(r);else{if(i===null)return Ba;o=i.ok?e.srcOf(i.value,r):null}if(o===null||new URL(o).origin===t)return PC;const{minWidth:a,maxWidth:n}=e.layout;if(a!==null){if(s===null)return Ba;if(Math.min(s,n??Number.POSITIVE_INFINITY)<a)return IC}return{kind:"frame",src:o}},NC=({resolution:e,caption:t,fallback:r,theme:i,labels:s})=>{const o=ul(),a=SC(),[n,l]=E.useState(null),[c,h]=E.useState(null),d=e.kind==="lookup"?e.request.href:null,[f,u]=E.useState(null);E.useEffect(()=>{if(d!==null)return MC.subscribe(d,T=>$C(new URL(d),T),T=>u({key:d,outcome:T}))},[d]);const{provider:p,layout:m}=e,y=DC(e,o,{theme:i,lang:a},f!==null&&f.key===d?f.outcome:null,n),x=E.useCallback(T=>{if(T===null)return;l(T.getBoundingClientRect().width);const D=new ResizeObserver(()=>l(T.getBoundingClientRect().width));return D.observe(T),()=>D.disconnect()},[]),C=y.kind==="frame"?y.src:null,k=c!==null&&c.src===C?c.height:null,v=E.useCallback(T=>{if(!(T===null||T.contentWindow===null||m.kind!=="message"||C===null))return AC(T.contentWindow,{origin:p.frameOrigin,src:C,heightOf:m.heightOf,set:D=>h({src:C,height:D})})},[m,p.frameOrigin,C]);if(y.kind==="fallback")return r;const S=m.minWidth===null?null:w.jsx("span",{ref:x,"aria-hidden":"true","data-embed-measure":p.id,className:"block h-0"});if(y.kind==="narrow")return w.jsxs(w.Fragment,{children:[S,r]});const _=p.content==="video"?s.embeddedVideo:s.embeddedPost,{frame:B}=p;return w.jsxs(w.Fragment,{children:[S,w.jsxs("figure",{"data-embed-provider":p.id,"data-embed-state":y.kind,style:RC,children:[w.jsx("div",{"data-embed-box":"","data-aqmd-embed-surface":"",style:OC(m,k),className:"noscript:hidden overflow-hidden rounded-lg",children:y.kind==="frame"?w.jsx("iframe",{ref:v,src:y.src,title:`${p.name}: ${_.text}`,lang:_.lang,loading:"lazy",allow:B.allow??void 0,allowFullScreen:B.allowFullScreen,sandbox:B.sandbox,referrerPolicy:B.referrerPolicy,scrolling:B.scrolling??void 0,className:"block h-full w-full border-0"},y.src):null}),w.jsx("figcaption",{className:"mt-2",children:t})]})]})},qC=["title","width","height","allow","allowfullscreen","sandbox","referrerpolicy","loading","frameborder","scrolling"],zC=(e,t)=>dr.allowedFrameUrlOf(e,t)!==null,jC=(e,t)=>{const r=new Map(Object.entries(e).map(([o,a])=>[o.toLowerCase(),a])),i=dr.allowedFrameUrlOf(r.get("src"),t);if(i===null)return null;const s={};for(const o of qC){const a=r.get(o);if(a!==void 0)if(o==="allow"){const n=dr.reduceFrameFeatures(a);n!==null&&(s.allow=n)}else if(o==="referrerpolicy"){const n=a.trim().toLowerCase();dr.EMBED_FRAME_REFERRER_POLICIES.has(n)&&(s.referrerpolicy=n)}else s[o]=a}return Object.freeze({src:i.href,attributes:Object.freeze(s)})},WC=new Set(["script","style","template","noscript","noembed","noframes","plaintext","xmp","title","head","meta","link","base","object","embed","applet","param","frame","frameset","select","datalist","track","math","foreignobject"]),HC=new Set(["id","class","title","lang","dir","role","hidden","translate","style"]),YC=new Set(["markdown-alert","markdown-alert-title","markdown-alert-note","markdown-alert-tip","markdown-alert-important","markdown-alert-warning","markdown-alert-caution","octicon","octicon-info","octicon-light-bulb","octicon-report","octicon-alert","octicon-stop","mr-2","message","message-symbol","message-content","alert","info","warning","markdown-details","markdown-details-content","footnotes","footnote-ref","footnote-backref","math","inline","display"]),jh="language-",UC=/[\t\n\f\r ]+/u,XC=new Set(["h1","h2","h3","h4","h5","h6"]),Wh=Object.freeze({sup:/^fnref\d*:\d+$/u,li:/^fn:\d+$/u}),Hh="user-content-",Vt=["align"],Wr=["width","height"],Yh=["colspan","rowspan","headers","scope","abbr","align","valign","width","height"],La=Object.freeze({a:["href","name","hreflang","data-link-kind","data-doc-path","data-doc-exists","data-footnote-ref","data-footnote-backref"],abbr:[],address:[],article:[],aside:[],audio:["src","controls","loop","muted","preload"],b:[],bdi:[],bdo:[],blockquote:["cite"],br:[],caption:Vt,cite:[],code:[_i.CODE_META_ATTRIBUTE],col:["span",...Vt,...Wr],colgroup:["span",...Vt,...Wr],dd:[],del:["cite","datetime"],details:["open"],dfn:[],div:Vt,dl:[],dt:[],em:[],figcaption:[],figure:[],footer:[],h1:Vt,h2:Vt,h3:Vt,h4:Vt,h5:Vt,h6:Vt,header:[],hgroup:[],hr:[],i:[],img:["src","alt","loading","decoding",...Vt,...Wr,"data-asset-src","data-asset-exists"],ins:["cite","datetime"],kbd:[],li:["value"],main:[],mark:[],nav:[],ol:["start","reversed","type"],p:Vt,pre:[],q:["cite"],rp:[],rt:[],ruby:[],s:[],samp:[],section:["data-footnotes"],small:[],source:["src","type"],span:[],strong:[],sub:[],summary:[],sup:[],table:[...Vt,"border",...Wr],tbody:[...Vt,"valign"],td:Yh,tfoot:[...Vt,"valign"],th:Yh,thead:[...Vt,"valign"],time:["datetime"],tr:[...Vt,"valign"],u:[],ul:[],var:[],video:["src","poster","controls","loop","muted","playsinline","preload",...Wr],wbr:[]}),Ea=Object.freeze({svg:["viewbox","version","xmlns","focusable","fill",...Wr],g:["fill","fill-rule","clip-rule"],path:["d","fill","fill-rule","clip-rule"]}),GC=new Set(["svg","g"]),VC=new Set(["href","src","cite","poster",dr.EMBED_LINK_ATTRIBUTE]),ZC=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu,KC=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,QC=new Set(["left","right","center","justify","start","end"]),_s=e=>KC.test(e.replace(ZC,"")),JC=e=>{let t=null;for(const r of e.split(";")){const i=r.indexOf(":");if(i<0||r.slice(0,i).trim().toLowerCase()!=="text-align")continue;const s=r.slice(i+1).trim().toLowerCase();QC.has(s)&&(t=s)}return t===null?null:`text-align: ${t}`},tb=e=>{const t=e.split(UC).filter(r=>YC.has(r)||r.startsWith(jh)&&r.length>jh.length);return t.length===0?null:t.join(" ")},eb=(e,t)=>XC.has(e)||t.startsWith(Hh)&&t.length>Hh.length||Object.hasOwn(Wh,e)&&Wh[e].test(t),rb=e=>{const t=new Map;for(const[r,i]of Object.entries(e)){const s=r.toLowerCase();t.has(s)||t.set(s,i)}return t},zi=(e,t,r)=>{const i={};for(const[s,o]of t){if(s===us.SOURCE_LINES_ATTRIBUTE){us.parseSourceLines(o)!==null&&(i[s]=o);continue}if((HC.has(s)||r.includes(s)||s.startsWith("aria-")&&s.length>5)&&!(VC.has(s)&&!_s(o))&&!(s==="fill"&&/url\s*\(/iu.test(o))&&!(s==="id"&&!eb(e,o))){if(s==="class"||s==="style"){const a=s==="class"?tb(o):JC(o);a!==null&&(i[s]=a);continue}i[s]=o}}return i},ib=e=>e.get("type")?.trim().toLowerCase()==="checkbox"&&e.has("disabled"),fl=(e,t,r)=>{const i=e.toLowerCase(),s=r.parentName===null?null:r.parentName.toLowerCase(),o=rb(t);if(s!==null&&GC.has(s)){const n=i!=="svg"&&Object.hasOwn(Ea,i)?Ea[i]:void 0;return n===void 0?{action:"remove"}:{action:"keep",attributes:zi(i,o,n)}}if(i==="svg")return{action:"keep",attributes:zi(i,o,Ea.svg)};if(i==="iframe"){const n=jC(Object.fromEntries(o),r.iFrameAllowedDomains);return n===null?{action:"remove"}:{action:"embed",embed:n,pluginType:o.get("data-plugin-type")??null}}if(i==="p"){const n=zi(i,o,La.p),l=o.get(dr.EMBED_LINK_ATTRIBUTE);return l!==void 0&&_s(l)?{action:"placeholder",attributes:n,link:l}:{action:"keep",attributes:n}}if(i==="input")return ib(o)?{action:"keep",attributes:zi(i,o,["type","checked","disabled"])}:{action:"remove"};if(WC.has(i))return{action:"remove"};const a=Object.hasOwn(La,i)?La[i]:void 0;return a===void 0?{action:"unwrap"}:{action:"keep",attributes:zi(i,o,a)}};typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(t,r){r=r||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,r.bubbles,r.cancelable,r.detail),i}));const sb=typeof document<"u"&&!!document.documentMode;let Fa;function ob(){return Fa||(Fa=document.createElement("div").style)}const Uh=["webkit","moz","ms"],Ds={};function gl(e){if(Ds[e])return Ds[e];const t=ob();if(e in t)return Ds[e]=e;const r=e[0].toUpperCase()+e.slice(1);let i=Uh.length;for(;i--;){const s=`${Uh[i]}${r}`;if(s in t)return Ds[e]=s}}function Ns(e,t){return parseFloat(t[gl(e)])||0}function qs(e,t,r=window.getComputedStyle(e)){const i=t==="border"?"Width":"";return{left:Ns(`${t}Left${i}`,r),right:Ns(`${t}Right${i}`,r),top:Ns(`${t}Top${i}`,r),bottom:Ns(`${t}Bottom${i}`,r)}}function Zr(e,t,r){e.style[gl(t)]=r}function ab(e,t){const r=gl("transform");Zr(e,"transition",`${r} ${t.duration}ms ${t.easing}`)}function nb(e,{x:t,y:r,scale:i,isSVG:s},o){if(Zr(e,"transform",`scale(${i}) translate(${t}px, ${r}px)`),s&&sb){const a=window.getComputedStyle(e).getPropertyValue("transform");e.setAttribute("transform",a)}}function Aa(e){let t=e.parentNode;(!t||t.nodeType!==1)&&(t=document.documentElement);const r=window.getComputedStyle(e),i=window.getComputedStyle(t),s=e.getBoundingClientRect(),o=t.getBoundingClientRect();return{elem:{style:r,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,margin:qs(e,"margin",r),border:qs(e,"border",r)},parent:{style:i,width:o.width,height:o.height,top:o.top,bottom:o.bottom,left:o.left,right:o.right,padding:qs(t,"padding",i),border:qs(t,"border",i)}}}let fs={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?fs={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(fs={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function Ma(e,t,r,i){fs[e].split(" ").forEach(s=>{t.addEventListener(s,r,i)})}function $a(e,t,r){fs[e].split(" ").forEach(i=>{t.removeEventListener(i,r)})}function Id(e,t){let r=e.length;for(;r--;)if(e[r].pointerId===t.pointerId)return r;return-1}function sn(e,t){let r;if(t.touches){r=0;for(const i of t.touches)i.pointerId=r++,sn(e,i);return}r=Id(e,t),r>-1&&e.splice(r,1),e.push(t)}function lb(e,t){if(t.touches){for(;e.length;)e.pop();return}const r=Id(e,t);r>-1&&e.splice(r,1)}function Xh(e){e=e.slice(0);let t=e.pop(),r;for(;r=e.pop();)t={clientX:(r.clientX-t.clientX)/2+t.clientX,clientY:(r.clientY-t.clientY)/2+t.clientY};return t}function Oa(e){if(e.length<2)return 0;const t=e[0],r=e[1];return Math.sqrt(Math.pow(Math.abs(r.clientX-t.clientX),2)+Math.pow(Math.abs(r.clientY-t.clientY),2))}function hb(e){let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1}function cb(e){return(e.getAttribute("class")||"").trim()}function db(e,t){return e.nodeType===1&&` ${cb(e)} `.indexOf(` ${t} `)>-1}function ub(e,t){for(let r=e;r!=null;r=r.parentNode)if(db(r,t.excludeClass)||t.exclude.indexOf(r)>-1)return!0;return!1}const fb=/^http:[\w\.\/]+svg$/;function gb(e){return fb.test(e.namespaceURI)&&e.nodeName.toLowerCase()!=="svg"}function pb(e){const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}const Pd={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:e=>{e.preventDefault(),e.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:nb,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function Dd(e,t){if(!e)throw new Error("Panzoom requires an element as an argument");if(e.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!hb(e))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t={...Pd,...t};const r=gb(e),i=e.parentNode;i.style.overflow=t.overflow,i.style.userSelect="none",i.style.touchAction=t.touchAction,(t.canvas?i:e).style.cursor=t.cursor,e.style.userSelect="none",e.style.touchAction=t.touchAction,Zr(e,"transformOrigin",typeof t.origin=="string"?t.origin:r?"0 0":"50% 50%");function s(){i.style.overflow="",i.style.userSelect="",i.style.touchAction="",i.style.cursor="",e.style.cursor="",e.style.userSelect="",e.style.touchAction="",Zr(e,"transformOrigin","")}function o(M={}){for(const N in M)M.hasOwnProperty(N)&&(t[N]=M[N]);(M.hasOwnProperty("cursor")||M.hasOwnProperty("canvas"))&&(i.style.cursor=e.style.cursor="",(t.canvas?i:e).style.cursor=t.cursor),M.hasOwnProperty("overflow")&&(i.style.overflow=M.overflow),M.hasOwnProperty("touchAction")&&(i.style.touchAction=M.touchAction,e.style.touchAction=M.touchAction)}let a=0,n=0,l=1,c=!1;m(t.startScale,{animate:!1,force:!0}),setTimeout(()=>{p(t.startX,t.startY,{animate:!1,force:!0})});function h(M,N,L){if(L.silent)return;const X=new CustomEvent(M,{detail:N});e.dispatchEvent(X)}function d(M,N,L){const X={x:a,y:n,scale:l,isSVG:r,originalEvent:L};return requestAnimationFrame(()=>{typeof N.animate=="boolean"&&(N.animate?ab(e,N):Zr(e,"transition","none")),N.setTransform(e,X,N),h(M,X,N),h("panzoomchange",X,N)}),X}function f(M,N,L,X){const U={...t,...X},G={x:a,y:n,opts:U};if(!X?.force&&(U.disablePan||U.panOnlyWhenZoomed&&l===U.startScale))return G;if(M=parseFloat(M),N=parseFloat(N),U.disableXAxis||(G.x=(U.relative?a:0)+M),U.disableYAxis||(G.y=(U.relative?n:0)+N),U.contain){const q=Aa(e),K=q.elem.width/l,Z=q.elem.height/l,J=K*L,dt=Z*L,ut=(J-K)/2,yt=(dt-Z)/2;if(U.contain==="inside"){const Et=(-q.elem.margin.left-q.parent.padding.left+ut)/L,It=(q.parent.width-J-q.parent.padding.left-q.elem.margin.left-q.parent.border.left-q.parent.border.right+ut)/L;G.x=Math.max(Math.min(G.x,It),Et);const Mt=(-q.elem.margin.top-q.parent.padding.top+yt)/L,$t=(q.parent.height-dt-q.parent.padding.top-q.elem.margin.top-q.parent.border.top-q.parent.border.bottom+yt)/L;G.y=Math.max(Math.min(G.y,$t),Mt)}else if(U.contain==="outside"){const Et=(-(J-q.parent.width)-q.parent.padding.left-q.parent.border.left-q.parent.border.right+ut)/L,It=(ut-q.parent.padding.left)/L;G.x=Math.max(Math.min(G.x,It),Et);const Mt=(-(dt-q.parent.height)-q.parent.padding.top-q.parent.border.top-q.parent.border.bottom+yt)/L,$t=(yt-q.parent.padding.top)/L;G.y=Math.max(Math.min(G.y,$t),Mt)}}return U.roundPixels&&(G.x=Math.round(G.x),G.y=Math.round(G.y)),G}function u(M,N){const L={...t,...N},X={scale:l,opts:L};if(!N?.force&&L.disableZoom)return X;let U=t.minScale,G=t.maxScale;if(L.contain){const q=Aa(e),K=q.elem.width/l,Z=q.elem.height/l;if(K>1&&Z>1){const J=q.parent.width-q.parent.border.left-q.parent.border.right,dt=q.parent.height-q.parent.border.top-q.parent.border.bottom,ut=J/K,yt=dt/Z;t.contain==="inside"?G=Math.min(G,ut,yt):t.contain==="outside"&&(U=Math.max(U,ut,yt))}}return X.scale=Math.min(Math.max(M,U),G),X}function p(M,N,L,X){const U=f(M,N,l,L);return a!==U.x||n!==U.y?(a=U.x,n=U.y,d("panzoompan",U.opts,X)):{x:a,y:n,scale:l,isSVG:r,originalEvent:X}}function m(M,N,L){const X=u(M,N),U=X.opts;if(!N?.force&&U.disableZoom)return;M=X.scale;let G=a,q=n;if(U.focal){const Z=U.focal;G=(Z.x/M-Z.x/l+a*M)/M,q=(Z.y/M-Z.y/l+n*M)/M}const K=f(G,q,M,{relative:!1,force:!0});return a=K.x,n=K.y,l=M,d("panzoomzoom",U,L)}function y(M,N){const L={...t,animate:!0,...N};return m(l*Math.exp((M?1:-1)*L.step),L)}function x(M){return y(!0,M)}function C(M){return y(!1,M)}function k(M,N,L,X){const U=Aa(e),G={width:U.parent.width-U.parent.padding.left-U.parent.padding.right-U.parent.border.left-U.parent.border.right,height:U.parent.height-U.parent.padding.top-U.parent.padding.bottom-U.parent.border.top-U.parent.border.bottom};let q=N.clientX-U.parent.left-U.parent.padding.left-U.parent.border.left-U.elem.margin.left,K=N.clientY-U.parent.top-U.parent.padding.top-U.parent.border.top-U.elem.margin.top;r||(q-=U.elem.width/l/2,K-=U.elem.height/l/2);const Z={x:q/G.width*(G.width*M),y:K/G.height*(G.height*M)};return m(M,{...L,animate:!1,focal:Z},X)}function v(M,N){M.preventDefault();const L={...t,...N,animate:!1},U=(M.deltaY===0&&M.deltaX?M.deltaX:M.deltaY)<0?1:-1,G=u(l*Math.exp(U*L.step/3),L).scale;return k(G,M,L,M)}function S(M){const N={...t,animate:!0,force:!0,...M};l=u(N.startScale,N).scale;const L=f(N.startX,N.startY,l,N);return a=L.x,n=L.y,d("panzoomreset",N)}let _,B,T,D,O,R;const H=[];function Y(M){if(ub(M.target,t))return;sn(H,M),c=!0,t.handleStartEvent(M),_=a,B=n,h("panzoomstart",{x:a,y:n,scale:l,isSVG:r,originalEvent:M},t);const N=Xh(H);T=N.clientX,D=N.clientY,O=l,R=Oa(H)}function P(M){if(!c||_===void 0||B===void 0||T===void 0||D===void 0)return;sn(H,M);const N=Xh(H),L=H.length>1;let X=l;if(L){R===0&&(R=Oa(H));const U=Oa(H)-R;X=u(U*t.step/80+O).scale,k(X,N,{animate:!1},M)}(!L||t.pinchAndPan)&&p(_+(N.clientX-T)/X,B+(N.clientY-D)/X,{animate:!1},M)}function A(M){H.length===1&&h("panzoomend",{x:a,y:n,scale:l,isSVG:r,originalEvent:M},t),lb(H,M),c&&(c=!1,_=B=T=D=void 0)}let $=!1;function z(){$||($=!0,Ma("down",t.canvas?i:e,Y),Ma("move",document,P,{passive:!0}),Ma("up",document,A,{passive:!0}))}function I(){$=!1,$a("down",t.canvas?i:e,Y),$a("move",document,P),$a("up",document,A)}return t.noBind||z(),{bind:z,destroy:I,eventNames:fs,getPan:()=>({x:a,y:n}),getScale:()=>l,getOptions:()=>pb(t),handleDown:Y,handleMove:P,handleUp:A,pan:p,reset:S,resetStyle:s,setOptions:o,setStyle:(M,N)=>Zr(e,M,N),zoom:m,zoomIn:x,zoomOut:C,zoomToPoint:k,zoomWithWheel:v}}Dd.defaultOptions=Pd;const mb=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],yb=Lt("arrow-down",mb);const xb=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Cb=Lt("arrow-left",xb);const bb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],kb=Lt("arrow-right",bb);const wb=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Sb=Lt("arrow-up",wb);const vb=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],on=Lt("refresh-cw",vb);const Tb=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],_b=Lt("settings-2",Tb);const Bb=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Nd=Lt("zoom-in",Bb);const Lb=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],qd=Lt("zoom-out",Lb);var zd=Object.defineProperty,g=(e,t)=>zd(e,"name",{value:t,configurable:!0}),jd=(e,t)=>{for(var r in t)zd(e,r,{get:t[r],enumerable:!0})},Qs={exports:{}},Eb=Qs.exports,Gh;function Fb(){return Gh||(Gh=1,(function(e,t){(function(r,i){e.exports=i()})(Eb,(function(){var r=1e3,i=6e4,s=36e5,o="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",f="quarter",u="year",p="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var A=["th","st","nd","rd"],$=P%100;return"["+P+(A[($-20)%10]||A[$]||A[0])+"]"}},k=function(P,A,$){var z=String(P);return!z||z.length>=A?P:""+Array(A+1-z.length).join($)+P},v={s:k,z:function(P){var A=-P.utcOffset(),$=Math.abs(A),z=Math.floor($/60),I=$%60;return(A<=0?"+":"-")+k(z,2,"0")+":"+k(I,2,"0")},m:function P(A,$){if(A.date()<$.date())return-P($,A);var z=12*($.year()-A.year())+($.month()-A.month()),I=A.clone().add(z,d),M=$-I<0,N=A.clone().add(z+(M?-1:1),d);return+(-(z+($-I)/(M?I-N:N-I))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:d,y:u,w:h,d:c,D:p,h:l,m:n,s:a,ms:o,Q:f}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},S="en",_={};_[S]=C;var B="$isDayjsObject",T=function(P){return P instanceof H||!(!P||!P[B])},D=function P(A,$,z){var I;if(!A)return S;if(typeof A=="string"){var M=A.toLowerCase();_[M]&&(I=M),$&&(_[M]=$,I=M);var N=A.split("-");if(!I&&N.length>1)return P(N[0])}else{var L=A.name;_[L]=A,I=L}return!z&&I&&(S=I),I||!z&&S},O=function(P,A){if(T(P))return P.clone();var $=typeof A=="object"?A:{};return $.date=P,$.args=arguments,new H($)},R=v;R.l=D,R.i=T,R.w=function(P,A){return O(P,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var H=(function(){function P($){this.$L=D($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[B]=!0}var A=P.prototype;return A.parse=function($){this.$d=(function(z){var I=z.date,M=z.utc;if(I===null)return new Date(NaN);if(R.u(I))return new Date;if(I instanceof Date)return new Date(I);if(typeof I=="string"&&!/Z$/i.test(I)){var N=I.match(y);if(N){var L=N[2]-1||0,X=(N[7]||"0").substring(0,3);return M?new Date(Date.UTC(N[1],L,N[3]||1,N[4]||0,N[5]||0,N[6]||0,X)):new Date(N[1],L,N[3]||1,N[4]||0,N[5]||0,N[6]||0,X)}}return new Date(I)})($),this.init()},A.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},A.$utils=function(){return R},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function($,z){var I=O($);return this.startOf(z)<=I&&I<=this.endOf(z)},A.isAfter=function($,z){return O($)<this.startOf(z)},A.isBefore=function($,z){return this.endOf(z)<O($)},A.$g=function($,z,I){return R.u($)?this[z]:this.set(I,$)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function($,z){var I=this,M=!!R.u(z)||z,N=R.p($),L=function(dt,ut){var yt=R.w(I.$u?Date.UTC(I.$y,ut,dt):new Date(I.$y,ut,dt),I);return M?yt:yt.endOf(c)},X=function(dt,ut){return R.w(I.toDate()[dt].apply(I.toDate("s"),(M?[0,0,0,0]:[23,59,59,999]).slice(ut)),I)},U=this.$W,G=this.$M,q=this.$D,K="set"+(this.$u?"UTC":"");switch(N){case u:return M?L(1,0):L(31,11);case d:return M?L(1,G):L(0,G+1);case h:var Z=this.$locale().weekStart||0,J=(U<Z?U+7:U)-Z;return L(M?q-J:q+(6-J),G);case c:case p:return X(K+"Hours",0);case l:return X(K+"Minutes",1);case n:return X(K+"Seconds",2);case a:return X(K+"Milliseconds",3);default:return this.clone()}},A.endOf=function($){return this.startOf($,!1)},A.$set=function($,z){var I,M=R.p($),N="set"+(this.$u?"UTC":""),L=(I={},I[c]=N+"Date",I[p]=N+"Date",I[d]=N+"Month",I[u]=N+"FullYear",I[l]=N+"Hours",I[n]=N+"Minutes",I[a]=N+"Seconds",I[o]=N+"Milliseconds",I)[M],X=M===c?this.$D+(z-this.$W):z;if(M===d||M===u){var U=this.clone().set(p,1);U.$d[L](X),U.init(),this.$d=U.set(p,Math.min(this.$D,U.daysInMonth())).$d}else L&&this.$d[L](X);return this.init(),this},A.set=function($,z){return this.clone().$set($,z)},A.get=function($){return this[R.p($)]()},A.add=function($,z){var I,M=this;$=Number($);var N=R.p(z),L=function(G){var q=O(M);return R.w(q.date(q.date()+Math.round(G*$)),M)};if(N===d)return this.set(d,this.$M+$);if(N===u)return this.set(u,this.$y+$);if(N===c)return L(1);if(N===h)return L(7);var X=(I={},I[n]=i,I[l]=s,I[a]=r,I)[N]||1,U=this.$d.getTime()+$*X;return R.w(U,this)},A.subtract=function($,z){return this.add(-1*$,z)},A.format=function($){var z=this,I=this.$locale();if(!this.isValid())return I.invalidDate||m;var M=$||"YYYY-MM-DDTHH:mm:ssZ",N=R.z(this),L=this.$H,X=this.$m,U=this.$M,G=I.weekdays,q=I.months,K=I.meridiem,Z=function(ut,yt,Et,It){return ut&&(ut[yt]||ut(z,M))||Et[yt].slice(0,It)},J=function(ut){return R.s(L%12||12,ut,"0")},dt=K||function(ut,yt,Et){var It=ut<12?"AM":"PM";return Et?It.toLowerCase():It};return M.replace(x,(function(ut,yt){return yt||(function(Et){switch(Et){case"YY":return String(z.$y).slice(-2);case"YYYY":return R.s(z.$y,4,"0");case"M":return U+1;case"MM":return R.s(U+1,2,"0");case"MMM":return Z(I.monthsShort,U,q,3);case"MMMM":return Z(q,U);case"D":return z.$D;case"DD":return R.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return Z(I.weekdaysMin,z.$W,G,2);case"ddd":return Z(I.weekdaysShort,z.$W,G,3);case"dddd":return G[z.$W];case"H":return String(L);case"HH":return R.s(L,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return dt(L,X,!0);case"A":return dt(L,X,!1);case"m":return String(X);case"mm":return R.s(X,2,"0");case"s":return String(z.$s);case"ss":return R.s(z.$s,2,"0");case"SSS":return R.s(z.$ms,3,"0");case"Z":return N}return null})(ut)||N.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function($,z,I){var M,N=this,L=R.p(z),X=O($),U=(X.utcOffset()-this.utcOffset())*i,G=this-X,q=function(){return R.m(N,X)};switch(L){case u:M=q()/12;break;case d:M=q();break;case f:M=q()/3;break;case h:M=(G-U)/6048e5;break;case c:M=(G-U)/864e5;break;case l:M=G/s;break;case n:M=G/i;break;case a:M=G/r;break;default:M=G}return I?M:R.a(M)},A.daysInMonth=function(){return this.endOf(d).$D},A.$locale=function(){return _[this.$L]},A.locale=function($,z){if(!$)return this.$L;var I=this.clone(),M=D($,z,!0);return M&&(I.$L=M),I},A.clone=function(){return R.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},P})(),Y=H.prototype;return O.prototype=Y,[["$ms",o],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",u],["$D",p]].forEach((function(P){Y[P[1]]=function(A){return this.$g(A,P[0],P[1])}})),O.extend=function(P,A){return P.$i||(P(A,H,O),P.$i=!0),O},O.locale=D,O.isDayjs=T,O.unix=function(P){return O(1e3*P)},O.en=_[S],O.Ls=_,O.p={},O}))})(Qs)),Qs.exports}var Ab=Fb();const Wd=Ad(Ab);var Ze={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},V={trace:g((...e)=>{},"trace"),debug:g((...e)=>{},"debug"),info:g((...e)=>{},"info"),warn:g((...e)=>{},"warn"),error:g((...e)=>{},"error"),fatal:g((...e)=>{},"fatal")},pl=g(function(e="fatal"){let t=Ze.fatal;typeof e=="string"?e.toLowerCase()in Ze&&(t=Ze[e]):typeof e=="number"&&(t=e),V.trace=()=>{},V.debug=()=>{},V.info=()=>{},V.warn=()=>{},V.error=()=>{},V.fatal=()=>{},t<=Ze.fatal&&(V.fatal=console.error?console.error.bind(console,be("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",be("FATAL"))),t<=Ze.error&&(V.error=console.error?console.error.bind(console,be("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",be("ERROR"))),t<=Ze.warn&&(V.warn=console.warn?console.warn.bind(console,be("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",be("WARN"))),t<=Ze.info&&(V.info=console.info?console.info.bind(console,be("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",be("INFO"))),t<=Ze.debug&&(V.debug=console.debug?console.debug.bind(console,be("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",be("DEBUG"))),t<=Ze.trace&&(V.trace=console.debug?console.debug.bind(console,be("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",be("TRACE")))},"setLogLevel"),be=g(e=>`%c${Wd().format("ss.SSS")} : ${e} : `,"format");const Js={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const s=r<.5?r*(1+t):r+t-r*t,o=2*r-s;switch(i){case"r":return Js.hue2rgb(o,s,e+1/3)*255;case"g":return Js.hue2rgb(o,s,e)*255;case"b":return Js.hue2rgb(o,s,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const s=Math.max(e,t,r),o=Math.min(e,t,r),a=(s+o)/2;if(i==="l")return a*100;if(s===o)return 0;const n=s-o,l=a>.5?n/(2-s-o):n/(s+o);if(i==="s")return l*100;switch(s){case e:return((t-r)/n+(t<r?6:0))*60;case t:return((r-e)/n+2)*60;case r:return((e-t)/n+4)*60;default:return-1}}},Mb={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},$b={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},ft={channel:Js,lang:Mb,unit:$b},lr={};for(let e=0;e<=255;e++)lr[e]=ft.unit.dec2hex(e);const te={ALL:0,RGB:1,HSL:2};class Ob{constructor(){this.type=te.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=te.ALL}is(t){return this.type===t}}class Rb{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new Ob}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=te.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:s}=t;r===void 0&&(t.h=ft.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=ft.channel.rgb2hsl(t,"s")),s===void 0&&(t.l=ft.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:s}=t;r===void 0&&(t.r=ft.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=ft.channel.hsl2rgb(t,"g")),s===void 0&&(t.b=ft.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(te.HSL)&&r!==void 0?r:(this._ensureHSL(),ft.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(te.HSL)&&r!==void 0?r:(this._ensureHSL(),ft.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(te.HSL)&&r!==void 0?r:(this._ensureHSL(),ft.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(te.RGB)&&r!==void 0?r:(this._ensureRGB(),ft.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(te.RGB)&&r!==void 0?r:(this._ensureRGB(),ft.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(te.RGB)&&r!==void 0?r:(this._ensureRGB(),ft.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(te.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(te.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(te.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(te.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(te.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(te.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Zo=new Rb({r:0,g:0,b:0,a:0},"transparent"),Jr={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Jr.re);if(!t)return;const r=t[1],i=parseInt(r,16),s=r.length,o=s%4===0,a=s>4,n=a?1:17,l=a?8:4,c=o?0:-1,h=a?255:15;return Zo.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:o?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`#${lr[Math.round(t)]}${lr[Math.round(r)]}${lr[Math.round(i)]}${lr[Math.round(s*255)]}`:`#${lr[Math.round(t)]}${lr[Math.round(r)]}${lr[Math.round(i)]}`}},_r={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(_r.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return ft.channel.clamp.h(parseFloat(r)*.9);case"rad":return ft.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return ft.channel.clamp.h(parseFloat(r)*360)}}return ft.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(_r.re);if(!r)return;const[,i,s,o,a,n]=r;return Zo.set({h:_r._hue2deg(i),s:ft.channel.clamp.s(parseFloat(s)),l:ft.channel.clamp.l(parseFloat(o)),a:a?ft.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:s}=e;return s<1?`hsla(${ft.lang.round(t)}, ${ft.lang.round(r)}%, ${ft.lang.round(i)}%, ${s})`:`hsl(${ft.lang.round(t)}, ${ft.lang.round(r)}%, ${ft.lang.round(i)}%)`}},os={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=os.colors[e];if(t)return Jr.parse(t)},stringify:e=>{const t=Jr.stringify(e);for(const r in os.colors)if(os.colors[r]===t)return r}},Ki={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Ki.re);if(!r)return;const[,i,s,o,a,n,l,c,h]=r;return Zo.set({r:ft.channel.clamp.r(s?parseFloat(i)*2.55:parseFloat(i)),g:ft.channel.clamp.g(a?parseFloat(o)*2.55:parseFloat(o)),b:ft.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?ft.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`rgba(${ft.lang.round(t)}, ${ft.lang.round(r)}, ${ft.lang.round(i)}, ${ft.lang.round(s)})`:`rgb(${ft.lang.round(t)}, ${ft.lang.round(r)}, ${ft.lang.round(i)})`}},Me={format:{keyword:os,hex:Jr,rgb:Ki,rgba:Ki,hsl:_r,hsla:_r},parse:e=>{if(typeof e!="string")return e;const t=Jr.parse(e)||Ki.parse(e)||_r.parse(e)||os.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(te.HSL)||e.data.r===void 0?_r.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Ki.stringify(e):Jr.stringify(e)},Hd=(e,t)=>{const r=Me.parse(e);for(const i in t)r[i]=ft.channel.clamp[i](t[i]);return Me.stringify(r)},er=(e,t,r=0,i=1)=>{if(typeof e!="number")return Hd(e,{a:t});const s=Zo.set({r:ft.channel.clamp.r(e),g:ft.channel.clamp.g(t),b:ft.channel.clamp.b(r),a:ft.channel.clamp.a(i)});return Me.stringify(s)},Ib=e=>{const{r:t,g:r,b:i}=Me.parse(e),s=.2126*ft.channel.toLinear(t)+.7152*ft.channel.toLinear(r)+.0722*ft.channel.toLinear(i);return ft.lang.round(s)},Pb=e=>Ib(e)>=.5,Te=e=>!Pb(e),ml=(e,t,r)=>{const i=Me.parse(e),s=i[t],o=ft.channel.clamp[t](s+r);return s!==o&&(i[t]=o),Me.stringify(i)},j=(e,t)=>ml(e,"l",t),W=(e,t)=>ml(e,"l",-t),b=(e,t)=>{const r=Me.parse(e),i={};for(const s in t)t[s]&&(i[s]=r[s]+t[s]);return Hd(e,i)},Db=(e,t,r=50)=>{const{r:i,g:s,b:o,a}=Me.parse(e),{r:n,g:l,b:c,a:h}=Me.parse(t),d=r/100,f=d*2-1,u=a-h,m=((f*u===-1?f:(f+u)/(1+f*u))+1)/2,y=1-m,x=i*m+n*y,C=s*m+l*y,k=o*m+c*y,v=a*d+h*(1-d);return er(x,C,k,v)},F=(e,t=100)=>{const r=Me.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Db(r,e,t)};var an=g((e,t,{depth:r=2,clobber:i=!1}={})=>{const s={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(o=>an(e,o,s)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(o=>{e.includes(o)||e.push(o)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(o=>{typeof t[o]=="object"&&t[o]!==null&&(e[o]===void 0||typeof e[o]=="object")?(e[o]===void 0&&(e[o]=Array.isArray(t[o])?[]:{}),e[o]=an(e[o],t[o],{depth:r-1,clobber:i})):(i||typeof e[o]!="object"&&typeof t[o]!="object")&&(e[o]=t[o])}),e)},"assignWithDepth"),qt=an,Ye="#ffffff",Ue="#f2f2f2",ct=g((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),ri,Nb=(ri=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||j(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||W(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||W(this.mainBkg,10)):(this.rowOdd=this.rowOdd||j(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||j(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||F(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ri,"Theme"),ri),qb=g(e=>{const t=new Nb;return t.calculate(e),t},"getThemeVariables"),ii,zb=(ii=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(F("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=er(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=W("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=W(this.sectionBkgColor,10),this.taskBorderColor=er(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=er(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||j(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||W(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=j(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=j(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=j(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=F(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||F(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||j(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??j(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=j(this.secondaryColor,20),this.git1=j(this.pie2||this.secondaryColor,20),this.git2=j(this.pie3||this.tertiaryColor,20),this.git3=j(this.pie4||b(this.primaryColor,{h:-30}),20),this.git4=j(this.pie5||b(this.primaryColor,{h:-60}),20),this.git5=j(this.pie6||b(this.primaryColor,{h:-90}),10),this.git6=j(this.pie7||b(this.primaryColor,{h:60}),10),this.git7=j(this.pie8||b(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||F(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||F(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||j("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||j("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||j("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||j("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||j(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||j(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||j(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||j(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ii,"Theme"),ii),jb=g(e=>{const t=new zb;return t.calculate(e),t},"getThemeVariables"),si,Wb=(si=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=b(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=er(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||W(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||W(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=W(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||W(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||F(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||F(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||j(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||j(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||b(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||b(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||W(F(this.git0),25),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||F(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||F(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(Object.keys(this).forEach(i=>{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(si,"Theme"),si),Yd=g(e=>{const t=new Wb;return t.calculate(e),t},"getThemeVariables"),oi,Hb=(oi=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=j("#cde498",10),this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.primaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=W(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||W(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||W(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=W(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||W(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||j(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||j(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-30}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||F(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||F(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(oi,"Theme"),oi),Yb=g(e=>{const t=new Hb;return t.calculate(e),t},"getThemeVariables"),ai,Ub=(ai=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=j(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||j(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=j(this.contrast,55),this.border2=this.contrast,this.actorBorder=j(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||F(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||j(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||W(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=j(this.contrast,30),this.sectionBkgColor2=j(this.contrast,30),this.taskBorderColor=W(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=j(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=W(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=W(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||b(this.primaryColor,{h:-30}),this.git4=this.pie5||b(this.primaryColor,{h:-60}),this.git5=this.pie6||b(this.primaryColor,{h:-90}),this.git6=this.pie7||b(this.primaryColor,{h:60}),this.git7=this.pie8||b(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ai,"Theme"),ai),Xb=g(e=>{const t=new Ub;return t.calculate(e),t},"getThemeVariables"),ni,Gb=(ni=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||j(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||b(t,{h:30}),this.cScale4=this.cScale4||b(t,{h:60}),this.cScale5=this.cScale5||b(t,{h:90}),this.cScale6=this.cScale6||b(t,{h:120}),this.cScale7=this.cScale7||b(t,{h:150}),this.cScale8=this.cScale8||b(t,{h:210,l:150}),this.cScale9=this.cScale9||b(t,{h:270}),this.cScale10=this.cScale10||b(t,{h:300}),this.cScale11=this.cScale11||b(t,{h:330}),this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=W(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=W(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||F(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||j(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||W(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ni,"Theme"),ni),Vb=g(e=>{const t=new Gb;return t.calculate(e),t},"getThemeVariables"),li,Zb=(li=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(F("#323D47"),10),this.border1="#ccc",this.border2=er(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||j(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||F(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(li,"Theme"),li),Kb=g(e=>{const t=new Zb;return t.calculate(e),t},"getThemeVariables"),hi,Qb=(hi=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ct("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||j(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=this.mainBkg;if(this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=W(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=W(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||F(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||j(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||W(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(hi,"Theme"),hi),Jb=g(e=>{const t=new Qb;return t.calculate(e),t},"getThemeVariables"),ci,tk=(ci=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(F("#323D47"),10),this.border1="#ccc",this.border2=er(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||j(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||F(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ci,"Theme"),ci),ek=g(e=>{const t=new tk;return t.calculate(e),t},"getThemeVariables"),di,rk=(di=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||j(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||F(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||j(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||W(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(di,"Theme"),di),ik=g(e=>{const t=new rk;return t.calculate(e),t},"getThemeVariables"),ui,sk=(ui=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(F("#323D47"),10),this.border1="#ccc",this.border2=er(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||j(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||F(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=W(this["cScale"+r],75);const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ui,"Theme"),ui),ok=g(e=>{const t=new sk;return t.calculate(e),t},"getThemeVariables"),rr={base:{getThemeVariables:qb},dark:{getThemeVariables:jb},default:{getThemeVariables:Yd},forest:{getThemeVariables:Yb},neutral:{getThemeVariables:Xb},neo:{getThemeVariables:Vb},"neo-dark":{getThemeVariables:Kb},redux:{getThemeVariables:Jb},"redux-dark":{getThemeVariables:ek},"redux-color":{getThemeVariables:ik},"redux-dark-color":{getThemeVariables:ok}},Zt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Ud={...Zt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:rr.default.getThemeVariables(),sequence:{...Zt.sequence,messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:g(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:g(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Zt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Zt.c4,useWidth:void 0,personFont:g(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Zt.flowchart,inheritDir:!1},external_personFont:g(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:g(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:g(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:g(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:g(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:g(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:g(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:g(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:g(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:g(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:g(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:g(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:g(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:g(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:g(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:g(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:g(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:g(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:g(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:g(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:g(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Zt.pie,useWidth:984},xyChart:{...Zt.xyChart,useWidth:void 0},requirement:{...Zt.requirement,useWidth:void 0},packet:{...Zt.packet},eventmodeling:{...Zt.eventmodeling},treeView:{...Zt.treeView,useWidth:void 0},radar:{...Zt.radar},railroad:{...Zt.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Zt.ishikawa},sankey:{...Zt.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Zt.venn},cynefin:{...Zt.cynefin}},Xd=g((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Xd(e[i],"")]:[...r,t+i],[]),"keyify"),ak=new Set(Xd(Ud,"")),yl=Ud,nk={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},lk=g((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(V.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),po=g(e=>{if(V.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>po(t));return}for(const t of Object.keys(e)){if(V.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!ak.has(t)||e[t]==null){V.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=nk[t];i?lk(e[t],i):(V.debug("sanitizing object",t),po(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(V.debug("sanitizing css option",t),e[t]=Gd(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}V.debug("After sanitization",e)}},"sanitizeDirective"),Gd=g(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),yi=Object.freeze(yl),Xe=g(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),fe=qt({},yi),mo,$r=[],as=qt({},yi),Ko=g((e,t)=>{let r=qt({},e),i={};for(const s of t)Kd(s),i=qt(i,s);if(r=qt(r,i),i.theme&&i.theme in rr){const s=qt({},mo),o=qt(s.themeVariables||{},i.themeVariables);r.theme&&r.theme in rr&&(r.themeVariables=rr[r.theme].getThemeVariables(o))}return as=r,Jd(as),as},"updateCurrentConfig"),hk=g(e=>(fe=qt({},yi),fe=qt(fe,e),e.theme&&rr[e.theme]&&(fe.themeVariables=rr[e.theme].getThemeVariables(e.themeVariables)),Ko(fe,$r),fe),"setSiteConfig"),ck=g(e=>{mo=qt({},e)},"saveConfigFromInitialize"),dk=g(e=>(fe=qt(fe,e),Ko(fe,$r),fe),"updateSiteConfig"),Vd=g(()=>qt({},fe),"getSiteConfig"),Zd=g(e=>(Jd(e),qt(as,e),At()),"setConfig"),At=g(()=>qt({},as),"getConfig"),Kd=g(e=>{e&&(["secure",...fe.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(V.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&Kd(e[t])}))},"sanitize"),uk=g(e=>{po(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),$r.push(e),Ko(fe,$r)},"addDirective"),yo=g((e=fe)=>{$r=[],Ko(e,$r)},"reset"),fk={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},Vh={},Qd=g(e=>{Vh[e]||(V.warn(fk[e]),Vh[e]=!0)},"issueWarning"),Jd=g(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Qd("LAZY_LOAD_DEPRECATED")},"checkConfig"),gk=g(()=>{let e={};mo&&(e=qt(e,mo));for(const t of $r)e=qt(e,t);return e},"getUserDefinedConfig"),re=g(e=>(e.flowchart?.htmlLabels!=null&&Qd("FLOWCHART_HTML_LABELS_DEPRECATED"),Xe(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),tu=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,ns=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,pk=/\s*%%.*\n/gm,fi,eu=(fi=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},g(fi,"UnknownDiagramError"),fi),Or={},xl=g(function(e,t){e=e.replace(tu,"").replace(ns,"").replace(pk,`
|
|
8
|
+
`);for(const[r,{detector:i}]of Object.entries(Or))if(i(e,t))return r;throw new eu(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),nn=g((...e)=>{for(const{id:t,detector:r,loader:i}of e)ru(t,r,i)},"registerLazyLoadedDiagrams"),ru=g((e,t,r)=>{Or[e]&&V.warn(`Detector with key ${e} already exists. Overwriting.`),Or[e]={detector:t,loader:r},V.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),mk=g(e=>Or[e].loader,"getDiagramLoader"),Bi=/<br\s*\/?>/gi,yk=g(e=>e?ou(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),xk=(()=>{let e=!1;return()=>{e||(iu(),e=!0)}})();function iu(){const e="data-temp-href-target";mi.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),mi.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}g(iu,"setupDompurifyHooks");var su=g(e=>(xk(),mi.sanitize(e)),"removeScript"),Zh=g((e,t)=>{if(re(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=su(e):r!=="loose"&&(e=ou(e),e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(/=/g,"="),e=wk(e))}return e},"sanitizeMore"),Se=g((e,t)=>e&&(t.dompurifyConfig?e=mi.sanitize(Zh(e,t),t.dompurifyConfig).toString():e=mi.sanitize(Zh(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),Ck=g((e,t)=>typeof e=="string"?Se(e,t):e.flat().map(r=>Se(r,t)),"sanitizeTextOrArray"),bk=g(e=>Bi.test(e),"hasBreaks"),kk=g(e=>e.split(Bi),"splitBreaks"),wk=g(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),ou=g(e=>e.replace(Bi,"#br#"),"breakToPlaceholder"),au=g(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),Sk=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),vk=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),ln=g(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let s=t[i];if(s===","&&i>0&&i+1<t.length){const o=t[i-1],a=t[i+1];Tk(o,a)&&(s=o+","+a,i++,r.pop())}r.push(_k(s))}return r.join("")},"parseGenericTypes"),hn=g((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),Tk=g((e,t)=>{const r=hn(e,"~"),i=hn(t,"~");return r===1&&i===1},"shouldCombineSets"),_k=g(e=>{const t=hn(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let s=i.indexOf("~"),o=i.lastIndexOf("~");for(;s!==-1&&o!==-1&&s!==o;)i[s]="<",i[o]=">",s=i.indexOf("~"),o=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),Kh=g(()=>window.MathMLElement!==void 0,"isMathMLSupported"),cn=/\$\$(.*?)\$\$/g,xi=g(e=>(e.match(cn)?.length??0)>0,"hasKatex"),Bk=g(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Cl(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const s={width:r.clientWidth,height:r.clientHeight};return r.remove(),s},"calculateMathMLDimensions"),Lk=g(async(e,t)=>{if(!xi(e))return e;if(!(Kh()||t.legacyMathML||t.forceLegacyMathML))return e.replace(cn,"MathML is unsupported in this environment.");{const{default:r}=await import("katex"),i=t.forceLegacyMathML||!Kh()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Bi).map(s=>xi(s)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${s}</div>`:`<div>${s}</div>`).join("").replace(cn,(s,o)=>r.renderToString(o,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Cl=g(async(e,t)=>Se(await Lk(e,t),t),"renderKatexSanitized"),Li={getRows:yk,sanitizeText:Se,sanitizeTextOrArray:Ck,hasBreaks:bk,splitBreaks:kk,lineBreakRegex:Bi,removeScript:su,getUrl:au,evaluate:Xe,getMax:Sk,getMin:vk},Ek=g(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),Fk=g(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),bl=g(function(e,t,r,i){const s=Fk(t,r,i);Ek(e,s)},"configureSvgSize"),nu=g(function(e,t,r,i){const s=t.node().getBBox(),o=s.width,a=s.height;V.info(`SVG bounds: ${o}x${a}`,s);let n=0,l=0;V.info(`Graph bounds: ${n}x${l}`,e),n=o+r*2,l=a+r*2,V.info(`Calculated bounds: ${n}x${l}`),bl(t,l,n,i);const c=`${s.x-r} ${s.y-r} ${s.width+2*r} ${s.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),to={};function dn(e){return[...e.cssRules].map(t=>t.cssText).join(`
|
|
9
|
+
`)}g(dn,"cssStyleSheetToString");var Ak=g((e,t,r,i)=>{let s="";return e in to&&to[e]?s=to[e]({...r,svgId:i}):V.warn(`No theme found for ${e}`),` & {
|
|
10
|
+
font-family: ${r.fontFamily};
|
|
11
|
+
font-size: ${r.fontSize};
|
|
12
|
+
fill: ${r.textColor}
|
|
13
|
+
}
|
|
14
|
+
@keyframes edge-animation-frame {
|
|
15
|
+
from {
|
|
16
|
+
stroke-dashoffset: 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
@keyframes dash {
|
|
20
|
+
to {
|
|
21
|
+
stroke-dashoffset: 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
& .edge-animation-slow {
|
|
25
|
+
stroke-dasharray: 9,5 !important;
|
|
26
|
+
stroke-dashoffset: 900;
|
|
27
|
+
animation: dash 50s linear infinite;
|
|
28
|
+
stroke-linecap: round;
|
|
29
|
+
}
|
|
30
|
+
& .edge-animation-fast {
|
|
31
|
+
stroke-dasharray: 9,5 !important;
|
|
32
|
+
stroke-dashoffset: 900;
|
|
33
|
+
animation: dash 20s linear infinite;
|
|
34
|
+
stroke-linecap: round;
|
|
35
|
+
}
|
|
36
|
+
/* Classes common for multiple diagrams */
|
|
37
|
+
|
|
38
|
+
& .error-icon {
|
|
39
|
+
fill: ${r.errorBkgColor};
|
|
40
|
+
}
|
|
41
|
+
& .error-text {
|
|
42
|
+
fill: ${r.errorTextColor};
|
|
43
|
+
stroke: ${r.errorTextColor};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
& .edge-thickness-normal {
|
|
47
|
+
stroke-width: ${r.strokeWidth??1}px;
|
|
48
|
+
}
|
|
49
|
+
& .edge-thickness-thick {
|
|
50
|
+
stroke-width: 3.5px
|
|
51
|
+
}
|
|
52
|
+
& .edge-pattern-solid {
|
|
53
|
+
stroke-dasharray: 0;
|
|
54
|
+
}
|
|
55
|
+
& .edge-thickness-invisible {
|
|
56
|
+
stroke-width: 0;
|
|
57
|
+
fill: none;
|
|
58
|
+
}
|
|
59
|
+
& .edge-pattern-dashed{
|
|
60
|
+
stroke-dasharray: 3;
|
|
61
|
+
}
|
|
62
|
+
.edge-pattern-dotted {
|
|
63
|
+
stroke-dasharray: 2;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
& .marker {
|
|
67
|
+
fill: ${r.lineColor};
|
|
68
|
+
stroke: ${r.lineColor};
|
|
69
|
+
}
|
|
70
|
+
& .marker.cross {
|
|
71
|
+
stroke: ${r.lineColor};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
& svg {
|
|
75
|
+
font-family: ${r.fontFamily};
|
|
76
|
+
font-size: ${r.fontSize};
|
|
77
|
+
}
|
|
78
|
+
& p {
|
|
79
|
+
margin: 0
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
${s}
|
|
83
|
+
.node .neo-node {
|
|
84
|
+
stroke: ${r.nodeBorder};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
|
|
88
|
+
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
89
|
+
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
90
|
+
}
|
|
91
|
+
[data-look="neo"].swimlane.cluster rect {
|
|
92
|
+
filter: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
[data-look="neo"].node path {
|
|
97
|
+
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
98
|
+
stroke-width: ${r.strokeWidth??1}px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-look="neo"].node .outer-path {
|
|
102
|
+
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-look="neo"].node .neo-line path {
|
|
106
|
+
stroke: ${r.nodeBorder};
|
|
107
|
+
filter: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[data-look="neo"].node circle{
|
|
111
|
+
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
112
|
+
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[data-look="neo"].node circle .state-start{
|
|
116
|
+
fill: #000000;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
[data-look="neo"].icon-shape .icon {
|
|
120
|
+
fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
121
|
+
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
[data-look="neo"].icon-shape .icon-neo path {
|
|
125
|
+
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
126
|
+
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
${t}
|
|
130
|
+
`},"getStyles"),Mk=g((e,t)=>{t!==void 0&&(to[e]=t)},"addStylesForDiagram"),$k=Ak,kl={};jd(kl,{clear:()=>lu,getAccDescription:()=>uu,getAccTitle:()=>cu,getDiagramTitle:()=>gu,setAccDescription:()=>du,setAccTitle:()=>hu,setDiagramTitle:()=>fu});var wl="",Sl="",vl="",Tl=g(e=>Se(e,At()),"sanitizeText"),lu=g(()=>{wl="",vl="",Sl=""},"clear"),hu=g(e=>{wl=Tl(e).replace(/^\s+/g,"")},"setAccTitle"),cu=g(()=>wl,"getAccTitle"),du=g(e=>{vl=Tl(e).replace(/\n\s+/g,`
|
|
131
|
+
`)},"setAccDescription"),uu=g(()=>vl,"getAccDescription"),fu=g(e=>{Sl=Tl(e)},"setDiagramTitle"),gu=g(()=>Sl,"getDiagramTitle"),Qh=V,Ok=pl,wt=At,Rk=Zd,Ik=yi,_l=g(e=>Se(e,wt()),"sanitizeText"),pu=nu,Pk=g(()=>kl,"getCommonDb"),xo={},Co=g((e,t,r)=>{xo[e]&&Qh.warn(`Diagram with id ${e} already registered. Overwriting.`),xo[e]=t,r&&ru(e,r),Mk(e,t.styles),t.injectUtils?.(Qh,Ok,wt,_l,pu,Pk(),()=>{})},"registerDiagram"),un=g(e=>{if(e in xo)return xo[e];throw new Dk(e)},"getDiagram"),gi,Dk=(gi=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},g(gi,"DiagramNotFoundError"),gi),Nk={value:()=>{}};function mu(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new eo(r)}function eo(e){this._=e}function qk(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");if(s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}eo.prototype=mu.prototype={constructor:eo,on:function(e,t){var r=this._,i=qk(e+"",r),s,o=-1,a=i.length;if(arguments.length<2){for(;++o<a;)if((s=(e=i[o]).type)&&(s=zk(r[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(s=(e=i[o]).type)r[s]=Jh(r[s],e.name,t);else if(t==null)for(s in r)r[s]=Jh(r[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new eo(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var r=new Array(s),i=0,s,o;i<s;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],i=0,s=o.length;i<s;++i)o[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],s=0,o=i.length;s<o;++s)i[s].value.apply(t,r)}};function zk(e,t){for(var r=0,i=e.length,s;r<i;++r)if((s=e[r]).name===t)return s.value}function Jh(e,t,r){for(var i=0,s=e.length;i<s;++i)if(e[i].name===t){e[i]=Nk,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var fn="http://www.w3.org/1999/xhtml";const tc={svg:"http://www.w3.org/2000/svg",xhtml:fn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Qo(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),tc.hasOwnProperty(t)?{space:tc[t],local:e}:e}function jk(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===fn&&t.documentElement.namespaceURI===fn?t.createElement(e):t.createElementNS(r,e)}}function Wk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yu(e){var t=Qo(e);return(t.local?Wk:jk)(t)}function Hk(){}function Bl(e){return e==null?Hk:function(){return this.querySelector(e)}}function Yk(e){typeof e!="function"&&(e=Bl(e));for(var t=this._groups,r=t.length,i=new Array(r),s=0;s<r;++s)for(var o=t[s],a=o.length,n=i[s]=new Array(a),l,c,h=0;h<a;++h)(l=o[h])&&(c=e.call(l,l.__data__,h,o))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new Ce(i,this._parents)}function Uk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Xk(){return[]}function xu(e){return e==null?Xk:function(){return this.querySelectorAll(e)}}function Gk(e){return function(){return Uk(e.apply(this,arguments))}}function Vk(e){typeof e=="function"?e=Gk(e):e=xu(e);for(var t=this._groups,r=t.length,i=[],s=[],o=0;o<r;++o)for(var a=t[o],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),s.push(l));return new Ce(i,s)}function Cu(e){return function(){return this.matches(e)}}function bu(e){return function(t){return t.matches(e)}}var Zk=Array.prototype.find;function Kk(e){return function(){return Zk.call(this.children,e)}}function Qk(){return this.firstElementChild}function Jk(e){return this.select(e==null?Qk:Kk(typeof e=="function"?e:bu(e)))}var t1=Array.prototype.filter;function e1(){return Array.from(this.children)}function r1(e){return function(){return t1.call(this.children,e)}}function i1(e){return this.selectAll(e==null?e1:r1(typeof e=="function"?e:bu(e)))}function s1(e){typeof e!="function"&&(e=Cu(e));for(var t=this._groups,r=t.length,i=new Array(r),s=0;s<r;++s)for(var o=t[s],a=o.length,n=i[s]=[],l,c=0;c<a;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&n.push(l);return new Ce(i,this._parents)}function ku(e){return new Array(e.length)}function o1(){return new Ce(this._enter||this._groups.map(ku),this._parents)}function bo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}bo.prototype={constructor:bo,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function a1(e){return function(){return e}}function n1(e,t,r,i,s,o){for(var a=0,n,l=t.length,c=o.length;a<c;++a)(n=t[a])?(n.__data__=o[a],i[a]=n):r[a]=new bo(e,o[a]);for(;a<l;++a)(n=t[a])&&(s[a]=n)}function l1(e,t,r,i,s,o,a){var n,l,c=new Map,h=t.length,d=o.length,f=new Array(h),u;for(n=0;n<h;++n)(l=t[n])&&(f[n]=u=a.call(l,l.__data__,n,t)+"",c.has(u)?s[n]=l:c.set(u,l));for(n=0;n<d;++n)u=a.call(e,o[n],n,o)+"",(l=c.get(u))?(i[n]=l,l.__data__=o[n],c.delete(u)):r[n]=new bo(e,o[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(f[n])===l&&(s[n]=l)}function h1(e){return e.__data__}function c1(e,t){if(!arguments.length)return Array.from(this,h1);var r=t?l1:n1,i=this._parents,s=this._groups;typeof e!="function"&&(e=a1(e));for(var o=s.length,a=new Array(o),n=new Array(o),l=new Array(o),c=0;c<o;++c){var h=i[c],d=s[c],f=d.length,u=d1(e.call(h,h&&h.__data__,c,i)),p=u.length,m=n[c]=new Array(p),y=a[c]=new Array(p),x=l[c]=new Array(f);r(h,d,m,y,x,u,t);for(var C=0,k=0,v,S;C<p;++C)if(v=m[C]){for(C>=k&&(k=C+1);!(S=y[k])&&++k<p;);v._next=S||null}}return a=new Ce(a,i),a._enter=n,a._exit=l,a}function d1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function u1(){return new Ce(this._exit||this._groups.map(ku),this._parents)}function f1(e,t,r){var i=this.enter(),s=this,o=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),r==null?o.remove():r(o),i&&s?i.merge(s).order():s}function g1(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,s=r.length,o=i.length,a=Math.min(s,o),n=new Array(s),l=0;l<a;++l)for(var c=r[l],h=i[l],d=c.length,f=n[l]=new Array(d),u,p=0;p<d;++p)(u=c[p]||h[p])&&(f[p]=u);for(;l<s;++l)n[l]=r[l];return new Ce(n,this._parents)}function p1(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],s=i.length-1,o=i[s],a;--s>=0;)(a=i[s])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function m1(e){e||(e=y1);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o){for(var a=r[o],n=a.length,l=s[o]=new Array(n),c,h=0;h<n;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new Ce(s,this._parents).order()}function y1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function x1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function C1(){return Array.from(this)}function b1(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],s=0,o=i.length;s<o;++s){var a=i[s];if(a)return a}return null}function k1(){let e=0;for(const t of this)++e;return e}function w1(){return!this.node()}function S1(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],o=0,a=s.length,n;o<a;++o)(n=s[o])&&e.call(n,n.__data__,o,s);return this}function v1(e){return function(){this.removeAttribute(e)}}function T1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _1(e,t){return function(){this.setAttribute(e,t)}}function B1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function L1(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function E1(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function F1(e,t){var r=Qo(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?T1:v1:typeof t=="function"?r.local?E1:L1:r.local?B1:_1)(r,t))}function wu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function A1(e){return function(){this.style.removeProperty(e)}}function M1(e,t,r){return function(){this.style.setProperty(e,t,r)}}function $1(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function O1(e,t,r){return arguments.length>1?this.each((t==null?A1:typeof t=="function"?$1:M1)(e,t,r??"")):Ci(this.node(),e)}function Ci(e,t){return e.style.getPropertyValue(t)||wu(e).getComputedStyle(e,null).getPropertyValue(t)}function R1(e){return function(){delete this[e]}}function I1(e,t){return function(){this[e]=t}}function P1(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function D1(e,t){return arguments.length>1?this.each((t==null?R1:typeof t=="function"?P1:I1)(e,t)):this.node()[e]}function Su(e){return e.trim().split(/^|\s+/)}function Ll(e){return e.classList||new vu(e)}function vu(e){this._node=e,this._names=Su(e.getAttribute("class")||"")}vu.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Tu(e,t){for(var r=Ll(e),i=-1,s=t.length;++i<s;)r.add(t[i])}function _u(e,t){for(var r=Ll(e),i=-1,s=t.length;++i<s;)r.remove(t[i])}function N1(e){return function(){Tu(this,e)}}function q1(e){return function(){_u(this,e)}}function z1(e,t){return function(){(t.apply(this,arguments)?Tu:_u)(this,e)}}function j1(e,t){var r=Su(e+"");if(arguments.length<2){for(var i=Ll(this.node()),s=-1,o=r.length;++s<o;)if(!i.contains(r[s]))return!1;return!0}return this.each((typeof t=="function"?z1:t?N1:q1)(r,t))}function W1(){this.textContent=""}function H1(e){return function(){this.textContent=e}}function Y1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function U1(e){return arguments.length?this.each(e==null?W1:(typeof e=="function"?Y1:H1)(e)):this.node().textContent}function X1(){this.innerHTML=""}function G1(e){return function(){this.innerHTML=e}}function V1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Z1(e){return arguments.length?this.each(e==null?X1:(typeof e=="function"?V1:G1)(e)):this.node().innerHTML}function K1(){this.nextSibling&&this.parentNode.appendChild(this)}function Q1(){return this.each(K1)}function J1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function t2(){return this.each(J1)}function e2(e){var t=typeof e=="function"?e:yu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function r2(){return null}function i2(e,t){var r=typeof e=="function"?e:yu(e),i=t==null?r2:typeof t=="function"?t:Bl(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function s2(){var e=this.parentNode;e&&e.removeChild(this)}function o2(){return this.each(s2)}function a2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function n2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function l2(e){return this.select(e?n2:a2)}function h2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function c2(e){return function(t){e.call(this,t,this.__data__)}}function d2(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function u2(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,s=t.length,o;r<s;++r)o=t[r],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++i]=o;++i?t.length=i:delete this.__on}}}function f2(e,t,r){return function(){var i=this.__on,s,o=c2(t);if(i){for(var a=0,n=i.length;a<n;++a)if((s=i[a]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=r),s.value=t;return}}this.addEventListener(e.type,o,r),s={type:e.type,name:e.name,value:t,listener:o,options:r},i?i.push(s):this.__on=[s]}}function g2(e,t,r){var i=d2(e+""),s,o=i.length,a;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(s=0,h=n[l];s<o;++s)if((a=i[s]).type===h.type&&a.name===h.name)return h.value}return}for(n=t?f2:u2,s=0;s<o;++s)this.each(n(i[s],t,r));return this}function Bu(e,t,r){var i=wu(e),s=i.CustomEvent;typeof s=="function"?s=new s(t,r):(s=i.document.createEvent("Event"),r?(s.initEvent(t,r.bubbles,r.cancelable),s.detail=r.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function p2(e,t){return function(){return Bu(this,e,t)}}function m2(e,t){return function(){return Bu(this,e,t.apply(this,arguments))}}function y2(e,t){return this.each((typeof t=="function"?m2:p2)(e,t))}function*x2(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],s=0,o=i.length,a;s<o;++s)(a=i[s])&&(yield a)}var Lu=[null];function Ce(e,t){this._groups=e,this._parents=t}function Bs(){return new Ce([[document.documentElement]],Lu)}function C2(){return this}Ce.prototype=Bs.prototype={constructor:Ce,select:Yk,selectAll:Vk,selectChild:Jk,selectChildren:i1,filter:s1,data:c1,enter:o1,exit:u1,join:f1,merge:g1,selection:C2,order:p1,sort:m1,call:x1,nodes:C1,node:b1,size:k1,empty:w1,each:S1,attr:F1,style:O1,property:D1,classed:j1,text:U1,html:Z1,raise:Q1,lower:t2,append:e2,insert:i2,remove:o2,clone:l2,datum:h2,on:g2,dispatch:y2,[Symbol.iterator]:x2};function pt(e){return typeof e=="string"?new Ce([[document.querySelector(e)]],[document.documentElement]):new Ce([[e]],Lu)}function Jo(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function El(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Ei(){}var gs=.7,ko=1/gs,ti="\\s*([+-]?\\d+)\\s*",ps="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",b2=/^#([0-9a-f]{3,8})$/,k2=new RegExp(`^rgb\\(${ti},${ti},${ti}\\)$`),w2=new RegExp(`^rgb\\(${je},${je},${je}\\)$`),S2=new RegExp(`^rgba\\(${ti},${ti},${ti},${ps}\\)$`),v2=new RegExp(`^rgba\\(${je},${je},${je},${ps}\\)$`),T2=new RegExp(`^hsl\\(${ps},${je},${je}\\)$`),_2=new RegExp(`^hsla\\(${ps},${je},${je},${ps}\\)$`),ec={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Jo(Ei,bi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:rc,formatHex:rc,formatHex8:B2,formatHsl:L2,formatRgb:ic,toString:ic});function rc(){return this.rgb().formatHex()}function B2(){return this.rgb().formatHex8()}function L2(){return Fu(this).formatHsl()}function ic(){return this.rgb().formatRgb()}function bi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=b2.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?sc(t):r===3?new he(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?zs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?zs(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=k2.exec(e))?new he(t[1],t[2],t[3],1):(t=w2.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=S2.exec(e))?zs(t[1],t[2],t[3],t[4]):(t=v2.exec(e))?zs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=T2.exec(e))?nc(t[1],t[2]/100,t[3]/100,1):(t=_2.exec(e))?nc(t[1],t[2]/100,t[3]/100,t[4]):ec.hasOwnProperty(e)?sc(ec[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function sc(e){return new he(e>>16&255,e>>8&255,e&255,1)}function zs(e,t,r,i){return i<=0&&(e=t=r=NaN),new he(e,t,r,i)}function Eu(e){return e instanceof Ei||(e=bi(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function gn(e,t,r,i){return arguments.length===1?Eu(e):new he(e,t,r,i??1)}function he(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}Jo(he,gn,El(Ei,{brighter(e){return e=e==null?ko:Math.pow(ko,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gs:Math.pow(gs,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(Fr(this.r),Fr(this.g),Fr(this.b),wo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oc,formatHex:oc,formatHex8:E2,formatRgb:ac,toString:ac}));function oc(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}`}function E2(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}${Br((isNaN(this.opacity)?1:this.opacity)*255)}`}function ac(){const e=wo(this.opacity);return`${e===1?"rgb(":"rgba("}${Fr(this.r)}, ${Fr(this.g)}, ${Fr(this.b)}${e===1?")":`, ${e})`}`}function wo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Br(e){return e=Fr(e),(e<16?"0":"")+e.toString(16)}function nc(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ee(e,t,r,i)}function Fu(e){if(e instanceof Ee)return new Ee(e.h,e.s,e.l,e.opacity);if(e instanceof Ei||(e=bi(e)),!e)return new Ee;if(e instanceof Ee)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,s=Math.min(t,r,i),o=Math.max(t,r,i),a=NaN,n=o-s,l=(o+s)/2;return n?(t===o?a=(r-i)/n+(r<i)*6:r===o?a=(i-t)/n+2:a=(t-r)/n+4,n/=l<.5?o+s:2-o-s,a*=60):n=l>0&&l<1?0:a,new Ee(a,n,l,e.opacity)}function F2(e,t,r,i){return arguments.length===1?Fu(e):new Ee(e,t,r,i??1)}function Ee(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}Jo(Ee,F2,El(Ei,{brighter(e){return e=e==null?ko:Math.pow(ko,e),new Ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gs:Math.pow(gs,e),new Ee(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,s=2*r-i;return new he(Ra(e>=240?e-240:e+120,s,i),Ra(e,s,i),Ra(e<120?e+240:e-120,s,i),this.opacity)},clamp(){return new Ee(lc(this.h),js(this.s),js(this.l),wo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=wo(this.opacity);return`${e===1?"hsl(":"hsla("}${lc(this.h)}, ${js(this.s)*100}%, ${js(this.l)*100}%${e===1?")":`, ${e})`}`}}));function lc(e){return e=(e||0)%360,e<0?e+360:e}function js(e){return Math.max(0,Math.min(1,e||0))}function Ra(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const ta=e=>()=>e;function Au(e,t){return function(r){return e+r*t}}function A2(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function M2(e,t){var r=t-e;return r?Au(e,r>180||r<-180?r-360*Math.round(r/360):r):ta(isNaN(e)?t:e)}function $2(e){return(e=+e)==1?Fl:function(t,r){return r-t?A2(t,r,e):ta(isNaN(t)?r:t)}}function Fl(e,t){var r=t-e;return r?Au(e,r):ta(isNaN(e)?t:e)}const pn=(function e(t){var r=$2(t);function i(s,o){var a=r((s=gn(s)).r,(o=gn(o)).r),n=r(s.g,o.g),l=r(s.b,o.b),c=Fl(s.opacity,o.opacity);return function(h){return s.r=a(h),s.g=n(h),s.b=l(h),s.opacity=c(h),s+""}}return i.gamma=e,i})(1);function tr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var mn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ia=new RegExp(mn.source,"g");function O2(e){return function(){return e}}function R2(e){return function(t){return e(t)+""}}function Mu(e,t){var r=mn.lastIndex=Ia.lastIndex=0,i,s,o,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=mn.exec(e))&&(s=Ia.exec(t));)(o=s.index)>r&&(o=t.slice(r,o),n[a]?n[a]+=o:n[++a]=o),(i=i[0])===(s=s[0])?n[a]?n[a]+=s:n[++a]=s:(n[++a]=null,l.push({i:a,x:tr(i,s)})),r=Ia.lastIndex;return r<t.length&&(o=t.slice(r),n[a]?n[a]+=o:n[++a]=o),n.length<2?l[0]?R2(l[0].x):O2(t):(t=l.length,function(c){for(var h=0,d;h<t;++h)n[(d=l[h]).i]=d.x(c);return n.join("")})}var hc=180/Math.PI,yn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $u(e,t,r,i,s,o){var a,n,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*r+t*i)&&(r-=e*l,i-=t*l),(n=Math.sqrt(r*r+i*i))&&(r/=n,i/=n,l/=n),e*i<t*r&&(e=-e,t=-t,l=-l,a=-a),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*hc,skewX:Math.atan(l)*hc,scaleX:a,scaleY:n}}var Ws;function I2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?yn:$u(t.a,t.b,t.c,t.d,t.e,t.f)}function P2(e){return e==null||(Ws||(Ws=document.createElementNS("http://www.w3.org/2000/svg","g")),Ws.setAttribute("transform",e),!(e=Ws.transform.baseVal.consolidate()))?yn:(e=e.matrix,$u(e.a,e.b,e.c,e.d,e.e,e.f))}function Ou(e,t,r,i){function s(c){return c.length?c.pop()+" ":""}function o(c,h,d,f,u,p){if(c!==d||h!==f){var m=u.push("translate(",null,t,null,r);p.push({i:m-4,x:tr(c,d)},{i:m-2,x:tr(h,f)})}else(d||f)&&u.push("translate("+d+t+f+r)}function a(c,h,d,f){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(s(d)+"rotate(",null,i)-2,x:tr(c,h)})):h&&d.push(s(d)+"rotate("+h+i)}function n(c,h,d,f){c!==h?f.push({i:d.push(s(d)+"skewX(",null,i)-2,x:tr(c,h)}):h&&d.push(s(d)+"skewX("+h+i)}function l(c,h,d,f,u,p){if(c!==d||h!==f){var m=u.push(s(u)+"scale(",null,",",null,")");p.push({i:m-4,x:tr(c,d)},{i:m-2,x:tr(h,f)})}else(d!==1||f!==1)&&u.push(s(u)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),o(c.translateX,c.translateY,h.translateX,h.translateY,d,f),a(c.rotate,h.rotate,d,f),n(c.skewX,h.skewX,d,f),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(u){for(var p=-1,m=f.length,y;++p<m;)d[(y=f[p]).i]=y.x(u);return d.join("")}}}var D2=Ou(I2,"px, ","px)","deg)"),N2=Ou(P2,", ",")",")"),ki=0,Qi=0,ji=0,Ru=1e3,So,Ji,vo=0,Rr=0,ea=0,ms=typeof performance=="object"&&performance.now?performance:Date,Iu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Al(){return Rr||(Iu(q2),Rr=ms.now()+ea)}function q2(){Rr=0}function To(){this._call=this._time=this._next=null}To.prototype=Pu.prototype={constructor:To,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Al():+r)+(t==null?0:+t),!this._next&&Ji!==this&&(Ji?Ji._next=this:So=this,Ji=this),this._call=e,this._time=r,xn()},stop:function(){this._call&&(this._call=null,this._time=1/0,xn())}};function Pu(e,t,r){var i=new To;return i.restart(e,t,r),i}function z2(){Al(),++ki;for(var e=So,t;e;)(t=Rr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ki}function cc(){Rr=(vo=ms.now())+ea,ki=Qi=0;try{z2()}finally{ki=0,W2(),Rr=0}}function j2(){var e=ms.now(),t=e-vo;t>Ru&&(ea-=t,vo=e)}function W2(){for(var e,t=So,r,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:So=r);Ji=e,xn(i)}function xn(e){if(!ki){Qi&&(Qi=clearTimeout(Qi));var t=e-Rr;t>24?(e<1/0&&(Qi=setTimeout(cc,e-ms.now()-ea)),ji&&(ji=clearInterval(ji))):(ji||(vo=ms.now(),ji=setInterval(j2,Ru)),ki=1,Iu(cc))}}function dc(e,t,r){var i=new To;return t=t==null?0:+t,i.restart(s=>{i.stop(),e(s+t)},t,r),i}var H2=mu("start","end","cancel","interrupt"),Y2=[],Du=0,uc=1,Cn=2,ro=3,fc=4,bn=5,io=6;function ra(e,t,r,i,s,o){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;U2(e,r,{name:t,index:i,group:s,on:H2,tween:Y2,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Du})}function Ml(e,t){var r=$e(e,t);if(r.state>Du)throw new Error("too late; already scheduled");return r}function Ge(e,t){var r=$e(e,t);if(r.state>ro)throw new Error("too late; already running");return r}function $e(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function U2(e,t,r){var i=e.__transition,s;i[t]=r,r.timer=Pu(o,0,r.time);function o(c){r.state=uc,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var h,d,f,u;if(r.state!==uc)return l();for(h in i)if(u=i[h],u.name===r.name){if(u.state===ro)return dc(a);u.state===fc?(u.state=io,u.timer.stop(),u.on.call("interrupt",e,e.__data__,u.index,u.group),delete i[h]):+h<t&&(u.state=io,u.timer.stop(),u.on.call("cancel",e,e.__data__,u.index,u.group),delete i[h])}if(dc(function(){r.state===ro&&(r.state=fc,r.timer.restart(n,r.delay,r.time),n(c))}),r.state=Cn,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Cn){for(r.state=ro,s=new Array(f=r.tween.length),h=0,d=-1;h<f;++h)(u=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(s[++d]=u);s.length=d+1}}function n(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=bn,1),d=-1,f=s.length;++d<f;)s[d].call(e,h);r.state===bn&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=io,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function X2(e,t){var r=e.__transition,i,s,o=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((i=r[a]).name!==t){o=!1;continue}s=i.state>Cn&&i.state<bn,i.state=io,i.timer.stop(),i.on.call(s?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}o&&delete e.__transition}}function G2(e){return this.each(function(){X2(this,e)})}function V2(e,t){var r,i;return function(){var s=Ge(this,e),o=s.tween;if(o!==r){i=r=o;for(var a=0,n=i.length;a<n;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}s.tween=i}}function Z2(e,t,r){var i,s;if(typeof r!="function")throw new Error;return function(){var o=Ge(this,e),a=o.tween;if(a!==i){s=(i=a).slice();for(var n={name:t,value:r},l=0,c=s.length;l<c;++l)if(s[l].name===t){s[l]=n;break}l===c&&s.push(n)}o.tween=s}}function K2(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=$e(this.node(),r).tween,s=0,o=i.length,a;s<o;++s)if((a=i[s]).name===e)return a.value;return null}return this.each((t==null?V2:Z2)(r,e,t))}function $l(e,t,r){var i=e._id;return e.each(function(){var s=Ge(this,i);(s.value||(s.value={}))[t]=r.apply(this,arguments)}),function(s){return $e(s,i).value[t]}}function Nu(e,t){var r;return(typeof t=="number"?tr:t instanceof bi?pn:(r=bi(t))?(t=r,pn):Mu)(e,t)}function Q2(e){return function(){this.removeAttribute(e)}}function J2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tw(e,t,r){var i,s=r+"",o;return function(){var a=this.getAttribute(e);return a===s?null:a===i?o:o=t(i=a,r)}}function ew(e,t,r){var i,s=r+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===s?null:a===i?o:o=t(i=a,r)}}function rw(e,t,r){var i,s,o;return function(){var a,n=r(this),l;return n==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=n+"",a===l?null:a===i&&l===s?o:(s=l,o=t(i=a,n)))}}function iw(e,t,r){var i,s,o;return function(){var a,n=r(this),l;return n==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=n+"",a===l?null:a===i&&l===s?o:(s=l,o=t(i=a,n)))}}function sw(e,t){var r=Qo(e),i=r==="transform"?N2:Nu;return this.attrTween(e,typeof t=="function"?(r.local?iw:rw)(r,i,$l(this,"attr."+e,t)):t==null?(r.local?J2:Q2)(r):(r.local?ew:tw)(r,i,t))}function ow(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function aw(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function nw(e,t){var r,i;function s(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&aw(e,o)),r}return s._value=t,s}function lw(e,t){var r,i;function s(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&ow(e,o)),r}return s._value=t,s}function hw(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=Qo(e);return this.tween(r,(i.local?nw:lw)(i,t))}function cw(e,t){return function(){Ml(this,e).delay=+t.apply(this,arguments)}}function dw(e,t){return t=+t,function(){Ml(this,e).delay=t}}function uw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cw:dw)(t,e)):$e(this.node(),t).delay}function fw(e,t){return function(){Ge(this,e).duration=+t.apply(this,arguments)}}function gw(e,t){return t=+t,function(){Ge(this,e).duration=t}}function pw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fw:gw)(t,e)):$e(this.node(),t).duration}function mw(e,t){if(typeof t!="function")throw new Error;return function(){Ge(this,e).ease=t}}function yw(e){var t=this._id;return arguments.length?this.each(mw(t,e)):$e(this.node(),t).ease}function xw(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ge(this,e).ease=r}}function Cw(e){if(typeof e!="function")throw new Error;return this.each(xw(this._id,e))}function bw(e){typeof e!="function"&&(e=Cu(e));for(var t=this._groups,r=t.length,i=new Array(r),s=0;s<r;++s)for(var o=t[s],a=o.length,n=i[s]=[],l,c=0;c<a;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&n.push(l);return new sr(i,this._parents,this._name,this._id)}function kw(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,s=r.length,o=Math.min(i,s),a=new Array(i),n=0;n<o;++n)for(var l=t[n],c=r[n],h=l.length,d=a[n]=new Array(h),f,u=0;u<h;++u)(f=l[u]||c[u])&&(d[u]=f);for(;n<i;++n)a[n]=t[n];return new sr(a,this._parents,this._name,this._id)}function ww(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function Sw(e,t,r){var i,s,o=ww(t)?Ml:Ge;return function(){var a=o(this,e),n=a.on;n!==i&&(s=(i=n).copy()).on(t,r),a.on=s}}function vw(e,t){var r=this._id;return arguments.length<2?$e(this.node(),r).on.on(e):this.each(Sw(r,e,t))}function Tw(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function _w(){return this.on("end.remove",Tw(this._id))}function Bw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Bl(e));for(var i=this._groups,s=i.length,o=new Array(s),a=0;a<s;++a)for(var n=i[a],l=n.length,c=o[a]=new Array(l),h,d,f=0;f<l;++f)(h=n[f])&&(d=e.call(h,h.__data__,f,n))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,ra(c[f],t,r,f,c,$e(h,r)));return new sr(o,this._parents,t,r)}function Lw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=xu(e));for(var i=this._groups,s=i.length,o=[],a=[],n=0;n<s;++n)for(var l=i[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var f=e.call(h,h.__data__,d,l),u,p=$e(h,r),m=0,y=f.length;m<y;++m)(u=f[m])&&ra(u,t,r,m,f,p);o.push(f),a.push(h)}return new sr(o,a,t,r)}var Ew=Bs.prototype.constructor;function Fw(){return new Ew(this._groups,this._parents)}function Aw(e,t){var r,i,s;return function(){var o=Ci(this,e),a=(this.style.removeProperty(e),Ci(this,e));return o===a?null:o===r&&a===i?s:s=t(r=o,i=a)}}function qu(e){return function(){this.style.removeProperty(e)}}function Mw(e,t,r){var i,s=r+"",o;return function(){var a=Ci(this,e);return a===s?null:a===i?o:o=t(i=a,r)}}function $w(e,t,r){var i,s,o;return function(){var a=Ci(this,e),n=r(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),Ci(this,e))),a===l?null:a===i&&l===s?o:(s=l,o=t(i=a,n))}}function Ow(e,t){var r,i,s,o="style."+t,a="end."+o,n;return function(){var l=Ge(this,e),c=l.on,h=l.value[o]==null?n||(n=qu(t)):void 0;(c!==r||s!==h)&&(i=(r=c).copy()).on(a,s=h),l.on=i}}function Rw(e,t,r){var i=(e+="")=="transform"?D2:Nu;return t==null?this.styleTween(e,Aw(e,i)).on("end.style."+e,qu(e)):typeof t=="function"?this.styleTween(e,$w(e,i,$l(this,"style."+e,t))).each(Ow(this._id,e)):this.styleTween(e,Mw(e,i,t),r).on("end.style."+e,null)}function Iw(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function Pw(e,t,r){var i,s;function o(){var a=t.apply(this,arguments);return a!==s&&(i=(s=a)&&Iw(e,a,r)),i}return o._value=t,o}function Dw(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,Pw(e,t,r??""))}function Nw(e){return function(){this.textContent=e}}function qw(e){return function(){var t=e(this);this.textContent=t??""}}function zw(e){return this.tween("text",typeof e=="function"?qw($l(this,"text",e)):Nw(e==null?"":e+""))}function jw(e){return function(t){this.textContent=e.call(this,t)}}function Ww(e){var t,r;function i(){var s=e.apply(this,arguments);return s!==r&&(t=(r=s)&&jw(s)),t}return i._value=e,i}function Hw(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Ww(e))}function Yw(){for(var e=this._name,t=this._id,r=zu(),i=this._groups,s=i.length,o=0;o<s;++o)for(var a=i[o],n=a.length,l,c=0;c<n;++c)if(l=a[c]){var h=$e(l,t);ra(l,e,r,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new sr(i,this._parents,e,r)}function Uw(){var e,t,r=this,i=r._id,s=r.size();return new Promise(function(o,a){var n={value:a},l={value:function(){--s===0&&o()}};r.each(function(){var c=Ge(this,i),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(n),t._.interrupt.push(n),t._.end.push(l)),c.on=t}),s===0&&o()})}var Xw=0;function sr(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function zu(){return++Xw}var Ke=Bs.prototype;sr.prototype={constructor:sr,select:Bw,selectAll:Lw,selectChild:Ke.selectChild,selectChildren:Ke.selectChildren,filter:bw,merge:kw,selection:Fw,transition:Yw,call:Ke.call,nodes:Ke.nodes,node:Ke.node,size:Ke.size,empty:Ke.empty,each:Ke.each,on:vw,attr:sw,attrTween:hw,style:Rw,styleTween:Dw,text:zw,textTween:Hw,remove:_w,tween:K2,delay:uw,duration:pw,ease:yw,easeVarying:Cw,end:Uw,[Symbol.iterator]:Ke[Symbol.iterator]};function Gw(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Vw={time:null,delay:0,duration:250,ease:Gw};function Zw(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Kw(e){var t,r;e instanceof sr?(t=e._id,e=e._name):(t=zu(),(r=Vw).time=Al(),e=e==null?null:e+"");for(var i=this._groups,s=i.length,o=0;o<s;++o)for(var a=i[o],n=a.length,l,c=0;c<n;++c)(l=a[c])&&ra(l,e,t,c,a,r||Zw(l,t));return new sr(i,this._parents,e,t)}Bs.prototype.interrupt=G2;Bs.prototype.transition=Kw;const kn=Math.PI,wn=2*kn,wr=1e-6,Qw=wn-wr;function ju(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Jw(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ju;const r=10**t;return function(i){this._+=i[0];for(let s=1,o=i.length;s<o;++s)this._+=Math.round(arguments[s]*r)/r+i[s]}}class tS{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ju:Jw(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,s){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+s}`}bezierCurveTo(t,r,i,s,o,a){this._append`C${+t},${+r},${+i},${+s},${this._x1=+o},${this._y1=+a}`}arcTo(t,r,i,s,o){if(t=+t,r=+r,i=+i,s=+s,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,n=this._y1,l=i-t,c=s-r,h=a-t,d=n-r,f=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(f>wr)if(!(Math.abs(d*l-c*h)>wr)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let u=i-a,p=s-n,m=l*l+c*c,y=u*u+p*p,x=Math.sqrt(m),C=Math.sqrt(f),k=o*Math.tan((kn-Math.acos((m+f-y)/(2*x*C)))/2),v=k/C,S=k/x;Math.abs(v-1)>wr&&this._append`L${t+v*h},${r+v*d}`,this._append`A${o},${o},0,0,${+(d*u>h*p)},${this._x1=t+S*l},${this._y1=r+S*c}`}}arc(t,r,i,s,o,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(s),l=i*Math.sin(s),c=t+n,h=r+l,d=1^a,f=a?s-o:o-s;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>wr||Math.abs(this._y1-h)>wr)&&this._append`L${c},${h}`,i&&(f<0&&(f=f%wn+wn),f>Qw?this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:f>wr&&this._append`A${i},${i},0,${+(f>=kn)},${d},${this._x1=t+i*Math.cos(o)},${this._y1=r+i*Math.sin(o)}`)}rect(t,r,i,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+s}h${-i}Z`}toString(){return this._}}function Sr(e){return function(){return e}}const eS=Math.abs,rS=Math.atan2,iS=Math.cos,sS=Math.max,oS=Math.min,aS=Math.sin,nS=Math.sqrt,Sn=1e-12,ia=Math.PI,vn=ia/2,lS=2*ia;function hS(e){return e>1?0:e<-1?ia:Math.acos(e)}function cS(e){return e>=1?vn:e<=-1?-vn:Math.asin(e)}function Wu(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new tS(t)}function Hu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Yu(e){this._context=e}Yu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ls(e){return new Yu(e)}function dS(e){return e[0]}function uS(e){return e[1]}function Uu(e,t){var r=Sr(!0),i=null,s=ls,o=null,a=Wu(n);e=typeof e=="function"?e:e===void 0?dS:Sr(e),t=typeof t=="function"?t:t===void 0?uS:Sr(t);function n(l){var c,h=(l=Hu(l)).length,d,f=!1,u;for(i==null&&(o=s(u=a())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(d,c,l),+t(d,c,l));if(u)return o=null,u+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:Sr(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:Sr(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Sr(!!l),n):r},n.curve=function(l){return arguments.length?(s=l,i!=null&&(o=s(i)),n):s},n.context=function(l){return arguments.length?(l==null?i=o=null:o=s(i=l),n):i},n}class Xu{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Gu(e){return new Xu(e,!0)}function Vu(e){return new Xu(e,!1)}function fr(){}function _o(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function sa(e){this._context=e}sa.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:_o(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:_o(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bo(e){return new sa(e)}function Zu(e){this._context=e}Zu.prototype={areaStart:fr,areaEnd:fr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:_o(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fS(e){return new Zu(e)}function Ku(e){this._context=e}Ku.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:_o(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gS(e){return new Ku(e)}function Qu(e,t){this._basis=new sa(e),this._beta=t}Qu.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],s=t[0],o=e[r]-i,a=t[r]-s,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*o),this._beta*t[n]+(1-this._beta)*(s+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const pS=(function e(t){function r(i){return t===1?new sa(i):new Qu(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function Lo(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Ol(e,t){this._context=e,this._k=(1-t)/6}Ol.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Lo(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Lo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Ju=(function e(t){function r(i){return new Ol(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Rl(e,t){this._context=e,this._k=(1-t)/6}Rl.prototype={areaStart:fr,areaEnd:fr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Lo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const mS=(function e(t){function r(i){return new Rl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Il(e,t){this._context=e,this._k=(1-t)/6}Il.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Lo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const yS=(function e(t){function r(i){return new Il(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Pl(e,t,r){var i=e._x1,s=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Sn){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,s=(s*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Sn){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,s,o,a,e._x2,e._y2)}function tf(e,t){this._context=e,this._alpha=t}tf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Pl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ef=(function e(t){function r(i){return t?new tf(i,t):new Ol(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function rf(e,t){this._context=e,this._alpha=t}rf.prototype={areaStart:fr,areaEnd:fr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Pl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const xS=(function e(t){function r(i){return t?new rf(i,t):new Rl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function sf(e,t){this._context=e,this._alpha=t}sf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Pl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const CS=(function e(t){function r(i){return t?new sf(i,t):new Il(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function of(e){this._context=e}of.prototype={areaStart:fr,areaEnd:fr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function bS(e){return new of(e)}function gc(e){return e<0?-1:1}function pc(e,t,r){var i=e._x1-e._x0,s=t-e._x1,o=(e._y1-e._y0)/(i||s<0&&-0),a=(r-e._y1)/(s||i<0&&-0),n=(o*s+a*i)/(i+s);return(gc(o)+gc(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(n))||0}function mc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Pa(e,t,r){var i=e._x0,s=e._y0,o=e._x1,a=e._y1,n=(o-i)/3;e._context.bezierCurveTo(i+n,s+n*t,o-n,a-n*r,o,a)}function Eo(e){this._context=e}Eo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Pa(this,this._t0,mc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Pa(this,mc(this,r=pc(this,e,t)),r);break;default:Pa(this,this._t0,r=pc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function af(e){this._context=new nf(e)}(af.prototype=Object.create(Eo.prototype)).point=function(e,t){Eo.prototype.point.call(this,t,e)};function nf(e){this._context=e}nf.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,s,o){this._context.bezierCurveTo(t,e,i,r,o,s)}};function lf(e){return new Eo(e)}function hf(e){return new af(e)}function cf(e){this._context=e}cf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=yc(e),s=yc(t),o=0,a=1;a<r;++o,++a)this._context.bezierCurveTo(i[0][o],s[0][o],i[1][o],s[1][o],e[a],t[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function yc(e){var t,r=e.length-1,i,s=new Array(r),o=new Array(r),a=new Array(r);for(s[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=s[t]/o[t-1],o[t]-=i,a[t]-=i*a[t-1];for(s[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)s[t]=(a[t]-s[t+1])/o[t];for(o[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-s[t+1];return[s,o]}function df(e){return new cf(e)}function oa(e,t){this._context=e,this._t=t}oa.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function uf(e){return new oa(e,.5)}function ff(e){return new oa(e,0)}function gf(e){return new oa(e,1)}function ts(e,t,r){this.k=e,this.x=t,this.y=r}ts.prototype={constructor:ts,scale:function(e){return e===1?this:new ts(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ts(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};ts.prototype;var pf=g(e=>{const{securityLevel:t}=wt();let r=pt("body");if(t==="sandbox"){const o=pt(`#i${e}`).node()?.contentDocument??document;r=pt(o.body)}return r.select(`#${e}`)},"selectSvgElement");function Dl(e){return typeof e>"u"||e===null}g(Dl,"isNothing");function mf(e){return typeof e=="object"&&e!==null}g(mf,"isObject");function yf(e){return Array.isArray(e)?e:Dl(e)?[]:[e]}g(yf,"toArray");function xf(e,t){var r,i,s,o;if(t)for(o=Object.keys(t),r=0,i=o.length;r<i;r+=1)s=o[r],e[s]=t[s];return e}g(xf,"extend");function Cf(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}g(Cf,"repeat");function bf(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}g(bf,"isNegativeZero");var kS=Dl,wS=mf,SS=yf,vS=Cf,TS=bf,_S=xf,Wt={isNothing:kS,isObject:wS,toArray:SS,repeat:vS,isNegativeZero:TS,extend:_S};function Nl(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
132
|
+
|
|
133
|
+
`+e.mark.snippet),i+" "+r):i}g(Nl,"formatError");function wi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Nl(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}g(wi,"YAMLException$1");wi.prototype=Object.create(Error.prototype);wi.prototype.constructor=wi;wi.prototype.toString=g(function(t){return this.name+": "+Nl(this,t)},"toString");var ge=wi;function so(e,t,r,i,s){var o="",a="",n=Math.floor(s/2)-1;return i-t>n&&(o=" ... ",t=i-n+o.length),r-i>n&&(a=" ...",r=i+n-a.length),{str:o+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+o.length}}g(so,"getLine");function oo(e,t){return Wt.repeat(" ",t-e.length)+e}g(oo,"padStart");function kf(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],s=[],o,a=-1;o=r.exec(e.buffer);)s.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var n="",l,c,h=Math.min(e.line+t.linesAfter,s.length).toString().length,d=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)c=so(e.buffer,i[a-l],s[a-l],e.position-(i[a]-i[a-l]),d),n=Wt.repeat(" ",t.indent)+oo((e.line-l+1).toString(),h)+" | "+c.str+`
|
|
134
|
+
`+n;for(c=so(e.buffer,i[a],s[a],e.position,d),n+=Wt.repeat(" ",t.indent)+oo((e.line+1).toString(),h)+" | "+c.str+`
|
|
135
|
+
`,n+=Wt.repeat("-",t.indent+h+3+c.pos)+`^
|
|
136
|
+
`,l=1;l<=t.linesAfter&&!(a+l>=s.length);l++)c=so(e.buffer,i[a+l],s[a+l],e.position-(i[a]-i[a+l]),d),n+=Wt.repeat(" ",t.indent)+oo((e.line+l+1).toString(),h)+" | "+c.str+`
|
|
137
|
+
`;return n.replace(/\n$/,"")}g(kf,"makeSnippet");var BS=kf,LS=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ES=["scalar","sequence","mapping"];function wf(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}g(wf,"compileStyleAliases");function Sf(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(LS.indexOf(r)===-1)throw new ge('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=wf(t.styleAliases||null),ES.indexOf(this.kind)===-1)throw new ge('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}g(Sf,"Type$1");var ee=Sf;function Tn(e,t){var r=[];return e[t].forEach(function(i){var s=r.length;r.forEach(function(o,a){o.tag===i.tag&&o.kind===i.kind&&o.multi===i.multi&&(s=a)}),r[s]=i}),r}g(Tn,"compileList");function vf(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(s){s.multi?(e.multi[s.kind].push(s),e.multi.fallback.push(s)):e[s.kind][s.tag]=e.fallback[s.tag]=s}for(g(i,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}g(vf,"compileMap");function Fo(e){return this.extend(e)}g(Fo,"Schema$1");Fo.prototype.extend=g(function(t){var r=[],i=[];if(t instanceof ee)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new ge("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(o){if(!(o instanceof ee))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new ge("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new ge("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(o){if(!(o instanceof ee))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var s=Object.create(Fo.prototype);return s.implicit=(this.implicit||[]).concat(r),s.explicit=(this.explicit||[]).concat(i),s.compiledImplicit=Tn(s,"implicit"),s.compiledExplicit=Tn(s,"explicit"),s.compiledTypeMap=vf(s.compiledImplicit,s.compiledExplicit),s},"extend");var FS=Fo,AS=new ee("tag:yaml.org,2002:str",{kind:"scalar",construct:g(function(e){return e!==null?e:""},"construct")}),MS=new ee("tag:yaml.org,2002:seq",{kind:"sequence",construct:g(function(e){return e!==null?e:[]},"construct")}),$S=new ee("tag:yaml.org,2002:map",{kind:"mapping",construct:g(function(e){return e!==null?e:{}},"construct")}),OS=new FS({explicit:[AS,MS,$S]});function Tf(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}g(Tf,"resolveYamlNull");function _f(){return null}g(_f,"constructYamlNull");function Bf(e){return e===null}g(Bf,"isNull");var RS=new ee("tag:yaml.org,2002:null",{kind:"scalar",resolve:Tf,construct:_f,predicate:Bf,represent:{canonical:g(function(){return"~"},"canonical"),lowercase:g(function(){return"null"},"lowercase"),uppercase:g(function(){return"NULL"},"uppercase"),camelcase:g(function(){return"Null"},"camelcase"),empty:g(function(){return""},"empty")},defaultStyle:"lowercase"});function Lf(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}g(Lf,"resolveYamlBoolean");function Ef(e){return e==="true"||e==="True"||e==="TRUE"}g(Ef,"constructYamlBoolean");function Ff(e){return Object.prototype.toString.call(e)==="[object Boolean]"}g(Ff,"isBoolean");var IS=new ee("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Lf,construct:Ef,predicate:Ff,represent:{lowercase:g(function(e){return e?"true":"false"},"lowercase"),uppercase:g(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:g(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function Af(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}g(Af,"isHexCode");function Mf(e){return 48<=e&&e<=55}g(Mf,"isOctCode");function $f(e){return 48<=e&&e<=57}g($f,"isDecCode");function Of(e){if(e===null)return!1;var t=e.length,r=0,i=!1,s;if(!t)return!1;if(s=e[r],(s==="-"||s==="+")&&(s=e[++r]),s==="0"){if(r+1===t)return!0;if(s=e[++r],s==="b"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(s!=="0"&&s!=="1")return!1;i=!0}return i&&s!=="_"}if(s==="x"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!Af(e.charCodeAt(r)))return!1;i=!0}return i&&s!=="_"}if(s==="o"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!Mf(e.charCodeAt(r)))return!1;i=!0}return i&&s!=="_"}}if(s==="_")return!1;for(;r<t;r++)if(s=e[r],s!=="_"){if(!$f(e.charCodeAt(r)))return!1;i=!0}return!(!i||s==="_")}g(Of,"resolveYamlInteger");function Rf(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}g(Rf,"constructYamlInteger");function If(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Wt.isNegativeZero(e)}g(If,"isInteger");var PS=new ee("tag:yaml.org,2002:int",{kind:"scalar",resolve:Of,construct:Rf,predicate:If,represent:{binary:g(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:g(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:g(function(e){return e.toString(10)},"decimal"),hexadecimal:g(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),DS=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Pf(e){return!(e===null||!DS.test(e)||e[e.length-1]==="_")}g(Pf,"resolveYamlFloat");function Df(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}g(Df,"constructYamlFloat");var NS=/^[-+]?[0-9]+e/;function Nf(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Wt.isNegativeZero(e))return"-0.0";return r=e.toString(10),NS.test(r)?r.replace("e",".e"):r}g(Nf,"representYamlFloat");function qf(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Wt.isNegativeZero(e))}g(qf,"isFloat");var qS=new ee("tag:yaml.org,2002:float",{kind:"scalar",resolve:Pf,construct:Df,predicate:qf,represent:Nf,defaultStyle:"lowercase"}),zf=OS.extend({implicit:[RS,IS,PS,qS]}),zS=zf,jf=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Wf=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Hf(e){return e===null?!1:jf.exec(e)!==null||Wf.exec(e)!==null}g(Hf,"resolveYamlTimestamp");function Yf(e){var t,r,i,s,o,a,n,l=0,c=null,h,d,f;if(t=jf.exec(e),t===null&&(t=Wf.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(r,i,s));if(o=+t[4],a=+t[5],n=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=+t[10],d=+(t[11]||0),c=(h*60+d)*6e4,t[9]==="-"&&(c=-c)),f=new Date(Date.UTC(r,i,s,o,a,n,l)),c&&f.setTime(f.getTime()-c),f}g(Yf,"constructYamlTimestamp");function Uf(e){return e.toISOString()}g(Uf,"representYamlTimestamp");var jS=new ee("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Hf,construct:Yf,instanceOf:Date,represent:Uf});function Xf(e){return e==="<<"||e===null}g(Xf,"resolveYamlMerge");var WS=new ee("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Xf}),ql=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
138
|
+
\r`;function Gf(e){if(e===null)return!1;var t,r,i=0,s=e.length,o=ql;for(r=0;r<s;r++)if(t=o.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}g(Gf,"resolveYamlBinary");function Vf(e){var t,r,i=e.replace(/[\r\n=]/g,""),s=i.length,o=ql,a=0,n=[];for(t=0;t<s;t++)t%4===0&&t&&(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)),a=a<<6|o.indexOf(i.charAt(t));return r=s%4*6,r===0?(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)):r===18?(n.push(a>>10&255),n.push(a>>2&255)):r===12&&n.push(a>>4&255),new Uint8Array(n)}g(Vf,"constructYamlBinary");function Zf(e){var t="",r=0,i,s,o=e.length,a=ql;for(i=0;i<o;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return s=o%3,s===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):s===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):s===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}g(Zf,"representYamlBinary");function Kf(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}g(Kf,"isBinary");var HS=new ee("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Gf,construct:Vf,predicate:Kf,represent:Zf}),YS=Object.prototype.hasOwnProperty,US=Object.prototype.toString;function Qf(e){if(e===null)return!0;var t=[],r,i,s,o,a,n=e;for(r=0,i=n.length;r<i;r+=1){if(s=n[r],a=!1,US.call(s)!=="[object Object]")return!1;for(o in s)if(YS.call(s,o))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}g(Qf,"resolveYamlOmap");function Jf(e){return e!==null?e:[]}g(Jf,"constructYamlOmap");var XS=new ee("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Qf,construct:Jf}),GS=Object.prototype.toString;function tg(e){if(e===null)return!0;var t,r,i,s,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],GS.call(i)!=="[object Object]"||(s=Object.keys(i),s.length!==1))return!1;o[t]=[s[0],i[s[0]]]}return!0}g(tg,"resolveYamlPairs");function eg(e){if(e===null)return[];var t,r,i,s,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],s=Object.keys(i),o[t]=[s[0],i[s[0]]];return o}g(eg,"constructYamlPairs");var VS=new ee("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:tg,construct:eg}),ZS=Object.prototype.hasOwnProperty;function rg(e){if(e===null)return!0;var t,r=e;for(t in r)if(ZS.call(r,t)&&r[t]!==null)return!1;return!0}g(rg,"resolveYamlSet");function ig(e){return e!==null?e:{}}g(ig,"constructYamlSet");var KS=new ee("tag:yaml.org,2002:set",{kind:"mapping",resolve:rg,construct:ig}),sg=zS.extend({implicit:[jS,WS],explicit:[HS,XS,VS,KS]}),gr=Object.prototype.hasOwnProperty,Ao=1,og=2,ag=3,Mo=4,Da=1,QS=2,xc=3,JS=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,tv=/[\x85\u2028\u2029]/,ev=/[,\[\]\{\}]/,ng=/^(?:!|!!|![a-z\-]+!)$/i,lg=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _n(e){return Object.prototype.toString.call(e)}g(_n,"_class");function Fe(e){return e===10||e===13}g(Fe,"is_EOL");function ur(e){return e===9||e===32}g(ur,"is_WHITE_SPACE");function ce(e){return e===9||e===32||e===10||e===13}g(ce,"is_WS_OR_EOL");function Lr(e){return e===44||e===91||e===93||e===123||e===125}g(Lr,"is_FLOW_INDICATOR");function hg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}g(hg,"fromHexCode");function cg(e){return e===120?2:e===117?4:e===85?8:0}g(cg,"escapedHexLen");function dg(e){return 48<=e&&e<=57?e-48:-1}g(dg,"fromDecimalCode");function Bn(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
139
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}g(Bn,"simpleEscapeSequence");function ug(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}g(ug,"charFromCodepoint");function zl(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}g(zl,"setProperty");var fg=new Array(256),gg=new Array(256);for(Cr=0;Cr<256;Cr++)fg[Cr]=Bn(Cr)?1:0,gg[Cr]=Bn(Cr);var Cr;function pg(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||sg,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}g(pg,"State$1");function jl(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=BS(r),new ge(t,r)}g(jl,"generateError");function at(e,t){throw jl(e,t)}g(at,"throwError");function ys(e,t){e.onWarning&&e.onWarning.call(null,jl(e,t))}g(ys,"throwWarning");var Cc={YAML:g(function(t,r,i){var s,o,a;t.version!==null&&at(t,"duplication of %YAML directive"),i.length!==1&&at(t,"YAML directive accepts exactly one argument"),s=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),s===null&&at(t,"ill-formed argument of the YAML directive"),o=parseInt(s[1],10),a=parseInt(s[2],10),o!==1&&at(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&ys(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:g(function(t,r,i){var s,o;i.length!==2&&at(t,"TAG directive accepts exactly two arguments"),s=i[0],o=i[1],ng.test(s)||at(t,"ill-formed tag handle (first argument) of the TAG directive"),gr.call(t.tagMap,s)&&at(t,'there is a previously declared suffix for "'+s+'" tag handle'),lg.test(o)||at(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{at(t,"tag prefix is malformed: "+o)}t.tagMap[s]=o},"handleTagDirective")};function ir(e,t,r,i){var s,o,a,n;if(t<r){if(n=e.input.slice(t,r),i)for(s=0,o=n.length;s<o;s+=1)a=n.charCodeAt(s),a===9||32<=a&&a<=1114111||at(e,"expected valid JSON character");else JS.test(n)&&at(e,"the stream contains non-printable characters");e.result+=n}}g(ir,"captureSegment");function Ln(e,t,r,i){var s,o,a,n;for(Wt.isObject(r)||at(e,"cannot merge mappings; the provided source object is unacceptable"),s=Object.keys(r),a=0,n=s.length;a<n;a+=1)o=s[a],gr.call(t,o)||(zl(t,o,r[o]),i[o]=!0)}g(Ln,"mergeMappings");function Er(e,t,r,i,s,o,a,n,l){var c,h;if(Array.isArray(s))for(s=Array.prototype.slice.call(s),c=0,h=s.length;c<h;c+=1)Array.isArray(s[c])&&at(e,"nested arrays are not supported inside keys"),typeof s=="object"&&_n(s[c])==="[object Object]"&&(s[c]="[object Object]");if(typeof s=="object"&&_n(s)==="[object Object]"&&(s="[object Object]"),s=String(s),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(c=0,h=o.length;c<h;c+=1)Ln(e,t,o[c],r);else Ln(e,t,o,r);else!e.json&&!gr.call(r,s)&&gr.call(t,s)&&(e.line=a||e.line,e.lineStart=n||e.lineStart,e.position=l||e.position,at(e,"duplicated mapping key")),zl(t,s,o),delete r[s];return t}g(Er,"storeMappingPair");function aa(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):at(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}g(aa,"readLineBreak");function Dt(e,t,r){for(var i=0,s=e.input.charCodeAt(e.position);s!==0;){for(;ur(s);)s===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),s=e.input.charCodeAt(++e.position);if(t&&s===35)do s=e.input.charCodeAt(++e.position);while(s!==10&&s!==13&&s!==0);if(Fe(s))for(aa(e),s=e.input.charCodeAt(e.position),i++,e.lineIndent=0;s===32;)e.lineIndent++,s=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&ys(e,"deficient indentation"),i}g(Dt,"skipSeparationSpace");function Ls(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||ce(r)))}g(Ls,"testDocumentSeparator");function na(e,t){t===1?e.result+=" ":t>1&&(e.result+=Wt.repeat(`
|
|
140
|
+
`,t-1))}g(na,"writeFoldedLines");function mg(e,t,r){var i,s,o,a,n,l,c,h,d=e.kind,f=e.result,u;if(u=e.input.charCodeAt(e.position),ce(u)||Lr(u)||u===35||u===38||u===42||u===33||u===124||u===62||u===39||u===34||u===37||u===64||u===96||(u===63||u===45)&&(s=e.input.charCodeAt(e.position+1),ce(s)||r&&Lr(s)))return!1;for(e.kind="scalar",e.result="",o=a=e.position,n=!1;u!==0;){if(u===58){if(s=e.input.charCodeAt(e.position+1),ce(s)||r&&Lr(s))break}else if(u===35){if(i=e.input.charCodeAt(e.position-1),ce(i))break}else{if(e.position===e.lineStart&&Ls(e)||r&&Lr(u))break;if(Fe(u))if(l=e.line,c=e.lineStart,h=e.lineIndent,Dt(e,!1,-1),e.lineIndent>=t){n=!0,u=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=h;break}}n&&(ir(e,o,a,!1),na(e,e.line-l),o=a=e.position,n=!1),ur(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return ir(e,o,a,!1),e.result?!0:(e.kind=d,e.result=f,!1)}g(mg,"readPlainScalar");function yg(e,t){var r,i,s;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=s=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(ir(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,s=e.position;else return!0;else Fe(r)?(ir(e,i,s,!0),na(e,Dt(e,!1,t)),i=s=e.position):e.position===e.lineStart&&Ls(e)?at(e,"unexpected end of the document within a single quoted scalar"):(e.position++,s=e.position);at(e,"unexpected end of the stream within a single quoted scalar")}g(yg,"readSingleQuotedScalar");function xg(e,t){var r,i,s,o,a,n;if(n=e.input.charCodeAt(e.position),n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return ir(e,r,e.position,!0),e.position++,!0;if(n===92){if(ir(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),Fe(n))Dt(e,!1,t);else if(n<256&&fg[n])e.result+=gg[n],e.position++;else if((a=cg(n))>0){for(s=a,o=0;s>0;s--)n=e.input.charCodeAt(++e.position),(a=hg(n))>=0?o=(o<<4)+a:at(e,"expected hexadecimal character");e.result+=ug(o),e.position++}else at(e,"unknown escape sequence");r=i=e.position}else Fe(n)?(ir(e,r,i,!0),na(e,Dt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Ls(e)?at(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}at(e,"unexpected end of the stream within a double quoted scalar")}g(xg,"readDoubleQuotedScalar");function Cg(e,t){var r=!0,i,s,o,a=e.tag,n,l=e.anchor,c,h,d,f,u,p=Object.create(null),m,y,x,C;if(C=e.input.charCodeAt(e.position),C===91)h=93,u=!1,n=[];else if(C===123)h=125,u=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),C=e.input.charCodeAt(++e.position);C!==0;){if(Dt(e,!0,t),C=e.input.charCodeAt(e.position),C===h)return e.position++,e.tag=a,e.anchor=l,e.kind=u?"mapping":"sequence",e.result=n,!0;r?C===44&&at(e,"expected the node content, but found ','"):at(e,"missed comma between flow collection entries"),y=m=x=null,d=f=!1,C===63&&(c=e.input.charCodeAt(e.position+1),ce(c)&&(d=f=!0,e.position++,Dt(e,!0,t))),i=e.line,s=e.lineStart,o=e.position,Ir(e,t,Ao,!1,!0),y=e.tag,m=e.result,Dt(e,!0,t),C=e.input.charCodeAt(e.position),(f||e.line===i)&&C===58&&(d=!0,C=e.input.charCodeAt(++e.position),Dt(e,!0,t),Ir(e,t,Ao,!1,!0),x=e.result),u?Er(e,n,p,y,m,x,i,s,o):d?n.push(Er(e,null,p,y,m,x,i,s,o)):n.push(m),Dt(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}at(e,"unexpected end of the stream within a flow collection")}g(Cg,"readFlowCollection");function bg(e,t){var r,i,s=Da,o=!1,a=!1,n=t,l=0,c=!1,h,d;if(d=e.input.charCodeAt(e.position),d===124)i=!1;else if(d===62)i=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Da===s?s=d===43?xc:QS:at(e,"repeat of a chomping mode identifier");else if((h=dg(d))>=0)h===0?at(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?at(e,"repeat of an indentation width identifier"):(n=t+h-1,a=!0);else break;if(ur(d)){do d=e.input.charCodeAt(++e.position);while(ur(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Fe(d)&&d!==0)}for(;d!==0;){for(aa(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!a||e.lineIndent<n)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>n&&(n=e.lineIndent),Fe(d)){l++;continue}if(e.lineIndent<n){s===xc?e.result+=Wt.repeat(`
|
|
141
|
+
`,o?1+l:l):s===Da&&o&&(e.result+=`
|
|
142
|
+
`);break}for(i?ur(d)?(c=!0,e.result+=Wt.repeat(`
|
|
143
|
+
`,o?1+l:l)):c?(c=!1,e.result+=Wt.repeat(`
|
|
144
|
+
`,l+1)):l===0?o&&(e.result+=" "):e.result+=Wt.repeat(`
|
|
145
|
+
`,l):e.result+=Wt.repeat(`
|
|
146
|
+
`,o?1+l:l),o=!0,a=!0,l=0,r=e.position;!Fe(d)&&d!==0;)d=e.input.charCodeAt(++e.position);ir(e,r,e.position,!1)}return!0}g(bg,"readBlockScalar");function En(e,t){var r,i=e.tag,s=e.anchor,o=[],a,n=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,at(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!ce(a))));){if(n=!0,e.position++,Dt(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Ir(e,t,ag,!1,!0),o.push(e.result),Dt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)at(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return n?(e.tag=i,e.anchor=s,e.kind="sequence",e.result=o,!0):!1}g(En,"readBlockSequence");function kg(e,t,r){var i,s,o,a,n,l,c=e.tag,h=e.anchor,d={},f=Object.create(null),u=null,p=null,m=null,y=!1,x=!1,C;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),C=e.input.charCodeAt(e.position);C!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,at(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),o=e.line,(C===63||C===58)&&ce(i))C===63?(y&&(Er(e,d,f,u,p,null,a,n,l),u=p=m=null),x=!0,y=!0,s=!0):y?(y=!1,s=!0):at(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,C=i;else{if(a=e.line,n=e.lineStart,l=e.position,!Ir(e,r,og,!1,!0))break;if(e.line===o){for(C=e.input.charCodeAt(e.position);ur(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),ce(C)||at(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Er(e,d,f,u,p,null,a,n,l),u=p=m=null),x=!0,y=!1,s=!1,u=e.tag,p=e.result;else if(x)at(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=h,!0}else if(x)at(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=h,!0}if((e.line===o||e.lineIndent>t)&&(y&&(a=e.line,n=e.lineStart,l=e.position),Ir(e,t,Mo,!0,s)&&(y?p=e.result:m=e.result),y||(Er(e,d,f,u,p,m,a,n,l),u=p=m=null),Dt(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&C!==0)at(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Er(e,d,f,u,p,null,a,n,l),x&&(e.tag=c,e.anchor=h,e.kind="mapping",e.result=d),x}g(kg,"readBlockMapping");function wg(e){var t,r=!1,i=!1,s,o,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&at(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,s="!!",a=e.input.charCodeAt(++e.position)):s="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(o=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):at(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!ce(a);)a===33&&(i?at(e,"tag suffix cannot contain exclamation marks"):(s=e.input.slice(t-1,e.position+1),ng.test(s)||at(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),ev.test(o)&&at(e,"tag suffix cannot contain flow indicator characters")}o&&!lg.test(o)&&at(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{at(e,"tag name is malformed: "+o)}return r?e.tag=o:gr.call(e.tagMap,s)?e.tag=e.tagMap[s]+o:s==="!"?e.tag="!"+o:s==="!!"?e.tag="tag:yaml.org,2002:"+o:at(e,'undeclared tag handle "'+s+'"'),!0}g(wg,"readTagProperty");function Sg(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&at(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!ce(r)&&!Lr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&at(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}g(Sg,"readAnchorProperty");function vg(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!ce(i)&&!Lr(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&at(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),gr.call(e.anchorMap,r)||at(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Dt(e,!0,-1),!0}g(vg,"readAlias");function Ir(e,t,r,i,s){var o,a,n,l=1,c=!1,h=!1,d,f,u,p,m,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=n=Mo===r||ag===r,i&&Dt(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;wg(e)||Sg(e);)Dt(e,!0,-1)?(c=!0,n=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):n=!1;if(n&&(n=c||s),(l===1||Mo===r)&&(Ao===r||og===r?m=t:m=t+1,y=e.position-e.lineStart,l===1?n&&(En(e,y)||kg(e,y,m))||Cg(e,m)?h=!0:(a&&bg(e,m)||yg(e,m)||xg(e,m)?h=!0:vg(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&at(e,"alias node should not have any properties")):mg(e,m,Ao===r)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(h=n&&En(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&at(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d<f;d+=1)if(p=e.implicitTypes[d],p.resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(gr.call(e.typeMap[e.kind||"fallback"],e.tag))p=e.typeMap[e.kind||"fallback"][e.tag];else for(p=null,u=e.typeMap.multi[e.kind||"fallback"],d=0,f=u.length;d<f;d+=1)if(e.tag.slice(0,u[d].tag.length)===u[d].tag){p=u[d];break}p||at(e,"unknown tag !<"+e.tag+">"),e.result!==null&&p.kind!==e.kind&&at(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result,e.tag)?(e.result=p.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):at(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}g(Ir,"composeNode");function Tg(e){var t=e.position,r,i,s,o=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(Dt(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(o=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!ce(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),s=[],i.length<1&&at(e,"directive name must not be less than one character in length");a!==0;){for(;ur(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!Fe(a));break}if(Fe(a))break;for(r=e.position;a!==0&&!ce(a);)a=e.input.charCodeAt(++e.position);s.push(e.input.slice(r,e.position))}a!==0&&aa(e),gr.call(Cc,i)?Cc[i](e,i,s):ys(e,'unknown document directive "'+i+'"')}if(Dt(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Dt(e,!0,-1)):o&&at(e,"directives end mark is expected"),Ir(e,e.lineIndent-1,Mo,!1,!0),Dt(e,!0,-1),e.checkLineBreaks&&tv.test(e.input.slice(t,e.position))&&ys(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ls(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Dt(e,!0,-1));return}if(e.position<e.length-1)at(e,"end of the stream or a document separator is expected");else return}g(Tg,"readDocument");function Wl(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
147
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new pg(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,at(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Tg(r);return r.documents}g(Wl,"loadDocuments");function rv(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=Wl(e,r);if(typeof t!="function")return i;for(var s=0,o=i.length;s<o;s+=1)t(i[s])}g(rv,"loadAll$1");function _g(e,t){var r=Wl(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new ge("expected a single document in the stream, but found more")}}g(_g,"load$1");var iv=_g,sv={load:iv},Bg=Object.prototype.toString,Lg=Object.prototype.hasOwnProperty,Hl=65279,ov=9,xs=10,av=13,nv=32,lv=33,hv=34,Fn=35,cv=37,dv=38,uv=39,fv=42,Eg=44,gv=45,$o=58,pv=61,mv=62,yv=63,xv=64,Fg=91,Ag=93,Cv=96,Mg=123,bv=124,$g=125,ie={};ie[0]="\\0";ie[7]="\\a";ie[8]="\\b";ie[9]="\\t";ie[10]="\\n";ie[11]="\\v";ie[12]="\\f";ie[13]="\\r";ie[27]="\\e";ie[34]='\\"';ie[92]="\\\\";ie[133]="\\N";ie[160]="\\_";ie[8232]="\\L";ie[8233]="\\P";var kv=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],wv=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Og(e,t){var r,i,s,o,a,n,l;if(t===null)return{};for(r={},i=Object.keys(t),s=0,o=i.length;s<o;s+=1)a=i[s],n=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&Lg.call(l.styleAliases,n)&&(n=l.styleAliases[n]),r[a]=n;return r}g(Og,"compileStyleMap");function Rg(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new ge("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Wt.repeat("0",i-t.length)+t}g(Rg,"encodeHex");var Sv=1,Cs=2;function Ig(e){this.schema=e.schema||sg,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Wt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Og(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Cs:Sv,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}g(Ig,"State");function An(e,t){for(var r=Wt.repeat(" ",t),i=0,s=-1,o="",a,n=e.length;i<n;)s=e.indexOf(`
|
|
148
|
+
`,i),s===-1?(a=e.slice(i),i=n):(a=e.slice(i,s+1),i=s+1),a.length&&a!==`
|
|
149
|
+
`&&(o+=r),o+=a;return o}g(An,"indentString");function Oo(e,t){return`
|
|
150
|
+
`+Wt.repeat(" ",e.indent*t)}g(Oo,"generateNextLine");function Pg(e,t){var r,i,s;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(s=e.implicitTypes[r],s.resolve(t))return!0;return!1}g(Pg,"testImplicitResolving");function bs(e){return e===nv||e===ov}g(bs,"isWhitespace");function Si(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Hl||65536<=e&&e<=1114111}g(Si,"isPrintable");function Mn(e){return Si(e)&&e!==Hl&&e!==av&&e!==xs}g(Mn,"isNsCharOrWhitespace");function $n(e,t,r){var i=Mn(e),s=i&&!bs(e);return(r?i:i&&e!==Eg&&e!==Fg&&e!==Ag&&e!==Mg&&e!==$g)&&e!==Fn&&!(t===$o&&!s)||Mn(t)&&!bs(t)&&e===Fn||t===$o&&s}g($n,"isPlainSafe");function Dg(e){return Si(e)&&e!==Hl&&!bs(e)&&e!==gv&&e!==yv&&e!==$o&&e!==Eg&&e!==Fg&&e!==Ag&&e!==Mg&&e!==$g&&e!==Fn&&e!==dv&&e!==fv&&e!==lv&&e!==bv&&e!==pv&&e!==mv&&e!==uv&&e!==hv&&e!==cv&&e!==xv&&e!==Cv}g(Dg,"isPlainSafeFirst");function Ng(e){return!bs(e)&&e!==$o}g(Ng,"isPlainSafeLast");function Kr(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}g(Kr,"codePointAt");function Yl(e){var t=/^\n* /;return t.test(e)}g(Yl,"needIndentIndicator");var qg=1,On=2,zg=3,jg=4,Hr=5;function Wg(e,t,r,i,s,o,a,n){var l,c=0,h=null,d=!1,f=!1,u=i!==-1,p=-1,m=Dg(Kr(e,0))&&Ng(Kr(e,e.length-1));if(t||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Kr(e,l),!Si(c))return Hr;m=m&&$n(c,h,n),h=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=Kr(e,l),c===xs)d=!0,u&&(f=f||l-p-1>i&&e[p+1]!==" ",p=l);else if(!Si(c))return Hr;m=m&&$n(c,h,n),h=c}f=f||u&&l-p-1>i&&e[p+1]!==" "}return!d&&!f?m&&!a&&!s(e)?qg:o===Cs?Hr:On:r>9&&Yl(e)?Hr:a?o===Cs?Hr:On:f?jg:zg}g(Wg,"chooseScalarStyle");function Hg(e,t,r,i,s){e.dump=(function(){if(t.length===0)return e.quotingType===Cs?'""':"''";if(!e.noCompatMode&&(kv.indexOf(t)!==-1||wv.test(t)))return e.quotingType===Cs?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return Pg(e,c)}switch(g(l,"testAmbiguity"),Wg(t,n,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,s)){case qg:return t;case On:return"'"+t.replace(/'/g,"''")+"'";case zg:return"|"+Rn(t,e.indent)+In(An(t,o));case jg:return">"+Rn(t,e.indent)+In(An(Yg(t,a),o));case Hr:return'"'+Ug(t)+'"';default:throw new ge("impossible error: invalid scalar style")}})()}g(Hg,"writeScalar");function Rn(e,t){var r=Yl(e)?String(t):"",i=e[e.length-1]===`
|
|
151
|
+
`,s=i&&(e[e.length-2]===`
|
|
152
|
+
`||e===`
|
|
153
|
+
`),o=s?"+":i?"":"-";return r+o+`
|
|
154
|
+
`}g(Rn,"blockHeader");function In(e){return e[e.length-1]===`
|
|
155
|
+
`?e.slice(0,-1):e}g(In,"dropEndingNewline");function Yg(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
|
|
156
|
+
`);return c=c!==-1?c:e.length,r.lastIndex=c,Pn(e.slice(0,c),t)})(),s=e[0]===`
|
|
157
|
+
`||e[0]===" ",o,a;a=r.exec(e);){var n=a[1],l=a[2];o=l[0]===" ",i+=n+(!s&&!o&&l!==""?`
|
|
158
|
+
`:"")+Pn(l,t),s=o}return i}g(Yg,"foldString");function Pn(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,s=0,o,a=0,n=0,l="";i=r.exec(e);)n=i.index,n-s>t&&(o=a>s?a:n,l+=`
|
|
159
|
+
`+e.slice(s,o),s=o+1),a=n;return l+=`
|
|
160
|
+
`,e.length-s>t&&a>s?l+=e.slice(s,a)+`
|
|
161
|
+
`+e.slice(a+1):l+=e.slice(s),l.slice(1)}g(Pn,"foldLine");function Ug(e){for(var t="",r=0,i,s=0;s<e.length;r>=65536?s+=2:s++)r=Kr(e,s),i=ie[r],!i&&Si(r)?(t+=e[s],r>=65536&&(t+=e[s+1])):t+=i||Rg(r);return t}g(Ug,"escapeString");function Xg(e,t,r){var i="",s=e.tag,o,a,n;for(o=0,a=r.length;o<a;o+=1)n=r[o],e.replacer&&(n=e.replacer.call(r,String(o),n)),(We(e,t,n,!1,!1)||typeof n>"u"&&We(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=s,e.dump="["+i+"]"}g(Xg,"writeFlowSequence");function Dn(e,t,r,i){var s="",o=e.tag,a,n,l;for(a=0,n=r.length;a<n;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(We(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&We(e,t+1,null,!0,!0,!1,!0))&&((!i||s!=="")&&(s+=Oo(e,t)),e.dump&&xs===e.dump.charCodeAt(0)?s+="-":s+="- ",s+=e.dump);e.tag=o,e.dump=s||"[]"}g(Dn,"writeBlockSequence");function Gg(e,t,r){var i="",s=e.tag,o=Object.keys(r),a,n,l,c,h;for(a=0,n=o.length;a<n;a+=1)h="",i!==""&&(h+=", "),e.condenseFlow&&(h+='"'),l=o[a],c=r[l],e.replacer&&(c=e.replacer.call(r,l,c)),We(e,t,l,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),We(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=s,e.dump="{"+i+"}"}g(Gg,"writeFlowMapping");function Vg(e,t,r,i){var s="",o=e.tag,a=Object.keys(r),n,l,c,h,d,f;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new ge("sortKeys must be a boolean or a function");for(n=0,l=a.length;n<l;n+=1)f="",(!i||s!=="")&&(f+=Oo(e,t)),c=a[n],h=r[c],e.replacer&&(h=e.replacer.call(r,c,h)),We(e,t+1,c,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&xs===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=Oo(e,t)),We(e,t+1,h,!0,d)&&(e.dump&&xs===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,s+=f));e.tag=o,e.dump=s||"{}"}g(Vg,"writeBlockMapping");function Nn(e,t,r){var i,s,o,a,n,l;for(s=r?e.explicitTypes:e.implicitTypes,o=0,a=s.length;o<a;o+=1)if(n=s[o],(n.instanceOf||n.predicate)&&(!n.instanceOf||typeof t=="object"&&t instanceof n.instanceOf)&&(!n.predicate||n.predicate(t))){if(r?n.multi&&n.representName?e.tag=n.representName(t):e.tag=n.tag:e.tag="?",n.represent){if(l=e.styleMap[n.tag]||n.defaultStyle,Bg.call(n.represent)==="[object Function]")i=n.represent(t,l);else if(Lg.call(n.represent,l))i=n.represent[l](t,l);else throw new ge("!<"+n.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}g(Nn,"detectType");function We(e,t,r,i,s,o,a){e.tag=null,e.dump=r,Nn(e,r,!1)||Nn(e,r,!0);var n=Bg.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=n==="[object Object]"||n==="[object Array]",d,f;if(h&&(d=e.duplicates.indexOf(r),f=d!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(s=!1),f&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(h&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),n==="[object Object]")i&&Object.keys(e.dump).length!==0?(Vg(e,t,e.dump,s),f&&(e.dump="&ref_"+d+e.dump)):(Gg(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Dn(e,t-1,e.dump,s):Dn(e,t,e.dump,s),f&&(e.dump="&ref_"+d+e.dump)):(Xg(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&Hg(e,e.dump,t,o,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ge("unacceptable kind of an object to dump "+n)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}g(We,"writeNode");function Zg(e,t){var r=[],i=[],s,o;for(Ro(e,r,i),s=0,o=i.length;s<o;s+=1)t.duplicates.push(r[i[s]]);t.usedDuplicates=new Array(o)}g(Zg,"getDuplicateReferences");function Ro(e,t,r){var i,s,o;if(e!==null&&typeof e=="object")if(s=t.indexOf(e),s!==-1)r.indexOf(s)===-1&&r.push(s);else if(t.push(e),Array.isArray(e))for(s=0,o=e.length;s<o;s+=1)Ro(e[s],t,r);else for(i=Object.keys(e),s=0,o=i.length;s<o;s+=1)Ro(e[i[s]],t,r)}g(Ro,"inspectNode");function vv(e,t){t=t||{};var r=new Ig(t);r.noRefs||Zg(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),We(r,0,i,!0,!0)?r.dump+`
|
|
162
|
+
`:""}g(vv,"dump$1");function Tv(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}g(Tv,"renamed");var Kg=zf,Qg=sv.load;var _v=g(e=>{const{handDrawnSeed:t}=wt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Fi=g(e=>{const t=Bv([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),Bv=g(e=>{const t=new Map;return e.forEach(r=>{const[i,s]=r.split(":");t.set(i.trim(),s?.trim())}),t},"styles2Map"),Ul=g(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),st=g(e=>{const{stylesArray:t}=Fi(e),r=[],i=[],s=[],o=[];return t.forEach(a=>{const n=a[0];Ul(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&s.push(a.join(":")+" !important"),n==="fill"&&o.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:s,backgroundStyles:o}},"styles2String"),et=g((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=wt(),{nodeBorder:s,mainBkg:o}=r,{stylesMap:a}=Fi(e);return Object.assign({roughness:.7,fill:a.get("fill")||o,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||s,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:Lv(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),Lv=g(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const s=isNaN(t[0])?0:t[0];return[s,s]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),Hs={},jt={},bc;function Ev(){return bc||(bc=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.BLANK_URL=jt.relativeFirstCharacters=jt.whitespaceEscapeCharsRegex=jt.urlSchemeRegex=jt.ctrlCharactersRegex=jt.htmlCtrlEntityRegex=jt.htmlEntitiesRegex=jt.invalidProtocolRegex=void 0,jt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,jt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,jt.htmlCtrlEntityRegex=/&(newline|tab);/gi,jt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,jt.urlSchemeRegex=/^.+(:|:)/gim,jt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,jt.relativeFirstCharacters=[".","/"],jt.BLANK_URL="about:blank"),jt}var kc;function Fv(){if(kc)return Hs;kc=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.sanitizeUrl=o;var e=Ev();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function s(a){try{return decodeURIComponent(a)}catch{return a}}function o(a){if(!a)return e.BLANK_URL;var n,l=s(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=s(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var f=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var u=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return u;if(f==="http:"||f==="https:"){if(!i(u))return e.BLANK_URL;var p=new URL(u);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return u}return Hs}var Jg=Fv();function Na(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Av(){}function tp(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function la(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const ep="[object RegExp]",Xl="[object String]",Gl="[object Number]",Vl="[object Boolean]",Zl="[object Arguments]",rp="[object Symbol]",ip="[object Date]",sp="[object Map]",op="[object Set]",ap="[object Array]",np="[object ArrayBuffer]",lp="[object Object]",hp="[object DataView]",cp="[object Uint8Array]",dp="[object Uint8ClampedArray]",up="[object Uint16Array]",fp="[object Uint32Array]",gp="[object Int8Array]",pp="[object Int16Array]",mp="[object Int32Array]",yp="[object Float32Array]",xp="[object Float64Array]",wc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function Kl(e){return typeof wc.Buffer<"u"&&wc.Buffer.isBuffer(e)}function Mv(e){return Number.isSafeInteger(e)&&e>=0}function Cp(e){return e!=null&&typeof e!="function"&&Mv(e.length)}function $v(e){return e==="__proto__"}function ha(e){return e==null||typeof e!="object"&&typeof e!="function"}function Ql(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ov(e,t){return Qr(e,void 0,e,new Map,t)}function Qr(e,t,r,i=new Map,s=void 0){const o=s?.(e,t,r,i);if(o!==void 0)return o;if(ha(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const a=new Array(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=Qr(e[n],n,r,i,s);return Object.hasOwn(e,"index")&&(a.index=e.index),Object.hasOwn(e,"input")&&(a.input=e.input),a}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const a=new RegExp(e.source,e.flags);return a.lastIndex=e.lastIndex,a}if(e instanceof Map){const a=new Map;i.set(e,a);for(const[n,l]of e)a.set(n,Qr(l,n,r,i,s));return a}if(e instanceof Set){const a=new Set;i.set(e,a);for(const n of e)a.add(Qr(n,void 0,r,i,s));return a}if(Kl(e))return e.subarray();if(Ql(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=Qr(e[n],n,r,i,s);return a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const a=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,a),_e(a,e,r,i,s),a}if(typeof File<"u"&&e instanceof File){const a=new File([e],e.name,{type:e.type});return i.set(e,a),_e(a,e,r,i,s),a}if(typeof Blob<"u"&&e instanceof Blob){const a=new Blob([e],{type:e.type});return i.set(e,a),_e(a,e,r,i,s),a}if(e instanceof Error){const a=structuredClone(e);return i.set(e,a),a.message=e.message,a.name=e.name,a.stack=e.stack,a.cause=e.cause,a.constructor=e.constructor,_e(a,e,r,i,s),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return i.set(e,a),_e(a,e,r,i,s),a}if(e instanceof Number){const a=new Number(e.valueOf());return i.set(e,a),_e(a,e,r,i,s),a}if(e instanceof String){const a=new String(e.valueOf());return i.set(e,a),_e(a,e,r,i,s),a}if(typeof e=="object"&&Rv(e)){const a=Object.create(Object.getPrototypeOf(e));return i.set(e,a),_e(a,e,r,i,s),a}return e}function _e(e,t,r=e,i,s){const o=[...Object.keys(t),...tp(t)];for(let a=0;a<o.length;a++){const n=o[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=Qr(t[n],n,r,i,s))}}function Rv(e){switch(la(e)){case Zl:case ap:case np:case hp:case Vl:case ip:case yp:case xp:case gp:case pp:case mp:case sp:case Gl:case lp:case ep:case op:case Xl:case rp:case cp:case dp:case up:case fp:return!0;default:return!1}}function Iv(e,t){return Ov(e,(r,i,s,o)=>{if(typeof e=="object"){if(la(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return o.set(e,a),_e(a,e,s,o),a}switch(Object.prototype.toString.call(e)){case Gl:case Xl:case Vl:{const a=new e.constructor(e?.valueOf());return _e(a,e),a}case Zl:{const a={};return _e(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Sc(e){return Iv(e)}function qn(e){return e!==null&&typeof e=="object"&&la(e)==="[object Arguments]"}function zn(e){return typeof e=="object"&&e!==null}function Pv(e){return zn(e)&&Cp(e)}function Es(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const s=t?t.apply(this,i):i[0],o=r.cache;if(o.has(s))return o.get(s);const a=e.apply(this,i);return r.cache=o.set(s,a)||o,a};return r.cache=new(Es.Cache||Map),r}Es.Cache=Map;function hs(e){return Ql(e)}function Dv(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function Nv(e){if(ha(e))return e;if(Array.isArray(e)||Ql(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function qv(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let s=e;for(let o=0;o<r.length;o++){const a=r[o];s=ao(s,a,i,new Map)}return s}function ao(e,t,r,i){if(ha(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return Nv(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let o=0;o<t.length;o++)t[o]=t[o]??void 0}const s=[...Object.keys(t),...tp(t)];for(let o=0;o<s.length;o++){const a=s[o];if($v(a))continue;let n=t[a],l=e[a];if(qn(n)&&(n={...n}),qn(l)&&(l={...l}),Kl(n)&&(n=Sc(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let f=0;f<d.length;f++){const u=d[f];h[u]=l[u]}l=h}else if(Pv(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=r(l,n,a,e,t,i);c!==void 0?e[a]=c:Array.isArray(n)||zn(l)&&zn(n)&&(Na(l)||Na(n)||hs(l)||hs(n))?e[a]=ao(l,n,r,i):l==null&&Na(n)?e[a]=ao({},n,r,i):l==null&&hs(n)?e[a]=Sc(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function zv(e,...t){return qv(e,...t,Av)}function vc(e){if(e==null)return!0;if(Cp(e))return typeof e.splice!="function"&&typeof e!="string"&&!Kl(e)&&!hs(e)&&!qn(e)?!1:e.length===0;if(typeof e=="object"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);return Dv(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var bp="",jv={curveBasis:Bo,curveBasisClosed:fS,curveBasisOpen:gS,curveBumpX:Gu,curveBumpY:Vu,curveBundle:pS,curveCardinalClosed:mS,curveCardinalOpen:yS,curveCardinal:Ju,curveCatmullRomClosed:xS,curveCatmullRomOpen:CS,curveCatmullRom:ef,curveLinear:ls,curveLinearClosed:bS,curveMonotoneX:lf,curveMonotoneY:hf,curveNatural:df,curveStep:uf,curveStepAfter:gf,curveStepBefore:ff},Wv=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Hv=g(function(e,t){const r=kp(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);po(a),i=qt(i,[...a])}else i=r.args;if(!i)return;let s=xl(e,t);const o="config";return i[o]!==void 0&&(s==="flowchart-v2"&&(s="flowchart"),i[s]=i[o],delete i[o]),i},"detectInit"),kp=g(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${Wv.source})(?=[}][%]{2}).*
|
|
163
|
+
`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),V.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const s=[];for(;(i=ns.exec(e))!==null;)if(i.index===ns.lastIndex&&ns.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const o=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;s.push({type:o,args:a})}return s.length===0?{type:e,args:null}:s.length===1?s[0]:s}catch(r){return V.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),Yv=g(function(e){return e.replace(ns,"")},"removeDirectives"),Uv=g(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Jl(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return jv[r]??t}g(Jl,"interpolateToCurve");function wp(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?Jg.sanitizeUrl(r):r}g(wp,"formatUrl");var Xv=g((e,...t)=>{const r=e.split("."),i=r.length-1,s=r[i];let o=window;for(let a=0;a<i;a++)if(o=o[r[a]],!o){V.error(`Function name: ${e} not found in window`);return}o[s](...t)},"runFunc");function th(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}g(th,"distance");function Sp(e){let t,r=0;e.forEach(s=>{r+=th(s,t),t=s});const i=r/2;return eh(e,i)}g(Sp,"traverseEdge");function vp(e){return e.length===1?e[0]:Sp(e)}g(vp,"calcLabelPosition");var Tc=g((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),eh=g((e,t)=>{let r,i=t;for(const s of e){if(r){const o=th(s,r);if(o===0)return r;if(o<i)i-=o;else{const a=i/o;if(a<=0)return r;if(a>=1)return{x:s.x,y:s.y};if(a>0&&a<1)return{x:Tc((1-a)*r.x+a*s.x,5),y:Tc((1-a)*r.y+a*s.y,5)}}}r=s}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Gv=g((e,t,r)=>{V.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const s=eh(t,25),o=e?10:5,a=Math.atan2(t[0].y-s.y,t[0].x-s.x),n={x:0,y:0};return n.x=Math.sin(a)*o+(t[0].x+s.x)/2,n.y=-Math.cos(a)*o+(t[0].y+s.y)/2,n},"calcCardinalityPosition");function Tp(e,t,r){const i=structuredClone(r);V.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const s=25+e,o=eh(i,s),a=10+e*.5,n=Math.atan2(i[0].y-o.y,i[0].x-o.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+o.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+o.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+o.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+o.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+o.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+o.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+o.x)/2,l.y=-Math.cos(n)*a+(i[0].y+o.y)/2),l}g(Tp,"calcTerminalLabelPosition");function rh(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}g(rh,"getStylesFromArray");var _c=0,_p=g(()=>(_c++,"id-"+Math.random().toString(36).substr(2,12)+"-"+_c),"generateId");function Bp(e){let t="";const r="0123456789abcdef",i=r.length;for(let s=0;s<e;s++)t+=r.charAt(Math.floor(Math.random()*i));return t}g(Bp,"makeRandomHex");var Lp=g(e=>Bp(e.length),"random"),Vv=g(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"),Zv=g(function(e,t){const r=t.text.replace(Li.lineBreakRegex," "),[,i]=Fs(t.fontSize),s=e.append("text");s.attr("x",t.x),s.attr("y",t.y),s.style("text-anchor",t.anchor),s.style("font-family",t.fontFamily),s.style("font-size",i),s.style("font-weight",t.fontWeight),s.attr("fill",t.fill),t.class!==void 0&&s.attr("class",t.class);const o=s.append("tspan");return o.attr("x",t.x+t.textMargin*2),o.attr("fill",t.fill),o.text(r),s},"drawSimpleText"),Ep=Es((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Li.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),s=[];let o="";return i.forEach((a,n)=>{const l=He(`${a} `,r),c=He(o,r);if(l>t){const{hyphenatedStrings:f,remainingWord:u}=Kv(a,t,"-",r);s.push(o,...f),o=u}else c+l>=t?(s.push(o),o=a):o=[o,a].filter(Boolean).join(" ");n+1===i.length&&s.push(o)}),s.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),Kv=Es((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const s=[...e],o=[];let a="";return s.forEach((n,l)=>{const c=`${a}${n}`;if(He(c,i)>=t){const d=l+1,f=s.length===d,u=`${c}${r}`;o.push(f?c:u),a=""}else a=c}),{hyphenatedStrings:o,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function ih(e,t){return ca(e,t).height}g(ih,"calculateTextHeight");function He(e,t){return ca(e,t).width}g(He,"calculateTextWidth");var ca=Es((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:s=400}=t;if(!e)return{width:0,height:0};const[,o]=Fs(r),a=["sans-serif",i],n=e.split(Li.lineBreakRegex),l=[],c=pt("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const f of a){let u=0;const p={width:0,height:0,lineHeight:0};for(const m of n){const y=Vv();y.text=m||bp;const x=Zv(h,y).style("font-size",o).style("font-weight",s).style("font-family",f),C=(x._groups||x)[0][0].getBBox();if(C.width===0&&C.height===0)throw new Error("svg element not in render tree");p.width=Math.round(Math.max(p.width,C.width)),u=Math.round(C.height),p.height+=u,p.lineHeight=Math.round(Math.max(p.lineHeight,u))}l.push(p)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),pi,Qv=(pi=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},g(pi,"InitIDGenerator"),pi),Ys,Jv=g(function(e){return Ys=Ys||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Ys.innerHTML=e,unescape(Ys.textContent)},"entityDecode");function sh(e){return"str"in e}g(sh,"isDetailedError");var tT=g((e,t,r,i)=>{if(!i)return;const s=e.node()?.getBBox();s&&e.append("text").text(i).attr("text-anchor","middle").attr("x",s.x+s.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Fs=g(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function da(e,t){return zv({},e,t)}g(da,"cleanAndMerge");var we={assignWithDepth:qt,wrapLabel:Ep,calculateTextHeight:ih,calculateTextWidth:He,calculateTextDimensions:ca,cleanAndMerge:da,detectInit:Hv,detectDirective:kp,isSubstringInArray:Uv,interpolateToCurve:Jl,calcLabelPosition:vp,calcCardinalityPosition:Gv,calcTerminalLabelPosition:Tp,formatUrl:wp,getStylesFromArray:rh,generateId:_p,random:Lp,runFunc:Xv,entityDecode:Jv,insertTitle:tT,isLabelCoordinateInPath:Fp,parseFontSize:Fs,InitIDGenerator:Qv},eT=g(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),pr=g(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),rT=g((e,t,{counter:r=0,prefix:i,suffix:s},o)=>o||`${i?`${i}_`:""}${e}_${t}_${r}${s?`_${s}`:""}`,"getEdgeId");function Ut(e){return e??null}g(Ut,"handleUndefinedAttr");function Fp(e,t){const r=Math.round(e.x),i=Math.round(e.y),s=t.replace(/(\d+\.\d+)/g,o=>Math.round(parseFloat(o)).toString());return s.includes(r.toString())||s.includes(i.toString())}g(Fp,"isLabelCoordinateInPath");var ua=g(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins");async function oh(e,t){const r=e.getElementsByTagName("img");if(!r||r.length===0)return;const i=t.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...r].map(s=>new Promise(o=>{function a(){if(s.style.display="flex",s.style.flexDirection="column",i){const n=wt().fontSize?wt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=yl.fontSize]=Fs(n),h=c*l+"px";s.style.minWidth=h,s.style.maxWidth=h}else s.style.width="100%";o(s)}g(a,"setupImage"),setTimeout(()=>{s.complete&&a()}),s.addEventListener("error",a),s.addEventListener("load",a)})))}g(oh,"configureLabelImages");const iT=Object.freeze({left:0,top:0,width:16,height:16}),Io=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ap=Object.freeze({...iT,...Io}),sT=Object.freeze({...Ap,body:"",hidden:!1}),oT=Object.freeze({width:null,height:null}),aT=Object.freeze({...oT,...Io}),nT=(e,t,r,i="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;i=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const n=s.pop(),l=s.pop(),c={provider:s.length>0?s[0]:i,prefix:l,name:n};return qa(c)?c:null}const o=s[0],a=o.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return qa(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:o};return qa(n,r)?n:null}return null},qa=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function lT(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function Bc(e,t){const r=lT(e,t);for(const i in sT)i in Io?i in e&&!(i in r)&&(r[i]=Io[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function hT(e,t){const r=e.icons,i=e.aliases||Object.create(null),s=Object.create(null);function o(a){if(r[a])return s[a]=[];if(!(a in s)){s[a]=null;const n=i[a]&&i[a].parent,l=n&&o(n);l&&(s[a]=[n].concat(l))}return s[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(o),s}function Lc(e,t,r){const i=e.icons,s=e.aliases||Object.create(null);let o={};function a(n){o=Bc(i[n]||s[n],o)}return a(t),r.forEach(a),Bc(e,o)}function cT(e,t){if(e.icons[t])return Lc(e,t,[]);const r=hT(e,[t])[t];return r?Lc(e,t,r):null}const dT=/(-?[0-9.]*[0-9]+[0-9.]*)/g,uT=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ec(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(dT);if(i===null||!i.length)return e;const s=[];let o=i.shift(),a=uT.test(o);for(;;){if(a){const n=parseFloat(o);isNaN(n)?s.push(o):s.push(Math.ceil(n*t*r)/r)}else s.push(o);if(o=i.shift(),o===void 0)return s.join("");a=!a}}function fT(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const s=e.indexOf(">",i),o=e.indexOf("</"+t);if(s===-1||o===-1)break;const a=e.indexOf(">",o);if(a===-1)break;r+=e.slice(s+1,o).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function gT(e,t){return e?"<defs>"+e+"</defs>"+t:t}function pT(e,t,r){const i=fT(e);return gT(i.defs,t+i.content+r)}const mT=e=>e==="unset"||e==="undefined"||e==="none";function yT(e,t){const r={...Ap,...e},i={...aT,...t},s={left:r.left,top:r.top,width:r.width,height:r.height};let o=r.body;[r,i].forEach(m=>{const y=[],x=m.hFlip,C=m.vFlip;let k=m.rotate;x?C?k+=2:(y.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),y.push("scale(-1 1)"),s.top=s.left=0):C&&(y.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),y.push("scale(1 -1)"),s.top=s.left=0);let v;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:v=s.height/2+s.top,y.unshift("rotate(90 "+v.toString()+" "+v.toString()+")");break;case 2:y.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:v=s.width/2+s.left,y.unshift("rotate(-90 "+v.toString()+" "+v.toString()+")");break}k%2===1&&(s.left!==s.top&&(v=s.left,s.left=s.top,s.top=v),s.width!==s.height&&(v=s.width,s.width=s.height,s.height=v)),y.length&&(o=pT(o,'<g transform="'+y.join(" ")+'">',"</g>"))});const a=i.width,n=i.height,l=s.width,c=s.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=Ec(d,l/c)):(h=a==="auto"?l:a,d=n===null?Ec(h,c/l):n==="auto"?c:n);const f={},u=(m,y)=>{mT(y)||(f[m]=y.toString())};u("width",h),u("height",d);const p=[s.left,s.top,l,c];return f.viewBox=p.join(" "),{attributes:f,viewBox:p,body:o}}const xT=/\sid="(\S+)"/g,Fc=new Map;function CT(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Fc.get(e)||0;return Fc.set(e,t+1),t?`${e}${t}`:e}function bT(e){const t=[];let r;for(;r=xT.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(s=>{const o=CT(s),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function kT(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}var Mp={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},jn=new Map,$p=new Map,Op=g(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(V.debug("Registering icon pack:",t.name),"loader"in t)$p.set(t.name,t.loader);else if("icons"in t)jn.set(t.name,t.icons);else throw V.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Rp=g(async(e,t)=>{const r=nT(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let s=jn.get(i);if(!s){const a=$p.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{s={...await a(),prefix:i},jn.set(i,s)}catch(n){throw V.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const o=cT(s,r.name);if(!o)throw new Error(`Icon not found: ${e}`);return o},"getRegisteredIconData"),wT=g(async e=>{try{return await Rp(e),!0}catch{return!1}},"isIconAvailable"),Ai=g(async(e,t,r)=>{let i;try{i=await Rp(e,t?.fallbackPrefix)}catch(a){V.error(a),i=Mp}const s=yT(i,t),o=kT(bT(s.body),{...s.attributes,...r});return Se(o,At())},"getIconSVG");function ah(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nr=ah();function Ip(e){Nr=e}var cs={exec:()=>null};function St(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(s,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(de.caret,"$1"),r=r.replace(s,a),i},getRegex:()=>new RegExp(r,t)};return i}var ST=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),de={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},vT=/^(?:[ \t]*(?:\n|$))+/,TT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,_T=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,As=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,BT=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,nh=/(?:[*+-]|\d{1,9}[.)])/,Pp=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Dp=St(Pp).replace(/bull/g,nh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),LT=St(Pp).replace(/bull/g,nh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),lh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ET=/^[^\n]+/,hh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,FT=St(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",hh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),AT=St(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,nh).getRegex(),fa="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ch=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,MT=St("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ch).replace("tag",fa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Np=St(lh).replace("hr",As).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fa).getRegex(),$T=St(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Np).getRegex(),dh={blockquote:$T,code:TT,def:FT,fences:_T,heading:BT,hr:As,html:MT,lheading:Dp,list:AT,newline:vT,paragraph:Np,table:cs,text:ET},Ac=St("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",As).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fa).getRegex(),OT={...dh,lheading:LT,table:Ac,paragraph:St(lh).replace("hr",As).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ac).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fa).getRegex()},RT={...dh,html:St(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ch).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:St(lh).replace("hr",As).replace("heading",` *#{1,6} *[^
|
|
164
|
+
]`).replace("lheading",Dp).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},IT=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,PT=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qp=/^( {2,}|\\)\n(?!\s*$)/,DT=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ga=/[\p{P}\p{S}]/u,uh=/[\s\p{P}\p{S}]/u,zp=/[^\s\p{P}\p{S}]/u,NT=St(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,uh).getRegex(),jp=/(?!~)[\p{P}\p{S}]/u,qT=/(?!~)[\s\p{P}\p{S}]/u,zT=/(?:[^\s\p{P}\p{S}]|~)/u,jT=St(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ST?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Wp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,WT=St(Wp,"u").replace(/punct/g,ga).getRegex(),HT=St(Wp,"u").replace(/punct/g,jp).getRegex(),Hp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",YT=St(Hp,"gu").replace(/notPunctSpace/g,zp).replace(/punctSpace/g,uh).replace(/punct/g,ga).getRegex(),UT=St(Hp,"gu").replace(/notPunctSpace/g,zT).replace(/punctSpace/g,qT).replace(/punct/g,jp).getRegex(),XT=St("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,zp).replace(/punctSpace/g,uh).replace(/punct/g,ga).getRegex(),GT=St(/\\(punct)/,"gu").replace(/punct/g,ga).getRegex(),VT=St(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ZT=St(ch).replace("(?:-->|$)","-->").getRegex(),KT=St("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ZT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Po=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,QT=St(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Po).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Yp=St(/^!?\[(label)\]\[(ref)\]/).replace("label",Po).replace("ref",hh).getRegex(),Up=St(/^!?\[(ref)\](?:\[\])?/).replace("ref",hh).getRegex(),JT=St("reflink|nolink(?!\\()","g").replace("reflink",Yp).replace("nolink",Up).getRegex(),Mc=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,fh={_backpedal:cs,anyPunctuation:GT,autolink:VT,blockSkip:jT,br:qp,code:PT,del:cs,emStrongLDelim:WT,emStrongRDelimAst:YT,emStrongRDelimUnd:XT,escape:IT,link:QT,nolink:Up,punctuation:NT,reflink:Yp,reflinkSearch:JT,tag:KT,text:DT,url:cs},t_={...fh,link:St(/^!?\[(label)\]\((.*?)\)/).replace("label",Po).getRegex(),reflink:St(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Po).getRegex()},Wn={...fh,emStrongRDelimAst:UT,emStrongLDelim:HT,url:St(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Mc).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:St(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Mc).getRegex()},e_={...Wn,br:St(qp).replace("{2,}","*").getRegex(),text:St(Wn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Us={normal:dh,gfm:OT,pedantic:RT},Wi={normal:fh,gfm:Wn,breaks:e_,pedantic:t_},r_={"&":"&","<":"<",">":">",'"':""","'":"'"},$c=e=>r_[e];function De(e,t){if(t){if(de.escapeTest.test(e))return e.replace(de.escapeReplace,$c)}else if(de.escapeTestNoEncode.test(e))return e.replace(de.escapeReplaceNoEncode,$c);return e}function Oc(e){try{e=encodeURI(e).replace(de.percentDecode,"%")}catch{return null}return e}function Rc(e,t){let r=e.replace(de.findPipe,(o,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(de.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(de.slashPipe,"|");return i}function Hi(e,t,r){let i=e.length;if(i===0)return"";let s=0;for(;s<i&&e.charAt(i-s-1)===t;)s++;return e.slice(0,i-s)}function i_(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function Ic(e,t,r,i,s){let o=t.href,a=t.title||null,n=e[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function s_(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let s=i[1];return t.split(`
|
|
165
|
+
`).map(o=>{let a=o.match(r.other.beginningSpace);if(a===null)return o;let[n]=a;return n.length>=s.length?o.slice(s.length):o}).join(`
|
|
166
|
+
`)}var Do=class{options;rules;lexer;constructor(t){this.options=t||Nr}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Hi(i,`
|
|
167
|
+
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],s=s_(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:s}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let s=Hi(i,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(i=s.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Hi(r[0],`
|
|
168
|
+
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Hi(r[0],`
|
|
169
|
+
`).split(`
|
|
170
|
+
`),s="",o="",a=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))l.push(i[c]),n=!0;else if(!n)l.push(i[c]);else break;i=i.slice(c);let h=l.join(`
|
|
171
|
+
`),d=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
172
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
173
|
+
${h}`:h,o=o?`${o}
|
|
174
|
+
${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,a,!0),this.lexer.state.top=f,i.length===0)break;let u=a.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let p=u,m=p.raw+`
|
|
175
|
+
`+i.join(`
|
|
176
|
+
`),y=this.blockquote(m);a[a.length-1]=y,s=s.substring(0,s.length-p.raw.length)+y.raw,o=o.substring(0,o.length-p.text.length)+y.text;break}else if(u?.type==="list"){let p=u,m=p.raw+`
|
|
177
|
+
`+i.join(`
|
|
178
|
+
`),y=this.list(m);a[a.length-1]=y,s=s.substring(0,s.length-u.raw.length)+y.raw,o=o.substring(0,o.length-p.raw.length)+y.raw,i=m.substring(a.at(-1).raw.length).split(`
|
|
179
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:o}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),s=i.length>1,o={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let a=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",d="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let f=r[2].split(`
|
|
180
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),u=t.split(`
|
|
181
|
+
`,1)[0],p=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):p?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),p&&this.rules.other.blankLine.test(u)&&(h+=u+`
|
|
182
|
+
`,t=t.substring(u.length+1),c=!0),!c){let C=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),v=this.rules.other.fencesBeginRegex(m),S=this.rules.other.headingBeginRegex(m),_=this.rules.other.htmlBeginRegex(m);for(;t;){let B=t.split(`
|
|
183
|
+
`,1)[0],T;if(u=B,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),T=u):T=u.replace(this.rules.other.tabCharGlobal," "),v.test(u)||S.test(u)||_.test(u)||C.test(u)||k.test(u))break;if(T.search(this.rules.other.nonSpaceChar)>=m||!u.trim())d+=`
|
|
184
|
+
`+T.slice(m);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(f)||S.test(f)||k.test(f))break;d+=`
|
|
185
|
+
`+u}!p&&!u.trim()&&(p=!0),h+=B+`
|
|
186
|
+
`,t=t.substring(B.length+1),f=T.slice(m)}}o.loose||(n?o.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let y=null,x;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(x=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:h,task:!!y,checked:x,loose:!1,text:d,tokens:[]}),o.raw+=h}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let c=0;c<o.items.length;c++)if(this.lexer.state.top=!1,o.items[c].tokens=this.lexer.blockTokens(o.items[c].text,[]),!o.loose){let h=o.items[c].tokens.filter(f=>f.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=d}if(o.loose)for(let c=0;c<o.items.length;c++)o.items[c].loose=!0;return o}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:s,title:o}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=Rc(r[1]),s=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
187
|
+
`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===s.length){for(let n of s)this.rules.other.tableAlignRight.test(n)?a.align.push("right"):this.rules.other.tableAlignCenter.test(n)?a.align.push("center"):this.rules.other.tableAlignLeft.test(n)?a.align.push("left"):a.align.push(null);for(let n=0;n<i.length;n++)a.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:a.align[n]});for(let n of o)a.rows.push(Rc(n,a.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
|
|
188
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=Hi(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=i_(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let s=r[2],o="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],o=a[3])}else o=r[3]?r[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?s=s.slice(1):s=s.slice(1,-1)),Ic(r,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let s=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=r[s.toLowerCase()];if(!o){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return Ic(i,o,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||s[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!i||this.rules.inline.punctuation.exec(i))){let o=[...s[0]].length-1,a,n,l=o,c=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+o);(s=h.exec(r))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(n=[...a].length,s[3]||s[4]){l+=n;continue}else if((s[5]||s[6])&&o%3&&!((o+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let d=[...s[0]][0].length,f=t.slice(0,o+s.index+d+n);if(Math.min(o,n)%2){let p=f.slice(1,-1);return{type:"em",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}let u=f.slice(2,-2);return{type:"strong",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return s&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,s;return r[2]==="@"?(i=r[1],s="mailto:"+i):(i=r[1],s=i),{type:"link",raw:r[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,s;if(r[2]==="@")i=r[0],s="mailto:"+i;else{let o;do o=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(o!==r[0]);i=r[0],r[1]==="www."?s="http://"+r[0]:s=r[0]}return{type:"link",raw:r[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Be=class Hn{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Nr,this.options.tokenizer=this.options.tokenizer||new Do,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:de,block:Us.normal,inline:Wi.normal};this.options.pedantic?(r.block=Us.pedantic,r.inline=Wi.pedantic):this.options.gfm&&(r.block=Us.gfm,this.options.breaks?r.inline=Wi.breaks:r.inline=Wi.gfm),this.tokenizer.rules=r}static get rules(){return{block:Us,inline:Wi}}static lex(t,r){return new Hn(r).lex(t)}static lexInline(t,r){return new Hn(r).inlineTokens(t)}lex(t){t=t.replace(de.carriageReturn,`
|
|
189
|
+
`),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){for(this.options.pedantic&&(t=t.replace(de.tabCharGlobal," ").replace(de.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},t,r))?(t=t.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let a=r.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
|
|
190
|
+
`:r.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
191
|
+
`)?"":`
|
|
192
|
+
`)+s.raw,a.text+=`
|
|
193
|
+
`+s.text,this.inlineQueue.at(-1).src=a.text):r.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
194
|
+
`)?"":`
|
|
195
|
+
`)+s.raw,a.text+=`
|
|
196
|
+
`+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},r.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),r.push(s);continue}let o=t;if(this.options.extensions?.startBlock){let a=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(o=t.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(o))){let a=r.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
197
|
+
`)?"":`
|
|
198
|
+
`)+s.raw,a.text+=`
|
|
199
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(s),i=o.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
200
|
+
`)?"":`
|
|
201
|
+
`)+s.raw,a.text+=`
|
|
202
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(s);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)o=s[2]?s[2].length:0,i=i.slice(0,s.index+o)+"["+"a".repeat(s[0].length-o-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(u=>{f=u.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},No=class{options;parser;constructor(t){this.options=t||Nr}space(t){return""}code({text:t,lang:r,escaped:i}){let s=(r||"").match(de.notSpaceStart)?.[0],o=t.replace(de.endingNewline,"")+`
|
|
203
|
+
`;return s?'<pre><code class="language-'+De(s)+'">'+(i?o:De(o,!0))+`</code></pre>
|
|
204
|
+
`:"<pre><code>"+(i?o:De(o,!0))+`</code></pre>
|
|
205
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
206
|
+
${this.parser.parse(t)}</blockquote>
|
|
207
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
|
|
208
|
+
`}hr(t){return`<hr>
|
|
209
|
+
`}list(t){let r=t.ordered,i=t.start,s="";for(let n=0;n<t.items.length;n++){let l=t.items[n];s+=this.listitem(l)}let o=r?"ol":"ul",a=r&&i!==1?' start="'+i+'"':"";return"<"+o+a+`>
|
|
210
|
+
`+s+"</"+o+`>
|
|
211
|
+
`}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+De(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
|
|
212
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
213
|
+
`}table(t){let r="",i="";for(let o=0;o<t.header.length;o++)i+=this.tablecell(t.header[o]);r+=this.tablerow({text:i});let s="";for(let o=0;o<t.rows.length;o++){let a=t.rows[o];i="";for(let n=0;n<a.length;n++)i+=this.tablecell(a[n]);s+=this.tablerow({text:i})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
214
|
+
<thead>
|
|
215
|
+
`+r+`</thead>
|
|
216
|
+
`+s+`</table>
|
|
217
|
+
`}tablerow({text:t}){return`<tr>
|
|
218
|
+
${t}</tr>
|
|
219
|
+
`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
|
|
220
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${De(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let s=this.parser.parseInline(i),o=Oc(t);if(o===null)return s;t=o;let a='<a href="'+t+'"';return r&&(a+=' title="'+De(r)+'"'),a+=">"+s+"</a>",a}image({href:t,title:r,text:i,tokens:s}){s&&(i=this.parser.parseInline(s,this.parser.textRenderer));let o=Oc(t);if(o===null)return De(i);t=o;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${De(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:De(t.text)}},gh=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Le=class Yn{options;renderer;textRenderer;constructor(t){this.options=t||Nr,this.options.renderer=this.options.renderer||new No,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new gh}static parse(t,r){return new Yn(r).parse(t)}static parseInline(t,r){return new Yn(r).parseInline(t)}parse(t,r=!0){let i="";for(let s=0;s<t.length;s++){let o=t[s];if(this.options.extensions?.renderers?.[o.type]){let n=o,l=this.options.extensions.renderers[n.type].call({parser:this},n);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=l||"";continue}}let a=o;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let n=a,l=this.renderer.text(n);for(;s+1<t.length&&t[s+1].type==="text";)n=t[++s],l+=`
|
|
221
|
+
`+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let s=0;s<t.length;s++){let o=t[s];if(this.options.extensions?.renderers?.[o.type]){let n=this.options.extensions.renderers[o.type].call({parser:this},o);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=n||"";continue}}let a=o;switch(a.type){case"escape":{i+=r.text(a);break}case"html":{i+=r.html(a);break}case"link":{i+=r.link(a);break}case"image":{i+=r.image(a);break}case"strong":{i+=r.strong(a);break}case"em":{i+=r.em(a);break}case"codespan":{i+=r.codespan(a);break}case"br":{i+=r.br(a);break}case"del":{i+=r.del(a);break}case"text":{i+=r.text(a);break}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},es=class{options;block;constructor(t){this.options=t||Nr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Be.lex:Be.lexInline}provideParser(){return this.block?Le.parse:Le.parseInline}},o_=class{defaults=ah();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Le;Renderer=No;TextRenderer=gh;Lexer=Be;Tokenizer=Do;Hooks=es;constructor(...t){this.use(...t)}walkTokens(t,r){let i=[];for(let s of t)switch(i=i.concat(r.call(this,s)),s.type){case"table":{let o=s;for(let a of o.header)i=i.concat(this.walkTokens(a.tokens,r));for(let a of o.rows)for(let n of a)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let o=s;i=i.concat(this.walkTokens(o.items,r));break}default:{let o=s;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{let n=o[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):o.tokens&&(i=i.concat(this.walkTokens(o.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let s={...i};if(s.async=this.defaults.async||s.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let a=r.renderers[o.name];a?r.renderers[o.name]=function(...n){let l=o.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[o.level];a?a.unshift(o.tokenizer):r[o.level]=[o.tokenizer],o.start&&(o.level==="block"?r.startBlock?r.startBlock.push(o.start):r.startBlock=[o.start]:o.level==="inline"&&(r.startInline?r.startInline.push(o.start):r.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(r.childTokens[o.name]=o.childTokens)}),s.extensions=r),i.renderer){let o=this.defaults.renderer||new No(this.defaults);for(let a in i.renderer){if(!(a in o))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=o[n];o[n]=(...h)=>{let d=l.apply(o,h);return d===!1&&(d=c.apply(o,h)),d||""}}s.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new Do(this.defaults);for(let a in i.tokenizer){if(!(a in o))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=o[n];o[n]=(...h)=>{let d=l.apply(o,h);return d===!1&&(d=c.apply(o,h)),d}}s.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new es;for(let a in i.hooks){if(!(a in o))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=o[n];es.passThroughHooks.has(a)?o[n]=h=>{if(this.defaults.async&&es.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(o,h);return c.call(o,f)})();let d=l.call(o,h);return c.call(o,d)}:o[n]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(o,h);return f===!1&&(f=await c.apply(o,h)),f})();let d=l.apply(o,h);return d===!1&&(d=c.apply(o,h)),d}}s.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,a=i.walkTokens;s.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),o&&(l=l.concat(o.call(this,n))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Be.lex(t,r??this.defaults)}parser(t,r){return Le.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let s={...i},o={...this.defaults,...s},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let n=o.hooks?await o.hooks.preprocess(r):r,l=await(o.hooks?await o.hooks.provideLexer():t?Be.lex:Be.lexInline)(n,o),c=o.hooks?await o.hooks.processAllTokens(l):l;o.walkTokens&&await Promise.all(this.walkTokens(c,o.walkTokens));let h=await(o.hooks?await o.hooks.provideParser():t?Le.parse:Le.parseInline)(c,o);return o.hooks?await o.hooks.postprocess(h):h})().catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let n=(o.hooks?o.hooks.provideLexer():t?Be.lex:Be.lexInline)(r,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let l=(o.hooks?o.hooks.provideParser():t?Le.parse:Le.parseInline)(n,o);return o.hooks&&(l=o.hooks.postprocess(l)),l}catch(n){return a(n)}}}onError(t,r){return i=>{if(i.message+=`
|
|
222
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+De(i.message+"",!0)+"</pre>";return r?Promise.resolve(s):s}if(r)return Promise.reject(i);throw i}}},Pr=new o_;function vt(e,t){return Pr.parse(e,t)}vt.options=vt.setOptions=function(e){return Pr.setOptions(e),vt.defaults=Pr.defaults,Ip(vt.defaults),vt};vt.getDefaults=ah;vt.defaults=Nr;vt.use=function(...e){return Pr.use(...e),vt.defaults=Pr.defaults,Ip(vt.defaults),vt};vt.walkTokens=function(e,t){return Pr.walkTokens(e,t)};vt.parseInline=Pr.parseInline;vt.Parser=Le;vt.parser=Le.parse;vt.Renderer=No;vt.TextRenderer=gh;vt.Lexer=Be;vt.lexer=Be.lex;vt.Tokenizer=Do;vt.Hooks=es;vt.parse=vt;vt.options;vt.setOptions;vt.use;vt.walkTokens;vt.parseInline;Le.parse;Be.lex;function Xp(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var s=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var d,f;return(f=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&f!==void 0?f:0})):n},[]);if(s.length){var o=new RegExp(`
|
|
223
|
+
[ ]{`+Math.min.apply(Math,s)+"}","g");i=i.map(function(n){return n.replace(o,`
|
|
224
|
+
`)})}i[0]=i[0].replace(/^\r?\n/,"");var a=i[0];return t.forEach(function(n,l){var c=a.match(/(?:^|\n)( *)$/),h=c?c[1]:"",d=n;typeof n=="string"&&n.includes(`
|
|
225
|
+
`)&&(d=String(n).split(`
|
|
226
|
+
`).map(function(f,u){return u===0?f:""+h+f}).join(`
|
|
227
|
+
`)),a+=d+i[l+1]}),a}function Gp(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
|
|
228
|
+
`).replace(/\n{2,}/g,`
|
|
229
|
+
`);return Xp(i)}g(Gp,"preprocessMarkdown");function Vp(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}g(Vp,"nonMarkdownToLines");function Zp(e,t={}){const r=Gp(e,t),i=vt.lexer(r),s=[[]];let o=0;function a(n,l="normal"){n.type==="text"?n.text.split(`
|
|
230
|
+
`).forEach((h,d)=>{d!==0&&(o++,s.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&s[o].push({content:f,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&s[o].push({content:n.text,type:"normal"})}return g(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?s[o].push({content:n.text,type:"normal"}):s[o].push({content:n.raw,type:"normal"})}),s}g(Zp,"markdownToLines");function Kp(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}g(Kp,"nonMarkdownToHTML");function Qp(e,{markdownAutoWrap:t}={}){const r=vt.lexer(e);function i(s){return s.type==="text"?t===!1?s.text.replace(/\n */g,"<br/>").replace(/ /g," "):s.text.replace(/\n */g,"<br/>"):s.type==="strong"?`<strong>${s.tokens?.map(i).join("")}</strong>`:s.type==="em"?`<em>${s.tokens?.map(i).join("")}</em>`:s.type==="paragraph"?`<p>${s.tokens?.map(i).join("")}</p>`:s.type==="space"?"":s.type==="html"?`${s.text}`:s.type==="escape"?s.text:(V.warn(`Unsupported markdown: ${s.type}`),s.raw)}return g(i,"output"),r.map(i).join("")}g(Qp,"markdownToHTML");function Jp(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}g(Jp,"splitTextToChars");function tm(e,t){const r=Jp(t.content);return ph(e,[],r,t.type)}g(tm,"splitWordToFitWidth");function ph(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[s,...o]=r,a=[...t,s];return e([{content:a.join(""),type:i}])?ph(e,a,o,i):(t.length===0&&s&&(t.push(s),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}g(ph,"splitWordToFitWidthRecursion");function em(e,t){if(e.some(({content:r})=>r.includes(`
|
|
231
|
+
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return qo(e,t)}g(em,"splitLineToFitWidth");function qo(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let s="";e[0].content===" "&&(s=" ",e.shift());const o=e.shift()??{content:" ",type:"normal"},a=[...i];if(s!==""&&a.push({content:s,type:"normal"}),a.push(o),t(a))return qo(e,t,r,a);if(i.length>0)r.push(i),e.unshift(o);else if(o.content){const[n,l]=tm(t,o);r.push([n]),l.content&&e.unshift(l)}return qo(e,t,r)}g(qo,"splitLineToFitWidthRecursion");function Un(e,t){t&&e.attr("style",t)}g(Un,"applyStyle");var Pc=16384;async function rm(e,t,r,i,s=!1,o=At()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,Pc)}px`),a.attr("height",`${Math.min(10*r,Pc)}px`);const n=a.append("xhtml:div"),l=xi(t.label)?await Cl(t.label.replace(Li.lineBreakRegex,`
|
|
232
|
+
`),o):Se(t.label,o),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),Un(h,t.labelStyle),h.attr("class",`${c} ${i}`),Un(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),s&&n.attr("class","labelBkg");let d=n.node().getBoundingClientRect();return d.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),d=n.node().getBoundingClientRect()),a.node()}g(rm,"addHtmlSpan");function pa(e,t,r,i=!1){const s=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&s.attr("text-anchor","middle"),s}g(pa,"createTspan");function im(e,t,r){const i=e.append("text"),s=pa(i,1,t);ma(s,r);const o=s.node().getComputedTextLength();return i.remove(),o}g(im,"computeWidthOfText");function sm(e,t,r){const i=e.append("text"),s=pa(i,1,t);ma(s,[{content:r,type:"normal"}]);const o=s.node()?.getBoundingClientRect();return o&&i.remove(),o}g(sm,"computeDimensionOfText");function om(e,t,r,i=!1,s=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");s&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=g(u=>im(a,1.1,u)<=e,"checkWidth"),f=d(h)?[h]:em(h,d);for(const u of f){const p=pa(l,c,1.1,s);ma(p,u),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}g(om,"createFormattedText");function Xn(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}g(Xn,"decodeHTMLEntities");function ma(e,t){e.text(""),t.forEach((r,i)=>{const s=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?s.text(Xn(r.content)):s.text(" "+Xn(r.content))})}g(ma,"updateTextContentAndStyles");async function am(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(s,o,a)=>(r.push((async()=>{const n=`${o}:${a}`;return await wT(n)?await Ai(n,void 0,{class:"label-icon"}):`<i class='${Se(s,t).replace(":"," ")}'></i>`})()),s));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}g(am,"replaceIconSubstring");var Oe=g(async(e,t="",{style:r="",isTitle:i=!1,classes:s="",useHtmlLabels:o=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(V.debug("XYZ createText",t,r,i,s,o,n,"addSvgBackground: ",c),o){const d=a?Qp(t,h):Kp(t),f=await am(pr(d),h),u=t.replace(/\\\\/g,"\\"),p={isNode:n,label:xi(t)?u:f,labelStyle:r.replace("fill:","color:")};return await rm(e,p,l,s,c,h)}else{const d=pr(t.replace(/<br\s*\/?>/g,"<br/>")),f=a?Zp(d.replace("<br>","<br/>"),h):Vp(d),u=om(l,e,f,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(u).attr("style",p)}else{const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");pt(u).select("rect").attr("style",p.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(u).select("text").attr("style",m)}return i?pt(u).selectAll("tspan.text-outer-tspan").classed("title-row",!0):pt(u).selectAll("tspan.text-outer-tspan").classed("row",!0),u}},"createText");function za(e,t,r){if(e&&e.length){const[i,s]=t,o=Math.PI/180*r,a=Math.cos(o),n=Math.sin(o);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-s)*n+i,l[1]=(c-i)*n+(h-s)*a+s}}}function a_(e,t){return e[0]===t[0]&&e[1]===t[1]}function n_(e,t,r,i=1){const s=r,o=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(s)for(const c of a)za(c,n,s);const l=(function(c,h,d){const f=[];for(const C of c){const k=[...C];a_(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&f.push(k)}const u=[];h=Math.max(h,.1);const p=[];for(const C of f)for(let k=0;k<C.length-1;k++){const v=C[k],S=C[k+1];if(v[1]!==S[1]){const _=Math.min(v[1],S[1]);p.push({ymin:_,ymax:Math.max(v[1],S[1]),x:_===v[1]?v[0]:S[0],islope:(S[0]-v[0])/(S[1]-v[1])})}}if(p.sort(((C,k)=>C.ymin<k.ymin?-1:C.ymin>k.ymin?1:C.x<k.x?-1:C.x>k.x?1:C.ymax===k.ymax?0:(C.ymax-k.ymax)/Math.abs(C.ymax-k.ymax))),!p.length)return u;let m=[],y=p[0].ymin,x=0;for(;m.length||p.length;){if(p.length){let C=-1;for(let k=0;k<p.length&&!(p[k].ymin>y);k++)C=k;p.splice(0,C+1).forEach((k=>{m.push({s:y,edge:k})}))}if(m=m.filter((C=>!(C.edge.ymax<=y))),m.sort(((C,k)=>C.edge.x===k.edge.x?0:(C.edge.x-k.edge.x)/Math.abs(C.edge.x-k.edge.x))),(d!==1||x%h==0)&&m.length>1)for(let C=0;C<m.length;C+=2){const k=C+1;if(k>=m.length)break;const v=m[C].edge,S=m[k].edge;u.push([[Math.round(v.x),y],[Math.round(S.x),y]])}y+=d,m.forEach((C=>{C.edge.x=C.edge.x+d*C.edge.islope})),x++}return u})(a,o,i);if(s){for(const c of a)za(c,n,-s);(function(c,h,d){const f=[];c.forEach((u=>f.push(...u))),za(f,h,d)})(l,n,-s)}return l}function Ms(e,t){var r;const i=t.hachureAngle+90;let s=t.hachureGap;s<0&&(s=4*t.strokeWidth),s=Math.round(Math.max(s,.1));let o=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(o=s),n_(e,s,i,o||1)}class mh{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Ms(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const s of t)i.push(...this.helper.doubleLineOps(s[0][0],s[0][1],s[1][0],s[1][1],r));return i}}function ya(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class l_ extends mh{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const s=Ms(t,Object.assign({},r,{hachureGap:i})),o=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(o),l=.5*i*Math.sin(o);for(const[c,h]of s)ya([c,h])&&a.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class h_ extends mh{fillPolygons(t,r){const i=this._fillPolygons(t,r),s=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),o=this._fillPolygons(t,s);return i.ops=i.ops.concat(o.ops),i}}class c_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Ms(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let s=r.hachureGap;s<0&&(s=4*r.strokeWidth),s=Math.max(s,.1);let o=r.fillWeight;o<0&&(o=r.strokeWidth/2);const a=s/4;for(const n of t){const l=ya(n),c=l/s,h=Math.ceil(c)-1,d=l-h*s,f=(n[0][0]+n[1][0])/2-s/4,u=Math.min(n[0][1],n[1][1]);for(let p=0;p<h;p++){const m=u+d+p*s,y=f-a+2*Math.random()*a,x=m-a+2*Math.random()*a,C=this.helper.ellipse(y,x,o,o,r);i.push(...C.ops)}}return{type:"fillSketch",ops:i}}}class d_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Ms(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,s=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,o=[];return t.forEach((a=>{const n=ya(a),l=Math.floor(n/(i+s)),c=(n+s-l*(i+s))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let u=0;u<l;u++){const p=u*(i+s),m=p+i,y=[h[0]+p*Math.cos(f)+c*Math.cos(f),h[1]+p*Math.sin(f)+c*Math.sin(f)],x=[h[0]+m*Math.cos(f)+c*Math.cos(f),h[1]+m*Math.sin(f)+c*Math.sin(f)];o.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r))}})),o}}class u_{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,s=r.zigzagOffset<0?i:r.zigzagOffset,o=Ms(t,r=Object.assign({},r,{hachureGap:i+s}));return{type:"fillSketch",ops:this.zigzagLines(o,s,r)}}zigzagLines(t,r,i){const s=[];return t.forEach((o=>{const a=ya(o),n=Math.round(a/(2*r));let l=o[0],c=o[1];l[0]>c[0]&&(l=o[1],c=o[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const f=2*d*r,u=2*(d+1)*r,p=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],y=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],x=[m[0]+p*Math.cos(h+Math.PI/4),m[1]+p*Math.sin(h+Math.PI/4)];s.push(...this.helper.doubleLineOps(m[0],m[1],x[0],x[1],i),...this.helper.doubleLineOps(x[0],x[1],y[0],y[1],i))}})),s}}const ue={};class f_{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const g_=0,ja=1,Dc=2,Xs={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Wa(e,t){return e.type===t}function yh(e){const t=[],r=(function(a){const n=new Array;for(;a!=="";)if(a.match(/^([ \t\r\n,]+)/))a=a.substr(RegExp.$1.length);else if(a.match(/^([aAcChHlLmMqQsStTvVzZ])/))n[n.length]={type:g_,text:RegExp.$1},a=a.substr(RegExp.$1.length);else{if(!a.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];n[n.length]={type:ja,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:Dc,text:""},n})(e);let i="BOD",s=0,o=r[s];for(;!Wa(o,Dc);){let a=0;const n=[];if(i==="BOD"){if(o.text!=="M"&&o.text!=="m")return yh("M0,0"+e);s++,a=Xs[o.text],i=o.text}else Wa(o,ja)?a=Xs[i]:(s++,a=Xs[o.text],i=o.text);if(!(s+a<r.length))throw new Error("Path data ended short");for(let l=s;l<s+a;l++){const c=r[l];if(!Wa(c,ja))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Xs[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),s+=a,o=r[s],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function nm(e){let t=0,r=0,i=0,s=0;const o=[];for(const{key:a,data:n}of e)switch(a){case"M":o.push({key:"M",data:[...n]}),[t,r]=n,[i,s]=n;break;case"m":t+=n[0],r+=n[1],o.push({key:"M",data:[t,r]}),i=t,s=r;break;case"L":o.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],o.push({key:"L",data:[t,r]});break;case"C":o.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+r:c+t));o.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":o.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));o.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":o.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],o.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":o.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],o.push({key:"V",data:[r]});break;case"S":o.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));o.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":o.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],o.push({key:"T",data:[t,r]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=i,r=s}return o}function lm(e){const t=[];let r="",i=0,s=0,o=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,s]=h,[o,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],s=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,s]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,s]});break;case"V":s=h[0],t.push({key:"L",data:[i,s]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=i+(i-n),f=s+(s-l)):(d=i,f=s),t.push({key:"C",data:[d,f,...h]}),n=h[0],l=h[1],i=h[2],s=h[3];break}case"T":{const[d,f]=h;let u=0,p=0;r==="Q"||r==="T"?(u=i+(i-n),p=s+(s-l)):(u=i,p=s);const m=i+2*(u-i)/3,y=s+2*(p-s)/3,x=d+2*(u-d)/3,C=f+2*(p-f)/3;t.push({key:"C",data:[m,y,x,C,d,f]}),n=u,l=p,i=d,s=f;break}case"Q":{const[d,f,u,p]=h,m=i+2*(d-i)/3,y=s+2*(f-s)/3,x=u+2*(d-u)/3,C=p+2*(f-p)/3;t.push({key:"C",data:[m,y,x,C,u,p]}),n=d,l=f,i=u,s=p;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),u=h[2],p=h[3],m=h[4],y=h[5],x=h[6];d===0||f===0?(t.push({key:"C",data:[i,s,y,x,y,x]}),i=y,s=x):(i!==y||s!==x)&&(hm(i,s,y,x,d,f,u,p,m).forEach((function(C){t.push({key:"C",data:C})})),i=y,s=x);break}case"Z":t.push({key:"Z",data:[]}),i=o,s=a}r=c}return t}function Yi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function hm(e,t,r,i,s,o,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let f=[],u=0,p=0,m=0,y=0;if(c)[u,p,m,y]=c;else{[e,t]=Yi(e,t,-h),[r,i]=Yi(r,i,-h);const Y=(e-r)/2,P=(t-i)/2;let A=Y*Y/(s*s)+P*P/(o*o);A>1&&(A=Math.sqrt(A),s*=A,o*=A);const $=s*s,z=o*o,I=$*z-$*P*P-z*Y*Y,M=$*P*P+z*Y*Y,N=(n===l?-1:1)*Math.sqrt(Math.abs(I/M));m=N*s*P/o+(e+r)/2,y=N*-o*Y/s+(t+i)/2,u=Math.asin(parseFloat(((t-y)/o).toFixed(9))),p=Math.asin(parseFloat(((i-y)/o).toFixed(9))),e<m&&(u=Math.PI-u),r<m&&(p=Math.PI-p),u<0&&(u=2*Math.PI+u),p<0&&(p=2*Math.PI+p),l&&u>p&&(u-=2*Math.PI),!l&&p>u&&(p-=2*Math.PI)}let x=p-u;if(Math.abs(x)>120*Math.PI/180){const Y=p,P=r,A=i;p=l&&p>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,f=hm(r=m+s*Math.cos(p),i=y+o*Math.sin(p),P,A,s,o,a,0,l,[p,Y,m,y])}x=p-u;const C=Math.cos(u),k=Math.sin(u),v=Math.cos(p),S=Math.sin(p),_=Math.tan(x/4),B=4/3*s*_,T=4/3*o*_,D=[e,t],O=[e+B*k,t-T*C],R=[r+B*S,i-T*v],H=[r,i];if(O[0]=2*D[0]-O[0],O[1]=2*D[1]-O[1],c)return[O,R,H].concat(f);{f=[O,R,H].concat(f);const Y=[];for(let P=0;P<f.length;P+=3){const A=Yi(f[P][0],f[P][1],h),$=Yi(f[P+1][0],f[P+1][1],h),z=Yi(f[P+2][0],f[P+2][1],h);Y.push([A[0],A[1],$[0],$[1],z[0],z[1]])}return Y}}const p_={randOffset:function(e,t){return ht(e,t)},randOffsetWithRange:function(e,t,r){return zo(e,t,r)},ellipse:function(e,t,r,i,s){const o=dm(r,i,s);return Gn(e,t,s,o).opset},doubleLineOps:function(e,t,r,i,s){return mr(e,t,r,i,s,!0)}};function cm(e,t,r,i,s){return{type:"path",ops:mr(e,t,r,i,s)}}function no(e,t,r){const i=(e||[]).length;if(i>2){const s=[];for(let o=0;o<i-1;o++)s.push(...mr(e[o][0],e[o][1],e[o+1][0],e[o+1][1],r));return t&&s.push(...mr(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:s}}return i===2?cm(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function m_(e,t,r,i,s){return(function(o,a){return no(o,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],s)}function Nc(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=Gs(r[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:Gs(r[0],1.5*(1+.22*t.roughness),jc(t));for(let o=1;o<r.length;o++){const a=r[o];if(a.length){const n=Gs(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Gs(a,1.5*(1+.22*t.roughness),jc(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&s.push(c)}}return{type:"path",ops:i.concat(s)}}return{type:"path",ops:[]}}function dm(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),s=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),o=2*Math.PI/s;let a=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return a+=ht(a*l,r),n+=ht(n*l,r),{increment:o,rx:a,ry:n}}function Gn(e,t,r,i){const[s,o]=Wc(i.increment,e,t,i.rx,i.ry,1,i.increment*zo(.1,zo(.4,1,r),r),r);let a=jo(s,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=Wc(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=jo(n,null,r);a=a.concat(l)}return{estimatedPoints:o,opset:{type:"path",ops:a}}}function qc(e,t,r,i,s,o,a,n,l){const c=e,h=t;let d=Math.abs(r/2),f=Math.abs(i/2);d+=ht(.01*d,l),f+=ht(.01*f,l);let u=s,p=o;for(;u<0;)u+=2*Math.PI,p+=2*Math.PI;p-u>2*Math.PI&&(u=0,p=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(p-u)/2),x=Hc(y,c,h,d,f,u,p,1,l);if(!l.disableMultiStroke){const C=Hc(y,c,h,d,f,u,p,1.5,l);x.push(...C)}return a&&(n?x.push(...mr(c,h,c+d*Math.cos(u),h+f*Math.sin(u),l),...mr(c,h,c+d*Math.cos(p),h+f*Math.sin(p),l)):x.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(u),h+f*Math.sin(u)]})),{type:"path",ops:x}}function zc(e,t){const r=lm(nm(yh(e))),i=[];let s=[0,0],o=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":o=[n[0],n[1]],s=[n[0],n[1]];break;case"L":i.push(...mr(o[0],o[1],n[0],n[1],t)),o=[n[0],n[1]];break;case"C":{const[l,c,h,d,f,u]=n;i.push(...y_(l,c,h,d,f,u,o,t)),o=[f,u];break}case"Z":i.push(...mr(o[0],o[1],s[0],s[1],t)),o=[s[0],s[1]]}return{type:"path",ops:i}}function Ha(e,t){const r=[];for(const i of e)if(i.length){const s=t.maxRandomnessOffset||0,o=i.length;if(o>2){r.push({op:"move",data:[i[0][0]+ht(s,t),i[0][1]+ht(s,t)]});for(let a=1;a<o;a++)r.push({op:"lineTo",data:[i[a][0]+ht(s,t),i[a][1]+ht(s,t)]})}}return{type:"fillPath",ops:r}}function zr(e,t){return(function(r,i){let s=r.fillStyle||"hachure";if(!ue[s])switch(s){case"zigzag":ue[s]||(ue[s]=new l_(i));break;case"cross-hatch":ue[s]||(ue[s]=new h_(i));break;case"dots":ue[s]||(ue[s]=new c_(i));break;case"dashed":ue[s]||(ue[s]=new d_(i));break;case"zigzag-line":ue[s]||(ue[s]=new u_(i));break;default:s="hachure",ue[s]||(ue[s]=new mh(i))}return ue[s]})(t,p_).fillPolygons(e,t)}function jc(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function um(e){return e.randomizer||(e.randomizer=new f_(e.seed||0)),e.randomizer.next()}function zo(e,t,r,i=1){return r.roughness*i*(um(r)*(t-e)+e)}function ht(e,t,r=1){return zo(-e,e,t,r)}function mr(e,t,r,i,s,o=!1){const a=o?s.disableMultiStrokeFill:s.disableMultiStroke,n=Vn(e,t,r,i,s,!0,!1);if(a)return n;const l=Vn(e,t,r,i,s,!0,!0);return n.concat(l)}function Vn(e,t,r,i,s,o,a){const n=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=s.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,f=.2+.2*um(s);let u=s.bowing*s.maxRandomnessOffset*(i-t)/200,p=s.bowing*s.maxRandomnessOffset*(e-r)/200;u=ht(u,s,c),p=ht(p,s,c);const m=[],y=()=>ht(d,s,c),x=()=>ht(h,s,c),C=s.preserveVertices;return a?m.push({op:"move",data:[e+(C?0:y()),t+(C?0:y())]}):m.push({op:"move",data:[e+(C?0:ht(h,s,c)),t+(C?0:ht(h,s,c))]}),a?m.push({op:"bcurveTo",data:[u+e+(r-e)*f+y(),p+t+(i-t)*f+y(),u+e+2*(r-e)*f+y(),p+t+2*(i-t)*f+y(),r+(C?0:y()),i+(C?0:y())]}):m.push({op:"bcurveTo",data:[u+e+(r-e)*f+x(),p+t+(i-t)*f+x(),u+e+2*(r-e)*f+x(),p+t+2*(i-t)*f+x(),r+(C?0:x()),i+(C?0:x())]}),m}function Gs(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+ht(t,r),e[0][1]+ht(t,r)]),i.push([e[0][0]+ht(t,r),e[0][1]+ht(t,r)]);for(let s=1;s<e.length;s++)i.push([e[s][0]+ht(t,r),e[s][1]+ht(t,r)]),s===e.length-1&&i.push([e[s][0]+ht(t,r),e[s][1]+ht(t,r)]);return jo(i,null,r)}function jo(e,t,r){const i=e.length,s=[];if(i>3){const o=[],a=1-r.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];o[0]=[l[0],l[1]],o[1]=[l[0]+(a*e[n+1][0]-a*e[n-1][0])/6,l[1]+(a*e[n+1][1]-a*e[n-1][1])/6],o[2]=[e[n+1][0]+(a*e[n][0]-a*e[n+2][0])/6,e[n+1][1]+(a*e[n][1]-a*e[n+2][1])/6],o[3]=[e[n+1][0],e[n+1][1]],s.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}}else i===3?(s.push({op:"move",data:[e[1][0],e[1][1]]}),s.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&s.push(...Vn(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return s}function Wc(e,t,r,i,s,o,a,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+s*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+s*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+s*Math.sin(0)]),c.push([t+i*Math.cos(e),r+s*Math.sin(e)])}else{const h=ht(.5,n)-Math.PI/2;c.push([ht(o,n)+t+.9*i*Math.cos(h-e),ht(o,n)+r+.9*s*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let f=h;f<d;f+=e){const u=[ht(o,n)+t+i*Math.cos(f),ht(o,n)+r+s*Math.sin(f)];l.push(u),c.push(u)}c.push([ht(o,n)+t+i*Math.cos(h+2*Math.PI+.5*a),ht(o,n)+r+s*Math.sin(h+2*Math.PI+.5*a)]),c.push([ht(o,n)+t+.98*i*Math.cos(h+a),ht(o,n)+r+.98*s*Math.sin(h+a)]),c.push([ht(o,n)+t+.9*i*Math.cos(h+.5*a),ht(o,n)+r+.9*s*Math.sin(h+.5*a)])}return[c,l]}function Hc(e,t,r,i,s,o,a,n,l){const c=o+ht(.1,l),h=[];h.push([ht(n,l)+t+.9*i*Math.cos(c-e),ht(n,l)+r+.9*s*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([ht(n,l)+t+i*Math.cos(d),ht(n,l)+r+s*Math.sin(d)]);return h.push([t+i*Math.cos(a),r+s*Math.sin(a)]),h.push([t+i*Math.cos(a),r+s*Math.sin(a)]),jo(h,null,l)}function y_(e,t,r,i,s,o,a,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,f=n.preserveVertices;for(let u=0;u<d;u++)u===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(f?0:ht(c[0],n)),a[1]+(f?0:ht(c[0],n))]}),h=f?[s,o]:[s+ht(c[u],n),o+ht(c[u],n)],l.push({op:"bcurveTo",data:[e+ht(c[u],n),t+ht(c[u],n),r+ht(c[u],n),i+ht(c[u],n),h[0],h[1]]});return l}function Ui(e){return[...e]}function Yc(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Ui(e[0]),Ui(e[1]),Ui(e[2]),Ui(e[2]));else{const s=[];s.push(e[0],e[0]);for(let n=1;n<e.length;n++)s.push(e[n]),n===e.length-1&&s.push(e[n]);const o=[],a=1-t;i.push(Ui(s[0]));for(let n=1;n+2<s.length;n++){const l=s[n];o[0]=[l[0],l[1]],o[1]=[l[0]+(a*s[n+1][0]-a*s[n-1][0])/6,l[1]+(a*s[n+1][1]-a*s[n-1][1])/6],o[2]=[s[n+1][0]+(a*s[n][0]-a*s[n+2][0])/6,s[n+1][1]+(a*s[n][1]-a*s[n+2][1])/6],o[3]=[s[n+1][0],s[n+1][1]],i.push(o[1],o[2],o[3])}}return i}function lo(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function x_(e,t,r){const i=lo(t,r);if(i===0)return lo(e,t);let s=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return s=Math.max(0,Math.min(1,s)),lo(e,vr(t,r,s))}function vr(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Zn(e,t,r,i){const s=i||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],f=n[l+3];let u=3*h[0]-2*c[0]-f[0];u*=u;let p=3*h[1]-2*c[1]-f[1];p*=p;let m=3*d[0]-2*f[0]-c[0];m*=m;let y=3*d[1]-2*f[1]-c[1];return y*=y,u<m&&(u=m),p<y&&(p=y),u+p})(e,t)<r){const n=e[t+0];s.length?(o=s[s.length-1],a=n,Math.sqrt(lo(o,a))>1&&s.push(n)):s.push(n),s.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],f=vr(l,c,.5),u=vr(c,h,.5),p=vr(h,d,.5),m=vr(f,u,.5),y=vr(u,p,.5),x=vr(m,y,.5);Zn([l,f,m,x],0,r,s),Zn([x,y,p,d],0,r,s)}var o,a;return s}function C_(e,t){return Wo(e,0,e.length,t)}function Wo(e,t,r,i,s){const o=s||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=x_(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Wo(e,t,c+1,i,o),Wo(e,c,r,i,o)):(o.length||o.push(a),o.push(n)),o}function Ya(e,t=.15,r){const i=[],s=(e.length-1)/3;for(let o=0;o<s;o++)Zn(e,3*o,t,i);return r&&r>0?Wo(i,0,i.length,r):i}const ye="none";class Ho{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,s,o){const a=this._o(o);return this._d("line",[cm(t,r,i,s,a)],a)}rectangle(t,r,i,s,o){const a=this._o(o),n=[],l=m_(t,r,i,s,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+s],[t,r+s]];a.fillStyle==="solid"?n.push(Ha([c],a)):n.push(zr([c],a))}return a.stroke!==ye&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,s,o){const a=this._o(o),n=[],l=dm(i,s,a),c=Gn(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=Gn(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(zr([c.estimatedPoints],a));return a.stroke!==ye&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,s){const o=this.ellipse(t,r,i,i,s);return o.shape="circle",o}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[no(t,!1,i)],i)}arc(t,r,i,s,o,a,n=!1,l){const c=this._o(l),h=[],d=qc(t,r,i,s,o,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const u=qc(t,r,i,s,o,a,!0,!1,f);u.type="fillPath",h.push(u)}else h.push((function(f,u,p,m,y,x,C){const k=f,v=u;let S=Math.abs(p/2),_=Math.abs(m/2);S+=ht(.01*S,C),_+=ht(.01*_,C);let B=y,T=x;for(;B<0;)B+=2*Math.PI,T+=2*Math.PI;T-B>2*Math.PI&&(B=0,T=2*Math.PI);const D=(T-B)/C.curveStepCount,O=[];for(let R=B;R<=T;R+=D)O.push([k+S*Math.cos(R),v+_*Math.sin(R)]);return O.push([k+S*Math.cos(T),v+_*Math.sin(T)]),O.push([k,v]),zr([O],C)})(t,r,i,s,o,a,c));return c.stroke!==ye&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),s=[],o=Nc(t,i);if(i.fill&&i.fill!==ye)if(i.fillStyle==="solid"){const a=Nc(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...Ya(Yc([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...Ya(Yc(c),10,(1+i.roughness)/2))}a.length&&s.push(zr([a],i))}return i.stroke!==ye&&s.push(o),this._d("curve",s,i)}polygon(t,r){const i=this._o(r),s=[],o=no(t,!0,i);return i.fill&&(i.fillStyle==="solid"?s.push(Ha([t],i)):s.push(zr([t],i))),i.stroke!==ye&&s.push(o),this._d("polygon",s,i)}path(t,r){const i=this._o(r),s=[];if(!t)return this._d("path",s,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=i.fill&&i.fill!=="transparent"&&i.fill!==ye,a=i.stroke!==ye,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,f){const u=lm(nm(yh(h))),p=[];let m=[],y=[0,0],x=[];const C=()=>{x.length>=4&&m.push(...Ya(x,d)),x=[]},k=()=>{C(),m.length&&(p.push(m),m=[])};for(const{key:S,data:_}of u)switch(S){case"M":k(),y=[_[0],_[1]],m.push(y);break;case"L":C(),m.push([_[0],_[1]]);break;case"C":if(!x.length){const B=m.length?m[m.length-1]:y;x.push([B[0],B[1]])}x.push([_[0],_[1]]),x.push([_[2],_[3]]),x.push([_[4],_[5]]);break;case"Z":C(),m.push([y[0],y[1]])}if(k(),!f)return p;const v=[];for(const S of p){const _=C_(S,f);_.length&&v.push(_)}return v})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=zc(t,i);if(o)if(i.fillStyle==="solid")if(l.length===1){const h=zc(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else s.push(Ha(l,i));else s.push(zr(l,i));return a&&(n?l.forEach((h=>{s.push(no(h,!1,i))})):s.push(c)),this._d("path",s,i)}opsToPath(t,r){let i="";for(const s of t.ops){const o=typeof r=="number"&&r>=0?s.data.map((a=>+a.toFixed(r))):s.data;switch(s.op){case"move":i+=`M${o[0]} ${o[1]} `;break;case"bcurveTo":i+=`C${o[0]} ${o[1]}, ${o[2]} ${o[3]}, ${o[4]} ${o[5]} `;break;case"lineTo":i+=`L${o[0]} ${o[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,s=[];for(const o of r){let a=null;switch(o.type){case"path":a={d:this.opsToPath(o),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ye};break;case"fillPath":a={d:this.opsToPath(o),stroke:ye,strokeWidth:0,fill:i.fill||ye};break;case"fillSketch":a=this.fillSketch(o,i)}a&&s.push(a)}return s}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ye,strokeWidth:i,fill:ye}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class b_{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Ho(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),s=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":s.save(),s.strokeStyle=i.stroke==="none"?"transparent":i.stroke,s.lineWidth=i.strokeWidth,i.strokeLineDash&&s.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(s.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(s,a,o),s.restore();break;case"fillPath":{s.save(),s.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(s,a,o,n),s.restore();break}case"fillSketch":this.fillSketch(s,a,i)}}fillSketch(t,r,i){let s=i.fillWeight;s<0&&(s=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=s,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,s="nonzero"){t.beginPath();for(const o of r.ops){const a=typeof i=="number"&&i>=0?o.data.map((n=>+n.toFixed(i))):o.data;switch(o.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(s):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,s,o){const a=this.gen.line(t,r,i,s,o);return this.draw(a),a}rectangle(t,r,i,s,o){const a=this.gen.rectangle(t,r,i,s,o);return this.draw(a),a}ellipse(t,r,i,s,o){const a=this.gen.ellipse(t,r,i,s,o);return this.draw(a),a}circle(t,r,i,s){const o=this.gen.circle(t,r,i,s);return this.draw(o),o}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,s,o,a,n=!1,l){const c=this.gen.arc(t,r,i,s,o,a,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Vs="http://www.w3.org/2000/svg";class k_{constructor(t,r){this.svg=t,this.gen=new Ho(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,o=s.createElementNS(Vs,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=s.createElementNS(Vs,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=s.createElementNS(Vs,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(s,n,i)}l&&o.appendChild(l)}return o}fillSketch(t,r,i){let s=i.fillWeight;s<0&&(s=i.strokeWidth/2);const o=t.createElementNS(Vs,"path");return o.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),o.setAttribute("stroke",i.fill||""),o.setAttribute("stroke-width",s+""),o.setAttribute("fill","none"),i.fillLineDash&&o.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,s,o){const a=this.gen.line(t,r,i,s,o);return this.draw(a)}rectangle(t,r,i,s,o){const a=this.gen.rectangle(t,r,i,s,o);return this.draw(a)}ellipse(t,r,i,s,o){const a=this.gen.ellipse(t,r,i,s,o);return this.draw(a)}circle(t,r,i,s){const o=this.gen.circle(t,r,i,s);return this.draw(o)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,s,o,a,n=!1,l){const c=this.gen.arc(t,r,i,s,o,a,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var rt={canvas:(e,t)=>new b_(e,t),svg:(e,t)=>new k_(e,t),generator:e=>new Ho(e),newSeed:()=>Ho.newSeed()},lt=g(async(e,t,r)=>{let i;const s=t.useHtmlLabels||Xe(wt()?.htmlLabels);r?i=r:i="node default";const o=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=o.insert("g").attr("class","label").attr("style",Ut(t.labelStyle));let n;t.label===void 0?n="":n=typeof t.label=="string"?t.label:t.label[0];const l=!!t.icon||!!t.img,c=t.labelType==="markdown",h=await Oe(a,Se(pr(n),wt()),{useHtmlLabels:s,width:t.width||wt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},wt());let d=h.getBBox();const f=(t?.padding??0)/2;if(s){const u=h.children[0],p=pt(h);await oh(u,n),d=u.getBoundingClientRect(),p.attr("width",d.width),p.attr("height",d.height)}return s?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:a}},"labelHelper"),Ua=g(async(e,t,r)=>{const i=r.useHtmlLabels??re(wt()),s=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),o=await Oe(s,Se(pr(t),wt()),{useHtmlLabels:i,width:r.width||wt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=o.getBBox();const n=r.padding/2;if(re(wt())){const l=o.children[0],c=pt(o);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?s.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):s.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&s.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:s}},"insertLabel"),ot=g((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),nt=g((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function bt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}g(bt,"createPathFromPoints");function yr(e,t,r,i,s,o){const a=[],l=r-e,c=i-t,h=l/o,d=2*Math.PI/h,f=t+c/2;for(let u=0;u<=50;u++){const p=u/50,m=e+p*l,y=f+s*Math.sin(d*(m-e));a.push({x:m,y})}return a}g(yr,"generateFullSineWavePoints");function ks(e,t,r,i,s,o){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),p=t+r*Math.sin(f);a.push({x:-u,y:-p})}return a}g(ks,"generateCirclePoints");function Kn(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const s=t.find(l=>l.getAttribute("fill")!=="none"),o=t.find(l=>l.getAttribute("stroke")!=="none"),a=g((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(s){const l={fill:a(s,"fill"),"fill-opacity":a(s,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(o){const l={stroke:a(o,"stroke"),"stroke-width":a(o,"stroke-width")??"1","stroke-opacity":a(o,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}g(Kn,"mergePaths");var w_=g((e,t)=>{var r=e.x,i=e.y,s=t.x-r,o=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(o)*a>Math.abs(s)*n?(o<0&&(n=-n),l=o===0?0:n*s/o,c=n):(s<0&&(a=-a),l=a,c=s===0?0:a*o/s),{x:r+l,y:i+c}},"intersectRect"),qr=w_,S_=g(async(e,t,r,i=!1,s=!1)=>{let o=t||"";typeof o=="object"&&(o=o[0]);const a=wt(),n=re(a);return await Oe(e,o,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:s,width:Number.POSITIVE_INFINITY},a)},"createLabel"),hr=S_,xr=g((e,t,r,i,s)=>["M",e+s,t,"H",e+r-s,"A",s,s,0,0,1,e+r,t+s,"V",t+i-s,"A",s,s,0,0,1,e+r-s,t+i,"H",e+s,"A",s,s,0,0,1,e,t+i-s,"V",t+s,"A",s,s,0,0,1,e+s,t,"Z"].join(" "),"createRoundedRectPathD"),v_=g(async(e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:s}=r,{clusterBkg:o,clusterBorder:a}=i,n=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=st(t),f=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),u=Xe(r.flowchart.htmlLabels),p=t.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Oe(m,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let x=y.getBBox();if(u){const Y=y.children[0],P=pt(y);x=Y.getBoundingClientRect(),P.attr("width",x.width),P.attr("height",x.height)}const C=t.padding??0,k=t.width<=x.width+C?x.width+C:t.width;t.width<=x.width+C?t.diff=(k-t.width)/2-C:t.diff=-C;const v=t.height,S=t.y-v/2,_=t.y+v/2,B=t.x-k/2,T=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:S+v/3,D=p?4:0,O=x.height+2*D;let R,H;if(p){const Y=Math.max(O,x.height+2*D),P=B+Y,A=Math.max(0,k-Y);if(t.look==="handDrawn"){const I=rt.svg(f),M=et(t,{roughness:.7,fill:o,stroke:n,fillWeight:3,seed:s}),N=et(t,{roughness:.7,fill:"none",stroke:n,seed:s}),L=I.rectangle(B,S,Y,v,M);R=f.insert(()=>L,":first-child");const X=I.rectangle(P,S,A,v,N);H=f.insert(()=>X,":first-child"),R.select("path:nth-child(2)").attr("style",h.join(";")),R.select("path").attr("style",d.join(";").replace("fill","stroke"))}else R=f.insert("rect",":first-child"),H=f.insert("rect",":first-child"),R.attr("class","swimlane-title").attr("style",c).attr("x",B).attr("y",S).attr("width",Y).attr("height",v).attr("fill",o).attr("stroke",n),H.attr("class","swimlane-body").attr("style",c).attr("x",P).attr("y",S).attr("width",A).attr("height",v).attr("fill","none").attr("stroke",n);const $=B+Y/2,z=t.y;m.attr("transform",`translate(${$}, ${z}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{const Y=Math.max(0,T-S),P=Math.min(O,Y),A=S+P,$=Math.max(0,_-A),z=t.x-k/2;if(t.look==="handDrawn"){const N=rt.svg(f),L=et(t,{roughness:.7,fill:o,stroke:n,fillWeight:3,seed:s}),X=et(t,{roughness:.7,fill:"none",stroke:n,seed:s}),U=N.rectangle(z,S,k,P,L);R=f.insert(()=>U,":first-child");const G=N.rectangle(z,A,k,$,X);H=f.insert(()=>G,":first-child"),R.select("path:nth-child(2)").attr("style",h.join(";")),R.select("path").attr("style",d.join(";").replace("fill","stroke"))}else R=f.insert("rect",":first-child"),H=f.insert("rect",":first-child"),R.attr("class","swimlane-title").attr("style",c).attr("x",z).attr("y",S).attr("width",k).attr("height",P).attr("fill",o).attr("stroke",n),H.attr("class","swimlane-body").attr("style",c).attr("x",z).attr("y",A).attr("width",k).attr("height",$).attr("fill","none").attr("stroke",n);const I=t.x-x.width/2,M=S+(P-x.height)/2;m.attr("transform",`translate(${I}, ${M})`)}if(V.trace("Swimlane data ",t,JSON.stringify(t)),l){const Y=m.select("span");Y&&Y.attr("style",l)}return t.offsetX=0,t.width=k,t.height=v,t.offsetY=x.height-C/2,t.intersect=function(Y){return qr(t,Y)},{cluster:f,labelBBox:x}},"swimlane"),fm=g(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=wt(),{themeVariables:i,handDrawnSeed:s}=r,{clusterBkg:o,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=st(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=re(r),u=d.insert("g").attr("class","cluster-label ");let p;t.labelType==="markdown"?p=await Oe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):p=await hr(u,t.label,t.labelStyle||"",!1,!0);let m=p.getBBox();if(re(r)){const B=p.children[0],T=pt(p);m=B.getBoundingClientRect(),T.attr("width",m.width),T.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,k=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let v;if(t.look==="handDrawn"){const B=rt.svg(d),T=et(t,{roughness:.7,fill:o,stroke:a,fillWeight:3,seed:s}),D=B.path(xr(C,k,y,x,0),T);v=d.insert(()=>(V.debug("Rough node insert CXC",D),D),":first-child"),v.select("path:nth-child(2)").attr("style",c.join(";")),v.select("path").attr("style",h.join(";").replace("fill","stroke"))}else v=d.insert("rect",":first-child"),v.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:S}=ua(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const B=u.select("span");B&&B.attr("style",n)}const _=v.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(B){return qr(t,B)},{cluster:d,labelBBox:m}},"rect"),T_=g((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),s=0*t.padding,o=s/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2-o).attr("width",t.width+s).attr("height",t.height+s).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return qr(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),__=g(async(e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:s}=r,{altBackground:o,compositeBackground:a,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const u=await hr(d,t.label,t.labelStyle,void 0,!0);let p=u.getBBox();if(re(r)){const D=u.children[0],O=pt(u);p=D.getBoundingClientRect(),O.attr("width",p.width),O.attr("height",p.height)}const m=0*t.padding,y=m/2,x=(t.width<=p.width+t.padding?p.width+t.padding:t.width)+m;t.width<=p.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height+m,k=t.height+m-p.height-6,v=t.x-x/2,S=t.y-C/2;t.width=x;const _=t.y-t.height/2-y+p.height+2;let B;if(t.look==="handDrawn"){const D=t.cssClasses.includes("statediagram-cluster-alt"),O=rt.svg(c),R=t.rx||t.ry?O.path(xr(v,S,x,C,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:s}):O.rectangle(v,S,x,C,{seed:s});B=c.insert(()=>R,":first-child");const H=O.rectangle(v,_,x,k,{fill:D?o:a,fillStyle:D?"hachure":"solid",stroke:l,seed:s});B=c.insert(()=>R,":first-child"),f=c.insert(()=>H)}else B=h.insert("rect",":first-child"),B.attr("class","outer").attr("x",v).attr("y",S).attr("width",x).attr("height",C).attr("data-look",t.look),f.attr("class","inner").attr("x",v).attr("y",_).attr("width",x).attr("height",k);d.attr("transform",`translate(${t.x-p.width/2}, ${S+1-(re(r)?0:3)})`);const T=B.node().getBBox();return t.height=T.height,t.offsetX=0,t.offsetY=p.height-t.padding/2,t.labelBBox=p,t.intersect=function(D){return qr(t,D)},{cluster:c,labelBBox:p}},"roundedWithTitle"),B_=g(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=wt(),{themeVariables:i,handDrawnSeed:s}=r,{clusterBkg:o,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=st(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=re(r),u=d.insert("g").attr("class","cluster-label "),p=await Oe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=p.getBBox();if(re(r)){const B=p.children[0],T=pt(p);m=B.getBoundingClientRect(),T.attr("width",m.width),T.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,k=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let v;if(t.look==="handDrawn"){const B=rt.svg(d),T=et(t,{roughness:.7,fill:o,stroke:a,fillWeight:4,seed:s}),D=B.path(xr(C,k,y,x,t.rx),T);v=d.insert(()=>(V.debug("Rough node insert CXC",D),D),":first-child"),v.select("path:nth-child(2)").attr("style",c.join(";")),v.select("path").attr("style",h.join(";").replace("fill","stroke"))}else v=d.insert("rect",":first-child"),v.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:S}=ua(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const B=u.select("span");B&&B.attr("style",n)}const _=v.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(B){return qr(t,B)},{cluster:d,labelBBox:m}},"kanbanSection"),L_=g((e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:s}=r,{nodeBorder:o}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,d=t.x-c/2,f=t.y-h/2;t.width=c;let u;if(t.look==="handDrawn"){const y=rt.svg(a).rectangle(d,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:o,seed:s});u=a.insert(()=>y,":first-child")}else{u=n.insert("rect",":first-child");let m="outer";t.look,m="divider",u.attr("class",m).attr("x",d).attr("y",f).attr("width",c).attr("height",h).attr("data-look",t.look)}const p=u.node().getBBox();return t.height=p.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return qr(t,m)},{cluster:a,labelBBox:{}}},"divider"),E_=fm,F_={rect:fm,squareRect:E_,roundedWithTitle:__,noteGroup:T_,divider:L_,kanbanSection:B_,swimlane:v_},gm=new Map,pm=g(async(e,t)=>{const r=t.shape||"rect",i=await F_[r](e,t);return gm.set(t.id,i),i},"insertCluster"),A_=g(()=>{gm=new Map},"clear");function mm(e,t){return e.intersect(t)}g(mm,"intersectNode");var M_=mm;function ym(e,t,r,i){var s=e.x,o=e.y,a=s-i.x,n=o-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x<s&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<o&&(h=-h),{x:s+c,y:o+h}}g(ym,"intersectEllipse");var xm=ym;function Cm(e,t,r){return xm(e,t,t,r)}g(Cm,"intersectCircle");var $_=Cm;function bm(e,t,r,i){{const s=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,n=s*r.x+o*r.y+a,l=s*i.x+o*i.y+a,c=1e-6;if(n!==0&&l!==0&&Qn(n,l))return;const h=i.y-r.y,d=r.x-i.x,f=i.x*r.y-r.x*i.y,u=h*e.x+d*e.y+f,p=h*t.x+d*t.y+f;if(Math.abs(u)<c&&Math.abs(p)<c&&Qn(u,p))return;const m=s*d-h*o;if(m===0)return;const y=Math.abs(m/2);let x=o*f-d*a;const C=x<0?(x-y)/m:(x+y)/m;x=h*a-s*f;const k=x<0?(x-y)/m:(x+y)/m;return{x:C,y:k}}}g(bm,"intersectLine");function Qn(e,t){return e*t>0}g(Qn,"sameSign");var O_=bm;function km(e,t,r){let i=e.x,s=e.y,o=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=i-e.width/2-a,c=s-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],f=t[h<t.length-1?h+1:0],u=O_(e,r,{x:l+d.x,y:c+d.y},{x:l+f.x,y:c+f.y});u&&o.push(u)}return o.length?(o.length>1&&o.sort(function(h,d){let f=h.x-r.x,u=h.y-r.y,p=Math.sqrt(f*f+u*u),m=d.x-r.x,y=d.y-r.y,x=Math.sqrt(m*m+y*y);return p<x?-1:p===x?0:1}),o[0]):e}g(km,"intersectPolygon");var R_=km,tt={node:M_,circle:$_,ellipse:xm,polygon:R_,rect:qr};function wm(e,t){const{labelStyles:r}=st(t);t.labelStyle=r;const i=nt(t);let s=i;i||(s="anchor");const o=e.insert("g").attr("class",s).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,l=rt.svg(o),c=et(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,a*2,c),d=o.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Ut(n)),ot(t,d),t.intersect=function(f){return V.info("Circle intersect",t,a,f),tt.circle(t,a,f)},o}g(wm,"anchor");function Jn(e,t,r,i,s,o,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,f=(i-t)/2,u=d/s,p=f/o,m=Math.sqrt(u**2+p**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),x=l+y*o*Math.sin(h)*(a?-1:1),C=c-y*s*Math.cos(h)*(a?-1:1),k=Math.atan2((t-C)/o,(e-x)/s);let S=Math.atan2((i-C)/o,(r-x)/s)-k;a&&S<0&&(S+=2*Math.PI),!a&&S>0&&(S-=2*Math.PI);const _=[];for(let B=0;B<20;B++){const T=B/19,D=k+T*S,O=x+s*Math.cos(D),R=C+o*Math.sin(D);_.push({x:O,y:R})}return _}g(Jn,"generateArcPoints");function Sm(e,t,r){const[i,s]=[t,r].sort((o,a)=>a-o);return s*(1-Math.sqrt(1-(e/i/2)**2))}g(Sm,"calculateArcSagitta");async function vm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=g(D=>D+a,"calcTotalHeight"),l=g(D=>{const O=D/2;return[O/(2.5+D/50),O]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=n(t?.height?t?.height:h.height),[f,u]=l(d),p=Sm(d,f,u),y=(t?.width?t?.width:h.width)+o*2+p-p,x=d,{cssStyles:C}=t,k=[{x:y/2,y:-x/2},{x:-y/2,y:-x/2},...Jn(-y/2,-x/2,-y/2,x/2,f,u,!1),{x:y/2,y:x/2},...Jn(y/2,x/2,y/2,-x/2,f,u,!0)],v=rt.svg(c),S=et(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const _=bt(k),B=v.path(_,S),T=c.insert(()=>B,":first-child");return T.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(${f/2}, 0)`),ot(t,T),t.intersect=function(D){return tt.polygon(t,k,D)},c}g(vm,"bowTieRect");function ar(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}g(ar,"insertPolygonShape");var Zs=12;async function Tm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?28:s,a=t.look==="neo"?24:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width??l.width)+(t.look==="neo"?o*2:o+Zs),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,f=c,u=-h,p=0,m=[{x:d+Zs,y:u},{x:f,y:u},{x:f,y:p},{x:d,y:p},{x:d,y:u+Zs},{x:d+Zs,y:u}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(n),k=et(t,{}),v=bt(m),S=C.path(v,k);y=n.insert(()=>S,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),x&&y.attr("style",x)}else y=ar(n,c,h,m);return i&&y.attr("style",i),ot(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},n}g(Tm,"card");function _m(e,t){const{nodeStyles:r}=st(t);t.label="";const i=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,o=Math.max(28,t.width??0),a=[{x:0,y:o/2},{x:o/2,y:0},{x:0,y:-o/2},{x:-o/2,y:0}],n=rt.svg(i),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=bt(a),h=n.path(c,l),d=i.insert(()=>h,":first-child");return s&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",s),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return tt.polygon(t,a,f)},i}g(_m,"choice");async function xh(e,t,r){const{labelStyles:i,nodeStyles:s}=st(t);t.labelStyle=i;const{shapeSvg:o,bbox:a,halfPadding:n}=await lt(e,t,nt(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(o),p=et(t,{}),m=u.circle(0,0,h*2,p);d=o.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Ut(f))}else d=o.insert("circle",":first-child").attr("class","basic label-container").attr("style",s).attr("r",h).attr("cx",0).attr("cy",0);return ot(t,d),t.calcIntersect=function(u,p){const m=u.width/2;return tt.circle(u,m,p)},t.intersect=function(u){return V.info("Circle intersect",t,h,u),tt.circle(t,h,u)},o}g(xh,"circle");function Bm(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,s={x:i/2*t,y:i/2*r},o={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${o.x},${o.y} L ${n.x},${n.y}
|
|
233
|
+
M ${s.x},${s.y} L ${a.x},${a.y}`}g(Bm,"createLine");function Lm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r,t.label="";const s=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),o=Math.max(30,t?.width??0),{cssStyles:a}=t,n=rt.svg(s),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,o*2,l),h=Bm(o),d=n.path(h,l),f=s.insert(()=>c,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),a&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),ot(t,f),t.intersect=function(u){return V.info("crossedCircle intersect",t,{radius:o,point:u}),tt.circle(t,o,u)},s}g(Lm,"crossedCircle");function Qe(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),p=t+r*Math.sin(f);a.push({x:-u,y:-p})}return a}g(Qe,"generateCirclePoints");async function Em(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await lt(e,t,nt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+n,h=o.height+l,d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...Qe(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Qe(c/2+d*2,-d,d,20,-180,-270),...Qe(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Qe(c/2,h/2,d,20,0,90)],p=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Qe(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Qe(c/2+c*.1,-d,d,20,-180,-270),...Qe(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Qe(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2,y:h/2+d}],m=rt.svg(s),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(u).replace("Z",""),k=m.path(C,y),v=bt(p),S=m.path(v,{...y}),_=s.insert("g",":first-child");return _.insert(()=>S,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ot(t,_),t.intersect=function(B){return tt.polygon(t,p,B)},s}g(Em,"curlyBraceLeft");function Je(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),p=t+r*Math.sin(f);a.push({x:u,y:p})}return a}g(Je,"generateCirclePoints");async function Fm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await lt(e,t,nt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...Je(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Je(c/2+d*2,-d,d,20,-180,-270),...Je(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Je(c/2,h/2,d,20,0,90)],p=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...Je(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Je(c/2+d*2,-d,d,20,-180,-270),...Je(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Je(c/2,h/2,d,20,0,90),{x:c/2,y:h/2+d},{x:-c/2,y:h/2+d}],m=rt.svg(s),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(u).replace("Z",""),k=m.path(C,y),v=bt(p),S=m.path(v,{...y}),_=s.insert("g",":first-child");return _.insert(()=>S,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ot(t,_),t.intersect=function(B){return tt.polygon(t,p,B)},s}g(Fm,"curlyBraceRight");function Kt(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),p=t+r*Math.sin(f);a.push({x:-u,y:-p})}return a}g(Kt,"generateCirclePoints");async function Am(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await lt(e,t,nt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...Kt(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Kt(c/2+d*2,-d,d,20,-180,-270),...Kt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Kt(c/2,h/2,d,20,0,90)],p=[...Kt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Kt(-c/2-d/2,-d,d,20,0,90),...Kt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Kt(-c/2+d+d/2,h/2,d,30,-180,-270)],m=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Kt(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Kt(c/2+d*2,-d,d,20,-180,-270),...Kt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Kt(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2-d-d/2,y:h/2+d},...Kt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Kt(-c/2-d/2,-d,d,20,0,90),...Kt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Kt(-c/2+d+d/2,h/2,d,30,-180,-270)],y=rt.svg(s),x=et(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=bt(u).replace("Z",""),v=y.path(k,x),_=bt(p).replace("Z",""),B=y.path(_,x),T=bt(m),D=y.path(T,{...x}),O=s.insert("g",":first-child");return O.insert(()=>D,":first-child").attr("stroke-opacity",0),O.insert(()=>v,":first-child"),O.insert(()=>B,":first-child"),O.attr("class","text"),f&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",i),O.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ot(t,O),t.intersect=function(R){return tt.polygon(t,m,R)},s}g(Am,"curlyBraces");async function Mm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=20,l=5,{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=Math.max(n,(h.width+o*2)*1.25,t?.width??0),f=Math.max(l,h.height+a*2,t?.height??0),u=f/2,{cssStyles:p}=t,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=d,C=f,k=x-u,v=C/4,S=[{x:k,y:0},{x:v,y:0},{x:0,y:C/2},{x:v,y:C},{x:k,y:C},...ks(-k,-C/2,u,50,270,90)],_=bt(S),B=m.path(_,y),T=c.insert(()=>B,":first-child");return T.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),T.attr("transform",`translate(${-d/2}, ${-f/2})`),ot(t,T),t.intersect=function(D){return tt.polygon(t,S,D)},c}g(Mm,"curvedTrapezoid");var I_=g((e,t,r,i,s,o)=>[`M${e},${t+o}`,`a${s},${o} 0,0,0 ${r},0`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),P_=g((e,t,r,i,s,o)=>[`M${e},${t+o}`,`M${e+r},${t+o}`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),D_=g((e,t,r,i,s,o)=>[`M${e-r/2},${-i/2}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Uc=8,Xc=8;async function $m(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?24:s,a=t.look==="neo"?24:s;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.width<Xc&&(t.width=Xc);const C=y/2/(2.5+y/50);t.height=(t.height??0)-o-C*3,t.height<Uc&&(t.height=Uc)}const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t.width?t.width:l.width)+a,d=h/2,f=d/(2.5+h/50),u=(t.height?t.height:l.height)+o+f;let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=rt.svg(n),x=P_(0,0,h,u,d,f),C=D_(0,f,h,u,d,f),k=et(t,{}),v=y.path(x,k),S=y.path(C,et(t,{fill:"none"}));p=n.insert(()=>S,":first-child"),p=n.insert(()=>v,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{const y=I_(0,0,h,u,d,f);p=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Ut(m)).attr("style",i)}return p.attr("label-offset-y",f),p.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),ot(t,p),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(y){const x=tt.rect(t,y),C=x.x-(t.x??0);if(d!=0&&(Math.abs(C)<(t.width??0)/2||Math.abs(C)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-f)){let k=f*f*(1-C*C/(d*d));k>0&&(k=Math.sqrt(k)),k=f-k,y.y-(t.y??0)>0&&(k=-k),x.y+=k}return x},n}g($m,"cylinder");async function Mi(e,t,r){const{labelStyles:i,nodeStyles:s}=st(t);t.labelStyle=i;const{shapeSvg:o,bbox:a}=await lt(e,t,nt(t)),n=Math.max(a.width+r.labelPaddingX*2,t?.width||0),l=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:f,ry:u}=t;const{cssStyles:p}=t;if(r?.rx&&r.ry&&(f=r.rx,u=r.ry),t.look==="handDrawn"){const m=rt.svg(o),y=et(t,{}),x=f||u?m.path(xr(c,h,n,l,f||0),y):m.rectangle(c,h,n,l,y);d=o.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",Ut(p))}else d=o.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",s).attr("rx",Ut(f)).attr("ry",Ut(u)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return ot(t,d),t.calcIntersect=function(m,y){return tt.rect(m,y)},t.intersect=function(m){return tt.rect(t,m)},o}g(Mi,"drawRect");async function Om(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:s,padding:o,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(o??0)*2,labelPaddingY:s??o??0},c=await Mi(e,t,l);if(t.look==="handDrawn"){const u=rt.svg(c),p=et(t,{}),m=c.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return c;let x=null;if(y instanceof SVGGraphicsElement)x=y.getBBox();else return c;return c.insert(()=>u.line(x.x,x.y,x.x+x.width,x.y,p),".basic.label-container g.label"),c.insert(()=>u.line(x.x,x.y+x.height,x.x+x.width,x.y+x.height,p),".basic.label-container g.label"),m.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,f=(Number(h.attr("height"))||n)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),c}g(Om,"datastore");async function Rm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=n.width+s,h=n.height+o,d=h*.2,f=-c/2,u=-h/2-d/2,{cssStyles:p}=t,m=rt.svg(a),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:f,y:u+d},{x:-f,y:u+d},{x:-f,y:-u},{x:f,y:-u},{x:f,y:u},{x:-f,y:u},{x:-f,y:u+d}],C=m.polygon(x.map(v=>[v.x,v.y]),y),k=a.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),l.attr("transform",`translate(${f+(t.padding??0)/2-(n.x-(n.left??0))}, ${u+d+(t.padding??0)/2-(n.y-(n.top??0))})`),ot(t,k),t.intersect=function(v){return tt.rect(t,v)},a}g(Rm,"dividedRectangle");async function Im(e,t){const{labelStyles:r,nodeStyles:i}=st(t),s=t.look==="neo"?12:5;t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-s;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(n),p=et(t,{roughness:.2,strokeWidth:2.5}),m=et(t,{roughness:.2,strokeWidth:1.5}),y=u.circle(0,0,c*2,p),x=u.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",Ut(t.cssClasses)).attr("style",Ut(f)),d.node()?.appendChild(y),d.node()?.appendChild(x)}else{d=n.insert("g",":first-child");const u=d.insert("circle",":first-child"),p=d.insert("circle");d.attr("class","basic label-container").attr("style",i),u.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),p.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return ot(t,d),t.intersect=function(u){return V.info("DoubleCircle intersect",t,c,u),tt.circle(t,c,u)},n}g(Im,"doublecircle");function Pm(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:s}=st(t);t.label="",t.labelStyle=i;const o=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=rt.svg(o),{nodeBorder:c}=r,h=et(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=o.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",s),ot(t,f),t.intersect=function(u){return V.info("filledCircle intersect",t,{radius:a,point:u}),tt.circle(t,a,u)},o}g(Pm,"filledCircle");var Gc=10,Vc=10;async function Dm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?s*2:s;(t.width||t.height)&&(t.height=t?.height??0,t.height<Gc&&(t.height=Gc),t.width=(t?.width??0)-o-o/2,t.width<Vc&&(t.width=Vc));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:n.width)+(o??0),h=t?.height?t?.height:c+n.height,d=h,f=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:u}=t,p=rt.svg(a),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=bt(f),x=p.path(y,m),C=a.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return u&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),t.width=c,t.height=h,ot(t,C),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(k){return V.info("Triangle intersect",t,f,k),tt.polygon(t,f,k)},a}g(Dm,"flippedTriangle");function Nm(e,t,{dir:r,config:{state:i,themeVariables:s}}){const{nodeStyles:o}=st(t);t.label="";const a=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,f=rt.svg(a),u=et(t,{stroke:s.lineColor,fill:s.lineColor});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const p=f.rectangle(h,d,l,c,u),m=a.insert(()=>p,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",o),ot(t,m);const y=i?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(x){return tt.rect(t,x)},a}g(Nm,"forkJoin");async function qm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=15,o=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<o&&(t.height=o),t.width=(t?.width??0)-a*2,t.width<s&&(t.width=s));const{shapeSvg:l,bbox:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:Math.max(s,c.width))+a*2,d=(t?.height?t?.height:Math.max(o,c.height))+n*2,f=d/2,{cssStyles:u}=t,p=rt.svg(l),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2,y:-d/2},{x:h/2-f,y:-d/2},...ks(-h/2+f,0,f,50,90,270),{x:h/2-f,y:d/2},{x:-h/2,y:d/2}],x=bt(y),C=p.path(x,m),k=l.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),ot(t,k),t.intersect=function(v){return V.info("Pill intersect",t,{radius:f,point:v}),tt.polygon(t,y,v)},l}g(qm,"halfRoundedRectangle");var N_=g((e,t,r,i,s)=>[`M${e+s},${t}`,`L${e+r-s},${t}`,`L${e+r},${t-i/2}`,`L${e+r-s},${t-i}`,`L${e+s},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function zm(e,t){const{labelStyles:r,nodeStyles:i}=st(t),s=t.look==="neo"?3.5:4;t.labelStyle=r;const o=t.padding??0,a=70,n=32,l=t.look==="neo"?a:o,c=t.look==="neo"?n:o;if(t.width||t.height){const k=(t.height??0)/s;t.width=(t?.width??0)-2*k-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await lt(e,t,nt(t)),f=(t?.height?t?.height:d.height)+l,u=f/s,p=(t?.width?t?.width:d.width)+2*u+c,m=[{x:u,y:0},{x:p-u,y:0},{x:p,y:-f/2},{x:p-u,y:-f},{x:u,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(h),k=et(t,{}),v=N_(0,0,p,f,u),S=C.path(v,k);y=h.insert(()=>S,":first-child").attr("transform",`translate(${-p/2}, ${f/2})`),x&&y.attr("style",x)}else y=ar(h,p,f,m);return i&&y.attr("style",i),t.width=p,t.height=f,ot(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},h}g(zm,"hexagon");async function jm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.label="",t.labelStyle=r;const{shapeSvg:s}=await lt(e,t,nt(t)),o=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=rt.svg(s),c=et(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:o,y:0},{x:0,y:a},{x:o,y:a}],d=bt(h),f=l.path(d,c),u=s.insert(()=>f,":first-child");return u.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",i),u.attr("transform",`translate(${-o/2}, ${-a/2})`),ot(t,u),t.intersect=function(p){return V.info("Pill intersect",t,{points:h}),tt.polygon(t,h,p)},s}g(jm,"hourglass");async function Wm(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:s}=st(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await lt(e,t,"icon-shape default"),f=t.pos==="t",u=n,p=n,{nodeBorder:m}=r,{stylesMap:y}=Fi(t),x=-p/2,C=-u/2,k=t.label?8:0,v=rt.svg(c),S=et(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const _=v.rectangle(x,C,p,u,S),B=Math.max(p,h.width),T=u+h.height+k,D=v.rectangle(-B/2,-T/2,B,T,{...S,fill:"transparent",stroke:"none"}),O=c.insert(()=>_,":first-child"),R=c.insert(()=>D);if(t.icon){const H=c.append("g");H.html(`<g>${await Ai(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const Y=H.node().getBBox(),P=Y.width,A=Y.height,$=Y.x,z=Y.y;H.attr("transform",`translate(${-P/2-$},${f?h.height/2+k/2-A/2-z:-h.height/2-k/2-A/2-z})`),H.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-T/2:T/2-h.height})`),O.attr("transform",`translate(0,${f?h.height/2+k/2:-h.height/2-k/2})`),ot(t,R),t.intersect=function(H){if(V.info("iconSquare intersect",t,H),!t.label)return tt.rect(t,H);const Y=t.x??0,P=t.y??0,A=t.height??0;let $=[];return f?$=[{x:Y-h.width/2,y:P-A/2},{x:Y+h.width/2,y:P-A/2},{x:Y+h.width/2,y:P-A/2+h.height+k},{x:Y+p/2,y:P-A/2+h.height+k},{x:Y+p/2,y:P+A/2},{x:Y-p/2,y:P+A/2},{x:Y-p/2,y:P-A/2+h.height+k},{x:Y-h.width/2,y:P-A/2+h.height+k}]:$=[{x:Y-p/2,y:P-A/2},{x:Y+p/2,y:P-A/2},{x:Y+p/2,y:P-A/2+u},{x:Y+h.width/2,y:P-A/2+u},{x:Y+h.width/2/2,y:P+A/2},{x:Y-h.width/2,y:P+A/2},{x:Y-h.width/2,y:P-A/2+u},{x:Y-p/2,y:P-A/2+u}],tt.polygon(t,$,H)},c}g(Wm,"icon");async function Hm(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:s}=st(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await lt(e,t,"icon-shape default"),f=20,u=t.label?8:0,p=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Fi(t),C=rt.svg(c),k=et(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=x.get("fill");k.stroke=v??y;const S=c.append("g");t.icon&&S.html(`<g>${await Ai(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const _=S.node().getBBox(),B=_.width,T=_.height,D=_.x,O=_.y,R=Math.max(B,T)*Math.SQRT2+f*2,H=C.circle(0,0,R,k),Y=Math.max(R,h.width),P=R+h.height+u,A=C.rectangle(-Y/2,-P/2,Y,P,{...k,fill:"transparent",stroke:"none"}),$=c.insert(()=>H,":first-child"),z=c.insert(()=>A);return S.attr("transform",`translate(${-B/2-D},${p?h.height/2+u/2-T/2-O:-h.height/2-u/2-T/2-O})`),S.attr("style",`color: ${x.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-P/2:P/2-h.height})`),$.attr("transform",`translate(0,${p?h.height/2+u/2:-h.height/2-u/2})`),ot(t,z),t.intersect=function(I){return V.info("iconSquare intersect",t,I),tt.rect(t,I)},c}g(Hm,"iconCircle");async function Ym(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:s}=st(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await lt(e,t,"icon-shape default"),u=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Fi(t),k=-m/2,v=-p/2,S=t.label?8:0,_=rt.svg(c),B=et(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const T=C.get("fill");B.stroke=T??x;const D=_.path(xr(k,v,m,p,5),B),O=Math.max(m,h.width),R=p+h.height+S,H=_.rectangle(-O/2,-R/2,O,R,{...B,fill:"transparent",stroke:"none"}),Y=c.insert(()=>D,":first-child").attr("class","icon-shape2"),P=c.insert(()=>H);if(t.icon){const A=c.append("g");A.html(`<g>${await Ai(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const $=A.node().getBBox(),z=$.width,I=$.height,M=$.x,N=$.y;A.attr("transform",`translate(${-z/2-M},${u?h.height/2+S/2-I/2-N:-h.height/2-S/2-I/2-N})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-R/2:R/2-h.height})`),Y.attr("transform",`translate(0,${u?h.height/2+S/2:-h.height/2-S/2})`),ot(t,P),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const $=t.x??0,z=t.y??0,I=t.height??0;let M=[];return u?M=[{x:$-h.width/2,y:z-I/2},{x:$+h.width/2,y:z-I/2},{x:$+h.width/2,y:z-I/2+h.height+S},{x:$+m/2,y:z-I/2+h.height+S},{x:$+m/2,y:z+I/2},{x:$-m/2,y:z+I/2},{x:$-m/2,y:z-I/2+h.height+S},{x:$-h.width/2,y:z-I/2+h.height+S}]:M=[{x:$-m/2,y:z-I/2},{x:$+m/2,y:z-I/2},{x:$+m/2,y:z-I/2+p},{x:$+h.width/2,y:z-I/2+p},{x:$+h.width/2/2,y:z+I/2},{x:$-h.width/2,y:z+I/2},{x:$-h.width/2,y:z-I/2+p},{x:$-m/2,y:z-I/2+p}],tt.polygon(t,M,A)},c}g(Ym,"iconRounded");async function Um(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:s}=st(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await lt(e,t,"icon-shape default"),u=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Fi(t),k=-m/2,v=-p/2,S=t.label?8:0,_=rt.svg(c),B=et(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const T=C.get("fill");B.stroke=T??x;const D=_.path(xr(k,v,m,p,.1),B),O=Math.max(m,h.width),R=p+h.height+S,H=_.rectangle(-O/2,-R/2,O,R,{...B,fill:"transparent",stroke:"none"}),Y=c.insert(()=>D,":first-child"),P=c.insert(()=>H);if(t.icon){const A=c.append("g");A.html(`<g>${await Ai(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const $=A.node().getBBox(),z=$.width,I=$.height,M=$.x,N=$.y;A.attr("transform",`translate(${-z/2-M},${u?h.height/2+S/2-I/2-N:-h.height/2-S/2-I/2-N})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-R/2:R/2-h.height})`),Y.attr("transform",`translate(0,${u?h.height/2+S/2:-h.height/2-S/2})`),ot(t,P),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const $=t.x??0,z=t.y??0,I=t.height??0;let M=[];return u?M=[{x:$-h.width/2,y:z-I/2},{x:$+h.width/2,y:z-I/2},{x:$+h.width/2,y:z-I/2+h.height+S},{x:$+m/2,y:z-I/2+h.height+S},{x:$+m/2,y:z+I/2},{x:$-m/2,y:z+I/2},{x:$-m/2,y:z-I/2+h.height+S},{x:$-h.width/2,y:z-I/2+h.height+S}]:M=[{x:$-m/2,y:z-I/2},{x:$+m/2,y:z-I/2},{x:$+m/2,y:z-I/2+p},{x:$+h.width/2,y:z-I/2+p},{x:$+h.width/2/2,y:z+I/2},{x:$-h.width/2,y:z+I/2},{x:$-h.width/2,y:z-I/2+p},{x:$-m/2,y:z-I/2+p}],tt.polygon(t,M,A)},c}g(Um,"iconSquare");async function Xm(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const s=Number(i.naturalWidth.toString().replace("px","")),o=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=s/o;const{labelStyles:a}=st(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??s),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??o;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:f,label:u}=await lt(e,t,"image-shape default"),p=t.pos==="t",m=-c/2,y=-h/2,x=t.label?8:0,C=rt.svg(d),k=et(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=C.rectangle(m,y,c,h,k),S=Math.max(c,f.width),_=h+f.height+x,B=C.rectangle(-S/2,-_/2,S,_,{...k,fill:"none",stroke:"none"}),T=d.insert(()=>v,":first-child"),D=d.insert(()=>B);if(t.img){const O=d.append("image");O.attr("href",t.img),O.attr("width",c),O.attr("height",h),O.attr("preserveAspectRatio","none"),O.attr("transform",`translate(${-c/2},${p?_/2-h:-_/2})`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${p?-h/2-f.height/2-x/2:h/2-f.height/2+x/2})`),T.attr("transform",`translate(0,${p?f.height/2+x/2:-f.height/2-x/2})`),ot(t,D),t.intersect=function(O){if(V.info("iconSquare intersect",t,O),!t.label)return tt.rect(t,O);const R=t.x??0,H=t.y??0,Y=t.height??0;let P=[];return p?P=[{x:R-f.width/2,y:H-Y/2},{x:R+f.width/2,y:H-Y/2},{x:R+f.width/2,y:H-Y/2+f.height+x},{x:R+c/2,y:H-Y/2+f.height+x},{x:R+c/2,y:H+Y/2},{x:R-c/2,y:H+Y/2},{x:R-c/2,y:H-Y/2+f.height+x},{x:R-f.width/2,y:H-Y/2+f.height+x}]:P=[{x:R-c/2,y:H-Y/2},{x:R+c/2,y:H-Y/2},{x:R+c/2,y:H-Y/2+h},{x:R+f.width/2,y:H-Y/2+h},{x:R+f.width/2/2,y:H+Y/2},{x:R-f.width/2,y:H+Y/2},{x:R-f.width/2,y:H-Y/2+h},{x:R-c/2,y:H-Y/2+h}],tt.polygon(t,P,O)},d}g(Xm,"imageSquare");async function Gm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=s,a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=Math.max(l.width+(a??0)*2,t?.width??0),h=Math.max(l.height+(o??0)*2,t?.height??0),d=[{x:0,y:0},{x:c,y:0},{x:c+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),u&&f.attr("style",u)}else f=ar(n,c,h,d);return i&&f.attr("style",i),t.width=c,t.height=h,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(Gm,"inv_trapezoid");async function Vm(e,t){const{shapeSvg:r,bbox:i,label:s}=await lt(e,t,"label"),o=r.insert("rect",":first-child");return o.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),s.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),ot(t,o),t.intersect=function(l){return tt.rect(t,l)},r}g(Vm,"labelRect");async function Zm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=s,a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+o,h=(t?.width??l.width)+a,d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=ar(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(Zm,"lean_left");async function Km(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=s,a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+o,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=ar(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(Km,"lean_right");function Qm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.label="",t.labelStyle=r;const s=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=rt.svg(s),d=et(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=bt(c),u=h.path(f,d),p=s.insert(()=>u,":first-child");return p.attr("class","outer-path"),o&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",o),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),p.attr("transform",`translate(-${a/2},${-n})`),ot(t,p),t.intersect=function(m){return V.info("lightningBolt intersect",t,m),tt.polygon(t,c,m)},s}g(Qm,"lightningBolt");var q_=g((e,t,r,i,s,o,a)=>[`M${e},${t+o}`,`a${s},${o} 0,0,0 ${r},0`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+o+a}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),z_=g((e,t,r,i,s,o,a)=>[`M${e},${t+o}`,`M${e+r},${t+o}`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+o+a}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),j_=g((e,t,r,i,s,o)=>[`M${e-r/2},${-i/2}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Zc=10,Kc=10;async function Jm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?24:s;if(t.width||t.height){const x=t.width??0;t.width=(t.width??0)-o,t.width<Kc&&(t.width=Kc);const k=x/2/(2.5+x/50);t.height=(t.height??0)-a-k*3,t.height<Zc&&(t.height=Zc)}const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+o*2,d=h/2,f=d/(2.5+h/50),u=(t?.height?t?.height:l.height)+f+a*2,p=u*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=rt.svg(n),C=z_(0,0,h,u,d,f,p),k=j_(0,f,h,u,d,f),v=et(t,{}),S=x.path(C,v),_=x.path(k,v);n.insert(()=>_,":first-child").attr("class","line"),m=n.insert(()=>S,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=q_(0,0,h,u,d,f,p);m=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",Ut(y)).attr("style",i)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),ot(t,m),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),t.intersect=function(x){const C=tt.rect(t,x),k=C.x-(t.x??0);if(d!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-f)){let v=f*f*(1-k*k/(d*d));v>0&&(v=Math.sqrt(v)),v=f-v,x.y-(t.y??0)>0&&(v=-v),C.y+=v}return C},n}g(Jm,"linedCylinder");async function ty(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;if(t.width||t.height){const v=t.width;t.width=(v??0)*10/11-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+(o??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,f=t.look==="neo"?d/4:d/8,u=d+f,{cssStyles:p}=t,m=rt.svg(n),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...yr(-h/2-h/2*.1,u/2,h/2+h/2*.1,u/2,f,.8),{x:h/2+h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:-u/2},{x:-h/2,y:-u/2},{x:-h/2,y:u/2*1.1},{x:-h/2,y:-u/2}],C=m.polygon(x.map(v=>[v.x,v.y]),y),k=n.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(0,${-f/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-f/2-(l.y-(l.top??0))})`),ot(t,k),t.intersect=function(v){return tt.polygon(t,x,v)},n}g(ty,"linedWaveEdgedRect");async function ey(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:c.width)+o*2+2*n,f=(t?.height?t?.height:c.height)+a*2+2*n,u=d-2*n,p=f-2*n,m=-u/2,y=-p/2,{cssStyles:x}=t,C=rt.svg(l),k=et(t,{}),v=[{x:m-n,y:y+n},{x:m-n,y:y+p+n},{x:m+u-n,y:y+p+n},{x:m+u-n,y:y+p},{x:m+u,y:y+p},{x:m+u,y:y+p-n},{x:m+u+n,y:y+p-n},{x:m+u+n,y:y-n},{x:m+n,y:y-n},{x:m+n,y},{x:m,y},{x:m,y:y+n}],S=[{x:m,y:y+n},{x:m+u-n,y:y+n},{x:m+u-n,y:y+p},{x:m+u,y:y+p},{x:m+u,y},{x:m,y}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=bt(v);let B=C.path(_,k);const T=bt(S);let D=C.path(T,k);t.look!=="handDrawn"&&(B=Kn(B),D=Kn(D));const O=l.insert("g",":first-child");return O.insert(()=>B),O.insert(()=>D),O.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),ot(t,O),t.intersect=function(R){return tt.polygon(t,v,R)},l}g(ey,"multiRect");async function ry(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await lt(e,t,nt(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(o.width,t?.width??0)+l*2,f=Math.max(o.height,t?.height??0)+c*3,u=t.look==="neo"?f/4:f/8,p=f+(h?u/2:-u/2),m=-d/2,y=-p/2,x=10,{cssStyles:C}=t,k=yr(m-x,y+p+x,m+d-x,y+p+x,u,.8),v=k?.[k.length-1],S=[{x:m-x,y:y+x},{x:m-x,y:y+p+x},...k,{x:m+d-x,y:v.y-x},{x:m+d,y:v.y-x},{x:m+d,y:v.y-2*x},{x:m+d+x,y:v.y-2*x},{x:m+d+x,y:y-x},{x:m+x,y:y-x},{x:m+x,y},{x:m,y},{x:m,y:y+x}],_=[{x:m,y:y+x},{x:m+d-x,y:y+x},{x:m+d-x,y:v.y-x},{x:m+d,y:v.y-x},{x:m+d,y},{x:m,y}],B=rt.svg(s),T=et(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const D=bt(S),O=B.path(D,T),R=bt(_),H=B.path(R,T),Y=s.insert(()=>O,":first-child");return Y.insert(()=>H),Y.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&Y.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&Y.selectAll("path").attr("style",i),Y.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-(o.width/2)-x-(o.x-(o.left??0))}, ${-(o.height/2)+x-u/2-(o.y-(o.top??0))})`),ot(t,Y),t.intersect=function(P){return tt.polygon(t,S,P)},s}g(ry,"multiWaveEdgedRectangle");async function iy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:s}=st(t);t.labelStyle=i,t.useHtmlLabels||re(At())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,f=-h/2,{cssStyles:u}=t,p=rt.svg(a),m=et(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=p.rectangle(d,f,c,h,m),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),u&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",u),s&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",s),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,x),t.intersect=function(C){return tt.rect(t,C)},a}g(iy,"note");var W_=g((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function sy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await lt(e,t,nt(t)),a=o.width+(t.padding??0),n=o.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(s),p=et(t,{}),m=W_(0,0,l),y=u.path(m,p);d=s.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&d.attr("style",f)}else d=ar(s,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),ot(t,d),t.calcIntersect=function(u,p){const m=u.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],x=tt.polygon(u,y,p);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(u){return this.calcIntersect(t,u)},s}g(sy,"question");async function oy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?21:s??0,a=t.look==="neo"?12:s??0,{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width??l.width)+(t.look==="neo"?o*2:o),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),f=-h/2,u=-d/2,p=u/2,m=[{x:f+p,y:u},{x:f,y:0},{x:f+p,y:-u},{x:-f,y:-u},{x:-f,y:u}],{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=bt(m),v=x.path(k,C),S=n.insert(()=>v,":first-child");return S.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(${-p/2},0)`),c.attr("transform",`translate(${-p/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ot(t,S),t.intersect=function(_){return tt.polygon(t,m,_)},n}g(oy,"rect_left_inv_arrow");async function ay(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;let s;t.cssClasses?s="node "+t.cssClasses:s="node default";const o=e.insert("g").attr("class",s).attr("id",t.domId||t.id),a=o.insert("g"),n=o.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await hr(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(re(wt())){const T=h.children[0],D=pt(h);d=T.getBoundingClientRect(),D.attr("width",d.width),D.attr("height",d.height)}V.info("Text 2",l);const f=l||[],u=h.getBBox(),p=await hr(n,Array.isArray(f)?f.join("<br/>"):f,t.labelStyle,!0,!0),m=p.children[0],y=pt(p);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const x=(t.padding||0)/2;pt(p).attr("transform","translate( "+(d.width>u.width?0:(u.width-d.width)/2)+", "+(u.height+x+5)+")"),pt(h).attr("transform","translate( "+(d.width<u.width?0:-(u.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-x+3)+")");const C=d.width+(t.padding||0),k=d.height+(t.padding||0),v=-d.width/2-x,S=-d.height/2-x;let _,B;if(t.look==="handDrawn"){const T=rt.svg(o),D=et(t,{}),O=T.path(xr(v,S,C,k,t.rx||0),D),R=T.line(-d.width/2-x,-d.height/2-x+u.height+x,d.width/2+x,-d.height/2-x+u.height+x,D);B=o.insert(()=>(V.debug("Rough node insert CXC",O),R),":first-child"),_=o.insert(()=>(V.debug("Rough node insert CXC",O),O),":first-child")}else _=a.insert("rect",":first-child"),B=a.insert("line"),_.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),B.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+u.height+x).attr("y2",-d.height/2-x+u.height+x);return ot(t,_),t.intersect=function(T){return tt.rect(t,T)},o}g(ay,"rectWithTitle");async function ny(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,s={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Mi(e,t,s)}g(ny,"roundedRect");var br=8;async function ly(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width??n.width)+s*2+(t.look==="neo"?br:br*2),h=(t?.height??n.height)+o*2,d=c-br,f=h,u=br-c/2,p=-h/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:u,y:p},{x:u+d,y:p},{x:u+d,y:p+f},{x:u-br,y:p+f},{x:u-br,y:p},{x:u,y:p},{x:u,y:p+f}],k=y.polygon(C.map(S=>[S.x,S.y]),x),v=a.insert(()=>k,":first-child");return v.attr("class","basic label-container outer-path").attr("style",Ut(m)),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${br/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,v),t.intersect=function(S){return tt.rect(t,S)},a}g(ly,"shadedProcess");async function hy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+o*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,f=h,u=d/1.5,p=-f/2,m=-u/2,{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=[{x:p,y:m},{x:p,y:m+u},{x:p+f,y:m+u},{x:p+f,y:m-u/2}],v=bt(k),S=x.path(v,C),_=n.insert(()=>S,":first-child");return _.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(0, ${u/4})`),c.attr("transform",`translate(${-f/2+(t.padding??0)-(l.x-(l.left??0))}, ${-u/4+(t.padding??0)-(l.y-(l.top??0))})`),ot(t,_),t.intersect=function(B){return tt.polygon(t,k,B)},n}g(hy,"slopedRect");async function cy(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,s=t.look==="neo"?12:r,o={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:s};return Mi(e,t,o)}g(cy,"squareRect");async function dy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?20:s,a=t.look==="neo"?12:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?o*2:o),d=c/2,{cssStyles:f}=t,u=rt.svg(n),p=et(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=[{x:-h/2+d,y:-c/2},{x:h/2-d,y:-c/2},...ks(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...ks(h/2-d,0,d,50,270,450)],y=bt(m),x=u.path(y,p),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),ot(t,C),t.intersect=function(k){return tt.polygon(t,m,k)},n}g(dy,"stadium");async function uy(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return Mi(e,t,r)}g(uy,"state");function fy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:s}=st(t);t.labelStyle=i;const{cssStyles:o}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=rt.svg(h),f=et(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const u=d.circle(0,0,t.width,{...f,stroke:a,strokeWidth:2}),p=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),x=h.insert(()=>u,":first-child");if(x.insert(()=>y),t.look!=="handDrawn"&&x.attr("class","outer-path"),o&&x.selectAll("path").attr("style",o),s&&x.selectAll("path").attr("style",s),t.width<25&&c&&t.look!=="handDrawn"){const C=e.node()?.ownerSVGElement?.id??"",k=C?`${C}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${k})`)}return ot(t,x),t.intersect=function(C){return tt.circle(t,(t.width??0)/2,C)},h}g(fy,"stateEnd");function gy(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:s}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const o=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=rt.svg(o).circle(0,0,t.width,_v(i));a=o.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=o.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&s&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return ot(t,a),t.intersect=function(n){return tt.circle(t,(t.width??7)/2,n)},o}g(gy,"stateStart");var jr=8;async function py(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t?.padding??8,o=t.look==="neo"?28:s,a=t.look==="neo"?12:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width??l.width)+2*jr+o,h=(t?.height??l.height)+a,d=c-2*jr,f=h,u=-c/2,p=-h/2,m=[{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"){const y=rt.svg(n),x=et(t,{}),C=y.rectangle(u,p,d+16,f,x),k=y.line(u+jr,p,u+jr,p+f,x),v=y.line(u+jr+d,p,u+jr+d,p+f,x);n.insert(()=>k,":first-child"),n.insert(()=>v,":first-child");const S=n.insert(()=>C,":first-child"),{cssStyles:_}=t;S.attr("class","basic label-container").attr("style",Ut(_)),ot(t,S)}else{const y=ar(n,d,f,m);i&&y.attr("style",i),ot(t,y)}return t.intersect=function(y){return tt.polygon(t,m,y)},n}g(py,"subroutine");var Xa=.2;async function my(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-o*2-Xa*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height?t?.height:l.height)+a*2,h=Xa*c,d=Xa*c,u=(t?.width?t?.width:l.width)+o*2+h-h,p=c,m=-u/2,y=-p/2,{cssStyles:x}=t,C=rt.svg(n),k=et(t,{}),v=[{x:m-h/2,y},{x:m+u+h/2,y},{x:m+u+h/2,y:y+p},{x:m-h/2,y:y+p}],S=[{x:m+u-h/2,y:y+p},{x:m+u+h/2,y:y+p},{x:m+u+h/2,y:y+p-d}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=bt(v),B=C.path(_,k),T=bt(S),D=C.path(T,{...k,fillStyle:"solid"}),O=n.insert(()=>D,":first-child");return O.insert(()=>B,":first-child"),O.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",i),ot(t,O),t.intersect=function(R){return tt.polygon(t,v,R)},n}g(my,"taggedRect");async function yy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await lt(e,t,nt(t)),n=Math.max(o.width+(t.padding??0)*2,t?.width??0),l=Math.max(o.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,f=l+c,{cssStyles:u}=t,p=rt.svg(s),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:f/2},...yr(-n/2-n/2*.1,f/2,n/2+n/2*.1,f/2,c,.8),{x:n/2+n/2*.1,y:-f/2},{x:-n/2-n/2*.1,y:-f/2}],x=-n/2+n/2*.1,C=-f/2-d*.4,k=[{x:x+n-h,y:(C+l)*1.3},{x:x+n,y:C+l-d},{x:x+n,y:(C+l)*.9},...yr(x+n,(C+l)*1.25,x+n-h,(C+l)*1.3,-l*.02,.5)],v=bt(y),S=p.path(v,m),_=bt(k),B=p.path(_,{...m,fillStyle:"solid"}),T=s.insert(()=>B,":first-child");return T.insert(()=>S,":first-child"),T.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(o.x-(o.left??0))},${-l/2+(t.padding??0)-c/2-(o.y-(o.top??0))})`),ot(t,T),t.intersect=function(D){return tt.polygon(t,y,D)},s}g(yy,"taggedWaveEdgedRectangle");async function xy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await lt(e,t,nt(t)),a=Math.max(o.width+(t.padding??0),t?.width||0),n=Math.max(o.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=s.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),ot(t,h),t.intersect=function(d){return tt.rect(t,d)},s}g(xy,"text");var H_=g((e,t,r,i,s,o)=>`M${e},${t}
|
|
234
|
+
a${s},${o} 0,0,1 0,${-i}
|
|
235
|
+
l${r},0
|
|
236
|
+
a${s},${o} 0,0,1 0,${i}
|
|
237
|
+
M${r},${-i}
|
|
238
|
+
a${s},${o} 0,0,0 0,${i}
|
|
239
|
+
l${-r},0`,"createCylinderPathD"),Y_=g((e,t,r,i,s,o)=>[`M${e},${t}`,`M${e+r},${t}`,`a${s},${o} 0,0,0 0,${-i}`,`l${-r},0`,`a${s},${o} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),U_=g((e,t,r,i,s,o)=>[`M${e+r/2},${-i/2}`,`a${s},${o} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Qc=5,Jc=10;async function Cy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?12:s/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-o,t.height<Qc&&(t.height=Qc);const x=m/2/(2.5+m/50);t.width=(t.width??0)-o-x*3,t.width<Jc&&(t.width=Jc)}const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t.height?t.height:n.height)+o,h=c/2,d=h/(2.5+c/50),f=(t.width?t.width:n.width)+d+o,{cssStyles:u}=t;let p;if(t.look==="handDrawn"){const m=rt.svg(a),y=Y_(0,0,f,c,d,h),x=U_(0,0,f,c,d,h),C=m.path(y,et(t,{})),k=m.path(x,et(t,{fill:"none"}));p=a.insert(()=>k,":first-child"),p=a.insert(()=>C,":first-child"),p.attr("class","basic label-container"),u&&p.attr("style",u)}else{const m=H_(0,0,f,c,d,h);p=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Ut(u)).attr("style",i),p.attr("class","basic label-container outer-path"),u&&p.selectAll("path").attr("style",u),i&&p.selectAll("path").attr("style",i)}return p.attr("label-offset-x",d),p.attr("transform",`translate(${-f/2}, ${c/2} )`),l.attr("transform",`translate(${-(n.width/2)-d-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,p),t.intersect=function(m){const y=tt.rect(t,m),x=y.y-(t.y??0);if(h!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-d)){let C=d*d*(1-x*x/(h*h));C!=0&&(C=Math.sqrt(Math.abs(C))),C=d-C,m.x-(t.x??0)>0&&(C=-C),y.x+=C}return y},a}g(Cy,"tiltedCylinder");async function by(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=(t.look==="neo",s),a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+o,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=ar(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(by,"trapezoid");async function ky(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.height<l&&(t.height=l),t.width=(t.width??0)-o*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:h.width)+o*2,f=(t?.height?t?.height:h.height)+a*2,{cssStyles:u}=t,p=rt.svg(c),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-d/2*.8,y:-f/2},{x:d/2*.8,y:-f/2},{x:d/2,y:-f/2*.6},{x:d/2,y:f/2},{x:-d/2,y:f/2},{x:-d/2,y:-f/2*.6}],x=bt(y),C=p.path(x,m),k=c.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),ot(t,k),t.intersect=function(v){return tt.polygon(t,y,v)},c}g(ky,"trapezoidalPentagon");var td=10,ed=10;async function wy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?s*2:s;(t.width||t.height)&&(t.width=((t?.width??0)-o)/2,t.width<ed&&(t.width=ed),t.height=t?.height??0,t.height<td&&(t.height=td));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=Xe(wt().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+o,d=t?.height?t?.height:h+n.height,f=d,u=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-d}],{cssStyles:p}=t,m=rt.svg(a),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=bt(u),C=m.path(x,y),k=a.insert(()=>C,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return p&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),t.width=h,t.height=d,ot(t,k),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(v){return V.info("Triangle intersect",t,u,v),tt.polygon(t,u,v)},a}g(wy,"triangle");async function Sy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:c.width)+(o??0)*2,f=(t?.height?t?.height:c.height)+(a??0)*2,u=t.look==="neo"?f/4:f/8,p=f+(n?u:-u),{cssStyles:m}=t,x=14-d,C=x>0?x/2:0,k=rt.svg(l),v=et(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const S=[{x:-d/2-C,y:p/2},...yr(-d/2-C,p/2,d/2+C,p/2,u,.8),{x:d/2+C,y:-p/2},{x:-d/2-C,y:-p/2}],_=bt(S),B=k.path(_,v),T=l.insert(()=>B,":first-child");return T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(0,${-u/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-f/2+(t.padding??0)-u-(c.y-(c.top??0))})`),ot(t,T),t.intersect=function(D){return tt.polygon(t,S,D)},l}g(Sy,"waveEdgedRectangle");async function vy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?20:s;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);const v=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-v*(20/9)),t.width=t.width-o*2}const{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:l.width)+o*2,h=(t?.height?t?.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:u}=t,p=rt.svg(n),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...yr(-c/2,f/2,c/2,f/2,d,1),{x:c/2,y:-f/2},...yr(c/2,-f/2,-c/2,-f/2,d,-1)],x=bt(y),C=p.path(x,m),k=n.insert(()=>C,":first-child");return k.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),ot(t,k),t.intersect=function(v){return tt.polygon(t,y,v)},n}g(vy,"waveRectangle");var Rt=10;async function Ty(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-Rt,10),t.height=Math.max((t?.height??0)-o*2-Rt,10));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:n.width)+s*2+Rt,h=(t?.height?t?.height:n.height)+o*2+Rt,d=c-Rt,f=h-Rt,u=-d/2,p=-f/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{}),C=[{x:u-Rt,y:p-Rt},{x:u-Rt,y:p+f},{x:u+d,y:p+f},{x:u+d,y:p-Rt}],k=`M${u-Rt},${p-Rt} L${u+d},${p-Rt} L${u+d},${p+f} L${u-Rt},${p+f} L${u-Rt},${p-Rt}
|
|
240
|
+
M${u-Rt},${p} L${u+d},${p}
|
|
241
|
+
M${u},${p-Rt} L${u},${p+f}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const v=y.path(k,x),S=a.insert(()=>v,":first-child");return S.attr("transform",`translate(${Rt/2}, ${Rt/2})`),S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+Rt/2-(n.x-(n.left??0))}, ${-(n.height/2)+Rt/2-(n.y-(n.top??0))})`),ot(t,S),t.intersect=function(_){return tt.polygon(t,C,_)},a}g(Ty,"windowPane");var rd=new Set(["redux-color","redux-dark-color"]),X_=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Ch(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:s}=At(),{rowEven:o,rowOdd:a,nodeBorder:n,borderColorArray:l}=s;if(t.look==="handDrawn"){const{themeVariables:K}=At(),{background:Z}=K,J={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Z}`]};await Ch(e,J)}const c=At();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:f}=t,{labelStyles:u,nodeStyles:p}=st(t);if(r.attributes.length===0&&t.label){const K={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};He(t.label,c)+K.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const Z=await Mi(e,t,K);if(i!=null&&rd.has(i)){const J=r.colorIndex??0;Z.attr("data-color-id",`color-${J%l.length}`)}if(!Xe(c.htmlLabels)){const J=Z.select("text"),dt=J.node()?.getBBox();J.attr("transform",`translate(${-dt.width/2}, 0)`)}return Z}c.htmlLabels||(h*=1.25,d*=1.25);let m=nt(t);m||(m="node default");const y=e.insert("g").attr("class",m).attr("id",t.domId||t.id),x=await Yr(y,t.label??"",c,0,0,["name"],u);x.height+=d;let C=0;const k=[],v=[];let S=0,_=0,B=0,T=0,D=!0,O=!0;for(const K of r.attributes){const Z=await Yr(y,K.type,c,0,C,["attribute-type"],u);S=Math.max(S,Z.width+h);const J=await Yr(y,K.name,c,0,C,["attribute-name"],u);_=Math.max(_,J.width+h);const dt=await Yr(y,K.keys.join(),c,0,C,["attribute-keys"],u);B=Math.max(B,dt.width+h);const ut=await Yr(y,K.comment,c,0,C,["attribute-comment"],u);T=Math.max(T,ut.width+h);const yt=Math.max(Z.height,J.height,dt.height,ut.height)+d;v.push({yOffset:C,rowHeight:yt}),C+=yt}let R=4;B<=h&&(D=!1,B=0,R--),T<=h&&(O=!1,T=0,R--);const H=y.node().getBBox();if(x.width+h*2-(S+_+B+T)>0){const K=x.width+h*2-(S+_+B+T);S+=K/R,_+=K/R,B>0&&(B+=K/R),T>0&&(T+=K/R)}const Y=S+_+B+T,P=rt.svg(y),A=et(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let $=0;v.length>0&&($=v.reduce((K,Z)=>K+(Z?.rowHeight??0),0));const z=Math.max(H.width+h*2,t?.width||0,Y),I=Math.max(($??0)+x.height,t?.height||0),M=-z/2,N=-I/2;if(y.selectAll("g:not(:first-child)").each((K,Z,J)=>{const dt=pt(J[Z]),ut=dt.attr("transform");let yt=0,Et=0;if(ut){const Mt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ut);Mt&&(yt=parseFloat(Mt[1]),Et=parseFloat(Mt[2]),dt.attr("class").includes("attribute-name")?yt+=S:dt.attr("class").includes("attribute-keys")?yt+=S+_:dt.attr("class").includes("attribute-comment")&&(yt+=S+_+B))}dt.attr("transform",`translate(${M+h/2+yt}, ${Et+N+x.height+d/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(N+d/2)+")"),i!=null&&rd.has(i)){const K=r.colorIndex??0;y.attr("data-color-id",`color-${K%l.length}`)}const L=P.rectangle(M,N,z,I,A),X=y.insert(()=>L,":first-child").attr("class","outer-path").attr("style",f.join(""));k.push(0);for(const[K,Z]of v.entries()){const dt=(K+1)%2===0&&Z.yOffset!==0,ut=P.rectangle(M,x.height+N+Z?.yOffset,z,Z?.rowHeight,{...A,fill:dt?o:a,stroke:n});y.insert(()=>ut,"g.label").attr("style",f.join("")).attr("class",`row-rect-${dt?"even":"odd"}`)}const U=1e-4;let G=Ur(M,x.height+N,z+M,x.height+N,U),q=P.polygon(G.map(K=>[K.x,K.y]),A);if(y.insert(()=>q).attr("class","divider"),G=Ur(S+M,x.height+N,S+M,I+N,U),q=P.polygon(G.map(K=>[K.x,K.y]),A),y.insert(()=>q).attr("class","divider"),D){const K=S+_+M;G=Ur(K,x.height+N,K,I+N,U),q=P.polygon(G.map(Z=>[Z.x,Z.y]),A),y.insert(()=>q).attr("class","divider")}if(O){const K=S+_+B+M;G=Ur(K,x.height+N,K,I+N,U),q=P.polygon(G.map(Z=>[Z.x,Z.y]),A),y.insert(()=>q).attr("class","divider")}for(const K of k){const Z=x.height+N+K;G=Ur(M,Z,z+M,Z,U),q=P.polygon(G.map(J=>[J.x,J.y]),A),y.insert(()=>q).attr("class","divider")}if(ot(t,X),p&&t.look!=="handDrawn")if(i!=null&&X_.has(i))y.selectAll("path").attr("style",p);else{const Z=p.split(";")?.filter(J=>J.includes("stroke"))?.map(J=>`${J}`).join("; ");y.selectAll("path").attr("style",Z??""),y.selectAll(".row-rect-even path").attr("style",p)}return t.intersect=function(K){return tt.rect(t,K)},y}g(Ch,"erBox");async function Yr(e,t,r,i=0,s=0,o=[],a=""){const n=e.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${i}, ${s})`).attr("style",a);t!==ln(t)&&(t=ln(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=n.node().appendChild(await Oe(n,t,{width:He(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}let c=l.getBBox();if(Xe(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=pt(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}g(Yr,"addText");function Ur(e,t,r,i,s){return e===r?[{x:e-s/2,y:t},{x:e+s/2,y:t},{x:r+s/2,y:i},{x:r-s/2,y:i}]:[{x:e,y:t-s/2},{x:e,y:t+s/2},{x:r,y:i+s/2},{x:r,y:i-s/2}]}g(Ur,"lineToPolygon");async function _y(e,t,r,i,s=r.class.padding??12){const o=i?0:3,a=e.insert("g").attr("class",nt(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,f=0,u=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const C=t.annotations[0];await rs(n,{text:`«${C}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await rs(l,t,0,["font-weight: bolder"]);const p=l.node().getBBox();f=p.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const C of t.members){const k=await rs(c,C,m,[C.parseClassifier()]);m+=k+o}u=c.node().getBBox().height,u<=0&&(u=s/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const C of t.methods){const k=await rs(h,C,y,[C.parseClassifier()]);y+=k+o}let x=a.node().getBBox();if(n!==null){const C=n.node().getBBox();n.attr("transform",`translate(${-C.width/2})`)}return l.attr("transform",`translate(${-p.width/2}, ${d})`),x=a.node().getBBox(),c.attr("transform",`translate(0, ${d+f+s*2})`),x=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(u?u+s*4:s*2)})`),x=a.node().getBBox(),{shapeSvg:a,bbox:x}}g(_y,"textHelper");async function rs(e,t,r,i=[]){const s=e.insert("g").attr("class","label").attr("style",i.join("; ")),o=At();let a="useHtmlLabels"in t?t.useHtmlLabels:Xe(o.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),xi(n)&&(a=!0);const l=await Oe(s,_l(pr(n)),{width:He(n,o)+50,classes:"markdown-node-label",useHtmlLabels:a},o);let c,h=1;if(a){const d=l.children[0],f=pt(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const u=d.getElementsByTagName("img");if(u){const p=n.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...u].map(m=>new Promise(y=>{function x(){if(m.style.display="flex",m.style.flexDirection="column",p){const C=o.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,v=parseInt(C,10)*5+"px";m.style.minWidth=v,m.style.maxWidth=v}else m.style.width="100%";y(m)}g(x,"setupImage"),setTimeout(()=>{m.complete&&x()}),m.addEventListener("error",x),m.addEventListener("load",x)})))}c=d.getBoundingClientRect(),f.attr("width",c.width),f.attr("height",c.height)}else{i.includes("font-weight: bolder")&&pt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=n[0]+n.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=l.getBBox()}return s.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}g(rs,"addText");async function By(e,t){const r=wt(),{themeVariables:i}=r,{useGradient:s}=i,o=r.class.padding??12,a=o,n=t.useHtmlLabels??Xe(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await _y(e,t,r,n,a),{labelStyles:d,nodeStyles:f}=st(t);t.labelStyle=d,t.cssStyles=l.styles||"";const u=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const p=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=Math.max(t.width??0,h.width);let C=Math.max(t.height??0,h.height);const k=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?C+=a:l.members.length>0&&l.methods.length===0&&(C+=a*2);const v=-x/2,S=-C/2;let _=p?o*2:l.members.length===0&&l.methods.length===0?-o:0;k&&(_=o*2);const B=m.rectangle(v-o,S-o-(p?o:l.members.length===0&&l.methods.length===0?-o/2:0),x+2*o,C+2*o+_,y),T=c.insert(()=>B,":first-child");T.attr("class","basic label-container outer-path");const D=T.node().getBBox(),O=c.select(".annotation-group").node().getBBox().height-(p?o/2:0)||0,R=c.select(".label-group").node().getBBox().height-(p?o/2:0)||0,H=c.select(".members-group").node().getBBox().height-(p?o/2:0)||0,Y=(O+R+S+o-(S-o-(p?o:l.members.length===0&&l.methods.length===0?-o/2:0)))/2;if(c.selectAll(".text").each((P,A,$)=>{const z=pt($[A]),I=z.attr("transform");let M=0;if(I){const U=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);U&&(M=parseFloat(U[2]))}let N=M+S+o-(p?o:l.members.length===0&&l.methods.length===0?-o/2:0);if(z.attr("class").includes("methods-group")){const X=Math.max(H,a/2);k?N=Math.max(Y,O+R+X+S+a*2+o)+a*2:N=O+R+X+S+a*4+o}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?N=M-a:N=M),n||(N-=4);let L=v;(z.attr("class").includes("label-group")||z.attr("class").includes("annotation-group"))&&(L=-z.node()?.getBBox().width/2||0,c.selectAll("text").each(function(X,U,G){window.getComputedStyle(G[U]).textAnchor==="middle"&&(L=0)})),z.attr("transform",`translate(${L}, ${N})`)}),l.members.length>0||l.methods.length>0||p){const P=O+R+S+o,A=m.line(D.x,P,D.x+D.width,P+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!s?" neo-line":""}`).attr("style",u)}if(p||l.members.length>0||l.methods.length>0){const P=O+R+H+S+a*2+o,A=m.line(D.x,k?Math.max(Y,P):P,D.x+D.width,(k?Math.max(Y,P):P)+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!s?" neo-line":""}`).attr("style",u)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",u),T.select(":nth-child(2)").attr("style",u),c.selectAll(".divider").select("path").attr("style",u),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",u),!n){const P=RegExp(/color\s*:\s*([^;]*)/),A=P.exec(u);if(A){const $=A[0].replace("color","fill");c.selectAll("tspan").attr("style",$)}else if(d){const $=P.exec(d);if($){const z=$[0].replace("color","fill");c.selectAll("tspan").attr("style",z)}}}return ot(t,T),t.intersect=function(P){return tt.rect(t,P)},c}g(By,"classBox");async function Ly(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t,o=t,a=20,n=20,l="verifyMethod"in t,c=nt(t),{themeVariables:h}=wt(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,u=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let p;l?p=await Ne(u,`<<${s.type}>>`,0,t.labelStyle):p=await Ne(u,"<<Element>>",0,t.labelStyle);let m=p;const y=await Ne(u,s.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const D=await Ne(u,`${s.requirementId?`ID: ${s.requirementId}`:""}`,m,t.labelStyle);m+=D;const O=await Ne(u,`${s.text?`Text: ${s.text}`:""}`,m,t.labelStyle);m+=O;const R=await Ne(u,`${s.risk?`Risk: ${s.risk}`:""}`,m,t.labelStyle);m+=R,await Ne(u,`${s.verifyMethod?`Verification: ${s.verifyMethod}`:""}`,m,t.labelStyle)}else{const D=await Ne(u,`${o.type?`Type: ${o.type}`:""}`,m,t.labelStyle);m+=D,await Ne(u,`${o.docRef?`Doc Ref: ${o.docRef}`:""}`,m,t.labelStyle)}const x=(u.node()?.getBBox().width??200)+a,C=(u.node()?.getBBox().height??200)+a,k=-x/2,v=-C/2,S=rt.svg(u),_=et(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const B=S.rectangle(k,v,x,C,_),T=u.insert(()=>B,":first-child");if(T.attr("class","basic label-container outer-path").attr("style",i),d?.length){const D=t.colorIndex??0;u.attr("data-color-id",`color-${D%d.length}`)}if(u.selectAll(".label").each((D,O,R)=>{const H=pt(R[O]),Y=H.attr("transform");let P=0,A=0;if(Y){const M=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Y);M&&(P=parseFloat(M[1]),A=parseFloat(M[2]))}const $=A-C/2;let z=k+a/2;(O===0||O===1)&&(z=P),H.attr("transform",`translate(${z}, ${$+a})`)}),m>p+y+n){const D=v+p+y+n;let O;if(t.look==="neo"){const Y=[[k,D],[k+x,D],[k+x,D+.001],[k,D+.001]];O=S.polygon(Y,_)}else O=S.line(k,D,k+x,D,_);u.insert(()=>O).attr("class","divider")}return ot(t,T),t.intersect=function(D){return tt.rect(t,D)},i&&t.look!=="handDrawn"&&(f||d?.length)&&u.selectAll("path").attr("style",i),u}g(Ly,"requirementBox");async function Ne(e,t,r,i=""){if(t==="")return 0;const s=e.insert("g").attr("class","label").attr("style",i),o=wt(),a=o.htmlLabels??!0,n=await Oe(s,_l(pr(t)),{width:He(t,o)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},o);let l;if(a){const c=n.children[0],h=pt(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=n.getBBox(),l.height+=6}return s.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}g(Ne,"addText");var G_=g(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 Ey(e,t,{config:r}){const{labelStyles:i,nodeStyles:s}=st(t);t.labelStyle=i||"";const o=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=t.padding||10;let d="",f;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),f=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const u={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let p,m;f?{label:p,bbox:m}=await Ua(f,"ticket"in t&&t.ticket||"",u):{label:p,bbox:m}=await Ua(n,"ticket"in t&&t.ticket||"",u);const{label:y,bbox:x}=await Ua(n,"assigned"in t&&t.assigned||"",u);t.width=a;const C=10,k=t?.width||0,v=Math.max(m.height,x.height)/2,S=Math.max(l.height+C*2,t?.height||0)+v,_=-k/2,B=-S/2;c.attr("transform","translate("+(h-k/2)+", "+(-v-l.height/2)+")"),p.attr("transform","translate("+(h-k/2)+", "+(-v+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-x.width-2*o)+", "+(-v+l.height/2)+")");let T;const{rx:D,ry:O}=t,{cssStyles:R}=t;if(t.look==="handDrawn"){const H=rt.svg(n),Y=et(t,{}),P=D||O?H.path(xr(_,B,k,S,D||0),Y):H.rectangle(_,B,k,S,Y);T=n.insert(()=>P,":first-child"),T.attr("class","basic label-container").attr("style",R||null)}else{T=n.insert("rect",":first-child"),T.attr("class","basic label-container __APA__").attr("style",s).attr("rx",D??5).attr("ry",O??5).attr("x",_).attr("y",B).attr("width",k).attr("height",S);const H="priority"in t&&t.priority;if(H){const Y=n.append("line"),P=_+2,A=B+Math.floor((D??0)/2),$=B+S-Math.floor((D??0)/2);Y.attr("x1",P).attr("y1",A).attr("x2",P).attr("y2",$).attr("stroke-width","4").attr("stroke",G_(H))}}return ot(t,T),t.height=S,t.intersect=function(H){return tt.rect(t,H)},n}g(Ey,"kanbanItem");async function Fy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=o.width+10*a,c=o.height+8*a,h=.15*l,{cssStyles:d}=t,f=o.width+20,u=o.height+20,p=Math.max(l,f),m=Math.max(c,u);n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`);let y;const x=`M0 0
|
|
242
|
+
a${h},${h} 1 0,0 ${p*.25},${-1*m*.1}
|
|
243
|
+
a${h},${h} 1 0,0 ${p*.25},0
|
|
244
|
+
a${h},${h} 1 0,0 ${p*.25},0
|
|
245
|
+
a${h},${h} 1 0,0 ${p*.25},${m*.1}
|
|
246
|
+
|
|
247
|
+
a${h},${h} 1 0,0 ${p*.15},${m*.33}
|
|
248
|
+
a${h*.8},${h*.8} 1 0,0 0,${m*.34}
|
|
249
|
+
a${h},${h} 1 0,0 ${-1*p*.15},${m*.33}
|
|
250
|
+
|
|
251
|
+
a${h},${h} 1 0,0 ${-1*p*.25},${m*.15}
|
|
252
|
+
a${h},${h} 1 0,0 ${-1*p*.25},0
|
|
253
|
+
a${h},${h} 1 0,0 ${-1*p*.25},0
|
|
254
|
+
a${h},${h} 1 0,0 ${-1*p*.25},${-1*m*.15}
|
|
255
|
+
|
|
256
|
+
a${h},${h} 1 0,0 ${-1*p*.1},${-1*m*.33}
|
|
257
|
+
a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}
|
|
258
|
+
a${h},${h} 1 0,0 ${p*.1},${-1*m*.33}
|
|
259
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const C=rt.svg(s),k=et(t,{}),v=C.path(x,k);y=s.insert(()=>v,":first-child"),y.attr("class","basic label-container").attr("style",Ut(d))}else y=s.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-p/2}, ${-m/2})`),ot(t,y),t.calcIntersect=function(C,k){return tt.rect(C,k)},t.intersect=function(C){return V.info("Bang intersect",t,C),tt.rect(t,C)},s}g(Fy,"bang");async function Ay(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=o.width+2*a,c=o.height+2*a,h=.15*l,d=.25*l,f=.35*l,u=.2*l,{cssStyles:p}=t;let m;const y=`M0 0
|
|
260
|
+
a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
|
|
261
|
+
a${f},${f} 1 0,1 ${l*.4},${-1*l*.1}
|
|
262
|
+
a${d},${d} 1 0,1 ${l*.35},${l*.2}
|
|
263
|
+
|
|
264
|
+
a${h},${h} 1 0,1 ${l*.15},${c*.35}
|
|
265
|
+
a${u},${u} 1 0,1 ${-1*l*.15},${c*.65}
|
|
266
|
+
|
|
267
|
+
a${d},${h} 1 0,1 ${-1*l*.25},${l*.15}
|
|
268
|
+
a${f},${f} 1 0,1 ${-1*l*.5},0
|
|
269
|
+
a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
|
|
270
|
+
|
|
271
|
+
a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
|
|
272
|
+
a${u},${u} 1 0,1 ${l*.1},${-1*c*.65}
|
|
273
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const x=rt.svg(s),C=et(t,{}),k=x.path(y,C);m=s.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Ut(p))}else m=s.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),ot(t,m),t.calcIntersect=function(x,C){return tt.rect(x,C)},t.intersect=function(x){return V.info("Cloud intersect",t,x),tt.rect(t,x)},s}g(Ay,"cloud");async function My(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=o.width+8*a,c=o.height+2*a,h=5,d=t.look==="neo"?`
|
|
274
|
+
M${-l/2} ${c/2-h}
|
|
275
|
+
v${-c+2*h}
|
|
276
|
+
q0,-${h} ${h},-${h}
|
|
277
|
+
h${l-2*h}
|
|
278
|
+
q${h},0 ${h},${h}
|
|
279
|
+
v${c-h}
|
|
280
|
+
H${-l/2}
|
|
281
|
+
Z
|
|
282
|
+
`:`
|
|
283
|
+
M${-l/2} ${c/2-h}
|
|
284
|
+
v${-c+2*h}
|
|
285
|
+
q0,-${h} ${h},-${h}
|
|
286
|
+
h${l-2*h}
|
|
287
|
+
q${h},0 ${h},${h}
|
|
288
|
+
v${c-2*h}
|
|
289
|
+
q0,${h} ${-h},${h}
|
|
290
|
+
h${-(l-2*h)}
|
|
291
|
+
q${-h},0 ${-h},${-h}
|
|
292
|
+
Z
|
|
293
|
+
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=s.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return s.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),s.append(()=>n.node()),ot(t,f),t.calcIntersect=function(u,p){return tt.rect(u,p)},t.intersect=function(u){return tt.rect(t,u)},s}g(My,"defaultMindmapNode");async function $y(e,t){const r={padding:t.padding??0};return xh(e,t,r)}g($y,"mindmapCircle");var V_=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:cy},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:ny},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:dy},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:py},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:$m},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Om},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:xh},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Fy},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Ay},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:sy},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:zm},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Km},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Zm},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:by},{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:Gm},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Im},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:xy},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Tm},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:ly},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:gy},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:fy},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Nm},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:jm},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Em},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Fm},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Am},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Qm},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Sy},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:qm},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Cy},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Jm},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Mm},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Rm},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:wy},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Ty},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Pm},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:ky},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Dm},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:hy},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:ry},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:ey},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:vm},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Lm},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:yy},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:my},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:vy},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:oy},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:ty}],Z_=g(()=>{const t=[...Object.entries({state:uy,choice:_m,note:iy,rectWithTitle:ay,labelRect:Vm,iconSquare:Um,iconCircle:Hm,icon:Wm,iconRounded:Ym,imageSquare:Xm,anchor:wm,kanbanItem:Ey,mindmapCircle:$y,defaultMindmapNode:My,classBox:By,erBox:Ch,requirementBox:Ly}),...V_.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(s=>[s,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Oy=Z_();function Ry(e){return e in Oy}g(Ry,"isValidShape");var xa=new Map;async function bh(e,t,r){let i,s;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const o=t.shape?Oy[t.shape]:void 0;if(!o)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),s=await o(i,t,r)}else s=await o(e,t,r),i=s;return i.attr("data-look",Ut(t.look)),t.tooltip&&s.attr("title",t.tooltip),xa.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}g(bh,"insertNode");var K_=g((e,t)=>{xa.set(t.id,e)},"setNodeElem"),Q_=g(()=>{xa.clear()},"clear"),J_=g(e=>{const t=xa.get(e.id);V.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),Xr=g((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Qt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},id={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function is(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Ft(e),t=Ft(t);const[r,i]=[e.x,e.y],[s,o]=[t.x,t.y],a=s-r,n=o-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}g(is,"calculateDeltaAndAngle");var Ft=g(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),Iy=g(e=>({x:g(function(t,r,i){let s=0;const o=Ft(i[0]).x<Ft(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Qt,e.arrowTypeStart)){const{angle:u,deltaX:p}=is(i[0],i[1]);s=Qt[e.arrowTypeStart]*Math.cos(u)*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Qt,e.arrowTypeEnd)){const{angle:u,deltaX:p}=is(i[i.length-1],i[i.length-2]);s=Qt[e.arrowTypeEnd]*Math.cos(u)*(p>=0?1:-1)}const a=Math.abs(Ft(t).x-Ft(i[i.length-1]).x),n=Math.abs(Ft(t).y-Ft(i[i.length-1]).y),l=Math.abs(Ft(t).x-Ft(i[0]).x),c=Math.abs(Ft(t).y-Ft(i[0]).y),h=Qt[e.arrowTypeStart],d=Qt[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=o==="right"?-1:1,s-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=o==="right"?-1:1,s+=u}return Ft(t).x+s},"x"),y:g(function(t,r,i){let s=0;const o=Ft(i[0]).y<Ft(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Qt,e.arrowTypeStart)){const{angle:u,deltaY:p}=is(i[0],i[1]);s=Qt[e.arrowTypeStart]*Math.abs(Math.sin(u))*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Qt,e.arrowTypeEnd)){const{angle:u,deltaY:p}=is(i[i.length-1],i[i.length-2]);s=Qt[e.arrowTypeEnd]*Math.abs(Math.sin(u))*(p>=0?1:-1)}const a=Math.abs(Ft(t).y-Ft(i[i.length-1]).y),n=Math.abs(Ft(t).x-Ft(i[i.length-1]).x),l=Math.abs(Ft(t).y-Ft(i[0]).y),c=Math.abs(Ft(t).x-Ft(i[0]).x),h=Qt[e.arrowTypeStart],d=Qt[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=o==="up"?-1:1,s-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=o==="up"?-1:1,s+=u}return Ft(t).y+s},"y")}),"getLineFunctionsWithOffset"),tB=g((e,t,r,i,s,o=!1,a)=>{t.arrowTypeStart&&sd(e,"start",t.arrowTypeStart,r,i,s,o,a),t.arrowTypeEnd&&sd(e,"end",t.arrowTypeEnd,r,i,s,o,a)},"addEdgeMarkers"),eB={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},rB=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],sd=g((e,t,r,i,s,o,a=!1,n)=>{const l=eB[r],c=l&&rB.includes(l.type);if(!l){V.warn(`Unknown arrow type: ${r}`);return}const h=l.type,u=`${s}_${o}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const p=n.replace(/[^\dA-Za-z]/g,"_"),m=`${u}_${p}`;if(!document.getElementById(m)){const y=document.getElementById(u);if(y){const x=y.cloneNode(!0);x.id=m,x.querySelectorAll("path, circle, line").forEach(k=>{k.setAttribute("stroke",n),l.fill&&k.setAttribute("fill",n)}),y.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${u})`)},"addEdgeMarker"),iB=g(e=>typeof e=="string"?e:wt()?.flowchart?.curve,"resolveEdgeCurveType"),ws=new Map,Yt=new Map,sB=g(()=>{ws.clear(),Yt.clear()},"clear"),Xi=g(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),Py=g(async(e,t)=>{const r=wt();let i=re(r);const{labelStyles:s}=st(t);t.labelStyle=s;const o=e.insert("g").attr("class","edgeLabel"),a=o.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Oe(e,t.label,{style:Xi(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);a.node().appendChild(c),V.info("abc82",t,t.labelType);let h=c.getBBox(),d=h;if(i){const u=c.children[0],p=pt(c);h=u.getBoundingClientRect(),d=h,p.attr("width",h.width),p.attr("height",h.height)}else{const u=pt(c).select("text").node();u&&typeof u.getBBox=="function"&&(d=u.getBBox())}a.attr("transform",Xr(d,i)),ws.set(t.id,o),t.width=h.width,t.height=h.height;let f;if(t.startLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),p=u.insert("g").attr("class","inner"),m=await hr(p,t.startLabelLeft,Xi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=pt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",Xr(y,i)),Yt.get(t.id)||Yt.set(t.id,{}),Yt.get(t.id).startLeft=u,ss(f,t.startLabelLeft)}if(t.startLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),p=u.insert("g").attr("class","inner"),m=await hr(p,t.startLabelRight,Xi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=pt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",Xr(y,i)),Yt.get(t.id)||Yt.set(t.id,{}),Yt.get(t.id).startRight=u,ss(f,t.startLabelRight)}if(t.endLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),p=u.insert("g").attr("class","inner"),m=await hr(u,t.endLabelLeft,Xi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=pt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",Xr(y,i)),Yt.get(t.id)||Yt.set(t.id,{}),Yt.get(t.id).endLeft=u,ss(f,t.endLabelLeft)}if(t.endLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),p=u.insert("g").attr("class","inner"),m=await hr(u,t.endLabelRight,Xi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=pt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",Xr(y,i)),Yt.get(t.id)||Yt.set(t.id,{}),Yt.get(t.id).endRight=u,ss(f,t.endLabelRight)}return c},"insertEdgeLabel");function ss(e,t){re(wt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(ss,"setTerminalWidth");var Dy=g((e,t)=>{V.debug("Moving label abc88 ",e.id,e.label,ws.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=wt(),{subGraphTitleTotalMargin:s}=ua(i);if(e.label){const o=ws.get(e.id);let a=e.x,n=e.y;if(r){const l=we.calcLabelPosition(r);V.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}o.attr("transform",`translate(${a}, ${n+s/2})`)}if(e.startLabelLeft){const o=Yt.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const o=Yt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const o=Yt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const o=Yt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),oB=g((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,s=Math.abs(i.x-r.x),o=Math.abs(i.y-r.y);return s<.001||o<.001?t:o>=s?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),aB=g((e,t)=>{const r=e.x,i=e.y,s=Math.abs(t.x-r),o=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return s>=a||o>=n},"outsideNode"),nB=g((e,t,r)=>{V.debug(`intersection calc abc89:
|
|
294
|
+
outsidePoint: ${JSON.stringify(t)}
|
|
295
|
+
insidePoint : ${JSON.stringify(r)}
|
|
296
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,s=e.y,o=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-o:a+o;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(s-t.y)*a>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-s:s-l-t.y;n=h*d/c;const f={x:r.x<t.x?r.x+n:r.x-h+n,y:r.y<t.y?r.y+c-d:r.y-c+d};return n===0&&(f.x=t.x,f.y=t.y),h===0&&(f.x=t.x),c===0&&(f.y=t.y),V.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${n}`,f),f}else{r.x<t.x?n=t.x-a-i:n=i-a-t.x;let d=c*n/h,f=r.x<t.x?r.x+h-n:r.x-h+n,u=r.y<t.y?r.y+d:r.y-d;return V.debug(`sides calc abc89, Q ${c}, q ${d}, R ${h}, r ${n}`,{_x:f,_y:u}),n===0&&(f=t.x,u=t.y),h===0&&(f=t.x),c===0&&(u=t.y),{x:f,y:u}}},"intersection"),od=g((e,t)=>{V.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],s=!1;return e.forEach(o=>{if(V.info("abc88 checking point",o,t),!aB(t,o)&&!s){const a=nB(t,i,o);V.debug("abc88 inside",o,i,a),V.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?V.warn("abc88 no intersect",a,r):r.push(a),s=!0}else V.warn("abc88 outside",o,i),i=o,s||r.push(o)}),V.debug("returning points",r),r},"cutPathAtIntersect");function Ny(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const s=e[i-1],o=e[i],a=e[i+1];(s.x===o.x&&o.y===a.y&&Math.abs(o.x-a.x)>5&&Math.abs(o.y-s.y)>5||s.y===o.y&&o.x===a.x&&Math.abs(o.x-s.x)>5&&Math.abs(o.y-a.y)>5)&&(t.push(o),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}g(Ny,"extractCornerPoints");var ad=g(function(e,t,r){const i=t.x-e.x,s=t.y-e.y,o=Math.sqrt(i*i+s*s),a=r/o;return{x:t.x-a*i,y:t.y-a*s}},"findAdjacentPoint"),lB=g(function(e){const{cornerPointPositions:t}=Ny(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const s=e[i-1],o=e[i+1],a=e[i],n=ad(s,a,5),l=ad(o,a,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let f={x:a.x,y:a.y};if(Math.abs(o.x-s.x)>10&&Math.abs(o.y-s.y)>=10){V.debug("Corner point fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));const u=5;a.x===n.x?f={x:c<0?n.x-u+d:n.x+u-d,y:h<0?n.y-d:n.y+d}:f={x:c<0?n.x-d:n.x+d,y:h<0?n.y-u+d:n.y+u-d}}else V.debug("Corner point skipping fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));r.push(f,l)}else r.push(e[i]);return r},"fixCorners"),hB=g((e,t,r)=>{const i=e-t-r,s=2,o=2,a=s+o,n=Math.floor(i/a),l=Array(n).fill(`${s} ${o}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),qy=g(function(e,t,r,i,s,o,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=wt();let h=t.points,d=!1;const f=s;var u=o;const p=[];for(const I in t.cssCompiledStyles)Ul(I)||p.push(t.cssCompiledStyles[I]);if(c==="swimlane"){if(u.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),u.intersect(h[1])];else{const I=h.slice(1,-1),M=I[0],N=I[I.length-1],L=.5,X=Math.abs(h[h.length-1].x-N.x)<L&&Math.abs(h[h.length-1].y-N.y)<L,U=f.intersect(M),G=X?N:u.intersect(N),q=Math.abs(G.x-N.x)<L&&Math.abs(G.y-N.y)<L,Z=Math.abs(U.x-M.x)<L&&Math.abs(U.y-M.y)<L?[]:[U],J=q?[]:[G];h=[...Z,...I,...J]}h=oB(t,h)}else u.intersect&&f.intersect&&!n&&(h=h.slice(1,t.points.length-1),h.unshift(f.intersect(h[0])),h.push(u.intersect(h[h.length-1])));const m=btoa(JSON.stringify(h));t.toCluster&&(V.info("to cluster abc88",r.get(t.toCluster)),h=od(t.points,r.get(t.toCluster).node),d=!0),t.fromCluster&&(V.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(h,null,2)),h=od(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(I=>!Number.isNaN(I.y));const x=iB(t.curve);x!=="rounded"&&(y=lB(y));let C=ls;switch(x){case"linear":C=ls;break;case"basis":C=Bo;break;case"cardinal":C=Ju;break;case"bumpX":C=Gu;break;case"bumpY":C=Vu;break;case"catmullRom":C=ef;break;case"monotoneX":C=lf;break;case"monotoneY":C=hf;break;case"natural":C=df;break;case"step":C=uf;break;case"stepAfter":C=gf;break;case"stepBefore":C=ff;break;case"rounded":C=ls;break;default:C=Bo}const{x:k,y:v}=Iy(t),S=Uu().x(k).y(v).curve(C);let _;switch(t.thickness){case"normal":_="edge-thickness-normal";break;case"thick":_="edge-thickness-thick";break;case"invisible":_="edge-thickness-invisible";break;default:_="edge-thickness-normal"}switch(t.pattern){case"solid":_+=" edge-pattern-solid";break;case"dotted":_+=" edge-pattern-dotted";break;case"dashed":_+=" edge-pattern-dashed";break;default:_+=" edge-pattern-solid"}let B,T=x==="rounded"?zy(jy(y,t),5):S(y);const D=Array.isArray(t.style)?t.style:[t.style];let O=D.find(I=>I?.startsWith("stroke:")),R="";t.animate&&(R="edge-animation-fast"),t.animation&&(R="edge-animation-"+t.animation);let H=!1;if(t.look==="handDrawn"){const I=rt.svg(e);Object.assign([],y);const M=I.path(T,{roughness:.3,seed:l});_+=" transition",B=pt(M).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(R?" "+R:"")).attr("style",D?D.reduce((L,X)=>L+";"+X,""):"");let N=B.attr("d");B.attr("d",N),e.node().appendChild(B.node())}else{const I=p.join(";"),M=D?D.reduce((q,K)=>q+K+";",""):"",N=(I?I+";"+M+";":M)+";"+(D?D.reduce((q,K)=>q+";"+K,""):"");B=e.append("path").attr("d",T).attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(R?" "+R:"")).attr("style",N),O=N.match(/stroke:([^;]+)/)?.[1],H=t.animate===!0||!!t.animation||I.includes("animation");const L=B.node(),X=typeof L.getTotalLength=="function"?L.getTotalLength():0,U=id[t.arrowTypeStart]||0,G=id[t.arrowTypeEnd]||0;if(t.look==="neo"&&!H){const K=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?hB(X,U,G):`0 ${U} ${X-U-G} ${G}`}; stroke-dashoffset: 0;`;B.attr("style",K+B.attr("style"))}}B.attr("data-edge",!0),B.attr("data-et","edge"),B.attr("data-id",t.id),B.attr("data-points",m),B.attr("data-look",Ut(t.look)),t.showPoints&&y.forEach(I=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",I.x).attr("cy",I.y)});let Y="";(wt().flowchart.arrowMarkerAbsolute||wt().state.arrowMarkerAbsolute)&&(Y=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,Y=Y.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",t.arrowTypeStart),V.info("arrowTypeEnd",t.arrowTypeEnd);const P=!H&&t?.look==="neo";tB(B,t,Y,a,i,P,O);const A=Math.floor(h.length/2),$=h[A];we.isLabelCoordinateInPath($,B.attr("d"))||(d=!0);let z={};return d&&(z.updatedPath=h),z.originalPath=t.points,z},"insertEdge");function zy(e,t){if(e.length<2)return"";let r="";const i=e.length,s=1e-5;for(let o=0;o<i;o++){const a=e[o],n=e[o-1],l=e[o+1];if(o===0)r+=`M${a.x},${a.y}`;else if(o===i-1)r+=`L${a.x},${a.y}`;else{const c=a.x-n.x,h=a.y-n.y,d=l.x-a.x,f=l.y-a.y,u=Math.hypot(c,h),p=Math.hypot(d,f);if(u<s||p<s){r+=`L${a.x},${a.y}`;continue}const m=c/u,y=h/u,x=d/p,C=f/p,k=m*x+y*C,v=Math.max(-1,Math.min(1,k)),S=Math.acos(v);if(S<s||Math.abs(Math.PI-S)<s){r+=`L${a.x},${a.y}`;continue}const _=Math.min(t/Math.sin(S/2),u/2,p/2),B=a.x-m*_,T=a.y-y*_,D=a.x+x*_,O=a.y+C*_;r+=`L${B},${T}`,r+=`Q${a.x},${a.y} ${D},${O}`}}return r}g(zy,"generateRoundedPath");function tl(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}g(tl,"calculateDeltaAndAngle");function jy(e,t){const r=e.map(s=>({...s}));if(e.length>=2&&Qt[t.arrowTypeStart]){const s=Qt[t.arrowTypeStart],o=e[0],a=e[1],{angle:n}=tl(o,a),l=s*Math.cos(n),c=s*Math.sin(n);r[0].x=o.x+l,r[0].y=o.y+c}const i=e.length;if(i>=2&&Qt[t.arrowTypeEnd]){const s=Qt[t.arrowTypeEnd],o=e[i-1],a=e[i-2],{angle:n}=tl(a,o),l=s*Math.cos(n),c=s*Math.sin(n);r[i-1].x=o.x-l,r[i-1].y=o.y-c}return r}g(jy,"applyMarkerOffsetsToPoints");var cB=g((e,t,r,i)=>{t.forEach(s=>{$B[s](e,r,i)})},"insertMarkers"),dB=g((e,t,r)=>{V.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),uB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),fB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),gB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),pB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),mB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),yB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),xB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),CB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),bB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{transitionColor:o}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${o}`)},"barbNeo"),kB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),wB=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const s=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),s.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),SB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),vB=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const s=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),s.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),TB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${o}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${o}`)},"only_one_neo"),_B=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o,mainBkg:a}=s,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${o}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${o}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${o}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${o}`)},"zero_or_one_neo"),BB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${o}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${o}`)},"one_or_more_neo"),LB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o,mainBkg:a}=s,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${o}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${o}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${o}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${o}`)},"zero_or_more_neo"),EB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
|
|
297
|
+
L20,10
|
|
298
|
+
M20,10
|
|
299
|
+
L0,20`)},"requirement_arrow"),FB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
|
|
300
|
+
L20,10
|
|
301
|
+
M20,10
|
|
302
|
+
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),AB=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),MB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o}=s,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),$B={extension:dB,composition:uB,aggregation:fB,dependency:gB,lollipop:pB,point:mB,circle:yB,cross:xB,barb:CB,barbNeo:bB,only_one:kB,zero_or_one:wB,one_or_more:SB,zero_or_more:vB,only_one_neo:TB,zero_or_one_neo:_B,one_or_more_neo:BB,zero_or_more_neo:LB,requirement_arrow:EB,requirement_contains:AB,requirement_arrow_neo:FB,requirement_contains_neo:MB},Wy=cB,OB={common:Li,getConfig:At,insertCluster:pm,insertEdge:qy,insertEdgeLabel:Py,insertMarkers:Wy,insertNode:bh,interpolateToCurve:Jl,labelHelper:lt,log:V,positionEdgeLabel:Dy},Ss={},Hy=g(e=>{for(const t of e)Ss[t.name]=t},"registerLayoutLoaders"),RB=g(()=>{Hy([{name:"dagre",loader:g(async()=>await Promise.resolve().then(()=>require("./dagre-VKFMJZFB-CIQyEWnl.cjs")),"loader")},{name:"swimlane",loader:g(async()=>await Promise.resolve().then(()=>require("./swimlanes-5IMT3BWC-DGpEXqaM.cjs")),"loader")},{name:"cose-bilkent",loader:g(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-JH36ORCC-Flvn8Q3R.cjs")),"loader")}])},"registerDefaultLayoutLoaders");RB();var IB=g(async(e,t,r)=>{if(!(e.layoutAlgorithm in Ss))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const f=d.domId||d.id;d.domId=`${e.diagramId}-${f}`}const i=Ss[e.layoutAlgorithm],s=await i.loader(),{theme:o,themeVariables:a}=e.config,{useGradient:n,gradientStart:l,gradientStop:c}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`),n){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return s.render(e,t,OB,{algorithm:i.algorithm},r)},"render"),PB=g((e="",{fallback:t="dagre"}={})=>{if(e in Ss)return e;if(t in Ss)return V.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),kh="comm",Yy="rule",Uy="decl",DB="@media",NB="@import",qB="@supports",zB="@namespace",el="@keyframes",Xy="@layer",jB="@scope",WB=Math.abs,ds=String.fromCharCode;function Gy(e){return e.trim()}function rl(e,t,r){return e.replace(t,r)}function ei(e,t){return e.charCodeAt(t)|0}function vi(e,t,r){return e.slice(t,r)}function qe(e){return e.length}function Vy(e){return e.length}function Ks(e,t){return t.push(e),e}var Ca=1,Ti=1,Zy=0,ve=0,Nt=0,$i="";function wh(e,t,r,i,s,o,a,n){return{value:e,root:t,parent:r,type:i,props:s,children:o,line:Ca,column:Ti,length:a,return:"",siblings:n}}function HB(){return Nt}function YB(){return Nt=ve>0?ei($i,--ve):0,Ti--,Nt===10&&(Ti=1,Ca--),Nt}function Ae(){return Nt=ve<Zy?ei($i,ve++):0,Ti++,Nt===10&&(Ti=1,Ca++),Nt}function cr(){return ei($i,ve)}function ho(){return ve}function ba(e,t){return vi($i,e,t)}function vs(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function UB(e){return Ca=Ti=1,Zy=qe($i=e),ve=0,[]}function XB(e){return $i="",e}function Ga(e){return Gy(ba(ve-1,il(e===91?e+2:e===40?e+1:e)))}function GB(e){for(;(Nt=cr())&&Nt<33;)Ae();return vs(e)>2||vs(Nt)>3?"":" "}function VB(e,t){for(;--t&&Ae()&&!(Nt<48||Nt>102||Nt>57&&Nt<65||Nt>70&&Nt<97););return ba(e,ho()+(t<6&&cr()==32&&Ae()==32))}function il(e){for(;Ae();)switch(Nt){case e:return ve;case 34:case 39:e!==34&&e!==39&&il(Nt);break;case 40:e===41&&il(e);break;case 92:Ae();break}return ve}function ZB(e,t){for(;Ae()&&e+Nt!==57;)if(e+Nt===84&&cr()===47)break;return"/*"+ba(t,ve-1)+"*"+ds(e===47?e:Ae())}function KB(e){for(;!vs(cr());)Ae();return ba(e,ve)}function QB(e){return XB(co("",null,null,null,[""],e=UB(e),0,[0],e))}function co(e,t,r,i,s,o,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,p=0,m=1,y=1,x=1,C=0,k=0,v="",S=s,_=o,B=i,T=v;y;)switch(p=k,k=Ae()){case 40:p!=108&&ei(T,d-1)==58?(C++,T+="("):T+=Ga(k);break;case 41:C--,T+=")";break;case 34:case 39:case 91:T+=Ga(k);break;case 9:case 10:case 13:case 32:if(C>0){T+=ds(k);break}T+=GB(p);break;case 92:T+=VB(ho()-1,7);continue;case 47:switch(cr()){case 42:case 47:Ks(JB(ZB(Ae(),ho()),t,r,l),l),(vs(p||1)==5||vs(cr()||1)==5)&&qe(T)&&vi(T,-1,void 0)!==" "&&(T+=" ");break;default:T+="/"}break;case 123*m:n[c++]=qe(T)*x;case 125*m:case 59:case 0:if(C>0&&k){T+=ds(k);break}switch(k){case 0:case 125:y=0;case 59+h:x==-1&&(T=rl(T,/\f/g,"")),u>0&&(qe(T)-d||m===0)&&Ks(u>32?ld(T+";",i,r,d-1,l):ld(rl(T," ","")+";",i,r,d-2,l),l);break;case 59:T+=";";default:if(Ks(B=nd(T,t,r,c,h,s,n,v,S=[],_=[],d,o),o),k===123)if(h===0)co(T,t,B,B,S,o,d,n,_);else{switch(f){case 99:if(ei(T,3)===110)break;case 108:if(ei(T,2)===97)break;default:h=0;case 100:case 109:case 115:}h?co(e,B,B,i&&Ks(nd(e,B,B,0,0,s,n,v,s,S=[],d,_),_),s,_,d,n,i?S:_):co(T,B,B,B,[""],_,0,n,_)}}c=h=u=0,m=x=1,v=T="",d=a;break;case 58:d=1+qe(T),u=p;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&YB()==125)continue}switch(T+=ds(k),k*m){case 38:x=h>0?1:(T+="\f",-1);break;case 44:if(C>0)break;n[c++]=(qe(T)-1)*x,x=1;break;case 64:cr()===45&&(T+=Ga(Ae())),f=cr(),h=d=qe(v=T+=KB(ho())),k++;break;case 45:p===45&&qe(T)==2&&(m=0)}}return o}function nd(e,t,r,i,s,o,a,n,l,c,h,d){for(var f=s-1,u=s===0?o:[""],p=Vy(u),m=0,y=0,x=0;m<i;++m)for(var C=0,k=vi(e,f+1,f=WB(y=a[m])),v=e;C<p;++C)(v=Gy(y>0?u[C]+" "+k:rl(k,/&\f/g,u[C])))&&(l[x++]=v);return wh(e,t,r,s===0?Yy:n,l,c,h,d)}function JB(e,t,r,i){return wh(e,t,r,kh,ds(HB()),vi(e,2,-2),0,i)}function ld(e,t,r,i,s){return wh(e,t,r,Uy,vi(e,0,i),vi(e,i+1,-1),i,s)}function sl(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function tL(e,t,r,i){switch(e.type){case Xy:if(e.children.length)break;case NB:case zB:case Uy:return e.return=e.return||e.value;case kh:return"";case el:return e.return=e.value+"{"+sl(e.children,i)+"}";case Yy:if(!qe(e.value=e.props.join(",")))return""}return qe(r=sl(e.children,i))?e.return=e.value+"{"+r+"}":""}function eL(e){var t=Vy(e);return function(r,i,s,o){for(var a="",n=0;n<t;n++)a+=e[n](r,i,s,o)||"";return a}}var Ky="c4",rL=g(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),iL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./c4Diagram-LMCZKHZV-ByUwS5Pa.cjs"));return{id:Ky,diagram:e}},"loader"),sL={id:Ky,detector:rL,loader:iL},oL=sL,Qy="flowchart",aL=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),nL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-Cr8_S21X.cjs"));return{id:Qy,diagram:e}},"loader"),lL={id:Qy,detector:aL,loader:nL},hL=lL,Jy="flowchart-v2",cL=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),dL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-Cr8_S21X.cjs"));return{id:Jy,diagram:e}},"loader"),uL={id:Jy,detector:cL,loader:dL},fL=uL,t0="swimlane",gL=g(e=>/^\s*swimlane-beta\b/.test(e),"detector"),pL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./swimlanesDiagram-G3AALYLV-DqChJVS9.cjs"));return{id:t0,diagram:e}},"loader"),mL={id:t0,detector:gL,loader:pL},yL=mL,e0="er",xL=g(e=>/^\s*erDiagram/.test(e),"detector"),CL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./erDiagram-Q63AITRT-BT1bGFxN.cjs"));return{id:e0,diagram:e}},"loader"),bL={id:e0,detector:xL,loader:CL},kL=bL,r0="gitGraph",wL=g(e=>/^\s*gitGraph/.test(e),"detector"),SL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./gitGraphDiagram-IHSO6WYX-CtRl8SF8.cjs"));return{id:r0,diagram:e}},"loader"),vL={id:r0,detector:wL,loader:SL},TL=vL,i0="gantt",_L=g(e=>/^\s*gantt/.test(e),"detector"),BL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ganttDiagram-NO4QXBWP-BXUukgtA.cjs"));return{id:i0,diagram:e}},"loader"),LL={id:i0,detector:_L,loader:BL},EL=LL,s0="info",FL=g(e=>/^\s*info/.test(e),"detector"),AL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./infoDiagram-FWYZ7A6U-DjbpQufv.cjs"));return{id:s0,diagram:e}},"loader"),ML={id:s0,detector:FL,loader:AL},o0="pie",$L=g(e=>/^\s*pie/.test(e),"detector"),OL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pieDiagram-ENE6RG2P-DWsTb8I9.cjs"));return{id:o0,diagram:e}},"loader"),RL={id:o0,detector:$L,loader:OL},a0="quadrantChart",IL=g(e=>/^\s*quadrantChart/.test(e),"detector"),PL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./quadrantDiagram-ABIIQ3AL-BnIKvRMS.cjs"));return{id:a0,diagram:e}},"loader"),DL={id:a0,detector:IL,loader:PL},NL=DL,n0="xychart",qL=g(e=>/^\s*xychart(-beta)?/.test(e),"detector"),zL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./xychartDiagram-FW5EYKEG-C4GuhADi.cjs"));return{id:n0,diagram:e}},"loader"),jL={id:n0,detector:qL,loader:zL},WL=jL,l0="requirement",HL=g(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),YL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./requirementDiagram-TGXJPOKE-CjPsjAsx.cjs"));return{id:l0,diagram:e}},"loader"),UL={id:l0,detector:HL,loader:YL},XL=UL,h0="sequence",GL=g(e=>/^\s*sequenceDiagram/.test(e),"detector"),VL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sequenceDiagram-DBY2YBRQ-Cr1VcoK2.cjs"));return{id:h0,diagram:e}},"loader"),ZL={id:h0,detector:GL,loader:VL},KL=ZL,c0="class",QL=g((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),JL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-OUVF2IWQ-D1vfgcCB.cjs"));return{id:c0,diagram:e}},"loader"),tE={id:c0,detector:QL,loader:JL},eE=tE,d0="classDiagram",rE=g((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),iE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-v2-EOCWNBFH-D1vfgcCB.cjs"));return{id:d0,diagram:e}},"loader"),sE={id:d0,detector:rE,loader:iE},oE=sE,u0="state",aE=g((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),nE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-2N3HPSRC-BeP4b2HS.cjs"));return{id:u0,diagram:e}},"loader"),lE={id:u0,detector:aE,loader:nE},hE=lE,f0="stateDiagram",cE=g((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),dE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-v2-6OUMAXLB-L_ypLgkx.cjs"));return{id:f0,diagram:e}},"loader"),uE={id:f0,detector:cE,loader:dE},fE=uE,g0="journey",gE=g(e=>/^\s*journey/.test(e),"detector"),pE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./journeyDiagram-5HDEW3XC-BAzrW3sk.cjs"));return{id:g0,diagram:e}},"loader"),mE={id:g0,detector:gE,loader:pE},yE=mE,xE=g((e,t,r)=>{V.debug(`rendering svg for syntax error
|
|
303
|
+
`);const i=pf(t),s=i.append("g");i.attr("viewBox","0 0 2412 512"),bl(i,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),p0={draw:xE},CE=p0,bE={db:{},renderer:p0,parser:{parse:g(()=>{},"parse")}},kE=bE,m0="flowchart-elk",wE=g((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),SE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-Cr8_S21X.cjs"));return{id:m0,diagram:e}},"loader"),vE={id:m0,detector:wE,loader:SE},TE=vE,y0="timeline",_E=g(e=>/^\s*timeline/.test(e),"detector"),BE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./timeline-definition-FHXFAJF6-O0HVNX0c.cjs"));return{id:y0,diagram:e}},"loader"),LE={id:y0,detector:_E,loader:BE},EE=LE,x0="mindmap",FE=g(e=>/^\s*mindmap/.test(e),"detector"),AE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./mindmap-definition-LN4V7U3C-CPgbGhe0.cjs"));return{id:x0,diagram:e}},"loader"),ME={id:x0,detector:FE,loader:AE},$E=ME,C0="kanban",OE=g(e=>/^\s*kanban/.test(e),"detector"),RE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./kanban-definition-HUTT4EX6-vEBxhqy3.cjs"));return{id:C0,diagram:e}},"loader"),IE={id:C0,detector:OE,loader:RE},PE=IE,b0="sankey",DE=g(e=>/^\s*sankey(-beta)?/.test(e),"detector"),NE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sankeyDiagram-HTMAVEWB-CQhx84em.cjs"));return{id:b0,diagram:e}},"loader"),qE={id:b0,detector:DE,loader:NE},zE=qE,k0="packet",jE=g(e=>/^\s*packet(-beta)?/.test(e),"detector"),WE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-NH7WQ7WH-4RGgOu7p.cjs"));return{id:k0,diagram:e}},"loader"),HE={id:k0,detector:jE,loader:WE},w0="radar",YE=g(e=>/^\s*radar-beta/.test(e),"detector"),UE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-WEI45ONY-DZKSviH2.cjs"));return{id:w0,diagram:e}},"loader"),XE={id:w0,detector:YE,loader:UE},S0="block",GE=g(e=>/^\s*block(-beta)?/.test(e),"detector"),VE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./blockDiagram-677ZJIJ3-D1wkf-um.cjs"));return{id:S0,diagram:e}},"loader"),ZE={id:S0,detector:GE,loader:VE},KE=ZE,v0="treeView",QE=g(e=>/^\s*treeView-beta/.test(e),"detector"),JE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-OA4YK3LP-BBtbKikh.cjs"));return{id:v0,diagram:e}},"loader"),tF={id:v0,detector:QE,loader:JE},eF=tF,T0="architecture",rF=g(e=>/^\s*architecture/.test(e),"detector"),iF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./architectureDiagram-ZJ3FMSHR-BPesVaHB.cjs"));return{id:T0,diagram:e}},"loader"),sF={id:T0,detector:rF,loader:iF},oF=sF,_0="eventmodeling",aF=g(e=>/^\s*eventmodeling/.test(e),"detector"),nF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-FQU43EPY-C-3vCuEY.cjs"));return{id:_0,diagram:e}},"loader"),lF={id:_0,detector:aF,loader:nF},hF=lF,B0="ishikawa",cF=g(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),dF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ishikawaDiagram-FXEZZL3T-D0k3NpJW.cjs"));return{id:B0,diagram:e}},"loader"),uF={id:B0,detector:cF,loader:dF},L0="venn",fF=g(e=>/^\s*venn-beta/.test(e),"detector"),gF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./vennDiagram-L72KCM5P-BqOqbGRA.cjs"));return{id:L0,diagram:e}},"loader"),pF={id:L0,detector:fF,loader:gF},mF=pF,E0="treemap",yF=g(e=>/^\s*treemap/.test(e),"detector"),xF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-G47NLZAW-BnVPH5jd.cjs"));return{id:E0,diagram:e}},"loader"),CF={id:E0,detector:yF,loader:xF},F0="wardley",bF=g(e=>/^\s*wardley-beta/i.test(e),"detector"),kF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./wardleyDiagram-EHGQE667-B2Civob5.cjs"));return{id:F0,diagram:e}},"loader"),wF={id:F0,detector:bF,loader:kF},SF=wF,A0="cynefin",vF=g(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),TF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./cynefinDiagram-TSTJHNR4-BxqOgmm9.cjs"));return{id:A0,diagram:e}},"loader"),_F={id:A0,detector:vF,loader:TF},M0="railroad",BF=g(e=>/^\s*railroad-beta/i.test(e),"detector"),LF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./railroadDiagram-RFXS5EU6-D7cUshy0.cjs"));return{id:M0,diagram:e}},"loader"),EF={id:M0,detector:BF,loader:LF},$0="railroadEbnf",FF=g(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),AF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ebnfDiagram-CCIWWBDH-DpiouxMS.cjs"));return{id:$0,diagram:e}},"loader"),MF={id:$0,detector:FF,loader:AF},O0="railroadAbnf",$F=g(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),OF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./abnfDiagram-VRR7QNED-BlcBSkWc.cjs"));return{id:O0,diagram:e}},"loader"),RF={id:O0,detector:$F,loader:OF},R0="railroadPeg",IF=g(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),PF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pegDiagram-2B236MQR-DFSWh2UC.cjs"));return{id:R0,diagram:e}},"loader"),DF={id:R0,detector:IF,loader:PF},hd=!1,ka=g(()=>{hd||(hd=!0,Co("error",kE,e=>e.toLowerCase().trim()==="error"),Co("---",{db:{clear:g(()=>{},"clear")},styles:{},renderer:{draw:g(()=>{},"draw")},parser:{parse:g(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:g(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),nn(TE,$E,oF),nn(oL,PE,oE,eE,kL,EL,ML,RL,XL,KL,yL,fL,hL,EE,TL,fE,hE,yE,NL,zE,HE,WL,KE,hF,eF,XE,uF,CF,EF,MF,RF,DF,mF,SF,_F))},"addDiagrams"),NF=g(async()=>{V.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Or).map(async([r,{detector:i,loader:s}])=>{if(s)try{un(r)}catch{try{const{diagram:o,id:a}=await s();Co(a,o,i)}catch(o){throw V.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Or[r],o}}}))).filter(r=>r.status==="rejected");if(t.length>0){V.error(`Failed to load ${t.length} external diagrams`);for(const r of t)V.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),qF="graphics-document document";function I0(e,t){e.attr("role",qF),t!==""&&e.attr("aria-roledescription",t)}g(I0,"setA11yDiagramInfo");function P0(e,t,r,i){if(e.insert!==void 0){if(r){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(r)}if(t){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}g(P0,"addSVGa11yTitleDescription");var Ar,ol=(Ar=class{constructor(t,r,i,s,o){this.type=t,this.text=r,this.db=i,this.parser=s,this.renderer=o}static async fromText(t,r={}){const i=At(),s=xl(t,i);t=eT(t)+`
|
|
304
|
+
`;try{un(s)}catch{const c=mk(s);if(!c)throw new eu(`Diagram ${s} not found.`);const{id:h,diagram:d}=await c();Co(h,d)}const{db:o,parser:a,renderer:n,init:l}=un(s);return a.parser&&(a.parser.yy=o),o.clear?.(),l?.(i),r.title&&o.setDiagramTitle?.(r.title),await a.parse(t),new Ar(s,t,o,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},g(Ar,"Diagram"),Ar),cd=[],zF=g(()=>{cd.forEach(e=>{e()}),cd=[]},"attachFunctions"),jF=g(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function D0(e){const t=e.match(tu);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
|
|
305
|
+
`).map(a=>a.startsWith(r)?a.slice(r.length):a).join(`
|
|
306
|
+
`):t[2];let s=Qg(i,{schema:Kg})??{};s=typeof s=="object"&&!Array.isArray(s)?s:{};const o={};return s.displayMode&&(o.displayMode=s.displayMode.toString()),s.title&&(o.title=s.title.toString()),s.config&&(o.config=s.config),{text:e.slice(t[0].length),metadata:o}}g(D0,"extractFrontMatter");var WF=g(e=>e.replace(/\r\n?/g,`
|
|
307
|
+
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),HF=g(e=>{const{text:t,metadata:r}=D0(e),{displayMode:i,title:s,config:o={}}=r;return i&&(o.gantt||(o.gantt={}),o.gantt.displayMode=i),{title:s,config:o,text:t}},"processFrontmatter"),YF=g(e=>{const t=we.detectInit(e)??{},r=we.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:Yv(e),directive:t}},"processDirectives");function Sh(e){const t=WF(e),r=HF(t),i=YF(r.text),s=da(r.config,i.directive);return e=jF(i.text),{code:e,title:r.title,config:s}}g(Sh,"preprocessDiagram");function N0(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}g(N0,"toBase64");var UF=5e4,XF="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",GF="sandbox",VF="loose",ZF="http://www.w3.org/2000/svg",KF="http://www.w3.org/1999/xlink",QF="http://www.w3.org/1999/xhtml",JF="100%",tA="100%",eA="border:0;margin:0;",rA="margin:0",iA="allow-top-navigation-by-user-activation allow-popups",sA='The "iframe" tag is not supported by your browser.',oA=["foreignobject"],aA=["dominant-baseline"];function vh(e){const t=Sh(e);return yo(),uk(t.config??{}),t}g(vh,"processAndSetConfigs");async function q0(e,t){ka();try{const{code:r,config:i}=vh(e);return{diagramType:(await j0(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}g(q0,"parse");var dd=g((e,t,r=[])=>{const i=Gd(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),nA=g((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=re(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{vc(l.styles)||n.forEach(c=>{r.insertRule(dd(l.id,c,l.styles),r.cssRules.length)}),vc(l.textStyles)||r.insertRule(dd(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const s=new CSSStyleSheet;s.replaceSync(e.themeCSS),i=dn(s)+`
|
|
308
|
+
`}else i+=`${e.themeCSS}
|
|
309
|
+
`;return i+dn(r)},"createCssStyles"),lA=g((e,t)=>sl(QB(`${e}{${t}}`),eL([g(function(i,s,o,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===el)return;i.props=i.props.map(n=>n.startsWith(e)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[DB,qB,Xy,jB,"@container","@starting-style"],el].includes(i.type)||(V.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=kh))},"addNamespace"),tL])),"compileCSS"),hA=g((e,t,r,i)=>{const s=nA(e,r),o=$k(t,s,{...e.themeVariables,theme:e.theme,look:e.look},i);return lA(i,o)},"createUserStyles"),cA=g((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=pr(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),dA=g((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":tA,i=N0(`<body style="${rA}">${e}</body>`);return`<iframe style="width:${JF};height:${r};${eA}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${iA}">
|
|
310
|
+
${sA}
|
|
311
|
+
</iframe>`},"putIntoIFrame"),ud=g((e,t,r,i,s)=>{const o=e.append("div");o.attr("id",r),i&&o.attr("style",i);const a=o.append("svg").attr("id",t).attr("width","100%").attr("xmlns",ZF);return s&&a.attr("xmlns:xlink",s),a.append("g"),e},"appendDivSvgG");function al(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}g(al,"sandboxedIframe");var uA=g((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),fA=g(async function(e,t,r){ka();const i=vh(t);t=i.code;const s=At();V.debug(s),t.length>(s?.maxTextSize??UF)&&(t=XF);const o=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=g(()=>{const Y=pt(f?n:c).node();Y&&"remove"in Y&&Y.remove()},"removeTempElements");let d=pt(document.body);const f=s.securityLevel===GF,u=s.securityLevel===VF,p=s.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const H=al(pt(r),a);d=pt(H.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt(r);ud(d,e,l,`font-family: ${p}`,KF)}else{if(uA(document,e,l,a),f){const H=al(pt(document.body),a);d=pt(H.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt("body");ud(d,e,l)}let m,y;try{m=await ol.fromText(t,{title:i.title})}catch(H){if(s.suppressErrorRendering)throw h(),H;m=await ol.fromText("error"),y=H}const x=d.select(c).node(),C=m.type,k=x.firstChild,v=k.firstChild,S=m.renderer.getClasses?.(t,m),_=hA(s,C,S,o),B=document.createElement("style");B.innerHTML=_,k.insertBefore(B,v);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(H){throw s.suppressErrorRendering?h():CE.draw(t,e,"11.16.0"),H}const T=d.select(`${c} svg`),D=m.db.getAccTitle?.(),O=m.db.getAccDescription?.();W0(C,T,D,O),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",QF);let R=d.select(c).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",s.arrowMarkerAbsolute),R=cA(R,f,Xe(s.arrowMarkerAbsolute)),f){const H=d.select(c+" svg").node();R=dA(R,H)}else u||(R=mi.sanitize(R,{ADD_TAGS:oA,ADD_ATTR:aA,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(zF(),y)throw y;return h(),{diagramType:C,svg:R,bindFunctions:m.db.bindFunctions}},"render");function z0(e={}){const t=qt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),ck(t),t?.theme&&t.theme in rr?t.themeVariables=rr[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=rr.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?hk(t):Vd();pl(r.logLevel),ka()}g(z0,"initialize");var j0=g((e,t={})=>{const{code:r}=Sh(e);return ol.fromText(r,t)},"getDiagramFromText");function W0(e,t,r,i){I0(t,e),P0(t,r,i,t.attr("id"))}g(W0,"addA11yInfo");var Dr=Object.freeze({render:fA,parse:q0,getDiagramFromText:j0,initialize:z0,getConfig:At,setConfig:Zd,getSiteConfig:Vd,updateSiteConfig:dk,reset:g(()=>{yo()},"reset"),globalReset:g(()=>{yo(yi)},"globalReset"),defaultConfig:yi});pl(At().logLevel);yo(At());var gA=g((e,t,r)=>{V.warn(e),sh(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),H0=g(async function(e={querySelector:".mermaid"}){try{await pA(e)}catch(t){if(sh(t)&&V.error(t.str),or.parseError&&or.parseError(t),!e.suppressErrors)throw V.error("Use the suppressErrors option to suppress these errors"),t}},"run"),pA=g(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=Dr.getConfig();V.debug(`${e?"":"No "}Callback function found`);let s;if(r)s=r;else if(t)s=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");V.debug(`Found ${s.length} diagrams`),i?.startOnLoad!==void 0&&(V.debug("Start On Load: "+i?.startOnLoad),Dr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const o=new we.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(s)){if(V.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${o.next()}`;a=l.innerHTML,a=Xp(we.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=we.detectInit(a);h&&V.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await G0(c,a,l);l.innerHTML=d,e&&await e(c),f&&f(l)}catch(d){gA(d,n,or.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),Y0=g(function(e){Dr.initialize(e)},"initialize"),mA=g(async function(e,t,r){V.warn("mermaid.init is deprecated. Please use run instead."),e&&Y0(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await H0(i)},"init"),yA=g(async(e,{lazyLoad:t=!0}={})=>{ka(),nn(...e),t===!1&&await NF()},"registerExternalDiagrams"),U0=g(function(){if(or.startOnLoad){const{startOnLoad:e}=Dr.getConfig();e&&or.run().catch(t=>V.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",U0,!1);var xA=g(function(e){or.parseError=e},"setParseErrorHandler"),Yo=[],Va=!1,X0=g(async()=>{if(!Va){for(Va=!0;Yo.length>0;){const e=Yo.shift();if(e)try{await e()}catch(t){V.error("Error executing queue",t)}}Va=!1}},"executeQueue"),CA=g(async(e,t)=>new Promise((r,i)=>{const s=g(()=>new Promise((o,a)=>{Dr.parse(e,t).then(n=>{o(n),r(n)},n=>{V.error("Error parsing",n),or.parseError?.(n),a(n),i(n)})}),"performCall");Yo.push(s),X0().catch(i)}),"parse"),G0=g((e,t,r)=>new Promise((i,s)=>{const o=g(()=>new Promise((a,n)=>{Dr.render(e,t,r).then(l=>{a(l),i(l)},l=>{V.error("Error parsing",l),or.parseError?.(l),n(l),s(l)})}),"performCall");Yo.push(o),X0().catch(s)}),"render"),bA=g(()=>Object.keys(Or).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),or={startOnLoad:!0,mermaidAPI:Dr,parse:CA,render:G0,init:mA,run:H0,registerExternalDiagrams:yA,registerLayoutLoaders:Hy,initialize:Y0,parseError:void 0,contentLoaded:U0,setParseErrorHandler:xA,detectType:xl,registerIconPacks:Op,getRegisteredDiagramsMetadata:bA},nl=or;const Uo="flex size-11 items-center justify-center rounded border p-1 shadow",V0="absolute start-0 z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg",Z0="flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start",K0="both-shift",fd=Object.freeze({none:Object.freeze({panTrigger:null,zoom:!1}),zoom:Object.freeze({panTrigger:null,zoom:!0}),pan:Object.freeze({panTrigger:"drag",zoom:!1}),"pan-shift":Object.freeze({panTrigger:"shift-drag",zoom:!1}),both:Object.freeze({panTrigger:"drag",zoom:!0}),"both-shift":Object.freeze({panTrigger:"shift-drag",zoom:!0})}),kA=Object.freeze(["none","zoom","pan","pan-shift","both","both-shift"]),wA=Object.freeze(["none","zoom","pan","both"]),SA=Object.freeze({none:"none",zoom:"zoom",pan:"pan","pan-shift":"pan",both:"both","both-shift":"both"}),uo=.3,vA=3,TA=2,Tr=.5,_A=1;function gd(e,t){return e.panTrigger!==null&&t?e.zoom?"none":"pinch-zoom":e.zoom?"pan-x pan-y":"auto"}const BA=0;function Za(e,t,r){return e.panTrigger===null||t.button!==BA?!1:t.pointerType==="touch"||t.pointerType==="pen"?r:e.panTrigger==="drag"||t.shiftKey}function LA(e,t){return e.zoom&&t.shiftKey}function EA(e){if(e===null)return null;const t=e.trim().split(/[\s,]+/u),r=t.length===4?Number(t[2]):Number.NaN;if(!(Number.isFinite(r)&&r>0))throw new Error(`[@aiquants/markdown] MermaidDiagram: the drawing has no usable viewBox (${JSON.stringify(e)})`);return r}function FA(e,t){if(!(Number.isFinite(e)&&e>0&&(t===null||Number.isFinite(t)&&t>0)))throw new Error(`[@aiquants/markdown] MermaidDiagram: cannot fit a drawing ${t} px wide into a frame ${e} px wide`);return t===null?1:Math.min(1,e/t)}function AA(e){if(!(Number.isFinite(e)&&e>0&&e<=1))throw new Error(`[@aiquants/markdown] MermaidDiagram: the fit scale must be in (0, 1], got ${e}`);return{minScale:1,maxScale:TA/e}}function Ka(e,t){return Math.min(t.maxScale,Math.max(t.minScale,e))}function Gi(e,t,r,i,s){return{scale:t,x:e.x+(i.x-s.origin.x)/t-(r.x-s.origin.x)/e.scale,y:e.y+(i.y-s.origin.y)/t-(r.y-s.origin.y)/e.scale}}function MA(e,t,r){const i=(s,o,a,n)=>{const l=(0-o)/e.scale,c=(n-o-e.scale*a)/e.scale;return Math.min(Math.max(l,c),Math.max(Math.min(l,c),s))};return{scale:e.scale,x:i(e.x,t.origin.x,t.inline,r.inline),y:i(e.y,t.origin.y,t.block,r.block)}}function $A(e,t,r){return e*t.inline-r.inline>Tr||e*t.block-r.block>Tr}function OA(e,t){const r=o=>Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y),i=o=>({x:(o[0].x+o[1].x)/2,y:(o[0].y+o[1].y)/2}),s=r(e);return s<_A?null:{ratio:r(t)/s,from:i(e),to:i(t)}}function pd(e){return e*(1-Math.exp(-uo))}function md(e,t,r){const i=e<-Tr||e>Tr;return t-e>r+Tr?i?0-e:0:e<-Tr?0-e:t>r+Tr?r-t:0}const wa=Object.freeze({interactionMode:{text:"マウス操作モード",lang:"ja"},interactionModeTouch:{text:"タッチ操作モード",lang:"ja"},modeNone:{text:"操作なし",lang:"ja"},modeZoom:{text:"拡大縮小のみ",lang:"ja"},modePan:{text:"移動のみ (左ドラッグ)",lang:"ja"},modePanShift:{text:"移動のみ (Shift+ドラッグ)",lang:"ja"},modeBoth:{text:"拡大縮小+移動 (左ドラッグ)",lang:"ja"},modeBothShift:{text:"拡大縮小+移動 (Shift+ドラッグ)",lang:"ja"},modeNoneTouch:{text:"操作なし (指はページをスクロール)",lang:"ja"},modeZoomTouch:{text:"拡大縮小のみ (2 本指)",lang:"ja"},modePanTouch:{text:"移動のみ (はみ出す図を 1 本指でドラッグ)",lang:"ja"},modeBothTouch:{text:"拡大縮小+移動 (2 本指・はみ出す図は 1 本指)",lang:"ja"},zoomIn:{text:"Zoom In",lang:"en"},zoomOut:{text:"Zoom Out",lang:"en"},resetView:{text:"Reset View",lang:"en"},panUp:{text:"Pan Up",lang:"en"},panDown:{text:"Pan Down",lang:"en"},panLeft:{text:"Pan Left",lang:"en"},panRight:{text:"Pan Right",lang:"en"},diagram:{text:"Diagram (arrow keys pan, + and - zoom, 0 resets)",lang:"en"},retry:{text:"再試行",lang:"ja"}}),RA=dl(wa),IA=Object.freeze({none:"modeNone",zoom:"modeZoom",pan:"modePan","pan-shift":"modePanShift",both:"modeBoth","both-shift":"modeBothShift"}),PA=Object.freeze({none:"modeNoneTouch",zoom:"modeZoomTouch",pan:"modePanTouch",both:"modeBothTouch"}),Q0="(pointer: coarse)",DA=e=>{const t=window.matchMedia(Q0);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},NA=()=>window.matchMedia(Q0).matches,qA=()=>!1,zA=()=>E.useSyncExternalStore(DA,NA,qA),yd=new Set(["gantt"]),jA=200,WA=300,HA=Object.freeze({height:0,overflow:"hidden",visibility:"hidden",contain:"strict"}),YA="data-aqmd-mermaid-host",UA=e=>{const t=document.createElement("div");return t.setAttribute(YA,""),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.insetBlockStart="0",t.style.insetInlineStart=`${-e}px`,t.style.width=`${e}px`,t.style.visibility="hidden",t.style.contain="strict",document.body.append(t),t};let xd=Promise.resolve();const XA=e=>{const t=e instanceof Error?e.message:String(e);return t.includes("dynamically imported module")||t.includes("Importing a module script failed")},Cd=e=>{e.resetStyle(),e.destroy()},Qa=(e,t)=>t?"grabbing":e.panTrigger==="drag"?"move":"",GA=Object.freeze({visibility:"hidden"});let J0=!1,ll=null;if(nl?.initialize)try{nl.initialize({startOnLoad:!1}),J0=!0}catch(e){ll=e instanceof Error?e:new Error(String(e))}else ll=new Error("Mermaid library or mermaid.initialize is not available.");const tx=({chartContent:e,interaction:t,hideInteractionMenu:r=!1,labels:i,sourceLines:s})=>{const o=E.useMemo(()=>Go(wa,i),[i]),a=E.useId(),n=E.useId(),l=E.useRef(`mermaid-chart-${Math.random().toString(36).substring(2,15)}`),c=E.useRef(0),h=E.useRef(null),d=E.useRef(null),f=E.useRef(null),u=E.useRef(null),[p,m]=E.useState(!0),[y,x]=E.useState(null),[C,k]=E.useState(null),[v,S]=E.useState(0),_=E.useRef(!1),B=zA(),[T,D]=E.useState(t??K0),O=E.useRef(fd[T]),R=E.useRef(!1),[H,Y]=E.useState(!1),[P,A]=E.useState(!1),$=E.useRef(null),z=E.useRef(null);E.useEffect(()=>{t&&D(t)},[t]),E.useEffect(()=>{O.current=fd[T],u.current?.refresh()},[T]),E.useEffect(()=>{if(!P)return;const q=K=>{$.current&&!$.current.contains(K.target)&&A(!1)};return document.addEventListener("pointerdown",q),()=>document.removeEventListener("pointerdown",q)},[P]),E.useEffect(()=>{if(m(!0),x(null),k(null),!J0){x(ll?.message||"Mermaid failed to initialize globally."),m(!1);return}const q=e.trim();if(q===""){m(!1);return}const K=h.current;if(!K)throw new Error("[@aiquants/markdown] MermaidDiagram: the measuring element is not mounted");let Z=!1,J=0,dt=null,ut=K.offsetWidth,yt=null,Et,It;const Mt=()=>{oe.disconnect(),clearTimeout(Et)},$t=Gt=>{yt=null,Mt(),x(Gt),k(null),m(!1)},Xt=Gt=>{c.current+=1;const Jt=c.current;J=Jt,dt=Gt;const Re=()=>!Z&&Jt===J,ae=async()=>{const _t=UA(Gt);try{return await nl.render(`${l.current}-${Jt}`,q,_t)}finally{_t.remove()}};xd=xd.then(()=>Re()?ae().then(_t=>{if(Re()){if(typeof _t.svg!="string"||_t.svg.length===0){$t("Failed to render Mermaid diagram: SVG content is empty or invalid.");return}yt=_t.diagramType,k({svg:_t.svg,bindFunctions:typeof _t.bindFunctions=="function"?_t.bindFunctions:null}),m(!1),yd.has(_t.diagramType)?ut!==Gt&&Pt():oe.disconnect()}}).catch(_t=>{if(Re()){if(console.error(`[MermaidDiagram ${l.current}] Error rendering Mermaid diagram:`,_t),XA(_t)&&!_.current){_.current=!0,It=setTimeout(()=>S(Ct=>Ct+1),WA);return}$t(_t instanceof Error?_t.message:"An unknown error occurred while rendering the diagram.")}}):Promise.resolve())},Pt=()=>{clearTimeout(Et),Et=setTimeout(()=>{ut>0&&ut!==dt&&Xt(ut)},jA)},se=()=>{const Gt=K.offsetWidth;if(Gt!==ut){if(ut=Gt,dt===null){Gt>0&&Xt(Gt);return}yt!==null&&yd.has(yt)&&Pt()}},oe=new ResizeObserver(se);return oe.observe(K),ut>0&&Xt(ut),()=>{Z=!0,Mt(),clearTimeout(It)}},[e,v]),E.useEffect(()=>{const q=d.current;if(!q)return;const K=()=>{u.current=null,f.current&&(Cd(f.current),f.current=null),R.current=!1,Y(!1)};if(!C){q.innerHTML="",K();return}q.innerHTML=C.svg;const Z=q.querySelector("svg");let J=!1,dt;const ut=[];if(Z){let yt;try{yt=EA(Z.getAttribute("viewBox"))}catch(Mt){console.error(`[MermaidDiagram ${l.current}] Cannot size the drawing:`,Mt),x(Mt instanceof Error?Mt.message:String(Mt)),k(null);return}const Et=yt,It=()=>{if(J)return;const Mt=Z.getBBox();if(!Mt||Mt.width===0||Mt.height===0){dt=setTimeout(It,100);return}f.current&&Cd(f.current);const $t=Dd(Z,{startScale:1,startX:0,startY:0,minScale:1,maxScale:1,origin:"0 0",step:uo,animate:!1,noBind:!0,cursor:"",overflow:"",touchAction:gd(O.current,!1)});f.current=$t;let Xt={minScale:1,maxScale:1};const Pt=()=>{const Q=$t.getPan();return{scale:$t.getScale(),x:Q.x,y:Q.y}},se=()=>{const Q=q.getBoundingClientRect(),gt=Z.getBoundingClientRect(),{scale:kt,x:Ht,y:mt}=Pt();return{frameRect:Q,frame:{inline:Q.width,block:Q.height},drawing:{origin:{x:gt.left-Q.left-kt*Ht,y:gt.top-Q.top-kt*mt},inline:gt.width/kt,block:gt.height/kt}}},oe=()=>{if(J)return;const{frame:Q,drawing:gt}=se(),kt=$A($t.getScale(),gt,Q);R.current=kt,Y(kt),Sa(kt),$t.setOptions({touchAction:gd(O.current,kt)}),q.style.cursor=Qa(O.current,Ct?.kind==="pan"&&Ct.mouse)},Gt=()=>{const Q=q.getBoundingClientRect().width;Q<=0||(Xt=AA(FA(Q,Et)),$t.setOptions({minScale:Xt.minScale,maxScale:Xt.maxScale}))},Jt=Q=>{const gt=Pt(),{frame:kt,drawing:Ht}=se(),mt=MA({...Q,scale:Ka(Q.scale,Xt)},Ht,kt);return mt.scale===gt.scale&&mt.x===gt.x&&mt.y===gt.y?!1:($t.zoom(mt.scale,{animate:!1,force:!0,silent:!0}),$t.pan(mt.x,mt.y,{animate:!1,force:!0}),oe(),!0)},Re=(Q,gt)=>{const{drawing:kt}=se();return Jt(Gi(Pt(),Ka(Q,Xt),gt,gt,kt))},ae=Q=>{const gt=q.getBoundingClientRect();return{x:Q.x-gt.left,y:Q.y-gt.top}};u.current={zoomBy:Q=>{const{frame:gt}=se();Re($t.getScale()*Math.exp(Q*uo),{x:gt.inline/2,y:gt.block/2})},panBy:(Q,gt)=>{const{drawing:kt}=se(),Ht=Pt();return Jt(Gi(Ht,Ht.scale,{x:0,y:0},{x:Q,y:gt},kt))},reset:()=>{Jt({scale:1,x:0,y:0})},panSteps:()=>{const{frame:Q}=se();return{x:pd(Q.inline),y:pd(Q.block)}},refresh:oe};const _t=new Map;let Ct=null;const pe=Q=>({x:Q.clientX,y:Q.clientY}),it=()=>{const Q=[..._t.values()];return Q.length===2?[Q[0],Q[1]]:null},xt=Q=>{if(_t.has(Q.pointerId)&&_t.set(Q.pointerId,pe(Q)),Ct?.kind==="pinch"){const gt=it();if(gt===null)return;const kt=OA(Ct.last,gt);if(Ct={kind:"pinch",last:gt},kt===null)return;const{drawing:Ht}=se(),mt=Pt();Jt(Gi(mt,Ka(mt.scale*kt.ratio,Xt),ae(kt.from),ae(kt.to),Ht));return}if(Ct?.kind==="pan"&&Ct.pointerId===Q.pointerId){const gt=pe(Q),{drawing:kt}=se(),Ht=Pt();Jt(Gi(Ht,Ht.scale,ae(Ct.last),ae(gt),kt)),Ct={...Ct,last:gt}}},Ot=()=>{window.removeEventListener("pointermove",xt),window.removeEventListener("pointerup",Ie),window.removeEventListener("pointercancel",Ie)},ne=()=>{Ot(),window.addEventListener("pointermove",xt),window.addEventListener("pointerup",Ie),window.addEventListener("pointercancel",Ie)},Ie=Q=>{if(_t.delete(Q.pointerId),Ct?.kind==="pinch"){const[gt]=[..._t.entries()];Ct=gt!==void 0&&Za(O.current,{button:0,shiftKey:!1,pointerType:Q.pointerType},R.current)?{kind:"pan",pointerId:gt[0],last:gt[1],mouse:!1}:null}else Ct?.kind==="pan"&&Ct.pointerId===Q.pointerId&&(Ct=null);Ct===null&&_t.size===0&&Ot(),q.style.cursor=Qa(O.current,Ct?.kind==="pan"&&Ct.mouse)},$s=Q=>{const gt=O.current;if(Q.pointerType==="touch"||Q.pointerType==="pen"){_t.set(Q.pointerId,pe(Q)),ne();const kt=it();kt!==null&>.zoom?Ct={kind:"pinch",last:kt}:_t.size>1?Ct?.kind==="pan"&&!Ct.mouse&&(Ct=null):Za(gt,Q,R.current)&&(Ct={kind:"pan",pointerId:Q.pointerId,last:pe(Q),mouse:!1});return}Za(gt,Q,R.current)&&(Ct={kind:"pan",pointerId:Q.pointerId,last:pe(Q),mouse:!0},q.style.cursor=Qa(gt,!0),ne(),Q.preventDefault())},Oi=Q=>{Ct!==null&&!(Ct.kind==="pan"&&Ct.mouse)&&Q.cancelable&&Q.preventDefault()};let Ri=!1;const Sa=Q=>{Q!==Ri&&(Ri=Q,Q?q.addEventListener("touchmove",Oi,{passive:!1}):q.removeEventListener("touchmove",Oi))},Ii=Q=>{const gt=Q.target;if(!(gt instanceof Element)||gt===Z||!Z.contains(gt))return;const kt=q.getBoundingClientRect(),Ht=gt.getBoundingClientRect(),mt={x:md(Ht.left-kt.left,Ht.right-kt.left,kt.width),y:md(Ht.top-kt.top,Ht.bottom-kt.top,kt.height)};if(mt.x===0&&mt.y===0)return;const{drawing:Bt}=se(),me=Pt();Jt(Gi(me,me.scale,{x:0,y:0},mt,Bt))},Os=Q=>{if(!LA(O.current,Q))return;const gt=Q.deltaY===0?Q.deltaX:Q.deltaY;gt!==0&&(Q.preventDefault(),Re($t.getScale()*Math.exp(Math.sign(-gt)*uo/vA),ae(pe(Q))))},Ve=new ResizeObserver(()=>{Gt(),Jt(Pt()),oe()});q.addEventListener("pointerdown",$s),q.addEventListener("focusin",Ii),q.addEventListener("wheel",Os,{passive:!1}),Z.addEventListener("panzoomchange",oe),Ve.observe(q),ut.push(()=>{q.removeEventListener("pointerdown",$s),q.removeEventListener("focusin",Ii),Sa(!1),q.removeEventListener("wheel",Os),Z.removeEventListener("panzoomchange",oe),Ve.disconnect(),Ot()}),Gt(),oe()};It()}return C.bindFunctions&&C.bindFunctions(q),()=>{J=!0,clearTimeout(dt);for(const yt of ut)yt();K()}},[C]);const I=E.useCallback(()=>A(q=>!q),[]),M=E.useCallback(q=>{D(q),A(!1)},[]),N=E.useCallback(q=>{q.key!=="Escape"||!P||(q.preventDefault(),A(!1),z.current?.focus())},[P]),L=E.useCallback(q=>{const K=u.current;if(K===null||q.target!==q.currentTarget||q.altKey||q.ctrlKey||q.metaKey)return;const Z=K.panSteps();let J;switch(q.key){case"ArrowLeft":J=K.panBy(Z.x,0);break;case"ArrowRight":J=K.panBy(-Z.x,0);break;case"ArrowUp":J=K.panBy(0,Z.y);break;case"ArrowDown":J=K.panBy(0,-Z.y);break;case"+":case"=":K.zoomBy(1),J=!0;break;case"-":K.zoomBy(-1),J=!0;break;case"0":K.reset(),J=!0;break;default:J=!1}J&&q.preventDefault()},[]),X=(q,K,Z,J,dt=!1)=>w.jsx("button",{type:"button","data-aqmd-mermaid-control":q,onClick:Z,style:dt?GA:void 0,className:Uo,"aria-label":o[K].text,lang:o[K].lang,children:J},q),U=q=>{const K=u.current;if(K===null)return;const Z=K.panSteps();K.panBy(q.x*Z.x,q.y*Z.y)};let G;if(p)G=w.jsx("div",{className:"flex h-32 items-center justify-center bg-white dark:bg-gray-800 dark:text-white",children:"🌀 Loading diagram..."});else if(y)G=w.jsxs("div",{"data-aqmd-mermaid-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[w.jsxs("div",{children:["Error: ",y]}),w.jsxs("button",{type:"button","data-aqmd-mermaid-retry":"",onClick:()=>{_.current=!1,x(null),S(q=>q+1)},lang:o.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[w.jsx(on,{className:"h-4 w-4"}),o.retry.text]})]});else{const q=o[B?"interactionModeTouch":"interactionMode"],K=B?wA.map(Z=>({value:Z,label:o[PA[Z]],checked:SA[T]===Z})):kA.map(Z=>({value:Z,label:o[IA[Z]],checked:T===Z}));G=w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-aqmd-mermaid-toolbar":"",className:"mb-1 flex flex-wrap items-start gap-1",children:[!r&&w.jsxs("div",{ref:$,className:"relative",children:[w.jsx("button",{ref:z,id:a,type:"button","data-aqmd-mermaid-control":"mode",onClick:I,className:Uo,"aria-label":q.text,lang:q.lang,"aria-haspopup":"menu","aria-expanded":P,onKeyDown:N,children:w.jsx(_b,{size:18})}),P&&w.jsx("div",{role:"menu","aria-labelledby":a,"data-aqmd-mermaid-menu":"",onKeyDown:N,className:V0,children:K.map(({value:Z,label:J,checked:dt})=>w.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":dt,lang:J.lang,onClick:()=>M(Z),className:Z0,children:[w.jsx("span",{className:"w-3 shrink-0","aria-hidden":"true",children:dt?"✓":""}),w.jsx("span",{children:J.text})]},Z))})]}),X("zoom-in","zoomIn",()=>u.current?.zoomBy(1),w.jsx(Nd,{size:20})),X("zoom-out","zoomOut",()=>u.current?.zoomBy(-1),w.jsx(qd,{size:20})),X("reset","resetView",()=>u.current?.reset(),w.jsx(on,{size:18})),X("pan-left","panLeft",()=>U({x:1,y:0}),w.jsx(Cb,{size:18}),!H),X("pan-up","panUp",()=>U({x:0,y:1}),w.jsx(Sb,{size:18}),!H),X("pan-down","panDown",()=>U({x:0,y:-1}),w.jsx(yb,{size:18}),!H),X("pan-right","panRight",()=>U({x:-1,y:0}),w.jsx(kb,{size:18}),!H)]}),w.jsx("span",{id:n,hidden:!0,lang:o.diagram.lang,children:o.diagram.text}),w.jsx("div",{ref:d,"data-testid":"mermaid-diagram","data-aqmd-mermaid-frame":"","data-aqmd-mermaid-overflowing":H?"true":"false",role:"group",tabIndex:0,"aria-labelledby":n,onKeyDown:L,className:"mermaid mermaid-diagram-container bg-white dark:bg-gray-400"})]})}return w.jsxs("div",{className:"relative","data-aqmd-mermaid":"","data-source-lines":s,children:[w.jsx("div",{ref:h,"data-aqmd-mermaid-measure":!0,"aria-hidden":"true",style:HA}),G]})};tx.displayName="MermaidDiagramInternal";const Th=E.memo(tx),VA="unicodeTextInMathMode",ZA="noCharacterMetrics",KA=/^No character metrics for '.+' in style '.+' and mode '.+'$/su,QA="consoleCommand",JA=e=>{const t=(r,i)=>s=>(i(s),e(QA,`${r} is ignored: a formula does not write to the console`),"");return{"\\message":t("\\message",r=>r.consumeArgs(1)),"\\errmessage":t("\\errmessage",r=>r.consumeArgs(1)),"\\show":t("\\show",r=>r.popToken())}},ex=(e,t)=>{const r=`${t?"display":"inline"}:${e}`,i=kr.get(r);if(i!==void 0)return kr.delete(r),kr.set(r,i),i;const s=eM(e,t);return kr.set(r,s),kr.size>tM&&kr.delete(kr.keys().next().value),s},tM=610,kr=new Map,eM=(e,t)=>{const r=[],i=(o,a)=>{r.push({code:o,message:a,formula:e,displayMode:t})},s=console.warn;console.warn=(...o)=>{const[a]=o;if(o.length===1&&typeof a=="string"&&KA.test(a)){i(ZA,a);return}s.apply(console,o)};try{const o=Vx.renderToString(e,{displayMode:t,throwOnError:!1,macros:JA(i),strict:(a,n)=>(a!==VA&&i(a,n),"ignore")});return Object.freeze({html:o,diagnostics:Object.freeze(r.map(a=>Object.freeze(a)))})}finally{console.warn=s}};const rM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],iM=Lt("chevron-down",rM);const sM=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],oM=Lt("copy",sM);const aM=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],nM=Lt("download",aM);const lM=[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]],hM=Lt("highlighter",lM);const cM=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],dM=Lt("maximize-2",cM);const uM=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],fM=Lt("minimize-2",uM),gM=Object.freeze({table:{text:"Spreadsheet",lang:"en"},zoomIn:{text:"Zoom in",lang:"en"},zoomOut:{text:"Zoom out",lang:"en"},resetZoom:{text:"Reset zoom",lang:"en"},highlight:{text:"Highlight the active row and column",lang:"en"},copyAll:{text:"Copy the whole table",lang:"en"},saveTsv:{text:"Save as TSV",lang:"en"},saveMenu:{text:"More ways to save",lang:"en"},saveTsvWithBom:{text:"Save with a BOM (for Excel)",lang:"en"},fullscreen:{text:"View full screen",lang:"en"},exitFullscreen:{text:"Exit full screen",lang:"en"},fullscreenDialog:{text:"Spreadsheet (full screen)",lang:"en"},size:{text:"Rows {rows} × columns {cols}",lang:"en"},fileName:{text:"spreadsheet.tsv",lang:"en"},copied:{text:"Copied the whole table.",lang:"en"},copyFailed:{text:"Could not copy the table: {reason}",lang:"en"},cellAnnouncement:{text:"{cell}, {value}",lang:"en"},emptyCell:{text:"blank",lang:"en"},selectionAnnouncement:{text:"{range} selected",lang:"en"},readOnly:{text:"This table is read-only here.",lang:"en"},formatRefused:{text:"This table keeps text only, so formatting and links are not saved.",lang:"en"},fenceRefused:{text:"A cell cannot begin a line with ``` or ~~~ in this table, so the change was not saved.",lang:"en"},editConflict:{text:"The table changed in the editor, so the change was not saved. Try again.",lang:"en"},optionsError:{text:"Invalid spreadsheet options: {message}",lang:"en"},loadFailed:{text:"Could not load the spreadsheet: {message}",lang:"en"},retry:{text:"Retry",lang:"en"}}),pM=Object.freeze({table:{text:"表",lang:"ja"},zoomIn:{text:"拡大",lang:"ja"},zoomOut:{text:"縮小",lang:"ja"},resetZoom:{text:"拡大率を戻す",lang:"ja"},highlight:{text:"選んだ行と列を強調",lang:"ja"},copyAll:{text:"表全体をコピー",lang:"ja"},saveTsv:{text:"TSV として保存",lang:"ja"},saveMenu:{text:"ほかの保存の方法",lang:"ja"},saveTsvWithBom:{text:"BOM を付けて保存 (Excel 向け)",lang:"ja"},fullscreen:{text:"全画面で見る",lang:"ja"},exitFullscreen:{text:"全画面を閉じる",lang:"ja"},fullscreenDialog:{text:"表 (全画面)",lang:"ja"},size:{text:"{rows} 行 × {cols} 列",lang:"ja"},fileName:{text:"表.tsv",lang:"ja"},copied:{text:"表全体をコピーしました。",lang:"ja"},copyFailed:{text:"表をコピーできませんでした: {reason}",lang:"ja"},cellAnnouncement:{text:"{cell}、{value}",lang:"ja"},emptyCell:{text:"空白",lang:"ja"},selectionAnnouncement:{text:"{range} を選択",lang:"ja"},readOnly:{text:"この表はここでは編集できません。",lang:"ja"},formatRefused:{text:"この表は文字だけを保つため、書式とリンクは保存しません。",lang:"ja"},fenceRefused:{text:"セルの行頭に ``` や ~~~ を置くと表が壊れるため、この変更は保存しませんでした。",lang:"ja"},editConflict:{text:"エディタで表が変わっていたため、この変更は保存しませんでした。もう一度お試しください。",lang:"ja"},optionsError:{text:"表の指定の誤り: {message}",lang:"ja"},loadFailed:{text:"表を読み込めませんでした: {message}",lang:"ja"},retry:{text:"再試行",lang:"ja"}}),Ts=Object.freeze({en:gM,ja:pM}),Gr=(e,t)=>e.replace(/\{([A-Za-z]+)\}/gu,(r,i)=>Object.hasOwn(t,i)?String(t[i]):r),mM=({labels:e,rows:t,cols:r,canZoomIn:i,canZoomOut:s,zoomed:o,onZoom:a,onResetZoom:n,highlighted:l,onToggleHighlight:c,onCopy:h,onSave:d,fullscreen:f,onToggleFullscreen:u,gridReady:p})=>{const[m,y]=E.useState(!1),x=E.useId(),C=E.useRef(null),k=E.useRef(null);E.useEffect(()=>{if(!m)return;const B=k.current?.ownerDocument;if(B===void 0)return;const T=D=>{D.target instanceof Node&&k.current?.contains(D.target)===!0||y(!1)};return B.addEventListener("pointerdown",T,!0),()=>B.removeEventListener("pointerdown",T,!0)},[m]);const v=B=>{B.key!=="Escape"||!m||(B.preventDefault(),B.stopPropagation(),y(!1),C.current?.focus())},S=(B,T,D,O,R,H)=>w.jsx("button",{type:"button","data-aqmd-spreadsheet-control":B,onClick:R?D:void 0,"aria-disabled":R?void 0:"true","aria-pressed":H,className:Uo,"aria-label":e[T].text,lang:e[T].lang,children:O}),_=f?"exitFullscreen":"fullscreen";return w.jsxs("div",{"data-aqmd-spreadsheet-toolbar":"",className:"mb-1 flex flex-wrap items-center gap-1",children:[S("zoom-in","zoomIn",()=>a(1),w.jsx(Nd,{size:20}),p&&i),S("zoom-out","zoomOut",()=>a(-1),w.jsx(qd,{size:20}),p&&s),S("reset-zoom","resetZoom",n,w.jsx(on,{size:18}),p&&o),S("highlight","highlight",c,w.jsx(hM,{size:18}),p,l),S("copy","copyAll",h,w.jsx(oM,{size:18}),p),w.jsxs("div",{ref:k,className:"relative flex gap-1",children:[S("save","saveTsv",()=>d(!1),w.jsx(nM,{size:18}),!0),w.jsx("button",{ref:C,type:"button","data-aqmd-spreadsheet-control":"save-menu",onClick:()=>y(B=>!B),onKeyDown:v,className:Uo,"aria-label":e.saveMenu.text,lang:e.saveMenu.lang,"aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?x:void 0,children:w.jsx(iM,{size:18})}),m&&w.jsx("div",{id:x,role:"menu","aria-label":e.saveMenu.text,lang:e.saveMenu.lang,"data-aqmd-spreadsheet-menu":"",onKeyDown:v,className:V0,children:w.jsx("button",{type:"button",role:"menuitem","data-aqmd-spreadsheet-menu-item":"save-with-bom",lang:e.saveTsvWithBom.lang,onClick:()=>{y(!1),C.current?.focus(),d(!0)},className:Z0,children:e.saveTsvWithBom.text})})]}),S("fullscreen",_,u,f?w.jsx(fM,{size:18}):w.jsx(dM,{size:18}),!0),w.jsx("span",{"data-aqmd-spreadsheet-size":"",lang:e.size.lang,className:"ms-1 text-sm",children:Gr(e.size.text,{rows:t,cols:r})})]})},yM=(e,t,r)=>{const i={v:1,rows:e.length,cols:e[0]?.length??0,clipId:r,formats:[],validations:[],cells:e.map(o=>o.map(a=>({t:a}))),wholeRows:!1,wholeCols:!1,conditionalFormats:[]},s=t.serializeClipPayload(i);return{plain:t.serializeTsv(e),html:t.serializeHtmlTable(i,s)}},xM=async(e,t,r)=>{await t.write([r({"text/plain":new Blob([e.plain],{type:"text/plain"}),"text/html":new Blob([e.html],{type:"text/html"})})])},CM="\uFEFF",bM="text/tab-separated-values;charset=utf-8",kM=(e,t)=>`${t?CM:""}${go.serializeTsv(e)}`,wM=(e,t,r)=>{const i=r.defaultView;if(i===null)throw new Error("[@aiquants/markdown] saving a file needs a document with a window");const s=i.URL.createObjectURL(new Blob([e],{type:bM})),o=r.createElement("a");o.href=s,o.download=t,o.hidden=!0,r.body.append(o);try{o.click()}finally{o.remove(),i.setTimeout(()=>i.URL.revokeObjectURL(s),0)}},rx=24,SM=1,vM=1,TM="#f3f4f6",_M=Object.freeze({bold:!0,background:TM}),BM=Object.freeze({}),LM=(e,t)=>Math.max(1,Math.min(e.visibleRows??_i.DEFAULT_SPREADSHEET_VISIBLE_ROWS,t)),EM=e=>Vr.SPREADSHEET_COLUMN_HEADER_HEIGHT_PX+e*rx+Vr.SPREADSHEET_SCROLLBAR_SIZE_PX,FM=(e,t,r)=>{const i=(e[0]?.length??0)+r,s=e.map(o=>[...o,...Array(r).fill("")]);for(let o=0;o<t;o+=1)s.push(Array(i).fill(""));return s},ix=e=>{let t=e.length;for(;t>1&&e[t-1].every(i=>i==="");)t-=1;let r=e[0]?.length??0;for(;r>1&&e.slice(0,t).every(i=>i[r-1]==="");)r-=1;return t===0||r===0?[[""]]:e.slice(0,t).map(i=>i.slice(0,r))},AM=["format","hyperlink","note","comments","validation"],MM=(e,t)=>{let r=null,i=!1;for(const s of t){if(!(Number.isInteger(s.row)&&Number.isInteger(s.col))||s.row<0||s.row>=e.length||s.col<0||s.col>=e[s.row].length)throw new RangeError(`[@aiquants/markdown] spreadsheet edit outside the table: row ${s.row}, column ${s.col}`);AM.some(o=>s[o]!==void 0&&s[o]!==null)&&(i=!0),s.text!==void 0&&(r??=e.map(o=>[...o]),r[s.row][s.col]=s.text.replace(/\r\n?/gu,`
|
|
312
|
+
`))}return r!==null?{kind:"applied",matrix:r}:i?{kind:"format-only"}:{kind:"unchanged"}},$M=e=>go.serializeTsv(ix(e)).replaceAll(`\r
|
|
313
|
+
`,`
|
|
314
|
+
`),OM=/^ {0,3}(?:`{3}|~{3})/mu,RM=e=>OM.test(e),IM=(e,t)=>{const r=e.indexOf(t);return r===-1?{echo:!1,pending:[]}:{echo:!0,pending:e.slice(r+1)}},PM=(e,t,r,i,s)=>{const o=s==="down"?1:s==="up"?-1:0,a=s==="right"?1:s==="left"?-1:0,n=(d,f)=>d>=0&&d<t&&f>=0&&f<r,l=(d,f)=>e(d,f)!=="";let c=i.row+o,h=i.col+a;if(!n(c,h))return{row:i.row,col:i.col};if(l(i.row,i.col)&&l(c,h)){for(;n(c+o,h+a)&&l(c+o,h+a);)c+=o,h+=a;return{row:c,col:h}}for(;n(c,h);){if(l(c,h))return{row:c,col:h};c+=o,h+=a}return{row:c-o,col:h-a}},DM=/^(?:https?:\/\/|mailto:|tel:)\S+$/iu,NM=e=>DM.test(e)?e:void 0,qM=(e,t)=>{const r=`${t(e.startCol)}${e.startRow+1}`;return e.startRow===e.endRow&&e.startCol===e.endCol?r:`${r}:${t(e.endCol)}${e.endRow+1}`};let fo=null,Ja=null;const hl=new Set,zM=e=>(hl.add(e),()=>{hl.delete(e)}),bd=()=>fo!==null?Promise.resolve(fo):(Ja??=import("@aiquants/spreadsheet").then(e=>{fo=e;for(const t of hl)t();return e},e=>{throw Ja=null,e}),Ja);class Vi extends Error{reason;constructor(t){super(`[@aiquants/markdown] spreadsheet edit refused: ${t}`),this.name="SpreadsheetEditRefusal",this.reason=t}}const kd=Object.freeze({row:!0,column:!0,intersection:!1}),jM=Object.freeze({row:!1,column:!1,intersection:!1}),WM=Object.freeze({link:!1}),HM=229,YM=({matrix:e,headerRows:t,visibleRows:r})=>{const i=e.slice(0,r),s=i.slice(0,t),o=i.slice(t);return w.jsxs("table",{"data-aqmd-spreadsheet-static":"",children:[s.length>0&&w.jsx("thead",{children:s.map((a,n)=>w.jsx("tr",{children:a.map((l,c)=>w.jsx("th",{scope:"col",children:l},c))},n))}),w.jsx("tbody",{children:o.map((a,n)=>w.jsx("tr",{children:a.map((l,c)=>w.jsx("td",{children:l},c))},n))})]})},UM=e=>{try{return{options:_i.parseSpreadsheetOptions(e),error:null}}catch(t){if(t instanceof RangeError)return{options:null,error:t.message};throw t}},sx=({tsv:e,meta:t,sourceLines:r,editor:i,locale:s="en",labels:o})=>{if(!Object.hasOwn(Ts,s))throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet locale "${String(s)}" (en and ja are supported)`);const a=E.useMemo(()=>Go(Ts[s],o),[s,o]),{options:n,error:l}=E.useMemo(()=>UM(t),[t]),c=E.useMemo(()=>us.parseSourceLines(r)?.first??null,[r]),h=i!==void 0&&c!==null?i:void 0,d=h!==void 0,f=d&&n!==null&&n.footerRows===0?SM:0,u=d?vM:0,[p,m]=E.useState(()=>go.parseTsv(e)),[y,x]=E.useState(0),C=E.useRef(e),k=E.useRef([]),v=E.useMemo(()=>FM(p,f,u),[p,f,u]),S=E.useRef(v);S.current=v;const _=E.useRef(0);_.current=n?.headerRows??0;const B=E.useRef(d);B.current=d;const T=E.useSyncExternalStore(zM,()=>fo,()=>null),[D,O]=E.useState(null),[R,H]=E.useState(1),[Y,P]=E.useState(kd),[A,$]=E.useState(!1),[z,I]=E.useState(null),M=E.useRef(null),N=E.useId(),L=E.useCallback((it,xt={})=>{I(Ot=>({text:Gr(a[it].text,xt),lang:a[it].lang,serial:(Ot?.serial??0)+1}))},[a]);E.useEffect(()=>{if(T!==null||l!==null)return;let it=!0;return bd().catch(xt=>{it&&O(xt instanceof Error?xt.message:String(xt))}),()=>{it=!1}},[T,l]),E.useEffect(()=>{const it=IM(k.current,e);k.current=it.pending,!(e===C.current||it.echo)&&(C.current=e,m(go.parseTsv(e)),x(xt=>xt+1))},[e]);const X=E.useRef(()=>{});X.current=it=>{if(h===void 0||c===null)throw new Vi("readOnly");const xt=MM(S.current,it);if(xt.kind==="format-only")throw new Vi("formatRefused");if(xt.kind==="unchanged")return;const Ot=ix(xt.matrix),ne=$M(Ot);if(ne!==C.current){if(RM(ne))throw new Vi("fenceRefused");if(!h.write({fenceLine:c,expected:C.current,text:ne}))throw new Vi("editConflict");C.current=ne,k.current=[...k.current,ne],m(Ot),x(Ie=>Ie+1)}};const[U]=E.useState(()=>({get rowCount(){return S.current.length},get colCount(){return S.current[0].length},getCellText:(it,xt)=>S.current[it][xt],applyEdits:(it,xt)=>X.current(it),isCellReadOnly:()=>!B.current,getCellFormat:it=>it<_.current?_M:BM,getCellHyperlink:(it,xt)=>NM(S.current[it][xt]),findDataEdge:(it,xt)=>PM((Ot,ne)=>S.current[Ot][ne],S.current.length,S.current[0].length,it,xt)})),G=E.useCallback(it=>{if(!(it instanceof Vi))throw it;L(it.reason)},[L]),q=E.useCallback(it=>L("readOnly"),[L]),K=E.useCallback(it=>{M.current?.ownerDocument.defaultView?.open(it,"_blank","noopener,noreferrer")},[]),Z=E.useCallback(({row:it,displayText:xt,columnName:Ot})=>Gr(a.cellAnnouncement.text,{cell:`${Ot}${it+1}`,value:xt===""?a.emptyCell.text:xt}),[a]),J=T?.columnIndexToName,dt=E.useMemo(()=>J===void 0?void 0:({range:it})=>Gr(a.selectionAnnouncement.text,{range:qM(it,J)}),[J,a]),ut=E.useCallback(it=>H(xt=>Vr.clampSpreadsheetZoom(Vr.stepSpreadsheetZoom(xt,it))),[]),yt=E.useCallback(()=>H(1),[]),Et=Y.row||Y.column,It=E.useCallback(()=>P(it=>it.row||it.column?jM:kd),[]),Mt=E.useCallback(()=>{if(T===null)return;const it=M.current?.ownerDocument.defaultView;(async()=>{if(it==null)throw new Error("no window");const Ot=yM(p,T,it.crypto.randomUUID());await xM(Ot,it.navigator.clipboard,ne=>new it.ClipboardItem(ne))})().then(()=>L("copied"),Ot=>L("copyFailed",{reason:Ot instanceof Error?Ot.message:String(Ot)}))},[L,p,T]),$t=E.useCallback(it=>{const xt=M.current?.ownerDocument;xt!==void 0&&wM(kM(p,it),a.fileName.text,xt)},[p,a]),Xt=E.useRef(!1);E.useEffect(()=>{Xt.current&&(Xt.current=!1,M.current?.querySelector('[data-aqmd-spreadsheet-control="fullscreen"]')?.focus())},[A]);const Pt=E.useCallback(it=>{const xt=M.current;xt!==null&&(xt.close(),it?xt.showModal():xt.show(),Xt.current=!0,$(it))},[]),se=E.useCallback(()=>Pt(!A),[A,Pt]),oe=E.useCallback(it=>{!A||it.key!=="Escape"||it.defaultPrevented||it.nativeEvent.isComposing||it.keyCode===HM||(it.preventDefault(),it.stopPropagation(),Pt(!1))},[A,Pt]),Gt=E.useCallback(it=>{it.preventDefault(),Pt(!1)},[Pt]),Jt=p.length,Re=p[0].length,ae=n===null?0:LM(n,v.length),_t=E.useMemo(()=>({"--aqmd-spreadsheet-box-height":`${EM(ae)}px`}),[ae]),Ct=A?a.fullscreenDialog:a.table,pe=T?.Spreadsheet;return w.jsxs("div",{"data-aqmd-spreadsheet":"","data-source-lines":r,"data-aqmd-spreadsheet-editable":d?"":void 0,"data-aqmd-spreadsheet-fullscreen":A?"":void 0,children:[w.jsx("span",{id:N,hidden:!0,lang:Ct.lang,children:Ct.text}),w.jsxs("dialog",{ref:M,open:!0,"data-aqmd-spreadsheet-dialog":"",role:A?void 0:"group","aria-labelledby":N,onKeyDown:oe,onCancel:Gt,children:[l!==null?w.jsx("div",{"data-aqmd-spreadsheet-error":"options",role:"alert",lang:a.optionsError.lang,children:Gr(a.optionsError.text,{message:l})}):w.jsxs(w.Fragment,{children:[w.jsx(mM,{labels:a,rows:Jt,cols:Re,canZoomIn:R<Vr.SPREADSHEET_ZOOM_MAX,canZoomOut:R>Vr.SPREADSHEET_ZOOM_MIN,zoomed:R!==1,onZoom:ut,onResetZoom:yt,highlighted:Et,onToggleHighlight:It,onCopy:Mt,onSave:$t,fullscreen:A,onToggleFullscreen:se,gridReady:pe!==void 0}),w.jsx("div",{"data-aqmd-spreadsheet-box":"",style:_t,children:pe===void 0||n===null?w.jsx(YM,{matrix:p,headerRows:n?.headerRows??0,visibleRows:ae}):w.jsx(pe,{adapter:U,dataVersion:y,defaultRowHeight:rx,frozenRows:n.headerRows,frozenTrailingRows:n.footerRows,frozenColumns:n.frozenColumns,enableFillHandle:d,enableResizeUI:!0,zoom:R,onZoomChange:H,highlight:Y,onHighlightChange:P,popovers:WM,onHyperlinkOpen:K,onEditRejected:G,onReadOnlyRejected:q,onUndoRequest:h?.undo,onRedoRequest:h?.redo,formatCellAnnouncement:Z,formatSelectionAnnouncement:dt,locale:s})})]}),D!==null&&w.jsxs("div",{"data-aqmd-spreadsheet-error":"load",role:"alert",children:[w.jsx("span",{lang:a.loadFailed.lang,children:Gr(a.loadFailed.text,{message:D})}),w.jsx("button",{type:"button","data-aqmd-spreadsheet-retry":"",lang:a.retry.lang,className:"ms-2 inline-flex min-h-11 items-center rounded border px-3 py-1 text-sm",onClick:()=>{O(null),bd().catch(it=>O(it instanceof Error?it.message:String(it)))},children:a.retry.text})]}),w.jsx("p",{"data-aqmd-spreadsheet-notice":"",role:"status",lang:z?.lang,children:z?.text})]})]})};sx.displayName="SpreadsheetBlock";const _h=E.memo(sx),XM=Object.freeze({light:"solarized-light",dark:"github-dark-high-contrast"}),GM=Object.freeze({"solarized-light":Object.freeze({"#657b83":"#435860","#93a1a1":"#4b5757","#2aa198":"#005f59","#dc322f":"#ae0010","#d33682":"#a70060","#268bd2":"#00588e","#859900":"#4e5a00","#586e75":"#43585f","#cb4b16":"#9a3100","#b58900":"#6c5100","#6c71c4":"#4a4c9c"}),"github-dark-high-contrast":Object.freeze({"#272b33":"#abb1bb"})});function VM(e){const t={};for(const r in e){const i=e[r];switch(r){case"class":t.className=i;break;case"style":{const s={};for(const o of i.split(";")){const a=o.indexOf(":");if(a<=0)continue;const n=o.slice(0,a).trim(),l=o.slice(a+1).trim();n===""||l===""||(s[n.startsWith("--")?n:n.replace(/-(\w)/g,(c,h)=>h.toUpperCase())]=l)}t.style=s;break}case"tabindex":t.tabIndex=Number(i);break;default:t[r]=i}}return t}const ZM=({code:e})=>{const[t,r]=E.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},s=>{console.error("Failed to copy: ",s)})};return w.jsx("button",{type:"button","data-aqmd-code-copy":"",className:"absolute top-2 right-2 z-10 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md px-2 py-1 text-sm transition-colors",onClick:i,children:t?"COPIED!":"Copy"})},KM=({htmlPromise:e,filename:t,code:r,sourceLines:i})=>{const s=E.use(e),o={replace:a=>{if(a instanceof Tt.Element&&a.name==="pre"){const n=VM(a.attribs),l=t?"2.2rem 0 1rem 0":"1rem 0";return n.style={...typeof n.style=="object"?n.style:{},margin:"0",padding:"0.8rem 0"},w.jsxs("div",{className:"relative",style:{margin:l},"data-aqmd-code-block":"","data-source-lines":i,children:[t&&w.jsx("div",{"data-aqmd-code-filename":"",className:"absolute -top-4 left-0 z-0 rounded-md px-2 py-0.5 text-sm",children:t}),w.jsx(ZM,{code:r}),w.jsx("pre",{...n,children:Tt.domToReact(a.children,o)})]})}},htmlparser2:{lowerCaseTags:!0}};return w.jsx(w.Fragment,{children:Tt(s,o)})},QM=/^(diff)?:?(\w+):?([\w.-]*)?/,JM=()=>({code(e){for(const t of e.children){if(t.type!=="element")continue;const r=t.children[0];if(r?.type!=="element")continue;const i=r.children[0];if(i?.type!=="text")continue;const s=i.value;let o,a,n="";if(s.startsWith("+")?(o="+",a="add",n="bg-green-200 dark:bg-green-400/90 text-green-700"):s.startsWith("-")&&(o="-",a="remove",n="bg-red-200 dark:bg-red-400/90 text-red-700"),o&&a){t.properties.dataAqmdDiff=a,i.value=s.substring(1).trimStart();const l={type:"element",tagName:"span",properties:{className:`inline-flex items-center justify-center w-4 h-4 rounded-full select-none font-bold text-[0.5rem] mr-2 ${n}`},children:[{type:"text",value:o==="+"?"➕":"➖"}]};t.children.unshift(l)}}}}),t5=e=>{const t=QM.exec(e??"");return{isDiff:t?.[1]==="diff",lang:t?.[2]||"text",filename:t?.[3]||void 0}},Bh=({lang:e,code:t,node:r,sourceLines:i})=>{const s=e??r?.lang??void 0,o=t??r?.value??"",{isDiff:a,lang:n,filename:l}=t5(s);return n===_i.SPREADSHEETS_LANGUAGE?w.jsx(_h,{tsv:o,meta:r?.meta??void 0,sourceLines:i}):n==="mermaid"?w.jsx(Th,{chartContent:o,sourceLines:i}):w.jsx(e5,{code:o,lang:n,isDiff:a,filename:l,sourceLines:i})},e5=({code:e,lang:t,isDiff:r,filename:i,sourceLines:s})=>{const o=E.useMemo(async()=>{const a=[];return r&&a.push(JM()),await Xx.codeToHtml(e,{lang:t,themes:XM,defaultColor:!1,colorReplacements:GM,transformers:a})},[e,t,r]);return w.jsx(E.Suspense,{fallback:w.jsx("div",{className:"dark:text-white","data-source-lines":s,children:"🌀 Loading code..."}),children:w.jsx(KM,{htmlPromise:o,filename:i,code:e,sourceLines:s})})},ox=({code:e})=>{const[t,r]=E.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},s=>{console.error("Failed to copy: ",s)})};return w.jsx("button",{type:"button","data-aqmd-code-copy":"",className:"absolute right-2 z-10 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md px-2 py-1 text-xs transition-colors",onClick:i,children:t?"COPIED!":"Copy"})},ax=(e,t)=>{const r=E.useMemo(()=>{try{return{kind:"rendered",html:ex(e,t).html}}catch(i){return{kind:"failed",error:i,message:`Math rendering error: ${i instanceof Error?i.message:String(i)}`}}},[e,t]);return E.useEffect(()=>{r.kind==="failed"&&console.error("An error occurred while rendering KaTeX:",r.error)},[r]),r},r5=({node:e})=>{const t=ax(e.value,!0),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return w.jsxs("div",{className:"relative",children:[w.jsx(ox,{code:e.value}),t.kind==="rendered"?w.jsx("article",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):w.jsx("article",{className:r,children:t.message})]})},i5=/^[a-z][a-z0-9+.-]*:/i,s5=/^[/\\]{2}/,o5=/[\t\n\r]/g,wd=32,a5=e=>{let t=0,r=e.length;for(;t<r&&e.charCodeAt(t)<=wd;)t+=1;for(;r>t&&e.charCodeAt(r-1)<=wd;)r-=1;return e.slice(t,r)},nx=e=>{const t=a5(e).replace(o5,"");return i5.test(t)||s5.test(t)},n5="text-link underline visited:text-link-visited",l5="inline-block w-fit",Lh=new Set(["img","picture","video","audio","svg","canvas","iframe","object","embed","address","article","aside","blockquote","details","dialog","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","menu","nav","ol","p","pre","section","table","ul"]);[...Lh].join(",");const lx=(e,t)=>[e,t?l5:void 0,n5].filter(r=>r!==void 0&&r.trim()!=="").join(" "),h5=new Set(["id","title","lang","dir","role"]),c5=["aria-","data-footnote-"],d5=e=>{const t={};for(const[r,i]of Object.entries(e)){const s=r.toLowerCase();(h5.has(s)||c5.some(o=>s.startsWith(o)&&s.length>o.length))&&(t[s]=i)}return Object.freeze(t)},ke=new rn.Logger(rn.LogLevel.INFO,"[DifyIFramePlugin]"),u5="100%",f5="600px",g5="0",p5=e=>typeof e!="object"||e===null||!("type"in e)?null:typeof e.type=="string"?e.type:null,m5=({embed:e,iFrameAllowedDomains:t})=>{const[r,i]=E.useState(!0),[s,o]=E.useState(!1),a=E.useRef(null),n=E.useRef(null),l=E.useRef(null),{src:c}=e,h=E.useCallback(x=>{x.source===null||x.source!==a.current?.contentWindow||!zC(x.origin,t)||p5(x.data)==="dify-chatbot-iframe-ready"&&(ke.info("Dify chatbot iframe is ready"),i(C=>C&&(o(!1),n.current&&(clearTimeout(n.current),n.current=null),l.current&&(clearTimeout(l.current),l.current=null),!1)))},[t]),d=E.useCallback(()=>{const x=a.current;if(x)try{if(!x.contentDocument)throw new Error("Cannot access iframe content");i(k=>k&&(o(!1),!1))}catch{ke.info("Crossorigin error detected, showing auth prompt"),o(k=>k||(i(!1),!0))}},[]),f=E.useCallback(()=>{const x=window.open(c,"dify-oauth","width=500,height=600,scrollbars=yes,resizable=yes");if(!x){ke.error("ポップアップがブロックされました");return}const C=setInterval(()=>{if(x.closed){clearInterval(C),ke.info("ポップアップが閉じられました");try{ke.info("ポップアップURL:",x.location.href)}catch(v){ke.info("クロスオリジンのためURLにアクセスできません:",v)}const k=a.current;if(k?.src){const v=k.src;i(S=>S||!0),o(S=>S&&!1),k.src="",setTimeout(()=>{k.src=v,n.current=setTimeout(()=>{ke.warn("認証後タイムアウト: dify-chatbot-iframe-ready not received after auth"),d()},5e3)},100)}}},1e3);ke.info("ポップアップを開きました:"),ke.info("- 初期URL:",c),ke.info("- ウィンドウ名:","dify-oauth"),ke.info("- ウィンドウサイズ: 500x600")},[d,c]);E.useEffect(()=>(window.addEventListener("message",h),()=>{window.removeEventListener("message",h)}),[h]),E.useEffect(()=>{const x=setTimeout(()=>{ke.warn("Timeout: dify-chatbot-iframe-ready not received, checking iframe access"),d()},5e3);return l.current=x,()=>{l.current&&(clearTimeout(l.current),l.current=null)}},[d]),E.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);const{width:u=u5,height:p=f5,frameborder:m=g5,...y}=e.attributes;return w.jsxs("div",{className:"dify-iframe-container",children:[r&&!s&&w.jsxs("div",{className:"flex items-center justify-center rounded-lg bg-gray-50 p-8",children:[w.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-blue-600 border-b-2"}),w.jsx("span",{className:"ml-3 text-gray-600",children:"Dify チャットボットを読み込み中..."})]}),s&&w.jsxs("div",{className:"mb-4 rounded-lg border border-blue-200 bg-blue-50 p-6",children:[w.jsx("div",{className:"flex items-center",children:w.jsxs("div",{className:"text-blue-800",children:[w.jsx("h3",{className:"font-medium",children:"認証が必要です"}),w.jsx("p",{className:"mt-1 text-sm",children:"Dify チャットボットにアクセスするには OAuth 認証が必要です。 ポップアップウィンドウで認証を完了してください。"})]})}),w.jsx("div",{className:"mt-4",children:w.jsx("button",{type:"button",onClick:f,className:"rounded-md border border-gray-700 bg-gray-900 px-4 py-2 font-medium text-sm text-white shadow-lg transition-colors hover:bg-gray-800",children:"OAuth 認証を開始"})})]}),w.jsx("div",{className:`${r||s?"hidden":"block"}`,children:w.jsx("iframe",{ref:a,...Tt.attributesToProps({...y,width:u,height:p,frameborder:m},"iframe"),src:c,"data-plugin-type":"dify"})})]})},Sd=Object.freeze({dify:m5}),y5=e=>Object.hasOwn(Sd,e)?Sd[e]:null,x5=w.jsx(E.Fragment,{}),C5=(e,t,r,i,s)=>{const o=t===null?null:y5(t),a=e.attributes.title===void 0?{title:`${i.text}: ${new URL(e.src).hostname}`,lang:i.lang}:{};return w.jsx(TC,{embed:e,label:i,insideAnchor:s,children:o!==null?w.jsx(o,{embed:e,iFrameAllowedDomains:r}):w.jsx("iframe",{...Tt.attributesToProps(e.attributes,"iframe"),...a,src:e.src})})},b5=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof Tt.Element&&t.name.toLowerCase()==="a")return!0;return!1},hx=e=>e.some(t=>t instanceof Tt.Element&&(Lh.has(t.name)||hx(t.children))),k5=(e,t,r)=>{const{class:i,"data-link-kind":s,"data-doc-path":o,"data-doc-exists":a,...n}=e.attribs,l=lx(i,hx(e.children)),c=n.href??"",h=s,d=h==="external"||nx(c),f=Tt.domToReact(e.children,t);if(r&&c&&!d)return w.jsx(r,{href:c,kind:h,docPath:o,docExists:a===void 0?void 0:a==="true",className:l,attributes:d5(n),children:f});d&&(n.target="_blank",n.rel="noreferrer");const u={};return s!==void 0&&(u["data-link-kind"]=s),o!==void 0&&(u["data-doc-path"]=o),a!==void 0&&(u["data-doc-exists"]=a),w.jsx("a",{...Tt.attributesToProps(n,"a"),className:l,...u,children:f})},cx=({iFrameAllowedDomains:e,embedLabels:t,linkComponent:r,renderPlaceholder:i,renderKept:s})=>{const o={replace:a=>{if(!(a instanceof Tt.Element))return;const n=a.parent instanceof Tt.Element?a.parent.name:null,l=fl(a.name,a.attribs,{parentName:n,iFrameAllowedDomains:e});switch(l.action){case"remove":return x5;case"unwrap":return w.jsx(E.Fragment,{children:Tt.domToReact(a.children,o)});case"embed":return C5(l.embed,l.pluginType,e,t.embeddedFrame,b5(a))}if(a.attribs={...l.attributes},l.action==="placeholder"){const h=i?.(a,l.link,o);if(h!==void 0)return h}const c=s?.(a,o);if(c!==void 0)return c;if(a.name==="a")return k5(a,o,r)}};return o},w5=({alt:e,target:t,label:r})=>w.jsxs("span",{"data-testid":"markdown-missing-image","data-asset-src":t||void 0,role:"img","aria-label":`${e?`${r} (${e})`:r}${t?`: ${t}`:""}`,className:"my-1 inline-flex max-w-full items-center gap-2 rounded-lg border border-gray-300 border-dashed bg-gray-50 px-3 py-2 text-gray-600 text-sm dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400",children:[w.jsx(pC,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),w.jsxs("span",{className:"min-w-0",children:[w.jsx("span",{className:"font-medium",children:e?`${r} (${e})`:r}),t&&w.jsx("span",{className:"ml-2 break-all font-mono text-xs dark:text-gray-300",children:t})]})]}),S5=(e,t,r)=>{const{src:i,alt:s,"data-asset-exists":o,"data-asset-src":a}=e.attribs;if(!i||i.trim()===""||o==="false")return w.jsx(w5,{alt:s,target:a,label:t});const n=r.rendered===0;return r.rendered+=1,w.jsx("img",{alt:"",...Tt.attributesToProps({loading:n?"eager":"lazy",decoding:"async",...e.attribs})})},Xo=e=>e.map(t=>t instanceof Tt.Text?t.data:t instanceof Tt.Element?Xo(t.children):"").join(""),v5=(e,t)=>e.map(r=>{if(r instanceof Tt.Text)return{kind:"text",text:r.data};if(!(r instanceof Tt.Element))return{kind:"ignored"};if(r.name.toLowerCase()!=="a")return{kind:"element"};const i=fl(r.name,r.attribs,{parentName:"p",iFrameAllowedDomains:t});return{kind:"link",href:i.action==="keep"?i.attributes.href??null:null}}),T5=(e,t,r,i)=>{const s=e.children,o=dr.placeholderLinkOf(t,v5(s,i.iFrameAllowedDomains));if(o===null)return;const a=Tt.domToReact(s,r),n=w.jsx("p",{...Tt.attributesToProps(e.attribs,"p"),children:a}),l=s.find(f=>f instanceof Tt.Element),c=i.embeds.linkCardEndpoint,h=c!==null&&l!==void 0&&dr.isBareLink(Xo(l.children),o)?w.jsx(FC,{href:t,endpoint:c,size:ze.linkCardSizeOf(i.embeds),fallback:n}):n,d=Mr.resolveEmbed(o,i.embeds.providers);return d===null?h:w.jsx(NC,{resolution:d,caption:a,fallback:h,theme:i.theme,labels:i.embedLabels})},_5={lowerCaseAttributeNames:!1},B5=2166136261,L5=16777619,E5=/^[\t\n\f\r ]*$/u,F5=`language-${_i.SPREADSHEETS_LANGUAGE}`,dx=e=>e.name==="code"&&(e.attribs.class??"").split(/[\t\n\f\r ]+/u).includes(F5),A5=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof Tt.Element&&(t.name==="li"||t.name==="blockquote"))return!0;return!1},M5=e=>{let t=B5;const r=s=>{for(let o=0;o<s.length;o+=1)t=Math.imul(t^s.charCodeAt(o),L5)},i=s=>{if(s instanceof Tt.Text)r(""),r(s.data);else if(s instanceof Tt.Element){r(""),r(s.name);for(const[o,a]of Object.entries(s.attribs))o!==us.SOURCE_LINES_ATTRIBUTE&&(r(""),r(o),r(""),r(a));if(r(""),!dx(s))for(const o of s.children)i(o);r("")}else r("\x07"),r(s.data)};return i(e),(t>>>0).toString(36)},$5=(e,t)=>{if(e==="")return[];const r=new Map;return Tt.htmlToDOM(e,_5).map(i=>{if(i instanceof Tt.Text&&E5.test(i.data))return i.data;const s=M5(i),o=r.get(s)??0;return r.set(s,o+1),w.jsx(E.Fragment,{children:Tt.domToReact([i],t)},`${s}.${o}`)})},ux=({htmlContent:e,theme:t="light",iFrameAllowedDomains:r=[],embeds:i=ze.NO_EMBEDS,embedLabels:s,mermaidInteraction:o,mermaidLabels:a,spreadsheetEditor:n,spreadsheetLocale:l,spreadsheetLabels:c,linkComponent:h,missingImageLabel:d="Image not found",onMathDiagnostics:f})=>{Rd(i);const u=Fd(s),p={rendered:0},m=[],y=E.useRef(null),x=E.useEffectEvent(v=>{f?.(v)}),C=cx({iFrameAllowedDomains:r,embedLabels:u,linkComponent:h,renderPlaceholder:(v,S,_)=>T5(v,S,_,{embeds:i,theme:t,embedLabels:u,iFrameAllowedDomains:r}),renderKept:v=>{if(v.name==="pre"&&v.children.length===1){const S=v.children[0];if(S instanceof Tt.Element&&S.name==="code"){const _=S.attribs.class??"",B=Xo(S.children),T=v.attribs[us.SOURCE_LINES_ATTRIBUTE];if(dx(S)){const D=A5(v)?void 0:n;return w.jsx(_h,{tsv:B,meta:S.attribs[_i.CODE_META_ATTRIBUTE],sourceLines:T,editor:D,locale:l,labels:c})}return _.includes("language-mermaid")?w.jsx(Th,{chartContent:B,interaction:o,labels:a,sourceLines:T}):w.jsx(Bh,{lang:_.replace("language-",""),code:B,theme:t,sourceLines:T})}}if(v.name==="img")return S5(v,d,p);if(v.name==="span"&&v.attribs.class?.includes("math")){const S=v.attribs.class.includes("display");let _=Xo(v.children).trim();S?_=_.replace(/^\\\[/,"").replace(/\\\]$/,""):_=_.replace(/^\\\(/,"").replace(/\\\)$/,"");try{const{html:B,diagnostics:T}=ex(_,S);return m.push(...T),S?w.jsxs("span",{className:"group relative block",children:[w.jsx(ox,{code:_}),w.jsx("span",{dangerouslySetInnerHTML:{__html:B}})]}):w.jsx("span",{dangerouslySetInnerHTML:{__html:B}})}catch(B){console.error("Failed to render math:",B);return}}}}),k=$5(e,C);return E.useEffect(()=>{y.current!==e&&(y.current=e,m.length>0&&x(m))},[e,m]),w.jsx("div",{className:"markdown-body","data-theme":t,children:k})};const O5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],R5=Lt("triangle-alert",O5);const I5=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],P5=Lt("text-align-center",I5);const D5=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],N5=Lt("text-align-start",D5);const q5=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],z5=Lt("text-align-end",q5);const j5=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],W5=Lt("list",j5);const H5=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Y5=Lt("palette",H5);const U5=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],X5=Lt("pin",U5);const G5=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],V5=Lt("pin-off",G5),Z5=e=>`#${e.id}`,K5=e=>{let t=Number.POSITIVE_INFINITY;for(const r of e)r.depth<t&&(t=r.depth);return t},vd="block truncate py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",fx=({headings:e,className:t="",onHeadingSelect:r,headingHref:i=Z5,label:s,labelledBy:o})=>{if(e.length===0)return null;const a=K5(e);return w.jsx("nav",{className:`toc ${t}`,"aria-label":s,"aria-labelledby":o,children:w.jsx("ul",{className:"m-0 list-none p-0",children:e.map((n,l)=>{const c=n.id===""?null:i(n);return w.jsx("li",{style:{paddingLeft:`${(n.depth-a)*1}rem`},children:c===null?w.jsx("span",{className:`${vd} text-gray-600 dark:text-gray-300`,title:n.text,children:n.text}):w.jsx("a",{href:_s(c)?c:void 0,className:`${vd} text-gray-600 no-underline hover:text-blue-800 dark:text-gray-300 dark:hover:text-blue-300`,onClick:r===void 0?void 0:h=>r(n,h),title:n.text,children:n.text})},l)})})})},tn="--aqmd-toolbar-block-overlap",Q5=({toolbar:e,content:t,scrollportTop:r,scrollportBottom:i})=>{if(e.width<=0||e.height<=0)return 0;const s=e.left<t.right&&e.right>t.left,o=e.top<r+e.height&&e.top<i,a=e.bottom-r;return s&&o&&a>0?Math.ceil(a):0},gx=e=>`mermaid${e.charAt(0).toUpperCase()}${e.slice(1)}`,px=Object.keys(wa),mx=e=>`spreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`,yx=Object.keys(Ts.en),xx=Object.freeze({loading:{text:"Loading data...",lang:"en"},errorPrefix:{text:"Error: ",lang:"en"},defaultErrorTitle:{text:"An error occurred",lang:"en"},missingImage:{text:"Image not found",lang:"en"},styleTitle:{text:"Display Style",lang:"en"},selectStyleAria:{text:"Select display style",lang:"en"},pinStyleAria:{text:"Pin style selector",lang:"en"},unpinStyleAria:{text:"Unpin style selector",lang:"en"},openTocAria:{text:"目次を開く",lang:"ja"},tocTitle:{text:"目次",lang:"ja"},pinTocAria:{text:"目次をピン留め",lang:"ja"},unpinTocAria:{text:"目次のピン留めを解除",lang:"ja"},selectAlignAria:{text:"揃えを選択",lang:"ja"},alignTitle:{text:"揃え",lang:"ja"},pinAlignAria:{text:"揃え選択をピン留め",lang:"ja"},unpinAlignAria:{text:"揃え選択のピン留めを解除",lang:"ja"},alignLeft:{text:"左揃え",lang:"ja"},alignCenter:{text:"中央揃え",lang:"ja"},alignRight:{text:"右揃え",lang:"ja"},...Object.fromEntries(px.map(e=>[gx(e),wa[e]])),...Object.fromEntries(yx.map(e=>[mx(e),Ts.en[e]])),...Vo}),J5=dl(xx),t3=e=>Go(xx,e),e3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of px){const i=e[gx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},r3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of yx){const i=e[mx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},i3=Object.keys(Vo),s3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of i3){const i=e[r];i!==void 0&&(t[r]=i)}return Object.freeze(t)},Td=Object.freeze({left:{labelKey:"alignLeft",Icon:N5},center:{labelKey:"alignCenter",Icon:P5},right:{labelKey:"alignRight",Icon:z5}}),o3=Object.freeze({text:"ファイルを選択してください。",lang:"ja"}),a3="100%",n3=e=>e==="center"?"auto":e==="right"?"auto 0":"0 auto",cl="24px",Cx=e=>Object.freeze({position:"fixed",insetBlockStart:"var(--aqmd-toolbar-inset-block-start, 0px)",insetInlineEnd:`calc(var(--aqmd-toolbar-inset-inline-end, 0px) + ${e})`,zIndex:60,display:"flex",flexDirection:"row",alignItems:"flex-start",gap:"0.5rem",pointerEvents:"none"}),l3=Cx(cl),h3=Object.freeze({position:"absolute",insetBlockStart:0,insetInlineStart:0,blockSize:"var(--aqmd-toolbar-inset-block-start, 0px)",inlineSize:"var(--aqmd-toolbar-inset-inline-end, 0px)",visibility:"hidden",pointerEvents:"none"}),c3=e=>`calc(100cqi - var(--aqmd-toolbar-inset-inline-end, 0px) - ${e})`,d3=8,_d=800,u3=16,f3=(e,t)=>{const r=e.defaultView;let i;const s=()=>{e.removeEventListener("click",o,!0),e.removeEventListener("pointercancel",a,!0),i!==void 0&&r?.clearTimeout(i)};function o(n){s(),!(n.timeStamp-t.timeStamp>_d||Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY)>u3)&&(n.preventDefault(),n.stopPropagation())}function a(n){n.pointerId===t.pointerId&&s()}e.addEventListener("click",o,!0),e.addEventListener("pointercancel",a,!0),i=r?.setTimeout(s,_d)},g3=(e,t,r)=>{const[i,s]=E.useState(null);return E.useLayoutEffect(()=>{const o=t.current;if(!e||o===null||r===null){s(null);return}const a=o.ownerDocument.defaultView;let n=0;const l=()=>{n=0;const d=o.getBoundingClientRect(),f=o.offsetHeight>0?d.height/o.offsetHeight:1,u=a?.visualViewport??null,p=u===null?Number.POSITIVE_INFINITY:u.offsetTop+u.height,m=Math.min(r.getBoundingClientRect().bottom,p);s(Math.max(0,Math.floor((m-d.top)/f-d3)))},c=()=>{a!==null&&n===0&&(n=a.requestAnimationFrame(l))};l();const h=new ResizeObserver(c);return h.observe(r),a?.addEventListener("resize",c),a?.visualViewport?.addEventListener("resize",c),a?.visualViewport?.addEventListener("scroll",c),o.ownerDocument.addEventListener("scroll",c,!0),()=>{a!==null&&n!==0&&a.cancelAnimationFrame(n),h.disconnect(),a?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("scroll",c),o.ownerDocument.removeEventListener("scroll",c,!0)}},[e,t,r]),i};function en({menu:e,Icon:t,buttonLabel:r,titleLabel:i,titleId:s,pinLabel:o,unpinLabel:a,isOpen:n,isPinned:l,isFront:c,onActivate:h,onToggle:d,onClose:f,onPinToggle:u,popoverClassName:p,scrollBarClearance:m,boundary:y,renderBody:x}){const C=E.useRef(null),k=E.useRef(null),v=E.useRef(null),S=g3(n,v,y),_=E.useCallback(()=>{d(),h()},[h,d]),B=E.useCallback(()=>{if(l)return;const D=C.current?.contains(document.activeElement)===!0;f(),D&&k.current?.focus()},[l,f]);E.useEffect(()=>{if(!n||l)return;const D=C.current;if(D===null)return;const O=H=>{D.contains(H.target)||(f(),H.pointerType==="touch"&&!(H.target instanceof Element&&H.target.closest("[data-aqmd-toolbar]")!==null)&&f3(D.ownerDocument,H))},R=H=>{H.key!=="Escape"||H.defaultPrevented||H.isComposing||(H.preventDefault(),f(),k.current?.focus())};return document.addEventListener("pointerdown",O),D.addEventListener("keydown",R),()=>{document.removeEventListener("pointerdown",O),D.removeEventListener("keydown",R)}},[n,l,f]);const T=l?a:o;return w.jsxs("div",{ref:C,"data-aqmd-toolbar-menu":e,children:[w.jsx("button",{ref:k,type:"button",className:"pointer-events-auto rounded-full border border-gray-200 bg-white p-3 shadow-lg transition-colors hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700",onClick:_,"aria-label":r.text,lang:r.lang,"aria-expanded":n,children:w.jsx(t,{className:"h-5 w-5 text-gray-600 dark:text-gray-300"})}),n&&w.jsxs("div",{ref:v,"data-aqmd-toolbar-popover":e,className:`pointer-events-auto absolute end-0 top-full mt-2 box-border overflow-y-auto overscroll-contain rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-700 dark:bg-gray-800 ${p}`,style:{zIndex:c?2:1,maxInlineSize:c3(m),maxBlockSize:S??void 0},children:[w.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[w.jsx("h3",{id:s,lang:i.lang,className:"px-2 font-bold text-gray-600 text-sm uppercase tracking-wider dark:text-gray-300",children:i.text}),w.jsx("button",{type:"button",className:"rounded p-3.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200",onClick:u,"aria-label":T.text,lang:T.lang,children:l?w.jsx(X5,{className:"h-4 w-4"}):w.jsx(V5,{className:"h-4 w-4"})})]}),x(B)]})]})}const p3=(e,t,r,i)=>{const[s,o]=E.useState(0),a=E.useRef(null);return E.useLayoutEffect(()=>{const n=e.current,l=t.current;if(r===null||n===null||l===null){a.current=null,o(0);return}const c=()=>{const p=n.getBoundingClientRect();o(Q5({toolbar:r.getBoundingClientRect(),content:l.getBoundingClientRect(),scrollportTop:p.top+n.clientTop,scrollportBottom:p.bottom}))};a.current=c;let h=null;const d=()=>{h===null&&(h=requestAnimationFrame(()=>{h=null,c()}))};c();const f=new ResizeObserver(c);f.observe(n),f.observe(l),f.observe(r);const u=r.querySelector("[data-aqmd-toolbar-inset-probe]");return u!==null&&f.observe(u),window.addEventListener("resize",c),window.addEventListener("scroll",d,{capture:!0,passive:!0}),()=>{a.current=null,f.disconnect(),window.removeEventListener("resize",c),window.removeEventListener("scroll",d,{capture:!0}),h!==null&&cancelAnimationFrame(h)}},[e,t,r]),E.useLayoutEffect(()=>{a.current?.()},[i]),s},m3=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,y3=e=>{let t=null,r=e;for(;r!==null;)r.getAttribute("hidden")?.toLowerCase()==="until-found"&&(r.dispatchEvent(new Event("beforematch",{bubbles:!0})),r.removeAttribute("hidden")),r instanceof HTMLDetailsElement&&!r.open&&t!==null&&t!==Array.from(r.children).find(i=>i.localName==="summary")&&(r.open=!0),t=r,r=r.parentElement},x3=E.memo(function({parseResult:t,theme:r,styleClassName:i,iFrameAllowedDomains:s,embeds:o,embedLabels:a,linkComponent:n,missingImageLabel:l,mermaidLabels:c,spreadsheetEditor:h,spreadsheetLocale:d,spreadsheetLabels:f,onMathDiagnostics:u}){return w.jsx("div",{className:"w-full min-w-0",children:w.jsx("div",{className:i,"data-theme":r,children:w.jsx(ux,{htmlContent:t.htmlContent,theme:r,iFrameAllowedDomains:s,embeds:o,embedLabels:a,linkComponent:n,missingImageLabel:l,mermaidLabels:c,spreadsheetEditor:h,spreadsheetLocale:d,spreadsheetLabels:f,onMathDiagnostics:u})})})});function bx(){const[e,t]=E.useState("toc"),[r,i]=E.useState(!1),[s,o]=E.useState(!1),[a,n]=E.useState(!1),[l,c]=E.useState(!1),[h,d]=E.useState(!1),[f,u]=E.useState(!1),p=E.useCallback(()=>t("toc"),[]),m=E.useCallback(()=>i(O=>!O),[]),y=E.useCallback(()=>i(!1),[]),x=E.useCallback(()=>c(O=>!O),[]),C=E.useCallback(()=>t("style"),[]),k=E.useCallback(()=>o(O=>!O),[]),v=E.useCallback(()=>o(!1),[]),S=E.useCallback(()=>d(O=>!O),[]),_=E.useCallback(()=>t("align"),[]),B=E.useCallback(()=>n(O=>!O),[]),T=E.useCallback(()=>n(!1),[]),D=E.useCallback(()=>u(O=>!O),[]);return{lastActiveMenu:e,isTocOpen:r,isStyleOpen:s,isAlignOpen:a,isTocPinned:l,isStylePinned:h,isAlignPinned:f,activateToc:p,toggleToc:m,closeToc:y,togglePinToc:x,activateStyle:C,toggleStyle:k,closeStyle:v,togglePinStyle:S,activateAlign:_,toggleAlign:B,closeAlign:T,togglePinAlign:D}}const C3=({error:e,labels:t})=>{if(E.isValidElement(e))return w.jsx("div",{className:"p-4",children:e});if(typeof e=="object"&&e!==null&&"message"in e){const i=e,s=i.title!==void 0&&i.title!=="";return w.jsx("div",{className:"mx-auto my-8 max-w-lg rounded-xl border border-red-200 bg-red-50/50 p-6 shadow-sm backdrop-blur-sm dark:border-red-900/50 dark:bg-red-950/30",children:w.jsxs("div",{className:"flex items-start gap-3",children:[w.jsx("div",{className:"rounded-lg bg-red-100 p-2 text-red-600 dark:bg-red-900/50 dark:text-red-400",children:w.jsx(R5,{className:"h-5 w-5"})}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsx("h3",{lang:s?void 0:t.defaultErrorTitle.lang,className:"font-semibold text-base text-red-900 dark:text-red-200",children:s?i.title:t.defaultErrorTitle.text}),i.status&&w.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 font-medium font-mono text-red-700 text-xs dark:bg-red-900/60 dark:text-red-300",children:i.status})]}),w.jsx("p",{className:"mt-2 text-red-700 text-sm leading-relaxed dark:text-red-300/90",children:i.message})]})]})})}const r=typeof e=="string"?e:String(e);return w.jsx("div",{className:"mx-auto my-8 max-w-lg rounded-xl border border-red-200 bg-red-50/50 p-4 text-center dark:border-red-900/50 dark:bg-red-950/30",children:w.jsxs("p",{className:"font-medium text-red-700 text-sm dark:text-red-300",children:[w.jsx("span",{lang:t.errorPrefix.lang,children:t.errorPrefix.text}),r]})})};function b3({parseResult:e,content:t,error:r=null,isLoading:i=!1,labels:s,theme:o,style:a,onStyleChange:n,availableStyles:l=Di.DEFAULT_MARKDOWN_STYLES,align:c=Di.DEFAULT_CONTENT_ALIGN,onAlignChange:h,showToc:d=!0,showStyle:f=!0,showAlign:u=!0,width:p,maxWidth:m,padding:y=16,iFrameAllowedDomains:x,embeds:C=ze.NO_EMBEDS,emptyMessage:k,toolbar:v,linkComponent:S,onHeadingSelect:_,headingHref:B,onMathDiagnostics:T,spreadsheetEditor:D,spreadsheetLocale:O,renderScrollBar:R}){const H=E.useRef(null),[Y,P]=E.useState(null),A=E.useCallback(mt=>{H.current=mt,P(mt)},[]),[$,z]=E.useState(0),I=E.useRef(null),[M,N]=E.useState(null),L=E.useRef(null),X=E.useId(),U=bx(),G=v??U,q=E.useMemo(()=>t3(s),[s]),K=E.useMemo(()=>e3(s),[s]),Z=E.useMemo(()=>r3(s),[s]),J=E.useRef(D);J.current=D;const dt=D!==void 0,ut=E.useMemo(()=>dt?{write:mt=>J.current?.write(mt)===!0,undo:()=>J.current?.undo(),redo:()=>J.current?.redo()}:void 0,[dt]);Rd(C);const yt=Mr.EMBED_PROVIDER_IDS.filter(mt=>C.providers.includes(mt)).join(" "),Et=C.linkCardEndpoint,It=C.linkCardSize,Mt=E.useMemo(()=>{const mt=yt.split(" "),Bt=Object.freeze(Mr.EMBED_PROVIDER_IDS.filter(me=>mt.includes(me)));return Object.freeze(It===void 0?{providers:Bt,linkCardEndpoint:Et}:{providers:Bt,linkCardEndpoint:Et,linkCardSize:It})},[yt,Et,It]),$t=s?.embeddedVideo,Xt=s?.embeddedPost,Pt=s?.embeddedFrame,se=E.useMemo(()=>s3({embeddedVideo:$t,embeddedPost:Xt,embeddedFrame:Pt}),[$t,Xt,Pt]),oe=E.useRef(T);E.useLayoutEffect(()=>{oe.current=T},[T]);const Gt=E.useCallback(mt=>{oe.current?.(mt)},[]),Jt=k===void 0?o3:{text:k,lang:void 0},Re=p3(H,I,M,c);if(!Di.CONTENT_ALIGNS.includes(c))throw new TypeError(`[@aiquants/markdown] align must be one of ${Di.CONTENT_ALIGNS.join(", ")}; got ${String(c)} (normalize it with toContentAlign)`);const ae=Number.isFinite(y)&&y>=0?y:16,_t=E.useCallback(mt=>{const Bt=H.current;if(Bt){const me=Bt.querySelector("[data-theme]"),le=Bt.getBoundingClientRect(),Pe=me?.children;let nr=-1,Rs=Number.POSITIVE_INFINITY;if(Pe)for(let Pi=0;Pi<Pe.length;Pi+=1){const va=Pe[Pi],Eh=Math.abs(va.getBoundingClientRect().top-le.top);Eh<Rs&&(Rs=Eh,nr=Pi)}if(Pe&&nr>=0){const va=Pe[nr].getBoundingClientRect();L.current={childIndex:nr,offset:va.top-le.top}}else L.current=null}n(mt)},[n]);E.useLayoutEffect(()=>{const mt=L.current;if(!mt)return;L.current=null;const Bt=H.current;if(!Bt)return;const le=Bt.querySelector("[data-theme]")?.children[mt.childIndex];if(!le)return;const Pe=Bt.getBoundingClientRect(),Rs=le.getBoundingClientRect().top-Pe.top;Bt.scrollTop+=Rs-mt.offset});const{isTocPinned:Ct,closeToc:pe}=G,it=E.useCallback((mt,Bt)=>{if(Ct||pe(),_?.(mt,Bt)===!0)return;Bt.preventDefault();const le=H.current?.querySelector(`#${CSS.escape(mt.id)}`)??document.getElementById(mt.id);le&&(y3(le),le.tabIndex<0&&!le.hasAttribute("tabindex")&&le.setAttribute("tabindex","-1"),le.scrollIntoView({behavior:m3()?"instant":"smooth",block:"start"}),le.focus({preventScroll:!0}))},[pe,Ct,_]),xt=E.useMemo(()=>l.find(Bt=>Bt.name===a)?.className??"markdown-body",[l,a]),Ot=e?.headings??[],ne=!(i||r),Ie=ne&&e!==null,$s=ne&&e===null&&t!==null,Oi=Ie&&d&&Ot.length>0,Ri=Ie&&f,Ii=(Ie||$s)&&u&&typeof h=="function"&&(p!==void 0||m!==void 0),Os=E.useMemo(()=>w.jsx(fx,{headings:Ot,className:"text-sm",labelledBy:X,onHeadingSelect:it,headingHref:B}),[Ot,X,it,B]),Ve=R===void 0?cl:`${$}px`,Q=E.useMemo(()=>Ve===cl?l3:Cx(Ve),[Ve]),gt=Oi||Ri||Ii?w.jsxs("div",{ref:N,"data-aqmd-toolbar":!0,style:Q,children:[w.jsx("span",{"data-aqmd-toolbar-inset-probe":!0,"aria-hidden":"true",style:h3}),Ii&&h&&w.jsx(en,{menu:"align",Icon:Td[c].Icon,buttonLabel:q.selectAlignAria,titleLabel:q.alignTitle,pinLabel:q.pinAlignAria,unpinLabel:q.unpinAlignAria,isOpen:G.isAlignOpen,isPinned:G.isAlignPinned,isFront:G.lastActiveMenu==="align",onActivate:G.activateAlign,onToggle:G.toggleAlign,onClose:G.closeAlign,onPinToggle:G.togglePinAlign,popoverClassName:"w-48 p-2",scrollBarClearance:Ve,boundary:Y,renderBody:mt=>w.jsx("div",{className:"space-y-1",children:Di.CONTENT_ALIGNS.map(Bt=>{const{labelKey:me,Icon:le}=Td[Bt],Pe=q[me],nr=c===Bt;return w.jsxs("button",{type:"button","aria-pressed":nr,lang:Pe.lang,className:`flex min-h-11 w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors ${nr?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{h(Bt),mt()},children:[w.jsx(le,{className:"h-4 w-4"}),Pe.text]},Bt)})})}),Ri&&w.jsx(en,{menu:"style",Icon:Y5,buttonLabel:q.selectStyleAria,titleLabel:q.styleTitle,pinLabel:q.pinStyleAria,unpinLabel:q.unpinStyleAria,isOpen:G.isStyleOpen,isPinned:G.isStylePinned,isFront:G.lastActiveMenu==="style",onActivate:G.activateStyle,onToggle:G.toggleStyle,onClose:G.closeStyle,onPinToggle:G.togglePinStyle,popoverClassName:"w-48 p-2",scrollBarClearance:Ve,boundary:Y,renderBody:mt=>w.jsx("div",{className:"space-y-1",children:l.map(Bt=>{const me=a===Bt.name;return w.jsx("button",{type:"button","aria-pressed":me,className:`min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${me?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{_t(Bt.name),mt()},children:Bt.name},Bt.name)})})}),Oi&&w.jsx(en,{menu:"toc",Icon:W5,buttonLabel:q.openTocAria,titleLabel:q.tocTitle,titleId:X,pinLabel:q.pinTocAria,unpinLabel:q.unpinTocAria,isOpen:G.isTocOpen,isPinned:G.isTocPinned,isFront:G.lastActiveMenu==="toc",onActivate:G.activateToc,onToggle:G.toggleToc,onClose:G.closeToc,onPinToggle:G.togglePinToc,popoverClassName:"markdown-viewer-scrollbar-thin w-64 p-4",scrollBarClearance:Ve,boundary:Y,renderBody:()=>Os})]}):null,kt=()=>i?w.jsxs("p",{children:[w.jsx("span",{"aria-hidden":"true",children:"🌀"})," ",w.jsx("span",{lang:q.loading.lang,children:q.loading.text})]}):r?w.jsx(C3,{error:r,labels:q}):e?w.jsx("div",{className:"relative w-full min-w-0",children:w.jsx(x3,{parseResult:e,theme:o,styleClassName:xt,iFrameAllowedDomains:x,embeds:Mt,embedLabels:se,linkComponent:S,missingImageLabel:q.missingImage.text,mermaidLabels:K,spreadsheetEditor:ut,spreadsheetLocale:O,spreadsheetLabels:Z,onMathDiagnostics:Gt})}):t!==null?w.jsx("pre",{className:"whitespace-pre-wrap break-all",children:t}):w.jsx("p",{lang:Jt.lang,children:Jt.text}),Ht={containerType:"inline-size",paddingInline:`${ae}px`,paddingBlockEnd:`${ae}px`,paddingBlockStart:`calc(${ae}px + var(${tn}))`,scrollPaddingBlockStart:`var(${tn})`,[tn]:`${Re}px`};return w.jsxs(Md,{scrollerRef:A,scrollerProps:{"data-testid":"viewer","data-aqmd-scroll-container":!0,className:"grid h-full w-full overflow-x-auto overflow-y-auto *:min-w-0",style:Ht},renderScrollBar:R,onBarInlineSizeChange:z,children:[gt,w.jsx("div",{ref:I,"data-aqmd-content":!0,style:{width:p??a3,maxWidth:m,marginInline:n3(c)},children:kt()})]})}const kx=({node:e})=>w.jsx("del",{children:w.jsx(zt,{nodes:e.children})}),wx=({node:e})=>w.jsx("em",{children:w.jsx(zt,{nodes:e.children})}),Sx=({node:e})=>w.jsx("sup",{children:w.jsxs("a",{id:`fnref-${e.identifier}`,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",href:`#fn-${e.identifier}`,children:["[",e.identifier,"]"]})}),k3=({nodes:e,theme:t="light"})=>e.length===0?null:w.jsx("section",{className:"border-[#171717] border-t pt-4 dark:border-[#464646]",children:w.jsx("ol",{className:"pl-6 text-[#686868] text-sm dark:text-[#a4a5a9]",children:e.map((r,i)=>w.jsx("li",{id:`fn-${r.identifier}`,className:i===0?"":"mt-4",children:w.jsx(zt,{nodes:r.children,theme:t})},`mdast-node-fn-${r.identifier}-${i}`))})}),vx=({node:e})=>w.jsx("a",{href:e.url,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",children:"↩"}),w3=e=>e.replace(/<rt\b[^>]*>[\s\S]*?<\/rt>/gi,"").replace(/<rp\b[^>]*>[\s\S]*?<\/rp>/gi,"").replace(/<[^>]+>/g,"").replace(/ /gi," ").replace(/&/gi,"&").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&#(\d+);/g,(s,o)=>{const a=Number(o);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/&#x([0-9a-f]+);/gi,(s,o)=>{const a=Number.parseInt(o,16);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/\s+/g," ").trim(),Tx=e=>{const t=r=>{if(!r||typeof r!="object")return"";if("type"in r&&r.type==="html"){const i=r.value;return typeof i=="string"?w3(i):""}if("value"in r){const i=r.value;if(typeof i=="string")return i}return"children"in r&&Array.isArray(r.children)?r.children.map(i=>t(i)).join(""):""};return e.map(r=>t(r)).join("").replace(/\s+/g," ").trim()},S3=e=>{switch(e){case 1:return"border-b-2 border-gray-300 pb-2 text-3xl font-bold dark:border-gray-600 dark:text-gray-100";case 2:return"border-b border-gray-300 pb-2 text-2xl font-semibold dark:border-gray-600 dark:text-gray-200";case 3:return"text-xl font-semibold dark:text-gray-300";default:return"text-lg font-medium dark:text-gray-400"}},_x=({node:e})=>{const t=new Gx,r=`h${e.depth}`,i=e.data?.hProperties?.id,s=t.slug(Tx(e.children));return w.jsx(r,{id:i||s,className:S3(e.depth),children:w.jsx(zt,{nodes:e.children})})},v3=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==!1).map(([t,r])=>[t,r===!0?"":String(r)])),T3=({node:e,theme:t,iFrameAllowedDomains:r=[]})=>{const i=w.jsx(zt,{nodes:e.children,theme:t,iFrameAllowedDomains:r}),s=fl(e.data.tagName,v3(e.data.properties),{parentName:null,iFrameAllowedDomains:r});if(s.action==="unwrap")return i;if(s.action!=="keep"&&s.action!=="placeholder")return null;const o=e.data.tagName.toLowerCase();return w.jsx(o,{...Tt.attributesToProps(s.attributes,e.data.tagName.toLowerCase()),children:i})},_3=/^\s*<(address|article|aside|blockquote|details|dialog|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h[1-6]|header|hgroup|hr|li|main|nav|ol|p|pre|section|table|ul)/i,B3=({node:e,iFrameAllowedDomains:t=[]})=>{const r=Tt(e.value,cx({iFrameAllowedDomains:t,embedLabels:Kx}));return Array.isArray(r)&&r.length===0?null:_3.test(e.value)?w.jsx("div",{children:r}):w.jsx("span",{children:r})},Bx=({node:e})=>{if(!e.url||e.url.trim()===""||!_s(e.url))return null;const t=e.title??"",r=e.data?.hProperties?.width,i=e.data?.hProperties?.height;return w.jsxs("span",{style:{width:r,height:i},className:"mt-4 mb-4 inline-block w-fit max-w-full",children:[w.jsx("img",{src:e.url,alt:e.alt??"",className:"mx-auto h-full w-full",width:r,height:i}),t&&w.jsx("em",{className:"block text-center text-gray-400 text-xs",children:t})]})},Lx=({node:e})=>w.jsx("code",{className:"rounded-md bg-gray-200 px-1.5 py-1 font-mono text-gray-800 text-sm dark:bg-gray-700 dark:text-gray-200",children:e.value}),L3=({node:e})=>{const t=ax(e.value,!1),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return t.kind==="rendered"?w.jsx("span",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):w.jsx("span",{className:r,children:t.message})},E3=new RegExp(`<(?:${[...Lh].join("|")})(?=[\\s/>])`,"i"),Ex=e=>e.some(t=>t.type==="image"||t.type==="imageReference"||t.type==="html"&&typeof t.value=="string"&&E3.test(t.value)||t.children!==void 0&&Ex(t.children)),Fx=({node:e})=>{const t=_s(e.url)?e.url:void 0,r=t!==void 0&&nx(t);return w.jsx("a",{className:lx(void 0,Ex(e.children)),href:t,target:r?"_blank":void 0,rel:r?"noreferrer":void 0,children:w.jsx(zt,{nodes:e.children})})},Ax=({node:e})=>e.children.length===1&&e.children[0].type==="paragraph"?w.jsx("li",{children:w.jsx(zt,{nodes:e.children[0].children})}):w.jsx("li",{children:w.jsx(zt,{nodes:e.children})}),Mx=({node:e})=>{const t=e.ordered?"ol":"ul";return w.jsx(t,{children:w.jsx(zt,{nodes:e.children})})},F3=({node:e})=>w.jsx("mark",{children:w.jsx(zt,{nodes:e.children})}),$x=({node:e})=>w.jsx("p",{children:w.jsx(zt,{nodes:e.children})}),Ox=({node:e})=>w.jsx("strong",{children:w.jsx(zt,{nodes:e.children})}),A3=({node:e})=>w.jsx("sub",{children:w.jsx(zt,{nodes:e.children})}),M3=({node:e})=>w.jsx("sup",{children:w.jsx(zt,{nodes:e.children})}),Bd=e=>{const t=e.data?.hProperties;return{merged:t?.merged??!1,colSpan:t?.colSpan,rowSpan:t?.rowSpan,textAlign:t?.textAlign}},Rx=({node:e})=>{const[t,...r]=e.children;return w.jsx("div",{className:"overflow-x-auto",children:w.jsxs("table",{className:"w-full border-collapse border-none",children:[w.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:w.jsx("tr",{children:t.children.map((i,s)=>{const{merged:o,colSpan:a,rowSpan:n,textAlign:l}=Bd(i);return o?null:w.jsx("th",{colSpan:a,rowSpan:n,style:{textAlign:l??e.align?.[s]??void 0},className:"border border-gray-300 px-4 py-2 text-left font-semibold dark:border-gray-600 dark:text-gray-200",children:w.jsx(zt,{nodes:i.children})},`mdast-table-node-${e.type}-${s}`)})})}),w.jsx("tbody",{children:r.map((i,s)=>w.jsx("tr",{className:"border-gray-200 border-t bg-white dark:border-gray-700 dark:bg-gray-900",children:i.children.map((o,a)=>{const{merged:n,colSpan:l,rowSpan:c,textAlign:h}=Bd(o);return n?null:w.jsx("td",{colSpan:l,rowSpan:c,style:{textAlign:h??e.align?.[a]??void 0},className:"border border-gray-300 px-4 py-2 dark:border-gray-600 dark:text-gray-300",children:w.jsx(zt,{nodes:o.children})},`mdast-table-node-${e.type}-${a}`)})},`mdast-table-node-${e.type}-${s}`))})]})})},Ix=({node:e})=>w.jsx(w.Fragment,{children:e.value}),Px=()=>w.jsx("hr",{className:"border-gray-300 dark:border-gray-600"}),Dx=({node:e})=>{const t=e.data?.title||"";return w.jsxs("details",{className:"markdown-details",children:[w.jsx("summary",{children:t}),w.jsx("div",{className:"markdown-details-content",children:w.jsx(zt,{nodes:e.children})})]})},Nx=({node:e})=>{const r=["message",e.data?.messageType||"message"].filter(Boolean).join(" ");return w.jsxs("aside",{className:r,children:[w.jsx("span",{className:"message-symbol",style:{userSelect:"none"},children:"!"}),w.jsx("div",{className:"message-content",children:w.jsx(zt,{nodes:e.children})})]})},zt=({nodes:e,theme:t="light",iFrameAllowedDomains:r=[]})=>e.map((i,s)=>{switch(i.type){case"blockquote":return w.jsx(qx,{node:i},`mdast-node-${i.type}-${s}`);case"break":return w.jsx("br",{},`mdast-node-${i.type}-${s}`);case"code":return w.jsx(Bh,{node:i,theme:t},`mdast-node-${i.type}-${s}`);case"delete":return w.jsx(kx,{node:i},`mdast-node-${i.type}-${s}`);case"details":return w.jsx(Dx,{node:i},`mdast-node-${i.type}-${s}`);case"emphasis":return w.jsx(wx,{node:i},`mdast-node-${i.type}-${s}`);case"footnoteReference":return w.jsx(Sx,{node:i},`mdast-node-${i.type}-${s}`);case"footnoteDefinition":return null;case"footnote-back-link":return w.jsx(vx,{node:i},`mdast-node-${i.type}-${s}`);case"heading":return w.jsx(_x,{node:i},`mdast-node-${i.type}-${s}`);case"html":return w.jsx(B3,{node:i,iFrameAllowedDomains:r},`mdast-node-${i.type}-${s}`);case"html-block-container":{const o=i,a=`mdast-node-${o.type}-${o.position?.start?.offset??"na"}-${o.position?.end?.offset??"na"}`;return w.jsx(T3,{node:o,theme:t,iFrameAllowedDomains:r},a)}case"image":return w.jsx(Bx,{node:i},`mdast-node-${i.type}-${s}`);case"inlineCode":return w.jsx(Lx,{node:i},`mdast-node-${i.type}-${s}`);case"inlineMath":return w.jsx(L3,{node:i},`mdast-node-${i.type}-${s}`);case"link":return w.jsx(Fx,{node:i},`mdast-node-${i.type}-${s}`);case"listItem":return w.jsx(Ax,{node:i},`mdast-node-${i.type}-${s}`);case"list":return w.jsx(Mx,{node:i},`mdast-node-${i.type}-${s}`);case"mark":return w.jsx(F3,{node:i},`mdast-node-${i.type}-${s}`);case"math":return w.jsx(r5,{node:i},`mdast-node-${i.type}-${s}`);case"message":return w.jsx(Nx,{node:i},`mdast-node-${i.type}-${s}`);case"paragraph":return w.jsx($x,{node:i},`mdast-node-${i.type}-${s}`);case"strong":return w.jsx(Ox,{node:i},`mdast-node-${i.type}-${s}`);case"subscript":return w.jsx(A3,{node:i},`mdast-node-${i.type}-${s}`);case"superscript":return w.jsx(M3,{node:i},`mdast-node-${i.type}-${s}`);case"table":return w.jsx(Rx,{node:i},`mdast-node-${i.type}-${s}`);case"text":return w.jsx(Ix,{node:i},`mdast-node-${i.type}-${s}`);case"thematicBreak":return w.jsx(Px,{},`mdast-node-${i.type}-${s}`);case"yaml":return null;default:{if(process.env.NODE_ENV==="development")return w.jsxs("div",{children:[w.jsxs("p",{style:{color:"red"},children:["Unknown node type: ",i.type]}),w.jsx("pre",{children:JSON.stringify(i,null,2)})]},`mdast-node-${i.type}-${s}`);throw new Error(`Unknown node type: ${i.type}`)}}}),qx=({node:e})=>w.jsx("blockquote",{className:"my-4 border-gray-300 border-l-4 bg-gray-50 p-4 italic dark:border-gray-500 dark:bg-gray-800 dark:text-gray-300",children:w.jsx(zt,{nodes:e.children})}),$3=/\s*\{#(.+?)\}\s*$/,O3=()=>e=>{xe.visit(e,"heading",t=>{if(t.children.length===0)return;const r=t.children[t.children.length-1];if(r?.type!=="text")return;const i=r,s=i.value.match($3);if(s){const o=s[1];t.data||(t.data={});const a=t.data,n=a.hProperties||{};n.id=o,a.hProperties=n,i.value=i.value.substring(0,s.index).trimEnd(),i.value===""&&t.children.pop()}})},R3=()=>e=>{xe.visit(e,"footnoteDefinition",t=>{xe.visit(t,"paragraph",r=>{r.children.push({type:"footnote-back-link",url:`#fnref-${t.identifier}`})})})},I3=()=>e=>{xe.visit(e,"html",(t,r,i)=>{if(typeof r!="number"||!i)return;const o=t.value.trim().match(/^<a\s+href="([^"]+)"[^>]*>(.*?)<\/a>$/i);if(o){const[,a,n]=o,l={type:"link",url:a,children:[{type:"text",value:n}]};i.children.splice(r,1,l)}})},P3=()=>e=>{const t=r=>{const i=r.children;if(!i)return;let s=0;for(;s<i.length;){const o=i[s];if(o.type==="html"&&o.value.startsWith("<")&&!o.value.startsWith("</")&&o.value.match(/<([a-zA-Z0-9]+)/)){let n="",l=0;const c=[];let h=!1;for(let d=s;d<i.length;d++){const f=i[d];if(f.type==="html"){n+=f.value;const u=f.value.match(/<\/?([a-zA-Z0-9]+)/g)||[];for(const p of u){const m=p.match(/<\/?([a-zA-Z0-9]+)/);if(!m)continue;const y=m[1];p.startsWith("</")?c.length>0&&c[c.length-1]===y&&c.pop():p.startsWith("<")&&c.push(y)}}else if(f.type==="text")n+=f.value;else{c.length===0&&(h=!0);break}if(l++,c.length===0){h=!0;break}}h&&i.splice(s,l,{type:"html",value:n})}s++}};xe.visit(e,"paragraph",t),xe.visit(e,"tableCell",t),xe.visit(e,"heading",t),xe.visit(e,"emphasis",t),xe.visit(e,"strong",t),xe.visit(e,"delete",t)},Ld=/\s*=\s*(\d+)(w|h|x|y)\s*/g,D3=()=>e=>{xe.visit(e,"image",t=>{const r=l=>{if(!l)return{updatedText:l,matches:[]};const c=[...l.matchAll(Ld)];return{updatedText:l.replaceAll(Ld,"").trim(),matches:c}},{updatedText:i,matches:s}=r(t.alt);t.alt=i;const{updatedText:o,matches:a}=r(t.title);t.title=o||null;const n=[...s,...a];if(n.length>0){t.data||(t.data={}),t.data.hProperties||(t.data.hProperties={});for(const l of n){const c=Number.parseInt(l[1],10),h=l[2];h==="w"||h==="x"?t.data.hProperties.width=c:(h==="h"||h==="y")&&(t.data.hProperties.height=c)}}})},N3=()=>e=>{xe.visit(e,(t,r,i)=>{i&&Object.defineProperty(t,"parent",{value:i,writable:!0,configurable:!0,enumerable:!1})})},Ed=/^:::(message|details)\s*(.*)/,q3=()=>e=>{function t(r){const i=[];let s=0;for(;s<r.length;){const o=r[s];if(o.type==="paragraph"&&o.children[0]?.type==="text"&&o.children[0].value.trim().startsWith(":::")){const l=o.children[0].value.trim().match(Ed);if(l){const c=s;let h=-1,d=1;const f=o.children.at(-1);if(o.children.length>1&&f?.type==="text"&&f.value.trim()===":::")h=c;else for(let u=c+1;u<r.length;u++){const p=r[u];if(p.type==="paragraph"&&p.children[0]?.type==="text"){const m=p.children[0].value.trim();Ed.test(m)?d++:m===":::"&&d--}if(d===0){h=u;break}}if(h!==-1){const u=l[1],p=l[2];let m;if(h===c){const C=o.children.slice(1,-1);C[0]?.type==="break"&&C.shift(),C.at(-1)?.type==="break"&&C.pop(),m=C.length>0?[{type:"paragraph",children:C}]:[]}else{const C=o.children.slice(1);C[0]?.type==="break"&&C.shift();const k={type:"paragraph",children:C},S=r[h].children.slice(0,-1);S.at(-1)?.type==="break"&&S.pop();const _={type:"paragraph",children:S},B=r.slice(c+1,h);m=[k,...B,_].filter(T=>!(T.type==="paragraph"&&T.children.length===0))}const y=t(m);let x;if(u==="message"?x={type:"message",data:{messageType:p.trim()},children:y}:u==="details"&&(x={type:"details",data:{title:p.trim()},children:y}),x){i.push(x),s=h+1;continue}}}}const a={...o};"children"in a&&Array.isArray(a.children)&&(a.type==="blockquote"||a.type==="footnoteDefinition"||a.type==="message"||a.type==="details"?a.children=t(a.children):a.type==="list"&&(a.children=a.children.map(n=>({...n,children:t(n.children)})))),i.push(a),s++}return i}e.children=t(e.children)},z3=e=>{const t=[];return xe.visit(e,"heading",r=>{const i=Tx(r.children),s=r.data?.hProperties?.id;s&&i&&t.push({depth:r.depth,text:i,id:s})}),t};exports.BlockquoteNode=qx;exports.CodeNode=Bh;exports.Color=Me;exports.Color$1=Ei;exports.DEFAULT_MARKDOWN_EMBED_LABELS=Zx;exports.DEFAULT_MARKDOWN_VIEWER_LABELS=J5;exports.DEFAULT_MERMAID_DIAGRAM_LABELS=RA;exports.DEFAULT_MERMAID_INTERACTION=K0;exports.DeleteNode=kx;exports.EmphasisNode=wx;exports.FootnoteBackLinkNode=vx;exports.FootnoteReferenceNode=Sx;exports.FootnotesSection=k3;exports.HeadingNode=_x;exports.HostedScrollArea=Md;exports.ImageNode=Bx;exports.InlineCodeNode=Lx;exports.JSON_SCHEMA=Kg;exports.LinkNode=Fx;exports.ListItemNode=Ax;exports.ListNode=Mx;exports.MarkdownRenderer=ux;exports.MarkdownViewer=b3;exports.MermaidDiagram=Th;exports.NodesRenderer=zt;exports.ParagraphNode=$x;exports.Rgb=he;exports.SPREADSHEET_BLOCK_LABEL_CATALOGS=Ts;exports.SpreadsheetBlock=_h;exports.StrongNode=Ox;exports.TableNode=Rx;exports.TableOfContents=fx;exports.TextNode=Ix;exports.ThematicBreakNode=Px;exports.Utils=ft;exports.ZERO_WIDTH_SPACE=bp;exports.ZennDetailsNode=Dx;exports.ZennMessageNode=Nx;exports.__export=jd;exports.__name=g;exports.abs=eS;exports.acos=hS;exports.adjustChannel=ml;exports.argumentsTag=Zl;exports.array=Hu;exports.arrayBufferTag=np;exports.arrayTag=ap;exports.asin=cS;exports.assignWithDepth_default=qt;exports.at=rt;exports.atan2=rS;exports.booleanTag=Vl;exports.calculateMathMLDimensions=Bk;exports.calculateTextDimensions=ca;exports.calculateTextHeight=ih;exports.calculateTextWidth=He;exports.cleanAndMerge=da;exports.clear=lu;exports.clear$1=sB;exports.clear$2=A_;exports.clear2=Q_;exports.color=bi;exports.commonDb_exports=kl;exports.common_default=Li;exports.computeDimensionOfText=sm;exports.computeLabelTransform=Xr;exports.configureLabelImages=oh;exports.configureSvgSize=bl;exports.constant=Sr;exports.constant$1=ta;exports.cos=iS;exports.createText=Oe;exports.curveBasis=Bo;exports.darken=W;exports.dataViewTag=hp;exports.dateTag=ip;exports.dayjs2=Wd;exports.decodeEntities=pr;exports.defaultConfig2=Ik;exports.defaultConfig_default=yl;exports.define=Jo;exports.distExports=Jg;exports.edgeLabels=ws;exports.epsilon=Sn;exports.extend=El;exports.extractHeadings=z3;exports.float32ArrayTag=yp;exports.float64ArrayTag=xp;exports.generateId=_p;exports.getAccDescription=uu;exports.getAccTitle=cu;exports.getConfig=At;exports.getConfig2=wt;exports.getDefaultExportFromCjs=Ad;exports.getDiagramTitle=gu;exports.getEdgeId=rT;exports.getEffectiveHtmlLabels=re;exports.getIconSVG=Ai;exports.getLineFunctionsWithOffset=Iy;exports.getRegisteredLayoutAlgorithm=PB;exports.getStylesFromArray=rh;exports.getSubGraphTitleMargins=ua;exports.getTag=la;exports.getThemeVariables3=Yd;exports.getUrl=au;exports.getUserDefinedConfig=gk;exports.halfPi=vn;exports.hasKatex=xi;exports.hue=M2;exports.insertCluster=pm;exports.insertEdge=qy;exports.insertEdgeLabel=Py;exports.insertNode=bh;exports.int16ArrayTag=pp;exports.int32ArrayTag=mp;exports.int8ArrayTag=gp;exports.interpolateNumber=tr;exports.interpolateRgb=pn;exports.interpolateString=Mu;exports.isDark=Te;exports.isLabelStyle=Ul;exports.isPrimitive=ha;exports.isTypedArray=hs;exports.isValidShape=Ry;exports.lighten=j;exports.line=Uu;exports.lineBreakRegex=Bi;exports.load=Qg;exports.log=V;exports.mapTag=sp;exports.markerOffsets=Qt;exports.markers_default=Wy;exports.max=sS;exports.min=oS;exports.nogamma=Fl;exports.numberTag=Gl;exports.objectTag=lp;exports.parseFontSize=Fs;exports.parseGenericTypes=ln;exports.pi=ia;exports.positionEdgeLabel=Dy;exports.positionNode=J_;exports.random=Lp;exports.regexpTag=ep;exports.registerIconPacks=Op;exports.remarkCustomHeadingId=O3;exports.remarkFootnoteBackLink=R3;exports.remarkHtmlAnchorToLink=I3;exports.remarkHtmlInHtml=P3;exports.remarkImageSize=D3;exports.remarkParentNode=N3;exports.remarkZennMessage=q3;exports.render=IB;exports.renderKatexSanitized=Cl;exports.rgbConvert=Eu;exports.rgba=er;exports.sanitizeText=Se;exports.select=pt;exports.selectSvgElement=pf;exports.setAccDescription=du;exports.setAccTitle=hu;exports.setConfig2=Rk;exports.setDiagramTitle=fu;exports.setNodeElem=K_;exports.setTag=op;exports.setupGraphViewbox=nu;exports.setupGraphViewbox2=pu;exports.sin=aS;exports.sqrt=nS;exports.stringTag=Xl;exports.styles2String=st;exports.symbolTag=rp;exports.tau=lS;exports.terminalLabels=Yt;exports.uint16ArrayTag=up;exports.uint32ArrayTag=fp;exports.uint8ArrayTag=cp;exports.uint8ClampedArrayTag=dp;exports.unknownIcon=Mp;exports.updateNodeBounds=ot;exports.useMarkdownToolbarState=bx;exports.utils_default=we;exports.withPath=Wu;exports.wrapLabel=Ep;
|