@aiquants/markdown 11.1.1 → 11.2.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 +15 -8
- package/dist/{abnfDiagram-VRR7QNED-B9EKZZCe.js → abnfDiagram-VRR7QNED-BKDymcgU.js} +3 -3
- package/dist/{abnfDiagram-VRR7QNED-BUUUWvsh.cjs → abnfDiagram-VRR7QNED-BrysG8di.cjs} +1 -1
- package/dist/{arc-BdyZzyRm.cjs → arc-BB8-GmvF.cjs} +1 -1
- package/dist/{arc-BWBxoAtH.js → arc-HSlzHLN5.js} +1 -1
- package/dist/{architectureDiagram-ZJ3FMSHR-C82P-Or8.js → architectureDiagram-ZJ3FMSHR-Cw5TsOQY.js} +2 -2
- package/dist/{architectureDiagram-ZJ3FMSHR-C-j7rcTN.cjs → architectureDiagram-ZJ3FMSHR-DUr8yu65.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-B28l1266.cjs → blockDiagram-677ZJIJ3-3fEMZifU.cjs} +1 -1
- package/dist/{blockDiagram-677ZJIJ3-DQwdwRWd.js → blockDiagram-677ZJIJ3-B4QKTXoS.js} +3 -3
- package/dist/{c4Diagram-LMCZKHZV-BKS-5aGN.js → c4Diagram-LMCZKHZV-BF-7sSPW.js} +2 -2
- package/dist/{c4Diagram-LMCZKHZV-BHj3qRWp.cjs → c4Diagram-LMCZKHZV-Cr3HwHd7.cjs} +1 -1
- package/dist/{channel-CItIM75V.js → channel-0qa8ce6Q.js} +1 -1
- package/dist/{channel-C_cP5iR1.cjs → channel-CHciNRIB.cjs} +1 -1
- package/dist/{chunk-2Q5K7J3B-B0pXO2t7.cjs → chunk-2Q5K7J3B-3IUhxfJe.cjs} +1 -1
- package/dist/{chunk-2Q5K7J3B-D52R-aDh.js → chunk-2Q5K7J3B-BhPb31Ds.js} +1 -1
- package/dist/{chunk-32BRIVSS-DUlLCGoQ.js → chunk-32BRIVSS-BGg_X4L2.js} +1 -1
- package/dist/{chunk-32BRIVSS-e82Hm1LK.cjs → chunk-32BRIVSS-D5djvojF.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-DmYNlEib.cjs → chunk-5VM5RSS4-BZ3BilMv.cjs} +1 -1
- package/dist/{chunk-5VM5RSS4-WjZ3Kfp-.js → chunk-5VM5RSS4-BiHk_ZMt.js} +1 -1
- package/dist/{chunk-EX3LRPZG-VOMDBd7V.cjs → chunk-EX3LRPZG-C-ow5sUu.cjs} +1 -1
- package/dist/{chunk-EX3LRPZG-CZeIl-CM.js → chunk-EX3LRPZG-C5kdwLBO.js} +4 -4
- package/dist/{chunk-JWPE2WC7-XtdP0lPA.js → chunk-JWPE2WC7-DdePg2tx.js} +1 -1
- package/dist/{chunk-JWPE2WC7-DqZGyZxO.cjs → chunk-JWPE2WC7-e5NtU9tE.cjs} +1 -1
- package/dist/{chunk-MOJQB5TN-C-I6Np3F.cjs → chunk-MOJQB5TN-BLSnD3t7.cjs} +1 -1
- package/dist/{chunk-MOJQB5TN-BGmMcnEb.js → chunk-MOJQB5TN-Dbd1TEnx.js} +1 -1
- package/dist/{chunk-PUDLZKDR-CVDCE8CQ.js → chunk-PUDLZKDR-BsiVpD8V.js} +6 -6
- package/dist/{chunk-PUDLZKDR-BU0xXgGZ.cjs → chunk-PUDLZKDR-hGJNph5n.cjs} +1 -1
- package/dist/{chunk-RYQCIY6F-CazlBHVq.js → chunk-RYQCIY6F-BUXnC2bE.js} +1 -1
- package/dist/{chunk-RYQCIY6F-CzgqsQUG.cjs → chunk-RYQCIY6F-DX34sli0.cjs} +1 -1
- package/dist/{chunk-V7JOEXUC-DjZLR1xm.js → chunk-V7JOEXUC-BQueT2fh.js} +5 -5
- package/dist/{chunk-V7JOEXUC-BHcjsh4X.cjs → chunk-V7JOEXUC-CWk-EdL4.cjs} +1 -1
- package/dist/{chunk-VR4S4FIN-DKCdFxYZ.cjs → chunk-VR4S4FIN-6fMMVlwy.cjs} +1 -1
- package/dist/{chunk-VR4S4FIN-BdHVIRqw.js → chunk-VR4S4FIN-DI4PTMge.js} +1 -1
- package/dist/{chunk-XXDRQBXY-Z_rLeBGt.js → chunk-XXDRQBXY-0FVYkVuP.js} +1 -1
- package/dist/{chunk-XXDRQBXY-DqQWFq5n.cjs → chunk-XXDRQBXY-DcL_rCNu.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-HX7id7VH.cjs → classDiagram-OUVF2IWQ-CEZdsWvZ.cjs} +1 -1
- package/dist/{classDiagram-v2-EOCWNBFH-x_3zaG1u.js → classDiagram-OUVF2IWQ-DRGfIZdE.js} +2 -2
- package/dist/{classDiagram-v2-EOCWNBFH-HX7id7VH.cjs → classDiagram-v2-EOCWNBFH-CEZdsWvZ.cjs} +1 -1
- package/dist/{classDiagram-OUVF2IWQ-x_3zaG1u.js → classDiagram-v2-EOCWNBFH-DRGfIZdE.js} +2 -2
- package/dist/converter.wasm +0 -0
- package/dist/{cose-bilkent-JH36ORCC-Cyz8e4tp.js → cose-bilkent-JH36ORCC-3kBRwN8L.js} +1 -1
- package/dist/{cose-bilkent-JH36ORCC-CWD_TQFn.cjs → cose-bilkent-JH36ORCC-DjBFwUgZ.cjs} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-DEFr3c5a.cjs → cynefinDiagram-TSTJHNR4-CHqP9wNf.cjs} +1 -1
- package/dist/{cynefinDiagram-TSTJHNR4-uBcUSDG3.js → cynefinDiagram-TSTJHNR4-COFBfMTD.js} +2 -2
- package/dist/{dagre-VKFMJZFB-Bbd2N7Iu.js → dagre-VKFMJZFB-BiBZp1UZ.js} +2 -2
- package/dist/{dagre-VKFMJZFB-DByE8-C9.cjs → dagre-VKFMJZFB-CfOPJOfT.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-DPEX0cuZ.cjs → diagram-FQU43EPY-BWf-0ZaX.cjs} +1 -1
- package/dist/{diagram-FQU43EPY-CgQwvhUg.js → diagram-FQU43EPY-DE88GkFP.js} +2 -2
- package/dist/{diagram-G47NLZAW-BZsnXoS1.js → diagram-G47NLZAW-AGqBg4BW.js} +3 -3
- package/dist/{diagram-G47NLZAW-50nFSHRv.cjs → diagram-G47NLZAW-BmGTMih1.cjs} +1 -1
- package/dist/{diagram-NH7WQ7WH-eHSJPLfa.js → diagram-NH7WQ7WH-C_OQJCoz.js} +2 -2
- package/dist/{diagram-NH7WQ7WH-TShr7BQh.cjs → diagram-NH7WQ7WH-avUTm6At.cjs} +1 -1
- package/dist/{diagram-OA4YK3LP-Dphe8PdD.js → diagram-OA4YK3LP-BcG8oYQH.js} +3 -3
- package/dist/{diagram-OA4YK3LP-r5leQ0jD.cjs → diagram-OA4YK3LP-v4R9pnOp.cjs} +1 -1
- package/dist/{diagram-WEI45ONY-pgeZBaVl.js → diagram-WEI45ONY-B3f9-St7.js} +2 -2
- package/dist/{diagram-WEI45ONY-BaT3chSs.cjs → diagram-WEI45ONY-DMANh2pW.cjs} +1 -1
- package/dist/{ebnfDiagram-CCIWWBDH-Hf655Cjt.js → ebnfDiagram-CCIWWBDH-DHMH95Qm.js} +3 -3
- package/dist/{ebnfDiagram-CCIWWBDH-D3EvTRKP.cjs → ebnfDiagram-CCIWWBDH-DViSMuU5.cjs} +1 -1
- package/dist/{erDiagram-Q63AITRT-YkVu4ce1.js → erDiagram-Q63AITRT-DrY-YSX7.js} +4 -4
- package/dist/{erDiagram-Q63AITRT-fnT4vBqH.cjs → erDiagram-Q63AITRT-HV9x1ciI.cjs} +1 -1
- package/dist/{extractHeadings-B8u8yqfC.js → extractHeadings-Boz4pTVy.js} +3542 -3513
- package/dist/{extractHeadings-DLNXUqAG.cjs → extractHeadings-UK9m7d29.cjs} +49 -49
- package/dist/flowDiagram-23GEKE2U-Cw3lE3iu.cjs +1 -0
- package/dist/flowDiagram-23GEKE2U-DeQftLq7.js +7 -0
- package/dist/{ganttDiagram-NO4QXBWP-D-SkIoPg.js → ganttDiagram-NO4QXBWP-BrcUlnJH.js} +2 -2
- package/dist/{ganttDiagram-NO4QXBWP-DC3d7PwO.cjs → ganttDiagram-NO4QXBWP-XbcZyqEG.cjs} +1 -1
- package/dist/{gitGraphDiagram-IHSO6WYX-DFUHvrlM.cjs → gitGraphDiagram-IHSO6WYX-DDgZkg3G.cjs} +1 -1
- package/dist/{gitGraphDiagram-IHSO6WYX-CjYttPlh.js → gitGraphDiagram-IHSO6WYX-Dqk3F0Su.js} +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.client.cjs +1 -1
- package/dist/index.client.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-CM_qocjy.cjs → infoDiagram-FWYZ7A6U-DM1S6-Hc.cjs} +1 -1
- package/dist/{infoDiagram-FWYZ7A6U-DpELmEdt.js → infoDiagram-FWYZ7A6U-a32XjwX5.js} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-uPR_QB-P.cjs → ishikawaDiagram-FXEZZL3T-CHzSqzMH.cjs} +1 -1
- package/dist/{ishikawaDiagram-FXEZZL3T-doZ6ry1Q.js → ishikawaDiagram-FXEZZL3T-DWsA1PP7.js} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-DKxRZGZY.cjs → journeyDiagram-5HDEW3XC-Cis5Fa71.cjs} +1 -1
- package/dist/{journeyDiagram-5HDEW3XC-B3Gvqmgz.js → journeyDiagram-5HDEW3XC-CkVTUCEp.js} +4 -4
- package/dist/{kanban-definition-HUTT4EX6-XEl_CQHs.js → kanban-definition-HUTT4EX6-B30ORUDT.js} +2 -2
- package/dist/{kanban-definition-HUTT4EX6-CmEtZdgP.cjs → kanban-definition-HUTT4EX6-DcANcb4G.cjs} +1 -1
- package/dist/{linear-BJeuATkk.cjs → linear-CAd-44F2.cjs} +1 -1
- package/dist/{linear-CJwjH-8_.js → linear-uw6vQWir.js} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-B9zpExvk.cjs → mindmap-definition-LN4V7U3C-CP0bNnn-.cjs} +1 -1
- package/dist/{mindmap-definition-LN4V7U3C-Cd2v2Y8Z.js → mindmap-definition-LN4V7U3C-D-yIE9Kv.js} +3 -3
- package/dist/{pegDiagram-2B236MQR-DFYHpIqe.js → pegDiagram-2B236MQR-BOdy4HUA.js} +3 -3
- package/dist/{pegDiagram-2B236MQR-DWCHB7kd.cjs → pegDiagram-2B236MQR-Brh5cxKw.cjs} +1 -1
- package/dist/{pieDiagram-ENE6RG2P-CD581vqD.js → pieDiagram-ENE6RG2P-1cY-R9MG.js} +3 -3
- package/dist/{pieDiagram-ENE6RG2P-LLQzK8bv.cjs → pieDiagram-ENE6RG2P-CEaHvWUM.cjs} +1 -1
- package/dist/{quadrantDiagram-ABIIQ3AL-DjC_l1Fw.cjs → quadrantDiagram-ABIIQ3AL-C5CTuaUm.cjs} +1 -1
- package/dist/{quadrantDiagram-ABIIQ3AL-BhzJSnax.js → quadrantDiagram-ABIIQ3AL-CbZZ5GEh.js} +2 -2
- package/dist/{railroadDiagram-RFXS5EU6-C1tKXwxN.cjs → railroadDiagram-RFXS5EU6-C6-tc-QZ.cjs} +1 -1
- package/dist/{railroadDiagram-RFXS5EU6-DmVOfohB.js → railroadDiagram-RFXS5EU6-DThY6dTL.js} +3 -3
- package/dist/{requirementDiagram-TGXJPOKE-DDpRa8G1.js → requirementDiagram-TGXJPOKE-BwtXYJtb.js} +3 -3
- package/dist/{requirementDiagram-TGXJPOKE-DkGh_vLW.cjs → requirementDiagram-TGXJPOKE-h_ZfNqUh.cjs} +1 -1
- package/dist/{sankeyDiagram-HTMAVEWB-CkCLaKDd.cjs → sankeyDiagram-HTMAVEWB-DalNC8XY.cjs} +1 -1
- package/dist/{sankeyDiagram-HTMAVEWB-3UuuubkA.js → sankeyDiagram-HTMAVEWB-DkwdXFCH.js} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-DcWj7JMz.cjs → sequenceDiagram-DBY2YBRQ-BE2rVf2w.cjs} +1 -1
- package/dist/{sequenceDiagram-DBY2YBRQ-CRC__bVC.js → sequenceDiagram-DBY2YBRQ-CZHBSmBp.js} +3 -3
- package/dist/{sizeCapture-X5ZJPWSS-Wb9vgGKU.cjs → sizeCapture-X5ZJPWSS-CiSkHK1v.cjs} +1 -1
- package/dist/{sizeCapture-X5ZJPWSS-DuxhTDeu.js → sizeCapture-X5ZJPWSS-o-wx7oGH.js} +1 -1
- package/dist/{stateDiagram-2N3HPSRC-DGfmIJEN.js → stateDiagram-2N3HPSRC-C2yZajhM.js} +2 -2
- package/dist/{stateDiagram-2N3HPSRC-CMBwcQE6.cjs → stateDiagram-2N3HPSRC-Cts12p59.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-7UPtJqUO.cjs → stateDiagram-v2-6OUMAXLB-B8p1-c97.cjs} +1 -1
- package/dist/{stateDiagram-v2-6OUMAXLB-ZyMZ4vTG.js → stateDiagram-v2-6OUMAXLB-VE-c3q_l.js} +2 -2
- package/dist/styles/markdown.standalone.css +1 -1
- package/dist/{swimlanes-5IMT3BWC-CZzTj7hi.cjs → swimlanes-5IMT3BWC-DeNuvXGa.cjs} +1 -1
- package/dist/{swimlanes-5IMT3BWC-CpPHvYma.js → swimlanes-5IMT3BWC-TTTBHYYv.js} +3 -3
- package/dist/{swimlanesDiagram-G3AALYLV-ISXX19Uv.js → swimlanesDiagram-G3AALYLV-Buup5yvb.js} +2 -2
- package/dist/{swimlanesDiagram-G3AALYLV-By4sYWRa.cjs → swimlanesDiagram-G3AALYLV-Bxz106Lt.cjs} +1 -1
- package/dist/{timeline-definition-FHXFAJF6-YNTe1gIW.js → timeline-definition-FHXFAJF6-C_zjmLAX.js} +2 -2
- package/dist/{timeline-definition-FHXFAJF6-CLuuXV7h.cjs → timeline-definition-FHXFAJF6-c15QQTDf.cjs} +1 -1
- package/dist/{vennDiagram-L72KCM5P-DFt6CSPi.cjs → vennDiagram-L72KCM5P-CjX3W2Ne.cjs} +1 -1
- package/dist/{vennDiagram-L72KCM5P-B2jRtjMe.js → vennDiagram-L72KCM5P-DNLnBVJ_.js} +1 -1
- package/dist/{wardleyDiagram-EHGQE667-ZOmJLYv5.js → wardleyDiagram-EHGQE667-CjE65uje.js} +2 -2
- package/dist/{wardleyDiagram-EHGQE667-B1RAAbXU.cjs → wardleyDiagram-EHGQE667-UlY3HJxP.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-D1mJfFkC.cjs → xychartDiagram-FW5EYKEG-DDVfULUl.cjs} +1 -1
- package/dist/{xychartDiagram-FW5EYKEG-JwURYtLn.js → xychartDiagram-FW5EYKEG-DziQHnEA.js} +2 -2
- package/package.json +7 -7
- package/dist/flowDiagram-23GEKE2U-B5AFLHup.js +0 -7
- package/dist/flowDiagram-23GEKE2U-BaQLONgC.cjs +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var cC=Object.create;var jh=Object.defineProperty;var dC=Object.getOwnPropertyDescriptor;var uC=Object.getOwnPropertyNames;var fC=Object.getPrototypeOf,pC=Object.prototype.hasOwnProperty;var gC=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of uC(t))!pC.call(e,o)&&o!==r&&jh(e,o,{get:()=>t[o],enumerable:!(i=dC(t,o))||i.enumerable});return e};var Wh=(e,t,r)=>(r=e!=null?cC(fC(e)):{},gC(t||!e||!e.__esModule?jh(r,"default",{value:e,enumerable:!0}):r,e));const L=require("react"),Ne=require("./linkCards-Bjd_vW39.cjs"),Rr=require("./providers-DO2t7ks4.cjs"),Yi=require("./viewer-settings.cjs"),wt=require("html-react-parser"),It=require("./code-blocks-Bax5Xik7.cjs"),cr=require("./embeds.cjs"),vi=require("./source-lines.cjs"),un=require("./simple-logger-9yf7ypyB.cjs"),fn=require("shiki"),Ti=require("dompurify"),oe=require("@aiquants/spreadsheet/view"),Zs=require("@aiquants/spreadsheet/tsv"),mC=require("github-slugger"),yC=require("katex"),fe=require("unist-util-visit"),_i=(e,t)=>{const r={};for(const i of Object.keys(e)){const o=t?.[i];if(o===void 0){r[i]=e[i];continue}if(typeof o!="string")throw new TypeError(`[@aiquants/markdown] label "${i}" must be a string; got ${o===null?"null":typeof o}`);r[i]={text:o,lang:void 0}}return Object.freeze(r)},Qs=e=>{const t={};for(const r of Object.keys(e))t[r]=e[r].text;return Object.freeze(t)},Js=Object.freeze({embeddedVideo:{text:"embedded video",lang:"en"},embeddedPost:{text:"embedded post",lang:"en"},embeddedFrame:{text:"Embedded content",lang:"en"}}),xC=Qs(Js),Kd=e=>_i(Js,e),CC=Kd(void 0);function Zd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qo={exports:{}},Ui={};var Hh;function bC(){if(Hh)return Ui;Hh=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var n in o)n!=="key"&&(s[n]=o[n])}else s=o;return o=s.ref,{$$typeof:e,type:i,key:a,ref:o!==void 0?o:null,props:s}}return Ui.Fragment=t,Ui.jsx=r,Ui.jsxs=r,Ui}var Xi={};var Yh;function kC(){return Yh||(Yh=1,process.env.NODE_ENV!=="production"&&(function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===D?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case y:return"Fragment";case C:return"Profiler";case x:return"StrictMode";case _:return"Suspense";case E:return"SuspenseList";case M:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case m:return"Portal";case S:return T.displayName||"Context";case k:return(T._context.displayName||"Context")+".Consumer";case v:var W=T.render;return T=T.displayName,T||(T=W.displayName||W.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case B:return W=T.displayName||null,W!==null?W:e(T.type)||"Memo";case I:W=T._payload,T=T._init;try{return e(T(W))}catch{}}return null}function t(T){return""+T}function r(T){try{t(T);var W=!1}catch{W=!0}if(W){W=console;var z=W.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return z.call(W,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),t(T)}}function i(T){if(T===y)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===I)return"<...>";try{var W=e(T);return W?"<"+W+">":"<...>"}catch{return"<...>"}}function o(){var T=U.A;return T===null?null:T.getOwner()}function s(){return Error("react-stack-top-frame")}function a(T){if(q.call(T,"key")){var W=Object.getOwnPropertyDescriptor(T,"key").get;if(W&&W.isReactWarning)return!1}return T.key!==void 0}function n(T,W){function z(){F||(F=!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)",W))}z.isReactWarning=!0,Object.defineProperty(T,"key",{get:z,configurable:!0})}function l(){var T=e(this.type);return P[T]||(P[T]=!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.")),T=this.props.ref,T!==void 0?T:null}function c(T,W,z,G,X,K){var Q=z.ref;return T={$$typeof:p,type:T,key:W,props:z,_owner:G},(Q!==void 0?Q:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:l}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function h(T,W,z,G,X,K){var Q=W.children;if(Q!==void 0)if(G)if(N(Q)){for(G=0;G<Q.length;G++)d(Q[G]);Object.freeze&&Object.freeze(Q)}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(Q);if(q.call(W,"key")){Q=e(T);var nt=Object.keys(W).filter(function(ut){return ut!=="key"});G=0<nt.length?"{key: someKey, "+nt.join(": ..., ")+": ...}":"{key: someKey}",j[Q+G]||(nt=0<nt.length?"{"+nt.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,G,Q,nt,Q),j[Q+G]=!0)}if(Q=null,z!==void 0&&(r(z),Q=""+z),a(U)&&(r(U.key),Q=""+U.key),"key"in U){z={};for(var gt in U)gt!=="key"&&(z[gt]=U[gt])}else z=U;return Q&&n(z,typeof T=="function"?T.displayName||T.name||"Unknown":T),c(T,Q,z,o(),X,K)}function d(T){u(T)?T._store&&(T._store.validated=1):typeof T=="object"&&T!==null&&T.$$typeof===O&&(T._payload.status==="fulfilled"?u(T._payload.value)&&T._payload.value._store&&(T._payload.value._store.validated=1):T._store&&(T._store.validated=1))}function u(T){return typeof T=="object"&&T!==null&&T.$$typeof===p}var f=L,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"),S=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),W=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=Object.prototype.hasOwnProperty,N=Array.isArray,F=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(T){return T()}};var $,q={},P=f.react_stack_bottom_frame.bind(f,s)(),I=F(i(s)),j={};Xi.Fragment=y,Xi.jsx=function(T,U,z){var G=1e4>W.recentlyCreatedOwnerStacks++;return h(T,U,z,!1,G?Error("react-stack-top-frame"):P,G?F(i(T)):I)},Xi.jsxs=function(T,U,z){var G=1e4>W.recentlyCreatedOwnerStacks++;return h(T,U,z,!0,G?Error("react-stack-top-frame"):P,G?F(i(T)):I)}})()),Xi}var Uh;function kC(){return Uh||(Uh=1,process.env.NODE_ENV==="production"?qo.exports=CC():qo.exports=bC()),qo.exports}var w=kC();const Xh=Object.freeze({display:"flex",flexDirection:"row",inlineSize:"100%",blockSize:"100%",minInlineSize:0,minBlockSize:0}),wC=Object.freeze({flex:"1 1 0%",minInlineSize:0,minBlockSize:0,overflow:"clip"}),SC=Object.freeze({display:"flex",flex:"none",minBlockSize:0}),vC=Object.freeze({position:"absolute",insetBlock:0,insetInline:0,overflowY:"scroll",visibility:"hidden",pointerEvents:"none"}),TC=Object.freeze({scrollbarWidth:"none"}),_C=.01,Gh=Object.freeze({scroller:null,barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1}),Fa=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},BC=(e,t,r)=>{const i=getComputedStyle(e),o=Fa(i.width),s=e.getBoundingClientRect();if(o<=0||s.width<=0)return{barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1};const a=s.width/o,n=(s.width-t.getBoundingClientRect().width)/a-Fa(i.borderLeftWidth)-Fa(i.borderRightWidth),l=Math.max(0,Math.ceil(n-_C));return{barInlineSize:r.getBoundingClientRect().width/a,nativeBarInlineSize:l,overlaysScrollbars:l===0&&t.offsetWidth>0&&t.offsetWidth===t.clientWidth}},LC=(e,t,r,i,o)=>{const[s,a]=L.useState(Gh),n=L.useRef(o),l=L.useRef(0);return L.useLayoutEffect(()=>{n.current=o}),L.useLayoutEffect(()=>{const c=m=>{l.current!==m&&(l.current=m,n.current?.(m))},h=t.current,d=r.current,u=i.current;if(!e||h===null||d===null||u===null){a(Gh),c(0);return}const f=()=>{const{barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x}=BC(h,d,u);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)};f();const p=new ResizeObserver(f);return p.observe(h),p.observe(d),p.observe(u),window.addEventListener("resize",f),()=>{p.disconnect(),window.removeEventListener("resize",f)}},[e,t,r,i]),s},EC=(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 Zd({scrollerProps:e,scrollerRef:t,children:r,renderScrollBar:i,rowClassName:o,rowStyle:s,onBarInlineSizeChange:a}){const n=L.useRef(null),l=L.useRef(null),c=L.useRef(null),h=i!==void 0,d=LC(h,n,l,c,a),u=L.useCallback(m=>{n.current=m;const y=EC(t,m);return()=>{n.current=null,y()}},[t]),f=h?{...e.style,position:"relative",boxSizing:"border-box",overflowY:"scroll",width:`calc(100% + ${d.nativeBarInlineSize}px)`,...d.overlaysScrollbars?TC:void 0}:e.style,p=w.jsxs("div",{...e,ref:u,style:f,children:[r,h&&w.jsx("span",{ref:l,"data-aqmd-scroll-bar-probe":!0,"aria-hidden":"true",style:vC})]});return h?w.jsxs("div",{"data-aqmd-scroll-row":!0,className:o,style:s===void 0?Xh:{...Xh,...s},children:[w.jsx("div",{"data-aqmd-scroll-clip":!0,style:wC,children:p}),w.jsx("div",{ref:c,"data-aqmd-scroll-bar":!0,style:SC,children:d.scroller!==null&&i(d.scroller)})]}):p}const FC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),AC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),Vh=e=>{const t=AC(e);return t.charAt(0).toUpperCase()+t.slice(1)},Qd=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim(),MC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var $C={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 OC=L.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:a,...n},l)=>L.createElement("svg",{ref:l,...$C,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:Qd("lucide",o),...!s&&!MC(n)&&{"aria-hidden":"true"},...n},[...a.map(([c,h])=>L.createElement(c,h)),...Array.isArray(s)?s:[s]]));const Tt=(e,t)=>{const r=L.forwardRef(({className:i,...o},s)=>L.createElement(OC,{ref:s,iconNode:t,className:Qd(`lucide-${FC(Vh(e))}`,`lucide-${e}`,i),...o}));return r.displayName=Vh(e),r};const RC=[["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"}]],IC=Tt("image-off",RC);class PC extends L.Component{constructor(t){super(t),this.state={content:t.content,failed:!1}}static getDerivedStateFromProps(t,r){return t.content===r.content?null:{content:t.content,failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?w.jsxs("div",{"data-aqmd-block-failure":"",children:[w.jsx("p",{"data-aqmd-block-failure-notice":"",lang:this.props.label.lang,children:this.props.label.text}),w.jsx("pre",{"data-aqmd-block-failure-text":"",children:this.props.text()})]}):this.props.children}}const Jd=Object.freeze({blockFailed:{text:"This block could not be shown.",lang:"en"}}),DC=1024,Cs=(e,t)=>e.fingerprint===t.fingerprint&&e.content===t.content,NC=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&Cs(e[r],t[r]);)r+=1;let i=0;for(;i<e.length-r&&i<t.length-r&&Cs(e[e.length-1-i],t[t.length-1-i]);)i+=1;const o=Array.from({length:r},(n,l)=>[l,l]),s=Array.from({length:i},(n,l)=>[e.length-i+l,t.length-i+l]),a=qC(e,t,r,e.length-i,t.length-i);return[...o,...a,...s]},qC=(e,t,r,i,o)=>{const s=new Set(e.slice(r,i).map(S=>S.fingerprint)),a=new Set(t.slice(r,o).map(S=>S.fingerprint)),n=[];for(let S=r;S<i;S+=1)a.has(e[S].fingerprint)&&n.push(S);const l=[];for(let S=r;S<o;S+=1)s.has(t[S].fingerprint)&&l.push(S);const c=n.length,h=l.length;if(c===0||h===0)return[];const d=(S,v)=>Cs(e[n[S]],t[l[v]]),u=(S,v)=>e[n[S]].fingerprint===t[l[v]].fingerprint,f=(S,v)=>{let _=S;for(;_<c&&_+v<h&&d(_,_+v);)_+=1;return _},p=[Int32Array.of(f(0,0))],m=[Uint8Array.of(Aa)],y=h-c;let x=0;for(;!(y>=-x&&y<=x&&p[x][y+x]===c);){if(x+=1,x>DC)return[];const S=p[x-1],v=B=>B>=-(x-1)&&B<=x-1?S[B+x-1]:-1,_=new Int32Array(2*x+1).fill(-1),E=new Uint8Array(2*x+1);for(let B=-x;B<=x;B+=1){if(B<-c||B>h)continue;let O=-1,A=Aa;const D=v(B);D!==-1&&D<c&&D+B<h&&u(D,D+B)&&(O=D+1,A=Kh);const W=v(B+1);W!==-1&&W+1<=c&&W+1>O&&(O=W+1,A=Zh);const R=v(B-1);R!==-1&&R+B<=h&&R>O&&(O=R,A=Ma),O!==-1&&(_[B+x]=f(O,B),E[B+x]=A)}p.push(_),m.push(E)}const C=[];let k=y;for(let S=x;S>=0;S-=1){const v=p[S][k+S],_=m[S][k+S],E=_===Zh?k+1:_===Ma?k-1:k,B=_===Aa?0:p[S-1][E+S-1]+(_===Ma?0:1);for(let O=v-1;O>=B;O-=1)C.push([n[O],l[O+k]]);_===Kh&&C.push([n[B-1],l[B-1+k]]),k=E}return C.reverse()},Aa=0,Kh=1,Zh=2,Ma=3,zC=(e,t)=>{const r=e.map(()=>null),i=new Set;for(const[n,l]of NC(t,e))r[l]=t[n].key,i.add(n);const o=new Map;for(const[n,l]of t.entries()){if(i.has(n))continue;const c=o.get(l.fingerprint);c===void 0?o.set(l.fingerprint,[n]):c.push(n)}const s=n=>{for(const[l,c]of e.entries()){if(r[l]!==null)continue;const h=o.get(c.fingerprint),d=h===void 0?-1:h.findIndex(u=>n(c,t[u]));h!==void 0&&d!==-1&&(r[l]=t[h.splice(d,1)[0]].key)}};s(Cs),s(()=>!0);const a=new Set(r.filter(n=>n!==null));return e.map((n,l)=>{let c=r[l];if(c===null){let h=0;for(;a.has(`${n.fingerprint}.${h}`);)h+=1;c=`${n.fingerprint}.${h}`,a.add(c)}return{...n,key:c}})};const jC=[["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"}]],WC=Tt("building-2",jC);const HC=[["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"}]],Qh=Tt("globe",HC),YC=/^[a-z]{2,3}$/u,UC=e=>{const t=e.trim().split("-",1)[0]?.toLowerCase()??"";return YC.test(t)?t:null},XC=()=>()=>{},GC=e=>{const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>t.disconnect()},Sl=()=>L.useSyncExternalStore(XC,()=>window.location.origin,()=>null),VC=()=>L.useSyncExternalStore(GC,()=>UC(document.documentElement.lang),()=>null),KC=/^[1-9]\d{0,4}$/u,Jh=e=>e!==void 0&&KC.test(e.trim())?Number(e.trim()):null,ZC=({embed:e,label:t,insideAnchor:r,children:i})=>{const o=Sl(),s=new URL(e.src);if(o!==null&&s.origin!==o&&!r)return i;const a=Jh(e.attributes.width),n=Jh(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":o===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}: ${s.hostname}`}):w.jsx("a",{href:s.href,target:"_blank",rel:"noreferrer",lang:h,children:c??`${t.text}: ${s.hostname}`})})},tu=({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,o=new Map,s=[];let a=0;const n=(h,d,u)=>{if(o.get(h)===d&&(o.delete(h),u!==null)){i.set(h,u);for(const f of i.keys()){if(i.size<=t)break;i.delete(f)}for(const f of d.subscriptions)f.listener(u)}},l=()=>{for(;a<e;){const h=s.shift();if(h===void 0)return;const d=o.get(h);if(d===void 0)continue;const u=new AbortController;d.controller=u,a+=1,new Promise(f=>f(d.start(AbortSignal.any([u.signal,AbortSignal.timeout(r)])))).then(f=>n(h,d,{ok:!0,value:f}),()=>n(h,d,u.signal.aborted?null:{ok:!1})).finally(()=>{a-=1,l()})}};return Object.freeze({subscribe:(h,d,u)=>{const f=i.get(h);if(f!==void 0)return i.delete(h),i.set(h,f),u(f),()=>{};let p=o.get(h);p===void 0&&(p={start:d,subscriptions:new Set,controller:null},o.set(h,p),s.push(h));const m=p,y={listener:u};return m.subscriptions.add(y),l(),()=>{m.subscriptions.delete(y),!(m.subscriptions.size>0||o.get(h)!==m)&&(o.delete(h),m.controller===null?s.splice(s.indexOf(h),1):m.controller.abort())}}})},QC=tu({concurrency:2,capacity:256,timeoutMs:15e3}),JC="[data-aqmd-scroll-container]",tb=async(e,t)=>{let r;try{r=await fetch(e,{credentials:"same-origin",redirect:"error",headers:{accept:"application/json"},signal:t})}catch(s){if(t.aborted)throw s;return{kind:"error",cause:"network error"}}if(r.status===204){const s=Ne.linkCardSkipReasonOf(r.headers.get(Ne.LINK_CARD_SKIP_HEADER));return s===null?{kind:"error",cause:"HTTP 204 without a known skip reason"}:{kind:"skip",reason:s}}if(!r.ok)return{kind:"error",cause:`HTTP ${r.status}`};let i;try{i=await r.json()}catch(s){if(t.aborted)throw s;return{kind:"error",cause:`HTTP ${r.status}, not JSON`}}const o=Ne.linkCardMetadataOf(i);return o===null?{kind:"error",cause:`HTTP ${r.status}, not a JSON object`}:{kind:"card",metadata:o}},eb=e=>e.ok?e.value.kind==="card"?null:e.value.kind==="skip"?e.value.reason:e.value.cause:"network error",tc=(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})]})]}),rb=({href:e,endpoint:t,size:r,fallback:i})=>{const o=Sl(),s=L.useRef(null),a=new URL(e),n=`${t}
|
|
7
|
-
${a.href}`,[l,c]=L.useState(null);L.useEffect(()=>{const x=s.current;if(x===null||o===null)return;let C=null;const k=new IntersectionObserver(S=>{C!==null||!S.some(v=>v.isIntersecting)||(k.disconnect(),C=QC.subscribe(n,v=>tb(Ne.linkCardRequestOf(t,new URL(e),o),v),v=>{c({key:n,outcome:v});const _=eb(v);_!==null&&un.linkCardLogger.info(`No link card for ${e} (${_})`)}))},{root:x.closest(JC),rootMargin:"100% 0px"});return k.observe(x),()=>{k.disconnect(),C?.()}},[n,t,e,o]);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||o===null)return w.jsx("a",{ref:s,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?WC:Qh;return w.jsx("a",{ref:s,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:u}=d,f=new URL(o).hostname,p=tc(u.image,f),m=tc(u.icon,f),y=u.siteName===null?a.hostname:`${u.siteName} · ${a.hostname}`;return r==="compact"?w.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":"compact",children:w.jsx($a,{tile:m===null?w.jsx(Qh,{"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:u.title??e,secondary:y})}):w.jsxs("a",{ref:s,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:u.title??e}),u.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:u.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"})]})},eu=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(!Rr.isEmbedProviderId(t))throw new RangeError(`[@aiquants/markdown] embeds.providers holds an unknown provider id ${JSON.stringify(t)}; known ids are ${Rr.EMBED_PROVIDER_IDS.join(", ")}`);if(e.linkCardEndpoint!==null&&!Ne.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&&!Ne.isLinkCardSize(e.linkCardSize))throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${Ne.LINK_CARD_SIZES.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);return e},ro=new WeakMap;let zo=0;const ec=e=>{if(e.source===null)return;const t=ro.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(Rr.EMBED_FRAME_HEIGHT_LIMITS.max,Math.max(Rr.EMBED_FRAME_HEIGHT_LIMITS.min,Math.ceil(r)));i!==t.last&&(t.last=i,t.watch.set(i))},ib=(e,t)=>{const r={watch:t,last:null};return ro.has(e)||(zo+=1,zo===1&&window.addEventListener("message",ec)),ro.set(e,r),()=>{ro.get(e)===r&&(ro.delete(e),zo-=1,zo===0&&window.removeEventListener("message",ec))}},ob=tu({concurrency:2,capacity:256,timeoutMs:5e3}),sb=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()},ab=(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`}}},nb=Object.freeze({marginInline:0}),Oa=Object.freeze({kind:"pending"}),lb=Object.freeze({kind:"narrow"}),hb=Object.freeze({kind:"fallback"}),cb=(e,t,r,i,o)=>{if(t===null)return Oa;let s;if(e.kind==="frame")s=e.srcOf(r);else{if(i===null)return Oa;s=i.ok?e.srcOf(i.value,r):null}if(s===null||new URL(s).origin===t)return hb;const{minWidth:a,maxWidth:n}=e.layout;if(a!==null){if(o===null)return Oa;if(Math.min(o,n??Number.POSITIVE_INFINITY)<a)return lb}return{kind:"frame",src:s}},db=({resolution:e,caption:t,fallback:r,theme:i,labels:o})=>{const s=Sl(),a=VC(),[n,l]=L.useState(null),[c,h]=L.useState(null),d=e.kind==="lookup"?e.request.href:null,[u,f]=L.useState(null);L.useEffect(()=>{if(d!==null)return ob.subscribe(d,B=>sb(new URL(d),B),B=>f({key:d,outcome:B}))},[d]);const{provider:p,layout:m}=e,y=cb(e,s,{theme:i,lang:a},u!==null&&u.key===d?u.outcome:null,n),x=L.useCallback(B=>{if(B===null)return;l(B.getBoundingClientRect().width);const O=new ResizeObserver(()=>l(B.getBoundingClientRect().width));return O.observe(B),()=>O.disconnect()},[]),C=y.kind==="frame"?y.src:null,k=c!==null&&c.src===C?c.height:null,S=L.useCallback(B=>{if(!(B===null||B.contentWindow===null||m.kind!=="message"||C===null))return ib(B.contentWindow,{origin:p.frameOrigin,src:C,heightOf:m.heightOf,set:O=>h({src:C,height:O})})},[m,p.frameOrigin,C]);if(y.kind==="fallback")return r;const v=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:[v,r]});const _=p.content==="video"?o.embeddedVideo:o.embeddedPost,{frame:E}=p;return w.jsxs(w.Fragment,{children:[v,w.jsxs("figure",{"data-embed-provider":p.id,"data-embed-state":y.kind,style:nb,children:[w.jsx("div",{"data-embed-box":"","data-aqmd-embed-surface":"",style:ab(m,k),className:"noscript:hidden overflow-hidden rounded-lg",children:y.kind==="frame"?w.jsx("iframe",{ref:S,src:y.src,title:`${p.name}: ${_.text}`,lang:_.lang,loading:"lazy",allow:E.allow??void 0,allowFullScreen:E.allowFullScreen,sandbox:E.sandbox,referrerPolicy:E.referrerPolicy,scrolling:E.scrolling??void 0,className:"block h-full w-full border-0"},y.src):null}),w.jsx("figcaption",{className:"mt-2",children:t})]})]})},ub=["title","width","height","allow","allowfullscreen","sandbox","referrerpolicy","loading","frameborder","scrolling"],fb=(e,t)=>cr.allowedFrameUrlOf(e,t)!==null,pb=(e,t)=>{const r=new Map(Object.entries(e).map(([s,a])=>[s.toLowerCase(),a])),i=cr.allowedFrameUrlOf(r.get("src"),t);if(i===null)return null;const o={};for(const s of ub){const a=r.get(s);if(a!==void 0)if(s==="allow"){const n=cr.reduceFrameFeatures(a);n!==null&&(o.allow=n)}else if(s==="referrerpolicy"){const n=a.trim().toLowerCase();cr.EMBED_FRAME_REFERRER_POLICIES.has(n)&&(o.referrerpolicy=n)}else o[s]=a}return Object.freeze({src:i.href,attributes:Object.freeze(o)})},gb=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"]),mb=new Set(["id","class","title","lang","dir","role","hidden","translate","style"]),yb=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"]),rc="language-",xb=/[\t\n\f\r ]+/u,Cb=new Set(["h1","h2","h3","h4","h5","h6"]),ic=Object.freeze({sup:/^fnref\d*:\d+$/u,li:/^fn:\d+$/u}),oc="user-content-",Gt=["align"],Jr=["width","height"],sc=["colspan","rowspan","headers","scope","abbr","align","valign","width","height"],Ra=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:Gt,cite:[],code:[It.CODE_META_ATTRIBUTE],col:["span",...Gt,...Jr],colgroup:["span",...Gt,...Jr],dd:[],del:["cite","datetime"],details:["open"],dfn:[],div:Gt,dl:[],dt:[],em:[],figcaption:[],figure:[],footer:[],h1:Gt,h2:Gt,h3:Gt,h4:Gt,h5:Gt,h6:Gt,header:[],hgroup:[],hr:[],i:[],img:["src","alt","loading","decoding",...Gt,...Jr,"data-asset-src","data-asset-exists"],ins:["cite","datetime"],kbd:[],li:["value"],main:[],mark:[],nav:[],ol:["start","reversed","type"],p:Gt,pre:[],q:["cite"],rp:[],rt:[],ruby:[],s:[],samp:[],section:["data-footnotes"],small:[],source:["src","type"],span:[],strong:[],sub:[],summary:[],sup:[],table:[...Gt,"border",...Jr],tbody:[...Gt,"valign"],td:sc,tfoot:[...Gt,"valign"],th:sc,thead:[...Gt,"valign"],time:["datetime"],tr:[...Gt,"valign"],u:[],ul:[],var:[],video:["src","poster","controls","loop","muted","playsinline","preload",...Jr],wbr:[]}),Ia=Object.freeze({svg:["viewbox","version","xmlns","focusable","fill",...Jr],g:["fill","fill-rule","clip-rule"],path:["d","fill","fill-rule","clip-rule"]}),bb=new Set(["svg","g"]),kb=new Set(["href","src","cite","poster",cr.EMBED_LINK_ATTRIBUTE]),wb=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu,Sb=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,vb=new Set(["left","right","center","justify","start","end"]),Mo=e=>Sb.test(e.replace(wb,"")),Tb=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 o=r.slice(i+1).trim().toLowerCase();vb.has(o)&&(t=o)}return t===null?null:`text-align: ${t}`},_b=e=>{const t=e.split(xb).filter(r=>yb.has(r)||r.startsWith(rc)&&r.length>rc.length);return t.length===0?null:t.join(" ")},Bb=(e,t)=>Cb.has(e)||t.startsWith(oc)&&t.length>oc.length||Object.hasOwn(ic,e)&&ic[e].test(t),Lb=e=>{const t=new Map;for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();t.has(o)||t.set(o,i)}return t},Gi=(e,t,r)=>{const i={};for(const[o,s]of t){if(o===vi.SOURCE_LINES_ATTRIBUTE){vi.parseSourceLines(s)!==null&&(i[o]=s);continue}if((mb.has(o)||r.includes(o)||o.startsWith("aria-")&&o.length>5)&&!(kb.has(o)&&!Mo(s))&&!(o==="fill"&&/url\s*\(/iu.test(s))&&!(o==="id"&&!Bb(e,s))){if(o==="class"||o==="style"){const a=o==="class"?_b(s):Tb(s);a!==null&&(i[o]=a);continue}i[o]=s}}return i},Eb=e=>e.get("type")?.trim().toLowerCase()==="checkbox"&&e.has("disabled"),ta=(e,t,r)=>{const i=e.toLowerCase(),o=r.parentName===null?null:r.parentName.toLowerCase(),s=Lb(t);if(o!==null&&bb.has(o)){const n=i!=="svg"&&Object.hasOwn(Ia,i)?Ia[i]:void 0;return n===void 0?{action:"remove"}:{action:"keep",attributes:Gi(i,s,n)}}if(i==="svg")return{action:"keep",attributes:Gi(i,s,Ia.svg)};if(i==="iframe"){const n=pb(Object.fromEntries(s),r.iFrameAllowedDomains);return n===null?{action:"remove"}:{action:"embed",embed:n,pluginType:s.get("data-plugin-type")??null}}if(i==="p"){const n=Gi(i,s,Ra.p),l=s.get(cr.EMBED_LINK_ATTRIBUTE);return l!==void 0&&Mo(l)?{action:"placeholder",attributes:n,link:l}:{action:"keep",attributes:n}}if(i==="input")return Eb(s)?{action:"keep",attributes:Gi(i,s,["type","checked","disabled"])}:{action:"remove"};if(gb.has(i))return{action:"remove"};const a=Object.hasOwn(Ra,i)?Ra[i]:void 0;return a===void 0?{action:"unwrap"}:{action:"keep",attributes:Gi(i,s,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 Fb=typeof document<"u"&&!!document.documentMode;let Pa;function Ab(){return Pa||(Pa=document.createElement("div").style)}const ac=["webkit","moz","ms"],jo={};function vl(e){if(jo[e])return jo[e];const t=Ab();if(e in t)return jo[e]=e;const r=e[0].toUpperCase()+e.slice(1);let i=ac.length;for(;i--;){const o=`${ac[i]}${r}`;if(o in t)return jo[e]=o}}function Wo(e,t){return parseFloat(t[vl(e)])||0}function Ho(e,t,r=window.getComputedStyle(e)){const i=t==="border"?"Width":"";return{left:Wo(`${t}Left${i}`,r),right:Wo(`${t}Right${i}`,r),top:Wo(`${t}Top${i}`,r),bottom:Wo(`${t}Bottom${i}`,r)}}function oi(e,t,r){e.style[vl(t)]=r}function Mb(e,t){const r=vl("transform");oi(e,"transition",`${r} ${t.duration}ms ${t.easing}`)}function $b(e,{x:t,y:r,scale:i,isSVG:o},s){if(oi(e,"transform",`scale(${i}) translate(${t}px, ${r}px)`),o&&Fb){const a=window.getComputedStyle(e).getPropertyValue("transform");e.setAttribute("transform",a)}}function Da(e){let t=e.parentNode;(!t||t.nodeType!==1)&&(t=document.documentElement);const r=window.getComputedStyle(e),i=window.getComputedStyle(t),o=e.getBoundingClientRect(),s=t.getBoundingClientRect();return{elem:{style:r,width:o.width,height:o.height,top:o.top,bottom:o.bottom,left:o.left,right:o.right,margin:Ho(e,"margin",r),border:Ho(e,"border",r)},parent:{style:i,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,padding:Ho(t,"padding",i),border:Ho(t,"border",i)}}}let Co={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Co={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Co={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function Na(e,t,r,i){Co[e].split(" ").forEach(o=>{t.addEventListener(o,r,i)})}function qa(e,t,r){Co[e].split(" ").forEach(i=>{t.removeEventListener(i,r)})}function ru(e,t){let r=e.length;for(;r--;)if(e[r].pointerId===t.pointerId)return r;return-1}function pn(e,t){let r;if(t.touches){r=0;for(const i of t.touches)i.pointerId=r++,pn(e,i);return}r=ru(e,t),r>-1&&e.splice(r,1),e.push(t)}function Ob(e,t){if(t.touches){for(;e.length;)e.pop();return}const r=ru(e,t);r>-1&&e.splice(r,1)}function nc(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 za(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 Rb(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 Ib(e){return(e.getAttribute("class")||"").trim()}function Pb(e,t){return e.nodeType===1&&` ${Ib(e)} `.indexOf(` ${t} `)>-1}function Db(e,t){for(let r=e;r!=null;r=r.parentNode)if(Pb(r,t.excludeClass)||t.exclude.indexOf(r)>-1)return!0;return!1}const Nb=/^http:[\w\.\/]+svg$/;function qb(e){return Nb.test(e.namespaceURI)&&e.nodeName.toLowerCase()!=="svg"}function zb(e){const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}const iu={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:$b,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function ou(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(!Rb(e))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t={...iu,...t};const r=qb(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,oi(e,"transformOrigin",typeof t.origin=="string"?t.origin:r?"0 0":"50% 50%");function o(){i.style.overflow="",i.style.userSelect="",i.style.touchAction="",i.style.cursor="",e.style.cursor="",e.style.userSelect="",e.style.touchAction="",oi(e,"transformOrigin","")}function s(I={}){for(const j in I)I.hasOwnProperty(j)&&(t[j]=I[j]);(I.hasOwnProperty("cursor")||I.hasOwnProperty("canvas"))&&(i.style.cursor=e.style.cursor="",(t.canvas?i:e).style.cursor=t.cursor),I.hasOwnProperty("overflow")&&(i.style.overflow=I.overflow),I.hasOwnProperty("touchAction")&&(i.style.touchAction=I.touchAction,e.style.touchAction=I.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(I,j,T){if(T.silent)return;const U=new CustomEvent(I,{detail:j});e.dispatchEvent(U)}function d(I,j,T){const U={x:a,y:n,scale:l,isSVG:r,originalEvent:T};return requestAnimationFrame(()=>{typeof j.animate=="boolean"&&(j.animate?Mb(e,j):oi(e,"transition","none")),j.setTransform(e,U,j),h(I,U,j),h("panzoomchange",U,j)}),U}function u(I,j,T,U){const z={...t,...U},G={x:a,y:n,opts:z};if(!U?.force&&(z.disablePan||z.panOnlyWhenZoomed&&l===z.startScale))return G;if(I=parseFloat(I),j=parseFloat(j),z.disableXAxis||(G.x=(z.relative?a:0)+I),z.disableYAxis||(G.y=(z.relative?n:0)+j),z.contain){const X=Da(e),K=X.elem.width/l,Q=X.elem.height/l,nt=K*T,gt=Q*T,ut=(nt-K)/2,mt=(gt-Q)/2;if(z.contain==="inside"){const Lt=(-X.elem.margin.left-X.parent.padding.left+ut)/T,Ft=(X.parent.width-nt-X.parent.padding.left-X.elem.margin.left-X.parent.border.left-X.parent.border.right+ut)/T;G.x=Math.max(Math.min(G.x,Ft),Lt);const Mt=(-X.elem.margin.top-X.parent.padding.top+mt)/T,Ht=(X.parent.height-gt-X.parent.padding.top-X.elem.margin.top-X.parent.border.top-X.parent.border.bottom+mt)/T;G.y=Math.max(Math.min(G.y,Ht),Mt)}else if(z.contain==="outside"){const Lt=(-(nt-X.parent.width)-X.parent.padding.left-X.parent.border.left-X.parent.border.right+ut)/T,Ft=(ut-X.parent.padding.left)/T;G.x=Math.max(Math.min(G.x,Ft),Lt);const Mt=(-(gt-X.parent.height)-X.parent.padding.top-X.parent.border.top-X.parent.border.bottom+mt)/T,Ht=(mt-X.parent.padding.top)/T;G.y=Math.max(Math.min(G.y,Ht),Mt)}}return z.roundPixels&&(G.x=Math.round(G.x),G.y=Math.round(G.y)),G}function f(I,j){const T={...t,...j},U={scale:l,opts:T};if(!j?.force&&T.disableZoom)return U;let z=t.minScale,G=t.maxScale;if(T.contain){const X=Da(e),K=X.elem.width/l,Q=X.elem.height/l;if(K>1&&Q>1){const nt=X.parent.width-X.parent.border.left-X.parent.border.right,gt=X.parent.height-X.parent.border.top-X.parent.border.bottom,ut=nt/K,mt=gt/Q;t.contain==="inside"?G=Math.min(G,ut,mt):t.contain==="outside"&&(z=Math.max(z,ut,mt))}}return U.scale=Math.min(Math.max(I,z),G),U}function p(I,j,T,U){const z=u(I,j,l,T);return a!==z.x||n!==z.y?(a=z.x,n=z.y,d("panzoompan",z.opts,U)):{x:a,y:n,scale:l,isSVG:r,originalEvent:U}}function m(I,j,T){const U=f(I,j),z=U.opts;if(!j?.force&&z.disableZoom)return;I=U.scale;let G=a,X=n;if(z.focal){const Q=z.focal;G=(Q.x/I-Q.x/l+a*I)/I,X=(Q.y/I-Q.y/l+n*I)/I}const K=u(G,X,I,{relative:!1,force:!0});return a=K.x,n=K.y,l=I,d("panzoomzoom",z,T)}function y(I,j){const T={...t,animate:!0,...j};return m(l*Math.exp((I?1:-1)*T.step),T)}function x(I){return y(!0,I)}function C(I){return y(!1,I)}function k(I,j,T,U){const z=Da(e),G={width:z.parent.width-z.parent.padding.left-z.parent.padding.right-z.parent.border.left-z.parent.border.right,height:z.parent.height-z.parent.padding.top-z.parent.padding.bottom-z.parent.border.top-z.parent.border.bottom};let X=j.clientX-z.parent.left-z.parent.padding.left-z.parent.border.left-z.elem.margin.left,K=j.clientY-z.parent.top-z.parent.padding.top-z.parent.border.top-z.elem.margin.top;r||(X-=z.elem.width/l/2,K-=z.elem.height/l/2);const Q={x:X/G.width*(G.width*I),y:K/G.height*(G.height*I)};return m(I,{...T,animate:!1,focal:Q},U)}function S(I,j){I.preventDefault();const T={...t,...j,animate:!1},z=(I.deltaY===0&&I.deltaX?I.deltaX:I.deltaY)<0?1:-1,G=f(l*Math.exp(z*T.step/3),T).scale;return k(G,I,T,I)}function v(I){const j={...t,animate:!0,force:!0,...I};l=f(j.startScale,j).scale;const T=u(j.startX,j.startY,l,j);return a=T.x,n=T.y,d("panzoomreset",j)}let _,E,B,O,A,D;const W=[];function R(I){if(Db(I.target,t))return;pn(W,I),c=!0,t.handleStartEvent(I),_=a,E=n,h("panzoomstart",{x:a,y:n,scale:l,isSVG:r,originalEvent:I},t);const j=nc(W);B=j.clientX,O=j.clientY,A=l,D=za(W)}function N(I){if(!c||_===void 0||E===void 0||B===void 0||O===void 0)return;pn(W,I);const j=nc(W),T=W.length>1;let U=l;if(T){D===0&&(D=za(W));const z=za(W)-D;U=f(z*t.step/80+A).scale,k(U,j,{animate:!1},I)}(!T||t.pinchAndPan)&&p(_+(j.clientX-B)/U,E+(j.clientY-O)/U,{animate:!1},I)}function F(I){W.length===1&&h("panzoomend",{x:a,y:n,scale:l,isSVG:r,originalEvent:I},t),Ob(W,I),c&&(c=!1,_=E=B=O=void 0)}let $=!1;function q(){$||($=!0,Na("down",t.canvas?i:e,R),Na("move",document,N,{passive:!0}),Na("up",document,F,{passive:!0}))}function P(){$=!1,qa("down",t.canvas?i:e,R),qa("move",document,N),qa("up",document,F)}return t.noBind||q(),{bind:q,destroy:P,eventNames:Co,getPan:()=>({x:a,y:n}),getScale:()=>l,getOptions:()=>zb(t),handleDown:R,handleMove:N,handleUp:F,pan:p,reset:v,resetStyle:o,setOptions:s,setStyle:(I,j)=>oi(e,I,j),zoom:m,zoomIn:x,zoomOut:C,zoomToPoint:k,zoomWithWheel:S}}ou.defaultOptions=iu;const jb=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Wb=Tt("arrow-down",jb);const Hb=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Yb=Tt("arrow-left",Hb);const Ub=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Xb=Tt("arrow-right",Ub);const Gb=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Vb=Tt("arrow-up",Gb);const Kb=[["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"}]],gn=Tt("refresh-cw",Kb);const Zb=[["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"}]],Qb=Tt("settings-2",Zb);const Jb=[["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"}]],su=Tt("zoom-in",Jb);const t1=[["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"}]],au=Tt("zoom-out",t1);var nu=Object.defineProperty,g=(e,t)=>nu(e,"name",{value:t,configurable:!0}),lu=(e,t)=>{for(var r in t)nu(e,r,{get:t[r],enumerable:!0})},os={exports:{}},e1=os.exports,lc;function r1(){return lc||(lc=1,(function(e,t){(function(r,i){e.exports=i()})(e1,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",u="quarter",f="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(N){var F=["th","st","nd","rd"],$=N%100;return"["+N+(F[($-20)%10]||F[$]||F[0])+"]"}},k=function(N,F,$){var q=String(N);return!q||q.length>=F?N:""+Array(F+1-q.length).join($)+N},S={s:k,z:function(N){var F=-N.utcOffset(),$=Math.abs(F),q=Math.floor($/60),P=$%60;return(F<=0?"+":"-")+k(q,2,"0")+":"+k(P,2,"0")},m:function N(F,$){if(F.date()<$.date())return-N($,F);var q=12*($.year()-F.year())+($.month()-F.month()),P=F.clone().add(q,d),I=$-P<0,j=F.clone().add(q+(I?-1:1),d);return+(-(q+($-P)/(I?P-j:j-P))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:d,y:f,w:h,d:c,D:p,h:l,m:n,s:a,ms:s,Q:u}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},v="en",_={};_[v]=C;var E="$isDayjsObject",B=function(N){return N instanceof W||!(!N||!N[E])},O=function N(F,$,q){var P;if(!F)return v;if(typeof F=="string"){var I=F.toLowerCase();_[I]&&(P=I),$&&(_[I]=$,P=I);var j=F.split("-");if(!P&&j.length>1)return N(j[0])}else{var T=F.name;_[T]=F,P=T}return!q&&P&&(v=P),P||!q&&v},A=function(N,F){if(B(N))return N.clone();var $=typeof F=="object"?F:{};return $.date=N,$.args=arguments,new W($)},D=S;D.l=O,D.i=B,D.w=function(N,F){return A(N,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var W=(function(){function N($){this.$L=O($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[E]=!0}var F=N.prototype;return F.parse=function($){this.$d=(function(q){var P=q.date,I=q.utc;if(P===null)return new Date(NaN);if(D.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var j=P.match(y);if(j){var T=j[2]-1||0,U=(j[7]||"0").substring(0,3);return I?new Date(Date.UTC(j[1],T,j[3]||1,j[4]||0,j[5]||0,j[6]||0,U)):new Date(j[1],T,j[3]||1,j[4]||0,j[5]||0,j[6]||0,U)}}return new Date(P)})($),this.init()},F.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()},F.$utils=function(){return D},F.isValid=function(){return this.$d.toString()!==m},F.isSame=function($,q){var P=A($);return this.startOf(q)<=P&&P<=this.endOf(q)},F.isAfter=function($,q){return A($)<this.startOf(q)},F.isBefore=function($,q){return this.endOf(q)<A($)},F.$g=function($,q,P){return D.u($)?this[q]:this.set(P,$)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function($,q){var P=this,I=!!D.u(q)||q,j=D.p($),T=function(gt,ut){var mt=D.w(P.$u?Date.UTC(P.$y,ut,gt):new Date(P.$y,ut,gt),P);return I?mt:mt.endOf(c)},U=function(gt,ut){return D.w(P.toDate()[gt].apply(P.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(ut)),P)},z=this.$W,G=this.$M,X=this.$D,K="set"+(this.$u?"UTC":"");switch(j){case f:return I?T(1,0):T(31,11);case d:return I?T(1,G):T(0,G+1);case h:var Q=this.$locale().weekStart||0,nt=(z<Q?z+7:z)-Q;return T(I?X-nt:X+(6-nt),G);case c:case p:return U(K+"Hours",0);case l:return U(K+"Minutes",1);case n:return U(K+"Seconds",2);case a:return U(K+"Milliseconds",3);default:return this.clone()}},F.endOf=function($){return this.startOf($,!1)},F.$set=function($,q){var P,I=D.p($),j="set"+(this.$u?"UTC":""),T=(P={},P[c]=j+"Date",P[p]=j+"Date",P[d]=j+"Month",P[f]=j+"FullYear",P[l]=j+"Hours",P[n]=j+"Minutes",P[a]=j+"Seconds",P[s]=j+"Milliseconds",P)[I],U=I===c?this.$D+(q-this.$W):q;if(I===d||I===f){var z=this.clone().set(p,1);z.$d[T](U),z.init(),this.$d=z.set(p,Math.min(this.$D,z.daysInMonth())).$d}else T&&this.$d[T](U);return this.init(),this},F.set=function($,q){return this.clone().$set($,q)},F.get=function($){return this[D.p($)]()},F.add=function($,q){var P,I=this;$=Number($);var j=D.p(q),T=function(G){var X=A(I);return D.w(X.date(X.date()+Math.round(G*$)),I)};if(j===d)return this.set(d,this.$M+$);if(j===f)return this.set(f,this.$y+$);if(j===c)return T(1);if(j===h)return T(7);var U=(P={},P[n]=i,P[l]=o,P[a]=r,P)[j]||1,z=this.$d.getTime()+$*U;return D.w(z,this)},F.subtract=function($,q){return this.add(-1*$,q)},F.format=function($){var q=this,P=this.$locale();if(!this.isValid())return P.invalidDate||m;var I=$||"YYYY-MM-DDTHH:mm:ssZ",j=D.z(this),T=this.$H,U=this.$m,z=this.$M,G=P.weekdays,X=P.months,K=P.meridiem,Q=function(ut,mt,Lt,Ft){return ut&&(ut[mt]||ut(q,I))||Lt[mt].slice(0,Ft)},nt=function(ut){return D.s(T%12||12,ut,"0")},gt=K||function(ut,mt,Lt){var Ft=ut<12?"AM":"PM";return Lt?Ft.toLowerCase():Ft};return I.replace(x,(function(ut,mt){return mt||(function(Lt){switch(Lt){case"YY":return String(q.$y).slice(-2);case"YYYY":return D.s(q.$y,4,"0");case"M":return z+1;case"MM":return D.s(z+1,2,"0");case"MMM":return Q(P.monthsShort,z,X,3);case"MMMM":return Q(X,z);case"D":return q.$D;case"DD":return D.s(q.$D,2,"0");case"d":return String(q.$W);case"dd":return Q(P.weekdaysMin,q.$W,G,2);case"ddd":return Q(P.weekdaysShort,q.$W,G,3);case"dddd":return G[q.$W];case"H":return String(T);case"HH":return D.s(T,2,"0");case"h":return nt(1);case"hh":return nt(2);case"a":return gt(T,U,!0);case"A":return gt(T,U,!1);case"m":return String(U);case"mm":return D.s(U,2,"0");case"s":return String(q.$s);case"ss":return D.s(q.$s,2,"0");case"SSS":return D.s(q.$ms,3,"0");case"Z":return j}return null})(ut)||j.replace(":","")}))},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function($,q,P){var I,j=this,T=D.p(q),U=A($),z=(U.utcOffset()-this.utcOffset())*i,G=this-U,X=function(){return D.m(j,U)};switch(T){case f:I=X()/12;break;case d:I=X();break;case u:I=X()/3;break;case h:I=(G-z)/6048e5;break;case c:I=(G-z)/864e5;break;case l:I=G/o;break;case n:I=G/i;break;case a:I=G/r;break;default:I=G}return P?I:D.a(I)},F.daysInMonth=function(){return this.endOf(d).$D},F.$locale=function(){return _[this.$L]},F.locale=function($,q){if(!$)return this.$L;var P=this.clone(),I=O($,q,!0);return I&&(P.$L=I),P},F.clone=function(){return D.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},N})(),R=W.prototype;return A.prototype=R,[["$ms",s],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",f],["$D",p]].forEach((function(N){R[N[1]]=function(F){return this.$g(F,N[0],N[1])}})),A.extend=function(N,F){return N.$i||(N(F,W,A),N.$i=!0),A},A.locale=O,A.isDayjs=B,A.unix=function(N){return A(1e3*N)},A.en=_[v],A.Ls=_,A.p={},A}))})(os)),os.exports}var i1=r1();const hu=Kd(i1);var Ge={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")},Tl=g(function(e="fatal"){let t=Ge.fatal;typeof e=="string"?e.toLowerCase()in Ge&&(t=Ge[e]):typeof e=="number"&&(t=e),V.trace=()=>{},V.debug=()=>{},V.info=()=>{},V.warn=()=>{},V.error=()=>{},V.fatal=()=>{},t<=Ge.fatal&&(V.fatal=console.error?console.error.bind(console,me("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",me("FATAL"))),t<=Ge.error&&(V.error=console.error?console.error.bind(console,me("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",me("ERROR"))),t<=Ge.warn&&(V.warn=console.warn?console.warn.bind(console,me("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",me("WARN"))),t<=Ge.info&&(V.info=console.info?console.info.bind(console,me("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",me("INFO"))),t<=Ge.debug&&(V.debug=console.debug?console.debug.bind(console,me("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",me("DEBUG"))),t<=Ge.trace&&(V.trace=console.debug?console.debug.bind(console,me("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",me("TRACE")))},"setLogLevel"),me=g(e=>`%c${hu().format("ss.SSS")} : ${e} : `,"format");const ss={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 o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return ss.hue2rgb(s,o,e+1/3)*255;case"g":return ss.hue2rgb(s,o,e)*255;case"b":return ss.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){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}}},o1={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},s1={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},pt={channel:ss,lang:o1,unit:s1},nr={};for(let e=0;e<=255;e++)nr[e]=pt.unit.dec2hex(e);const Jt={ALL:0,RGB:1,HSL:2};class a1{constructor(){this.type=Jt.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=Jt.ALL}is(t){return this.type===t}}class n1{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new a1}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Jt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=pt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=pt.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=pt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=pt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=pt.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=pt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Jt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Jt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Jt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Jt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Jt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Jt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const ea=new n1({r:0,g:0,b:0,a:0},"transparent"),ni={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(ni.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return ea.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${nr[Math.round(t)]}${nr[Math.round(r)]}${nr[Math.round(i)]}${nr[Math.round(o*255)]}`:`#${nr[Math.round(t)]}${nr[Math.round(r)]}${nr[Math.round(i)]}`}},Er={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(Er.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return pt.channel.clamp.h(parseFloat(r)*.9);case"rad":return pt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return pt.channel.clamp.h(parseFloat(r)*360)}}return pt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Er.re);if(!r)return;const[,i,o,s,a,n]=r;return ea.set({h:Er._hue2deg(i),s:pt.channel.clamp.s(parseFloat(o)),l:pt.channel.clamp.l(parseFloat(s)),a:a?pt.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${pt.lang.round(t)}, ${pt.lang.round(r)}%, ${pt.lang.round(i)}%, ${o})`:`hsl(${pt.lang.round(t)}, ${pt.lang.round(r)}%, ${pt.lang.round(i)}%)`}},uo={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=uo.colors[e];if(t)return ni.parse(t)},stringify:e=>{const t=ni.stringify(e);for(const r in uo.colors)if(uo.colors[r]===t)return r}},io={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(io.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return ea.set({r:pt.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:pt.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:pt.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?pt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${pt.lang.round(t)}, ${pt.lang.round(r)}, ${pt.lang.round(i)}, ${pt.lang.round(o)})`:`rgb(${pt.lang.round(t)}, ${pt.lang.round(r)}, ${pt.lang.round(i)})`}},Me={format:{keyword:uo,hex:ni,rgb:io,rgba:io,hsl:Er,hsla:Er},parse:e=>{if(typeof e!="string")return e;const t=ni.parse(e)||io.parse(e)||Er.parse(e)||uo.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Jt.HSL)||e.data.r===void 0?Er.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?io.stringify(e):ni.stringify(e)},cu=(e,t)=>{const r=Me.parse(e);for(const i in t)r[i]=pt.channel.clamp[i](t[i]);return Me.stringify(r)},Je=(e,t,r=0,i=1)=>{if(typeof e!="number")return cu(e,{a:t});const o=ea.set({r:pt.channel.clamp.r(e),g:pt.channel.clamp.g(t),b:pt.channel.clamp.b(r),a:pt.channel.clamp.a(i)});return Me.stringify(o)},l1=e=>{const{r:t,g:r,b:i}=Me.parse(e),o=.2126*pt.channel.toLinear(t)+.7152*pt.channel.toLinear(r)+.0722*pt.channel.toLinear(i);return pt.lang.round(o)},h1=e=>l1(e)>=.5,ke=e=>!h1(e),_l=(e,t,r)=>{const i=Me.parse(e),o=i[t],s=pt.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Me.stringify(i)},H=(e,t)=>_l(e,"l",t),Y=(e,t)=>_l(e,"l",-t),b=(e,t)=>{const r=Me.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return cu(e,i)},c1=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Me.parse(e),{r:n,g:l,b:c,a:h}=Me.parse(t),d=r/100,u=d*2-1,f=a-h,m=((u*f===-1?u:(u+f)/(1+u*f))+1)/2,y=1-m,x=i*m+n*y,C=o*m+l*y,k=s*m+c*y,S=a*d+h*(1-d);return Je(x,C,k,S)},M=(e,t=100)=>{const r=Me.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,c1(r,e,t)};var mn=g((e,t,{depth:r=2,clobber:i=!1}={})=>{const o={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>mn(e,s,o)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),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(s=>{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=mn(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),qt=mn,We="#ffffff",He="#f2f2f2",dt=g((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),ci,d1=(ci=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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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||Y(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(this.mainBkg,10)):(this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(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]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He,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(ci,"Theme"),ci),u1=g(e=>{const t=new d1;return t.calculate(e),t},"getThemeVariables"),di,f1=(di=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.lineColor=M(this.background),this.textColor=M(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(M("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Je(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=Y("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Y(this.sectionBkgColor,10),this.taskBorderColor=Je(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Je(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||H(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(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=H(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=H(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=H(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=M(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]||M(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||H(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)]??H(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=H(this.secondaryColor,20),this.git1=H(this.pie2||this.secondaryColor,20),this.git2=H(this.pie3||this.tertiaryColor,20),this.git3=H(this.pie4||b(this.primaryColor,{h:-30}),20),this.git4=H(this.pie5||b(this.primaryColor,{h:-60}),20),this.git5=H(this.pie6||b(this.primaryColor,{h:-90}),10),this.git6=H(this.pie7||b(this.primaryColor,{h:60}),10),this.git7=H(this.pie8||b(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||M(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||M(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||H("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||H("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||H("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||H("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||H(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||H(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||H(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||H(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(di,"Theme"),di),p1=g(e=>{const t=new f1;return t.calculate(e),t},"getThemeVariables"),ui,g1=(ui=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=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.lineColor=M(this.background),this.textColor=M(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=dt(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=Je(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||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(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||M(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||M(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||H(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||H(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||Y(M(this.git0),25),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||M(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||M(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(ui,"Theme"),ui),du=g(e=>{const t=new g1;return t.calculate(e),t},"getThemeVariables"),fi,m1=(fi=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=H("#cde498",10),this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.primaryColor),this.lineColor=M(this.background),this.textColor=M(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=Y(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||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(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||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||M(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||M(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(fi,"Theme"),fi),y1=g(e=>{const t=new m1;return t.calculate(e),t},"getThemeVariables"),pi,x1=(pi=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=H(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.lineColor=M(this.background),this.textColor=M(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||H(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=H(this.contrast,55),this.border2=this.contrast,this.actorBorder=H(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]||M(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||Y(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=H(this.contrast,30),this.sectionBkgColor2=H(this.contrast,30),this.taskBorderColor=Y(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=H(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Y(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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=Y(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||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(pi,"Theme"),pi),C1=g(e=>{const t=new x1;return t.calculate(e),t},"getThemeVariables"),gi,b1=(gi=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=dt(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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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 s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||M(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(gi,"Theme"),gi),k1=g(e=>{const t=new b1;return t.calculate(e),t},"getThemeVariables"),mi,w1=(mi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(M("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=M(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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(mi,"Theme"),mi),S1=g(e=>{const t=new w1;return t.calculate(e),t},"getThemeVariables"),yi,v1=(yi=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=dt("#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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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 s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=this.mainBkg;if(this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||M(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(yi,"Theme"),yi),T1=g(e=>{const t=new v1;return t.calculate(e),t},"getThemeVariables"),xi,_1=(xi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(M("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=M(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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(xi,"Theme"),xi),B1=g(e=>{const t=new _1;return t.calculate(e),t},"getThemeVariables"),Ci,L1=(Ci=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=dt(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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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 s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||M(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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),E1=g(e=>{const t=new L1;return t.calculate(e),t},"getThemeVariables"),bi,F1=(bi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=M(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=M(this.primaryColor),this.secondaryTextColor=M(this.secondaryColor),this.tertiaryTextColor=M(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(M("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=M(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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||M(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||M(this.tertiaryColor),this.lineColor=this.lineColor||M(this.background),this.arrowheadColor=this.arrowheadColor||M(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||M(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||H(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]||M(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=Y(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||M(this.git0),this.gitInv1=this.gitInv1||M(this.git1),this.gitInv2=this.gitInv2||M(this.git2),this.gitInv3=this.gitInv3||M(this.git3),this.gitInv4=this.gitInv4||M(this.git4),this.gitInv5=this.gitInv5||M(this.git5),this.gitInv6=this.gitInv6||M(this.git6),this.gitInv7=this.gitInv7||M(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(bi,"Theme"),bi),A1=g(e=>{const t=new F1;return t.calculate(e),t},"getThemeVariables"),tr={base:{getThemeVariables:u1},dark:{getThemeVariables:p1},default:{getThemeVariables:du},forest:{getThemeVariables:y1},neutral:{getThemeVariables:C1},neo:{getThemeVariables:k1},"neo-dark":{getThemeVariables:S1},redux:{getThemeVariables:T1},"redux-dark":{getThemeVariables:B1},"redux-color":{getThemeVariables:E1},"redux-dark-color":{getThemeVariables:A1}},Vt={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},uu={...Vt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:tr.default.getThemeVariables(),sequence:{...Vt.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:{...Vt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Vt.c4,useWidth:void 0,personFont:g(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Vt.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:{...Vt.pie,useWidth:984},xyChart:{...Vt.xyChart,useWidth:void 0},requirement:{...Vt.requirement,useWidth:void 0},packet:{...Vt.packet},eventmodeling:{...Vt.eventmodeling},treeView:{...Vt.treeView,useWidth:void 0},radar:{...Vt.radar},railroad:{...Vt.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:{...Vt.ishikawa},sankey:{...Vt.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:{...Vt.venn},cynefin:{...Vt.cynefin}},fu=g((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...fu(e[i],"")]:[...r,t+i],[]),"keyify"),M1=new Set(fu(uu,"")),Bl=uu,$1={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},O1=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"),bs=g(e=>{if(V.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>bs(t));return}for(const t of Object.keys(e)){if(V.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!M1.has(t)||e[t]==null){V.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=$1[t];i?O1(e[t],i):(V.debug("sanitizing object",t),bs(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(V.debug("sanitizing css option",t),e[t]=pu(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"),pu=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"),Bi=Object.freeze(Bl),Ye=g(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ce=qt({},Bi),ks,Ir=[],fo=qt({},Bi),ra=g((e,t)=>{let r=qt({},e),i={};for(const o of t)yu(o),i=qt(i,o);if(r=qt(r,i),i.theme&&i.theme in tr){const o=qt({},ks),s=qt(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in tr&&(r.themeVariables=tr[r.theme].getThemeVariables(s))}return fo=r,Cu(fo),fo},"updateCurrentConfig"),R1=g(e=>(ce=qt({},Bi),ce=qt(ce,e),e.theme&&tr[e.theme]&&(ce.themeVariables=tr[e.theme].getThemeVariables(e.themeVariables)),ra(ce,Ir),ce),"setSiteConfig"),I1=g(e=>{ks=qt({},e)},"saveConfigFromInitialize"),P1=g(e=>(ce=qt(ce,e),ra(ce,Ir),ce),"updateSiteConfig"),gu=g(()=>qt({},ce),"getSiteConfig"),mu=g(e=>(Cu(e),qt(fo,e),Ot()),"setConfig"),Ot=g(()=>qt({},fo),"getConfig"),yu=g(e=>{e&&(["secure",...ce.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"&&yu(e[t])}))},"sanitize"),D1=g(e=>{bs(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Ir.push(e),ra(ce,Ir)},"addDirective"),ws=g((e=ce)=>{Ir=[],ra(e,Ir)},"reset"),N1={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."},hc={},xu=g(e=>{hc[e]||(V.warn(N1[e]),hc[e]=!0)},"issueWarning"),Cu=g(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&xu("LAZY_LOAD_DEPRECATED")},"checkConfig"),q1=g(()=>{let e={};ks&&(e=qt(e,ks));for(const t of Ir)e=qt(e,t);return e},"getUserDefinedConfig"),ee=g(e=>(e.flowchart?.htmlLabels!=null&&xu("FLOWCHART_HTML_LABELS_DEPRECATED"),Ye(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),bu=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,po=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,z1=/\s*%%.*\n/gm,ki,ku=(ki=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},g(ki,"UnknownDiagramError"),ki),Pr={},Ll=g(function(e,t){e=e.replace(bu,"").replace(po,"").replace(z1,`
|
|
8
|
-
`);for(const[r,{detector:i}]of Object.entries(Pr))if(i(e,t))return r;throw new
|
|
9
|
-
`)}g(kn,"cssStyleSheetToString");var
|
|
6
|
+
<%s key={someKey} {...props} />`,G,Q,nt,Q),j[Q+G]=!0)}if(Q=null,z!==void 0&&(r(z),Q=""+z),a(W)&&(r(W.key),Q=""+W.key),"key"in W){z={};for(var gt in W)gt!=="key"&&(z[gt]=W[gt])}else z=W;return Q&&n(z,typeof T=="function"?T.displayName||T.name||"Unknown":T),c(T,Q,z,o(),X,K)}function d(T){u(T)?T._store&&(T._store.validated=1):typeof T=="object"&&T!==null&&T.$$typeof===I&&(T._payload.status==="fulfilled"?u(T._payload.value)&&T._payload.value._store&&(T._payload.value._store.validated=1):T._store&&(T._store.validated=1))}function u(T){return typeof T=="object"&&T!==null&&T.$$typeof===p}var f=L,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"),S=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),U=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,N=Array.isArray,A=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(T){return T()}};var F,P={},O=f.react_stack_bottom_frame.bind(f,s)(),$=A(i(s)),j={};Xi.Fragment=y,Xi.jsx=function(T,W,z){var G=1e4>U.recentlyCreatedOwnerStacks++;return h(T,W,z,!1,G?Error("react-stack-top-frame"):O,G?A(i(T)):$)},Xi.jsxs=function(T,W,z){var G=1e4>U.recentlyCreatedOwnerStacks++;return h(T,W,z,!0,G?Error("react-stack-top-frame"):O,G?A(i(T)):$)}})()),Xi}var Uh;function wC(){return Uh||(Uh=1,process.env.NODE_ENV==="production"?qo.exports=bC():qo.exports=kC()),qo.exports}var w=wC();const Xh=Object.freeze({display:"flex",flexDirection:"row",inlineSize:"100%",blockSize:"100%",minInlineSize:0,minBlockSize:0}),SC=Object.freeze({flex:"1 1 0%",minInlineSize:0,minBlockSize:0,overflow:"clip"}),vC=Object.freeze({display:"flex",flex:"none",minBlockSize:0}),TC=Object.freeze({position:"absolute",insetBlock:0,insetInline:0,overflowY:"scroll",visibility:"hidden",pointerEvents:"none"}),_C=Object.freeze({scrollbarWidth:"none"}),BC=.01,Gh=Object.freeze({scroller:null,barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1}),Fa=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},LC=(e,t,r)=>{const i=getComputedStyle(e),o=Fa(i.width),s=e.getBoundingClientRect();if(o<=0||s.width<=0)return{barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1};const a=s.width/o,n=(s.width-t.getBoundingClientRect().width)/a-Fa(i.borderLeftWidth)-Fa(i.borderRightWidth),l=Math.max(0,Math.ceil(n-BC));return{barInlineSize:r.getBoundingClientRect().width/a,nativeBarInlineSize:l,overlaysScrollbars:l===0&&t.offsetWidth>0&&t.offsetWidth===t.clientWidth}},EC=(e,t,r,i,o)=>{const[s,a]=L.useState(Gh),n=L.useRef(o),l=L.useRef(0);return L.useLayoutEffect(()=>{n.current=o}),L.useLayoutEffect(()=>{const c=m=>{l.current!==m&&(l.current=m,n.current?.(m))},h=t.current,d=r.current,u=i.current;if(!e||h===null||d===null||u===null){a(Gh),c(0);return}const f=()=>{const{barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x}=LC(h,d,u);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)};f();const p=new ResizeObserver(f);return p.observe(h),p.observe(d),p.observe(u),window.addEventListener("resize",f),()=>{p.disconnect(),window.removeEventListener("resize",f)}},[e,t,r,i]),s},FC=(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 Qd({scrollerProps:e,scrollerRef:t,children:r,renderScrollBar:i,rowClassName:o,rowStyle:s,onBarInlineSizeChange:a}){const n=L.useRef(null),l=L.useRef(null),c=L.useRef(null),h=i!==void 0,d=EC(h,n,l,c,a),u=L.useCallback(m=>{n.current=m;const y=FC(t,m);return()=>{n.current=null,y()}},[t]),f=h?{...e.style,position:"relative",boxSizing:"border-box",overflowY:"scroll",width:`calc(100% + ${d.nativeBarInlineSize}px)`,...d.overlaysScrollbars?_C:void 0}:e.style,p=w.jsxs("div",{...e,ref:u,style:f,children:[r,h&&w.jsx("span",{ref:l,"data-aqmd-scroll-bar-probe":!0,"aria-hidden":"true",style:TC})]});return h?w.jsxs("div",{"data-aqmd-scroll-row":!0,className:o,style:s===void 0?Xh:{...Xh,...s},children:[w.jsx("div",{"data-aqmd-scroll-clip":!0,style:SC,children:p}),w.jsx("div",{ref:c,"data-aqmd-scroll-bar":!0,style:vC,children:d.scroller!==null&&i(d.scroller)})]}):p}const AC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),MC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),Vh=e=>{const t=MC(e);return t.charAt(0).toUpperCase()+t.slice(1)},Jd=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim(),$C=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var OC={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 RC=L.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:a,...n},l)=>L.createElement("svg",{ref:l,...OC,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:Jd("lucide",o),...!s&&!$C(n)&&{"aria-hidden":"true"},...n},[...a.map(([c,h])=>L.createElement(c,h)),...Array.isArray(s)?s:[s]]));const Tt=(e,t)=>{const r=L.forwardRef(({className:i,...o},s)=>L.createElement(RC,{ref:s,iconNode:t,className:Jd(`lucide-${AC(Vh(e))}`,`lucide-${e}`,i),...o}));return r.displayName=Vh(e),r};const IC=[["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=Tt("image-off",IC);class DC extends L.Component{constructor(t){super(t),this.state={content:t.content,failed:!1}}static getDerivedStateFromProps(t,r){return t.content===r.content?null:{content:t.content,failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?w.jsxs("div",{"data-aqmd-block-failure":"",children:[w.jsx("p",{"data-aqmd-block-failure-notice":"",lang:this.props.label.lang,children:this.props.label.text}),w.jsx("pre",{"data-aqmd-block-failure-text":"",children:this.props.text()})]}):this.props.children}}const tu=Object.freeze({blockFailed:{text:"This block could not be shown.",lang:"en"}}),NC=1024,Cs=(e,t)=>e.fingerprint===t.fingerprint&&e.content===t.content,qC=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&Cs(e[r],t[r]);)r+=1;let i=0;for(;i<e.length-r&&i<t.length-r&&Cs(e[e.length-1-i],t[t.length-1-i]);)i+=1;const o=Array.from({length:r},(n,l)=>[l,l]),s=Array.from({length:i},(n,l)=>[e.length-i+l,t.length-i+l]),a=zC(e,t,r,e.length-i,t.length-i);return[...o,...a,...s]},zC=(e,t,r,i,o)=>{const s=new Set(e.slice(r,i).map(S=>S.fingerprint)),a=new Set(t.slice(r,o).map(S=>S.fingerprint)),n=[];for(let S=r;S<i;S+=1)a.has(e[S].fingerprint)&&n.push(S);const l=[];for(let S=r;S<o;S+=1)s.has(t[S].fingerprint)&&l.push(S);const c=n.length,h=l.length;if(c===0||h===0)return[];const d=(S,v)=>Cs(e[n[S]],t[l[v]]),u=(S,v)=>e[n[S]].fingerprint===t[l[v]].fingerprint,f=(S,v)=>{let _=S;for(;_<c&&_+v<h&&d(_,_+v);)_+=1;return _},p=[Int32Array.of(f(0,0))],m=[Uint8Array.of(Aa)],y=h-c;let x=0;for(;!(y>=-x&&y<=x&&p[x][y+x]===c);){if(x+=1,x>NC)return[];const S=p[x-1],v=B=>B>=-(x-1)&&B<=x-1?S[B+x-1]:-1,_=new Int32Array(2*x+1).fill(-1),E=new Uint8Array(2*x+1);for(let B=-x;B<=x;B+=1){if(B<-c||B>h)continue;let I=-1,M=Aa;const D=v(B);D!==-1&&D<c&&D+B<h&&u(D,D+B)&&(I=D+1,M=Kh);const U=v(B+1);U!==-1&&U+1<=c&&U+1>I&&(I=U+1,M=Zh);const q=v(B-1);q!==-1&&q+B<=h&&q>I&&(I=q,M=Ma),I!==-1&&(_[B+x]=f(I,B),E[B+x]=M)}p.push(_),m.push(E)}const C=[];let k=y;for(let S=x;S>=0;S-=1){const v=p[S][k+S],_=m[S][k+S],E=_===Zh?k+1:_===Ma?k-1:k,B=_===Aa?0:p[S-1][E+S-1]+(_===Ma?0:1);for(let I=v-1;I>=B;I-=1)C.push([n[I],l[I+k]]);_===Kh&&C.push([n[B-1],l[B-1+k]]),k=E}return C.reverse()},Aa=0,Kh=1,Zh=2,Ma=3,jC=(e,t)=>{const r=e.map(()=>null),i=new Set;for(const[n,l]of qC(t,e))r[l]=t[n].key,i.add(n);const o=new Map;for(const[n,l]of t.entries()){if(i.has(n))continue;const c=o.get(l.fingerprint);c===void 0?o.set(l.fingerprint,[n]):c.push(n)}const s=n=>{for(const[l,c]of e.entries()){if(r[l]!==null)continue;const h=o.get(c.fingerprint),d=h===void 0?-1:h.findIndex(u=>n(c,t[u]));h!==void 0&&d!==-1&&(r[l]=t[h.splice(d,1)[0]].key)}};s(Cs),s(()=>!0);const a=new Set(r.filter(n=>n!==null));return e.map((n,l)=>{let c=r[l];if(c===null){let h=0;for(;a.has(`${n.fingerprint}.${h}`);)h+=1;c=`${n.fingerprint}.${h}`,a.add(c)}return{...n,key:c}})};const WC=[["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"}]],HC=Tt("building-2",WC);const YC=[["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"}]],Qh=Tt("globe",YC),UC=/^[a-z]{2,3}$/u,XC=e=>{const t=e.trim().split("-",1)[0]?.toLowerCase()??"";return UC.test(t)?t:null},GC=()=>()=>{},VC=e=>{const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>t.disconnect()},Sl=()=>L.useSyncExternalStore(GC,()=>window.location.origin,()=>null),KC=()=>L.useSyncExternalStore(VC,()=>XC(document.documentElement.lang),()=>null),ZC=/^[1-9]\d{0,4}$/u,Jh=e=>e!==void 0&&ZC.test(e.trim())?Number(e.trim()):null,QC=({embed:e,label:t,insideAnchor:r,children:i})=>{const o=Sl(),s=new URL(e.src);if(o!==null&&s.origin!==o&&!r)return i;const a=Jh(e.attributes.width),n=Jh(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":o===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}: ${s.hostname}`}):w.jsx("a",{href:s.href,target:"_blank",rel:"noreferrer",lang:h,children:c??`${t.text}: ${s.hostname}`})})},eu=({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,o=new Map,s=[];let a=0;const n=(h,d,u)=>{if(o.get(h)===d&&(o.delete(h),u!==null)){i.set(h,u);for(const f of i.keys()){if(i.size<=t)break;i.delete(f)}for(const f of d.subscriptions)f.listener(u)}},l=()=>{for(;a<e;){const h=s.shift();if(h===void 0)return;const d=o.get(h);if(d===void 0)continue;const u=new AbortController;d.controller=u,a+=1,new Promise(f=>f(d.start(AbortSignal.any([u.signal,AbortSignal.timeout(r)])))).then(f=>n(h,d,{ok:!0,value:f}),()=>n(h,d,u.signal.aborted?null:{ok:!1})).finally(()=>{a-=1,l()})}};return Object.freeze({subscribe:(h,d,u)=>{const f=i.get(h);if(f!==void 0)return i.delete(h),i.set(h,f),u(f),()=>{};let p=o.get(h);p===void 0&&(p={start:d,subscriptions:new Set,controller:null},o.set(h,p),s.push(h));const m=p,y={listener:u};return m.subscriptions.add(y),l(),()=>{m.subscriptions.delete(y),!(m.subscriptions.size>0||o.get(h)!==m)&&(o.delete(h),m.controller===null?s.splice(s.indexOf(h),1):m.controller.abort())}}})},JC=eu({concurrency:2,capacity:256,timeoutMs:15e3}),tb="[data-aqmd-scroll-container]",eb=async(e,t)=>{let r;try{r=await fetch(e,{credentials:"same-origin",redirect:"error",headers:{accept:"application/json"},signal:t})}catch(s){if(t.aborted)throw s;return{kind:"error",cause:"network error"}}if(r.status===204){const s=Ne.linkCardSkipReasonOf(r.headers.get(Ne.LINK_CARD_SKIP_HEADER));return s===null?{kind:"error",cause:"HTTP 204 without a known skip reason"}:{kind:"skip",reason:s}}if(!r.ok)return{kind:"error",cause:`HTTP ${r.status}`};let i;try{i=await r.json()}catch(s){if(t.aborted)throw s;return{kind:"error",cause:`HTTP ${r.status}, not JSON`}}const o=Ne.linkCardMetadataOf(i);return o===null?{kind:"error",cause:`HTTP ${r.status}, not a JSON object`}:{kind:"card",metadata:o}},rb=e=>e.ok?e.value.kind==="card"?null:e.value.kind==="skip"?e.value.reason:e.value.cause:"network error",tc=(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})]})]}),ib=({href:e,endpoint:t,size:r,fallback:i})=>{const o=Sl(),s=L.useRef(null),a=new URL(e),n=`${t}
|
|
7
|
+
${a.href}`,[l,c]=L.useState(null);L.useEffect(()=>{const x=s.current;if(x===null||o===null)return;let C=null;const k=new IntersectionObserver(S=>{C!==null||!S.some(v=>v.isIntersecting)||(k.disconnect(),C=JC.subscribe(n,v=>eb(Ne.linkCardRequestOf(t,new URL(e),o),v),v=>{c({key:n,outcome:v});const _=rb(v);_!==null&&un.linkCardLogger.info(`No link card for ${e} (${_})`)}))},{root:x.closest(tb),rootMargin:"100% 0px"});return k.observe(x),()=>{k.disconnect(),C?.()}},[n,t,e,o]);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||o===null)return w.jsx("a",{ref:s,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?HC:Qh;return w.jsx("a",{ref:s,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:u}=d,f=new URL(o).hostname,p=tc(u.image,f),m=tc(u.icon,f),y=u.siteName===null?a.hostname:`${u.siteName} · ${a.hostname}`;return r==="compact"?w.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":"compact",children:w.jsx($a,{tile:m===null?w.jsx(Qh,{"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:u.title??e,secondary:y})}):w.jsxs("a",{ref:s,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:u.title??e}),u.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:u.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"})]})},ru=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(!Rr.isEmbedProviderId(t))throw new RangeError(`[@aiquants/markdown] embeds.providers holds an unknown provider id ${JSON.stringify(t)}; known ids are ${Rr.EMBED_PROVIDER_IDS.join(", ")}`);if(e.linkCardEndpoint!==null&&!Ne.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&&!Ne.isLinkCardSize(e.linkCardSize))throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${Ne.LINK_CARD_SIZES.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);return e},ro=new WeakMap;let zo=0;const ec=e=>{if(e.source===null)return;const t=ro.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(Rr.EMBED_FRAME_HEIGHT_LIMITS.max,Math.max(Rr.EMBED_FRAME_HEIGHT_LIMITS.min,Math.ceil(r)));i!==t.last&&(t.last=i,t.watch.set(i))},ob=(e,t)=>{const r={watch:t,last:null};return ro.has(e)||(zo+=1,zo===1&&window.addEventListener("message",ec)),ro.set(e,r),()=>{ro.get(e)===r&&(ro.delete(e),zo-=1,zo===0&&window.removeEventListener("message",ec))}},sb=eu({concurrency:2,capacity:256,timeoutMs:5e3}),ab=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()},nb=(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`}}},lb=Object.freeze({marginInline:0}),Oa=Object.freeze({kind:"pending"}),hb=Object.freeze({kind:"narrow"}),cb=Object.freeze({kind:"fallback"}),db=(e,t,r,i,o)=>{if(t===null)return Oa;let s;if(e.kind==="frame")s=e.srcOf(r);else{if(i===null)return Oa;s=i.ok?e.srcOf(i.value,r):null}if(s===null||new URL(s).origin===t)return cb;const{minWidth:a,maxWidth:n}=e.layout;if(a!==null){if(o===null)return Oa;if(Math.min(o,n??Number.POSITIVE_INFINITY)<a)return hb}return{kind:"frame",src:s}},ub=({resolution:e,caption:t,fallback:r,theme:i,labels:o})=>{const s=Sl(),a=KC(),[n,l]=L.useState(null),[c,h]=L.useState(null),d=e.kind==="lookup"?e.request.href:null,[u,f]=L.useState(null);L.useEffect(()=>{if(d!==null)return sb.subscribe(d,B=>ab(new URL(d),B),B=>f({key:d,outcome:B}))},[d]);const{provider:p,layout:m}=e,y=db(e,s,{theme:i,lang:a},u!==null&&u.key===d?u.outcome:null,n),x=L.useCallback(B=>{if(B===null)return;l(B.getBoundingClientRect().width);const I=new ResizeObserver(()=>l(B.getBoundingClientRect().width));return I.observe(B),()=>I.disconnect()},[]),C=y.kind==="frame"?y.src:null,k=c!==null&&c.src===C?c.height:null,S=L.useCallback(B=>{if(!(B===null||B.contentWindow===null||m.kind!=="message"||C===null))return ob(B.contentWindow,{origin:p.frameOrigin,src:C,heightOf:m.heightOf,set:I=>h({src:C,height:I})})},[m,p.frameOrigin,C]);if(y.kind==="fallback")return r;const v=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:[v,r]});const _=p.content==="video"?o.embeddedVideo:o.embeddedPost,{frame:E}=p;return w.jsxs(w.Fragment,{children:[v,w.jsxs("figure",{"data-embed-provider":p.id,"data-embed-state":y.kind,style:lb,children:[w.jsx("div",{"data-embed-box":"","data-aqmd-embed-surface":"",style:nb(m,k),className:"noscript:hidden overflow-hidden rounded-lg",children:y.kind==="frame"?w.jsx("iframe",{ref:S,src:y.src,title:`${p.name}: ${_.text}`,lang:_.lang,loading:"lazy",allow:E.allow??void 0,allowFullScreen:E.allowFullScreen,sandbox:E.sandbox,referrerPolicy:E.referrerPolicy,scrolling:E.scrolling??void 0,className:"block h-full w-full border-0"},y.src):null}),w.jsx("figcaption",{className:"mt-2",children:t})]})]})},fb=["title","width","height","allow","allowfullscreen","sandbox","referrerpolicy","loading","frameborder","scrolling"],pb=(e,t)=>cr.allowedFrameUrlOf(e,t)!==null,gb=(e,t)=>{const r=new Map(Object.entries(e).map(([s,a])=>[s.toLowerCase(),a])),i=cr.allowedFrameUrlOf(r.get("src"),t);if(i===null)return null;const o={};for(const s of fb){const a=r.get(s);if(a!==void 0)if(s==="allow"){const n=cr.reduceFrameFeatures(a);n!==null&&(o.allow=n)}else if(s==="referrerpolicy"){const n=a.trim().toLowerCase();cr.EMBED_FRAME_REFERRER_POLICIES.has(n)&&(o.referrerpolicy=n)}else o[s]=a}return Object.freeze({src:i.href,attributes:Object.freeze(o)})},mb=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"]),yb=new Set(["id","class","title","lang","dir","role","hidden","translate","style"]),xb=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"]),rc="language-",Cb=/[\t\n\f\r ]+/u,bb=new Set(["h1","h2","h3","h4","h5","h6"]),ic=Object.freeze({sup:/^fnref\d*:\d+$/u,li:/^fn:\d+$/u}),oc="user-content-",Gt=["align"],Jr=["width","height"],sc=["colspan","rowspan","headers","scope","abbr","align","valign","width","height"],Ra=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:Gt,cite:[],code:[It.CODE_META_ATTRIBUTE],col:["span",...Gt,...Jr],colgroup:["span",...Gt,...Jr],dd:[],del:["cite","datetime"],details:["open"],dfn:[],div:Gt,dl:[],dt:[],em:[],figcaption:[],figure:[],footer:[],h1:Gt,h2:Gt,h3:Gt,h4:Gt,h5:Gt,h6:Gt,header:[],hgroup:[],hr:[],i:[],img:["src","alt","loading","decoding",...Gt,...Jr,"data-asset-src","data-asset-exists"],ins:["cite","datetime"],kbd:[],li:["value"],main:[],mark:[],nav:[],ol:["start","reversed","type"],p:Gt,pre:[],q:["cite"],rp:[],rt:[],ruby:[],s:[],samp:[],section:["data-footnotes"],small:[],source:["src","type"],span:[],strong:[],sub:[],summary:[],sup:[],table:[...Gt,"border",...Jr],tbody:[...Gt,"valign"],td:sc,tfoot:[...Gt,"valign"],th:sc,thead:[...Gt,"valign"],time:["datetime"],tr:[...Gt,"valign"],u:[],ul:[],var:[],video:["src","poster","controls","loop","muted","playsinline","preload",...Jr],wbr:[]}),Ia=Object.freeze({svg:["viewbox","version","xmlns","focusable","fill",...Jr],g:["fill","fill-rule","clip-rule"],path:["d","fill","fill-rule","clip-rule"]}),kb=new Set(["svg","g"]),wb=new Set(["href","src","cite","poster",cr.EMBED_LINK_ATTRIBUTE]),Sb=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu,vb=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,Tb=new Set(["left","right","center","justify","start","end"]),Mo=e=>vb.test(e.replace(Sb,"")),_b=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 o=r.slice(i+1).trim().toLowerCase();Tb.has(o)&&(t=o)}return t===null?null:`text-align: ${t}`},Bb=e=>{const t=e.split(Cb).filter(r=>xb.has(r)||r.startsWith(rc)&&r.length>rc.length);return t.length===0?null:t.join(" ")},Lb=(e,t)=>bb.has(e)||t.startsWith(oc)&&t.length>oc.length||Object.hasOwn(ic,e)&&ic[e].test(t),Eb=e=>{const t=new Map;for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();t.has(o)||t.set(o,i)}return t},Gi=(e,t,r)=>{const i={};for(const[o,s]of t){if(o===vi.SOURCE_LINES_ATTRIBUTE){vi.parseSourceLines(s)!==null&&(i[o]=s);continue}if((yb.has(o)||r.includes(o)||o.startsWith("aria-")&&o.length>5)&&!(wb.has(o)&&!Mo(s))&&!(o==="fill"&&/url\s*\(/iu.test(s))&&!(o==="id"&&!Lb(e,s))){if(o==="class"||o==="style"){const a=o==="class"?Bb(s):_b(s);a!==null&&(i[o]=a);continue}i[o]=s}}return i},Fb=e=>e.get("type")?.trim().toLowerCase()==="checkbox"&&e.has("disabled"),ta=(e,t,r)=>{const i=e.toLowerCase(),o=r.parentName===null?null:r.parentName.toLowerCase(),s=Eb(t);if(o!==null&&kb.has(o)){const n=i!=="svg"&&Object.hasOwn(Ia,i)?Ia[i]:void 0;return n===void 0?{action:"remove"}:{action:"keep",attributes:Gi(i,s,n)}}if(i==="svg")return{action:"keep",attributes:Gi(i,s,Ia.svg)};if(i==="iframe"){const n=gb(Object.fromEntries(s),r.iFrameAllowedDomains);return n===null?{action:"remove"}:{action:"embed",embed:n,pluginType:s.get("data-plugin-type")??null}}if(i==="p"){const n=Gi(i,s,Ra.p),l=s.get(cr.EMBED_LINK_ATTRIBUTE);return l!==void 0&&Mo(l)?{action:"placeholder",attributes:n,link:l}:{action:"keep",attributes:n}}if(i==="input")return Fb(s)?{action:"keep",attributes:Gi(i,s,["type","checked","disabled"])}:{action:"remove"};if(mb.has(i))return{action:"remove"};const a=Object.hasOwn(Ra,i)?Ra[i]:void 0;return a===void 0?{action:"unwrap"}:{action:"keep",attributes:Gi(i,s,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 Ab=typeof document<"u"&&!!document.documentMode;let Pa;function Mb(){return Pa||(Pa=document.createElement("div").style)}const ac=["webkit","moz","ms"],jo={};function vl(e){if(jo[e])return jo[e];const t=Mb();if(e in t)return jo[e]=e;const r=e[0].toUpperCase()+e.slice(1);let i=ac.length;for(;i--;){const o=`${ac[i]}${r}`;if(o in t)return jo[e]=o}}function Wo(e,t){return parseFloat(t[vl(e)])||0}function Ho(e,t,r=window.getComputedStyle(e)){const i=t==="border"?"Width":"";return{left:Wo(`${t}Left${i}`,r),right:Wo(`${t}Right${i}`,r),top:Wo(`${t}Top${i}`,r),bottom:Wo(`${t}Bottom${i}`,r)}}function oi(e,t,r){e.style[vl(t)]=r}function $b(e,t){const r=vl("transform");oi(e,"transition",`${r} ${t.duration}ms ${t.easing}`)}function Ob(e,{x:t,y:r,scale:i,isSVG:o},s){if(oi(e,"transform",`scale(${i}) translate(${t}px, ${r}px)`),o&&Ab){const a=window.getComputedStyle(e).getPropertyValue("transform");e.setAttribute("transform",a)}}function Da(e){let t=e.parentNode;(!t||t.nodeType!==1)&&(t=document.documentElement);const r=window.getComputedStyle(e),i=window.getComputedStyle(t),o=e.getBoundingClientRect(),s=t.getBoundingClientRect();return{elem:{style:r,width:o.width,height:o.height,top:o.top,bottom:o.bottom,left:o.left,right:o.right,margin:Ho(e,"margin",r),border:Ho(e,"border",r)},parent:{style:i,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,padding:Ho(t,"padding",i),border:Ho(t,"border",i)}}}let Co={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Co={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Co={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function Na(e,t,r,i){Co[e].split(" ").forEach(o=>{t.addEventListener(o,r,i)})}function qa(e,t,r){Co[e].split(" ").forEach(i=>{t.removeEventListener(i,r)})}function iu(e,t){let r=e.length;for(;r--;)if(e[r].pointerId===t.pointerId)return r;return-1}function pn(e,t){let r;if(t.touches){r=0;for(const i of t.touches)i.pointerId=r++,pn(e,i);return}r=iu(e,t),r>-1&&e.splice(r,1),e.push(t)}function Rb(e,t){if(t.touches){for(;e.length;)e.pop();return}const r=iu(e,t);r>-1&&e.splice(r,1)}function nc(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 za(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 Ib(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 Pb(e){return(e.getAttribute("class")||"").trim()}function Db(e,t){return e.nodeType===1&&` ${Pb(e)} `.indexOf(` ${t} `)>-1}function Nb(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 qb=/^http:[\w\.\/]+svg$/;function zb(e){return qb.test(e.namespaceURI)&&e.nodeName.toLowerCase()!=="svg"}function jb(e){const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}const ou={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:Ob,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function su(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(!Ib(e))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t={...ou,...t};const r=zb(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,oi(e,"transformOrigin",typeof t.origin=="string"?t.origin:r?"0 0":"50% 50%");function o(){i.style.overflow="",i.style.userSelect="",i.style.touchAction="",i.style.cursor="",e.style.cursor="",e.style.userSelect="",e.style.touchAction="",oi(e,"transformOrigin","")}function s($={}){for(const j in $)$.hasOwnProperty(j)&&(t[j]=$[j]);($.hasOwnProperty("cursor")||$.hasOwnProperty("canvas"))&&(i.style.cursor=e.style.cursor="",(t.canvas?i:e).style.cursor=t.cursor),$.hasOwnProperty("overflow")&&(i.style.overflow=$.overflow),$.hasOwnProperty("touchAction")&&(i.style.touchAction=$.touchAction,e.style.touchAction=$.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($,j,T){if(T.silent)return;const W=new CustomEvent($,{detail:j});e.dispatchEvent(W)}function d($,j,T){const W={x:a,y:n,scale:l,isSVG:r,originalEvent:T};return requestAnimationFrame(()=>{typeof j.animate=="boolean"&&(j.animate?$b(e,j):oi(e,"transition","none")),j.setTransform(e,W,j),h($,W,j),h("panzoomchange",W,j)}),W}function u($,j,T,W){const z={...t,...W},G={x:a,y:n,opts:z};if(!W?.force&&(z.disablePan||z.panOnlyWhenZoomed&&l===z.startScale))return G;if($=parseFloat($),j=parseFloat(j),z.disableXAxis||(G.x=(z.relative?a:0)+$),z.disableYAxis||(G.y=(z.relative?n:0)+j),z.contain){const X=Da(e),K=X.elem.width/l,Q=X.elem.height/l,nt=K*T,gt=Q*T,ut=(nt-K)/2,mt=(gt-Q)/2;if(z.contain==="inside"){const Lt=(-X.elem.margin.left-X.parent.padding.left+ut)/T,Ft=(X.parent.width-nt-X.parent.padding.left-X.elem.margin.left-X.parent.border.left-X.parent.border.right+ut)/T;G.x=Math.max(Math.min(G.x,Ft),Lt);const Mt=(-X.elem.margin.top-X.parent.padding.top+mt)/T,Ht=(X.parent.height-gt-X.parent.padding.top-X.elem.margin.top-X.parent.border.top-X.parent.border.bottom+mt)/T;G.y=Math.max(Math.min(G.y,Ht),Mt)}else if(z.contain==="outside"){const Lt=(-(nt-X.parent.width)-X.parent.padding.left-X.parent.border.left-X.parent.border.right+ut)/T,Ft=(ut-X.parent.padding.left)/T;G.x=Math.max(Math.min(G.x,Ft),Lt);const Mt=(-(gt-X.parent.height)-X.parent.padding.top-X.parent.border.top-X.parent.border.bottom+mt)/T,Ht=(mt-X.parent.padding.top)/T;G.y=Math.max(Math.min(G.y,Ht),Mt)}}return z.roundPixels&&(G.x=Math.round(G.x),G.y=Math.round(G.y)),G}function f($,j){const T={...t,...j},W={scale:l,opts:T};if(!j?.force&&T.disableZoom)return W;let z=t.minScale,G=t.maxScale;if(T.contain){const X=Da(e),K=X.elem.width/l,Q=X.elem.height/l;if(K>1&&Q>1){const nt=X.parent.width-X.parent.border.left-X.parent.border.right,gt=X.parent.height-X.parent.border.top-X.parent.border.bottom,ut=nt/K,mt=gt/Q;t.contain==="inside"?G=Math.min(G,ut,mt):t.contain==="outside"&&(z=Math.max(z,ut,mt))}}return W.scale=Math.min(Math.max($,z),G),W}function p($,j,T,W){const z=u($,j,l,T);return a!==z.x||n!==z.y?(a=z.x,n=z.y,d("panzoompan",z.opts,W)):{x:a,y:n,scale:l,isSVG:r,originalEvent:W}}function m($,j,T){const W=f($,j),z=W.opts;if(!j?.force&&z.disableZoom)return;$=W.scale;let G=a,X=n;if(z.focal){const Q=z.focal;G=(Q.x/$-Q.x/l+a*$)/$,X=(Q.y/$-Q.y/l+n*$)/$}const K=u(G,X,$,{relative:!1,force:!0});return a=K.x,n=K.y,l=$,d("panzoomzoom",z,T)}function y($,j){const T={...t,animate:!0,...j};return m(l*Math.exp(($?1:-1)*T.step),T)}function x($){return y(!0,$)}function C($){return y(!1,$)}function k($,j,T,W){const z=Da(e),G={width:z.parent.width-z.parent.padding.left-z.parent.padding.right-z.parent.border.left-z.parent.border.right,height:z.parent.height-z.parent.padding.top-z.parent.padding.bottom-z.parent.border.top-z.parent.border.bottom};let X=j.clientX-z.parent.left-z.parent.padding.left-z.parent.border.left-z.elem.margin.left,K=j.clientY-z.parent.top-z.parent.padding.top-z.parent.border.top-z.elem.margin.top;r||(X-=z.elem.width/l/2,K-=z.elem.height/l/2);const Q={x:X/G.width*(G.width*$),y:K/G.height*(G.height*$)};return m($,{...T,animate:!1,focal:Q},W)}function S($,j){$.preventDefault();const T={...t,...j,animate:!1},z=($.deltaY===0&&$.deltaX?$.deltaX:$.deltaY)<0?1:-1,G=f(l*Math.exp(z*T.step/3),T).scale;return k(G,$,T,$)}function v($){const j={...t,animate:!0,force:!0,...$};l=f(j.startScale,j).scale;const T=u(j.startX,j.startY,l,j);return a=T.x,n=T.y,d("panzoomreset",j)}let _,E,B,I,M,D;const U=[];function q($){if(Nb($.target,t))return;pn(U,$),c=!0,t.handleStartEvent($),_=a,E=n,h("panzoomstart",{x:a,y:n,scale:l,isSVG:r,originalEvent:$},t);const j=nc(U);B=j.clientX,I=j.clientY,M=l,D=za(U)}function N($){if(!c||_===void 0||E===void 0||B===void 0||I===void 0)return;pn(U,$);const j=nc(U),T=U.length>1;let W=l;if(T){D===0&&(D=za(U));const z=za(U)-D;W=f(z*t.step/80+M).scale,k(W,j,{animate:!1},$)}(!T||t.pinchAndPan)&&p(_+(j.clientX-B)/W,E+(j.clientY-I)/W,{animate:!1},$)}function A($){U.length===1&&h("panzoomend",{x:a,y:n,scale:l,isSVG:r,originalEvent:$},t),Rb(U,$),c&&(c=!1,_=E=B=I=void 0)}let F=!1;function P(){F||(F=!0,Na("down",t.canvas?i:e,q),Na("move",document,N,{passive:!0}),Na("up",document,A,{passive:!0}))}function O(){F=!1,qa("down",t.canvas?i:e,q),qa("move",document,N),qa("up",document,A)}return t.noBind||P(),{bind:P,destroy:O,eventNames:Co,getPan:()=>({x:a,y:n}),getScale:()=>l,getOptions:()=>jb(t),handleDown:q,handleMove:N,handleUp:A,pan:p,reset:v,resetStyle:o,setOptions:s,setStyle:($,j)=>oi(e,$,j),zoom:m,zoomIn:x,zoomOut:C,zoomToPoint:k,zoomWithWheel:S}}su.defaultOptions=ou;const Wb=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Hb=Tt("arrow-down",Wb);const Yb=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ub=Tt("arrow-left",Yb);const Xb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Gb=Tt("arrow-right",Xb);const Vb=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Kb=Tt("arrow-up",Vb);const Zb=[["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"}]],gn=Tt("refresh-cw",Zb);const Qb=[["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"}]],Jb=Tt("settings-2",Qb);const t1=[["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"}]],au=Tt("zoom-in",t1);const e1=[["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"}]],nu=Tt("zoom-out",e1);var lu=Object.defineProperty,g=(e,t)=>lu(e,"name",{value:t,configurable:!0}),hu=(e,t)=>{for(var r in t)lu(e,r,{get:t[r],enumerable:!0})},os={exports:{}},r1=os.exports,lc;function i1(){return lc||(lc=1,(function(e,t){(function(r,i){e.exports=i()})(r1,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",u="quarter",f="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(N){var A=["th","st","nd","rd"],F=N%100;return"["+N+(A[(F-20)%10]||A[F]||A[0])+"]"}},k=function(N,A,F){var P=String(N);return!P||P.length>=A?N:""+Array(A+1-P.length).join(F)+N},S={s:k,z:function(N){var A=-N.utcOffset(),F=Math.abs(A),P=Math.floor(F/60),O=F%60;return(A<=0?"+":"-")+k(P,2,"0")+":"+k(O,2,"0")},m:function N(A,F){if(A.date()<F.date())return-N(F,A);var P=12*(F.year()-A.year())+(F.month()-A.month()),O=A.clone().add(P,d),$=F-O<0,j=A.clone().add(P+($?-1:1),d);return+(-(P+(F-O)/($?O-j:j-O))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:d,y:f,w:h,d:c,D:p,h:l,m:n,s:a,ms:s,Q:u}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},v="en",_={};_[v]=C;var E="$isDayjsObject",B=function(N){return N instanceof U||!(!N||!N[E])},I=function N(A,F,P){var O;if(!A)return v;if(typeof A=="string"){var $=A.toLowerCase();_[$]&&(O=$),F&&(_[$]=F,O=$);var j=A.split("-");if(!O&&j.length>1)return N(j[0])}else{var T=A.name;_[T]=A,O=T}return!P&&O&&(v=O),O||!P&&v},M=function(N,A){if(B(N))return N.clone();var F=typeof A=="object"?A:{};return F.date=N,F.args=arguments,new U(F)},D=S;D.l=I,D.i=B,D.w=function(N,A){return M(N,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var U=(function(){function N(F){this.$L=I(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[E]=!0}var A=N.prototype;return A.parse=function(F){this.$d=(function(P){var O=P.date,$=P.utc;if(O===null)return new Date(NaN);if(D.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var j=O.match(y);if(j){var T=j[2]-1||0,W=(j[7]||"0").substring(0,3);return $?new Date(Date.UTC(j[1],T,j[3]||1,j[4]||0,j[5]||0,j[6]||0,W)):new Date(j[1],T,j[3]||1,j[4]||0,j[5]||0,j[6]||0,W)}}return new Date(O)})(F),this.init()},A.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},A.$utils=function(){return D},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function(F,P){var O=M(F);return this.startOf(P)<=O&&O<=this.endOf(P)},A.isAfter=function(F,P){return M(F)<this.startOf(P)},A.isBefore=function(F,P){return this.endOf(P)<M(F)},A.$g=function(F,P,O){return D.u(F)?this[P]:this.set(O,F)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(F,P){var O=this,$=!!D.u(P)||P,j=D.p(F),T=function(gt,ut){var mt=D.w(O.$u?Date.UTC(O.$y,ut,gt):new Date(O.$y,ut,gt),O);return $?mt:mt.endOf(c)},W=function(gt,ut){return D.w(O.toDate()[gt].apply(O.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(ut)),O)},z=this.$W,G=this.$M,X=this.$D,K="set"+(this.$u?"UTC":"");switch(j){case f:return $?T(1,0):T(31,11);case d:return $?T(1,G):T(0,G+1);case h:var Q=this.$locale().weekStart||0,nt=(z<Q?z+7:z)-Q;return T($?X-nt:X+(6-nt),G);case c:case p:return W(K+"Hours",0);case l:return W(K+"Minutes",1);case n:return W(K+"Seconds",2);case a:return W(K+"Milliseconds",3);default:return this.clone()}},A.endOf=function(F){return this.startOf(F,!1)},A.$set=function(F,P){var O,$=D.p(F),j="set"+(this.$u?"UTC":""),T=(O={},O[c]=j+"Date",O[p]=j+"Date",O[d]=j+"Month",O[f]=j+"FullYear",O[l]=j+"Hours",O[n]=j+"Minutes",O[a]=j+"Seconds",O[s]=j+"Milliseconds",O)[$],W=$===c?this.$D+(P-this.$W):P;if($===d||$===f){var z=this.clone().set(p,1);z.$d[T](W),z.init(),this.$d=z.set(p,Math.min(this.$D,z.daysInMonth())).$d}else T&&this.$d[T](W);return this.init(),this},A.set=function(F,P){return this.clone().$set(F,P)},A.get=function(F){return this[D.p(F)]()},A.add=function(F,P){var O,$=this;F=Number(F);var j=D.p(P),T=function(G){var X=M($);return D.w(X.date(X.date()+Math.round(G*F)),$)};if(j===d)return this.set(d,this.$M+F);if(j===f)return this.set(f,this.$y+F);if(j===c)return T(1);if(j===h)return T(7);var W=(O={},O[n]=i,O[l]=o,O[a]=r,O)[j]||1,z=this.$d.getTime()+F*W;return D.w(z,this)},A.subtract=function(F,P){return this.add(-1*F,P)},A.format=function(F){var P=this,O=this.$locale();if(!this.isValid())return O.invalidDate||m;var $=F||"YYYY-MM-DDTHH:mm:ssZ",j=D.z(this),T=this.$H,W=this.$m,z=this.$M,G=O.weekdays,X=O.months,K=O.meridiem,Q=function(ut,mt,Lt,Ft){return ut&&(ut[mt]||ut(P,$))||Lt[mt].slice(0,Ft)},nt=function(ut){return D.s(T%12||12,ut,"0")},gt=K||function(ut,mt,Lt){var Ft=ut<12?"AM":"PM";return Lt?Ft.toLowerCase():Ft};return $.replace(x,(function(ut,mt){return mt||(function(Lt){switch(Lt){case"YY":return String(P.$y).slice(-2);case"YYYY":return D.s(P.$y,4,"0");case"M":return z+1;case"MM":return D.s(z+1,2,"0");case"MMM":return Q(O.monthsShort,z,X,3);case"MMMM":return Q(X,z);case"D":return P.$D;case"DD":return D.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return Q(O.weekdaysMin,P.$W,G,2);case"ddd":return Q(O.weekdaysShort,P.$W,G,3);case"dddd":return G[P.$W];case"H":return String(T);case"HH":return D.s(T,2,"0");case"h":return nt(1);case"hh":return nt(2);case"a":return gt(T,W,!0);case"A":return gt(T,W,!1);case"m":return String(W);case"mm":return D.s(W,2,"0");case"s":return String(P.$s);case"ss":return D.s(P.$s,2,"0");case"SSS":return D.s(P.$ms,3,"0");case"Z":return j}return null})(ut)||j.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(F,P,O){var $,j=this,T=D.p(P),W=M(F),z=(W.utcOffset()-this.utcOffset())*i,G=this-W,X=function(){return D.m(j,W)};switch(T){case f:$=X()/12;break;case d:$=X();break;case u:$=X()/3;break;case h:$=(G-z)/6048e5;break;case c:$=(G-z)/864e5;break;case l:$=G/o;break;case n:$=G/i;break;case a:$=G/r;break;default:$=G}return O?$:D.a($)},A.daysInMonth=function(){return this.endOf(d).$D},A.$locale=function(){return _[this.$L]},A.locale=function(F,P){if(!F)return this.$L;var O=this.clone(),$=I(F,P,!0);return $&&(O.$L=$),O},A.clone=function(){return D.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()},N})(),q=U.prototype;return M.prototype=q,[["$ms",s],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",f],["$D",p]].forEach((function(N){q[N[1]]=function(A){return this.$g(A,N[0],N[1])}})),M.extend=function(N,A){return N.$i||(N(A,U,M),N.$i=!0),M},M.locale=I,M.isDayjs=B,M.unix=function(N){return M(1e3*N)},M.en=_[v],M.Ls=_,M.p={},M}))})(os)),os.exports}var o1=i1();const cu=Zd(o1);var Ge={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")},Tl=g(function(e="fatal"){let t=Ge.fatal;typeof e=="string"?e.toLowerCase()in Ge&&(t=Ge[e]):typeof e=="number"&&(t=e),V.trace=()=>{},V.debug=()=>{},V.info=()=>{},V.warn=()=>{},V.error=()=>{},V.fatal=()=>{},t<=Ge.fatal&&(V.fatal=console.error?console.error.bind(console,me("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",me("FATAL"))),t<=Ge.error&&(V.error=console.error?console.error.bind(console,me("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",me("ERROR"))),t<=Ge.warn&&(V.warn=console.warn?console.warn.bind(console,me("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",me("WARN"))),t<=Ge.info&&(V.info=console.info?console.info.bind(console,me("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",me("INFO"))),t<=Ge.debug&&(V.debug=console.debug?console.debug.bind(console,me("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",me("DEBUG"))),t<=Ge.trace&&(V.trace=console.debug?console.debug.bind(console,me("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",me("TRACE")))},"setLogLevel"),me=g(e=>`%c${cu().format("ss.SSS")} : ${e} : `,"format");const ss={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 o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return ss.hue2rgb(s,o,e+1/3)*255;case"g":return ss.hue2rgb(s,o,e)*255;case"b":return ss.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){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}}},s1={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},a1={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},pt={channel:ss,lang:s1,unit:a1},nr={};for(let e=0;e<=255;e++)nr[e]=pt.unit.dec2hex(e);const Jt={ALL:0,RGB:1,HSL:2};class n1{constructor(){this.type=Jt.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=Jt.ALL}is(t){return this.type===t}}class l1{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new n1}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Jt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=pt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=pt.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=pt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=pt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=pt.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=pt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),pt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),pt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Jt.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Jt.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Jt.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Jt.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Jt.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Jt.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const ea=new l1({r:0,g:0,b:0,a:0},"transparent"),ni={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(ni.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return ea.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${nr[Math.round(t)]}${nr[Math.round(r)]}${nr[Math.round(i)]}${nr[Math.round(o*255)]}`:`#${nr[Math.round(t)]}${nr[Math.round(r)]}${nr[Math.round(i)]}`}},Er={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(Er.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return pt.channel.clamp.h(parseFloat(r)*.9);case"rad":return pt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return pt.channel.clamp.h(parseFloat(r)*360)}}return pt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Er.re);if(!r)return;const[,i,o,s,a,n]=r;return ea.set({h:Er._hue2deg(i),s:pt.channel.clamp.s(parseFloat(o)),l:pt.channel.clamp.l(parseFloat(s)),a:a?pt.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${pt.lang.round(t)}, ${pt.lang.round(r)}%, ${pt.lang.round(i)}%, ${o})`:`hsl(${pt.lang.round(t)}, ${pt.lang.round(r)}%, ${pt.lang.round(i)}%)`}},uo={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=uo.colors[e];if(t)return ni.parse(t)},stringify:e=>{const t=ni.stringify(e);for(const r in uo.colors)if(uo.colors[r]===t)return r}},io={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(io.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return ea.set({r:pt.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:pt.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:pt.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?pt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${pt.lang.round(t)}, ${pt.lang.round(r)}, ${pt.lang.round(i)}, ${pt.lang.round(o)})`:`rgb(${pt.lang.round(t)}, ${pt.lang.round(r)}, ${pt.lang.round(i)})`}},Me={format:{keyword:uo,hex:ni,rgb:io,rgba:io,hsl:Er,hsla:Er},parse:e=>{if(typeof e!="string")return e;const t=ni.parse(e)||io.parse(e)||Er.parse(e)||uo.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Jt.HSL)||e.data.r===void 0?Er.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?io.stringify(e):ni.stringify(e)},du=(e,t)=>{const r=Me.parse(e);for(const i in t)r[i]=pt.channel.clamp[i](t[i]);return Me.stringify(r)},Je=(e,t,r=0,i=1)=>{if(typeof e!="number")return du(e,{a:t});const o=ea.set({r:pt.channel.clamp.r(e),g:pt.channel.clamp.g(t),b:pt.channel.clamp.b(r),a:pt.channel.clamp.a(i)});return Me.stringify(o)},h1=e=>{const{r:t,g:r,b:i}=Me.parse(e),o=.2126*pt.channel.toLinear(t)+.7152*pt.channel.toLinear(r)+.0722*pt.channel.toLinear(i);return pt.lang.round(o)},c1=e=>h1(e)>=.5,ke=e=>!c1(e),_l=(e,t,r)=>{const i=Me.parse(e),o=i[t],s=pt.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Me.stringify(i)},H=(e,t)=>_l(e,"l",t),Y=(e,t)=>_l(e,"l",-t),b=(e,t)=>{const r=Me.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return du(e,i)},d1=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Me.parse(e),{r:n,g:l,b:c,a:h}=Me.parse(t),d=r/100,u=d*2-1,f=a-h,m=((u*f===-1?u:(u+f)/(1+u*f))+1)/2,y=1-m,x=i*m+n*y,C=o*m+l*y,k=s*m+c*y,S=a*d+h*(1-d);return Je(x,C,k,S)},R=(e,t=100)=>{const r=Me.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,d1(r,e,t)};var mn=g((e,t,{depth:r=2,clobber:i=!1}={})=>{const o={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>mn(e,s,o)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),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(s=>{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=mn(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),qt=mn,We="#ffffff",He="#f2f2f2",dt=g((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),ci,u1=(ci=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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(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||H(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||Y(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(this.mainBkg,10)):(this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(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]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He,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(ci,"Theme"),ci),f1=g(e=>{const t=new u1;return t.calculate(e),t},"getThemeVariables"),di,p1=(di=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.lineColor=R(this.background),this.textColor=R(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(R("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Je(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=Y("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Y(this.sectionBkgColor,10),this.taskBorderColor=Je(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Je(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||H(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(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=H(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=H(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=H(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=R(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]||R(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||H(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)]??H(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=H(this.secondaryColor,20),this.git1=H(this.pie2||this.secondaryColor,20),this.git2=H(this.pie3||this.tertiaryColor,20),this.git3=H(this.pie4||b(this.primaryColor,{h:-30}),20),this.git4=H(this.pie5||b(this.primaryColor,{h:-60}),20),this.git5=H(this.pie6||b(this.primaryColor,{h:-90}),10),this.git6=H(this.pie7||b(this.primaryColor,{h:60}),10),this.git7=H(this.pie8||b(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||R(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||R(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||H("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||H("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||H("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||H("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||H(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||H(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||H(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||H(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(di,"Theme"),di),g1=g(e=>{const t=new p1;return t.calculate(e),t},"getThemeVariables"),ui,m1=(ui=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=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.lineColor=R(this.background),this.textColor=R(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=dt(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=Je(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||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(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||R(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||R(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||H(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||H(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||Y(R(this.git0),25),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||R(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||R(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(ui,"Theme"),ui),uu=g(e=>{const t=new m1;return t.calculate(e),t},"getThemeVariables"),fi,y1=(fi=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=H("#cde498",10),this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.primaryColor),this.lineColor=R(this.background),this.textColor=R(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=Y(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||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(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||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||R(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||R(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(fi,"Theme"),fi),x1=g(e=>{const t=new y1;return t.calculate(e),t},"getThemeVariables"),pi,C1=(pi=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=H(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.lineColor=R(this.background),this.textColor=R(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||H(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=H(this.contrast,55),this.border2=this.contrast,this.actorBorder=H(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]||R(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||Y(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=H(this.contrast,30),this.sectionBkgColor2=H(this.contrast,30),this.taskBorderColor=Y(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=H(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Y(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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=Y(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||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(pi,"Theme"),pi),b1=g(e=>{const t=new C1;return t.calculate(e),t},"getThemeVariables"),gi,k1=(gi=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=dt(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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(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||H(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 s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||R(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(gi,"Theme"),gi),w1=g(e=>{const t=new k1;return t.calculate(e),t},"getThemeVariables"),mi,S1=(mi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(R("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=R(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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(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||H(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]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(mi,"Theme"),mi),v1=g(e=>{const t=new S1;return t.calculate(e),t},"getThemeVariables"),yi,T1=(yi=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=dt("#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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(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||H(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 s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=this.mainBkg;if(this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||R(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(yi,"Theme"),yi),_1=g(e=>{const t=new T1;return t.calculate(e),t},"getThemeVariables"),xi,B1=(xi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(R("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=R(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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(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||H(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]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(xi,"Theme"),xi),L1=g(e=>{const t=new B1;return t.calculate(e),t},"getThemeVariables"),Ci,E1=(Ci=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=dt(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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(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||H(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 s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||R(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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),F1=g(e=>{const t=new E1;return t.calculate(e),t},"getThemeVariables"),bi,A1=(bi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=R(this.background),this.secondaryBorderColor=dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=dt(this.tertiaryColor,this.darkMode),this.primaryTextColor=R(this.primaryColor),this.secondaryTextColor=R(this.secondaryColor),this.tertiaryTextColor=R(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(R("#323D47"),10),this.border1="#ccc",this.border2=Je(255,255,255,.25),this.arrowheadColor=R(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||dt(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||dt(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||dt(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||dt(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||R(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||R(this.tertiaryColor),this.lineColor=this.lineColor||R(this.background),this.arrowheadColor=this.arrowheadColor||R(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?Y(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||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||R(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||H(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]||R(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=Y(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||ke(this.quadrant1Fill)?H(this.quadrant1Fill):Y(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?Y(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=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||R(this.git0),this.gitInv1=this.gitInv1||R(this.git1),this.gitInv2=this.gitInv2||R(this.git2),this.gitInv3=this.gitInv3||R(this.git3),this.gitInv4=this.gitInv4||R(this.git4),this.gitInv5=this.gitInv5||R(this.git5),this.gitInv6=this.gitInv6||R(this.git6),this.gitInv7=this.gitInv7||R(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||We,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||He}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(bi,"Theme"),bi),M1=g(e=>{const t=new A1;return t.calculate(e),t},"getThemeVariables"),tr={base:{getThemeVariables:f1},dark:{getThemeVariables:g1},default:{getThemeVariables:uu},forest:{getThemeVariables:x1},neutral:{getThemeVariables:b1},neo:{getThemeVariables:w1},"neo-dark":{getThemeVariables:v1},redux:{getThemeVariables:_1},"redux-dark":{getThemeVariables:L1},"redux-color":{getThemeVariables:F1},"redux-dark-color":{getThemeVariables:M1}},Vt={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},fu={...Vt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:tr.default.getThemeVariables(),sequence:{...Vt.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:{...Vt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Vt.c4,useWidth:void 0,personFont:g(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Vt.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:{...Vt.pie,useWidth:984},xyChart:{...Vt.xyChart,useWidth:void 0},requirement:{...Vt.requirement,useWidth:void 0},packet:{...Vt.packet},eventmodeling:{...Vt.eventmodeling},treeView:{...Vt.treeView,useWidth:void 0},radar:{...Vt.radar},railroad:{...Vt.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:{...Vt.ishikawa},sankey:{...Vt.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:{...Vt.venn},cynefin:{...Vt.cynefin}},pu=g((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...pu(e[i],"")]:[...r,t+i],[]),"keyify"),$1=new Set(pu(fu,"")),Bl=fu,O1={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},R1=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"),bs=g(e=>{if(V.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>bs(t));return}for(const t of Object.keys(e)){if(V.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!$1.has(t)||e[t]==null){V.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=O1[t];i?R1(e[t],i):(V.debug("sanitizing object",t),bs(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(V.debug("sanitizing css option",t),e[t]=gu(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"),gu=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"),Bi=Object.freeze(Bl),Ye=g(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ce=qt({},Bi),ks,Ir=[],fo=qt({},Bi),ra=g((e,t)=>{let r=qt({},e),i={};for(const o of t)xu(o),i=qt(i,o);if(r=qt(r,i),i.theme&&i.theme in tr){const o=qt({},ks),s=qt(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in tr&&(r.themeVariables=tr[r.theme].getThemeVariables(s))}return fo=r,bu(fo),fo},"updateCurrentConfig"),I1=g(e=>(ce=qt({},Bi),ce=qt(ce,e),e.theme&&tr[e.theme]&&(ce.themeVariables=tr[e.theme].getThemeVariables(e.themeVariables)),ra(ce,Ir),ce),"setSiteConfig"),P1=g(e=>{ks=qt({},e)},"saveConfigFromInitialize"),D1=g(e=>(ce=qt(ce,e),ra(ce,Ir),ce),"updateSiteConfig"),mu=g(()=>qt({},ce),"getSiteConfig"),yu=g(e=>(bu(e),qt(fo,e),Ot()),"setConfig"),Ot=g(()=>qt({},fo),"getConfig"),xu=g(e=>{e&&(["secure",...ce.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"&&xu(e[t])}))},"sanitize"),N1=g(e=>{bs(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Ir.push(e),ra(ce,Ir)},"addDirective"),ws=g((e=ce)=>{Ir=[],ra(e,Ir)},"reset"),q1={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."},hc={},Cu=g(e=>{hc[e]||(V.warn(q1[e]),hc[e]=!0)},"issueWarning"),bu=g(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Cu("LAZY_LOAD_DEPRECATED")},"checkConfig"),z1=g(()=>{let e={};ks&&(e=qt(e,ks));for(const t of Ir)e=qt(e,t);return e},"getUserDefinedConfig"),ee=g(e=>(e.flowchart?.htmlLabels!=null&&Cu("FLOWCHART_HTML_LABELS_DEPRECATED"),Ye(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),ku=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,po=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,j1=/\s*%%.*\n/gm,ki,wu=(ki=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},g(ki,"UnknownDiagramError"),ki),Pr={},Ll=g(function(e,t){e=e.replace(ku,"").replace(po,"").replace(j1,`
|
|
8
|
+
`);for(const[r,{detector:i}]of Object.entries(Pr))if(i(e,t))return r;throw new wu(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),yn=g((...e)=>{for(const{id:t,detector:r,loader:i}of e)Su(t,r,i)},"registerLazyLoadedDiagrams"),Su=g((e,t,r)=>{Pr[e]&&V.warn(`Detector with key ${e} already exists. Overwriting.`),Pr[e]={detector:t,loader:r},V.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),W1=g(e=>Pr[e].loader,"getDiagramLoader"),Ii=/<br\s*\/?>/gi,H1=g(e=>e?_u(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Y1=(()=>{let e=!1;return()=>{e||(vu(),e=!0)}})();function vu(){const e="data-temp-href-target";Ti.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Ti.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(vu,"setupDompurifyHooks");var Tu=g(e=>(Y1(),Ti.sanitize(e)),"removeScript"),cc=g((e,t)=>{if(ee(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Tu(e):r!=="loose"&&(e=_u(e),e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(/=/g,"="),e=V1(e))}return e},"sanitizeMore"),Ce=g((e,t)=>e&&(t.dompurifyConfig?e=Ti.sanitize(cc(e,t),t.dompurifyConfig).toString():e=Ti.sanitize(cc(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),U1=g((e,t)=>typeof e=="string"?Ce(e,t):e.flat().map(r=>Ce(r,t)),"sanitizeTextOrArray"),X1=g(e=>Ii.test(e),"hasBreaks"),G1=g(e=>e.split(Ii),"splitBreaks"),V1=g(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),_u=g(e=>e.replace(Ii,"#br#"),"breakToPlaceholder"),Bu=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"),K1=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),Z1=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),xn=g(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let o=t[i];if(o===","&&i>0&&i+1<t.length){const s=t[i-1],a=t[i+1];Q1(s,a)&&(o=s+","+a,i++,r.pop())}r.push(J1(o))}return r.join("")},"parseGenericTypes"),Cn=g((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),Q1=g((e,t)=>{const r=Cn(e,"~"),i=Cn(t,"~");return r===1&&i===1},"shouldCombineSets"),J1=g(e=>{const t=Cn(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),s=i.lastIndexOf("~");for(;o!==-1&&s!==-1&&o!==s;)i[o]="<",i[s]=">",o=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),dc=g(()=>window.MathMLElement!==void 0,"isMathMLSupported"),bn=/\$\$(.*?)\$\$/g,Li=g(e=>(e.match(bn)?.length??0)>0,"hasKatex"),tk=g(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await El(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 o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),ek=g(async(e,t)=>{if(!Li(e))return e;if(!(dc()||t.legacyMathML||t.forceLegacyMathML))return e.replace(bn,"MathML is unsupported in this environment.");{const{default:r}=await import("katex"),i=t.forceLegacyMathML||!dc()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Ii).map(o=>Li(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(bn,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),El=g(async(e,t)=>Ce(await ek(e,t),t),"renderKatexSanitized"),Pi={getRows:H1,sanitizeText:Ce,sanitizeTextOrArray:U1,hasBreaks:X1,splitBreaks:G1,lineBreakRegex:Ii,removeScript:Tu,getUrl:Bu,evaluate:Ye,getMax:K1,getMin:Z1},rk=g(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),ik=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"),Fl=g(function(e,t,r,i){const o=ik(t,r,i);rk(e,o)},"configureSvgSize"),Lu=g(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,a=o.height;V.info(`SVG bounds: ${s}x${a}`,o);let n=0,l=0;V.info(`Graph bounds: ${n}x${l}`,e),n=s+r*2,l=a+r*2,V.info(`Calculated bounds: ${n}x${l}`),Fl(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),as={};function kn(e){return[...e.cssRules].map(t=>t.cssText).join(`
|
|
9
|
+
`)}g(kn,"cssStyleSheetToString");var ok=g((e,t,r,i)=>{let o="";return e in as&&as[e]?o=as[e]({...r,svgId:i}):V.warn(`No theme found for ${e}`),` & {
|
|
10
10
|
font-family: ${r.fontFamily};
|
|
11
11
|
font-size: ${r.fontSize};
|
|
12
12
|
fill: ${r.textColor}
|
|
@@ -127,44 +127,44 @@ ${a.href}`,[l,c]=L.useState(null);L.useEffect(()=>{const x=s.current;if(x===null
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
${t}
|
|
130
|
-
`},"getStyles"),
|
|
131
|
-
`)},"setAccDescription"),Mu=g(()=>Ol,"getAccDescription"),$u=g(e=>{$l=Rl(e)},"setDiagramTitle"),Ou=g(()=>$l,"getDiagramTitle"),uc=V,ak=Tl,kt=Ot,nk=mu,lk=Bi,Il=g(e=>Ce(e,kt()),"sanitizeText"),Ru=Bu,hk=g(()=>Al,"getCommonDb"),Ss={},vs=g((e,t,r)=>{Ss[e]&&uc.warn(`Diagram with id ${e} already registered. Overwriting.`),Ss[e]=t,r&&wu(e,r),ok(e,t.styles),t.injectUtils?.(uc,ak,kt,Il,Ru,hk(),()=>{})},"registerDiagram"),wn=g(e=>{if(e in Ss)return Ss[e];throw new ck(e)},"getDiagram"),wi,ck=(wi=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},g(wi,"DiagramNotFoundError"),wi),dk={value:()=>{}};function Iu(){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 ns(r)}function ns(e){this._=e}function uk(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}ns.prototype=Iu.prototype={constructor:ns,on:function(e,t){var r=this._,i=uk(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((o=(e=i[s]).type)&&(o=fk(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(o=(e=i[s]).type)r[o]=fc(r[o],e.name,t);else if(t==null)for(o in r)r[o]=fc(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new ns(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,s;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,o=s.length;i<o;++i)s[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],o=0,s=i.length;o<s;++o)i[o].value.apply(t,r)}};function fk(e,t){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===t)return o.value}function fc(e,t,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=dk,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var Sn="http://www.w3.org/1999/xhtml";const pc={svg:"http://www.w3.org/2000/svg",xhtml:Sn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ia(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),pc.hasOwnProperty(t)?{space:pc[t],local:e}:e}function pk(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Sn&&t.documentElement.namespaceURI===Sn?t.createElement(e):t.createElementNS(r,e)}}function gk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Pu(e){var t=ia(e);return(t.local?gk:pk)(t)}function mk(){}function Pl(e){return e==null?mk:function(){return this.querySelector(e)}}function yk(e){typeof e!="function"&&(e=Pl(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=new Array(a),l,c,h=0;h<a;++h)(l=s[h])&&(c=e.call(l,l.__data__,h,s))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new pe(i,this._parents)}function xk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ck(){return[]}function Du(e){return e==null?Ck:function(){return this.querySelectorAll(e)}}function bk(e){return function(){return xk(e.apply(this,arguments))}}function kk(e){typeof e=="function"?e=bk(e):e=Du(e);for(var t=this._groups,r=t.length,i=[],o=[],s=0;s<r;++s)for(var a=t[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),o.push(l));return new pe(i,o)}function Nu(e){return function(){return this.matches(e)}}function qu(e){return function(t){return t.matches(e)}}var wk=Array.prototype.find;function Sk(e){return function(){return wk.call(this.children,e)}}function vk(){return this.firstElementChild}function Tk(e){return this.select(e==null?vk:Sk(typeof e=="function"?e:qu(e)))}var _k=Array.prototype.filter;function Bk(){return Array.from(this.children)}function Lk(e){return function(){return _k.call(this.children,e)}}function Ek(e){return this.selectAll(e==null?Bk:Lk(typeof e=="function"?e:qu(e)))}function Fk(e){typeof e!="function"&&(e=Nu(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new pe(i,this._parents)}function zu(e){return new Array(e.length)}function Ak(){return new pe(this._enter||this._groups.map(zu),this._parents)}function Ts(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ts.prototype={constructor:Ts,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 Mk(e){return function(){return e}}function $k(e,t,r,i,o,s){for(var a=0,n,l=t.length,c=s.length;a<c;++a)(n=t[a])?(n.__data__=s[a],i[a]=n):r[a]=new Ts(e,s[a]);for(;a<l;++a)(n=t[a])&&(o[a]=n)}function Ok(e,t,r,i,o,s,a){var n,l,c=new Map,h=t.length,d=s.length,u=new Array(h),f;for(n=0;n<h;++n)(l=t[n])&&(u[n]=f=a.call(l,l.__data__,n,t)+"",c.has(f)?o[n]=l:c.set(f,l));for(n=0;n<d;++n)f=a.call(e,s[n],n,s)+"",(l=c.get(f))?(i[n]=l,l.__data__=s[n],c.delete(f)):r[n]=new Ts(e,s[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(u[n])===l&&(o[n]=l)}function Rk(e){return e.__data__}function Ik(e,t){if(!arguments.length)return Array.from(this,Rk);var r=t?Ok:$k,i=this._parents,o=this._groups;typeof e!="function"&&(e=Mk(e));for(var s=o.length,a=new Array(s),n=new Array(s),l=new Array(s),c=0;c<s;++c){var h=i[c],d=o[c],u=d.length,f=Pk(e.call(h,h&&h.__data__,c,i)),p=f.length,m=n[c]=new Array(p),y=a[c]=new Array(p),x=l[c]=new Array(u);r(h,d,m,y,x,f,t);for(var C=0,k=0,S,v;C<p;++C)if(S=m[C]){for(C>=k&&(k=C+1);!(v=y[k])&&++k<p;);S._next=v||null}}return a=new pe(a,i),a._enter=n,a._exit=l,a}function Pk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Dk(){return new pe(this._exit||this._groups.map(zu),this._parents)}function Nk(e,t,r){var i=this.enter(),o=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?s.remove():r(s),i&&o?i.merge(o).order():o}function qk(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,s=i.length,a=Math.min(o,s),n=new Array(o),l=0;l<a;++l)for(var c=r[l],h=i[l],d=c.length,u=n[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||h[p])&&(u[p]=f);for(;l<o;++l)n[l]=r[l];return new pe(n,this._parents)}function zk(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,s=i[o],a;--o>=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function jk(e){e||(e=Wk);function t(d,u){return d&&u?e(d.__data__,u.__data__):!d-!u}for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s){for(var a=r[s],n=a.length,l=o[s]=new Array(n),c,h=0;h<n;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new pe(o,this._parents).order()}function Wk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Hk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Yk(){return Array.from(this)}function Uk(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length;o<s;++o){var a=i[o];if(a)return a}return null}function Xk(){let e=0;for(const t of this)++e;return e}function Gk(){return!this.node()}function Vk(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],s=0,a=o.length,n;s<a;++s)(n=o[s])&&e.call(n,n.__data__,s,o);return this}function Kk(e){return function(){this.removeAttribute(e)}}function Zk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qk(e,t){return function(){this.setAttribute(e,t)}}function Jk(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function t2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function e2(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 r2(e,t){var r=ia(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?Zk:Kk:typeof t=="function"?r.local?e2:t2:r.local?Jk:Qk)(r,t))}function ju(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function i2(e){return function(){this.style.removeProperty(e)}}function o2(e,t,r){return function(){this.style.setProperty(e,t,r)}}function s2(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function a2(e,t,r){return arguments.length>1?this.each((t==null?i2:typeof t=="function"?s2:o2)(e,t,r??"")):Ei(this.node(),e)}function Ei(e,t){return e.style.getPropertyValue(t)||ju(e).getComputedStyle(e,null).getPropertyValue(t)}function n2(e){return function(){delete this[e]}}function l2(e,t){return function(){this[e]=t}}function h2(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function c2(e,t){return arguments.length>1?this.each((t==null?n2:typeof t=="function"?h2:l2)(e,t)):this.node()[e]}function Wu(e){return e.trim().split(/^|\s+/)}function Dl(e){return e.classList||new Hu(e)}function Hu(e){this._node=e,this._names=Wu(e.getAttribute("class")||"")}Hu.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 Yu(e,t){for(var r=Dl(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function Uu(e,t){for(var r=Dl(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function d2(e){return function(){Yu(this,e)}}function u2(e){return function(){Uu(this,e)}}function f2(e,t){return function(){(t.apply(this,arguments)?Yu:Uu)(this,e)}}function p2(e,t){var r=Wu(e+"");if(arguments.length<2){for(var i=Dl(this.node()),o=-1,s=r.length;++o<s;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?f2:t?d2:u2)(r,t))}function g2(){this.textContent=""}function m2(e){return function(){this.textContent=e}}function y2(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function x2(e){return arguments.length?this.each(e==null?g2:(typeof e=="function"?y2:m2)(e)):this.node().textContent}function C2(){this.innerHTML=""}function b2(e){return function(){this.innerHTML=e}}function k2(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function w2(e){return arguments.length?this.each(e==null?C2:(typeof e=="function"?k2:b2)(e)):this.node().innerHTML}function S2(){this.nextSibling&&this.parentNode.appendChild(this)}function v2(){return this.each(S2)}function T2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function _2(){return this.each(T2)}function B2(e){var t=typeof e=="function"?e:Pu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function L2(){return null}function E2(e,t){var r=typeof e=="function"?e:Pu(e),i=t==null?L2:typeof t=="function"?t:Pl(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function F2(){var e=this.parentNode;e&&e.removeChild(this)}function A2(){return this.each(F2)}function M2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function O2(e){return this.select(e?$2:M2)}function R2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function I2(e){return function(t){e.call(this,t,this.__data__)}}function P2(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 D2(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,s;r<o;++r)s=t[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function N2(e,t,r){return function(){var i=this.__on,o,s=I2(t);if(i){for(var a=0,n=i.length;a<n;++a)if((o=i[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=t;return}}this.addEventListener(e.type,s,r),o={type:e.type,name:e.name,value:t,listener:s,options:r},i?i.push(o):this.__on=[o]}}function q2(e,t,r){var i=P2(e+""),o,s=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(o=0,h=n[l];o<s;++o)if((a=i[o]).type===h.type&&a.name===h.name)return h.value}return}for(n=t?N2:D2,o=0;o<s;++o)this.each(n(i[o],t,r));return this}function Xu(e,t,r){var i=ju(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,r):(o=i.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function z2(e,t){return function(){return Xu(this,e,t)}}function j2(e,t){return function(){return Xu(this,e,t.apply(this,arguments))}}function W2(e,t){return this.each((typeof t=="function"?j2:z2)(e,t))}function*H2(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length,a;o<s;++o)(a=i[o])&&(yield a)}var Gu=[null];function pe(e,t){this._groups=e,this._parents=t}function $o(){return new pe([[document.documentElement]],Gu)}function Y2(){return this}pe.prototype=$o.prototype={constructor:pe,select:yk,selectAll:kk,selectChild:Tk,selectChildren:Ek,filter:Fk,data:Ik,enter:Ak,exit:Dk,join:Nk,merge:qk,selection:Y2,order:zk,sort:jk,call:Hk,nodes:Yk,node:Uk,size:Xk,empty:Gk,each:Vk,attr:r2,style:a2,property:c2,classed:p2,text:x2,html:w2,raise:v2,lower:_2,append:B2,insert:E2,remove:A2,clone:O2,datum:R2,on:q2,dispatch:W2,[Symbol.iterator]:H2};function yt(e){return typeof e=="string"?new pe([[document.querySelector(e)]],[document.documentElement]):new pe([[e]],Gu)}function oa(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Nl(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Di(){}var bo=.7,_s=1/bo,li="\\s*([+-]?\\d+)\\s*",ko="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",U2=/^#([0-9a-f]{3,8})$/,X2=new RegExp(`^rgb\\(${li},${li},${li}\\)$`),G2=new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`),V2=new RegExp(`^rgba\\(${li},${li},${li},${ko}\\)$`),K2=new RegExp(`^rgba\\(${qe},${qe},${qe},${ko}\\)$`),Z2=new RegExp(`^hsl\\(${ko},${qe},${qe}\\)$`),Q2=new RegExp(`^hsla\\(${ko},${qe},${qe},${ko}\\)$`),gc={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};oa(Di,Fi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:mc,formatHex:mc,formatHex8:J2,formatHsl:tw,formatRgb:yc,toString:yc});function mc(){return this.rgb().formatHex()}function J2(){return this.rgb().formatHex8()}function tw(){return Ku(this).formatHsl()}function yc(){return this.rgb().formatRgb()}function Fi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=U2.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?xc(t):r===3?new se(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Yo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Yo(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=X2.exec(e))?new se(t[1],t[2],t[3],1):(t=G2.exec(e))?new se(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=V2.exec(e))?Yo(t[1],t[2],t[3],t[4]):(t=K2.exec(e))?Yo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Z2.exec(e))?kc(t[1],t[2]/100,t[3]/100,1):(t=Q2.exec(e))?kc(t[1],t[2]/100,t[3]/100,t[4]):gc.hasOwnProperty(e)?xc(gc[e]):e==="transparent"?new se(NaN,NaN,NaN,0):null}function xc(e){return new se(e>>16&255,e>>8&255,e&255,1)}function Yo(e,t,r,i){return i<=0&&(e=t=r=NaN),new se(e,t,r,i)}function Vu(e){return e instanceof Di||(e=Fi(e)),e?(e=e.rgb(),new se(e.r,e.g,e.b,e.opacity)):new se}function vn(e,t,r,i){return arguments.length===1?Vu(e):new se(e,t,r,i??1)}function se(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}oa(se,vn,Nl(Di,{brighter(e){return e=e==null?_s:Math.pow(_s,e),new se(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bo:Math.pow(bo,e),new se(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new se($r(this.r),$r(this.g),$r(this.b),Bs(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:Cc,formatHex:Cc,formatHex8:ew,formatRgb:bc,toString:bc}));function Cc(){return`#${Fr(this.r)}${Fr(this.g)}${Fr(this.b)}`}function ew(){return`#${Fr(this.r)}${Fr(this.g)}${Fr(this.b)}${Fr((isNaN(this.opacity)?1:this.opacity)*255)}`}function bc(){const e=Bs(this.opacity);return`${e===1?"rgb(":"rgba("}${$r(this.r)}, ${$r(this.g)}, ${$r(this.b)}${e===1?")":`, ${e})`}`}function Bs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $r(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fr(e){return e=$r(e),(e<16?"0":"")+e.toString(16)}function kc(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 Ku(e){if(e instanceof Ee)return new Ee(e.h,e.s,e.l,e.opacity);if(e instanceof Di||(e=Fi(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,o=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,n=s-o,l=(s+o)/2;return n?(t===s?a=(r-i)/n+(r<i)*6:r===s?a=(i-t)/n+2:a=(t-r)/n+4,n/=l<.5?s+o:2-s-o,a*=60):n=l>0&&l<1?0:a,new Ee(a,n,l,e.opacity)}function rw(e,t,r,i){return arguments.length===1?Ku(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}oa(Ee,rw,Nl(Di,{brighter(e){return e=e==null?_s:Math.pow(_s,e),new Ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bo:Math.pow(bo,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,o=2*r-i;return new se(ja(e>=240?e-240:e+120,o,i),ja(e,o,i),ja(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Ee(wc(this.h),Uo(this.s),Uo(this.l),Bs(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=Bs(this.opacity);return`${e===1?"hsl(":"hsla("}${wc(this.h)}, ${Uo(this.s)*100}%, ${Uo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wc(e){return e=(e||0)%360,e<0?e+360:e}function Uo(e){return Math.max(0,Math.min(1,e||0))}function ja(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 sa=e=>()=>e;function Zu(e,t){return function(r){return e+r*t}}function iw(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 ow(e,t){var r=t-e;return r?Zu(e,r>180||r<-180?r-360*Math.round(r/360):r):sa(isNaN(e)?t:e)}function sw(e){return(e=+e)==1?ql:function(t,r){return r-t?iw(t,r,e):sa(isNaN(t)?r:t)}}function ql(e,t){var r=t-e;return r?Zu(e,r):sa(isNaN(e)?t:e)}const Tn=(function e(t){var r=sw(t);function i(o,s){var a=r((o=vn(o)).r,(s=vn(s)).r),n=r(o.g,s.g),l=r(o.b,s.b),c=ql(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=n(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function Qe(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var _n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wa=new RegExp(_n.source,"g");function aw(e){return function(){return e}}function nw(e){return function(t){return e(t)+""}}function Qu(e,t){var r=_n.lastIndex=Wa.lastIndex=0,i,o,s,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=_n.exec(e))&&(o=Wa.exec(t));)(s=o.index)>r&&(s=t.slice(r,s),n[a]?n[a]+=s:n[++a]=s),(i=i[0])===(o=o[0])?n[a]?n[a]+=o:n[++a]=o:(n[++a]=null,l.push({i:a,x:Qe(i,o)})),r=Wa.lastIndex;return r<t.length&&(s=t.slice(r),n[a]?n[a]+=s:n[++a]=s),n.length<2?l[0]?nw(l[0].x):aw(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 Sc=180/Math.PI,Bn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ju(e,t,r,i,o,s){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:o,translateY:s,rotate:Math.atan2(t,e)*Sc,skewX:Math.atan(l)*Sc,scaleX:a,scaleY:n}}var Xo;function lw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Bn:Ju(t.a,t.b,t.c,t.d,t.e,t.f)}function hw(e){return e==null||(Xo||(Xo=document.createElementNS("http://www.w3.org/2000/svg","g")),Xo.setAttribute("transform",e),!(e=Xo.transform.baseVal.consolidate()))?Bn:(e=e.matrix,Ju(e.a,e.b,e.c,e.d,e.e,e.f))}function tf(e,t,r,i){function o(c){return c.length?c.pop()+" ":""}function s(c,h,d,u,f,p){if(c!==d||h!==u){var m=f.push("translate(",null,t,null,r);p.push({i:m-4,x:Qe(c,d)},{i:m-2,x:Qe(h,u)})}else(d||u)&&f.push("translate("+d+t+u+r)}function a(c,h,d,u){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),u.push({i:d.push(o(d)+"rotate(",null,i)-2,x:Qe(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function n(c,h,d,u){c!==h?u.push({i:d.push(o(d)+"skewX(",null,i)-2,x:Qe(c,h)}):h&&d.push(o(d)+"skewX("+h+i)}function l(c,h,d,u,f,p){if(c!==d||h!==u){var m=f.push(o(f)+"scale(",null,",",null,")");p.push({i:m-4,x:Qe(c,d)},{i:m-2,x:Qe(h,u)})}else(d!==1||u!==1)&&f.push(o(f)+"scale("+d+","+u+")")}return function(c,h){var d=[],u=[];return c=e(c),h=e(h),s(c.translateX,c.translateY,h.translateX,h.translateY,d,u),a(c.rotate,h.rotate,d,u),n(c.skewX,h.skewX,d,u),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,u),c=h=null,function(f){for(var p=-1,m=u.length,y;++p<m;)d[(y=u[p]).i]=y.x(f);return d.join("")}}}var cw=tf(lw,"px, ","px)","deg)"),dw=tf(hw,", ",")",")"),Ai=0,oo=0,Vi=0,ef=1e3,Ls,so,Es=0,Dr=0,aa=0,wo=typeof performance=="object"&&performance.now?performance:Date,rf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zl(){return Dr||(rf(uw),Dr=wo.now()+aa)}function uw(){Dr=0}function Fs(){this._call=this._time=this._next=null}Fs.prototype=of.prototype={constructor:Fs,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?zl():+r)+(t==null?0:+t),!this._next&&so!==this&&(so?so._next=this:Ls=this,so=this),this._call=e,this._time=r,Ln()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ln())}};function of(e,t,r){var i=new Fs;return i.restart(e,t,r),i}function fw(){zl(),++Ai;for(var e=Ls,t;e;)(t=Dr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ai}function vc(){Dr=(Es=wo.now())+aa,Ai=oo=0;try{fw()}finally{Ai=0,gw(),Dr=0}}function pw(){var e=wo.now(),t=e-Es;t>ef&&(aa-=t,Es=e)}function gw(){for(var e,t=Ls,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:Ls=r);so=e,Ln(i)}function Ln(e){if(!Ai){oo&&(oo=clearTimeout(oo));var t=e-Dr;t>24?(e<1/0&&(oo=setTimeout(vc,e-wo.now()-aa)),Vi&&(Vi=clearInterval(Vi))):(Vi||(Es=wo.now(),Vi=setInterval(pw,ef)),Ai=1,rf(vc))}}function Tc(e,t,r){var i=new Fs;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var mw=Iu("start","end","cancel","interrupt"),yw=[],sf=0,_c=1,En=2,ls=3,Bc=4,Fn=5,hs=6;function na(e,t,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;xw(e,r,{name:t,index:i,group:o,on:mw,tween:yw,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:sf})}function jl(e,t){var r=$e(e,t);if(r.state>sf)throw new Error("too late; already scheduled");return r}function Ue(e,t){var r=$e(e,t);if(r.state>ls)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 xw(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=of(s,0,r.time);function s(c){r.state=_c,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var h,d,u,f;if(r.state!==_c)return l();for(h in i)if(f=i[h],f.name===r.name){if(f.state===ls)return Tc(a);f.state===Bc?(f.state=hs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[h]):+h<t&&(f.state=hs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[h])}if(Tc(function(){r.state===ls&&(r.state=Bc,r.timer.restart(n,r.delay,r.time),n(c))}),r.state=En,r.on.call("start",e,e.__data__,r.index,r.group),r.state===En){for(r.state=ls,o=new Array(u=r.tween.length),h=0,d=-1;h<u;++h)(f=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(o[++d]=f);o.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=Fn,1),d=-1,u=o.length;++d<u;)o[d].call(e,h);r.state===Fn&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=hs,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function Cw(e,t){var r=e.__transition,i,o,s=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((i=r[a]).name!==t){s=!1;continue}o=i.state>En&&i.state<Fn,i.state=hs,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}s&&delete e.__transition}}function bw(e){return this.each(function(){Cw(this,e)})}function kw(e,t){var r,i;return function(){var o=Ue(this,e),s=o.tween;if(s!==r){i=r=s;for(var a=0,n=i.length;a<n;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function ww(e,t,r){var i,o;if(typeof r!="function")throw new Error;return function(){var s=Ue(this,e),a=s.tween;if(a!==i){o=(i=a).slice();for(var n={name:t,value:r},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=n;break}l===c&&o.push(n)}s.tween=o}}function Sw(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=$e(this.node(),r).tween,o=0,s=i.length,a;o<s;++o)if((a=i[o]).name===e)return a.value;return null}return this.each((t==null?kw:ww)(r,e,t))}function Wl(e,t,r){var i=e._id;return e.each(function(){var o=Ue(this,i);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return $e(o,i).value[t]}}function af(e,t){var r;return(typeof t=="number"?Qe:t instanceof Fi?Tn:(r=Fi(t))?(t=r,Tn):Qu)(e,t)}function vw(e){return function(){this.removeAttribute(e)}}function Tw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _w(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttribute(e);return a===o?null:a===i?s:s=t(i=a,r)}}function Bw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===i?s:s=t(i=a,r)}}function Lw(e,t,r){var i,o,s;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===o?s:(o=l,s=t(i=a,n)))}}function Ew(e,t,r){var i,o,s;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===o?s:(o=l,s=t(i=a,n)))}}function Fw(e,t){var r=ia(e),i=r==="transform"?dw:af;return this.attrTween(e,typeof t=="function"?(r.local?Ew:Lw)(r,i,Wl(this,"attr."+e,t)):t==null?(r.local?Tw:vw)(r):(r.local?Bw:_w)(r,i,t))}function Aw(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Mw(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function $w(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Mw(e,s)),r}return o._value=t,o}function Ow(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Aw(e,s)),r}return o._value=t,o}function Rw(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=ia(e);return this.tween(r,(i.local?$w:Ow)(i,t))}function Iw(e,t){return function(){jl(this,e).delay=+t.apply(this,arguments)}}function Pw(e,t){return t=+t,function(){jl(this,e).delay=t}}function Dw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Iw:Pw)(t,e)):$e(this.node(),t).delay}function Nw(e,t){return function(){Ue(this,e).duration=+t.apply(this,arguments)}}function qw(e,t){return t=+t,function(){Ue(this,e).duration=t}}function zw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Nw:qw)(t,e)):$e(this.node(),t).duration}function jw(e,t){if(typeof t!="function")throw new Error;return function(){Ue(this,e).ease=t}}function Ww(e){var t=this._id;return arguments.length?this.each(jw(t,e)):$e(this.node(),t).ease}function Hw(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ue(this,e).ease=r}}function Yw(e){if(typeof e!="function")throw new Error;return this.each(Hw(this._id,e))}function Uw(e){typeof e!="function"&&(e=Nu(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new rr(i,this._parents,this._name,this._id)}function Xw(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,o=r.length,s=Math.min(i,o),a=new Array(i),n=0;n<s;++n)for(var l=t[n],c=r[n],h=l.length,d=a[n]=new Array(h),u,f=0;f<h;++f)(u=l[f]||c[f])&&(d[f]=u);for(;n<i;++n)a[n]=t[n];return new rr(a,this._parents,this._name,this._id)}function Gw(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 Vw(e,t,r){var i,o,s=Gw(t)?jl:Ue;return function(){var a=s(this,e),n=a.on;n!==i&&(o=(i=n).copy()).on(t,r),a.on=o}}function Kw(e,t){var r=this._id;return arguments.length<2?$e(this.node(),r).on.on(e):this.each(Vw(r,e,t))}function Zw(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Qw(){return this.on("end.remove",Zw(this._id))}function Jw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Pl(e));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a<o;++a)for(var n=i[a],l=n.length,c=s[a]=new Array(l),h,d,u=0;u<l;++u)(h=n[u])&&(d=e.call(h,h.__data__,u,n))&&("__data__"in h&&(d.__data__=h.__data__),c[u]=d,na(c[u],t,r,u,c,$e(h,r)));return new rr(s,this._parents,t,r)}function tS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Du(e));for(var i=this._groups,o=i.length,s=[],a=[],n=0;n<o;++n)for(var l=i[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var u=e.call(h,h.__data__,d,l),f,p=$e(h,r),m=0,y=u.length;m<y;++m)(f=u[m])&&na(f,t,r,m,u,p);s.push(u),a.push(h)}return new rr(s,a,t,r)}var eS=$o.prototype.constructor;function rS(){return new eS(this._groups,this._parents)}function iS(e,t){var r,i,o;return function(){var s=Ei(this,e),a=(this.style.removeProperty(e),Ei(this,e));return s===a?null:s===r&&a===i?o:o=t(r=s,i=a)}}function nf(e){return function(){this.style.removeProperty(e)}}function oS(e,t,r){var i,o=r+"",s;return function(){var a=Ei(this,e);return a===o?null:a===i?s:s=t(i=a,r)}}function sS(e,t,r){var i,o,s;return function(){var a=Ei(this,e),n=r(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),Ei(this,e))),a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n))}}function aS(e,t){var r,i,o,s="style."+t,a="end."+s,n;return function(){var l=Ue(this,e),c=l.on,h=l.value[s]==null?n||(n=nf(t)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(a,o=h),l.on=i}}function nS(e,t,r){var i=(e+="")=="transform"?cw:af;return t==null?this.styleTween(e,iS(e,i)).on("end.style."+e,nf(e)):typeof t=="function"?this.styleTween(e,sS(e,i,Wl(this,"style."+e,t))).each(aS(this._id,e)):this.styleTween(e,oS(e,i,t),r).on("end.style."+e,null)}function lS(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function hS(e,t,r){var i,o;function s(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&lS(e,a,r)),i}return s._value=t,s}function cS(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,hS(e,t,r??""))}function dS(e){return function(){this.textContent=e}}function uS(e){return function(){var t=e(this);this.textContent=t??""}}function fS(e){return this.tween("text",typeof e=="function"?uS(Wl(this,"text",e)):dS(e==null?"":e+""))}function pS(e){return function(t){this.textContent=e.call(this,t)}}function gS(e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&pS(o)),t}return i._value=e,i}function mS(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,gS(e))}function yS(){for(var e=this._name,t=this._id,r=lf(),i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)if(l=a[c]){var h=$e(l,t);na(l,e,r,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new rr(i,this._parents,e,r)}function xS(){var e,t,r=this,i=r._id,o=r.size();return new Promise(function(s,a){var n={value:a},l={value:function(){--o===0&&s()}};r.each(function(){var c=Ue(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}),o===0&&s()})}var CS=0;function rr(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function lf(){return++CS}var Ve=$o.prototype;rr.prototype={constructor:rr,select:Jw,selectAll:tS,selectChild:Ve.selectChild,selectChildren:Ve.selectChildren,filter:Uw,merge:Xw,selection:rS,transition:yS,call:Ve.call,nodes:Ve.nodes,node:Ve.node,size:Ve.size,empty:Ve.empty,each:Ve.each,on:Kw,attr:Fw,attrTween:Rw,style:nS,styleTween:cS,text:fS,textTween:mS,remove:Qw,tween:Sw,delay:Dw,duration:zw,ease:Ww,easeVarying:Yw,end:xS,[Symbol.iterator]:Ve[Symbol.iterator]};function bS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var kS={time:null,delay:0,duration:250,ease:bS};function wS(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 SS(e){var t,r;e instanceof rr?(t=e._id,e=e._name):(t=lf(),(r=kS).time=zl(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&na(l,e,t,c,a,r||wS(l,t));return new rr(i,this._parents,e,t)}$o.prototype.interrupt=bw;$o.prototype.transition=SS;const An=Math.PI,Mn=2*An,Tr=1e-6,vS=Mn-Tr;function hf(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function TS(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hf;const r=10**t;return function(i){this._+=i[0];for(let o=1,s=i.length;o<s;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}class _S{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?hf:TS(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,o){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(t,r,i,o,s,a){this._append`C${+t},${+r},${+i},${+o},${this._x1=+s},${this._y1=+a}`}arcTo(t,r,i,o,s){if(t=+t,r=+r,i=+i,o=+o,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,n=this._y1,l=i-t,c=o-r,h=a-t,d=n-r,u=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(u>Tr)if(!(Math.abs(d*l-c*h)>Tr)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let f=i-a,p=o-n,m=l*l+c*c,y=f*f+p*p,x=Math.sqrt(m),C=Math.sqrt(u),k=s*Math.tan((An-Math.acos((m+u-y)/(2*x*C)))/2),S=k/C,v=k/x;Math.abs(S-1)>Tr&&this._append`L${t+S*h},${r+S*d}`,this._append`A${s},${s},0,0,${+(d*f>h*p)},${this._x1=t+v*l},${this._y1=r+v*c}`}}arc(t,r,i,o,s,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^a,u=a?o-s:s-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>Tr||Math.abs(this._y1-h)>Tr)&&this._append`L${c},${h}`,i&&(u<0&&(u=u%Mn+Mn),u>vS?this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:u>Tr&&this._append`A${i},${i},0,${+(u>=An)},${d},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function _r(e){return function(){return e}}const BS=Math.abs,LS=Math.atan2,ES=Math.cos,FS=Math.max,AS=Math.min,MS=Math.sin,$S=Math.sqrt,$n=1e-12,la=Math.PI,On=la/2,OS=2*la;function RS(e){return e>1?0:e<-1?la:Math.acos(e)}function IS(e){return e>=1?On:e<=-1?-On:Math.asin(e)}function cf(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 _S(t)}function df(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function uf(e){this._context=e}uf.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 go(e){return new uf(e)}function PS(e){return e[0]}function DS(e){return e[1]}function ff(e,t){var r=_r(!0),i=null,o=go,s=null,a=cf(n);e=typeof e=="function"?e:e===void 0?PS:_r(e),t=typeof t=="function"?t:t===void 0?DS:_r(t);function n(l){var c,h=(l=df(l)).length,d,u=!1,f;for(i==null&&(s=o(f=a())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+e(d,c,l),+t(d,c,l));if(f)return s=null,f+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:_r(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:_r(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:_r(!!l),n):r},n.curve=function(l){return arguments.length?(o=l,i!=null&&(s=o(i)),n):o},n.context=function(l){return arguments.length?(l==null?i=s=null:s=o(i=l),n):i},n}class pf{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 gf(e){return new pf(e,!0)}function mf(e){return new pf(e,!1)}function ur(){}function As(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 ha(e){this._context=e}ha.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:As(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:As(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ms(e){return new ha(e)}function yf(e){this._context=e}yf.prototype={areaStart:ur,areaEnd:ur,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:As(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function NS(e){return new yf(e)}function xf(e){this._context=e}xf.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:As(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qS(e){return new xf(e)}function Cf(e,t){this._basis=new ha(e),this._beta=t}Cf.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],o=t[0],s=e[r]-i,a=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*s),this._beta*t[n]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const zS=(function e(t){function r(i){return t===1?new ha(i):new Cf(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function $s(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 Hl(e,t){this._context=e,this._k=(1-t)/6}Hl.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:$s(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:$s(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 bf=(function e(t){function r(i){return new Hl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Yl(e,t){this._context=e,this._k=(1-t)/6}Yl.prototype={areaStart:ur,areaEnd:ur,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:$s(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 jS=(function e(t){function r(i){return new Yl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Ul(e,t){this._context=e,this._k=(1-t)/6}Ul.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:$s(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 WS=(function e(t){function r(i){return new Ul(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Xl(e,t,r){var i=e._x1,o=e._y1,s=e._x2,a=e._y2;if(e._l01_a>$n){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,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>$n){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);s=(s*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,o,s,a,e._x2,e._y2)}function kf(e,t){this._context=e,this._alpha=t}kf.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:Xl(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 wf=(function e(t){function r(i){return t?new kf(i,t):new Hl(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:ur,areaEnd:ur,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:Xl(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 HS=(function e(t){function r(i){return t?new Sf(i,t):new Yl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function vf(e,t){this._context=e,this._alpha=t}vf.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:Xl(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 YS=(function e(t){function r(i){return t?new vf(i,t):new Ul(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Tf(e){this._context=e}Tf.prototype={areaStart:ur,areaEnd:ur,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 US(e){return new Tf(e)}function Lc(e){return e<0?-1:1}function Ec(e,t,r){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(r-e._y1)/(o||i<0&&-0),n=(s*o+a*i)/(i+o);return(Lc(s)+Lc(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(n))||0}function Fc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ha(e,t,r){var i=e._x0,o=e._y0,s=e._x1,a=e._y1,n=(s-i)/3;e._context.bezierCurveTo(i+n,o+n*t,s-n,a-n*r,s,a)}function Os(e){this._context=e}Os.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:Ha(this,this._t0,Fc(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,Ha(this,Fc(this,r=Ec(this,e,t)),r);break;default:Ha(this,this._t0,r=Ec(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function _f(e){this._context=new Bf(e)}(_f.prototype=Object.create(Os.prototype)).point=function(e,t){Os.prototype.point.call(this,t,e)};function Bf(e){this._context=e}Bf.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,o,s){this._context.bezierCurveTo(t,e,i,r,s,o)}};function Lf(e){return new Os(e)}function Ef(e){return new _f(e)}function Ff(e){this._context=e}Ff.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=Ac(e),o=Ac(t),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(i[0][s],o[0][s],i[1][s],o[1][s],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 Ac(e){var t,r=e.length-1,i,o=new Array(r),s=new Array(r),a=new Array(r);for(o[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,s[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(o[r-1]=a[r-1]/s[r-1],t=r-2;t>=0;--t)o[t]=(a[t]-o[t+1])/s[t];for(s[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-o[t+1];return[o,s]}function Af(e){return new Ff(e)}function ca(e,t){this._context=e,this._t=t}ca.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 Mf(e){return new ca(e,.5)}function $f(e){return new ca(e,0)}function Of(e){return new ca(e,1)}function ao(e,t,r){this.k=e,this.x=t,this.y=r}ao.prototype={constructor:ao,scale:function(e){return e===1?this:new ao(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ao(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+")"}};ao.prototype;var Rf=g(e=>{const{securityLevel:t}=kt();let r=yt("body");if(t==="sandbox"){const s=yt(`#i${e}`).node()?.contentDocument??document;r=yt(s.body)}return r.select(`#${e}`)},"selectSvgElement");function Gl(e){return typeof e>"u"||e===null}g(Gl,"isNothing");function If(e){return typeof e=="object"&&e!==null}g(If,"isObject");function Pf(e){return Array.isArray(e)?e:Gl(e)?[]:[e]}g(Pf,"toArray");function Df(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}g(Df,"extend");function Nf(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}g(Nf,"repeat");function qf(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}g(qf,"isNegativeZero");var XS=Gl,GS=If,VS=Pf,KS=Nf,ZS=qf,QS=Df,Wt={isNothing:XS,isObject:GS,toArray:VS,repeat:KS,isNegativeZero:ZS,extend:QS};function Vl(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+=`
|
|
130
|
+
`},"getStyles"),sk=g((e,t)=>{t!==void 0&&(as[e]=t)},"addStylesForDiagram"),ak=ok,Al={};hu(Al,{clear:()=>Eu,getAccDescription:()=>$u,getAccTitle:()=>Au,getDiagramTitle:()=>Ru,setAccDescription:()=>Mu,setAccTitle:()=>Fu,setDiagramTitle:()=>Ou});var Ml="",$l="",Ol="",Rl=g(e=>Ce(e,Ot()),"sanitizeText"),Eu=g(()=>{Ml="",Ol="",$l=""},"clear"),Fu=g(e=>{Ml=Rl(e).replace(/^\s+/g,"")},"setAccTitle"),Au=g(()=>Ml,"getAccTitle"),Mu=g(e=>{Ol=Rl(e).replace(/\n\s+/g,`
|
|
131
|
+
`)},"setAccDescription"),$u=g(()=>Ol,"getAccDescription"),Ou=g(e=>{$l=Rl(e)},"setDiagramTitle"),Ru=g(()=>$l,"getDiagramTitle"),uc=V,nk=Tl,kt=Ot,lk=yu,hk=Bi,Il=g(e=>Ce(e,kt()),"sanitizeText"),Iu=Lu,ck=g(()=>Al,"getCommonDb"),Ss={},vs=g((e,t,r)=>{Ss[e]&&uc.warn(`Diagram with id ${e} already registered. Overwriting.`),Ss[e]=t,r&&Su(e,r),sk(e,t.styles),t.injectUtils?.(uc,nk,kt,Il,Iu,ck(),()=>{})},"registerDiagram"),wn=g(e=>{if(e in Ss)return Ss[e];throw new dk(e)},"getDiagram"),wi,dk=(wi=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},g(wi,"DiagramNotFoundError"),wi),uk={value:()=>{}};function Pu(){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 ns(r)}function ns(e){this._=e}function fk(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}ns.prototype=Pu.prototype={constructor:ns,on:function(e,t){var r=this._,i=fk(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((o=(e=i[s]).type)&&(o=pk(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(o=(e=i[s]).type)r[o]=fc(r[o],e.name,t);else if(t==null)for(o in r)r[o]=fc(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new ns(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,s;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,o=s.length;i<o;++i)s[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],o=0,s=i.length;o<s;++o)i[o].value.apply(t,r)}};function pk(e,t){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===t)return o.value}function fc(e,t,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=uk,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var Sn="http://www.w3.org/1999/xhtml";const pc={svg:"http://www.w3.org/2000/svg",xhtml:Sn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ia(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),pc.hasOwnProperty(t)?{space:pc[t],local:e}:e}function gk(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Sn&&t.documentElement.namespaceURI===Sn?t.createElement(e):t.createElementNS(r,e)}}function mk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Du(e){var t=ia(e);return(t.local?mk:gk)(t)}function yk(){}function Pl(e){return e==null?yk:function(){return this.querySelector(e)}}function xk(e){typeof e!="function"&&(e=Pl(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=new Array(a),l,c,h=0;h<a;++h)(l=s[h])&&(c=e.call(l,l.__data__,h,s))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new pe(i,this._parents)}function Ck(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function bk(){return[]}function Nu(e){return e==null?bk:function(){return this.querySelectorAll(e)}}function kk(e){return function(){return Ck(e.apply(this,arguments))}}function wk(e){typeof e=="function"?e=kk(e):e=Nu(e);for(var t=this._groups,r=t.length,i=[],o=[],s=0;s<r;++s)for(var a=t[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),o.push(l));return new pe(i,o)}function qu(e){return function(){return this.matches(e)}}function zu(e){return function(t){return t.matches(e)}}var Sk=Array.prototype.find;function vk(e){return function(){return Sk.call(this.children,e)}}function Tk(){return this.firstElementChild}function _k(e){return this.select(e==null?Tk:vk(typeof e=="function"?e:zu(e)))}var Bk=Array.prototype.filter;function Lk(){return Array.from(this.children)}function Ek(e){return function(){return Bk.call(this.children,e)}}function Fk(e){return this.selectAll(e==null?Lk:Ek(typeof e=="function"?e:zu(e)))}function Ak(e){typeof e!="function"&&(e=qu(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new pe(i,this._parents)}function ju(e){return new Array(e.length)}function Mk(){return new pe(this._enter||this._groups.map(ju),this._parents)}function Ts(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ts.prototype={constructor:Ts,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 $k(e){return function(){return e}}function Ok(e,t,r,i,o,s){for(var a=0,n,l=t.length,c=s.length;a<c;++a)(n=t[a])?(n.__data__=s[a],i[a]=n):r[a]=new Ts(e,s[a]);for(;a<l;++a)(n=t[a])&&(o[a]=n)}function Rk(e,t,r,i,o,s,a){var n,l,c=new Map,h=t.length,d=s.length,u=new Array(h),f;for(n=0;n<h;++n)(l=t[n])&&(u[n]=f=a.call(l,l.__data__,n,t)+"",c.has(f)?o[n]=l:c.set(f,l));for(n=0;n<d;++n)f=a.call(e,s[n],n,s)+"",(l=c.get(f))?(i[n]=l,l.__data__=s[n],c.delete(f)):r[n]=new Ts(e,s[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(u[n])===l&&(o[n]=l)}function Ik(e){return e.__data__}function Pk(e,t){if(!arguments.length)return Array.from(this,Ik);var r=t?Rk:Ok,i=this._parents,o=this._groups;typeof e!="function"&&(e=$k(e));for(var s=o.length,a=new Array(s),n=new Array(s),l=new Array(s),c=0;c<s;++c){var h=i[c],d=o[c],u=d.length,f=Dk(e.call(h,h&&h.__data__,c,i)),p=f.length,m=n[c]=new Array(p),y=a[c]=new Array(p),x=l[c]=new Array(u);r(h,d,m,y,x,f,t);for(var C=0,k=0,S,v;C<p;++C)if(S=m[C]){for(C>=k&&(k=C+1);!(v=y[k])&&++k<p;);S._next=v||null}}return a=new pe(a,i),a._enter=n,a._exit=l,a}function Dk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Nk(){return new pe(this._exit||this._groups.map(ju),this._parents)}function qk(e,t,r){var i=this.enter(),o=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?s.remove():r(s),i&&o?i.merge(o).order():o}function zk(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,s=i.length,a=Math.min(o,s),n=new Array(o),l=0;l<a;++l)for(var c=r[l],h=i[l],d=c.length,u=n[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||h[p])&&(u[p]=f);for(;l<o;++l)n[l]=r[l];return new pe(n,this._parents)}function jk(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,s=i[o],a;--o>=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Wk(e){e||(e=Hk);function t(d,u){return d&&u?e(d.__data__,u.__data__):!d-!u}for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s){for(var a=r[s],n=a.length,l=o[s]=new Array(n),c,h=0;h<n;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new pe(o,this._parents).order()}function Hk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Yk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Uk(){return Array.from(this)}function Xk(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length;o<s;++o){var a=i[o];if(a)return a}return null}function Gk(){let e=0;for(const t of this)++e;return e}function Vk(){return!this.node()}function Kk(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],s=0,a=o.length,n;s<a;++s)(n=o[s])&&e.call(n,n.__data__,s,o);return this}function Zk(e){return function(){this.removeAttribute(e)}}function Qk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Jk(e,t){return function(){this.setAttribute(e,t)}}function t2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function e2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function r2(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 i2(e,t){var r=ia(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?Qk:Zk:typeof t=="function"?r.local?r2:e2:r.local?t2:Jk)(r,t))}function Wu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function o2(e){return function(){this.style.removeProperty(e)}}function s2(e,t,r){return function(){this.style.setProperty(e,t,r)}}function a2(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function n2(e,t,r){return arguments.length>1?this.each((t==null?o2:typeof t=="function"?a2:s2)(e,t,r??"")):Ei(this.node(),e)}function Ei(e,t){return e.style.getPropertyValue(t)||Wu(e).getComputedStyle(e,null).getPropertyValue(t)}function l2(e){return function(){delete this[e]}}function h2(e,t){return function(){this[e]=t}}function c2(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function d2(e,t){return arguments.length>1?this.each((t==null?l2:typeof t=="function"?c2:h2)(e,t)):this.node()[e]}function Hu(e){return e.trim().split(/^|\s+/)}function Dl(e){return e.classList||new Yu(e)}function Yu(e){this._node=e,this._names=Hu(e.getAttribute("class")||"")}Yu.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 Uu(e,t){for(var r=Dl(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function Xu(e,t){for(var r=Dl(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function u2(e){return function(){Uu(this,e)}}function f2(e){return function(){Xu(this,e)}}function p2(e,t){return function(){(t.apply(this,arguments)?Uu:Xu)(this,e)}}function g2(e,t){var r=Hu(e+"");if(arguments.length<2){for(var i=Dl(this.node()),o=-1,s=r.length;++o<s;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?p2:t?u2:f2)(r,t))}function m2(){this.textContent=""}function y2(e){return function(){this.textContent=e}}function x2(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function C2(e){return arguments.length?this.each(e==null?m2:(typeof e=="function"?x2:y2)(e)):this.node().textContent}function b2(){this.innerHTML=""}function k2(e){return function(){this.innerHTML=e}}function w2(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function S2(e){return arguments.length?this.each(e==null?b2:(typeof e=="function"?w2:k2)(e)):this.node().innerHTML}function v2(){this.nextSibling&&this.parentNode.appendChild(this)}function T2(){return this.each(v2)}function _2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function B2(){return this.each(_2)}function L2(e){var t=typeof e=="function"?e:Du(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function E2(){return null}function F2(e,t){var r=typeof e=="function"?e:Du(e),i=t==null?E2:typeof t=="function"?t:Pl(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function A2(){var e=this.parentNode;e&&e.removeChild(this)}function M2(){return this.each(A2)}function $2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function O2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function R2(e){return this.select(e?O2:$2)}function I2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function P2(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 N2(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,s;r<o;++r)s=t[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function q2(e,t,r){return function(){var i=this.__on,o,s=P2(t);if(i){for(var a=0,n=i.length;a<n;++a)if((o=i[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=t;return}}this.addEventListener(e.type,s,r),o={type:e.type,name:e.name,value:t,listener:s,options:r},i?i.push(o):this.__on=[o]}}function z2(e,t,r){var i=D2(e+""),o,s=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(o=0,h=n[l];o<s;++o)if((a=i[o]).type===h.type&&a.name===h.name)return h.value}return}for(n=t?q2:N2,o=0;o<s;++o)this.each(n(i[o],t,r));return this}function Gu(e,t,r){var i=Wu(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,r):(o=i.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function j2(e,t){return function(){return Gu(this,e,t)}}function W2(e,t){return function(){return Gu(this,e,t.apply(this,arguments))}}function H2(e,t){return this.each((typeof t=="function"?W2:j2)(e,t))}function*Y2(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length,a;o<s;++o)(a=i[o])&&(yield a)}var Vu=[null];function pe(e,t){this._groups=e,this._parents=t}function $o(){return new pe([[document.documentElement]],Vu)}function U2(){return this}pe.prototype=$o.prototype={constructor:pe,select:xk,selectAll:wk,selectChild:_k,selectChildren:Fk,filter:Ak,data:Pk,enter:Mk,exit:Nk,join:qk,merge:zk,selection:U2,order:jk,sort:Wk,call:Yk,nodes:Uk,node:Xk,size:Gk,empty:Vk,each:Kk,attr:i2,style:n2,property:d2,classed:g2,text:C2,html:S2,raise:T2,lower:B2,append:L2,insert:F2,remove:M2,clone:R2,datum:I2,on:z2,dispatch:H2,[Symbol.iterator]:Y2};function yt(e){return typeof e=="string"?new pe([[document.querySelector(e)]],[document.documentElement]):new pe([[e]],Vu)}function oa(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Nl(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Di(){}var bo=.7,_s=1/bo,li="\\s*([+-]?\\d+)\\s*",ko="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",X2=/^#([0-9a-f]{3,8})$/,G2=new RegExp(`^rgb\\(${li},${li},${li}\\)$`),V2=new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`),K2=new RegExp(`^rgba\\(${li},${li},${li},${ko}\\)$`),Z2=new RegExp(`^rgba\\(${qe},${qe},${qe},${ko}\\)$`),Q2=new RegExp(`^hsl\\(${ko},${qe},${qe}\\)$`),J2=new RegExp(`^hsla\\(${ko},${qe},${qe},${ko}\\)$`),gc={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};oa(Di,Fi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:mc,formatHex:mc,formatHex8:tw,formatHsl:ew,formatRgb:yc,toString:yc});function mc(){return this.rgb().formatHex()}function tw(){return this.rgb().formatHex8()}function ew(){return Zu(this).formatHsl()}function yc(){return this.rgb().formatRgb()}function Fi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=X2.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?xc(t):r===3?new se(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Yo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Yo(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=G2.exec(e))?new se(t[1],t[2],t[3],1):(t=V2.exec(e))?new se(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=K2.exec(e))?Yo(t[1],t[2],t[3],t[4]):(t=Z2.exec(e))?Yo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Q2.exec(e))?kc(t[1],t[2]/100,t[3]/100,1):(t=J2.exec(e))?kc(t[1],t[2]/100,t[3]/100,t[4]):gc.hasOwnProperty(e)?xc(gc[e]):e==="transparent"?new se(NaN,NaN,NaN,0):null}function xc(e){return new se(e>>16&255,e>>8&255,e&255,1)}function Yo(e,t,r,i){return i<=0&&(e=t=r=NaN),new se(e,t,r,i)}function Ku(e){return e instanceof Di||(e=Fi(e)),e?(e=e.rgb(),new se(e.r,e.g,e.b,e.opacity)):new se}function vn(e,t,r,i){return arguments.length===1?Ku(e):new se(e,t,r,i??1)}function se(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}oa(se,vn,Nl(Di,{brighter(e){return e=e==null?_s:Math.pow(_s,e),new se(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bo:Math.pow(bo,e),new se(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new se($r(this.r),$r(this.g),$r(this.b),Bs(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:Cc,formatHex:Cc,formatHex8:rw,formatRgb:bc,toString:bc}));function Cc(){return`#${Fr(this.r)}${Fr(this.g)}${Fr(this.b)}`}function rw(){return`#${Fr(this.r)}${Fr(this.g)}${Fr(this.b)}${Fr((isNaN(this.opacity)?1:this.opacity)*255)}`}function bc(){const e=Bs(this.opacity);return`${e===1?"rgb(":"rgba("}${$r(this.r)}, ${$r(this.g)}, ${$r(this.b)}${e===1?")":`, ${e})`}`}function Bs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $r(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fr(e){return e=$r(e),(e<16?"0":"")+e.toString(16)}function kc(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 Zu(e){if(e instanceof Ee)return new Ee(e.h,e.s,e.l,e.opacity);if(e instanceof Di||(e=Fi(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,o=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,n=s-o,l=(s+o)/2;return n?(t===s?a=(r-i)/n+(r<i)*6:r===s?a=(i-t)/n+2:a=(t-r)/n+4,n/=l<.5?s+o:2-s-o,a*=60):n=l>0&&l<1?0:a,new Ee(a,n,l,e.opacity)}function iw(e,t,r,i){return arguments.length===1?Zu(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}oa(Ee,iw,Nl(Di,{brighter(e){return e=e==null?_s:Math.pow(_s,e),new Ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bo:Math.pow(bo,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,o=2*r-i;return new se(ja(e>=240?e-240:e+120,o,i),ja(e,o,i),ja(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Ee(wc(this.h),Uo(this.s),Uo(this.l),Bs(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=Bs(this.opacity);return`${e===1?"hsl(":"hsla("}${wc(this.h)}, ${Uo(this.s)*100}%, ${Uo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wc(e){return e=(e||0)%360,e<0?e+360:e}function Uo(e){return Math.max(0,Math.min(1,e||0))}function ja(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 sa=e=>()=>e;function Qu(e,t){return function(r){return e+r*t}}function ow(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 sw(e,t){var r=t-e;return r?Qu(e,r>180||r<-180?r-360*Math.round(r/360):r):sa(isNaN(e)?t:e)}function aw(e){return(e=+e)==1?ql:function(t,r){return r-t?ow(t,r,e):sa(isNaN(t)?r:t)}}function ql(e,t){var r=t-e;return r?Qu(e,r):sa(isNaN(e)?t:e)}const Tn=(function e(t){var r=aw(t);function i(o,s){var a=r((o=vn(o)).r,(s=vn(s)).r),n=r(o.g,s.g),l=r(o.b,s.b),c=ql(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=n(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function Qe(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var _n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wa=new RegExp(_n.source,"g");function nw(e){return function(){return e}}function lw(e){return function(t){return e(t)+""}}function Ju(e,t){var r=_n.lastIndex=Wa.lastIndex=0,i,o,s,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=_n.exec(e))&&(o=Wa.exec(t));)(s=o.index)>r&&(s=t.slice(r,s),n[a]?n[a]+=s:n[++a]=s),(i=i[0])===(o=o[0])?n[a]?n[a]+=o:n[++a]=o:(n[++a]=null,l.push({i:a,x:Qe(i,o)})),r=Wa.lastIndex;return r<t.length&&(s=t.slice(r),n[a]?n[a]+=s:n[++a]=s),n.length<2?l[0]?lw(l[0].x):nw(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 Sc=180/Math.PI,Bn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tf(e,t,r,i,o,s){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:o,translateY:s,rotate:Math.atan2(t,e)*Sc,skewX:Math.atan(l)*Sc,scaleX:a,scaleY:n}}var Xo;function hw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Bn:tf(t.a,t.b,t.c,t.d,t.e,t.f)}function cw(e){return e==null||(Xo||(Xo=document.createElementNS("http://www.w3.org/2000/svg","g")),Xo.setAttribute("transform",e),!(e=Xo.transform.baseVal.consolidate()))?Bn:(e=e.matrix,tf(e.a,e.b,e.c,e.d,e.e,e.f))}function ef(e,t,r,i){function o(c){return c.length?c.pop()+" ":""}function s(c,h,d,u,f,p){if(c!==d||h!==u){var m=f.push("translate(",null,t,null,r);p.push({i:m-4,x:Qe(c,d)},{i:m-2,x:Qe(h,u)})}else(d||u)&&f.push("translate("+d+t+u+r)}function a(c,h,d,u){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),u.push({i:d.push(o(d)+"rotate(",null,i)-2,x:Qe(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function n(c,h,d,u){c!==h?u.push({i:d.push(o(d)+"skewX(",null,i)-2,x:Qe(c,h)}):h&&d.push(o(d)+"skewX("+h+i)}function l(c,h,d,u,f,p){if(c!==d||h!==u){var m=f.push(o(f)+"scale(",null,",",null,")");p.push({i:m-4,x:Qe(c,d)},{i:m-2,x:Qe(h,u)})}else(d!==1||u!==1)&&f.push(o(f)+"scale("+d+","+u+")")}return function(c,h){var d=[],u=[];return c=e(c),h=e(h),s(c.translateX,c.translateY,h.translateX,h.translateY,d,u),a(c.rotate,h.rotate,d,u),n(c.skewX,h.skewX,d,u),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,u),c=h=null,function(f){for(var p=-1,m=u.length,y;++p<m;)d[(y=u[p]).i]=y.x(f);return d.join("")}}}var dw=ef(hw,"px, ","px)","deg)"),uw=ef(cw,", ",")",")"),Ai=0,oo=0,Vi=0,rf=1e3,Ls,so,Es=0,Dr=0,aa=0,wo=typeof performance=="object"&&performance.now?performance:Date,of=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zl(){return Dr||(of(fw),Dr=wo.now()+aa)}function fw(){Dr=0}function Fs(){this._call=this._time=this._next=null}Fs.prototype=sf.prototype={constructor:Fs,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?zl():+r)+(t==null?0:+t),!this._next&&so!==this&&(so?so._next=this:Ls=this,so=this),this._call=e,this._time=r,Ln()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ln())}};function sf(e,t,r){var i=new Fs;return i.restart(e,t,r),i}function pw(){zl(),++Ai;for(var e=Ls,t;e;)(t=Dr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ai}function vc(){Dr=(Es=wo.now())+aa,Ai=oo=0;try{pw()}finally{Ai=0,mw(),Dr=0}}function gw(){var e=wo.now(),t=e-Es;t>rf&&(aa-=t,Es=e)}function mw(){for(var e,t=Ls,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:Ls=r);so=e,Ln(i)}function Ln(e){if(!Ai){oo&&(oo=clearTimeout(oo));var t=e-Dr;t>24?(e<1/0&&(oo=setTimeout(vc,e-wo.now()-aa)),Vi&&(Vi=clearInterval(Vi))):(Vi||(Es=wo.now(),Vi=setInterval(gw,rf)),Ai=1,of(vc))}}function Tc(e,t,r){var i=new Fs;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var yw=Pu("start","end","cancel","interrupt"),xw=[],af=0,_c=1,En=2,ls=3,Bc=4,Fn=5,hs=6;function na(e,t,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;Cw(e,r,{name:t,index:i,group:o,on:yw,tween:xw,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:af})}function jl(e,t){var r=$e(e,t);if(r.state>af)throw new Error("too late; already scheduled");return r}function Ue(e,t){var r=$e(e,t);if(r.state>ls)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 Cw(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=sf(s,0,r.time);function s(c){r.state=_c,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var h,d,u,f;if(r.state!==_c)return l();for(h in i)if(f=i[h],f.name===r.name){if(f.state===ls)return Tc(a);f.state===Bc?(f.state=hs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[h]):+h<t&&(f.state=hs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[h])}if(Tc(function(){r.state===ls&&(r.state=Bc,r.timer.restart(n,r.delay,r.time),n(c))}),r.state=En,r.on.call("start",e,e.__data__,r.index,r.group),r.state===En){for(r.state=ls,o=new Array(u=r.tween.length),h=0,d=-1;h<u;++h)(f=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(o[++d]=f);o.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=Fn,1),d=-1,u=o.length;++d<u;)o[d].call(e,h);r.state===Fn&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=hs,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function bw(e,t){var r=e.__transition,i,o,s=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((i=r[a]).name!==t){s=!1;continue}o=i.state>En&&i.state<Fn,i.state=hs,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}s&&delete e.__transition}}function kw(e){return this.each(function(){bw(this,e)})}function ww(e,t){var r,i;return function(){var o=Ue(this,e),s=o.tween;if(s!==r){i=r=s;for(var a=0,n=i.length;a<n;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function Sw(e,t,r){var i,o;if(typeof r!="function")throw new Error;return function(){var s=Ue(this,e),a=s.tween;if(a!==i){o=(i=a).slice();for(var n={name:t,value:r},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=n;break}l===c&&o.push(n)}s.tween=o}}function vw(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=$e(this.node(),r).tween,o=0,s=i.length,a;o<s;++o)if((a=i[o]).name===e)return a.value;return null}return this.each((t==null?ww:Sw)(r,e,t))}function Wl(e,t,r){var i=e._id;return e.each(function(){var o=Ue(this,i);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return $e(o,i).value[t]}}function nf(e,t){var r;return(typeof t=="number"?Qe:t instanceof Fi?Tn:(r=Fi(t))?(t=r,Tn):Ju)(e,t)}function Tw(e){return function(){this.removeAttribute(e)}}function _w(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Bw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttribute(e);return a===o?null:a===i?s:s=t(i=a,r)}}function Lw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===i?s:s=t(i=a,r)}}function Ew(e,t,r){var i,o,s;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===o?s:(o=l,s=t(i=a,n)))}}function Fw(e,t,r){var i,o,s;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===o?s:(o=l,s=t(i=a,n)))}}function Aw(e,t){var r=ia(e),i=r==="transform"?uw:nf;return this.attrTween(e,typeof t=="function"?(r.local?Fw:Ew)(r,i,Wl(this,"attr."+e,t)):t==null?(r.local?_w:Tw)(r):(r.local?Lw:Bw)(r,i,t))}function Mw(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function $w(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Ow(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&$w(e,s)),r}return o._value=t,o}function Rw(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Mw(e,s)),r}return o._value=t,o}function Iw(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=ia(e);return this.tween(r,(i.local?Ow:Rw)(i,t))}function Pw(e,t){return function(){jl(this,e).delay=+t.apply(this,arguments)}}function Dw(e,t){return t=+t,function(){jl(this,e).delay=t}}function Nw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Pw:Dw)(t,e)):$e(this.node(),t).delay}function qw(e,t){return function(){Ue(this,e).duration=+t.apply(this,arguments)}}function zw(e,t){return t=+t,function(){Ue(this,e).duration=t}}function jw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qw:zw)(t,e)):$e(this.node(),t).duration}function Ww(e,t){if(typeof t!="function")throw new Error;return function(){Ue(this,e).ease=t}}function Hw(e){var t=this._id;return arguments.length?this.each(Ww(t,e)):$e(this.node(),t).ease}function Yw(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ue(this,e).ease=r}}function Uw(e){if(typeof e!="function")throw new Error;return this.each(Yw(this._id,e))}function Xw(e){typeof e!="function"&&(e=qu(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new rr(i,this._parents,this._name,this._id)}function Gw(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,o=r.length,s=Math.min(i,o),a=new Array(i),n=0;n<s;++n)for(var l=t[n],c=r[n],h=l.length,d=a[n]=new Array(h),u,f=0;f<h;++f)(u=l[f]||c[f])&&(d[f]=u);for(;n<i;++n)a[n]=t[n];return new rr(a,this._parents,this._name,this._id)}function Vw(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 Kw(e,t,r){var i,o,s=Vw(t)?jl:Ue;return function(){var a=s(this,e),n=a.on;n!==i&&(o=(i=n).copy()).on(t,r),a.on=o}}function Zw(e,t){var r=this._id;return arguments.length<2?$e(this.node(),r).on.on(e):this.each(Kw(r,e,t))}function Qw(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Jw(){return this.on("end.remove",Qw(this._id))}function tS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Pl(e));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a<o;++a)for(var n=i[a],l=n.length,c=s[a]=new Array(l),h,d,u=0;u<l;++u)(h=n[u])&&(d=e.call(h,h.__data__,u,n))&&("__data__"in h&&(d.__data__=h.__data__),c[u]=d,na(c[u],t,r,u,c,$e(h,r)));return new rr(s,this._parents,t,r)}function eS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Nu(e));for(var i=this._groups,o=i.length,s=[],a=[],n=0;n<o;++n)for(var l=i[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var u=e.call(h,h.__data__,d,l),f,p=$e(h,r),m=0,y=u.length;m<y;++m)(f=u[m])&&na(f,t,r,m,u,p);s.push(u),a.push(h)}return new rr(s,a,t,r)}var rS=$o.prototype.constructor;function iS(){return new rS(this._groups,this._parents)}function oS(e,t){var r,i,o;return function(){var s=Ei(this,e),a=(this.style.removeProperty(e),Ei(this,e));return s===a?null:s===r&&a===i?o:o=t(r=s,i=a)}}function lf(e){return function(){this.style.removeProperty(e)}}function sS(e,t,r){var i,o=r+"",s;return function(){var a=Ei(this,e);return a===o?null:a===i?s:s=t(i=a,r)}}function aS(e,t,r){var i,o,s;return function(){var a=Ei(this,e),n=r(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),Ei(this,e))),a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n))}}function nS(e,t){var r,i,o,s="style."+t,a="end."+s,n;return function(){var l=Ue(this,e),c=l.on,h=l.value[s]==null?n||(n=lf(t)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(a,o=h),l.on=i}}function lS(e,t,r){var i=(e+="")=="transform"?dw:nf;return t==null?this.styleTween(e,oS(e,i)).on("end.style."+e,lf(e)):typeof t=="function"?this.styleTween(e,aS(e,i,Wl(this,"style."+e,t))).each(nS(this._id,e)):this.styleTween(e,sS(e,i,t),r).on("end.style."+e,null)}function hS(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function cS(e,t,r){var i,o;function s(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&hS(e,a,r)),i}return s._value=t,s}function dS(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,cS(e,t,r??""))}function uS(e){return function(){this.textContent=e}}function fS(e){return function(){var t=e(this);this.textContent=t??""}}function pS(e){return this.tween("text",typeof e=="function"?fS(Wl(this,"text",e)):uS(e==null?"":e+""))}function gS(e){return function(t){this.textContent=e.call(this,t)}}function mS(e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&gS(o)),t}return i._value=e,i}function yS(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,mS(e))}function xS(){for(var e=this._name,t=this._id,r=hf(),i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)if(l=a[c]){var h=$e(l,t);na(l,e,r,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new rr(i,this._parents,e,r)}function CS(){var e,t,r=this,i=r._id,o=r.size();return new Promise(function(s,a){var n={value:a},l={value:function(){--o===0&&s()}};r.each(function(){var c=Ue(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}),o===0&&s()})}var bS=0;function rr(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function hf(){return++bS}var Ve=$o.prototype;rr.prototype={constructor:rr,select:tS,selectAll:eS,selectChild:Ve.selectChild,selectChildren:Ve.selectChildren,filter:Xw,merge:Gw,selection:iS,transition:xS,call:Ve.call,nodes:Ve.nodes,node:Ve.node,size:Ve.size,empty:Ve.empty,each:Ve.each,on:Zw,attr:Aw,attrTween:Iw,style:lS,styleTween:dS,text:pS,textTween:yS,remove:Jw,tween:vw,delay:Nw,duration:jw,ease:Hw,easeVarying:Uw,end:CS,[Symbol.iterator]:Ve[Symbol.iterator]};function kS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var wS={time:null,delay:0,duration:250,ease:kS};function SS(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 vS(e){var t,r;e instanceof rr?(t=e._id,e=e._name):(t=hf(),(r=wS).time=zl(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&na(l,e,t,c,a,r||SS(l,t));return new rr(i,this._parents,e,t)}$o.prototype.interrupt=kw;$o.prototype.transition=vS;const An=Math.PI,Mn=2*An,Tr=1e-6,TS=Mn-Tr;function cf(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function _S(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return cf;const r=10**t;return function(i){this._+=i[0];for(let o=1,s=i.length;o<s;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}class BS{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?cf:_S(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,o){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(t,r,i,o,s,a){this._append`C${+t},${+r},${+i},${+o},${this._x1=+s},${this._y1=+a}`}arcTo(t,r,i,o,s){if(t=+t,r=+r,i=+i,o=+o,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,n=this._y1,l=i-t,c=o-r,h=a-t,d=n-r,u=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(u>Tr)if(!(Math.abs(d*l-c*h)>Tr)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let f=i-a,p=o-n,m=l*l+c*c,y=f*f+p*p,x=Math.sqrt(m),C=Math.sqrt(u),k=s*Math.tan((An-Math.acos((m+u-y)/(2*x*C)))/2),S=k/C,v=k/x;Math.abs(S-1)>Tr&&this._append`L${t+S*h},${r+S*d}`,this._append`A${s},${s},0,0,${+(d*f>h*p)},${this._x1=t+v*l},${this._y1=r+v*c}`}}arc(t,r,i,o,s,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^a,u=a?o-s:s-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>Tr||Math.abs(this._y1-h)>Tr)&&this._append`L${c},${h}`,i&&(u<0&&(u=u%Mn+Mn),u>TS?this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:u>Tr&&this._append`A${i},${i},0,${+(u>=An)},${d},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function _r(e){return function(){return e}}const LS=Math.abs,ES=Math.atan2,FS=Math.cos,AS=Math.max,MS=Math.min,$S=Math.sin,OS=Math.sqrt,$n=1e-12,la=Math.PI,On=la/2,RS=2*la;function IS(e){return e>1?0:e<-1?la:Math.acos(e)}function PS(e){return e>=1?On:e<=-1?-On:Math.asin(e)}function df(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 BS(t)}function uf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ff(e){this._context=e}ff.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 go(e){return new ff(e)}function DS(e){return e[0]}function NS(e){return e[1]}function pf(e,t){var r=_r(!0),i=null,o=go,s=null,a=df(n);e=typeof e=="function"?e:e===void 0?DS:_r(e),t=typeof t=="function"?t:t===void 0?NS:_r(t);function n(l){var c,h=(l=uf(l)).length,d,u=!1,f;for(i==null&&(s=o(f=a())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+e(d,c,l),+t(d,c,l));if(f)return s=null,f+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:_r(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:_r(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:_r(!!l),n):r},n.curve=function(l){return arguments.length?(o=l,i!=null&&(s=o(i)),n):o},n.context=function(l){return arguments.length?(l==null?i=s=null:s=o(i=l),n):i},n}class gf{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 mf(e){return new gf(e,!0)}function yf(e){return new gf(e,!1)}function ur(){}function As(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 ha(e){this._context=e}ha.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:As(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:As(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ms(e){return new ha(e)}function xf(e){this._context=e}xf.prototype={areaStart:ur,areaEnd:ur,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:As(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qS(e){return new xf(e)}function Cf(e){this._context=e}Cf.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:As(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zS(e){return new Cf(e)}function bf(e,t){this._basis=new ha(e),this._beta=t}bf.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],o=t[0],s=e[r]-i,a=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*s),this._beta*t[n]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const jS=(function e(t){function r(i){return t===1?new ha(i):new bf(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function $s(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 Hl(e,t){this._context=e,this._k=(1-t)/6}Hl.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:$s(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:$s(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 kf=(function e(t){function r(i){return new Hl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Yl(e,t){this._context=e,this._k=(1-t)/6}Yl.prototype={areaStart:ur,areaEnd:ur,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:$s(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 WS=(function e(t){function r(i){return new Yl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Ul(e,t){this._context=e,this._k=(1-t)/6}Ul.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:$s(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 HS=(function e(t){function r(i){return new Ul(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Xl(e,t,r){var i=e._x1,o=e._y1,s=e._x2,a=e._y2;if(e._l01_a>$n){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,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>$n){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);s=(s*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,o,s,a,e._x2,e._y2)}function wf(e,t){this._context=e,this._alpha=t}wf.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:Xl(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 Sf=(function e(t){function r(i){return t?new wf(i,t):new Hl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function vf(e,t){this._context=e,this._alpha=t}vf.prototype={areaStart:ur,areaEnd:ur,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:Xl(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 YS=(function e(t){function r(i){return t?new vf(i,t):new Yl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);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(){(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:Xl(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 US=(function e(t){function r(i){return t?new Tf(i,t):new Ul(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function _f(e){this._context=e}_f.prototype={areaStart:ur,areaEnd:ur,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 XS(e){return new _f(e)}function Lc(e){return e<0?-1:1}function Ec(e,t,r){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(r-e._y1)/(o||i<0&&-0),n=(s*o+a*i)/(i+o);return(Lc(s)+Lc(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(n))||0}function Fc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ha(e,t,r){var i=e._x0,o=e._y0,s=e._x1,a=e._y1,n=(s-i)/3;e._context.bezierCurveTo(i+n,o+n*t,s-n,a-n*r,s,a)}function Os(e){this._context=e}Os.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:Ha(this,this._t0,Fc(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,Ha(this,Fc(this,r=Ec(this,e,t)),r);break;default:Ha(this,this._t0,r=Ec(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Bf(e){this._context=new Lf(e)}(Bf.prototype=Object.create(Os.prototype)).point=function(e,t){Os.prototype.point.call(this,t,e)};function Lf(e){this._context=e}Lf.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,o,s){this._context.bezierCurveTo(t,e,i,r,s,o)}};function Ef(e){return new Os(e)}function Ff(e){return new Bf(e)}function Af(e){this._context=e}Af.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=Ac(e),o=Ac(t),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(i[0][s],o[0][s],i[1][s],o[1][s],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 Ac(e){var t,r=e.length-1,i,o=new Array(r),s=new Array(r),a=new Array(r);for(o[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,s[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(o[r-1]=a[r-1]/s[r-1],t=r-2;t>=0;--t)o[t]=(a[t]-o[t+1])/s[t];for(s[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-o[t+1];return[o,s]}function Mf(e){return new Af(e)}function ca(e,t){this._context=e,this._t=t}ca.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 $f(e){return new ca(e,.5)}function Of(e){return new ca(e,0)}function Rf(e){return new ca(e,1)}function ao(e,t,r){this.k=e,this.x=t,this.y=r}ao.prototype={constructor:ao,scale:function(e){return e===1?this:new ao(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ao(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+")"}};ao.prototype;var If=g(e=>{const{securityLevel:t}=kt();let r=yt("body");if(t==="sandbox"){const s=yt(`#i${e}`).node()?.contentDocument??document;r=yt(s.body)}return r.select(`#${e}`)},"selectSvgElement");function Gl(e){return typeof e>"u"||e===null}g(Gl,"isNothing");function Pf(e){return typeof e=="object"&&e!==null}g(Pf,"isObject");function Df(e){return Array.isArray(e)?e:Gl(e)?[]:[e]}g(Df,"toArray");function Nf(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}g(Nf,"extend");function qf(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}g(qf,"repeat");function zf(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}g(zf,"isNegativeZero");var GS=Gl,VS=Pf,KS=Df,ZS=qf,QS=zf,JS=Nf,Wt={isNothing:GS,isObject:VS,toArray:KS,repeat:ZS,isNegativeZero:QS,extend:JS};function Vl(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
132
|
|
|
133
|
-
`+e.mark.snippet),i+" "+r):i}g(Vl,"formatError");function Mi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Vl(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}g(Mi,"YAMLException$1");Mi.prototype=Object.create(Error.prototype);Mi.prototype.constructor=Mi;Mi.prototype.toString=g(function(t){return this.name+": "+Vl(this,t)},"toString");var de=Mi;function cs(e,t,r,i,o){var s="",a="",n=Math.floor(o/2)-1;return i-t>n&&(s=" ... ",t=i-n+s.length),r-i>n&&(a=" ...",r=i+n-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}g(cs,"getLine");function ds(e,t){return Wt.repeat(" ",t-e.length)+e}g(ds,"padStart");function
|
|
133
|
+
`+e.mark.snippet),i+" "+r):i}g(Vl,"formatError");function Mi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Vl(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}g(Mi,"YAMLException$1");Mi.prototype=Object.create(Error.prototype);Mi.prototype.constructor=Mi;Mi.prototype.toString=g(function(t){return this.name+": "+Vl(this,t)},"toString");var de=Mi;function cs(e,t,r,i,o){var s="",a="",n=Math.floor(o/2)-1;return i-t>n&&(s=" ... ",t=i-n+s.length),r-i>n&&(a=" ...",r=i+n-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}g(cs,"getLine");function ds(e,t){return Wt.repeat(" ",t-e.length)+e}g(ds,"padStart");function jf(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],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var n="",l,c,h=Math.min(e.line+t.linesAfter,o.length).toString().length,d=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)c=cs(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),d),n=Wt.repeat(" ",t.indent)+ds((e.line-l+1).toString(),h)+" | "+c.str+`
|
|
134
134
|
`+n;for(c=cs(e.buffer,i[a],o[a],e.position,d),n+=Wt.repeat(" ",t.indent)+ds((e.line+1).toString(),h)+" | "+c.str+`
|
|
135
135
|
`,n+=Wt.repeat("-",t.indent+h+3+c.pos)+`^
|
|
136
136
|
`,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)c=cs(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),d),n+=Wt.repeat(" ",t.indent)+ds((e.line+l+1).toString(),h)+" | "+c.str+`
|
|
137
|
-
`;return n.replace(/\n$/,"")}g(
|
|
138
|
-
\r`;function
|
|
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(Pn,"simpleEscapeSequence");function
|
|
140
|
-
`,t-1))}g(ua,"writeFoldedLines");function
|
|
137
|
+
`;return n.replace(/\n$/,"")}g(jf,"makeSnippet");var tv=jf,ev=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],rv=["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 Hf(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(ev.indexOf(r)===-1)throw new de('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),rv.indexOf(this.kind)===-1)throw new de('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}g(Hf,"Type$1");var te=Hf;function Rn(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}g(Rn,"compileList");function Yf(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(g(i,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}g(Yf,"compileMap");function Rs(e){return this.extend(e)}g(Rs,"Schema$1");Rs.prototype.extend=g(function(t){var r=[],i=[];if(t instanceof te)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 de("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof te))throw new de("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new de("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new de("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof te))throw new de("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(Rs.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(i),o.compiledImplicit=Rn(o,"implicit"),o.compiledExplicit=Rn(o,"explicit"),o.compiledTypeMap=Yf(o.compiledImplicit,o.compiledExplicit),o},"extend");var iv=Rs,ov=new te("tag:yaml.org,2002:str",{kind:"scalar",construct:g(function(e){return e!==null?e:""},"construct")}),sv=new te("tag:yaml.org,2002:seq",{kind:"sequence",construct:g(function(e){return e!==null?e:[]},"construct")}),av=new te("tag:yaml.org,2002:map",{kind:"mapping",construct:g(function(e){return e!==null?e:{}},"construct")}),nv=new iv({explicit:[ov,sv,av]});function Uf(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}g(Uf,"resolveYamlNull");function Xf(){return null}g(Xf,"constructYamlNull");function Gf(e){return e===null}g(Gf,"isNull");var lv=new te("tag:yaml.org,2002:null",{kind:"scalar",resolve:Uf,construct:Xf,predicate:Gf,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 Vf(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(Vf,"resolveYamlBoolean");function Kf(e){return e==="true"||e==="True"||e==="TRUE"}g(Kf,"constructYamlBoolean");function Zf(e){return Object.prototype.toString.call(e)==="[object Boolean]"}g(Zf,"isBoolean");var hv=new te("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Vf,construct:Kf,predicate:Zf,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 Qf(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}g(Qf,"isHexCode");function Jf(e){return 48<=e&&e<=55}g(Jf,"isOctCode");function tp(e){return 48<=e&&e<=57}g(tp,"isDecCode");function ep(e){if(e===null)return!1;var t=e.length,r=0,i=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;i=!0}return i&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Qf(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Jf(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!tp(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}g(ep,"resolveYamlInteger");function rp(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(rp,"constructYamlInteger");function ip(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Wt.isNegativeZero(e)}g(ip,"isInteger");var cv=new te("tag:yaml.org,2002:int",{kind:"scalar",resolve:ep,construct:rp,predicate:ip,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"]}}),dv=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function op(e){return!(e===null||!dv.test(e)||e[e.length-1]==="_")}g(op,"resolveYamlFloat");function sp(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(sp,"constructYamlFloat");var uv=/^[-+]?[0-9]+e/;function ap(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),uv.test(r)?r.replace("e",".e"):r}g(ap,"representYamlFloat");function np(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Wt.isNegativeZero(e))}g(np,"isFloat");var fv=new te("tag:yaml.org,2002:float",{kind:"scalar",resolve:op,construct:sp,predicate:np,represent:ap,defaultStyle:"lowercase"}),lp=nv.extend({implicit:[lv,hv,cv,fv]}),pv=lp,hp=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),cp=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 dp(e){return e===null?!1:hp.exec(e)!==null||cp.exec(e)!==null}g(dp,"resolveYamlTimestamp");function up(e){var t,r,i,o,s,a,n,l=0,c=null,h,d,u;if(t=hp.exec(e),t===null&&(t=cp.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+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)),u=new Date(Date.UTC(r,i,o,s,a,n,l)),c&&u.setTime(u.getTime()-c),u}g(up,"constructYamlTimestamp");function fp(e){return e.toISOString()}g(fp,"representYamlTimestamp");var gv=new te("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:dp,construct:up,instanceOf:Date,represent:fp});function pp(e){return e==="<<"||e===null}g(pp,"resolveYamlMerge");var mv=new te("tag:yaml.org,2002:merge",{kind:"scalar",resolve:pp}),Kl=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
138
|
+
\r`;function gp(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=Kl;for(r=0;r<o;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}g(gp,"resolveYamlBinary");function mp(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=Kl,a=0,n=[];for(t=0;t<o;t++)t%4===0&&t&&(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%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(mp,"constructYamlBinary");function yp(e){var t="",r=0,i,o,s=e.length,a=Kl;for(i=0;i<s;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 o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}g(yp,"representYamlBinary");function xp(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}g(xp,"isBinary");var yv=new te("tag:yaml.org,2002:binary",{kind:"scalar",resolve:gp,construct:mp,predicate:xp,represent:yp}),xv=Object.prototype.hasOwnProperty,Cv=Object.prototype.toString;function Cp(e){if(e===null)return!0;var t=[],r,i,o,s,a,n=e;for(r=0,i=n.length;r<i;r+=1){if(o=n[r],a=!1,Cv.call(o)!=="[object Object]")return!1;for(s in o)if(xv.call(o,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}g(Cp,"resolveYamlOmap");function bp(e){return e!==null?e:[]}g(bp,"constructYamlOmap");var bv=new te("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Cp,construct:bp}),kv=Object.prototype.toString;function kp(e){if(e===null)return!0;var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],kv.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}g(kp,"resolveYamlPairs");function wp(e){if(e===null)return[];var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],o=Object.keys(i),s[t]=[o[0],i[o[0]]];return s}g(wp,"constructYamlPairs");var wv=new te("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:kp,construct:wp}),Sv=Object.prototype.hasOwnProperty;function Sp(e){if(e===null)return!0;var t,r=e;for(t in r)if(Sv.call(r,t)&&r[t]!==null)return!1;return!0}g(Sp,"resolveYamlSet");function vp(e){return e!==null?e:{}}g(vp,"constructYamlSet");var vv=new te("tag:yaml.org,2002:set",{kind:"mapping",resolve:Sp,construct:vp}),Tp=pv.extend({implicit:[gv,mv],explicit:[yv,bv,wv,vv]}),fr=Object.prototype.hasOwnProperty,Is=1,_p=2,Bp=3,Ps=4,Ya=1,Tv=2,Mc=3,_v=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Bv=/[\x85\u2028\u2029]/,Lv=/[,\[\]\{\}]/,Lp=/^(?:!|!!|![a-z\-]+!)$/i,Ep=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function In(e){return Object.prototype.toString.call(e)}g(In,"_class");function Fe(e){return e===10||e===13}g(Fe,"is_EOL");function dr(e){return e===9||e===32}g(dr,"is_WHITE_SPACE");function ae(e){return e===9||e===32||e===10||e===13}g(ae,"is_WS_OR_EOL");function Ar(e){return e===44||e===91||e===93||e===123||e===125}g(Ar,"is_FLOW_INDICATOR");function Fp(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}g(Fp,"fromHexCode");function Ap(e){return e===120?2:e===117?4:e===85?8:0}g(Ap,"escapedHexLen");function Mp(e){return 48<=e&&e<=57?e-48:-1}g(Mp,"fromDecimalCode");function Pn(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(Pn,"simpleEscapeSequence");function $p(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}g($p,"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 Op=new Array(256),Rp=new Array(256);for(wr=0;wr<256;wr++)Op[wr]=Pn(wr)?1:0,Rp[wr]=Pn(wr);var wr;function Ip(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Tp,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(Ip,"State$1");function Ql(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=tv(r),new de(t,r)}g(Ql,"generateError");function at(e,t){throw Ql(e,t)}g(at,"throwError");function So(e,t){e.onWarning&&e.onWarning.call(null,Ql(e,t))}g(So,"throwWarning");var $c={YAML:g(function(t,r,i){var o,s,a;t.version!==null&&at(t,"duplication of %YAML directive"),i.length!==1&&at(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),o===null&&at(t,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),a=parseInt(o[2],10),s!==1&&at(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&So(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:g(function(t,r,i){var o,s;i.length!==2&&at(t,"TAG directive accepts exactly two arguments"),o=i[0],s=i[1],Lp.test(o)||at(t,"ill-formed tag handle (first argument) of the TAG directive"),fr.call(t.tagMap,o)&&at(t,'there is a previously declared suffix for "'+o+'" tag handle'),Ep.test(s)||at(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{at(t,"tag prefix is malformed: "+s)}t.tagMap[o]=s},"handleTagDirective")};function er(e,t,r,i){var o,s,a,n;if(t<r){if(n=e.input.slice(t,r),i)for(o=0,s=n.length;o<s;o+=1)a=n.charCodeAt(o),a===9||32<=a&&a<=1114111||at(e,"expected valid JSON character");else _v.test(n)&&at(e,"the stream contains non-printable characters");e.result+=n}}g(er,"captureSegment");function Dn(e,t,r,i){var o,s,a,n;for(Wt.isObject(r)||at(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,n=o.length;a<n;a+=1)s=o[a],fr.call(t,s)||(Zl(t,s,r[s]),i[s]=!0)}g(Dn,"mergeMappings");function Mr(e,t,r,i,o,s,a,n,l){var c,h;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),c=0,h=o.length;c<h;c+=1)Array.isArray(o[c])&&at(e,"nested arrays are not supported inside keys"),typeof o=="object"&&In(o[c])==="[object Object]"&&(o[c]="[object Object]");if(typeof o=="object"&&In(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,h=s.length;c<h;c+=1)Dn(e,t,s[c],r);else Dn(e,t,s,r);else!e.json&&!fr.call(r,o)&&fr.call(t,o)&&(e.line=a||e.line,e.lineStart=n||e.lineStart,e.position=l||e.position,at(e,"duplicated mapping key")),Zl(t,o,s),delete r[o];return t}g(Mr,"storeMappingPair");function da(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(da,"readLineBreak");function Pt(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;dr(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(Fe(o))for(da(e),o=e.input.charCodeAt(e.position),i++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&So(e,"deficient indentation"),i}g(Pt,"skipSeparationSpace");function Oo(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||ae(r)))}g(Oo,"testDocumentSeparator");function ua(e,t){t===1?e.result+=" ":t>1&&(e.result+=Wt.repeat(`
|
|
140
|
+
`,t-1))}g(ua,"writeFoldedLines");function Pp(e,t,r){var i,o,s,a,n,l,c,h,d=e.kind,u=e.result,f;if(f=e.input.charCodeAt(e.position),ae(f)||Ar(f)||f===35||f===38||f===42||f===33||f===124||f===62||f===39||f===34||f===37||f===64||f===96||(f===63||f===45)&&(o=e.input.charCodeAt(e.position+1),ae(o)||r&&Ar(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,n=!1;f!==0;){if(f===58){if(o=e.input.charCodeAt(e.position+1),ae(o)||r&&Ar(o))break}else if(f===35){if(i=e.input.charCodeAt(e.position-1),ae(i))break}else{if(e.position===e.lineStart&&Oo(e)||r&&Ar(f))break;if(Fe(f))if(l=e.line,c=e.lineStart,h=e.lineIndent,Pt(e,!1,-1),e.lineIndent>=t){n=!0,f=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=h;break}}n&&(er(e,s,a,!1),ua(e,e.line-l),s=a=e.position,n=!1),dr(f)||(a=e.position+1),f=e.input.charCodeAt(++e.position)}return er(e,s,a,!1),e.result?!0:(e.kind=d,e.result=u,!1)}g(Pp,"readPlainScalar");function Dp(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(er(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else Fe(r)?(er(e,i,o,!0),ua(e,Pt(e,!1,t)),i=o=e.position):e.position===e.lineStart&&Oo(e)?at(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);at(e,"unexpected end of the stream within a single quoted scalar")}g(Dp,"readSingleQuotedScalar");function Np(e,t){var r,i,o,s,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 er(e,r,e.position,!0),e.position++,!0;if(n===92){if(er(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),Fe(n))Pt(e,!1,t);else if(n<256&&Op[n])e.result+=Rp[n],e.position++;else if((a=Ap(n))>0){for(o=a,s=0;o>0;o--)n=e.input.charCodeAt(++e.position),(a=Fp(n))>=0?s=(s<<4)+a:at(e,"expected hexadecimal character");e.result+=$p(s),e.position++}else at(e,"unknown escape sequence");r=i=e.position}else Fe(n)?(er(e,r,i,!0),ua(e,Pt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Oo(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(Np,"readDoubleQuotedScalar");function qp(e,t){var r=!0,i,o,s,a=e.tag,n,l=e.anchor,c,h,d,u,f,p=Object.create(null),m,y,x,C;if(C=e.input.charCodeAt(e.position),C===91)h=93,f=!1,n=[];else if(C===123)h=125,f=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),C=e.input.charCodeAt(++e.position);C!==0;){if(Pt(e,!0,t),C=e.input.charCodeAt(e.position),C===h)return e.position++,e.tag=a,e.anchor=l,e.kind=f?"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=u=!1,C===63&&(c=e.input.charCodeAt(e.position+1),ae(c)&&(d=u=!0,e.position++,Pt(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Nr(e,t,Is,!1,!0),y=e.tag,m=e.result,Pt(e,!0,t),C=e.input.charCodeAt(e.position),(u||e.line===i)&&C===58&&(d=!0,C=e.input.charCodeAt(++e.position),Pt(e,!0,t),Nr(e,t,Is,!1,!0),x=e.result),f?Mr(e,n,p,y,m,x,i,o,s):d?n.push(Mr(e,null,p,y,m,x,i,o,s)):n.push(m),Pt(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(qp,"readFlowCollection");function zp(e,t){var r,i,o=Ya,s=!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)Ya===o?o=d===43?Mc:Tv:at(e,"repeat of a chomping mode identifier");else if((h=Mp(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(dr(d)){do d=e.input.charCodeAt(++e.position);while(dr(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Fe(d)&&d!==0)}for(;d!==0;){for(da(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){o===Mc?e.result+=Wt.repeat(`
|
|
141
141
|
`,s?1+l:l):o===Ya&&s&&(e.result+=`
|
|
142
142
|
`);break}for(i?dr(d)?(c=!0,e.result+=Wt.repeat(`
|
|
143
143
|
`,s?1+l:l)):c?(c=!1,e.result+=Wt.repeat(`
|
|
144
144
|
`,l+1)):l===0?s&&(e.result+=" "):e.result+=Wt.repeat(`
|
|
145
145
|
`,l):e.result+=Wt.repeat(`
|
|
146
|
-
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!Fe(d)&&d!==0;)d=e.input.charCodeAt(++e.position);er(e,r,e.position,!1)}return!0}g(
|
|
147
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
146
|
+
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!Fe(d)&&d!==0;)d=e.input.charCodeAt(++e.position);er(e,r,e.position,!1)}return!0}g(zp,"readBlockScalar");function Nn(e,t){var r,i=e.tag,o=e.anchor,s=[],a,n=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),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),!ae(a))));){if(n=!0,e.position++,Pt(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Nr(e,t,Bp,!1,!0),s.push(e.result),Pt(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=o,e.kind="sequence",e.result=s,!0):!1}g(Nn,"readBlockSequence");function jp(e,t,r){var i,o,s,a,n,l,c=e.tag,h=e.anchor,d={},u=Object.create(null),f=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),s=e.line,(C===63||C===58)&&ae(i))C===63?(y&&(Mr(e,d,u,f,p,null,a,n,l),f=p=m=null),x=!0,y=!0,o=!0):y?(y=!1,o=!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,!Nr(e,r,_p,!1,!0))break;if(e.line===s){for(C=e.input.charCodeAt(e.position);dr(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),ae(C)||at(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Mr(e,d,u,f,p,null,a,n,l),f=p=m=null),x=!0,y=!1,o=!1,f=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===s||e.lineIndent>t)&&(y&&(a=e.line,n=e.lineStart,l=e.position),Nr(e,t,Ps,!0,o)&&(y?p=e.result:m=e.result),y||(Mr(e,d,u,f,p,m,a,n,l),f=p=m=null),Pt(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&C!==0)at(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Mr(e,d,u,f,p,null,a,n,l),x&&(e.tag=c,e.anchor=h,e.kind="mapping",e.result=d),x}g(jp,"readBlockMapping");function Wp(e){var t,r=!1,i=!1,o,s,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,o="!!",a=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=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&&!ae(a);)a===33&&(i?at(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),Lp.test(o)||at(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Lv.test(s)&&at(e,"tag suffix cannot contain flow indicator characters")}s&&!Ep.test(s)&&at(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{at(e,"tag name is malformed: "+s)}return r?e.tag=s:fr.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:at(e,'undeclared tag handle "'+o+'"'),!0}g(Wp,"readTagProperty");function Hp(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&&!ae(r)&&!Ar(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(Hp,"readAnchorProperty");function Yp(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&&!ae(i)&&!Ar(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),fr.call(e.anchorMap,r)||at(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Pt(e,!0,-1),!0}g(Yp,"readAlias");function Nr(e,t,r,i,o){var s,a,n,l=1,c=!1,h=!1,d,u,f,p,m,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=n=Ps===r||Bp===r,i&&Pt(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Wp(e)||Hp(e);)Pt(e,!0,-1)?(c=!0,n=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):n=!1;if(n&&(n=c||o),(l===1||Ps===r)&&(Is===r||_p===r?m=t:m=t+1,y=e.position-e.lineStart,l===1?n&&(Nn(e,y)||jp(e,y,m))||qp(e,m)?h=!0:(a&&zp(e,m)||Dp(e,m)||Np(e,m)?h=!0:Yp(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&at(e,"alias node should not have any properties")):Pp(e,m,Is===r)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(h=n&&Nn(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,u=e.implicitTypes.length;d<u;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(fr.call(e.typeMap[e.kind||"fallback"],e.tag))p=e.typeMap[e.kind||"fallback"][e.tag];else for(p=null,f=e.typeMap.multi[e.kind||"fallback"],d=0,u=f.length;d<u;d+=1)if(e.tag.slice(0,f[d].tag.length)===f[d].tag){p=f[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(Nr,"composeNode");function Up(e){var t=e.position,r,i,o,s=!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&&(Pt(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!ae(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&at(e,"directive name must not be less than one character in length");a!==0;){for(;dr(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&&!ae(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&da(e),fr.call($c,i)?$c[i](e,i,o):So(e,'unknown document directive "'+i+'"')}if(Pt(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,Pt(e,!0,-1)):s&&at(e,"directives end mark is expected"),Nr(e,e.lineIndent-1,Ps,!1,!0),Pt(e,!0,-1),e.checkLineBreaks&&Bv.test(e.input.slice(t,e.position))&&So(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Oo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Pt(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(Up,"readDocument");function Jl(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 Ip(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;)Up(r);return r.documents}g(Jl,"loadDocuments");function Ev(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=Jl(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}g(Ev,"loadAll$1");function Xp(e,t){var r=Jl(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new de("expected a single document in the stream, but found more")}}g(Xp,"load$1");var Fv=Xp,Av={load:Fv},Gp=Object.prototype.toString,Vp=Object.prototype.hasOwnProperty,th=65279,Mv=9,vo=10,$v=13,Ov=32,Rv=33,Iv=34,qn=35,Pv=37,Dv=38,Nv=39,qv=42,Kp=44,zv=45,Ds=58,jv=61,Wv=62,Hv=63,Yv=64,Zp=91,Qp=93,Uv=96,Jp=123,Xv=124,tg=125,re={};re[0]="\\0";re[7]="\\a";re[8]="\\b";re[9]="\\t";re[10]="\\n";re[11]="\\v";re[12]="\\f";re[13]="\\r";re[27]="\\e";re[34]='\\"';re[92]="\\\\";re[133]="\\N";re[160]="\\_";re[8232]="\\L";re[8233]="\\P";var Gv=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Vv=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function eg(e,t){var r,i,o,s,a,n,l;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],n=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&Vp.call(l.styleAliases,n)&&(n=l.styleAliases[n]),r[a]=n;return r}g(eg,"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 de("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Wt.repeat("0",i-t.length)+t}g(rg,"encodeHex");var Kv=1,To=2;function ig(e){this.schema=e.schema||Tp,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=eg(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==='"'?To:Kv,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 zn(e,t){for(var r=Wt.repeat(" ",t),i=0,o=-1,s="",a,n=e.length;i<n;)o=e.indexOf(`
|
|
148
148
|
`,i),o===-1?(a=e.slice(i),i=n):(a=e.slice(i,o+1),i=o+1),a.length&&a!==`
|
|
149
149
|
`&&(s+=r),s+=a;return s}g(zn,"indentString");function Ns(e,t){return`
|
|
150
|
-
`+Wt.repeat(" ",e.indent*t)}g(Ns,"generateNextLine");function
|
|
150
|
+
`+Wt.repeat(" ",e.indent*t)}g(Ns,"generateNextLine");function og(e,t){var r,i,o;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}g(og,"testImplicitResolving");function _o(e){return e===Ov||e===Mv}g(_o,"isWhitespace");function $i(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==th||65536<=e&&e<=1114111}g($i,"isPrintable");function jn(e){return $i(e)&&e!==th&&e!==$v&&e!==vo}g(jn,"isNsCharOrWhitespace");function Wn(e,t,r){var i=jn(e),o=i&&!_o(e);return(r?i:i&&e!==Kp&&e!==Zp&&e!==Qp&&e!==Jp&&e!==tg)&&e!==qn&&!(t===Ds&&!o)||jn(t)&&!_o(t)&&e===qn||t===Ds&&o}g(Wn,"isPlainSafe");function sg(e){return $i(e)&&e!==th&&!_o(e)&&e!==zv&&e!==Hv&&e!==Ds&&e!==Kp&&e!==Zp&&e!==Qp&&e!==Jp&&e!==tg&&e!==qn&&e!==Dv&&e!==qv&&e!==Rv&&e!==Xv&&e!==jv&&e!==Wv&&e!==Nv&&e!==Iv&&e!==Pv&&e!==Yv&&e!==Uv}g(sg,"isPlainSafeFirst");function ag(e){return!_o(e)&&e!==Ds}g(ag,"isPlainSafeLast");function si(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(si,"codePointAt");function eh(e){var t=/^\n* /;return t.test(e)}g(eh,"needIndentIndicator");var ng=1,Hn=2,lg=3,hg=4,ti=5;function cg(e,t,r,i,o,s,a,n){var l,c=0,h=null,d=!1,u=!1,f=i!==-1,p=-1,m=sg(si(e,0))&&ag(si(e,e.length-1));if(t||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=si(e,l),!$i(c))return ti;m=m&&Wn(c,h,n),h=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=si(e,l),c===vo)d=!0,f&&(u=u||l-p-1>i&&e[p+1]!==" ",p=l);else if(!$i(c))return ti;m=m&&Wn(c,h,n),h=c}u=u||f&&l-p-1>i&&e[p+1]!==" "}return!d&&!u?m&&!a&&!o(e)?ng:s===To?ti:Hn:r>9&&eh(e)?ti:a?s===To?ti:Hn:u?hg:lg}g(cg,"chooseScalarStyle");function dg(e,t,r,i,o){e.dump=(function(){if(t.length===0)return e.quotingType===To?'""':"''";if(!e.noCompatMode&&(Gv.indexOf(t)!==-1||Vv.test(t)))return e.quotingType===To?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return og(e,c)}switch(g(l,"testAmbiguity"),cg(t,n,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case ng:return t;case Hn:return"'"+t.replace(/'/g,"''")+"'";case lg:return"|"+Yn(t,e.indent)+Un(zn(t,s));case hg:return">"+Yn(t,e.indent)+Un(zn(ug(t,a),s));case ti:return'"'+fg(t)+'"';default:throw new de("impossible error: invalid scalar style")}})()}g(dg,"writeScalar");function Yn(e,t){var r=eh(e)?String(t):"",i=e[e.length-1]===`
|
|
151
151
|
`,o=i&&(e[e.length-2]===`
|
|
152
152
|
`||e===`
|
|
153
153
|
`),s=o?"+":i?"":"-";return r+s+`
|
|
154
154
|
`}g(Yn,"blockHeader");function Un(e){return e[e.length-1]===`
|
|
155
|
-
`?e.slice(0,-1):e}g(Un,"dropEndingNewline");function
|
|
155
|
+
`?e.slice(0,-1):e}g(Un,"dropEndingNewline");function ug(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
|
|
156
156
|
`);return c=c!==-1?c:e.length,r.lastIndex=c,Xn(e.slice(0,c),t)})(),o=e[0]===`
|
|
157
157
|
`||e[0]===" ",s,a;a=r.exec(e);){var n=a[1],l=a[2];s=l[0]===" ",i+=n+(!o&&!s&&l!==""?`
|
|
158
|
-
`:"")+Xn(l,t),o=s}return i}g(
|
|
158
|
+
`:"")+Xn(l,t),o=s}return i}g(ug,"foldString");function Xn(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,n=0,l="";i=r.exec(e);)n=i.index,n-o>t&&(s=a>o?a:n,l+=`
|
|
159
159
|
`+e.slice(o,s),o=s+1),a=n;return l+=`
|
|
160
160
|
`,e.length-o>t&&a>o?l+=e.slice(o,a)+`
|
|
161
|
-
`+e.slice(a+1):l+=e.slice(o),l.slice(1)}g(Xn,"foldLine");function
|
|
162
|
-
`:""}g(Kv,"dump$1");function Zv(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(Zv,"renamed");var yg=np,xg=Fv.load;var Qv=g(e=>{const{handDrawnSeed:t}=kt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Ni=g(e=>{const t=Jv([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),Jv=g(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),rh=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"),ot=g(e=>{const{stylesArray:t}=Ni(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];rh(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),et=g((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=kt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=Ni(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:tT(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),tT=g(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),Go={},jt={},Oc;function eT(){return Oc||(Oc=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 Rc;function rT(){if(Rc)return Go;Rc=1,Object.defineProperty(Go,"__esModule",{value:!0}),Go.sanitizeUrl=s;var e=eT();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 o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,l=o(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(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 u=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var f=h.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return f;if(u==="http:"||u==="https:"){if(!i(f))return e.BLANK_URL;var p=new URL(f);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return f}return Go}var Cg=rT();function Ua(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 iT(){}function bg(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function fa(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const kg="[object RegExp]",ih="[object String]",oh="[object Number]",sh="[object Boolean]",ah="[object Arguments]",wg="[object Symbol]",Sg="[object Date]",vg="[object Map]",Tg="[object Set]",_g="[object Array]",Bg="[object ArrayBuffer]",Lg="[object Object]",Eg="[object DataView]",Fg="[object Uint8Array]",Ag="[object Uint8ClampedArray]",Mg="[object Uint16Array]",$g="[object Uint32Array]",Og="[object Int8Array]",Rg="[object Int16Array]",Ig="[object Int32Array]",Pg="[object Float32Array]",Dg="[object Float64Array]",Ic=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function nh(e){return typeof Ic.Buffer<"u"&&Ic.Buffer.isBuffer(e)}function oT(e){return Number.isSafeInteger(e)&&e>=0}function Ng(e){return e!=null&&typeof e!="function"&&oT(e.length)}function sT(e){return e==="__proto__"}function pa(e){return e==null||typeof e!="object"&&typeof e!="function"}function lh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function aT(e,t){return ai(e,void 0,e,new Map,t)}function ai(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(pa(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]=ai(e[n],n,r,i,o);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,ai(l,n,r,i,o));return a}if(e instanceof Set){const a=new Set;i.set(e,a);for(const n of e)a.add(ai(n,void 0,r,i,o));return a}if(nh(e))return e.subarray();if(lh(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=ai(e[n],n,r,i,o);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,o),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,o),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,o),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,o),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(e instanceof Number){const a=new Number(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(e instanceof String){const a=new String(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(typeof e=="object"&&nT(e)){const a=Object.create(Object.getPrototypeOf(e));return i.set(e,a),_e(a,e,r,i,o),a}return e}function _e(e,t,r=e,i,o){const s=[...Object.keys(t),...bg(t)];for(let a=0;a<s.length;a++){const n=s[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=ai(t[n],n,r,i,o))}}function nT(e){switch(fa(e)){case ah:case _g:case Bg:case Eg:case sh:case Sg:case Pg:case Dg:case Og:case Rg:case Ig:case vg:case oh:case Lg:case kg:case Tg:case ih:case wg:case Fg:case Ag:case Mg:case $g:return!0;default:return!1}}function lT(e,t){return aT(e,(r,i,o,s)=>{if(typeof e=="object"){if(fa(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return s.set(e,a),_e(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case oh:case ih:case sh:{const a=new e.constructor(e?.valueOf());return _e(a,e),a}case ah:{const a={};return _e(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Pc(e){return lT(e)}function Kn(e){return e!==null&&typeof e=="object"&&fa(e)==="[object Arguments]"}function Zn(e){return typeof e=="object"&&e!==null}function hT(e){return Zn(e)&&Ng(e)}function Ro(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);const a=e.apply(this,i);return r.cache=s.set(o,a)||s,a};return r.cache=new(Ro.Cache||Map),r}Ro.Cache=Map;function mo(e){return lh(e)}function cT(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function dT(e){if(pa(e))return e;if(Array.isArray(e)||lh(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 uT(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let s=0;s<r.length;s++){const a=r[s];o=us(o,a,i,new Map)}return o}function us(e,t,r,i){if(pa(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return dT(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let s=0;s<t.length;s++)t[s]=t[s]??void 0}const o=[...Object.keys(t),...bg(t)];for(let s=0;s<o.length;s++){const a=o[s];if(sT(a))continue;let n=t[a],l=e[a];if(Kn(n)&&(n={...n}),Kn(l)&&(l={...l}),nh(n)&&(n=Pc(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let u=0;u<d.length;u++){const f=d[u];h[f]=l[f]}l=h}else if(hT(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)&&(Ua(l)||Ua(n)||mo(l)||mo(n))?e[a]=us(l,n,r,i):l==null&&Ua(n)?e[a]=us({},n,r,i):l==null&&mo(n)?e[a]=Pc(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function fT(e,...t){return uT(e,...t,iT)}function Dc(e){if(e==null)return!0;if(Ng(e))return typeof e.splice!="function"&&typeof e!="string"&&!nh(e)&&!mo(e)&&!Kn(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 cT(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var qg="",pT={curveBasis:Ms,curveBasisClosed:NS,curveBasisOpen:qS,curveBumpX:gf,curveBumpY:mf,curveBundle:zS,curveCardinalClosed:jS,curveCardinalOpen:WS,curveCardinal:bf,curveCatmullRomClosed:HS,curveCatmullRomOpen:YS,curveCatmullRom:wf,curveLinear:go,curveLinearClosed:US,curveMonotoneX:Lf,curveMonotoneY:Ef,curveNatural:Af,curveStep:Mf,curveStepAfter:Of,curveStepBefore:$f},gT=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,mT=g(function(e,t){const r=zg(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);bs(a),i=qt(i,[...a])}else i=r.args;if(!i)return;let o=Ll(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),zg=g(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${gT.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 o=[];for(;(i=po.exec(e))!==null;)if(i.index===po.lastIndex&&po.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}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"),yT=g(function(e){return e.replace(po,"")},"removeDirectives"),xT=g(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function hh(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return pT[r]??t}g(hh,"interpolateToCurve");function jg(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?Cg.sanitizeUrl(r):r}g(jg,"formatUrl");var CT=g((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a<i;a++)if(s=s[r[a]],!s){V.error(`Function name: ${e} not found in window`);return}s[o](...t)},"runFunc");function ch(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}g(ch,"distance");function Wg(e){let t,r=0;e.forEach(o=>{r+=ch(o,t),t=o});const i=r/2;return dh(e,i)}g(Wg,"traverseEdge");function Hg(e){return e.length===1?e[0]:Wg(e)}g(Hg,"calcLabelPosition");var Nc=g((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),dh=g((e,t)=>{let r,i=t;for(const o of e){if(r){const s=ch(o,r);if(s===0)return r;if(s<i)i-=s;else{const a=i/s;if(a<=0)return r;if(a>=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:Nc((1-a)*r.x+a*o.x,5),y:Nc((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),bT=g((e,t,r)=>{V.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=dh(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function Yg(e,t,r){const i=structuredClone(r);V.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=dh(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2),l}g(Yg,"calcTerminalLabelPosition");function uh(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(uh,"getStylesFromArray");var qc=0,Ug=g(()=>(qc++,"id-"+Math.random().toString(36).substr(2,12)+"-"+qc),"generateId");function Xg(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}g(Xg,"makeRandomHex");var Gg=g(e=>Xg(e.length),"random"),kT=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"),wT=g(function(e,t){const r=t.text.replace(Pi.lineBreakRegex," "),[,i]=Io(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),Vg=Ro((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Pi.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const l=je(`${a} `,r),c=je(s,r);if(l>t){const{hyphenatedStrings:u,remainingWord:f}=ST(a,t,"-",r);o.push(s,...u),s=f}else c+l>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),ST=Ro((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,l)=>{const c=`${a}${n}`;if(je(c,i)>=t){const d=l+1,u=o.length===d,f=`${c}${r}`;s.push(u?c:f),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function fh(e,t){return ga(e,t).height}g(fh,"calculateTextHeight");function je(e,t){return ga(e,t).width}g(je,"calculateTextWidth");var ga=Ro((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=Io(r),a=["sans-serif",i],n=e.split(Pi.lineBreakRegex),l=[],c=yt("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const u of a){let f=0;const p={width:0,height:0,lineHeight:0};for(const m of n){const y=kT();y.text=m||qg;const x=wT(h,y).style("font-size",s).style("font-weight",o).style("font-family",u),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)),f=Math.round(C.height),p.height+=f,p.lineHeight=Math.round(Math.max(p.lineHeight,f))}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}`),Si,vT=(Si=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},g(Si,"InitIDGenerator"),Si),Vo,TT=g(function(e){return Vo=Vo||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Vo.innerHTML=e,unescape(Vo.textContent)},"entityDecode");function ph(e){return"str"in e}g(ph,"isDetailedError");var _T=g((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Io=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 ma(e,t){return fT({},e,t)}g(ma,"cleanAndMerge");var xe={assignWithDepth:qt,wrapLabel:Vg,calculateTextHeight:fh,calculateTextWidth:je,calculateTextDimensions:ga,cleanAndMerge:ma,detectInit:mT,detectDirective:zg,isSubstringInArray:xT,interpolateToCurve:hh,calcLabelPosition:Hg,calcCardinalityPosition:bT,calcTerminalLabelPosition:Yg,formatUrl:jg,getStylesFromArray:uh,generateId:Ug,random:Gg,runFunc:CT,entityDecode:TT,insertTitle:_T,isLabelCoordinateInPath:Kg,parseFontSize:Io,InitIDGenerator:vT},BT=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"),LT=g((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Xt(e){return e??null}g(Xt,"handleUndefinedAttr");function Kg(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}g(Kg,"isLabelCoordinateInPath");var ya=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 gh(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(o=>new Promise(s=>{function a(){if(o.style.display="flex",o.style.flexDirection="column",i){const n=kt().fontSize?kt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=Bl.fontSize]=Io(n),h=c*l+"px";o.style.minWidth=h,o.style.maxWidth=h}else o.style.width="100%";s(o)}g(a,"setupImage"),setTimeout(()=>{o.complete&&a()}),o.addEventListener("error",a),o.addEventListener("load",a)})))}g(gh,"configureLabelImages");const ET=Object.freeze({left:0,top:0,width:16,height:16}),zs=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Zg=Object.freeze({...ET,...zs}),FT=Object.freeze({...Zg,body:"",hidden:!1}),AT=Object.freeze({width:null,height:null}),MT=Object.freeze({...AT,...zs}),$T=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return Xa(c)?c:null}const s=o[0],a=s.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return Xa(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return Xa(n,r)?n:null}return null},Xa=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function OT(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 zc(e,t){const r=OT(e,t);for(const i in FT)i in zs?i in e&&!(i in r)&&(r[i]=zs[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function RT(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const n=i[a]&&i[a].parent,l=n&&s(n);l&&(o[a]=[n].concat(l))}return o[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),o}function jc(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function a(n){s=zc(i[n]||o[n],s)}return a(t),r.forEach(a),zc(e,s)}function IT(e,t){if(e.icons[t])return jc(e,t,[]);const r=RT(e,[t])[t];return r?jc(e,t,r):null}const PT=/(-?[0-9.]*[0-9]+[0-9.]*)/g,DT=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Wc(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(PT);if(i===null||!i.length)return e;const o=[];let s=i.shift(),a=DT.test(s);for(;;){if(a){const n=parseFloat(s);isNaN(n)?o.push(s):o.push(Math.ceil(n*t*r)/r)}else o.push(s);if(s=i.shift(),s===void 0)return o.join("");a=!a}}function NT(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),s=e.indexOf("</"+t);if(o===-1||s===-1)break;const a=e.indexOf(">",s);if(a===-1)break;r+=e.slice(o+1,s).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function qT(e,t){return e?"<defs>"+e+"</defs>"+t:t}function zT(e,t,r){const i=NT(e);return qT(i.defs,t+i.content+r)}const jT=e=>e==="unset"||e==="undefined"||e==="none";function WT(e,t){const r={...Zg,...e},i={...MT,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=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("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):C&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let S;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:S=o.height/2+o.top,y.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:S=o.width/2+o.left,y.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}k%2===1&&(o.left!==o.top&&(S=o.left,o.left=o.top,o.top=S),o.width!==o.height&&(S=o.width,o.width=o.height,o.height=S)),y.length&&(s=zT(s,'<g transform="'+y.join(" ")+'">',"</g>"))});const a=i.width,n=i.height,l=o.width,c=o.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=Wc(d,l/c)):(h=a==="auto"?l:a,d=n===null?Wc(h,c/l):n==="auto"?c:n);const u={},f=(m,y)=>{jT(y)||(u[m]=y.toString())};f("width",h),f("height",d);const p=[o.left,o.top,l,c];return u.viewBox=p.join(" "),{attributes:u,viewBox:p,body:s}}const HT=/\sid="(\S+)"/g,Hc=new Map;function YT(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Hc.get(e)||0;return Hc.set(e,t+1),t?`${e}${t}`:e}function UT(e){const t=[];let r;for(;r=HT.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const s=YT(o),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function XT(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 Qg={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},Qn=new Map,Jg=new Map,tm=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)Jg.set(t.name,t.loader);else if("icons"in t)Qn.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"),em=g(async(e,t)=>{const r=$T(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 o=Qn.get(i);if(!o){const a=Jg.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},Qn.set(i,o)}catch(n){throw V.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=IT(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),GT=g(async e=>{try{return await em(e),!0}catch{return!1}},"isIconAvailable"),qi=g(async(e,t,r)=>{let i;try{i=await em(e,t?.fallbackPrefix)}catch(a){V.error(a),i=Qg}const o=WT(i,t),s=XT(UT(o.body),{...o.attributes,...r});return Ce(s,Ot())},"getIconSVG");function mh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Wr=mh();function rm(e){Wr=e}var yo={exec:()=>null};function vt(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(ne.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var VT=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ne={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")},KT=/^(?:[ \t]*(?:\n|$))+/,ZT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,QT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Po=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,JT=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yh=/(?:[*+-]|\d{1,9}[.)])/,im=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,om=vt(im).replace(/bull/g,yh).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(),t_=vt(im).replace(/bull/g,yh).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(),xh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,e_=/^[^\n]+/,Ch=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,r_=vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ch).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),i_=vt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yh).getRegex(),xa="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",bh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,o_=vt("^ {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",bh).replace("tag",xa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sm=vt(xh).replace("hr",Po).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",xa).getRegex(),s_=vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sm).getRegex(),kh={blockquote:s_,code:ZT,def:r_,fences:QT,heading:JT,hr:Po,html:o_,lheading:om,list:i_,newline:KT,paragraph:sm,table:yo,text:e_},Yc=vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Po).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",xa).getRegex(),a_={...kh,lheading:t_,table:Yc,paragraph:vt(xh).replace("hr",Po).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yc).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",xa).getRegex()},n_={...kh,html:vt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bh).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:yo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vt(xh).replace("hr",Po).replace("heading",` *#{1,6} *[^
|
|
164
|
-
]`).replace("lheading",
|
|
161
|
+
`+e.slice(a+1):l+=e.slice(o),l.slice(1)}g(Xn,"foldLine");function fg(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=si(e,o),i=re[r],!i&&$i(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||rg(r);return t}g(fg,"escapeString");function pg(e,t,r){var i="",o=e.tag,s,a,n;for(s=0,a=r.length;s<a;s+=1)n=r[s],e.replacer&&(n=e.replacer.call(r,String(s),n)),(ze(e,t,n,!1,!1)||typeof n>"u"&&ze(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}g(pg,"writeFlowSequence");function Gn(e,t,r,i){var o="",s=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)),(ze(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&ze(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=Ns(e,t)),e.dump&&vo===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}g(Gn,"writeBlockSequence");function gg(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,n,l,c,h;for(a=0,n=s.length;a<n;a+=1)h="",i!==""&&(h+=", "),e.condenseFlow&&(h+='"'),l=s[a],c=r[l],e.replacer&&(c=e.replacer.call(r,l,c)),ze(e,t,l,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ze(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=o,e.dump="{"+i+"}"}g(gg,"writeFlowMapping");function mg(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),n,l,c,h,d,u;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new de("sortKeys must be a boolean or a function");for(n=0,l=a.length;n<l;n+=1)u="",(!i||o!=="")&&(u+=Ns(e,t)),c=a[n],h=r[c],e.replacer&&(h=e.replacer.call(r,c,h)),ze(e,t+1,c,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&vo===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,d&&(u+=Ns(e,t)),ze(e,t+1,h,!0,d)&&(e.dump&&vo===e.dump.charCodeAt(0)?u+=":":u+=": ",u+=e.dump,o+=u));e.tag=s,e.dump=o||"{}"}g(mg,"writeBlockMapping");function Vn(e,t,r){var i,o,s,a,n,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(n=o[s],(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,Gp.call(n.represent)==="[object Function]")i=n.represent(t,l);else if(Vp.call(n.represent,l))i=n.represent[l](t,l);else throw new de("!<"+n.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}g(Vn,"detectType");function ze(e,t,r,i,o,s,a){e.tag=null,e.dump=r,Vn(e,r,!1)||Vn(e,r,!0);var n=Gp.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=n==="[object Object]"||n==="[object Array]",d,u;if(h&&(d=e.duplicates.indexOf(r),u=d!==-1),(e.tag!==null&&e.tag!=="?"||u||e.indent!==2&&t>0)&&(o=!1),u&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(h&&u&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),n==="[object Object]")i&&Object.keys(e.dump).length!==0?(mg(e,t,e.dump,o),u&&(e.dump="&ref_"+d+e.dump)):(gg(e,t,e.dump),u&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Gn(e,t-1,e.dump,o):Gn(e,t,e.dump,o),u&&(e.dump="&ref_"+d+e.dump)):(pg(e,t,e.dump),u&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&dg(e,e.dump,t,s,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new de("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(ze,"writeNode");function yg(e,t){var r=[],i=[],o,s;for(qs(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}g(yg,"getDuplicateReferences");function qs(e,t,r){var i,o,s;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)qs(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)qs(e[i[o]],t,r)}g(qs,"inspectNode");function Zv(e,t){t=t||{};var r=new ig(t);r.noRefs||yg(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),ze(r,0,i,!0,!0)?r.dump+`
|
|
162
|
+
`:""}g(Zv,"dump$1");function Qv(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(Qv,"renamed");var xg=lp,Cg=Av.load;var Jv=g(e=>{const{handDrawnSeed:t}=kt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Ni=g(e=>{const t=tT([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),tT=g(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),rh=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"),ot=g(e=>{const{stylesArray:t}=Ni(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];rh(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),et=g((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=kt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=Ni(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:eT(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),eT=g(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),Go={},jt={},Oc;function rT(){return Oc||(Oc=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 Rc;function iT(){if(Rc)return Go;Rc=1,Object.defineProperty(Go,"__esModule",{value:!0}),Go.sanitizeUrl=s;var e=rT();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 o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,l=o(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(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 u=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var f=h.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return f;if(u==="http:"||u==="https:"){if(!i(f))return e.BLANK_URL;var p=new URL(f);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return f}return Go}var bg=iT();function Ua(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 oT(){}function kg(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function fa(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const wg="[object RegExp]",ih="[object String]",oh="[object Number]",sh="[object Boolean]",ah="[object Arguments]",Sg="[object Symbol]",vg="[object Date]",Tg="[object Map]",_g="[object Set]",Bg="[object Array]",Lg="[object ArrayBuffer]",Eg="[object Object]",Fg="[object DataView]",Ag="[object Uint8Array]",Mg="[object Uint8ClampedArray]",$g="[object Uint16Array]",Og="[object Uint32Array]",Rg="[object Int8Array]",Ig="[object Int16Array]",Pg="[object Int32Array]",Dg="[object Float32Array]",Ng="[object Float64Array]",Ic=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function nh(e){return typeof Ic.Buffer<"u"&&Ic.Buffer.isBuffer(e)}function sT(e){return Number.isSafeInteger(e)&&e>=0}function qg(e){return e!=null&&typeof e!="function"&&sT(e.length)}function aT(e){return e==="__proto__"}function pa(e){return e==null||typeof e!="object"&&typeof e!="function"}function lh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function nT(e,t){return ai(e,void 0,e,new Map,t)}function ai(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(pa(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]=ai(e[n],n,r,i,o);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,ai(l,n,r,i,o));return a}if(e instanceof Set){const a=new Set;i.set(e,a);for(const n of e)a.add(ai(n,void 0,r,i,o));return a}if(nh(e))return e.subarray();if(lh(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=ai(e[n],n,r,i,o);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,o),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,o),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,o),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,o),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(e instanceof Number){const a=new Number(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(e instanceof String){const a=new String(e.valueOf());return i.set(e,a),_e(a,e,r,i,o),a}if(typeof e=="object"&&lT(e)){const a=Object.create(Object.getPrototypeOf(e));return i.set(e,a),_e(a,e,r,i,o),a}return e}function _e(e,t,r=e,i,o){const s=[...Object.keys(t),...kg(t)];for(let a=0;a<s.length;a++){const n=s[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=ai(t[n],n,r,i,o))}}function lT(e){switch(fa(e)){case ah:case Bg:case Lg:case Fg:case sh:case vg:case Dg:case Ng:case Rg:case Ig:case Pg:case Tg:case oh:case Eg:case wg:case _g:case ih:case Sg:case Ag:case Mg:case $g:case Og:return!0;default:return!1}}function hT(e,t){return nT(e,(r,i,o,s)=>{if(typeof e=="object"){if(fa(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return s.set(e,a),_e(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case oh:case ih:case sh:{const a=new e.constructor(e?.valueOf());return _e(a,e),a}case ah:{const a={};return _e(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Pc(e){return hT(e)}function Kn(e){return e!==null&&typeof e=="object"&&fa(e)==="[object Arguments]"}function Zn(e){return typeof e=="object"&&e!==null}function cT(e){return Zn(e)&&qg(e)}function Ro(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);const a=e.apply(this,i);return r.cache=s.set(o,a)||s,a};return r.cache=new(Ro.Cache||Map),r}Ro.Cache=Map;function mo(e){return lh(e)}function dT(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function uT(e){if(pa(e))return e;if(Array.isArray(e)||lh(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 fT(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let s=0;s<r.length;s++){const a=r[s];o=us(o,a,i,new Map)}return o}function us(e,t,r,i){if(pa(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return uT(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let s=0;s<t.length;s++)t[s]=t[s]??void 0}const o=[...Object.keys(t),...kg(t)];for(let s=0;s<o.length;s++){const a=o[s];if(aT(a))continue;let n=t[a],l=e[a];if(Kn(n)&&(n={...n}),Kn(l)&&(l={...l}),nh(n)&&(n=Pc(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let u=0;u<d.length;u++){const f=d[u];h[f]=l[f]}l=h}else if(cT(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)&&(Ua(l)||Ua(n)||mo(l)||mo(n))?e[a]=us(l,n,r,i):l==null&&Ua(n)?e[a]=us({},n,r,i):l==null&&mo(n)?e[a]=Pc(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function pT(e,...t){return fT(e,...t,oT)}function Dc(e){if(e==null)return!0;if(qg(e))return typeof e.splice!="function"&&typeof e!="string"&&!nh(e)&&!mo(e)&&!Kn(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 dT(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var zg="",gT={curveBasis:Ms,curveBasisClosed:qS,curveBasisOpen:zS,curveBumpX:mf,curveBumpY:yf,curveBundle:jS,curveCardinalClosed:WS,curveCardinalOpen:HS,curveCardinal:kf,curveCatmullRomClosed:YS,curveCatmullRomOpen:US,curveCatmullRom:Sf,curveLinear:go,curveLinearClosed:XS,curveMonotoneX:Ef,curveMonotoneY:Ff,curveNatural:Mf,curveStep:$f,curveStepAfter:Rf,curveStepBefore:Of},mT=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,yT=g(function(e,t){const r=jg(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);bs(a),i=qt(i,[...a])}else i=r.args;if(!i)return;let o=Ll(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),jg=g(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${mT.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 o=[];for(;(i=po.exec(e))!==null;)if(i.index===po.lastIndex&&po.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}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"),xT=g(function(e){return e.replace(po,"")},"removeDirectives"),CT=g(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function hh(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return gT[r]??t}g(hh,"interpolateToCurve");function Wg(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?bg.sanitizeUrl(r):r}g(Wg,"formatUrl");var bT=g((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a<i;a++)if(s=s[r[a]],!s){V.error(`Function name: ${e} not found in window`);return}s[o](...t)},"runFunc");function ch(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}g(ch,"distance");function Hg(e){let t,r=0;e.forEach(o=>{r+=ch(o,t),t=o});const i=r/2;return dh(e,i)}g(Hg,"traverseEdge");function Yg(e){return e.length===1?e[0]:Hg(e)}g(Yg,"calcLabelPosition");var Nc=g((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),dh=g((e,t)=>{let r,i=t;for(const o of e){if(r){const s=ch(o,r);if(s===0)return r;if(s<i)i-=s;else{const a=i/s;if(a<=0)return r;if(a>=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:Nc((1-a)*r.x+a*o.x,5),y:Nc((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),kT=g((e,t,r)=>{V.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=dh(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function Ug(e,t,r){const i=structuredClone(r);V.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=dh(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2),l}g(Ug,"calcTerminalLabelPosition");function uh(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(uh,"getStylesFromArray");var qc=0,Xg=g(()=>(qc++,"id-"+Math.random().toString(36).substr(2,12)+"-"+qc),"generateId");function Gg(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}g(Gg,"makeRandomHex");var Vg=g(e=>Gg(e.length),"random"),wT=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"),ST=g(function(e,t){const r=t.text.replace(Pi.lineBreakRegex," "),[,i]=Io(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),Kg=Ro((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Pi.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const l=je(`${a} `,r),c=je(s,r);if(l>t){const{hyphenatedStrings:u,remainingWord:f}=vT(a,t,"-",r);o.push(s,...u),s=f}else c+l>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),vT=Ro((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,l)=>{const c=`${a}${n}`;if(je(c,i)>=t){const d=l+1,u=o.length===d,f=`${c}${r}`;s.push(u?c:f),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function fh(e,t){return ga(e,t).height}g(fh,"calculateTextHeight");function je(e,t){return ga(e,t).width}g(je,"calculateTextWidth");var ga=Ro((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=Io(r),a=["sans-serif",i],n=e.split(Pi.lineBreakRegex),l=[],c=yt("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const u of a){let f=0;const p={width:0,height:0,lineHeight:0};for(const m of n){const y=wT();y.text=m||zg;const x=ST(h,y).style("font-size",s).style("font-weight",o).style("font-family",u),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)),f=Math.round(C.height),p.height+=f,p.lineHeight=Math.round(Math.max(p.lineHeight,f))}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}`),Si,TT=(Si=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},g(Si,"InitIDGenerator"),Si),Vo,_T=g(function(e){return Vo=Vo||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Vo.innerHTML=e,unescape(Vo.textContent)},"entityDecode");function ph(e){return"str"in e}g(ph,"isDetailedError");var BT=g((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Io=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 ma(e,t){return pT({},e,t)}g(ma,"cleanAndMerge");var xe={assignWithDepth:qt,wrapLabel:Kg,calculateTextHeight:fh,calculateTextWidth:je,calculateTextDimensions:ga,cleanAndMerge:ma,detectInit:yT,detectDirective:jg,isSubstringInArray:CT,interpolateToCurve:hh,calcLabelPosition:Yg,calcCardinalityPosition:kT,calcTerminalLabelPosition:Ug,formatUrl:Wg,getStylesFromArray:uh,generateId:Xg,random:Vg,runFunc:bT,entityDecode:_T,insertTitle:BT,isLabelCoordinateInPath:Zg,parseFontSize:Io,InitIDGenerator:TT},LT=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"),ET=g((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Xt(e){return e??null}g(Xt,"handleUndefinedAttr");function Zg(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}g(Zg,"isLabelCoordinateInPath");var ya=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 gh(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(o=>new Promise(s=>{function a(){if(o.style.display="flex",o.style.flexDirection="column",i){const n=kt().fontSize?kt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=Bl.fontSize]=Io(n),h=c*l+"px";o.style.minWidth=h,o.style.maxWidth=h}else o.style.width="100%";s(o)}g(a,"setupImage"),setTimeout(()=>{o.complete&&a()}),o.addEventListener("error",a),o.addEventListener("load",a)})))}g(gh,"configureLabelImages");const FT=Object.freeze({left:0,top:0,width:16,height:16}),zs=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Qg=Object.freeze({...FT,...zs}),AT=Object.freeze({...Qg,body:"",hidden:!1}),MT=Object.freeze({width:null,height:null}),$T=Object.freeze({...MT,...zs}),OT=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return Xa(c)?c:null}const s=o[0],a=s.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return Xa(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return Xa(n,r)?n:null}return null},Xa=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function RT(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 zc(e,t){const r=RT(e,t);for(const i in AT)i in zs?i in e&&!(i in r)&&(r[i]=zs[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function IT(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const n=i[a]&&i[a].parent,l=n&&s(n);l&&(o[a]=[n].concat(l))}return o[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),o}function jc(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function a(n){s=zc(i[n]||o[n],s)}return a(t),r.forEach(a),zc(e,s)}function PT(e,t){if(e.icons[t])return jc(e,t,[]);const r=IT(e,[t])[t];return r?jc(e,t,r):null}const DT=/(-?[0-9.]*[0-9]+[0-9.]*)/g,NT=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Wc(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 o=[];let s=i.shift(),a=NT.test(s);for(;;){if(a){const n=parseFloat(s);isNaN(n)?o.push(s):o.push(Math.ceil(n*t*r)/r)}else o.push(s);if(s=i.shift(),s===void 0)return o.join("");a=!a}}function qT(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),s=e.indexOf("</"+t);if(o===-1||s===-1)break;const a=e.indexOf(">",s);if(a===-1)break;r+=e.slice(o+1,s).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function zT(e,t){return e?"<defs>"+e+"</defs>"+t:t}function jT(e,t,r){const i=qT(e);return zT(i.defs,t+i.content+r)}const WT=e=>e==="unset"||e==="undefined"||e==="none";function HT(e,t){const r={...Qg,...e},i={...$T,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=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("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):C&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let S;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:S=o.height/2+o.top,y.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:S=o.width/2+o.left,y.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}k%2===1&&(o.left!==o.top&&(S=o.left,o.left=o.top,o.top=S),o.width!==o.height&&(S=o.width,o.width=o.height,o.height=S)),y.length&&(s=jT(s,'<g transform="'+y.join(" ")+'">',"</g>"))});const a=i.width,n=i.height,l=o.width,c=o.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=Wc(d,l/c)):(h=a==="auto"?l:a,d=n===null?Wc(h,c/l):n==="auto"?c:n);const u={},f=(m,y)=>{WT(y)||(u[m]=y.toString())};f("width",h),f("height",d);const p=[o.left,o.top,l,c];return u.viewBox=p.join(" "),{attributes:u,viewBox:p,body:s}}const YT=/\sid="(\S+)"/g,Hc=new Map;function UT(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Hc.get(e)||0;return Hc.set(e,t+1),t?`${e}${t}`:e}function XT(e){const t=[];let r;for(;r=YT.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const s=UT(o),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function GT(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 Jg={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},Qn=new Map,tm=new Map,em=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)tm.set(t.name,t.loader);else if("icons"in t)Qn.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"),rm=g(async(e,t)=>{const r=OT(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 o=Qn.get(i);if(!o){const a=tm.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},Qn.set(i,o)}catch(n){throw V.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=PT(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),VT=g(async e=>{try{return await rm(e),!0}catch{return!1}},"isIconAvailable"),qi=g(async(e,t,r)=>{let i;try{i=await rm(e,t?.fallbackPrefix)}catch(a){V.error(a),i=Jg}const o=HT(i,t),s=GT(XT(o.body),{...o.attributes,...r});return Ce(s,Ot())},"getIconSVG");function mh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Wr=mh();function im(e){Wr=e}var yo={exec:()=>null};function vt(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(ne.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var KT=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ne={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")},ZT=/^(?:[ \t]*(?:\n|$))+/,QT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,JT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Po=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,t_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yh=/(?:[*+-]|\d{1,9}[.)])/,om=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,sm=vt(om).replace(/bull/g,yh).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(),e_=vt(om).replace(/bull/g,yh).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(),xh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,r_=/^[^\n]+/,Ch=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,i_=vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ch).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),o_=vt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yh).getRegex(),xa="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",bh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,s_=vt("^ {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",bh).replace("tag",xa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),am=vt(xh).replace("hr",Po).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",xa).getRegex(),a_=vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",am).getRegex(),kh={blockquote:a_,code:QT,def:i_,fences:JT,heading:t_,hr:Po,html:s_,lheading:sm,list:o_,newline:ZT,paragraph:am,table:yo,text:r_},Yc=vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Po).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",xa).getRegex(),n_={...kh,lheading:e_,table:Yc,paragraph:vt(xh).replace("hr",Po).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yc).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",xa).getRegex()},l_={...kh,html:vt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bh).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:yo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vt(xh).replace("hr",Po).replace("heading",` *#{1,6} *[^
|
|
164
|
+
]`).replace("lheading",sm).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},h_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,c_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,nm=/^( {2,}|\\)\n(?!\s*$)/,d_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ca=/[\p{P}\p{S}]/u,wh=/[\s\p{P}\p{S}]/u,lm=/[^\s\p{P}\p{S}]/u,u_=vt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wh).getRegex(),hm=/(?!~)[\p{P}\p{S}]/u,f_=/(?!~)[\s\p{P}\p{S}]/u,p_=/(?:[^\s\p{P}\p{S}]|~)/u,g_=vt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",KT?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),cm=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,m_=vt(cm,"u").replace(/punct/g,Ca).getRegex(),y_=vt(cm,"u").replace(/punct/g,hm).getRegex(),dm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",x_=vt(dm,"gu").replace(/notPunctSpace/g,lm).replace(/punctSpace/g,wh).replace(/punct/g,Ca).getRegex(),C_=vt(dm,"gu").replace(/notPunctSpace/g,p_).replace(/punctSpace/g,f_).replace(/punct/g,hm).getRegex(),b_=vt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,lm).replace(/punctSpace/g,wh).replace(/punct/g,Ca).getRegex(),k_=vt(/\\(punct)/,"gu").replace(/punct/g,Ca).getRegex(),w_=vt(/^<(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(),S_=vt(bh).replace("(?:-->|$)","-->").getRegex(),v_=vt("^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",S_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),js=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,T_=vt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",js).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),um=vt(/^!?\[(label)\]\[(ref)\]/).replace("label",js).replace("ref",Ch).getRegex(),fm=vt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ch).getRegex(),__=vt("reflink|nolink(?!\\()","g").replace("reflink",um).replace("nolink",fm).getRegex(),Uc=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Sh={_backpedal:yo,anyPunctuation:k_,autolink:w_,blockSkip:g_,br:nm,code:c_,del:yo,emStrongLDelim:m_,emStrongRDelimAst:x_,emStrongRDelimUnd:b_,escape:h_,link:T_,nolink:fm,punctuation:u_,reflink:um,reflinkSearch:__,tag:v_,text:d_,url:yo},B_={...Sh,link:vt(/^!?\[(label)\]\((.*?)\)/).replace("label",js).getRegex(),reflink:vt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",js).getRegex()},Jn={...Sh,emStrongRDelimAst:C_,emStrongLDelim:y_,url:vt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Uc).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:vt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Uc).getRegex()},L_={...Jn,br:vt(nm).replace("{2,}","*").getRegex(),text:vt(Jn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ko={normal:kh,gfm:n_,pedantic:l_},Ki={normal:Sh,gfm:Jn,breaks:L_,pedantic:B_},E_={"&":"&","<":"<",">":">",'"':""","'":"'"},Xc=e=>E_[e];function Ie(e,t){if(t){if(ne.escapeTest.test(e))return e.replace(ne.escapeReplace,Xc)}else if(ne.escapeTestNoEncode.test(e))return e.replace(ne.escapeReplaceNoEncode,Xc);return e}function Gc(e){try{e=encodeURI(e).replace(ne.percentDecode,"%")}catch{return null}return e}function Vc(e,t){let r=e.replace(ne.findPipe,(s,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(ne.splitPipe),o=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(;o<i.length;o++)i[o]=i[o].trim().replace(ne.slashPipe,"|");return i}function Zi(e,t,r){let i=e.length;if(i===0)return"";let o=0;for(;o<i&&e.charAt(i-o-1)===t;)o++;return e.slice(0,i-o)}function F_(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 Kc(e,t,r,i,o){let s=t.href,a=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function A_(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
|
|
165
165
|
`).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[n]=a;return n.length>=o.length?s.slice(o.length):s}).join(`
|
|
166
166
|
`)}var Ws=class{options;rules;lexer;constructor(t){this.options=t||Wr}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:Zi(i,`
|
|
167
|
-
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=
|
|
167
|
+
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=A_(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:o}}}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 o=Zi(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.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:Zi(r[0],`
|
|
168
168
|
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Zi(r[0],`
|
|
169
169
|
`).split(`
|
|
170
170
|
`),o="",s="",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(`
|
|
@@ -185,7 +185,7 @@ ${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
185
185
|
`+f}!p&&!f.trim()&&(p=!0),h+=E+`
|
|
186
186
|
`,t=t.substring(E.length+1),u=B.slice(m)}}s.loose||(n?s.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,""))),s.items.push({type:"list_item",raw:h,task:!!y,checked:x,loose:!1,text:d,tokens:[]}),s.raw+=h}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){let h=s.items[c].tokens.filter(u=>u.type==="space"),d=h.length>0&&h.some(u=>this.rules.other.anyLine.test(u.raw));s.loose=d}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}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," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=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:o,title:s}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=Vc(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
187
187
|
`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let n of o)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 s)a.rows.push(Vc(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=Zi(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=
|
|
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=Zi(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=F_(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 o=r[2],s="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],s=a[3])}else s=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),Kc(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.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 o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=r[o.toLowerCase()];if(!s){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return Kc(i,s,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[2])||!i||this.rules.inline.punctuation.exec(i))){let s=[...o[0]].length-1,a,n,l=s,c=0,h=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+s);(o=h.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(n=[...a].length,o[3]||o[4]){l+=n;continue}else if((o[5]||o[6])&&s%3&&!((s+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let d=[...o[0]][0].length,u=t.slice(0,s+o.index+d+n);if(Math.min(s,n)%2){let p=u.slice(1,-1);return{type:"em",raw:u,text:p,tokens:this.lexer.inlineTokens(p)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&s&&(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,o;return r[2]==="@"?(i=r[1],o="mailto:"+i):(i=r[1],o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=r[0],o="mailto:"+i;else{let s;do s=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(s!==r[0]);i=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,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 tl{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Wr,this.options.tokenizer=this.options.tokenizer||new Ws,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:ne,block:Ko.normal,inline:Ki.normal};this.options.pedantic?(r.block=Ko.pedantic,r.inline=Ki.pedantic):this.options.gfm&&(r.block=Ko.gfm,this.options.breaks?r.inline=Ki.breaks:r.inline=Ki.gfm),this.tokenizer.rules=r}static get rules(){return{block:Ko,inline:Ki}}static lex(t,r){return new tl(r).lex(t)}static lexInline(t,r){return new tl(r).inlineTokens(t)}lex(t){t=t.replace(ne.carriageReturn,`
|
|
189
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(ne.tabCharGlobal," ").replace(ne.spaceLine,""));t;){let o;if(this.options.extensions?.block?.some(a=>(o=a.call({lexer:this},t,r))?(t=t.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let a=r.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
|
|
190
190
|
`:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
191
191
|
`)?"":`
|
|
@@ -218,27 +218,27 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
218
218
|
${t}</tr>
|
|
219
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
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>${Ie(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 o=this.parser.parseInline(i),s=Gc(t);if(s===null)return o;t=s;let a='<a href="'+t+'"';return r&&(a+=' title="'+Ie(r)+'"'),a+=">"+o+"</a>",a}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let s=Gc(t);if(s===null)return Ie(i);t=s;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${Ie(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ie(t.text)}},vh=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 el{options;renderer;textRenderer;constructor(t){this.options=t||Wr,this.options.renderer=this.options.renderer||new Hs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vh}static parse(t,r){return new el(r).parse(t)}static parseInline(t,r){return new el(r).parseInline(t)}parse(t,r=!0){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=s,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=s;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(;o+1<t.length&&t[o+1].type==="text";)n=t[++o],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 o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=this.options.extensions.renderers[s.type].call({parser:this},s);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=n||"";continue}}let a=s;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}},no=class{options;block;constructor(t){this.options=t||Wr}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}},
|
|
222
|
-
Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Ie(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},qr=new
|
|
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 o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=this.options.extensions.renderers[s.type].call({parser:this},s);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=n||"";continue}}let a=s;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}},no=class{options;block;constructor(t){this.options=t||Wr}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}},M_=class{defaults=mh();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Le;Renderer=Hs;TextRenderer=vh;Lexer=Be;Tokenizer=Ws;Hooks=no;constructor(...t){this.use(...t)}walkTokens(t,r){let i=[];for(let o of t)switch(i=i.concat(r.call(this,o)),o.type){case"table":{let s=o;for(let a of s.header)i=i.concat(this.walkTokens(a.tokens,r));for(let a of s.rows)for(let n of a)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let s=o;i=i.concat(this.walkTokens(s.items,r));break}default:{let s=o;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let n=s[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...n){let l=s.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),o.extensions=r),i.renderer){let s=this.defaults.renderer||new Hs(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d||""}}o.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new Ws(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new no;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=s[n];no.passThroughHooks.has(a)?s[n]=h=>{if(this.defaults.async&&no.passThroughHooksRespectAsync.has(a))return(async()=>{let u=await l.call(s,h);return c.call(s,u)})();let d=l.call(s,h);return c.call(s,d)}:s[n]=(...h)=>{if(this.defaults.async)return(async()=>{let u=await l.apply(s,h);return u===!1&&(u=await c.apply(s,h)),u})();let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),s&&(l=l.concat(s.call(this,n))),l}}this.defaults={...this.defaults,...o}}),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 o={...i},s={...this.defaults,...o},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.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(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():t?Be.lex:Be.lexInline)(n,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():t?Le.parse:Le.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let n=(s.hooks?s.hooks.provideLexer():t?Be.lex:Be.lexInline)(r,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():t?Le.parse:Le.parseInline)(n,s);return s.hooks&&(l=s.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 o="<p>An error occurred:</p><pre>"+Ie(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},qr=new M_;function Bt(e,t){return qr.parse(e,t)}Bt.options=Bt.setOptions=function(e){return qr.setOptions(e),Bt.defaults=qr.defaults,im(Bt.defaults),Bt};Bt.getDefaults=mh;Bt.defaults=Wr;Bt.use=function(...e){return qr.use(...e),Bt.defaults=qr.defaults,im(Bt.defaults),Bt};Bt.walkTokens=function(e,t){return qr.walkTokens(e,t)};Bt.parseInline=qr.parseInline;Bt.Parser=Le;Bt.parser=Le.parse;Bt.Renderer=Hs;Bt.TextRenderer=vh;Bt.Lexer=Be;Bt.lexer=Be.lex;Bt.Tokenizer=Ws;Bt.Hooks=no;Bt.parse=Bt;Bt.options;Bt.setOptions;Bt.use;Bt.walkTokens;Bt.parseInline;Le.parse;Be.lex;function pm(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 o=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var d,u;return(u=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&u!==void 0?u:0})):n},[]);if(o.length){var s=new RegExp(`
|
|
223
223
|
[ ]{`+Math.min.apply(Math,o)+"}","g");i=i.map(function(n){return n.replace(s,`
|
|
224
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
225
|
`)&&(d=String(n).split(`
|
|
226
226
|
`).map(function(u,f){return f===0?u:""+h+u}).join(`
|
|
227
|
-
`)),a+=d+i[l+1]}),a}function
|
|
227
|
+
`)),a+=d+i[l+1]}),a}function gm(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
|
|
228
228
|
`).replace(/\n{2,}/g,`
|
|
229
|
-
`);return
|
|
230
|
-
`).forEach((h,d)=>{d!==0&&(s++,o.push([])),h.split(" ").forEach(u=>{u=u.replace(/'/g,"'"),u&&o[s].push({content:u,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].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"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}g(
|
|
231
|
-
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Ys(e,t)}g(
|
|
232
|
-
`),s):Ce(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),rl(h,t.labelStyle),h.attr("class",`${c} ${i}`),rl(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"),o&&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(wm,"addHtmlSpan");function ba(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}g(ba,"createTspan");function Sm(e,t,r){const i=e.append("text"),o=ba(i,1,t);ka(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}g(Sm,"computeWidthOfText");function vm(e,t,r){const i=e.append("text"),o=ba(i,1,t);ka(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}g(vm,"computeDimensionOfText");function Tm(e,t,r,i=!1,o=!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");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=g(f=>Sm(a,1.1,f)<=e,"checkWidth"),u=d(h)?[h]:km(h,d);for(const f of u){const p=ba(l,c,1.1,o);ka(p,f),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(Tm,"createFormattedText");function il(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(il,"decodeHTMLEntities");function ka(e,t){e.text(""),t.forEach((r,i)=>{const o=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?o.text(il(r.content)):o.text(" "+il(r.content))})}g(ka,"updateTextContentAndStyles");async function _m(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await GT(n)?await qi(n,void 0,{class:"label-icon"}):`<i class='${Ce(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}g(_m,"replaceIconSubstring");var Oe=g(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(V.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?xm(t,h):ym(t),u=await _m(pr(d),h),f=t.replace(/\\\\/g,"\\"),p={isNode:n,label:Li(t)?f:u,labelStyle:r.replace("fill:","color:")};return await wm(e,p,l,o,c,h)}else{const d=pr(t.replace(/<br\s*\/?>/g,"<br/>")),u=a?mm(d.replace("<br>","<br/>"),h):gm(d),f=Tm(l,e,u,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:");yt(f).attr("style",p)}else{const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");yt(f).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:");yt(f).select("text").attr("style",m)}return i?yt(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):yt(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText");function Ga(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*a+o}}}function M_(e,t){return e[0]===t[0]&&e[1]===t[1]}function $_(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)Ga(c,n,o);const l=(function(c,h,d){const u=[];for(const C of c){const k=[...C];M_(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&u.push(k)}const f=[];h=Math.max(h,.1);const p=[];for(const C of u)for(let k=0;k<C.length-1;k++){const S=C[k],v=C[k+1];if(S[1]!==v[1]){const _=Math.min(S[1],v[1]);p.push({ymin:_,ymax:Math.max(S[1],v[1]),x:_===S[1]?S[0]:v[0],islope:(v[0]-S[0])/(v[1]-S[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 f;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 S=m[C].edge,v=m[k].edge;f.push([[Math.round(S.x),y],[Math.round(v.x),y]])}y+=d,m.forEach((C=>{C.edge.x=C.edge.x+d*C.edge.islope})),x++}return f})(a,s,i);if(o){for(const c of a)Ga(c,n,-o);(function(c,h,d){const u=[];c.forEach((f=>u.push(...f))),Ga(u,h,d)})(l,n,-o)}return l}function Do(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),$_(e,o,i,s||1)}class _h{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Do(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function wa(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 O_ extends _h{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Do(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)wa([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 R_ extends _h{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class I_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Do(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const l=wa(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,u=(n[0][0]+n[1][0])/2-o/4,f=Math.min(n[0][1],n[1][1]);for(let p=0;p<h;p++){const m=f+d+p*o,y=u-a+2*Math.random()*a,x=m-a+2*Math.random()*a,C=this.helper.ellipse(y,x,s,s,r);i.push(...C.ops)}}return{type:"fillSketch",ops:i}}}class P_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Do(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,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return t.forEach((a=>{const n=wa(a),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const u=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let f=0;f<l;f++){const p=f*(i+o),m=p+i,y=[h[0]+p*Math.cos(u)+c*Math.cos(u),h[1]+p*Math.sin(u)+c*Math.sin(u)],x=[h[0]+m*Math.cos(u)+c*Math.cos(u),h[1]+m*Math.sin(u)+c*Math.sin(u)];s.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r))}})),s}}class D_{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,s=Do(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(s,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((s=>{const a=wa(s),n=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const u=2*d*r,f=2*(d+1)*r,p=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],y=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],x=[m[0]+p*Math.cos(h+Math.PI/4),m[1]+p*Math.sin(h+Math.PI/4)];o.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))}})),o}}const he={};class N_{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const q_=0,Va=1,Qc=2,Zo={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 Ka(e,t){return e.type===t}function Bh(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:q_,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:Va,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:Qc,text:""},n})(e);let i="BOD",o=0,s=r[o];for(;!Ka(s,Qc);){let a=0;const n=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return Bh("M0,0"+e);o++,a=Zo[s.text],i=s.text}else Ka(s,Va)?a=Zo[i]:(o++,a=Zo[s.text],i=s.text);if(!(o+a<r.length))throw new Error("Path data ended short");for(let l=o;l<o+a;l++){const c=r[l];if(!Ka(c,Va))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Zo[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),o+=a,s=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function Bm(e){let t=0,r=0,i=0,o=0;const s=[];for(const{key:a,data:n}of e)switch(a){case"M":s.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],s.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":s.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],s.push({key:"L",data:[t,r]});break;case"C":s.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));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.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));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.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));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function Lm(e){const t=[];let r="",i=0,o=0,s=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,o]=h,[s,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,u=0;r==="C"||r==="S"?(d=i+(i-n),u=o+(o-l)):(d=i,u=o),t.push({key:"C",data:[d,u,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,u]=h;let f=0,p=0;r==="Q"||r==="T"?(f=i+(i-n),p=o+(o-l)):(f=i,p=o);const m=i+2*(f-i)/3,y=o+2*(p-o)/3,x=d+2*(f-d)/3,C=u+2*(p-u)/3;t.push({key:"C",data:[m,y,x,C,d,u]}),n=f,l=p,i=d,o=u;break}case"Q":{const[d,u,f,p]=h,m=i+2*(d-i)/3,y=o+2*(u-o)/3,x=f+2*(d-f)/3,C=p+2*(u-p)/3;t.push({key:"C",data:[m,y,x,C,f,p]}),n=d,l=u,i=f,o=p;break}case"A":{const d=Math.abs(h[0]),u=Math.abs(h[1]),f=h[2],p=h[3],m=h[4],y=h[5],x=h[6];d===0||u===0?(t.push({key:"C",data:[i,o,y,x,y,x]}),i=y,o=x):(i!==y||o!==x)&&(Em(i,o,y,x,d,u,f,p,m).forEach((function(C){t.push({key:"C",data:C})})),i=y,o=x);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function Qi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Em(e,t,r,i,o,s,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let u=[],f=0,p=0,m=0,y=0;if(c)[f,p,m,y]=c;else{[e,t]=Qi(e,t,-h),[r,i]=Qi(r,i,-h);const R=(e-r)/2,N=(t-i)/2;let F=R*R/(o*o)+N*N/(s*s);F>1&&(F=Math.sqrt(F),o*=F,s*=F);const $=o*o,q=s*s,P=$*q-$*N*N-q*R*R,I=$*N*N+q*R*R,j=(n===l?-1:1)*Math.sqrt(Math.abs(P/I));m=j*o*N/s+(e+r)/2,y=j*-s*R/o+(t+i)/2,f=Math.asin(parseFloat(((t-y)/s).toFixed(9))),p=Math.asin(parseFloat(((i-y)/s).toFixed(9))),e<m&&(f=Math.PI-f),r<m&&(p=Math.PI-p),f<0&&(f=2*Math.PI+f),p<0&&(p=2*Math.PI+p),l&&f>p&&(f-=2*Math.PI),!l&&p>f&&(p-=2*Math.PI)}let x=p-f;if(Math.abs(x)>120*Math.PI/180){const R=p,N=r,F=i;p=l&&p>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,u=Em(r=m+o*Math.cos(p),i=y+s*Math.sin(p),N,F,o,s,a,0,l,[p,R,m,y])}x=p-f;const C=Math.cos(f),k=Math.sin(f),S=Math.cos(p),v=Math.sin(p),_=Math.tan(x/4),E=4/3*o*_,B=4/3*s*_,O=[e,t],A=[e+E*k,t-B*C],D=[r+E*v,i-B*S],W=[r,i];if(A[0]=2*O[0]-A[0],A[1]=2*O[1]-A[1],c)return[A,D,W].concat(u);{u=[A,D,W].concat(u);const R=[];for(let N=0;N<u.length;N+=3){const F=Qi(u[N][0],u[N][1],h),$=Qi(u[N+1][0],u[N+1][1],h),q=Qi(u[N+2][0],u[N+2][1],h);R.push([F[0],F[1],$[0],$[1],q[0],q[1]])}return R}}const z_={randOffset:function(e,t){return ct(e,t)},randOffsetWithRange:function(e,t,r){return Us(e,t,r)},ellipse:function(e,t,r,i,o){const s=Am(r,i,o);return ol(e,t,o,s).opset},doubleLineOps:function(e,t,r,i,o){return gr(e,t,r,i,o,!0)}};function Fm(e,t,r,i,o){return{type:"path",ops:gr(e,t,r,i,o)}}function fs(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let s=0;s<i-1;s++)o.push(...gr(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&o.push(...gr(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?Fm(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function j_(e,t,r,i,o){return(function(s,a){return fs(s,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function Jc(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=Qo(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:Qo(r[0],1.5*(1+.22*t.roughness),rd(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const n=Qo(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Qo(a,1.5*(1+.22*t.roughness),rd(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function Am(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),s=2*Math.PI/o;let a=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return a+=ct(a*l,r),n+=ct(n*l,r),{increment:s,rx:a,ry:n}}function ol(e,t,r,i){const[o,s]=id(i.increment,e,t,i.rx,i.ry,1,i.increment*Us(.1,Us(.4,1,r),r),r);let a=Xs(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=id(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=Xs(n,null,r);a=a.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function td(e,t,r,i,o,s,a,n,l){const c=e,h=t;let d=Math.abs(r/2),u=Math.abs(i/2);d+=ct(.01*d,l),u+=ct(.01*u,l);let f=o,p=s;for(;f<0;)f+=2*Math.PI,p+=2*Math.PI;p-f>2*Math.PI&&(f=0,p=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(p-f)/2),x=od(y,c,h,d,u,f,p,1,l);if(!l.disableMultiStroke){const C=od(y,c,h,d,u,f,p,1.5,l);x.push(...C)}return a&&(n?x.push(...gr(c,h,c+d*Math.cos(f),h+u*Math.sin(f),l),...gr(c,h,c+d*Math.cos(p),h+u*Math.sin(p),l)):x.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(f),h+u*Math.sin(f)]})),{type:"path",ops:x}}function ed(e,t){const r=Lm(Bm(Bh(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...gr(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,d,u,f]=n;i.push(...W_(l,c,h,d,u,f,s,t)),s=[u,f];break}case"Z":i.push(...gr(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function Za(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+ct(o,t),i[0][1]+ct(o,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[i[a][0]+ct(o,t),i[a][1]+ct(o,t)]})}}return{type:"fillPath",ops:r}}function Kr(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!he[o])switch(o){case"zigzag":he[o]||(he[o]=new O_(i));break;case"cross-hatch":he[o]||(he[o]=new R_(i));break;case"dots":he[o]||(he[o]=new I_(i));break;case"dashed":he[o]||(he[o]=new P_(i));break;case"zigzag-line":he[o]||(he[o]=new D_(i));break;default:o="hachure",he[o]||(he[o]=new _h(i))}return he[o]})(t,z_).fillPolygons(e,t)}function rd(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Mm(e){return e.randomizer||(e.randomizer=new N_(e.seed||0)),e.randomizer.next()}function Us(e,t,r,i=1){return r.roughness*i*(Mm(r)*(t-e)+e)}function ct(e,t,r=1){return Us(-e,e,t,r)}function gr(e,t,r,i,o,s=!1){const a=s?o.disableMultiStrokeFill:o.disableMultiStroke,n=sl(e,t,r,i,o,!0,!1);if(a)return n;const l=sl(e,t,r,i,o,!0,!0);return n.concat(l)}function sl(e,t,r,i,o,s,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=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,u=.2+.2*Mm(o);let f=o.bowing*o.maxRandomnessOffset*(i-t)/200,p=o.bowing*o.maxRandomnessOffset*(e-r)/200;f=ct(f,o,c),p=ct(p,o,c);const m=[],y=()=>ct(d,o,c),x=()=>ct(h,o,c),C=o.preserveVertices;return a?m.push({op:"move",data:[e+(C?0:y()),t+(C?0:y())]}):m.push({op:"move",data:[e+(C?0:ct(h,o,c)),t+(C?0:ct(h,o,c))]}),a?m.push({op:"bcurveTo",data:[f+e+(r-e)*u+y(),p+t+(i-t)*u+y(),f+e+2*(r-e)*u+y(),p+t+2*(i-t)*u+y(),r+(C?0:y()),i+(C?0:y())]}):m.push({op:"bcurveTo",data:[f+e+(r-e)*u+x(),p+t+(i-t)*u+x(),f+e+2*(r-e)*u+x(),p+t+2*(i-t)*u+x(),r+(C?0:x()),i+(C?0:x())]}),m}function Qo(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+ct(t,r),e[0][1]+ct(t,r)]),i.push([e[0][0]+ct(t,r),e[0][1]+ct(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+ct(t,r),e[o][1]+ct(t,r)]),o===e.length-1&&i.push([e[o][0]+ct(t,r),e[o][1]+ct(t,r)]);return Xs(i,null,r)}function Xs(e,t,r){const i=e.length,o=[];if(i>3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];s[0]=[l[0],l[1]],s[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],s[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],s[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...sl(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function id(e,t,r,i,o,s,a,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+o*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const h=ct(.5,n)-Math.PI/2;c.push([ct(s,n)+t+.9*i*Math.cos(h-e),ct(s,n)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let u=h;u<d;u+=e){const f=[ct(s,n)+t+i*Math.cos(u),ct(s,n)+r+o*Math.sin(u)];l.push(f),c.push(f)}c.push([ct(s,n)+t+i*Math.cos(h+2*Math.PI+.5*a),ct(s,n)+r+o*Math.sin(h+2*Math.PI+.5*a)]),c.push([ct(s,n)+t+.98*i*Math.cos(h+a),ct(s,n)+r+.98*o*Math.sin(h+a)]),c.push([ct(s,n)+t+.9*i*Math.cos(h+.5*a),ct(s,n)+r+.9*o*Math.sin(h+.5*a)])}return[c,l]}function od(e,t,r,i,o,s,a,n,l){const c=s+ct(.1,l),h=[];h.push([ct(n,l)+t+.9*i*Math.cos(c-e),ct(n,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([ct(n,l)+t+i*Math.cos(d),ct(n,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),Xs(h,null,l)}function W_(e,t,r,i,o,s,a,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let f=0;f<d;f++)f===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(u?0:ct(c[0],n)),a[1]+(u?0:ct(c[0],n))]}),h=u?[o,s]:[o+ct(c[f],n),s+ct(c[f],n)],l.push({op:"bcurveTo",data:[e+ct(c[f],n),t+ct(c[f],n),r+ct(c[f],n),i+ct(c[f],n),h[0],h[1]]});return l}function Ji(e){return[...e]}function sd(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(Ji(e[0]),Ji(e[1]),Ji(e[2]),Ji(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const s=[],a=1-t;i.push(Ji(o[0]));for(let n=1;n+2<o.length;n++){const l=o[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*o[n+1][0]-a*o[n-1][0])/6,l[1]+(a*o[n+1][1]-a*o[n-1][1])/6],s[2]=[o[n+1][0]+(a*o[n][0]-a*o[n+2][0])/6,o[n+1][1]+(a*o[n][1]-a*o[n+2][1])/6],s[3]=[o[n+1][0],o[n+1][1]],i.push(s[1],s[2],s[3])}}return i}function ps(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function H_(e,t,r){const i=ps(t,r);if(i===0)return ps(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),ps(e,Br(t,r,o))}function Br(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function al(e,t,r,i){const o=i||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],u=n[l+3];let f=3*h[0]-2*c[0]-u[0];f*=f;let p=3*h[1]-2*c[1]-u[1];p*=p;let m=3*d[0]-2*u[0]-c[0];m*=m;let y=3*d[1]-2*u[1]-c[1];return y*=y,f<m&&(f=m),p<y&&(p=y),f+p})(e,t)<r){const n=e[t+0];o.length?(s=o[o.length-1],a=n,Math.sqrt(ps(s,a))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],u=Br(l,c,.5),f=Br(c,h,.5),p=Br(h,d,.5),m=Br(u,f,.5),y=Br(f,p,.5),x=Br(m,y,.5);al([l,u,m,x],0,r,o),al([x,y,p,d],0,r,o)}var s,a;return o}function Y_(e,t){return Gs(e,0,e.length,t)}function Gs(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=H_(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Gs(e,t,c+1,i,s),Gs(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function Qa(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s<o;s++)al(e,3*s,t,i);return r&&r>0?Gs(i,0,i.length,r):i}const ue="none";class Vs{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,o,s){const a=this._o(s);return this._d("line",[Fm(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=j_(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(Za([c],a)):n.push(Kr([c],a))}return a.stroke!==ue&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],l=Am(i,o,a),c=ol(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=ol(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(Kr([c.estimatedPoints],a));return a.stroke!==ue&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[fs(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],d=td(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const f=td(t,r,i,o,s,a,!0,!1,u);f.type="fillPath",h.push(f)}else h.push((function(u,f,p,m,y,x,C){const k=u,S=f;let v=Math.abs(p/2),_=Math.abs(m/2);v+=ct(.01*v,C),_+=ct(.01*_,C);let E=y,B=x;for(;E<0;)E+=2*Math.PI,B+=2*Math.PI;B-E>2*Math.PI&&(E=0,B=2*Math.PI);const O=(B-E)/C.curveStepCount,A=[];for(let D=E;D<=B;D+=O)A.push([k+v*Math.cos(D),S+_*Math.sin(D)]);return A.push([k+v*Math.cos(B),S+_*Math.sin(B)]),A.push([k,S]),Kr([A],C)})(t,r,i,o,s,a,c));return c.stroke!==ue&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=Jc(t,i);if(i.fill&&i.fill!==ue)if(i.fillStyle==="solid"){const a=Jc(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.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(...Qa(sd([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...Qa(sd(c),10,(1+i.roughness)/2))}a.length&&o.push(Kr([a],i))}return i.stroke!==ue&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=fs(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(Za([t],i)):o.push(Kr([t],i))),i.stroke!==ue&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==ue,a=i.stroke!==ue,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,u){const f=Lm(Bm(Bh(h))),p=[];let m=[],y=[0,0],x=[];const C=()=>{x.length>=4&&m.push(...Qa(x,d)),x=[]},k=()=>{C(),m.length&&(p.push(m),m=[])};for(const{key:v,data:_}of f)switch(v){case"M":k(),y=[_[0],_[1]],m.push(y);break;case"L":C(),m.push([_[0],_[1]]);break;case"C":if(!x.length){const E=m.length?m[m.length-1]:y;x.push([E[0],E[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(),!u)return p;const S=[];for(const v of p){const _=Y_(v,u);_.length&&S.push(_)}return S})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=ed(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=ed(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(Za(l,i));else o.push(Kr(l,i));return a&&(n?l.forEach((h=>{o.push(fs(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ue};break;case"fillPath":a={d:this.opsToPath(s),stroke:ue,strokeWidth:0,fill:i.fill||ue};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ue,strokeWidth:i,fill:ue}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class U_{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Vs(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.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(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}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,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,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 Jo="http://www.w3.org/2000/svg";class X_{constructor(t,r){this.svg=t,this.gen=new Vs(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(Jo,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(Jo,"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=o.createElementNS(Jo,"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(o,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(Jo,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}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,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,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 U_(e,t),svg:(e,t)=>new X_(e,t),generator:e=>new Vs(e),newSeed:()=>Vs.newSeed()},ht=g(async(e,t,r)=>{let i;const o=t.useHtmlLabels||Ye(kt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Xt(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,Ce(pr(n),kt()),{useHtmlLabels:o,width:t.width||kt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},kt());let d=h.getBBox();const u=(t?.padding??0)/2;if(o){const f=h.children[0],p=yt(h);await gh(f,n),d=f.getBoundingClientRect(),p.attr("width",d.width),p.attr("height",d.height)}return o?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:s,bbox:d,halfPadding:u,label:a}},"labelHelper"),Ja=g(async(e,t,r)=>{const i=r.useHtmlLabels??ee(kt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Oe(o,Ce(pr(t),kt()),{useHtmlLabels:i,width:r.width||kt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const n=r.padding/2;if(ee(kt())){const l=s.children[0],c=yt(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):o.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:o}},"insertLabel"),st=g((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),lt=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 mr(e,t,r,i,o,s){const a=[],l=r-e,c=i-t,h=l/s,d=2*Math.PI/h,u=t+c/2;for(let f=0;f<=50;f++){const p=f/50,m=e+p*l,y=u+o*Math.sin(d*(m-e));a.push({x:m,y})}return a}g(mr,"generateFullSineWavePoints");function Bo(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}g(Bo,"generateCirclePoints");function nl(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 o=t.find(l=>l.getAttribute("fill")!=="none"),s=t.find(l=>l.getAttribute("stroke")!=="none"),a=g((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"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(nl,"mergePaths");var G_=g((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),l=s===0?0:n*o/s,c=n):(o<0&&(a=-a),l=a,c=o===0?0:a*s/o),{x:r+l,y:i+c}},"intersectRect"),Hr=G_,V_=g(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=kt(),n=ee(a);return await Oe(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),lr=V_,yr=g((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),K_=g(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,n=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=ot(t),u=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),f=Ye(r.flowchart.htmlLabels),p=t.direction==="LR",m=u.insert("g").attr("class","cluster-label swimlane-label"),y=await Oe(m,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let x=y.getBBox();if(f){const R=y.children[0],N=yt(y);x=R.getBoundingClientRect(),N.attr("width",x.width),N.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 S=t.height,v=t.y-S/2,_=t.y+S/2,E=t.x-k/2,B=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:v+S/3,O=p?4:0,A=x.height+2*O;let D,W;if(p){const R=Math.max(A,x.height+2*O),N=E+R,F=Math.max(0,k-R);if(t.look==="handDrawn"){const P=rt.svg(u),I=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),j=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),T=P.rectangle(E,v,R,S,I);D=u.insert(()=>T,":first-child");const U=P.rectangle(N,v,F,S,j);W=u.insert(()=>U,":first-child"),D.select("path:nth-child(2)").attr("style",h.join(";")),D.select("path").attr("style",d.join(";").replace("fill","stroke"))}else D=u.insert("rect",":first-child"),W=u.insert("rect",":first-child"),D.attr("class","swimlane-title").attr("style",c).attr("x",E).attr("y",v).attr("width",R).attr("height",S).attr("fill",s).attr("stroke",n),W.attr("class","swimlane-body").attr("style",c).attr("x",N).attr("y",v).attr("width",F).attr("height",S).attr("fill","none").attr("stroke",n);const $=E+R/2,q=t.y;m.attr("transform",`translate(${$}, ${q}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{const R=Math.max(0,B-v),N=Math.min(A,R),F=v+N,$=Math.max(0,_-F),q=t.x-k/2;if(t.look==="handDrawn"){const j=rt.svg(u),T=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),U=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),z=j.rectangle(q,v,k,N,T);D=u.insert(()=>z,":first-child");const G=j.rectangle(q,F,k,$,U);W=u.insert(()=>G,":first-child"),D.select("path:nth-child(2)").attr("style",h.join(";")),D.select("path").attr("style",d.join(";").replace("fill","stroke"))}else D=u.insert("rect",":first-child"),W=u.insert("rect",":first-child"),D.attr("class","swimlane-title").attr("style",c).attr("x",q).attr("y",v).attr("width",k).attr("height",N).attr("fill",s).attr("stroke",n),W.attr("class","swimlane-body").attr("style",c).attr("x",q).attr("y",F).attr("width",k).attr("height",$).attr("fill","none").attr("stroke",n);const P=t.x-x.width/2,I=v+(N-x.height)/2;m.attr("transform",`translate(${P}, ${I})`)}if(V.trace("Swimlane data ",t,JSON.stringify(t)),l){const R=m.select("span");R&&R.attr("style",l)}return t.offsetX=0,t.width=k,t.height=S,t.offsetY=x.height-C/2,t.intersect=function(R){return Hr(t,R)},{cluster:u,labelBBox:x}},"swimlane"),$m=g(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=ot(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=ee(r),f=d.insert("g").attr("class","cluster-label ");let p;t.labelType==="markdown"?p=await Oe(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width}):p=await lr(f,t.label,t.labelStyle||"",!1,!0);let m=p.getBBox();if(ee(r)){const E=p.children[0],B=yt(p);m=E.getBoundingClientRect(),B.attr("width",m.width),B.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 S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),O=E.path(yr(C,k,y,x,0),B);S=d.insert(()=>(V.debug("Rough node insert CXC",O),O),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.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:v}=ya(r);if(f.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=f.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Hr(t,E)},{cluster:d,labelBBox:m}},"rect"),Z_=g((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return Hr(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),Q_=g(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,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 u=c.append("rect");const f=await lr(d,t.label,t.labelStyle,void 0,!0);let p=f.getBBox();if(ee(r)){const O=f.children[0],A=yt(f);p=O.getBoundingClientRect(),A.attr("width",p.width),A.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,S=t.x-x/2,v=t.y-C/2;t.width=x;const _=t.y-t.height/2-y+p.height+2;let E;if(t.look==="handDrawn"){const O=t.cssClasses.includes("statediagram-cluster-alt"),A=rt.svg(c),D=t.rx||t.ry?A.path(yr(S,v,x,C,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):A.rectangle(S,v,x,C,{seed:o});E=c.insert(()=>D,":first-child");const W=A.rectangle(S,_,x,k,{fill:O?s:a,fillStyle:O?"hachure":"solid",stroke:l,seed:o});E=c.insert(()=>D,":first-child"),u=c.insert(()=>W)}else E=h.insert("rect",":first-child"),E.attr("class","outer").attr("x",S).attr("y",v).attr("width",x).attr("height",C).attr("data-look",t.look),u.attr("class","inner").attr("x",S).attr("y",_).attr("width",x).attr("height",k);d.attr("transform",`translate(${t.x-p.width/2}, ${v+1-(ee(r)?0:3)})`);const B=E.node().getBBox();return t.height=B.height,t.offsetX=0,t.offsetY=p.height-t.padding/2,t.labelBBox=p,t.intersect=function(O){return Hr(t,O)},{cluster:c,labelBBox:p}},"roundedWithTitle"),J_=g(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=ot(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=ee(r),f=d.insert("g").attr("class","cluster-label "),p=await Oe(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let m=p.getBBox();if(ee(r)){const E=p.children[0],B=yt(p);m=E.getBoundingClientRect(),B.attr("width",m.width),B.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 S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),O=E.path(yr(C,k,y,x,t.rx),B);S=d.insert(()=>(V.debug("Rough node insert CXC",O),O),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.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:v}=ya(r);if(f.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=f.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Hr(t,E)},{cluster:d,labelBBox:m}},"kanbanSection"),tB=g((e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=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,u=t.y-h/2;t.width=c;let f;if(t.look==="handDrawn"){const y=rt.svg(a).rectangle(d,u,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});f=a.insert(()=>y,":first-child")}else{f=n.insert("rect",":first-child");let m="outer";t.look,m="divider",f.attr("class",m).attr("x",d).attr("y",u).attr("width",c).attr("height",h).attr("data-look",t.look)}const p=f.node().getBBox();return t.height=p.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Hr(t,m)},{cluster:a,labelBBox:{}}},"divider"),eB=$m,rB={rect:$m,squareRect:eB,roundedWithTitle:Q_,noteGroup:Z_,divider:tB,kanbanSection:J_,swimlane:K_},Om=new Map,Rm=g(async(e,t)=>{const r=t.shape||"rect",i=await rB[r](e,t);return Om.set(t.id,i),i},"insertCluster"),iB=g(()=>{Om=new Map},"clear");function Im(e,t){return e.intersect(t)}g(Im,"intersectNode");var oB=Im;function Pm(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x<o&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<s&&(h=-h),{x:o+c,y:s+h}}g(Pm,"intersectEllipse");var Dm=Pm;function Nm(e,t,r){return Dm(e,t,t,r)}g(Nm,"intersectCircle");var sB=Nm;function qm(e,t,r,i){{const o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,n=o*r.x+s*r.y+a,l=o*i.x+s*i.y+a,c=1e-6;if(n!==0&&l!==0&&ll(n,l))return;const h=i.y-r.y,d=r.x-i.x,u=i.x*r.y-r.x*i.y,f=h*e.x+d*e.y+u,p=h*t.x+d*t.y+u;if(Math.abs(f)<c&&Math.abs(p)<c&&ll(f,p))return;const m=o*d-h*s;if(m===0)return;const y=Math.abs(m/2);let x=s*u-d*a;const C=x<0?(x-y)/m:(x+y)/m;x=h*a-o*u;const k=x<0?(x-y)/m:(x+y)/m;return{x:C,y:k}}}g(qm,"intersectLine");function ll(e,t){return e*t>0}g(ll,"sameSign");var aB=qm;function zm(e,t,r){let i=e.x,o=e.y,s=[],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=o-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],u=t[h<t.length-1?h+1:0],f=aB(e,r,{x:l+d.x,y:c+d.y},{x:l+u.x,y:c+u.y});f&&s.push(f)}return s.length?(s.length>1&&s.sort(function(h,d){let u=h.x-r.x,f=h.y-r.y,p=Math.sqrt(u*u+f*f),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}),s[0]):e}g(zm,"intersectPolygon");var nB=zm,tt={node:oB,circle:sB,ellipse:Dm,polygon:nB,rect:Hr};function jm(e,t){const{labelStyles:r}=ot(t);t.labelStyle=r;const i=lt(t);let o=i;i||(o="anchor");const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,l=rt.svg(s),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=s.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Xt(n)),st(t,d),t.intersect=function(u){return V.info("Circle intersect",t,a,u),tt.circle(t,a,u)},s}g(jm,"anchor");function hl(e,t,r,i,o,s,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,u=(i-t)/2,f=d/o,p=u/s,m=Math.sqrt(f**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*s*Math.sin(h)*(a?-1:1),C=c-y*o*Math.cos(h)*(a?-1:1),k=Math.atan2((t-C)/s,(e-x)/o);let v=Math.atan2((i-C)/s,(r-x)/o)-k;a&&v<0&&(v+=2*Math.PI),!a&&v>0&&(v-=2*Math.PI);const _=[];for(let E=0;E<20;E++){const B=E/19,O=k+B*v,A=x+o*Math.cos(O),D=C+s*Math.sin(O);_.push({x:A,y:D})}return _}g(hl,"generateArcPoints");function Wm(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}g(Wm,"calculateArcSagitta");async function Hm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=g(O=>O+a,"calcTotalHeight"),l=g(O=>{const A=O/2;return[A/(2.5+O/50),A]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await ht(e,t,lt(t)),d=n(t?.height?t?.height:h.height),[u,f]=l(d),p=Wm(d,u,f),y=(t?.width?t?.width:h.width)+s*2+p-p,x=d,{cssStyles:C}=t,k=[{x:y/2,y:-x/2},{x:-y/2,y:-x/2},...hl(-y/2,-x/2,-y/2,x/2,u,f,!1),{x:y/2,y:x/2},...hl(y/2,x/2,y/2,-x/2,u,f,!0)],S=rt.svg(c),v=et(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=bt(k),E=S.path(_,v),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${u/2}, 0)`),st(t,B),t.intersect=function(O){return tt.polygon(t,k,O)},c}g(Hm,"bowTieRect");function or(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}g(or,"insertPolygonShape");var ts=12;async function Ym(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+ts),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,u=c,f=-h,p=0,m=[{x:d+ts,y:f},{x:u,y:f},{x:u,y:p},{x:d,y:p},{x:d,y:f+ts},{x:d+ts,y:f}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(n),k=et(t,{}),S=bt(m),v=C.path(S,k);y=n.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),x&&y.attr("style",x)}else y=or(n,c,h,m);return i&&y.attr("style",i),st(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},n}g(Ym,"card");function Um(e,t){const{nodeStyles:r}=ot(t);t.label="";const i=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/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 o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(u){return tt.polygon(t,a,u)},i}g(Um,"choice");async function Lh(e,t,r){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await ht(e,t,lt(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(s),p=et(t,{}),m=f.circle(0,0,h*2,p);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Xt(u))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return st(t,d),t.calcIntersect=function(f,p){const m=f.width/2;return tt.circle(f,m,p)},t.intersect=function(f){return V.info("Circle intersect",t,h,f),tt.circle(t,h,f)},s}g(Lh,"circle");function Xm(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={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 ${s.x},${s.y} L ${n.x},${n.y}
|
|
233
|
-
M ${o.x},${o.y} L ${a.x},${a.y}`}g(Xm,"createLine");function Gm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=rt.svg(o),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=Xm(s),d=n.path(h,l),u=o.insert(()=>c,":first-child");return u.insert(()=>d),u.attr("class","outer-path"),a&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",i),st(t,u),t.intersect=function(f){return V.info("crossedCircle intersect",t,{radius:s,point:f}),tt.circle(t,s,f)},o}g(Gm,"crossedCircle");function Ke(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}g(Ke,"generateCirclePoints");async function Vm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+n,h=s.height+l,d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...Ke(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Ke(c/2+d*2,-d,d,20,-180,-270),...Ke(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Ke(c/2,h/2,d,20,0,90)],p=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Ke(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Ke(c/2+c*.1,-d,d,20,-180,-270),...Ke(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Ke(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(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(f).replace("Z",""),k=m.path(C,y),S=bt(p),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),u&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,p,E)},o}g(Vm,"curlyBraceLeft");function Ze(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:f,y:p})}return a}g(Ze,"generateCirclePoints");async function Km(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...Ze(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Ze(c/2+d*2,-d,d,20,-180,-270),...Ze(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Ze(c/2,h/2,d,20,0,90)],p=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...Ze(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Ze(c/2+d*2,-d,d,20,-180,-270),...Ze(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Ze(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(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(f).replace("Z",""),k=m.path(C,y),S=bt(p),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),u&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,p,E)},o}g(Km,"curlyBraceRight");function Kt(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}g(Kt,"generateCirclePoints");async function Zm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...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(o),x=et(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=bt(f).replace("Z",""),S=y.path(k,x),_=bt(p).replace("Z",""),E=y.path(_,x),B=bt(m),O=y.path(B,{...x}),A=o.insert("g",":first-child");return A.insert(()=>O,":first-child").attr("stroke-opacity",0),A.insert(()=>S,":first-child"),A.insert(()=>E,":first-child"),A.attr("class","text"),u&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,A),t.intersect=function(D){return tt.polygon(t,m,D)},o}g(Zm,"curlyBraces");async function Qm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await ht(e,t,lt(t)),d=Math.max(n,(h.width+s*2)*1.25,t?.width??0),u=Math.max(l,h.height+a*2,t?.height??0),f=u/2,{cssStyles:p}=t,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=d,C=u,k=x-f,S=C/4,v=[{x:k,y:0},{x:S,y:0},{x:0,y:C/2},{x:S,y:C},{x:k,y:C},...Bo(-k,-C/2,f,50,270,90)],_=bt(v),E=m.path(_,y),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.attr("transform",`translate(${-d/2}, ${-u/2})`),st(t,B),t.intersect=function(O){return tt.polygon(t,v,O)},c}g(Qm,"curvedTrapezoid");var lB=g((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),hB=g((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),cB=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),ad=8,nd=8;async function Jm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.width<nd&&(t.width=nd);const C=y/2/(2.5+y/50);t.height=(t.height??0)-s-C*3,t.height<ad&&(t.height=ad)}const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t.width?t.width:l.width)+a,d=h/2,u=d/(2.5+h/50),f=(t.height?t.height:l.height)+s+u;let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=rt.svg(n),x=hB(0,0,h,f,d,u),C=cB(0,u,h,f,d,u),k=et(t,{}),S=y.path(x,k),v=y.path(C,et(t,{fill:"none"}));p=n.insert(()=>v,":first-child"),p=n.insert(()=>S,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{const y=lB(0,0,h,f,d,u);p=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Xt(m)).attr("style",i)}return p.attr("label-offset-y",u),p.attr("transform",`translate(${-h/2}, ${-(f/2+u)})`),st(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-u)){let k=u*u*(1-C*C/(d*d));k>0&&(k=Math.sqrt(k)),k=u-k,y.y-(t.y??0)>0&&(k=-k),x.y+=k}return x},n}g(Jm,"cylinder");async function zi(e,t,r){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await ht(e,t,lt(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:u,ry:f}=t;const{cssStyles:p}=t;if(r?.rx&&r.ry&&(u=r.rx,f=r.ry),t.look==="handDrawn"){const m=rt.svg(s),y=et(t,{}),x=u||f?m.path(yr(c,h,n,l,u||0),y):m.rectangle(c,h,n,l,y);d=s.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",Xt(p))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Xt(u)).attr("ry",Xt(f)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return st(t,d),t.calcIntersect=function(m,y){return tt.rect(m,y)},t.intersect=function(m){return tt.rect(t,m)},s}g(zi,"drawRect");async function ty(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await zi(e,t,l);if(t.look==="handDrawn"){const f=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(()=>f.line(x.x,x.y,x.x+x.width,x.y,p),".basic.label-container g.label"),c.insert(()=>f.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,u=(Number(h.attr("height"))||n)??0;return d>0&&u>0&&h.attr("stroke-dasharray",`${d} ${u}`),c}g(ty,"datastore");async function ey(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=n.width+o,h=n.height+s,d=h*.2,u=-c/2,f=-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:u,y:f+d},{x:-u,y:f+d},{x:-u,y:-f},{x:u,y:-f},{x:u,y:f},{x:-u,y:f},{x:-u,y:f+d}],C=m.polygon(x.map(S=>[S.x,S.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(${u+(t.padding??0)/2-(n.x-(n.left??0))}, ${f+d+(t.padding??0)/2-(n.y-(n.top??0))})`),st(t,k),t.intersect=function(S){return tt.rect(t,S)},a}g(ey,"dividedRectangle");async function ry(e,t){const{labelStyles:r,nodeStyles:i}=ot(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(n),p=et(t,{roughness:.2,strokeWidth:2.5}),m=et(t,{roughness:.2,strokeWidth:1.5}),y=f.circle(0,0,c*2,p),x=f.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",Xt(t.cssClasses)).attr("style",Xt(u)),d.node()?.appendChild(y),d.node()?.appendChild(x)}else{d=n.insert("g",":first-child");const f=d.insert("circle",":first-child"),p=d.insert("circle");d.attr("class","basic label-container").attr("style",i),f.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 st(t,d),t.intersect=function(f){return V.info("DoubleCircle intersect",t,c,f),tt.circle(t,c,f)},n}g(ry,"doublecircle");function iy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=rt.svg(s),{nodeBorder:c}=r,h=et(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),u=s.insert(()=>d,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",o),st(t,u),t.intersect=function(f){return V.info("filledCircle intersect",t,{radius:a,point:f}),tt.circle(t,a,f)},s}g(iy,"filledCircle");var ld=10,hd=10;async function oy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<ld&&(t.height=ld),t.width=(t?.width??0)-s-s/2,t.width<hd&&(t.width=hd));const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width:n.width)+(s??0),h=t?.height?t?.height:c+n.height,d=h,u=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:f}=t,p=rt.svg(a),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=bt(u),x=p.path(y,m),C=a.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return f&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),t.width=c,t.height=h,st(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,u,k),tt.polygon(t,u,k)},a}g(oy,"flippedTriangle");function sy(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=ot(t);t.label="";const a=e.insert("g").attr("class",lt(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,u=rt.svg(a),f=et(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=u.rectangle(h,d,l,c,f),m=a.insert(()=>p,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),st(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(sy,"forkJoin");async function ay(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=15,s=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<s&&(t.height=s),t.width=(t?.width??0)-a*2,t.width<o&&(t.width=o));const{shapeSvg:l,bbox:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:Math.max(o,c.width))+a*2,d=(t?.height?t?.height:Math.max(s,c.height))+n*2,u=d/2,{cssStyles:f}=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-u,y:-d/2},...Bo(-h/2+u,0,u,50,90,270),{x:h/2-u,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"),f&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),st(t,k),t.intersect=function(S){return V.info("Pill intersect",t,{radius:u,point:S}),tt.polygon(t,y,S)},l}g(ay,"halfRoundedRectangle");var dB=g((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function ny(e,t){const{labelStyles:r,nodeStyles:i}=ot(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,l=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const k=(t.height??0)/o;t.width=(t?.width??0)-2*k-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await ht(e,t,lt(t)),u=(t?.height?t?.height:d.height)+l,f=u/o,p=(t?.width?t?.width:d.width)+2*f+c,m=[{x:f,y:0},{x:p-f,y:0},{x:p,y:-u/2},{x:p-f,y:-u},{x:f,y:-u},{x:0,y:-u/2}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(h),k=et(t,{}),S=dB(0,0,p,u,f),v=C.path(S,k);y=h.insert(()=>v,":first-child").attr("transform",`translate(${-p/2}, ${u/2})`),x&&y.attr("style",x)}else y=or(h,p,u,m);return i&&y.attr("style",i),t.width=p,t.height=u,st(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},h}g(ny,"hexagon");async function ly(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await ht(e,t,lt(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=rt.svg(o),c=et(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=bt(h),u=l.path(d,c),f=o.insert(()=>u,":first-child");return f.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",i),f.attr("transform",`translate(${-s/2}, ${-a/2})`),st(t,f),t.intersect=function(p){return V.info("Pill intersect",t,{points:h}),tt.polygon(t,h,p)},o}g(ly,"hourglass");async function hy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await ht(e,t,"icon-shape default"),u=t.pos==="t",f=n,p=n,{nodeBorder:m}=r,{stylesMap:y}=Ni(t),x=-p/2,C=-f/2,k=t.label?8:0,S=rt.svg(c),v=et(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=S.rectangle(x,C,p,f,v),E=Math.max(p,h.width),B=f+h.height+k,O=S.rectangle(-E/2,-B/2,E,B,{...v,fill:"transparent",stroke:"none"}),A=c.insert(()=>_,":first-child"),D=c.insert(()=>O);if(t.icon){const W=c.append("g");W.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const R=W.node().getBBox(),N=R.width,F=R.height,$=R.x,q=R.y;W.attr("transform",`translate(${-N/2-$},${u?h.height/2+k/2-F/2-q:-h.height/2-k/2-F/2-q})`),W.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-B/2:B/2-h.height})`),A.attr("transform",`translate(0,${u?h.height/2+k/2:-h.height/2-k/2})`),st(t,D),t.intersect=function(W){if(V.info("iconSquare intersect",t,W),!t.label)return tt.rect(t,W);const R=t.x??0,N=t.y??0,F=t.height??0;let $=[];return u?$=[{x:R-h.width/2,y:N-F/2},{x:R+h.width/2,y:N-F/2},{x:R+h.width/2,y:N-F/2+h.height+k},{x:R+p/2,y:N-F/2+h.height+k},{x:R+p/2,y:N+F/2},{x:R-p/2,y:N+F/2},{x:R-p/2,y:N-F/2+h.height+k},{x:R-h.width/2,y:N-F/2+h.height+k}]:$=[{x:R-p/2,y:N-F/2},{x:R+p/2,y:N-F/2},{x:R+p/2,y:N-F/2+f},{x:R+h.width/2,y:N-F/2+f},{x:R+h.width/2/2,y:N+F/2},{x:R-h.width/2,y:N+F/2},{x:R-h.width/2,y:N-F/2+f},{x:R-p/2,y:N-F/2+f}],tt.polygon(t,$,W)},c}g(hy,"icon");async function cy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await ht(e,t,"icon-shape default"),u=20,f=t.label?8:0,p=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Ni(t),C=rt.svg(c),k=et(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=x.get("fill");k.stroke=S??y;const v=c.append("g");t.icon&&v.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const _=v.node().getBBox(),E=_.width,B=_.height,O=_.x,A=_.y,D=Math.max(E,B)*Math.SQRT2+u*2,W=C.circle(0,0,D,k),R=Math.max(D,h.width),N=D+h.height+f,F=C.rectangle(-R/2,-N/2,R,N,{...k,fill:"transparent",stroke:"none"}),$=c.insert(()=>W,":first-child"),q=c.insert(()=>F);return v.attr("transform",`translate(${-E/2-O},${p?h.height/2+f/2-B/2-A:-h.height/2-f/2-B/2-A})`),v.attr("style",`color: ${x.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-N/2:N/2-h.height})`),$.attr("transform",`translate(0,${p?h.height/2+f/2:-h.height/2-f/2})`),st(t,q),t.intersect=function(P){return V.info("iconSquare intersect",t,P),tt.rect(t,P)},c}g(cy,"iconCircle");async function dy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await ht(e,t,"icon-shape default"),f=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ni(t),k=-m/2,S=-p/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const O=_.path(yr(k,S,m,p,5),E),A=Math.max(m,h.width),D=p+h.height+v,W=_.rectangle(-A/2,-D/2,A,D,{...E,fill:"transparent",stroke:"none"}),R=c.insert(()=>O,":first-child").attr("class","icon-shape2"),N=c.insert(()=>W);if(t.icon){const F=c.append("g");F.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const $=F.node().getBBox(),q=$.width,P=$.height,I=$.x,j=$.y;F.attr("transform",`translate(${-q/2-I},${f?h.height/2+v/2-P/2-j:-h.height/2-v/2-P/2-j})`),F.attr("style",`color: ${C.get("stroke")??y};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-D/2:D/2-h.height})`),R.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),st(t,N),t.intersect=function(F){if(V.info("iconSquare intersect",t,F),!t.label)return tt.rect(t,F);const $=t.x??0,q=t.y??0,P=t.height??0;let I=[];return f?I=[{x:$-h.width/2,y:q-P/2},{x:$+h.width/2,y:q-P/2},{x:$+h.width/2,y:q-P/2+h.height+v},{x:$+m/2,y:q-P/2+h.height+v},{x:$+m/2,y:q+P/2},{x:$-m/2,y:q+P/2},{x:$-m/2,y:q-P/2+h.height+v},{x:$-h.width/2,y:q-P/2+h.height+v}]:I=[{x:$-m/2,y:q-P/2},{x:$+m/2,y:q-P/2},{x:$+m/2,y:q-P/2+p},{x:$+h.width/2,y:q-P/2+p},{x:$+h.width/2/2,y:q+P/2},{x:$-h.width/2,y:q+P/2},{x:$-h.width/2,y:q-P/2+p},{x:$-m/2,y:q-P/2+p}],tt.polygon(t,I,F)},c}g(dy,"iconRounded");async function uy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await ht(e,t,"icon-shape default"),f=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ni(t),k=-m/2,S=-p/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const O=_.path(yr(k,S,m,p,.1),E),A=Math.max(m,h.width),D=p+h.height+v,W=_.rectangle(-A/2,-D/2,A,D,{...E,fill:"transparent",stroke:"none"}),R=c.insert(()=>O,":first-child"),N=c.insert(()=>W);if(t.icon){const F=c.append("g");F.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const $=F.node().getBBox(),q=$.width,P=$.height,I=$.x,j=$.y;F.attr("transform",`translate(${-q/2-I},${f?h.height/2+v/2-P/2-j:-h.height/2-v/2-P/2-j})`),F.attr("style",`color: ${C.get("stroke")??y};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-D/2:D/2-h.height})`),R.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),st(t,N),t.intersect=function(F){if(V.info("iconSquare intersect",t,F),!t.label)return tt.rect(t,F);const $=t.x??0,q=t.y??0,P=t.height??0;let I=[];return f?I=[{x:$-h.width/2,y:q-P/2},{x:$+h.width/2,y:q-P/2},{x:$+h.width/2,y:q-P/2+h.height+v},{x:$+m/2,y:q-P/2+h.height+v},{x:$+m/2,y:q+P/2},{x:$-m/2,y:q+P/2},{x:$-m/2,y:q-P/2+h.height+v},{x:$-h.width/2,y:q-P/2+h.height+v}]:I=[{x:$-m/2,y:q-P/2},{x:$+m/2,y:q-P/2},{x:$+m/2,y:q-P/2+p},{x:$+h.width/2,y:q-P/2+p},{x:$+h.width/2/2,y:q+P/2},{x:$-h.width/2,y:q+P/2},{x:$-h.width/2,y:q-P/2+p},{x:$-m/2,y:q-P/2+p}],tt.polygon(t,I,F)},c}g(uy,"iconSquare");async function fy(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=ot(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:u,label:f}=await ht(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 S=C.rectangle(m,y,c,h,k),v=Math.max(c,u.width),_=h+u.height+x,E=C.rectangle(-v/2,-_/2,v,_,{...k,fill:"none",stroke:"none"}),B=d.insert(()=>S,":first-child"),O=d.insert(()=>E);if(t.img){const A=d.append("image");A.attr("href",t.img),A.attr("width",c),A.attr("height",h),A.attr("preserveAspectRatio","none"),A.attr("transform",`translate(${-c/2},${p?_/2-h:-_/2})`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-h/2-u.height/2-x/2:h/2-u.height/2+x/2})`),B.attr("transform",`translate(0,${p?u.height/2+x/2:-u.height/2-x/2})`),st(t,O),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const D=t.x??0,W=t.y??0,R=t.height??0;let N=[];return p?N=[{x:D-u.width/2,y:W-R/2},{x:D+u.width/2,y:W-R/2},{x:D+u.width/2,y:W-R/2+u.height+x},{x:D+c/2,y:W-R/2+u.height+x},{x:D+c/2,y:W+R/2},{x:D-c/2,y:W+R/2},{x:D-c/2,y:W-R/2+u.height+x},{x:D-u.width/2,y:W-R/2+u.height+x}]:N=[{x:D-c/2,y:W-R/2},{x:D+c/2,y:W-R/2},{x:D+c/2,y:W-R/2+h},{x:D+u.width/2,y:W-R/2+h},{x:D+u.width/2/2,y:W+R/2},{x:D-u.width/2,y:W+R/2},{x:D-u.width/2,y:W-R/2+h},{x:D-c/2,y:W-R/2+h}],tt.polygon(t,N,A)},d}g(fy,"imageSquare");async function py(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=Math.max(l.width+(a??0)*2,t?.width??0),h=Math.max(l.height+(s??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 u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),f&&u.attr("style",f)}else u=or(n,c,h,d);return i&&u.attr("style",i),t.width=c,t.height=h,st(t,u),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(py,"inv_trapezoid");async function gy(e,t){const{shapeSvg:r,bbox:i,label:o}=await ht(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),st(t,s),t.intersect=function(l){return tt.rect(t,l)},r}g(gy,"labelRect");async function my(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height??l.height)+s,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 u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=or(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,st(t,u),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(my,"lean_left");async function yy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height??l.height)+s,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 u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=or(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,st(t,u),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(yy,"lean_right");function xy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),{cssStyles:s}=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(o),d=et(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=bt(c),f=h.path(u,d),p=o.insert(()=>f,":first-child");return p.attr("class","outer-path"),s&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),p.attr("transform",`translate(-${a/2},${-n})`),st(t,p),t.intersect=function(m){return V.info("lightningBolt intersect",t,m),tt.polygon(t,c,m)},o}g(xy,"lightningBolt");var uB=g((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),fB=g((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),pB=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),cd=10,dd=10;async function Cy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const x=t.width??0;t.width=(t.width??0)-s,t.width<dd&&(t.width=dd);const k=x/2/(2.5+x/50);t.height=(t.height??0)-a-k*3,t.height<cd&&(t.height=cd)}const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+s*2,d=h/2,u=d/(2.5+h/50),f=(t?.height?t?.height:l.height)+u+a*2,p=f*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=rt.svg(n),C=fB(0,0,h,f,d,u,p),k=pB(0,u,h,f,d,u),S=et(t,{}),v=x.path(C,S),_=x.path(k,S);n.insert(()=>_,":first-child").attr("class","line"),m=n.insert(()=>v,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=uB(0,0,h,f,d,u,p);m=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",Xt(y)).attr("style",i)}return m.attr("label-offset-y",u),m.attr("transform",`translate(${-h/2}, ${-(f/2+u)})`),st(t,m),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+u-(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-u)){let S=u*u*(1-k*k/(d*d));S>0&&(S=Math.sqrt(S)),S=u-S,x.y-(t.y??0)>0&&(S=-S),C.y+=S}return C},n}g(Cy,"linedCylinder");async function by(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const S=t.width;t.width=(S??0)*10/11-s*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 ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+(s??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,u=t.look==="neo"?d/4:d/8,f=d+u,{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:-f/2},{x:-h/2-h/2*.1,y:f/2},...mr(-h/2-h/2*.1,f/2,h/2+h/2*.1,f/2,u,.8),{x:h/2+h/2*.1,y:-f/2},{x:-h/2-h/2*.1,y:-f/2},{x:-h/2,y:-f/2},{x:-h/2,y:f/2*1.1},{x:-h/2,y:-f/2}],C=m.polygon(x.map(S=>[S.x,S.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,${-u/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-u/2-(l.y-(l.top??0))})`),st(t,k),t.intersect=function(S){return tt.polygon(t,x,S)},n}g(by,"linedWaveEdgedRect");async function ky(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await ht(e,t,lt(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,u=(t?.height?t?.height:c.height)+a*2+2*n,f=d-2*n,p=u-2*n,m=-f/2,y=-p/2,{cssStyles:x}=t,C=rt.svg(l),k=et(t,{}),S=[{x:m-n,y:y+n},{x:m-n,y:y+p+n},{x:m+f-n,y:y+p+n},{x:m+f-n,y:y+p},{x:m+f,y:y+p},{x:m+f,y:y+p-n},{x:m+f+n,y:y+p-n},{x:m+f+n,y:y-n},{x:m+n,y:y-n},{x:m+n,y},{x:m,y},{x:m,y:y+n}],v=[{x:m,y:y+n},{x:m+f-n,y:y+n},{x:m+f-n,y:y+p},{x:m+f,y:y+p},{x:m+f,y},{x:m,y}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=bt(S);let E=C.path(_,k);const B=bt(v);let O=C.path(B,k);t.look!=="handDrawn"&&(E=nl(E),O=nl(O));const A=l.insert("g",":first-child");return A.insert(()=>E),A.insert(()=>O),A.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&A.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))})`),st(t,A),t.intersect=function(D){return tt.polygon(t,S,D)},l}g(ky,"multiRect");async function wy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(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(s.width,t?.width??0)+l*2,u=Math.max(s.height,t?.height??0)+c*3,f=t.look==="neo"?u/4:u/8,p=u+(h?f/2:-f/2),m=-d/2,y=-p/2,x=10,{cssStyles:C}=t,k=mr(m-x,y+p+x,m+d-x,y+p+x,f,.8),S=k?.[k.length-1],v=[{x:m-x,y:y+x},{x:m-x,y:y+p+x},...k,{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y:S.y-2*x},{x:m+d+x,y:S.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:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y},{x:m,y}],E=rt.svg(o),B=et(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const O=bt(v),A=E.path(O,B),D=bt(_),W=E.path(D,B),R=o.insert(()=>A,":first-child");return R.insert(()=>W),R.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",i),R.attr("transform",`translate(0,${-f/2})`),a.attr("transform",`translate(${-(s.width/2)-x-(s.x-(s.left??0))}, ${-(s.height/2)+x-f/2-(s.y-(s.top??0))})`),st(t,R),t.intersect=function(N){return tt.polygon(t,v,N)},o}g(wy,"multiWaveEdgedRectangle");async function Sy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i,t.useHtmlLabels||ee(Ot())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(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,u=-h/2,{cssStyles:f}=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,u,c,h,m),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),f&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",f),o&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),st(t,x),t.intersect=function(C){return tt.rect(t,C)},a}g(Sy,"note");var gB=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 vy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ht(e,t,lt(t)),a=s.width+(t.padding??0),n=s.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:u}=t;if(t.look==="handDrawn"){const f=rt.svg(o),p=et(t,{}),m=gB(0,0,l),y=f.path(m,p);d=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),u&&d.attr("style",u)}else d=or(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),st(t,d),t.calcIntersect=function(f,p){const m=f.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(f,y,p);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(f){return this.calcIntersect(t,f)},o}g(vy,"question");async function Ty(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width??l.width)+(t.look==="neo"?s*2:s),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),u=-h/2,f=-d/2,p=f/2,m=[{x:u+p,y:f},{x:u,y:0},{x:u+p,y:-f},{x:-u,y:-f},{x:-u,y:f}],{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=bt(m),S=x.path(k,C),v=n.insert(()=>S,":first-child");return v.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.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))})`),st(t,v),t.intersect=function(_){return tt.polygon(t,m,_)},n}g(Ty,"rect_left_inv_arrow");async function _y(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await lr(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(ee(kt())){const B=h.children[0],O=yt(h);d=B.getBoundingClientRect(),O.attr("width",d.width),O.attr("height",d.height)}V.info("Text 2",l);const u=l||[],f=h.getBBox(),p=await lr(n,Array.isArray(u)?u.join("<br/>"):u,t.labelStyle,!0,!0),m=p.children[0],y=yt(p);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const x=(t.padding||0)/2;yt(p).attr("transform","translate( "+(d.width>f.width?0:(f.width-d.width)/2)+", "+(f.height+x+5)+")"),yt(h).attr("transform","translate( "+(d.width<f.width?0:-(f.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),S=-d.width/2-x,v=-d.height/2-x;let _,E;if(t.look==="handDrawn"){const B=rt.svg(s),O=et(t,{}),A=B.path(yr(S,v,C,k,t.rx||0),O),D=B.line(-d.width/2-x,-d.height/2-x+f.height+x,d.width/2+x,-d.height/2-x+f.height+x,O);E=s.insert(()=>(V.debug("Rough node insert CXC",A),D),":first-child"),_=s.insert(()=>(V.debug("Rough node insert CXC",A),A),":first-child")}else _=a.insert("rect",":first-child"),E=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)),E.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+f.height+x).attr("y2",-d.height/2-x+f.height+x);return st(t,_),t.intersect=function(B){return tt.rect(t,B)},s}g(_y,"rectWithTitle");async function By(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return zi(e,t,o)}g(By,"roundedRect");var Sr=8;async function Ly(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?Sr:Sr*2),h=(t?.height??n.height)+s*2,d=c-Sr,u=h,f=Sr-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:f,y:p},{x:f+d,y:p},{x:f+d,y:p+u},{x:f-Sr,y:p+u},{x:f-Sr,y:p},{x:f,y:p},{x:f,y:p+u}],k=y.polygon(C.map(v=>[v.x,v.y]),x),S=a.insert(()=>k,":first-child");return S.attr("class","basic label-container outer-path").attr("style",Xt(m)),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${Sr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),st(t,S),t.intersect=function(v){return tt.rect(t,v)},a}g(Ly,"shadedProcess");async function Ey(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+s*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,u=h,f=d/1.5,p=-u/2,m=-f/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+f},{x:p+u,y:m+f},{x:p+u,y:m-f/2}],S=bt(k),v=x.path(S,C),_=n.insert(()=>v,":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, ${f/4})`),c.attr("transform",`translate(${-u/2+(t.padding??0)-(l.x-(l.left??0))}, ${-f/4+(t.padding??0)-(l.y-(l.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,k,E)},n}g(Ey,"slopedRect");async function Fy(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return zi(e,t,s)}g(Fy,"squareRect");async function Ay(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:u}=t,f=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},...Bo(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...Bo(h/2-d,0,d,50,270,450)],y=bt(m),x=f.path(y,p),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),st(t,C),t.intersect=function(k){return tt.polygon(t,m,k)},n}g(Ay,"stadium");async function My(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return zi(e,t,r)}g(My,"state");function $y(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{cssStyles:s}=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),u=et(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=d.circle(0,0,t.width,{...u,stroke:a,strokeWidth:2}),p=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...u,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),x=h.insert(()=>f,":first-child");if(x.insert(()=>y),t.look!=="handDrawn"&&x.attr("class","outer-path"),s&&x.selectAll("path").attr("style",s),o&&x.selectAll("path").attr("style",o),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 st(t,x),t.intersect=function(C){return tt.circle(t,(t.width??0)/2,C)},h}g($y,"stateEnd");function Oy(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=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 s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=rt.svg(s).circle(0,0,t.width,Qv(i));a=s.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=s.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&&o&&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 st(t,a),t.intersect=function(n){return tt.circle(t,(t.width??7)/2,n)},s}g(Oy,"stateStart");var Zr=8;async function Ry(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width??l.width)+2*Zr+s,h=(t?.height??l.height)+a,d=c-2*Zr,u=h,f=-c/2,p=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(t.look==="handDrawn"){const y=rt.svg(n),x=et(t,{}),C=y.rectangle(f,p,d+16,u,x),k=y.line(f+Zr,p,f+Zr,p+u,x),S=y.line(f+Zr+d,p,f+Zr+d,p+u,x);n.insert(()=>k,":first-child"),n.insert(()=>S,":first-child");const v=n.insert(()=>C,":first-child"),{cssStyles:_}=t;v.attr("class","basic label-container").attr("style",Xt(_)),st(t,v)}else{const y=or(n,d,u,m);i&&y.attr("style",i),st(t,y)}return t.intersect=function(y){return tt.polygon(t,m,y)},n}g(Ry,"subroutine");var tn=.2;async function Iy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-tn*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height?t?.height:l.height)+a*2,h=tn*c,d=tn*c,f=(t?.width?t?.width:l.width)+s*2+h-h,p=c,m=-f/2,y=-p/2,{cssStyles:x}=t,C=rt.svg(n),k=et(t,{}),S=[{x:m-h/2,y},{x:m+f+h/2,y},{x:m+f+h/2,y:y+p},{x:m-h/2,y:y+p}],v=[{x:m+f-h/2,y:y+p},{x:m+f+h/2,y:y+p},{x:m+f+h/2,y:y+p-d}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=bt(S),E=C.path(_,k),B=bt(v),O=C.path(B,{...k,fillStyle:"solid"}),A=n.insert(()=>O,":first-child");return A.insert(()=>E,":first-child"),A.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),st(t,A),t.intersect=function(D){return tt.polygon(t,S,D)},n}g(Iy,"taggedRect");async function Py(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,u=l+c,{cssStyles:f}=t,p=rt.svg(o),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:u/2},...mr(-n/2-n/2*.1,u/2,n/2+n/2*.1,u/2,c,.8),{x:n/2+n/2*.1,y:-u/2},{x:-n/2-n/2*.1,y:-u/2}],x=-n/2+n/2*.1,C=-u/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},...mr(x+n,(C+l)*1.25,x+n-h,(C+l)*1.3,-l*.02,.5)],S=bt(y),v=p.path(S,m),_=bt(k),E=p.path(_,{...m,fillStyle:"solid"}),B=o.insert(()=>E,":first-child");return B.insert(()=>v,":first-child"),B.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),st(t,B),t.intersect=function(O){return tt.polygon(t,y,O)},o}g(Py,"taggedWaveEdgedRectangle");async function Dy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ht(e,t,lt(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=o.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),st(t,h),t.intersect=function(d){return tt.rect(t,d)},o}g(Dy,"text");var mB=g((e,t,r,i,o,s)=>`M${e},${t}
|
|
229
|
+
`);return pm(i)}g(gm,"preprocessMarkdown");function mm(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}g(mm,"nonMarkdownToLines");function ym(e,t={}){const r=gm(e,t),i=Bt.lexer(r),o=[[]];let s=0;function a(n,l="normal"){n.type==="text"?n.text.split(`
|
|
230
|
+
`).forEach((h,d)=>{d!==0&&(s++,o.push([])),h.split(" ").forEach(u=>{u=u.replace(/'/g,"'"),u&&o[s].push({content:u,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].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"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}g(ym,"markdownToLines");function xm(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}g(xm,"nonMarkdownToHTML");function Cm(e,{markdownAutoWrap:t}={}){const r=Bt.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g," "):o.text.replace(/\n */g,"<br/>"):o.type==="strong"?`<strong>${o.tokens?.map(i).join("")}</strong>`:o.type==="em"?`<em>${o.tokens?.map(i).join("")}</em>`:o.type==="paragraph"?`<p>${o.tokens?.map(i).join("")}</p>`:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(V.warn(`Unsupported markdown: ${o.type}`),o.raw)}return g(i,"output"),r.map(i).join("")}g(Cm,"markdownToHTML");function bm(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}g(bm,"splitTextToChars");function km(e,t){const r=bm(t.content);return Th(e,[],r,t.type)}g(km,"splitWordToFitWidth");function Th(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?Th(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}g(Th,"splitWordToFitWidthRecursion");function wm(e,t){if(e.some(({content:r})=>r.includes(`
|
|
231
|
+
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Ys(e,t)}g(wm,"splitLineToFitWidth");function Ys(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(s),t(a))return Ys(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=km(t,s);r.push([n]),l.content&&e.unshift(l)}return Ys(e,t,r)}g(Ys,"splitLineToFitWidthRecursion");function rl(e,t){t&&e.attr("style",t)}g(rl,"applyStyle");var Zc=16384;async function Sm(e,t,r,i,o=!1,s=Ot()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,Zc)}px`),a.attr("height",`${Math.min(10*r,Zc)}px`);const n=a.append("xhtml:div"),l=Li(t.label)?await El(t.label.replace(Pi.lineBreakRegex,`
|
|
232
|
+
`),s):Ce(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),rl(h,t.labelStyle),h.attr("class",`${c} ${i}`),rl(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"),o&&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(Sm,"addHtmlSpan");function ba(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}g(ba,"createTspan");function vm(e,t,r){const i=e.append("text"),o=ba(i,1,t);ka(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}g(vm,"computeWidthOfText");function Tm(e,t,r){const i=e.append("text"),o=ba(i,1,t);ka(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}g(Tm,"computeDimensionOfText");function _m(e,t,r,i=!1,o=!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");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=g(f=>vm(a,1.1,f)<=e,"checkWidth"),u=d(h)?[h]:wm(h,d);for(const f of u){const p=ba(l,c,1.1,o);ka(p,f),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(_m,"createFormattedText");function il(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(il,"decodeHTMLEntities");function ka(e,t){e.text(""),t.forEach((r,i)=>{const o=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?o.text(il(r.content)):o.text(" "+il(r.content))})}g(ka,"updateTextContentAndStyles");async function Bm(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await VT(n)?await qi(n,void 0,{class:"label-icon"}):`<i class='${Ce(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}g(Bm,"replaceIconSubstring");var Oe=g(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(V.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?Cm(t,h):xm(t),u=await Bm(pr(d),h),f=t.replace(/\\\\/g,"\\"),p={isNode:n,label:Li(t)?f:u,labelStyle:r.replace("fill:","color:")};return await Sm(e,p,l,o,c,h)}else{const d=pr(t.replace(/<br\s*\/?>/g,"<br/>")),u=a?ym(d.replace("<br>","<br/>"),h):mm(d),f=_m(l,e,u,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:");yt(f).attr("style",p)}else{const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");yt(f).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:");yt(f).select("text").attr("style",m)}return i?yt(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):yt(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText");function Ga(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*a+o}}}function $_(e,t){return e[0]===t[0]&&e[1]===t[1]}function O_(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)Ga(c,n,o);const l=(function(c,h,d){const u=[];for(const C of c){const k=[...C];$_(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&u.push(k)}const f=[];h=Math.max(h,.1);const p=[];for(const C of u)for(let k=0;k<C.length-1;k++){const S=C[k],v=C[k+1];if(S[1]!==v[1]){const _=Math.min(S[1],v[1]);p.push({ymin:_,ymax:Math.max(S[1],v[1]),x:_===S[1]?S[0]:v[0],islope:(v[0]-S[0])/(v[1]-S[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 f;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 S=m[C].edge,v=m[k].edge;f.push([[Math.round(S.x),y],[Math.round(v.x),y]])}y+=d,m.forEach((C=>{C.edge.x=C.edge.x+d*C.edge.islope})),x++}return f})(a,s,i);if(o){for(const c of a)Ga(c,n,-o);(function(c,h,d){const u=[];c.forEach((f=>u.push(...f))),Ga(u,h,d)})(l,n,-o)}return l}function Do(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),O_(e,o,i,s||1)}class _h{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Do(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function wa(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 R_ extends _h{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Do(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)wa([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 I_ extends _h{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class P_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Do(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const l=wa(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,u=(n[0][0]+n[1][0])/2-o/4,f=Math.min(n[0][1],n[1][1]);for(let p=0;p<h;p++){const m=f+d+p*o,y=u-a+2*Math.random()*a,x=m-a+2*Math.random()*a,C=this.helper.ellipse(y,x,s,s,r);i.push(...C.ops)}}return{type:"fillSketch",ops:i}}}class D_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Do(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,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return t.forEach((a=>{const n=wa(a),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const u=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let f=0;f<l;f++){const p=f*(i+o),m=p+i,y=[h[0]+p*Math.cos(u)+c*Math.cos(u),h[1]+p*Math.sin(u)+c*Math.sin(u)],x=[h[0]+m*Math.cos(u)+c*Math.cos(u),h[1]+m*Math.sin(u)+c*Math.sin(u)];s.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r))}})),s}}class N_{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,s=Do(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(s,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((s=>{const a=wa(s),n=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const u=2*d*r,f=2*(d+1)*r,p=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],y=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],x=[m[0]+p*Math.cos(h+Math.PI/4),m[1]+p*Math.sin(h+Math.PI/4)];o.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))}})),o}}const he={};class q_{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const z_=0,Va=1,Qc=2,Zo={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 Ka(e,t){return e.type===t}function Bh(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:z_,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:Va,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:Qc,text:""},n})(e);let i="BOD",o=0,s=r[o];for(;!Ka(s,Qc);){let a=0;const n=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return Bh("M0,0"+e);o++,a=Zo[s.text],i=s.text}else Ka(s,Va)?a=Zo[i]:(o++,a=Zo[s.text],i=s.text);if(!(o+a<r.length))throw new Error("Path data ended short");for(let l=o;l<o+a;l++){const c=r[l];if(!Ka(c,Va))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Zo[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),o+=a,s=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function Lm(e){let t=0,r=0,i=0,o=0;const s=[];for(const{key:a,data:n}of e)switch(a){case"M":s.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],s.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":s.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],s.push({key:"L",data:[t,r]});break;case"C":s.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));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.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));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.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));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function Em(e){const t=[];let r="",i=0,o=0,s=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,o]=h,[s,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,u=0;r==="C"||r==="S"?(d=i+(i-n),u=o+(o-l)):(d=i,u=o),t.push({key:"C",data:[d,u,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,u]=h;let f=0,p=0;r==="Q"||r==="T"?(f=i+(i-n),p=o+(o-l)):(f=i,p=o);const m=i+2*(f-i)/3,y=o+2*(p-o)/3,x=d+2*(f-d)/3,C=u+2*(p-u)/3;t.push({key:"C",data:[m,y,x,C,d,u]}),n=f,l=p,i=d,o=u;break}case"Q":{const[d,u,f,p]=h,m=i+2*(d-i)/3,y=o+2*(u-o)/3,x=f+2*(d-f)/3,C=p+2*(u-p)/3;t.push({key:"C",data:[m,y,x,C,f,p]}),n=d,l=u,i=f,o=p;break}case"A":{const d=Math.abs(h[0]),u=Math.abs(h[1]),f=h[2],p=h[3],m=h[4],y=h[5],x=h[6];d===0||u===0?(t.push({key:"C",data:[i,o,y,x,y,x]}),i=y,o=x):(i!==y||o!==x)&&(Fm(i,o,y,x,d,u,f,p,m).forEach((function(C){t.push({key:"C",data:C})})),i=y,o=x);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function Qi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Fm(e,t,r,i,o,s,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let u=[],f=0,p=0,m=0,y=0;if(c)[f,p,m,y]=c;else{[e,t]=Qi(e,t,-h),[r,i]=Qi(r,i,-h);const q=(e-r)/2,N=(t-i)/2;let A=q*q/(o*o)+N*N/(s*s);A>1&&(A=Math.sqrt(A),o*=A,s*=A);const F=o*o,P=s*s,O=F*P-F*N*N-P*q*q,$=F*N*N+P*q*q,j=(n===l?-1:1)*Math.sqrt(Math.abs(O/$));m=j*o*N/s+(e+r)/2,y=j*-s*q/o+(t+i)/2,f=Math.asin(parseFloat(((t-y)/s).toFixed(9))),p=Math.asin(parseFloat(((i-y)/s).toFixed(9))),e<m&&(f=Math.PI-f),r<m&&(p=Math.PI-p),f<0&&(f=2*Math.PI+f),p<0&&(p=2*Math.PI+p),l&&f>p&&(f-=2*Math.PI),!l&&p>f&&(p-=2*Math.PI)}let x=p-f;if(Math.abs(x)>120*Math.PI/180){const q=p,N=r,A=i;p=l&&p>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,u=Fm(r=m+o*Math.cos(p),i=y+s*Math.sin(p),N,A,o,s,a,0,l,[p,q,m,y])}x=p-f;const C=Math.cos(f),k=Math.sin(f),S=Math.cos(p),v=Math.sin(p),_=Math.tan(x/4),E=4/3*o*_,B=4/3*s*_,I=[e,t],M=[e+E*k,t-B*C],D=[r+E*v,i-B*S],U=[r,i];if(M[0]=2*I[0]-M[0],M[1]=2*I[1]-M[1],c)return[M,D,U].concat(u);{u=[M,D,U].concat(u);const q=[];for(let N=0;N<u.length;N+=3){const A=Qi(u[N][0],u[N][1],h),F=Qi(u[N+1][0],u[N+1][1],h),P=Qi(u[N+2][0],u[N+2][1],h);q.push([A[0],A[1],F[0],F[1],P[0],P[1]])}return q}}const j_={randOffset:function(e,t){return ct(e,t)},randOffsetWithRange:function(e,t,r){return Us(e,t,r)},ellipse:function(e,t,r,i,o){const s=Mm(r,i,o);return ol(e,t,o,s).opset},doubleLineOps:function(e,t,r,i,o){return gr(e,t,r,i,o,!0)}};function Am(e,t,r,i,o){return{type:"path",ops:gr(e,t,r,i,o)}}function fs(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let s=0;s<i-1;s++)o.push(...gr(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&o.push(...gr(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?Am(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function W_(e,t,r,i,o){return(function(s,a){return fs(s,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function Jc(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=Qo(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:Qo(r[0],1.5*(1+.22*t.roughness),rd(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const n=Qo(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Qo(a,1.5*(1+.22*t.roughness),rd(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function Mm(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),s=2*Math.PI/o;let a=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return a+=ct(a*l,r),n+=ct(n*l,r),{increment:s,rx:a,ry:n}}function ol(e,t,r,i){const[o,s]=id(i.increment,e,t,i.rx,i.ry,1,i.increment*Us(.1,Us(.4,1,r),r),r);let a=Xs(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=id(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=Xs(n,null,r);a=a.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function td(e,t,r,i,o,s,a,n,l){const c=e,h=t;let d=Math.abs(r/2),u=Math.abs(i/2);d+=ct(.01*d,l),u+=ct(.01*u,l);let f=o,p=s;for(;f<0;)f+=2*Math.PI,p+=2*Math.PI;p-f>2*Math.PI&&(f=0,p=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(p-f)/2),x=od(y,c,h,d,u,f,p,1,l);if(!l.disableMultiStroke){const C=od(y,c,h,d,u,f,p,1.5,l);x.push(...C)}return a&&(n?x.push(...gr(c,h,c+d*Math.cos(f),h+u*Math.sin(f),l),...gr(c,h,c+d*Math.cos(p),h+u*Math.sin(p),l)):x.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(f),h+u*Math.sin(f)]})),{type:"path",ops:x}}function ed(e,t){const r=Em(Lm(Bh(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...gr(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,d,u,f]=n;i.push(...H_(l,c,h,d,u,f,s,t)),s=[u,f];break}case"Z":i.push(...gr(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function Za(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+ct(o,t),i[0][1]+ct(o,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[i[a][0]+ct(o,t),i[a][1]+ct(o,t)]})}}return{type:"fillPath",ops:r}}function Kr(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!he[o])switch(o){case"zigzag":he[o]||(he[o]=new R_(i));break;case"cross-hatch":he[o]||(he[o]=new I_(i));break;case"dots":he[o]||(he[o]=new P_(i));break;case"dashed":he[o]||(he[o]=new D_(i));break;case"zigzag-line":he[o]||(he[o]=new N_(i));break;default:o="hachure",he[o]||(he[o]=new _h(i))}return he[o]})(t,j_).fillPolygons(e,t)}function rd(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function $m(e){return e.randomizer||(e.randomizer=new q_(e.seed||0)),e.randomizer.next()}function Us(e,t,r,i=1){return r.roughness*i*($m(r)*(t-e)+e)}function ct(e,t,r=1){return Us(-e,e,t,r)}function gr(e,t,r,i,o,s=!1){const a=s?o.disableMultiStrokeFill:o.disableMultiStroke,n=sl(e,t,r,i,o,!0,!1);if(a)return n;const l=sl(e,t,r,i,o,!0,!0);return n.concat(l)}function sl(e,t,r,i,o,s,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=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,u=.2+.2*$m(o);let f=o.bowing*o.maxRandomnessOffset*(i-t)/200,p=o.bowing*o.maxRandomnessOffset*(e-r)/200;f=ct(f,o,c),p=ct(p,o,c);const m=[],y=()=>ct(d,o,c),x=()=>ct(h,o,c),C=o.preserveVertices;return a?m.push({op:"move",data:[e+(C?0:y()),t+(C?0:y())]}):m.push({op:"move",data:[e+(C?0:ct(h,o,c)),t+(C?0:ct(h,o,c))]}),a?m.push({op:"bcurveTo",data:[f+e+(r-e)*u+y(),p+t+(i-t)*u+y(),f+e+2*(r-e)*u+y(),p+t+2*(i-t)*u+y(),r+(C?0:y()),i+(C?0:y())]}):m.push({op:"bcurveTo",data:[f+e+(r-e)*u+x(),p+t+(i-t)*u+x(),f+e+2*(r-e)*u+x(),p+t+2*(i-t)*u+x(),r+(C?0:x()),i+(C?0:x())]}),m}function Qo(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+ct(t,r),e[0][1]+ct(t,r)]),i.push([e[0][0]+ct(t,r),e[0][1]+ct(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+ct(t,r),e[o][1]+ct(t,r)]),o===e.length-1&&i.push([e[o][0]+ct(t,r),e[o][1]+ct(t,r)]);return Xs(i,null,r)}function Xs(e,t,r){const i=e.length,o=[];if(i>3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];s[0]=[l[0],l[1]],s[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],s[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],s[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...sl(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function id(e,t,r,i,o,s,a,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+o*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const h=ct(.5,n)-Math.PI/2;c.push([ct(s,n)+t+.9*i*Math.cos(h-e),ct(s,n)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let u=h;u<d;u+=e){const f=[ct(s,n)+t+i*Math.cos(u),ct(s,n)+r+o*Math.sin(u)];l.push(f),c.push(f)}c.push([ct(s,n)+t+i*Math.cos(h+2*Math.PI+.5*a),ct(s,n)+r+o*Math.sin(h+2*Math.PI+.5*a)]),c.push([ct(s,n)+t+.98*i*Math.cos(h+a),ct(s,n)+r+.98*o*Math.sin(h+a)]),c.push([ct(s,n)+t+.9*i*Math.cos(h+.5*a),ct(s,n)+r+.9*o*Math.sin(h+.5*a)])}return[c,l]}function od(e,t,r,i,o,s,a,n,l){const c=s+ct(.1,l),h=[];h.push([ct(n,l)+t+.9*i*Math.cos(c-e),ct(n,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([ct(n,l)+t+i*Math.cos(d),ct(n,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),Xs(h,null,l)}function H_(e,t,r,i,o,s,a,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let f=0;f<d;f++)f===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(u?0:ct(c[0],n)),a[1]+(u?0:ct(c[0],n))]}),h=u?[o,s]:[o+ct(c[f],n),s+ct(c[f],n)],l.push({op:"bcurveTo",data:[e+ct(c[f],n),t+ct(c[f],n),r+ct(c[f],n),i+ct(c[f],n),h[0],h[1]]});return l}function Ji(e){return[...e]}function sd(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(Ji(e[0]),Ji(e[1]),Ji(e[2]),Ji(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const s=[],a=1-t;i.push(Ji(o[0]));for(let n=1;n+2<o.length;n++){const l=o[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*o[n+1][0]-a*o[n-1][0])/6,l[1]+(a*o[n+1][1]-a*o[n-1][1])/6],s[2]=[o[n+1][0]+(a*o[n][0]-a*o[n+2][0])/6,o[n+1][1]+(a*o[n][1]-a*o[n+2][1])/6],s[3]=[o[n+1][0],o[n+1][1]],i.push(s[1],s[2],s[3])}}return i}function ps(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function Y_(e,t,r){const i=ps(t,r);if(i===0)return ps(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),ps(e,Br(t,r,o))}function Br(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function al(e,t,r,i){const o=i||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],u=n[l+3];let f=3*h[0]-2*c[0]-u[0];f*=f;let p=3*h[1]-2*c[1]-u[1];p*=p;let m=3*d[0]-2*u[0]-c[0];m*=m;let y=3*d[1]-2*u[1]-c[1];return y*=y,f<m&&(f=m),p<y&&(p=y),f+p})(e,t)<r){const n=e[t+0];o.length?(s=o[o.length-1],a=n,Math.sqrt(ps(s,a))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],u=Br(l,c,.5),f=Br(c,h,.5),p=Br(h,d,.5),m=Br(u,f,.5),y=Br(f,p,.5),x=Br(m,y,.5);al([l,u,m,x],0,r,o),al([x,y,p,d],0,r,o)}var s,a;return o}function U_(e,t){return Gs(e,0,e.length,t)}function Gs(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=Y_(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Gs(e,t,c+1,i,s),Gs(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function Qa(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s<o;s++)al(e,3*s,t,i);return r&&r>0?Gs(i,0,i.length,r):i}const ue="none";class Vs{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,o,s){const a=this._o(s);return this._d("line",[Am(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=W_(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(Za([c],a)):n.push(Kr([c],a))}return a.stroke!==ue&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],l=Mm(i,o,a),c=ol(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=ol(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(Kr([c.estimatedPoints],a));return a.stroke!==ue&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[fs(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],d=td(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const f=td(t,r,i,o,s,a,!0,!1,u);f.type="fillPath",h.push(f)}else h.push((function(u,f,p,m,y,x,C){const k=u,S=f;let v=Math.abs(p/2),_=Math.abs(m/2);v+=ct(.01*v,C),_+=ct(.01*_,C);let E=y,B=x;for(;E<0;)E+=2*Math.PI,B+=2*Math.PI;B-E>2*Math.PI&&(E=0,B=2*Math.PI);const I=(B-E)/C.curveStepCount,M=[];for(let D=E;D<=B;D+=I)M.push([k+v*Math.cos(D),S+_*Math.sin(D)]);return M.push([k+v*Math.cos(B),S+_*Math.sin(B)]),M.push([k,S]),Kr([M],C)})(t,r,i,o,s,a,c));return c.stroke!==ue&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=Jc(t,i);if(i.fill&&i.fill!==ue)if(i.fillStyle==="solid"){const a=Jc(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.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(...Qa(sd([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...Qa(sd(c),10,(1+i.roughness)/2))}a.length&&o.push(Kr([a],i))}return i.stroke!==ue&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=fs(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(Za([t],i)):o.push(Kr([t],i))),i.stroke!==ue&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==ue,a=i.stroke!==ue,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,u){const f=Em(Lm(Bh(h))),p=[];let m=[],y=[0,0],x=[];const C=()=>{x.length>=4&&m.push(...Qa(x,d)),x=[]},k=()=>{C(),m.length&&(p.push(m),m=[])};for(const{key:v,data:_}of f)switch(v){case"M":k(),y=[_[0],_[1]],m.push(y);break;case"L":C(),m.push([_[0],_[1]]);break;case"C":if(!x.length){const E=m.length?m[m.length-1]:y;x.push([E[0],E[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(),!u)return p;const S=[];for(const v of p){const _=U_(v,u);_.length&&S.push(_)}return S})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=ed(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=ed(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(Za(l,i));else o.push(Kr(l,i));return a&&(n?l.forEach((h=>{o.push(fs(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ue};break;case"fillPath":a={d:this.opsToPath(s),stroke:ue,strokeWidth:0,fill:i.fill||ue};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ue,strokeWidth:i,fill:ue}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class X_{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Vs(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.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(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}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,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,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 Jo="http://www.w3.org/2000/svg";class G_{constructor(t,r){this.svg=t,this.gen=new Vs(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(Jo,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(Jo,"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=o.createElementNS(Jo,"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(o,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(Jo,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}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,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,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 X_(e,t),svg:(e,t)=>new G_(e,t),generator:e=>new Vs(e),newSeed:()=>Vs.newSeed()},ht=g(async(e,t,r)=>{let i;const o=t.useHtmlLabels||Ye(kt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Xt(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,Ce(pr(n),kt()),{useHtmlLabels:o,width:t.width||kt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},kt());let d=h.getBBox();const u=(t?.padding??0)/2;if(o){const f=h.children[0],p=yt(h);await gh(f,n),d=f.getBoundingClientRect(),p.attr("width",d.width),p.attr("height",d.height)}return o?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:s,bbox:d,halfPadding:u,label:a}},"labelHelper"),Ja=g(async(e,t,r)=>{const i=r.useHtmlLabels??ee(kt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Oe(o,Ce(pr(t),kt()),{useHtmlLabels:i,width:r.width||kt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const n=r.padding/2;if(ee(kt())){const l=s.children[0],c=yt(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):o.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:o}},"insertLabel"),st=g((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),lt=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 mr(e,t,r,i,o,s){const a=[],l=r-e,c=i-t,h=l/s,d=2*Math.PI/h,u=t+c/2;for(let f=0;f<=50;f++){const p=f/50,m=e+p*l,y=u+o*Math.sin(d*(m-e));a.push({x:m,y})}return a}g(mr,"generateFullSineWavePoints");function Bo(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}g(Bo,"generateCirclePoints");function nl(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 o=t.find(l=>l.getAttribute("fill")!=="none"),s=t.find(l=>l.getAttribute("stroke")!=="none"),a=g((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"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(nl,"mergePaths");var V_=g((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),l=s===0?0:n*o/s,c=n):(o<0&&(a=-a),l=a,c=o===0?0:a*s/o),{x:r+l,y:i+c}},"intersectRect"),Hr=V_,K_=g(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=kt(),n=ee(a);return await Oe(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),lr=K_,yr=g((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),Z_=g(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,n=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=ot(t),u=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),f=Ye(r.flowchart.htmlLabels),p=t.direction==="LR",m=u.insert("g").attr("class","cluster-label swimlane-label"),y=await Oe(m,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let x=y.getBBox();if(f){const q=y.children[0],N=yt(y);x=q.getBoundingClientRect(),N.attr("width",x.width),N.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 S=t.height,v=t.y-S/2,_=t.y+S/2,E=t.x-k/2,B=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:v+S/3,I=p?4:0,M=x.height+2*I;let D,U;if(p){const q=Math.max(M,x.height+2*I),N=E+q,A=Math.max(0,k-q);if(t.look==="handDrawn"){const O=rt.svg(u),$=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),j=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),T=O.rectangle(E,v,q,S,$);D=u.insert(()=>T,":first-child");const W=O.rectangle(N,v,A,S,j);U=u.insert(()=>W,":first-child"),D.select("path:nth-child(2)").attr("style",h.join(";")),D.select("path").attr("style",d.join(";").replace("fill","stroke"))}else D=u.insert("rect",":first-child"),U=u.insert("rect",":first-child"),D.attr("class","swimlane-title").attr("style",c).attr("x",E).attr("y",v).attr("width",q).attr("height",S).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",N).attr("y",v).attr("width",A).attr("height",S).attr("fill","none").attr("stroke",n);const F=E+q/2,P=t.y;m.attr("transform",`translate(${F}, ${P}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{const q=Math.max(0,B-v),N=Math.min(M,q),A=v+N,F=Math.max(0,_-A),P=t.x-k/2;if(t.look==="handDrawn"){const j=rt.svg(u),T=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),W=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),z=j.rectangle(P,v,k,N,T);D=u.insert(()=>z,":first-child");const G=j.rectangle(P,A,k,F,W);U=u.insert(()=>G,":first-child"),D.select("path:nth-child(2)").attr("style",h.join(";")),D.select("path").attr("style",d.join(";").replace("fill","stroke"))}else D=u.insert("rect",":first-child"),U=u.insert("rect",":first-child"),D.attr("class","swimlane-title").attr("style",c).attr("x",P).attr("y",v).attr("width",k).attr("height",N).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",P).attr("y",A).attr("width",k).attr("height",F).attr("fill","none").attr("stroke",n);const O=t.x-x.width/2,$=v+(N-x.height)/2;m.attr("transform",`translate(${O}, ${$})`)}if(V.trace("Swimlane data ",t,JSON.stringify(t)),l){const q=m.select("span");q&&q.attr("style",l)}return t.offsetX=0,t.width=k,t.height=S,t.offsetY=x.height-C/2,t.intersect=function(q){return Hr(t,q)},{cluster:u,labelBBox:x}},"swimlane"),Om=g(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=ot(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=ee(r),f=d.insert("g").attr("class","cluster-label ");let p;t.labelType==="markdown"?p=await Oe(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width}):p=await lr(f,t.label,t.labelStyle||"",!1,!0);let m=p.getBBox();if(ee(r)){const E=p.children[0],B=yt(p);m=E.getBoundingClientRect(),B.attr("width",m.width),B.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 S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),I=E.path(yr(C,k,y,x,0),B);S=d.insert(()=>(V.debug("Rough node insert CXC",I),I),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.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:v}=ya(r);if(f.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=f.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Hr(t,E)},{cluster:d,labelBBox:m}},"rect"),Q_=g((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return Hr(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),J_=g(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,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 u=c.append("rect");const f=await lr(d,t.label,t.labelStyle,void 0,!0);let p=f.getBBox();if(ee(r)){const I=f.children[0],M=yt(f);p=I.getBoundingClientRect(),M.attr("width",p.width),M.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,S=t.x-x/2,v=t.y-C/2;t.width=x;const _=t.y-t.height/2-y+p.height+2;let E;if(t.look==="handDrawn"){const I=t.cssClasses.includes("statediagram-cluster-alt"),M=rt.svg(c),D=t.rx||t.ry?M.path(yr(S,v,x,C,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):M.rectangle(S,v,x,C,{seed:o});E=c.insert(()=>D,":first-child");const U=M.rectangle(S,_,x,k,{fill:I?s:a,fillStyle:I?"hachure":"solid",stroke:l,seed:o});E=c.insert(()=>D,":first-child"),u=c.insert(()=>U)}else E=h.insert("rect",":first-child"),E.attr("class","outer").attr("x",S).attr("y",v).attr("width",x).attr("height",C).attr("data-look",t.look),u.attr("class","inner").attr("x",S).attr("y",_).attr("width",x).attr("height",k);d.attr("transform",`translate(${t.x-p.width/2}, ${v+1-(ee(r)?0:3)})`);const B=E.node().getBBox();return t.height=B.height,t.offsetX=0,t.offsetY=p.height-t.padding/2,t.labelBBox=p,t.intersect=function(I){return Hr(t,I)},{cluster:c,labelBBox:p}},"roundedWithTitle"),tB=g(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=ot(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=ee(r),f=d.insert("g").attr("class","cluster-label "),p=await Oe(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let m=p.getBBox();if(ee(r)){const E=p.children[0],B=yt(p);m=E.getBoundingClientRect(),B.attr("width",m.width),B.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 S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),I=E.path(yr(C,k,y,x,t.rx),B);S=d.insert(()=>(V.debug("Rough node insert CXC",I),I),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.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:v}=ya(r);if(f.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=f.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Hr(t,E)},{cluster:d,labelBBox:m}},"kanbanSection"),eB=g((e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=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,u=t.y-h/2;t.width=c;let f;if(t.look==="handDrawn"){const y=rt.svg(a).rectangle(d,u,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});f=a.insert(()=>y,":first-child")}else{f=n.insert("rect",":first-child");let m="outer";t.look,m="divider",f.attr("class",m).attr("x",d).attr("y",u).attr("width",c).attr("height",h).attr("data-look",t.look)}const p=f.node().getBBox();return t.height=p.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Hr(t,m)},{cluster:a,labelBBox:{}}},"divider"),rB=Om,iB={rect:Om,squareRect:rB,roundedWithTitle:J_,noteGroup:Q_,divider:eB,kanbanSection:tB,swimlane:Z_},Rm=new Map,Im=g(async(e,t)=>{const r=t.shape||"rect",i=await iB[r](e,t);return Rm.set(t.id,i),i},"insertCluster"),oB=g(()=>{Rm=new Map},"clear");function Pm(e,t){return e.intersect(t)}g(Pm,"intersectNode");var sB=Pm;function Dm(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x<o&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<s&&(h=-h),{x:o+c,y:s+h}}g(Dm,"intersectEllipse");var Nm=Dm;function qm(e,t,r){return Nm(e,t,t,r)}g(qm,"intersectCircle");var aB=qm;function zm(e,t,r,i){{const o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,n=o*r.x+s*r.y+a,l=o*i.x+s*i.y+a,c=1e-6;if(n!==0&&l!==0&&ll(n,l))return;const h=i.y-r.y,d=r.x-i.x,u=i.x*r.y-r.x*i.y,f=h*e.x+d*e.y+u,p=h*t.x+d*t.y+u;if(Math.abs(f)<c&&Math.abs(p)<c&&ll(f,p))return;const m=o*d-h*s;if(m===0)return;const y=Math.abs(m/2);let x=s*u-d*a;const C=x<0?(x-y)/m:(x+y)/m;x=h*a-o*u;const k=x<0?(x-y)/m:(x+y)/m;return{x:C,y:k}}}g(zm,"intersectLine");function ll(e,t){return e*t>0}g(ll,"sameSign");var nB=zm;function jm(e,t,r){let i=e.x,o=e.y,s=[],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=o-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],u=t[h<t.length-1?h+1:0],f=nB(e,r,{x:l+d.x,y:c+d.y},{x:l+u.x,y:c+u.y});f&&s.push(f)}return s.length?(s.length>1&&s.sort(function(h,d){let u=h.x-r.x,f=h.y-r.y,p=Math.sqrt(u*u+f*f),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}),s[0]):e}g(jm,"intersectPolygon");var lB=jm,tt={node:sB,circle:aB,ellipse:Nm,polygon:lB,rect:Hr};function Wm(e,t){const{labelStyles:r}=ot(t);t.labelStyle=r;const i=lt(t);let o=i;i||(o="anchor");const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,l=rt.svg(s),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=s.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Xt(n)),st(t,d),t.intersect=function(u){return V.info("Circle intersect",t,a,u),tt.circle(t,a,u)},s}g(Wm,"anchor");function hl(e,t,r,i,o,s,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,u=(i-t)/2,f=d/o,p=u/s,m=Math.sqrt(f**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*s*Math.sin(h)*(a?-1:1),C=c-y*o*Math.cos(h)*(a?-1:1),k=Math.atan2((t-C)/s,(e-x)/o);let v=Math.atan2((i-C)/s,(r-x)/o)-k;a&&v<0&&(v+=2*Math.PI),!a&&v>0&&(v-=2*Math.PI);const _=[];for(let E=0;E<20;E++){const B=E/19,I=k+B*v,M=x+o*Math.cos(I),D=C+s*Math.sin(I);_.push({x:M,y:D})}return _}g(hl,"generateArcPoints");function Hm(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}g(Hm,"calculateArcSagitta");async function Ym(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=g(I=>I+a,"calcTotalHeight"),l=g(I=>{const M=I/2;return[M/(2.5+I/50),M]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await ht(e,t,lt(t)),d=n(t?.height?t?.height:h.height),[u,f]=l(d),p=Hm(d,u,f),y=(t?.width?t?.width:h.width)+s*2+p-p,x=d,{cssStyles:C}=t,k=[{x:y/2,y:-x/2},{x:-y/2,y:-x/2},...hl(-y/2,-x/2,-y/2,x/2,u,f,!1),{x:y/2,y:x/2},...hl(y/2,x/2,y/2,-x/2,u,f,!0)],S=rt.svg(c),v=et(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=bt(k),E=S.path(_,v),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${u/2}, 0)`),st(t,B),t.intersect=function(I){return tt.polygon(t,k,I)},c}g(Ym,"bowTieRect");function or(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}g(or,"insertPolygonShape");var ts=12;async function Um(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+ts),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,u=c,f=-h,p=0,m=[{x:d+ts,y:f},{x:u,y:f},{x:u,y:p},{x:d,y:p},{x:d,y:f+ts},{x:d+ts,y:f}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(n),k=et(t,{}),S=bt(m),v=C.path(S,k);y=n.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),x&&y.attr("style",x)}else y=or(n,c,h,m);return i&&y.attr("style",i),st(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},n}g(Um,"card");function Xm(e,t){const{nodeStyles:r}=ot(t);t.label="";const i=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/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 o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(u){return tt.polygon(t,a,u)},i}g(Xm,"choice");async function Lh(e,t,r){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await ht(e,t,lt(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(s),p=et(t,{}),m=f.circle(0,0,h*2,p);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Xt(u))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return st(t,d),t.calcIntersect=function(f,p){const m=f.width/2;return tt.circle(f,m,p)},t.intersect=function(f){return V.info("Circle intersect",t,h,f),tt.circle(t,h,f)},s}g(Lh,"circle");function Gm(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={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 ${s.x},${s.y} L ${n.x},${n.y}
|
|
233
|
+
M ${o.x},${o.y} L ${a.x},${a.y}`}g(Gm,"createLine");function Vm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=rt.svg(o),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=Gm(s),d=n.path(h,l),u=o.insert(()=>c,":first-child");return u.insert(()=>d),u.attr("class","outer-path"),a&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",i),st(t,u),t.intersect=function(f){return V.info("crossedCircle intersect",t,{radius:s,point:f}),tt.circle(t,s,f)},o}g(Vm,"crossedCircle");function Ke(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}g(Ke,"generateCirclePoints");async function Km(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+n,h=s.height+l,d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...Ke(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Ke(c/2+d*2,-d,d,20,-180,-270),...Ke(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Ke(c/2,h/2,d,20,0,90)],p=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Ke(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Ke(c/2+c*.1,-d,d,20,-180,-270),...Ke(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Ke(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(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(f).replace("Z",""),k=m.path(C,y),S=bt(p),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),u&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,p,E)},o}g(Km,"curlyBraceLeft");function Ze(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:f,y:p})}return a}g(Ze,"generateCirclePoints");async function Zm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...Ze(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Ze(c/2+d*2,-d,d,20,-180,-270),...Ze(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Ze(c/2,h/2,d,20,0,90)],p=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...Ze(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Ze(c/2+d*2,-d,d,20,-180,-270),...Ze(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Ze(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(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(f).replace("Z",""),k=m.path(C,y),S=bt(p),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>k,":first-child"),_.attr("class","text"),u&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,p,E)},o}g(Zm,"curlyBraceRight");function Kt(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}g(Kt,"generateCirclePoints");async function Qm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...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(o),x=et(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=bt(f).replace("Z",""),S=y.path(k,x),_=bt(p).replace("Z",""),E=y.path(_,x),B=bt(m),I=y.path(B,{...x}),M=o.insert("g",":first-child");return M.insert(()=>I,":first-child").attr("stroke-opacity",0),M.insert(()=>S,":first-child"),M.insert(()=>E,":first-child"),M.attr("class","text"),u&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),M.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),st(t,M),t.intersect=function(D){return tt.polygon(t,m,D)},o}g(Qm,"curlyBraces");async function Jm(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await ht(e,t,lt(t)),d=Math.max(n,(h.width+s*2)*1.25,t?.width??0),u=Math.max(l,h.height+a*2,t?.height??0),f=u/2,{cssStyles:p}=t,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=d,C=u,k=x-f,S=C/4,v=[{x:k,y:0},{x:S,y:0},{x:0,y:C/2},{x:S,y:C},{x:k,y:C},...Bo(-k,-C/2,f,50,270,90)],_=bt(v),E=m.path(_,y),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.attr("transform",`translate(${-d/2}, ${-u/2})`),st(t,B),t.intersect=function(I){return tt.polygon(t,v,I)},c}g(Jm,"curvedTrapezoid");var hB=g((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),cB=g((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),dB=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),ad=8,nd=8;async function ty(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.width<nd&&(t.width=nd);const C=y/2/(2.5+y/50);t.height=(t.height??0)-s-C*3,t.height<ad&&(t.height=ad)}const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t.width?t.width:l.width)+a,d=h/2,u=d/(2.5+h/50),f=(t.height?t.height:l.height)+s+u;let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=rt.svg(n),x=cB(0,0,h,f,d,u),C=dB(0,u,h,f,d,u),k=et(t,{}),S=y.path(x,k),v=y.path(C,et(t,{fill:"none"}));p=n.insert(()=>v,":first-child"),p=n.insert(()=>S,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{const y=hB(0,0,h,f,d,u);p=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Xt(m)).attr("style",i)}return p.attr("label-offset-y",u),p.attr("transform",`translate(${-h/2}, ${-(f/2+u)})`),st(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-u)){let k=u*u*(1-C*C/(d*d));k>0&&(k=Math.sqrt(k)),k=u-k,y.y-(t.y??0)>0&&(k=-k),x.y+=k}return x},n}g(ty,"cylinder");async function zi(e,t,r){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{shapeSvg:s,bbox:a}=await ht(e,t,lt(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:u,ry:f}=t;const{cssStyles:p}=t;if(r?.rx&&r.ry&&(u=r.rx,f=r.ry),t.look==="handDrawn"){const m=rt.svg(s),y=et(t,{}),x=u||f?m.path(yr(c,h,n,l,u||0),y):m.rectangle(c,h,n,l,y);d=s.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",Xt(p))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Xt(u)).attr("ry",Xt(f)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return st(t,d),t.calcIntersect=function(m,y){return tt.rect(m,y)},t.intersect=function(m){return tt.rect(t,m)},s}g(zi,"drawRect");async function ey(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await zi(e,t,l);if(t.look==="handDrawn"){const f=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(()=>f.line(x.x,x.y,x.x+x.width,x.y,p),".basic.label-container g.label"),c.insert(()=>f.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,u=(Number(h.attr("height"))||n)??0;return d>0&&u>0&&h.attr("stroke-dasharray",`${d} ${u}`),c}g(ey,"datastore");async function ry(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=n.width+o,h=n.height+s,d=h*.2,u=-c/2,f=-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:u,y:f+d},{x:-u,y:f+d},{x:-u,y:-f},{x:u,y:-f},{x:u,y:f},{x:-u,y:f},{x:-u,y:f+d}],C=m.polygon(x.map(S=>[S.x,S.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(${u+(t.padding??0)/2-(n.x-(n.left??0))}, ${f+d+(t.padding??0)/2-(n.y-(n.top??0))})`),st(t,k),t.intersect=function(S){return tt.rect(t,S)},a}g(ry,"dividedRectangle");async function iy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=rt.svg(n),p=et(t,{roughness:.2,strokeWidth:2.5}),m=et(t,{roughness:.2,strokeWidth:1.5}),y=f.circle(0,0,c*2,p),x=f.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",Xt(t.cssClasses)).attr("style",Xt(u)),d.node()?.appendChild(y),d.node()?.appendChild(x)}else{d=n.insert("g",":first-child");const f=d.insert("circle",":first-child"),p=d.insert("circle");d.attr("class","basic label-container").attr("style",i),f.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 st(t,d),t.intersect=function(f){return V.info("DoubleCircle intersect",t,c,f),tt.circle(t,c,f)},n}g(iy,"doublecircle");function oy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=rt.svg(s),{nodeBorder:c}=r,h=et(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),u=s.insert(()=>d,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",o),st(t,u),t.intersect=function(f){return V.info("filledCircle intersect",t,{radius:a,point:f}),tt.circle(t,a,f)},s}g(oy,"filledCircle");var ld=10,hd=10;async function sy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<ld&&(t.height=ld),t.width=(t?.width??0)-s-s/2,t.width<hd&&(t.width=hd));const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width:n.width)+(s??0),h=t?.height?t?.height:c+n.height,d=h,u=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:f}=t,p=rt.svg(a),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=bt(u),x=p.path(y,m),C=a.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return f&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),t.width=c,t.height=h,st(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,u,k),tt.polygon(t,u,k)},a}g(sy,"flippedTriangle");function ay(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=ot(t);t.label="";const a=e.insert("g").attr("class",lt(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,u=rt.svg(a),f=et(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const p=u.rectangle(h,d,l,c,f),m=a.insert(()=>p,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),st(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(ay,"forkJoin");async function ny(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=15,s=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<s&&(t.height=s),t.width=(t?.width??0)-a*2,t.width<o&&(t.width=o));const{shapeSvg:l,bbox:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:Math.max(o,c.width))+a*2,d=(t?.height?t?.height:Math.max(s,c.height))+n*2,u=d/2,{cssStyles:f}=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-u,y:-d/2},...Bo(-h/2+u,0,u,50,90,270),{x:h/2-u,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"),f&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),st(t,k),t.intersect=function(S){return V.info("Pill intersect",t,{radius:u,point:S}),tt.polygon(t,y,S)},l}g(ny,"halfRoundedRectangle");var uB=g((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function ly(e,t){const{labelStyles:r,nodeStyles:i}=ot(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,l=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const k=(t.height??0)/o;t.width=(t?.width??0)-2*k-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await ht(e,t,lt(t)),u=(t?.height?t?.height:d.height)+l,f=u/o,p=(t?.width?t?.width:d.width)+2*f+c,m=[{x:f,y:0},{x:p-f,y:0},{x:p,y:-u/2},{x:p-f,y:-u},{x:f,y:-u},{x:0,y:-u/2}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(h),k=et(t,{}),S=uB(0,0,p,u,f),v=C.path(S,k);y=h.insert(()=>v,":first-child").attr("transform",`translate(${-p/2}, ${u/2})`),x&&y.attr("style",x)}else y=or(h,p,u,m);return i&&y.attr("style",i),t.width=p,t.height=u,st(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},h}g(ly,"hexagon");async function hy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await ht(e,t,lt(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=rt.svg(o),c=et(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=bt(h),u=l.path(d,c),f=o.insert(()=>u,":first-child");return f.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",i),f.attr("transform",`translate(${-s/2}, ${-a/2})`),st(t,f),t.intersect=function(p){return V.info("Pill intersect",t,{points:h}),tt.polygon(t,h,p)},o}g(hy,"hourglass");async function cy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await ht(e,t,"icon-shape default"),u=t.pos==="t",f=n,p=n,{nodeBorder:m}=r,{stylesMap:y}=Ni(t),x=-p/2,C=-f/2,k=t.label?8:0,S=rt.svg(c),v=et(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=S.rectangle(x,C,p,f,v),E=Math.max(p,h.width),B=f+h.height+k,I=S.rectangle(-E/2,-B/2,E,B,{...v,fill:"transparent",stroke:"none"}),M=c.insert(()=>_,":first-child"),D=c.insert(()=>I);if(t.icon){const U=c.append("g");U.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const q=U.node().getBBox(),N=q.width,A=q.height,F=q.x,P=q.y;U.attr("transform",`translate(${-N/2-F},${u?h.height/2+k/2-A/2-P:-h.height/2-k/2-A/2-P})`),U.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-B/2:B/2-h.height})`),M.attr("transform",`translate(0,${u?h.height/2+k/2:-h.height/2-k/2})`),st(t,D),t.intersect=function(U){if(V.info("iconSquare intersect",t,U),!t.label)return tt.rect(t,U);const q=t.x??0,N=t.y??0,A=t.height??0;let F=[];return u?F=[{x:q-h.width/2,y:N-A/2},{x:q+h.width/2,y:N-A/2},{x:q+h.width/2,y:N-A/2+h.height+k},{x:q+p/2,y:N-A/2+h.height+k},{x:q+p/2,y:N+A/2},{x:q-p/2,y:N+A/2},{x:q-p/2,y:N-A/2+h.height+k},{x:q-h.width/2,y:N-A/2+h.height+k}]:F=[{x:q-p/2,y:N-A/2},{x:q+p/2,y:N-A/2},{x:q+p/2,y:N-A/2+f},{x:q+h.width/2,y:N-A/2+f},{x:q+h.width/2/2,y:N+A/2},{x:q-h.width/2,y:N+A/2},{x:q-h.width/2,y:N-A/2+f},{x:q-p/2,y:N-A/2+f}],tt.polygon(t,F,U)},c}g(cy,"icon");async function dy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await ht(e,t,"icon-shape default"),u=20,f=t.label?8:0,p=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Ni(t),C=rt.svg(c),k=et(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const S=x.get("fill");k.stroke=S??y;const v=c.append("g");t.icon&&v.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const _=v.node().getBBox(),E=_.width,B=_.height,I=_.x,M=_.y,D=Math.max(E,B)*Math.SQRT2+u*2,U=C.circle(0,0,D,k),q=Math.max(D,h.width),N=D+h.height+f,A=C.rectangle(-q/2,-N/2,q,N,{...k,fill:"transparent",stroke:"none"}),F=c.insert(()=>U,":first-child"),P=c.insert(()=>A);return v.attr("transform",`translate(${-E/2-I},${p?h.height/2+f/2-B/2-M:-h.height/2-f/2-B/2-M})`),v.attr("style",`color: ${x.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-N/2:N/2-h.height})`),F.attr("transform",`translate(0,${p?h.height/2+f/2:-h.height/2-f/2})`),st(t,P),t.intersect=function(O){return V.info("iconSquare intersect",t,O),tt.rect(t,O)},c}g(dy,"iconCircle");async function uy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await ht(e,t,"icon-shape default"),f=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ni(t),k=-m/2,S=-p/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const I=_.path(yr(k,S,m,p,5),E),M=Math.max(m,h.width),D=p+h.height+v,U=_.rectangle(-M/2,-D/2,M,D,{...E,fill:"transparent",stroke:"none"}),q=c.insert(()=>I,":first-child").attr("class","icon-shape2"),N=c.insert(()=>U);if(t.icon){const A=c.append("g");A.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const F=A.node().getBBox(),P=F.width,O=F.height,$=F.x,j=F.y;A.attr("transform",`translate(${-P/2-$},${f?h.height/2+v/2-O/2-j:-h.height/2-v/2-O/2-j})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-D/2:D/2-h.height})`),q.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),st(t,N),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const F=t.x??0,P=t.y??0,O=t.height??0;let $=[];return f?$=[{x:F-h.width/2,y:P-O/2},{x:F+h.width/2,y:P-O/2},{x:F+h.width/2,y:P-O/2+h.height+v},{x:F+m/2,y:P-O/2+h.height+v},{x:F+m/2,y:P+O/2},{x:F-m/2,y:P+O/2},{x:F-m/2,y:P-O/2+h.height+v},{x:F-h.width/2,y:P-O/2+h.height+v}]:$=[{x:F-m/2,y:P-O/2},{x:F+m/2,y:P-O/2},{x:F+m/2,y:P-O/2+p},{x:F+h.width/2,y:P-O/2+p},{x:F+h.width/2/2,y:P+O/2},{x:F-h.width/2,y:P+O/2},{x:F-h.width/2,y:P-O/2+p},{x:F-m/2,y:P-O/2+p}],tt.polygon(t,$,A)},c}g(uy,"iconRounded");async function fy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ot(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await ht(e,t,"icon-shape default"),f=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Ni(t),k=-m/2,S=-p/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const I=_.path(yr(k,S,m,p,.1),E),M=Math.max(m,h.width),D=p+h.height+v,U=_.rectangle(-M/2,-D/2,M,D,{...E,fill:"transparent",stroke:"none"}),q=c.insert(()=>I,":first-child"),N=c.insert(()=>U);if(t.icon){const A=c.append("g");A.html(`<g>${await qi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const F=A.node().getBBox(),P=F.width,O=F.height,$=F.x,j=F.y;A.attr("transform",`translate(${-P/2-$},${f?h.height/2+v/2-O/2-j:-h.height/2-v/2-O/2-j})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-D/2:D/2-h.height})`),q.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),st(t,N),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const F=t.x??0,P=t.y??0,O=t.height??0;let $=[];return f?$=[{x:F-h.width/2,y:P-O/2},{x:F+h.width/2,y:P-O/2},{x:F+h.width/2,y:P-O/2+h.height+v},{x:F+m/2,y:P-O/2+h.height+v},{x:F+m/2,y:P+O/2},{x:F-m/2,y:P+O/2},{x:F-m/2,y:P-O/2+h.height+v},{x:F-h.width/2,y:P-O/2+h.height+v}]:$=[{x:F-m/2,y:P-O/2},{x:F+m/2,y:P-O/2},{x:F+m/2,y:P-O/2+p},{x:F+h.width/2,y:P-O/2+p},{x:F+h.width/2/2,y:P+O/2},{x:F-h.width/2,y:P+O/2},{x:F-h.width/2,y:P-O/2+p},{x:F-m/2,y:P-O/2+p}],tt.polygon(t,$,A)},c}g(fy,"iconSquare");async function py(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=ot(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:u,label:f}=await ht(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 S=C.rectangle(m,y,c,h,k),v=Math.max(c,u.width),_=h+u.height+x,E=C.rectangle(-v/2,-_/2,v,_,{...k,fill:"none",stroke:"none"}),B=d.insert(()=>S,":first-child"),I=d.insert(()=>E);if(t.img){const M=d.append("image");M.attr("href",t.img),M.attr("width",c),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-c/2},${p?_/2-h:-_/2})`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${p?-h/2-u.height/2-x/2:h/2-u.height/2+x/2})`),B.attr("transform",`translate(0,${p?u.height/2+x/2:-u.height/2-x/2})`),st(t,I),t.intersect=function(M){if(V.info("iconSquare intersect",t,M),!t.label)return tt.rect(t,M);const D=t.x??0,U=t.y??0,q=t.height??0;let N=[];return p?N=[{x:D-u.width/2,y:U-q/2},{x:D+u.width/2,y:U-q/2},{x:D+u.width/2,y:U-q/2+u.height+x},{x:D+c/2,y:U-q/2+u.height+x},{x:D+c/2,y:U+q/2},{x:D-c/2,y:U+q/2},{x:D-c/2,y:U-q/2+u.height+x},{x:D-u.width/2,y:U-q/2+u.height+x}]:N=[{x:D-c/2,y:U-q/2},{x:D+c/2,y:U-q/2},{x:D+c/2,y:U-q/2+h},{x:D+u.width/2,y:U-q/2+h},{x:D+u.width/2/2,y:U+q/2},{x:D-u.width/2,y:U+q/2},{x:D-u.width/2,y:U-q/2+h},{x:D-c/2,y:U-q/2+h}],tt.polygon(t,N,M)},d}g(py,"imageSquare");async function gy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=Math.max(l.width+(a??0)*2,t?.width??0),h=Math.max(l.height+(s??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 u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),f&&u.attr("style",f)}else u=or(n,c,h,d);return i&&u.attr("style",i),t.width=c,t.height=h,st(t,u),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(gy,"inv_trapezoid");async function my(e,t){const{shapeSvg:r,bbox:i,label:o}=await ht(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),st(t,s),t.intersect=function(l){return tt.rect(t,l)},r}g(my,"labelRect");async function yy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height??l.height)+s,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 u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=or(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,st(t,u),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(yy,"lean_left");async function xy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height??l.height)+s,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 u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=or(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,st(t,u),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(xy,"lean_right");function Cy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",lt(t)).attr("id",t.domId??t.id),{cssStyles:s}=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(o),d=et(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=bt(c),f=h.path(u,d),p=o.insert(()=>f,":first-child");return p.attr("class","outer-path"),s&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),p.attr("transform",`translate(-${a/2},${-n})`),st(t,p),t.intersect=function(m){return V.info("lightningBolt intersect",t,m),tt.polygon(t,c,m)},o}g(Cy,"lightningBolt");var fB=g((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),pB=g((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),gB=g((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),cd=10,dd=10;async function by(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const x=t.width??0;t.width=(t.width??0)-s,t.width<dd&&(t.width=dd);const k=x/2/(2.5+x/50);t.height=(t.height??0)-a-k*3,t.height<cd&&(t.height=cd)}const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+s*2,d=h/2,u=d/(2.5+h/50),f=(t?.height?t?.height:l.height)+u+a*2,p=f*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=rt.svg(n),C=pB(0,0,h,f,d,u,p),k=gB(0,u,h,f,d,u),S=et(t,{}),v=x.path(C,S),_=x.path(k,S);n.insert(()=>_,":first-child").attr("class","line"),m=n.insert(()=>v,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=fB(0,0,h,f,d,u,p);m=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",Xt(y)).attr("style",i)}return m.attr("label-offset-y",u),m.attr("transform",`translate(${-h/2}, ${-(f/2+u)})`),st(t,m),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+u-(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-u)){let S=u*u*(1-k*k/(d*d));S>0&&(S=Math.sqrt(S)),S=u-S,x.y-(t.y??0)>0&&(S=-S),C.y+=S}return C},n}g(by,"linedCylinder");async function ky(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const S=t.width;t.width=(S??0)*10/11-s*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 ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+(s??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,u=t.look==="neo"?d/4:d/8,f=d+u,{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:-f/2},{x:-h/2-h/2*.1,y:f/2},...mr(-h/2-h/2*.1,f/2,h/2+h/2*.1,f/2,u,.8),{x:h/2+h/2*.1,y:-f/2},{x:-h/2-h/2*.1,y:-f/2},{x:-h/2,y:-f/2},{x:-h/2,y:f/2*1.1},{x:-h/2,y:-f/2}],C=m.polygon(x.map(S=>[S.x,S.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,${-u/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-u/2-(l.y-(l.top??0))})`),st(t,k),t.intersect=function(S){return tt.polygon(t,x,S)},n}g(ky,"linedWaveEdgedRect");async function wy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await ht(e,t,lt(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,u=(t?.height?t?.height:c.height)+a*2+2*n,f=d-2*n,p=u-2*n,m=-f/2,y=-p/2,{cssStyles:x}=t,C=rt.svg(l),k=et(t,{}),S=[{x:m-n,y:y+n},{x:m-n,y:y+p+n},{x:m+f-n,y:y+p+n},{x:m+f-n,y:y+p},{x:m+f,y:y+p},{x:m+f,y:y+p-n},{x:m+f+n,y:y+p-n},{x:m+f+n,y:y-n},{x:m+n,y:y-n},{x:m+n,y},{x:m,y},{x:m,y:y+n}],v=[{x:m,y:y+n},{x:m+f-n,y:y+n},{x:m+f-n,y:y+p},{x:m+f,y:y+p},{x:m+f,y},{x:m,y}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=bt(S);let E=C.path(_,k);const B=bt(v);let I=C.path(B,k);t.look!=="handDrawn"&&(E=nl(E),I=nl(I));const M=l.insert("g",":first-child");return M.insert(()=>E),M.insert(()=>I),M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&M.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))})`),st(t,M),t.intersect=function(D){return tt.polygon(t,S,D)},l}g(wy,"multiRect");async function Sy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(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(s.width,t?.width??0)+l*2,u=Math.max(s.height,t?.height??0)+c*3,f=t.look==="neo"?u/4:u/8,p=u+(h?f/2:-f/2),m=-d/2,y=-p/2,x=10,{cssStyles:C}=t,k=mr(m-x,y+p+x,m+d-x,y+p+x,f,.8),S=k?.[k.length-1],v=[{x:m-x,y:y+x},{x:m-x,y:y+p+x},...k,{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y:S.y-2*x},{x:m+d+x,y:S.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:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y},{x:m,y}],E=rt.svg(o),B=et(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const I=bt(v),M=E.path(I,B),D=bt(_),U=E.path(D,B),q=o.insert(()=>M,":first-child");return q.insert(()=>U),q.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&q.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&q.selectAll("path").attr("style",i),q.attr("transform",`translate(0,${-f/2})`),a.attr("transform",`translate(${-(s.width/2)-x-(s.x-(s.left??0))}, ${-(s.height/2)+x-f/2-(s.y-(s.top??0))})`),st(t,q),t.intersect=function(N){return tt.polygon(t,v,N)},o}g(Sy,"multiWaveEdgedRectangle");async function vy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i,t.useHtmlLabels||ee(Ot())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(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,u=-h/2,{cssStyles:f}=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,u,c,h,m),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),f&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",f),o&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),st(t,x),t.intersect=function(C){return tt.rect(t,C)},a}g(vy,"note");var mB=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 Ty(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ht(e,t,lt(t)),a=s.width+(t.padding??0),n=s.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:u}=t;if(t.look==="handDrawn"){const f=rt.svg(o),p=et(t,{}),m=mB(0,0,l),y=f.path(m,p);d=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),u&&d.attr("style",u)}else d=or(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),st(t,d),t.calcIntersect=function(f,p){const m=f.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(f,y,p);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(f){return this.calcIntersect(t,f)},o}g(Ty,"question");async function _y(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width??l.width)+(t.look==="neo"?s*2:s),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),u=-h/2,f=-d/2,p=f/2,m=[{x:u+p,y:f},{x:u,y:0},{x:u+p,y:-f},{x:-u,y:-f},{x:-u,y:f}],{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=bt(m),S=x.path(k,C),v=n.insert(()=>S,":first-child");return v.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.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))})`),st(t,v),t.intersect=function(_){return tt.polygon(t,m,_)},n}g(_y,"rect_left_inv_arrow");async function By(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await lr(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(ee(kt())){const B=h.children[0],I=yt(h);d=B.getBoundingClientRect(),I.attr("width",d.width),I.attr("height",d.height)}V.info("Text 2",l);const u=l||[],f=h.getBBox(),p=await lr(n,Array.isArray(u)?u.join("<br/>"):u,t.labelStyle,!0,!0),m=p.children[0],y=yt(p);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const x=(t.padding||0)/2;yt(p).attr("transform","translate( "+(d.width>f.width?0:(f.width-d.width)/2)+", "+(f.height+x+5)+")"),yt(h).attr("transform","translate( "+(d.width<f.width?0:-(f.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),S=-d.width/2-x,v=-d.height/2-x;let _,E;if(t.look==="handDrawn"){const B=rt.svg(s),I=et(t,{}),M=B.path(yr(S,v,C,k,t.rx||0),I),D=B.line(-d.width/2-x,-d.height/2-x+f.height+x,d.width/2+x,-d.height/2-x+f.height+x,I);E=s.insert(()=>(V.debug("Rough node insert CXC",M),D),":first-child"),_=s.insert(()=>(V.debug("Rough node insert CXC",M),M),":first-child")}else _=a.insert("rect",":first-child"),E=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)),E.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+f.height+x).attr("y2",-d.height/2-x+f.height+x);return st(t,_),t.intersect=function(B){return tt.rect(t,B)},s}g(By,"rectWithTitle");async function Ly(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return zi(e,t,o)}g(Ly,"roundedRect");var Sr=8;async function Ey(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?Sr:Sr*2),h=(t?.height??n.height)+s*2,d=c-Sr,u=h,f=Sr-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:f,y:p},{x:f+d,y:p},{x:f+d,y:p+u},{x:f-Sr,y:p+u},{x:f-Sr,y:p},{x:f,y:p},{x:f,y:p+u}],k=y.polygon(C.map(v=>[v.x,v.y]),x),S=a.insert(()=>k,":first-child");return S.attr("class","basic label-container outer-path").attr("style",Xt(m)),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${Sr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),st(t,S),t.intersect=function(v){return tt.rect(t,v)},a}g(Ey,"shadedProcess");async function Fy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=(t?.width?t?.width:l.width)+s*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,u=h,f=d/1.5,p=-u/2,m=-f/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+f},{x:p+u,y:m+f},{x:p+u,y:m-f/2}],S=bt(k),v=x.path(S,C),_=n.insert(()=>v,":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, ${f/4})`),c.attr("transform",`translate(${-u/2+(t.padding??0)-(l.x-(l.left??0))}, ${-f/4+(t.padding??0)-(l.y-(l.top??0))})`),st(t,_),t.intersect=function(E){return tt.polygon(t,k,E)},n}g(Fy,"slopedRect");async function Ay(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return zi(e,t,s)}g(Ay,"squareRect");async function My(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:u}=t,f=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},...Bo(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...Bo(h/2-d,0,d,50,270,450)],y=bt(m),x=f.path(y,p),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),st(t,C),t.intersect=function(k){return tt.polygon(t,m,k)},n}g(My,"stadium");async function $y(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return zi(e,t,r)}g($y,"state");function Oy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i;const{cssStyles:s}=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),u=et(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=d.circle(0,0,t.width,{...u,stroke:a,strokeWidth:2}),p=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...u,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),x=h.insert(()=>f,":first-child");if(x.insert(()=>y),t.look!=="handDrawn"&&x.attr("class","outer-path"),s&&x.selectAll("path").attr("style",s),o&&x.selectAll("path").attr("style",o),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 st(t,x),t.intersect=function(C){return tt.circle(t,(t.width??0)/2,C)},h}g(Oy,"stateEnd");function Ry(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=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 s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=rt.svg(s).circle(0,0,t.width,Jv(i));a=s.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=s.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&&o&&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 st(t,a),t.intersect=function(n){return tt.circle(t,(t.width??7)/2,n)},s}g(Ry,"stateStart");var Zr=8;async function Iy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width??l.width)+2*Zr+s,h=(t?.height??l.height)+a,d=c-2*Zr,u=h,f=-c/2,p=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(t.look==="handDrawn"){const y=rt.svg(n),x=et(t,{}),C=y.rectangle(f,p,d+16,u,x),k=y.line(f+Zr,p,f+Zr,p+u,x),S=y.line(f+Zr+d,p,f+Zr+d,p+u,x);n.insert(()=>k,":first-child"),n.insert(()=>S,":first-child");const v=n.insert(()=>C,":first-child"),{cssStyles:_}=t;v.attr("class","basic label-container").attr("style",Xt(_)),st(t,v)}else{const y=or(n,d,u,m);i&&y.attr("style",i),st(t,y)}return t.intersect=function(y){return tt.polygon(t,m,y)},n}g(Iy,"subroutine");var tn=.2;async function Py(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-tn*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height?t?.height:l.height)+a*2,h=tn*c,d=tn*c,f=(t?.width?t?.width:l.width)+s*2+h-h,p=c,m=-f/2,y=-p/2,{cssStyles:x}=t,C=rt.svg(n),k=et(t,{}),S=[{x:m-h/2,y},{x:m+f+h/2,y},{x:m+f+h/2,y:y+p},{x:m-h/2,y:y+p}],v=[{x:m+f-h/2,y:y+p},{x:m+f+h/2,y:y+p},{x:m+f+h/2,y:y+p-d}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const _=bt(S),E=C.path(_,k),B=bt(v),I=C.path(B,{...k,fillStyle:"solid"}),M=n.insert(()=>I,":first-child");return M.insert(()=>E,":first-child"),M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),st(t,M),t.intersect=function(D){return tt.polygon(t,S,D)},n}g(Py,"taggedRect");async function Dy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await ht(e,t,lt(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,u=l+c,{cssStyles:f}=t,p=rt.svg(o),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:u/2},...mr(-n/2-n/2*.1,u/2,n/2+n/2*.1,u/2,c,.8),{x:n/2+n/2*.1,y:-u/2},{x:-n/2-n/2*.1,y:-u/2}],x=-n/2+n/2*.1,C=-u/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},...mr(x+n,(C+l)*1.25,x+n-h,(C+l)*1.3,-l*.02,.5)],S=bt(y),v=p.path(S,m),_=bt(k),E=p.path(_,{...m,fillStyle:"solid"}),B=o.insert(()=>E,":first-child");return B.insert(()=>v,":first-child"),B.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),st(t,B),t.intersect=function(I){return tt.polygon(t,y,I)},o}g(Dy,"taggedWaveEdgedRectangle");async function Ny(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await ht(e,t,lt(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=o.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),st(t,h),t.intersect=function(d){return tt.rect(t,d)},o}g(Ny,"text");var yB=g((e,t,r,i,o,s)=>`M${e},${t}
|
|
234
234
|
a${o},${s} 0,0,1 0,${-i}
|
|
235
235
|
l${r},0
|
|
236
236
|
a${o},${s} 0,0,1 0,${i}
|
|
237
237
|
M${r},${-i}
|
|
238
238
|
a${o},${s} 0,0,0 0,${i}
|
|
239
|
-
l${-r},0`,"createCylinderPathD"),
|
|
239
|
+
l${-r},0`,"createCylinderPathD"),xB=g((e,t,r,i,o,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),CB=g((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),ud=5,fd=10;async function qy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?12:o/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-s,t.height<ud&&(t.height=ud);const x=m/2/(2.5+m/50);t.width=(t.width??0)-s-x*3,t.width<fd&&(t.width=fd)}const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t.height?t.height:n.height)+s,h=c/2,d=h/(2.5+c/50),u=(t.width?t.width:n.width)+d+s,{cssStyles:f}=t;let p;if(t.look==="handDrawn"){const m=rt.svg(a),y=xB(0,0,u,c,d,h),x=CB(0,0,u,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"),f&&p.attr("style",f)}else{const m=yB(0,0,u,c,d,h);p=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Xt(f)).attr("style",i),p.attr("class","basic label-container outer-path"),f&&p.selectAll("path").attr("style",f),i&&p.selectAll("path").attr("style",i)}return p.attr("label-offset-x",d),p.attr("transform",`translate(${-u/2}, ${c/2} )`),l.attr("transform",`translate(${-(n.width/2)-d-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),st(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(qy,"tiltedCylinder");async function zy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.height??l.height)+s,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 u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const p=rt.svg(n),m=et(t,{}),y=bt(d),x=p.path(y,m);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=or(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,st(t,u),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(zy,"trapezoid");async function jy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,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)-s*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await ht(e,t,lt(t)),d=(t?.width?t?.width:h.width)+s*2,u=(t?.height?t?.height:h.height)+a*2,{cssStyles:f}=t,p=rt.svg(c),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-d/2*.8,y:-u/2},{x:d/2*.8,y:-u/2},{x:d/2,y:-u/2*.6},{x:d/2,y:u/2},{x:-d/2,y:u/2},{x:-d/2,y:-u/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"),f&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),st(t,k),t.intersect=function(S){return tt.polygon(t,y,S)},c}g(jy,"trapezoidalPentagon");var pd=10,gd=10;async function Wy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.width<gd&&(t.width=gd),t.height=t?.height??0,t.height<pd&&(t.height=pd));const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=Ye(kt().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+s,d=t?.height?t?.height:h+n.height,u=d,f=[{x:0,y:0},{x:u,y:0},{x:u/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(f),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,st(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(S){return V.info("Triangle intersect",t,f,S),tt.polygon(t,f,S)},a}g(Wy,"triangle");async function Hy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-s*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 ht(e,t,lt(t)),d=(t?.width?t?.width:c.width)+(s??0)*2,u=(t?.height?t?.height:c.height)+(a??0)*2,f=t.look==="neo"?u/4:u/8,p=u+(n?f:-f),{cssStyles:m}=t,x=14-d,C=x>0?x/2:0,k=rt.svg(l),S=et(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const v=[{x:-d/2-C,y:p/2},...mr(-d/2-C,p/2,d/2+C,p/2,f,.8),{x:d/2+C,y:-p/2},{x:-d/2-C,y:-p/2}],_=bt(v),E=k.path(_,S),B=l.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-f/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-u/2+(t.padding??0)-f-(c.y-(c.top??0))})`),st(t,B),t.intersect=function(I){return tt.polygon(t,v,I)},l}g(Hy,"waveEdgedRectangle");async function Yy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?20:o;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 S=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-S*(20/9)),t.width=t.width-s*2}const{shapeSvg:n,bbox:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width:l.width)+s*2,h=(t?.height?t?.height:l.height)+a,d=h/8,u=h+d*2,{cssStyles:f}=t,p=rt.svg(n),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:u/2},...mr(-c/2,u/2,c/2,u/2,d,1),{x:c/2,y:-u/2},...mr(c/2,-u/2,-c/2,-u/2,d,-1)],x=bt(y),C=p.path(x,m),k=n.insert(()=>C,":first-child");return k.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),st(t,k),t.intersect=function(S){return tt.polygon(t,y,S)},n}g(Yy,"waveRectangle");var Rt=10;async function Uy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-Rt,10),t.height=Math.max((t?.height??0)-s*2-Rt,10));const{shapeSvg:a,bbox:n,label:l}=await ht(e,t,lt(t)),c=(t?.width?t?.width:n.width)+o*2+Rt,h=(t?.height?t?.height:n.height)+s*2+Rt,d=c-Rt,u=h-Rt,f=-d/2,p=-u/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{}),C=[{x:f-Rt,y:p-Rt},{x:f-Rt,y:p+u},{x:f+d,y:p+u},{x:f+d,y:p-Rt}],k=`M${f-Rt},${p-Rt} L${f+d},${p-Rt} L${f+d},${p+u} L${f-Rt},${p+u} L${f-Rt},${p-Rt}
|
|
240
240
|
M${f-Rt},${p} L${f+d},${p}
|
|
241
|
-
M${f},${p-Rt} L${f},${p+u}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=y.path(k,x),v=a.insert(()=>S,":first-child");return v.attr("transform",`translate(${Rt/2}, ${Rt/2})`),v.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&v.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))})`),st(t,v),t.intersect=function(_){return tt.polygon(t,C,_)},a}g(Yy,"windowPane");var md=new Set(["redux-color","redux-dark-color"]),CB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Eh(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Ot(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:K}=Ot(),{background:Q}=K,nt={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Q}`]};await Eh(e,nt)}const c=Ot();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:u}=t,{labelStyles:f,nodeStyles:p}=ot(t);if(r.attributes.length===0&&t.label){const K={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};je(t.label,c)+K.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const Q=await zi(e,t,K);if(i!=null&&md.has(i)){const nt=r.colorIndex??0;Q.attr("data-color-id",`color-${nt%l.length}`)}if(!Ye(c.htmlLabels)){const nt=Q.select("text"),gt=nt.node()?.getBBox();nt.attr("transform",`translate(${-gt.width/2}, 0)`)}return Q}c.htmlLabels||(h*=1.25,d*=1.25);let m=lt(t);m||(m="node default");const y=e.insert("g").attr("class",m).attr("id",t.domId||t.id),x=await ei(y,t.label??"",c,0,0,["name"],f);x.height+=d;let C=0;const k=[],S=[];let v=0,_=0,E=0,B=0,O=!0,A=!0;for(const K of r.attributes){const Q=await ei(y,K.type,c,0,C,["attribute-type"],f);v=Math.max(v,Q.width+h);const nt=await ei(y,K.name,c,0,C,["attribute-name"],f);_=Math.max(_,nt.width+h);const gt=await ei(y,K.keys.join(),c,0,C,["attribute-keys"],f);E=Math.max(E,gt.width+h);const ut=await ei(y,K.comment,c,0,C,["attribute-comment"],f);B=Math.max(B,ut.width+h);const mt=Math.max(Q.height,nt.height,gt.height,ut.height)+d;S.push({yOffset:C,rowHeight:mt}),C+=mt}let D=4;E<=h&&(O=!1,E=0,D--),B<=h&&(A=!1,B=0,D--);const W=y.node().getBBox();if(x.width+h*2-(v+_+E+B)>0){const K=x.width+h*2-(v+_+E+B);v+=K/D,_+=K/D,E>0&&(E+=K/D),B>0&&(B+=K/D)}const R=v+_+E+B,N=rt.svg(y),F=et(t,{});t.look!=="handDrawn"&&(F.roughness=0,F.fillStyle="solid");let $=0;S.length>0&&($=S.reduce((K,Q)=>K+(Q?.rowHeight??0),0));const q=Math.max(W.width+h*2,t?.width||0,R),P=Math.max(($??0)+x.height,t?.height||0),I=-q/2,j=-P/2;if(y.selectAll("g:not(:first-child)").each((K,Q,nt)=>{const gt=yt(nt[Q]),ut=gt.attr("transform");let mt=0,Lt=0;if(ut){const Mt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ut);Mt&&(mt=parseFloat(Mt[1]),Lt=parseFloat(Mt[2]),gt.attr("class").includes("attribute-name")?mt+=v:gt.attr("class").includes("attribute-keys")?mt+=v+_:gt.attr("class").includes("attribute-comment")&&(mt+=v+_+E))}gt.attr("transform",`translate(${I+h/2+mt}, ${Lt+j+x.height+d/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(j+d/2)+")"),i!=null&&md.has(i)){const K=r.colorIndex??0;y.attr("data-color-id",`color-${K%l.length}`)}const T=N.rectangle(I,j,q,P,F),U=y.insert(()=>T,":first-child").attr("class","outer-path").attr("style",u.join(""));k.push(0);for(const[K,Q]of S.entries()){const gt=(K+1)%2===0&&Q.yOffset!==0,ut=N.rectangle(I,x.height+j+Q?.yOffset,q,Q?.rowHeight,{...F,fill:gt?s:a,stroke:n});y.insert(()=>ut,"g.label").attr("style",u.join("")).attr("class",`row-rect-${gt?"even":"odd"}`)}const z=1e-4;let G=ri(I,x.height+j,q+I,x.height+j,z),X=N.polygon(G.map(K=>[K.x,K.y]),F);if(y.insert(()=>X).attr("class","divider"),G=ri(v+I,x.height+j,v+I,P+j,z),X=N.polygon(G.map(K=>[K.x,K.y]),F),y.insert(()=>X).attr("class","divider"),O){const K=v+_+I;G=ri(K,x.height+j,K,P+j,z),X=N.polygon(G.map(Q=>[Q.x,Q.y]),F),y.insert(()=>X).attr("class","divider")}if(A){const K=v+_+E+I;G=ri(K,x.height+j,K,P+j,z),X=N.polygon(G.map(Q=>[Q.x,Q.y]),F),y.insert(()=>X).attr("class","divider")}for(const K of k){const Q=x.height+j+K;G=ri(I,Q,q+I,Q,z),X=N.polygon(G.map(nt=>[nt.x,nt.y]),F),y.insert(()=>X).attr("class","divider")}if(st(t,U),p&&t.look!=="handDrawn")if(i!=null&&CB.has(i))y.selectAll("path").attr("style",p);else{const Q=p.split(";")?.filter(nt=>nt.includes("stroke"))?.map(nt=>`${nt}`).join("; ");y.selectAll("path").attr("style",Q??""),y.selectAll(".row-rect-even path").attr("style",p)}return t.intersect=function(K){return tt.rect(t,K)},y}g(Eh,"erBox");async function ei(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==xn(t)&&(t=xn(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=n.node().appendChild(await Oe(n,t,{width:je(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(Ye(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=yt(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}g(ei,"addText");function ri(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}g(ri,"lineToPolygon");async function Uy(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",lt(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,u=0,f=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const C=t.annotations[0];await lo(n,{text:`«${C}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await lo(l,t,0,["font-weight: bolder"]);const p=l.node().getBBox();u=p.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const C of t.members){const k=await lo(c,C,m,[C.parseClassifier()]);m+=k+s}f=c.node().getBBox().height,f<=0&&(f=o/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const C of t.methods){const k=await lo(h,C,y,[C.parseClassifier()]);y+=k+s}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+u+o*2})`),x=a.node().getBBox(),h.attr("transform",`translate(0, ${d+u+(f?f+o*4:o*2)})`),x=a.node().getBBox(),{shapeSvg:a,bbox:x}}g(Uy,"textHelper");async function lo(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=Ot();let a="useHtmlLabels"in t?t.useHtmlLabels:Ye(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),Li(n)&&(a=!0);const l=await Oe(o,Il(pr(n)),{width:je(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const d=l.children[0],u=yt(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const f=d.getElementsByTagName("img");if(f){const p=n.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...f].map(m=>new Promise(y=>{function x(){if(m.style.display="flex",m.style.flexDirection="column",p){const C=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,S=parseInt(C,10)*5+"px";m.style.minWidth=S,m.style.maxWidth=S}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(),u.attr("width",c.width),u.attr("height",c.height)}else{i.includes("font-weight: bolder")&&yt(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 o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}g(lo,"addText");async function Xy(e,t){const r=kt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??Ye(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await Uy(e,t,r,n,a),{labelStyles:d,nodeStyles:u}=ot(t);t.labelStyle=d,t.cssStyles=l.styles||"";const f=l.styles?.join(";")||u||"";t.cssStyles||(t.cssStyles=f.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 S=-x/2,v=-C/2;let _=p?s*2:l.members.length===0&&l.methods.length===0?-s:0;k&&(_=s*2);const E=m.rectangle(S-s,v-s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0),x+2*s,C+2*s+_,y),B=c.insert(()=>E,":first-child");B.attr("class","basic label-container outer-path");const O=B.node().getBBox(),A=c.select(".annotation-group").node().getBBox().height-(p?s/2:0)||0,D=c.select(".label-group").node().getBBox().height-(p?s/2:0)||0,W=c.select(".members-group").node().getBBox().height-(p?s/2:0)||0,R=(A+D+v+s-(v-s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((N,F,$)=>{const q=yt($[F]),P=q.attr("transform");let I=0;if(P){const z=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(P);z&&(I=parseFloat(z[2]))}let j=I+v+s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(q.attr("class").includes("methods-group")){const U=Math.max(W,a/2);k?j=Math.max(R,A+D+U+v+a*2+s)+a*2:j=A+D+U+v+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?j=I-a:j=I),n||(j-=4);let T=S;(q.attr("class").includes("label-group")||q.attr("class").includes("annotation-group"))&&(T=-q.node()?.getBBox().width/2||0,c.selectAll("text").each(function(U,z,G){window.getComputedStyle(G[z]).textAnchor==="middle"&&(T=0)})),q.attr("transform",`translate(${T}, ${j})`)}),l.members.length>0||l.methods.length>0||p){const N=A+D+v+s,F=m.line(O.x,N,O.x+O.width,N+.001,y);c.insert(()=>F).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(p||l.members.length>0||l.methods.length>0){const N=A+D+W+v+a*2+s,F=m.line(O.x,k?Math.max(R,N):N,O.x+O.width,(k?Math.max(R,N):N)+.001,y);c.insert(()=>F).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",f),B.select(":nth-child(2)").attr("style",f),c.selectAll(".divider").select("path").attr("style",f),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",f),!n){const N=RegExp(/color\s*:\s*([^;]*)/),F=N.exec(f);if(F){const $=F[0].replace("color","fill");c.selectAll("tspan").attr("style",$)}else if(d){const $=N.exec(d);if($){const q=$[0].replace("color","fill");c.selectAll("tspan").attr("style",q)}}}return st(t,B),t.intersect=function(N){return tt.rect(t,N)},c}g(Xy,"classBox");async function Gy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=lt(t),{themeVariables:h}=kt(),{borderColorArray:d,requirementEdgeLabelBackground:u}=h,f=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let p;l?p=await Pe(f,`<<${o.type}>>`,0,t.labelStyle):p=await Pe(f,"<<Element>>",0,t.labelStyle);let m=p;const y=await Pe(f,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const O=await Pe(f,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=O;const A=await Pe(f,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=A;const D=await Pe(f,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=D,await Pe(f,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const O=await Pe(f,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=O,await Pe(f,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const x=(f.node()?.getBBox().width??200)+a,C=(f.node()?.getBBox().height??200)+a,k=-x/2,S=-C/2,v=rt.svg(f),_=et(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const E=v.rectangle(k,S,x,C,_),B=f.insert(()=>E,":first-child");if(B.attr("class","basic label-container outer-path").attr("style",i),d?.length){const O=t.colorIndex??0;f.attr("data-color-id",`color-${O%d.length}`)}if(f.selectAll(".label").each((O,A,D)=>{const W=yt(D[A]),R=W.attr("transform");let N=0,F=0;if(R){const I=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);I&&(N=parseFloat(I[1]),F=parseFloat(I[2]))}const $=F-C/2;let q=k+a/2;(A===0||A===1)&&(q=N),W.attr("transform",`translate(${q}, ${$+a})`)}),m>p+y+n){const O=S+p+y+n;let A;if(t.look==="neo"){const R=[[k,O],[k+x,O],[k+x,O+.001],[k,O+.001]];A=v.polygon(R,_)}else A=v.line(k,O,k+x,O,_);f.insert(()=>A).attr("class","divider")}return st(t,B),t.intersect=function(O){return tt.rect(t,O)},i&&t.look!=="handDrawn"&&(u||d?.length)&&f.selectAll("path").attr("style",i),f}g(Gy,"requirementBox");async function Pe(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=kt(),a=s.htmlLabels??!0,n=await Oe(o,Il(pr(t)),{width:je(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const c=n.children[0],h=yt(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 o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}g(Pe,"addText");var bB=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 Vy(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=t.padding||10;let d="",u;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let p,m;u?{label:p,bbox:m}=await Ja(u,"ticket"in t&&t.ticket||"",f):{label:p,bbox:m}=await Ja(n,"ticket"in t&&t.ticket||"",f);const{label:y,bbox:x}=await Ja(n,"assigned"in t&&t.assigned||"",f);t.width=a;const C=10,k=t?.width||0,S=Math.max(m.height,x.height)/2,v=Math.max(l.height+C*2,t?.height||0)+S,_=-k/2,E=-v/2;c.attr("transform","translate("+(h-k/2)+", "+(-S-l.height/2)+")"),p.attr("transform","translate("+(h-k/2)+", "+(-S+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-x.width-2*s)+", "+(-S+l.height/2)+")");let B;const{rx:O,ry:A}=t,{cssStyles:D}=t;if(t.look==="handDrawn"){const W=rt.svg(n),R=et(t,{}),N=O||A?W.path(yr(_,E,k,v,O||0),R):W.rectangle(_,E,k,v,R);B=n.insert(()=>N,":first-child"),B.attr("class","basic label-container").attr("style",D||null)}else{B=n.insert("rect",":first-child"),B.attr("class","basic label-container __APA__").attr("style",o).attr("rx",O??5).attr("ry",A??5).attr("x",_).attr("y",E).attr("width",k).attr("height",v);const W="priority"in t&&t.priority;if(W){const R=n.append("line"),N=_+2,F=E+Math.floor((O??0)/2),$=E+v-Math.floor((O??0)/2);R.attr("x1",N).attr("y1",F).attr("x2",N).attr("y2",$).attr("stroke-width","4").attr("stroke",bB(W))}}return st(t,B),t.height=v,t.intersect=function(W){return tt.rect(t,W)},n}g(Vy,"kanbanItem");async function Ky(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ht(e,t,lt(t)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:d}=t,u=s.width+20,f=s.height+20,p=Math.max(l,u),m=Math.max(c,f);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const x=`M0 0
|
|
241
|
+
M${f},${p-Rt} L${f},${p+u}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=y.path(k,x),v=a.insert(()=>S,":first-child");return v.attr("transform",`translate(${Rt/2}, ${Rt/2})`),v.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&v.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))})`),st(t,v),t.intersect=function(_){return tt.polygon(t,C,_)},a}g(Uy,"windowPane");var md=new Set(["redux-color","redux-dark-color"]),bB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Eh(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Ot(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:K}=Ot(),{background:Q}=K,nt={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Q}`]};await Eh(e,nt)}const c=Ot();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:u}=t,{labelStyles:f,nodeStyles:p}=ot(t);if(r.attributes.length===0&&t.label){const K={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};je(t.label,c)+K.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const Q=await zi(e,t,K);if(i!=null&&md.has(i)){const nt=r.colorIndex??0;Q.attr("data-color-id",`color-${nt%l.length}`)}if(!Ye(c.htmlLabels)){const nt=Q.select("text"),gt=nt.node()?.getBBox();nt.attr("transform",`translate(${-gt.width/2}, 0)`)}return Q}c.htmlLabels||(h*=1.25,d*=1.25);let m=lt(t);m||(m="node default");const y=e.insert("g").attr("class",m).attr("id",t.domId||t.id),x=await ei(y,t.label??"",c,0,0,["name"],f);x.height+=d;let C=0;const k=[],S=[];let v=0,_=0,E=0,B=0,I=!0,M=!0;for(const K of r.attributes){const Q=await ei(y,K.type,c,0,C,["attribute-type"],f);v=Math.max(v,Q.width+h);const nt=await ei(y,K.name,c,0,C,["attribute-name"],f);_=Math.max(_,nt.width+h);const gt=await ei(y,K.keys.join(),c,0,C,["attribute-keys"],f);E=Math.max(E,gt.width+h);const ut=await ei(y,K.comment,c,0,C,["attribute-comment"],f);B=Math.max(B,ut.width+h);const mt=Math.max(Q.height,nt.height,gt.height,ut.height)+d;S.push({yOffset:C,rowHeight:mt}),C+=mt}let D=4;E<=h&&(I=!1,E=0,D--),B<=h&&(M=!1,B=0,D--);const U=y.node().getBBox();if(x.width+h*2-(v+_+E+B)>0){const K=x.width+h*2-(v+_+E+B);v+=K/D,_+=K/D,E>0&&(E+=K/D),B>0&&(B+=K/D)}const q=v+_+E+B,N=rt.svg(y),A=et(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let F=0;S.length>0&&(F=S.reduce((K,Q)=>K+(Q?.rowHeight??0),0));const P=Math.max(U.width+h*2,t?.width||0,q),O=Math.max((F??0)+x.height,t?.height||0),$=-P/2,j=-O/2;if(y.selectAll("g:not(:first-child)").each((K,Q,nt)=>{const gt=yt(nt[Q]),ut=gt.attr("transform");let mt=0,Lt=0;if(ut){const Mt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ut);Mt&&(mt=parseFloat(Mt[1]),Lt=parseFloat(Mt[2]),gt.attr("class").includes("attribute-name")?mt+=v:gt.attr("class").includes("attribute-keys")?mt+=v+_:gt.attr("class").includes("attribute-comment")&&(mt+=v+_+E))}gt.attr("transform",`translate(${$+h/2+mt}, ${Lt+j+x.height+d/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(j+d/2)+")"),i!=null&&md.has(i)){const K=r.colorIndex??0;y.attr("data-color-id",`color-${K%l.length}`)}const T=N.rectangle($,j,P,O,A),W=y.insert(()=>T,":first-child").attr("class","outer-path").attr("style",u.join(""));k.push(0);for(const[K,Q]of S.entries()){const gt=(K+1)%2===0&&Q.yOffset!==0,ut=N.rectangle($,x.height+j+Q?.yOffset,P,Q?.rowHeight,{...A,fill:gt?s:a,stroke:n});y.insert(()=>ut,"g.label").attr("style",u.join("")).attr("class",`row-rect-${gt?"even":"odd"}`)}const z=1e-4;let G=ri($,x.height+j,P+$,x.height+j,z),X=N.polygon(G.map(K=>[K.x,K.y]),A);if(y.insert(()=>X).attr("class","divider"),G=ri(v+$,x.height+j,v+$,O+j,z),X=N.polygon(G.map(K=>[K.x,K.y]),A),y.insert(()=>X).attr("class","divider"),I){const K=v+_+$;G=ri(K,x.height+j,K,O+j,z),X=N.polygon(G.map(Q=>[Q.x,Q.y]),A),y.insert(()=>X).attr("class","divider")}if(M){const K=v+_+E+$;G=ri(K,x.height+j,K,O+j,z),X=N.polygon(G.map(Q=>[Q.x,Q.y]),A),y.insert(()=>X).attr("class","divider")}for(const K of k){const Q=x.height+j+K;G=ri($,Q,P+$,Q,z),X=N.polygon(G.map(nt=>[nt.x,nt.y]),A),y.insert(()=>X).attr("class","divider")}if(st(t,W),p&&t.look!=="handDrawn")if(i!=null&&bB.has(i))y.selectAll("path").attr("style",p);else{const Q=p.split(";")?.filter(nt=>nt.includes("stroke"))?.map(nt=>`${nt}`).join("; ");y.selectAll("path").attr("style",Q??""),y.selectAll(".row-rect-even path").attr("style",p)}return t.intersect=function(K){return tt.rect(t,K)},y}g(Eh,"erBox");async function ei(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==xn(t)&&(t=xn(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=n.node().appendChild(await Oe(n,t,{width:je(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(Ye(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=yt(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}g(ei,"addText");function ri(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}g(ri,"lineToPolygon");async function Xy(e,t,r,i,o=r.class.padding??12){const s=i?0:3,a=e.insert("g").attr("class",lt(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,u=0,f=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const C=t.annotations[0];await lo(n,{text:`«${C}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await lo(l,t,0,["font-weight: bolder"]);const p=l.node().getBBox();u=p.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const C of t.members){const k=await lo(c,C,m,[C.parseClassifier()]);m+=k+s}f=c.node().getBBox().height,f<=0&&(f=o/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const C of t.methods){const k=await lo(h,C,y,[C.parseClassifier()]);y+=k+s}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+u+o*2})`),x=a.node().getBBox(),h.attr("transform",`translate(0, ${d+u+(f?f+o*4:o*2)})`),x=a.node().getBBox(),{shapeSvg:a,bbox:x}}g(Xy,"textHelper");async function lo(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=Ot();let a="useHtmlLabels"in t?t.useHtmlLabels:Ye(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),Li(n)&&(a=!0);const l=await Oe(o,Il(pr(n)),{width:je(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const d=l.children[0],u=yt(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const f=d.getElementsByTagName("img");if(f){const p=n.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...f].map(m=>new Promise(y=>{function x(){if(m.style.display="flex",m.style.flexDirection="column",p){const C=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,S=parseInt(C,10)*5+"px";m.style.minWidth=S,m.style.maxWidth=S}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(),u.attr("width",c.width),u.attr("height",c.height)}else{i.includes("font-weight: bolder")&&yt(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 o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}g(lo,"addText");async function Gy(e,t){const r=kt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??Ye(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await Xy(e,t,r,n,a),{labelStyles:d,nodeStyles:u}=ot(t);t.labelStyle=d,t.cssStyles=l.styles||"";const f=l.styles?.join(";")||u||"";t.cssStyles||(t.cssStyles=f.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 S=-x/2,v=-C/2;let _=p?s*2:l.members.length===0&&l.methods.length===0?-s:0;k&&(_=s*2);const E=m.rectangle(S-s,v-s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0),x+2*s,C+2*s+_,y),B=c.insert(()=>E,":first-child");B.attr("class","basic label-container outer-path");const I=B.node().getBBox(),M=c.select(".annotation-group").node().getBBox().height-(p?s/2:0)||0,D=c.select(".label-group").node().getBBox().height-(p?s/2:0)||0,U=c.select(".members-group").node().getBBox().height-(p?s/2:0)||0,q=(M+D+v+s-(v-s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((N,A,F)=>{const P=yt(F[A]),O=P.attr("transform");let $=0;if(O){const z=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(O);z&&($=parseFloat(z[2]))}let j=$+v+s-(p?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(P.attr("class").includes("methods-group")){const W=Math.max(U,a/2);k?j=Math.max(q,M+D+W+v+a*2+s)+a*2:j=M+D+W+v+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?j=$-a:j=$),n||(j-=4);let T=S;(P.attr("class").includes("label-group")||P.attr("class").includes("annotation-group"))&&(T=-P.node()?.getBBox().width/2||0,c.selectAll("text").each(function(W,z,G){window.getComputedStyle(G[z]).textAnchor==="middle"&&(T=0)})),P.attr("transform",`translate(${T}, ${j})`)}),l.members.length>0||l.methods.length>0||p){const N=M+D+v+s,A=m.line(I.x,N,I.x+I.width,N+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(p||l.members.length>0||l.methods.length>0){const N=M+D+U+v+a*2+s,A=m.line(I.x,k?Math.max(q,N):N,I.x+I.width,(k?Math.max(q,N):N)+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",f),B.select(":nth-child(2)").attr("style",f),c.selectAll(".divider").select("path").attr("style",f),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",f),!n){const N=RegExp(/color\s*:\s*([^;]*)/),A=N.exec(f);if(A){const F=A[0].replace("color","fill");c.selectAll("tspan").attr("style",F)}else if(d){const F=N.exec(d);if(F){const P=F[0].replace("color","fill");c.selectAll("tspan").attr("style",P)}}}return st(t,B),t.intersect=function(N){return tt.rect(t,N)},c}g(Gy,"classBox");async function Vy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=lt(t),{themeVariables:h}=kt(),{borderColorArray:d,requirementEdgeLabelBackground:u}=h,f=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let p;l?p=await Pe(f,`<<${o.type}>>`,0,t.labelStyle):p=await Pe(f,"<<Element>>",0,t.labelStyle);let m=p;const y=await Pe(f,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const I=await Pe(f,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=I;const M=await Pe(f,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=M;const D=await Pe(f,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=D,await Pe(f,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const I=await Pe(f,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=I,await Pe(f,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const x=(f.node()?.getBBox().width??200)+a,C=(f.node()?.getBBox().height??200)+a,k=-x/2,S=-C/2,v=rt.svg(f),_=et(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const E=v.rectangle(k,S,x,C,_),B=f.insert(()=>E,":first-child");if(B.attr("class","basic label-container outer-path").attr("style",i),d?.length){const I=t.colorIndex??0;f.attr("data-color-id",`color-${I%d.length}`)}if(f.selectAll(".label").each((I,M,D)=>{const U=yt(D[M]),q=U.attr("transform");let N=0,A=0;if(q){const $=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(q);$&&(N=parseFloat($[1]),A=parseFloat($[2]))}const F=A-C/2;let P=k+a/2;(M===0||M===1)&&(P=N),U.attr("transform",`translate(${P}, ${F+a})`)}),m>p+y+n){const I=S+p+y+n;let M;if(t.look==="neo"){const q=[[k,I],[k+x,I],[k+x,I+.001],[k,I+.001]];M=v.polygon(q,_)}else M=v.line(k,I,k+x,I,_);f.insert(()=>M).attr("class","divider")}return st(t,B),t.intersect=function(I){return tt.rect(t,I)},i&&t.look!=="handDrawn"&&(u||d?.length)&&f.selectAll("path").attr("style",i),f}g(Vy,"requirementBox");async function Pe(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=kt(),a=s.htmlLabels??!0,n=await Oe(o,Il(pr(t)),{width:je(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const c=n.children[0],h=yt(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 o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}g(Pe,"addText");var kB=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 Ky(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=ot(t);t.labelStyle=i||"";const s=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await ht(e,t,lt(t)),h=t.padding||10;let d="",u;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let p,m;u?{label:p,bbox:m}=await Ja(u,"ticket"in t&&t.ticket||"",f):{label:p,bbox:m}=await Ja(n,"ticket"in t&&t.ticket||"",f);const{label:y,bbox:x}=await Ja(n,"assigned"in t&&t.assigned||"",f);t.width=a;const C=10,k=t?.width||0,S=Math.max(m.height,x.height)/2,v=Math.max(l.height+C*2,t?.height||0)+S,_=-k/2,E=-v/2;c.attr("transform","translate("+(h-k/2)+", "+(-S-l.height/2)+")"),p.attr("transform","translate("+(h-k/2)+", "+(-S+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-x.width-2*s)+", "+(-S+l.height/2)+")");let B;const{rx:I,ry:M}=t,{cssStyles:D}=t;if(t.look==="handDrawn"){const U=rt.svg(n),q=et(t,{}),N=I||M?U.path(yr(_,E,k,v,I||0),q):U.rectangle(_,E,k,v,q);B=n.insert(()=>N,":first-child"),B.attr("class","basic label-container").attr("style",D||null)}else{B=n.insert("rect",":first-child"),B.attr("class","basic label-container __APA__").attr("style",o).attr("rx",I??5).attr("ry",M??5).attr("x",_).attr("y",E).attr("width",k).attr("height",v);const U="priority"in t&&t.priority;if(U){const q=n.append("line"),N=_+2,A=E+Math.floor((I??0)/2),F=E+v-Math.floor((I??0)/2);q.attr("x1",N).attr("y1",A).attr("x2",N).attr("y2",F).attr("stroke-width","4").attr("stroke",kB(U))}}return st(t,B),t.height=v,t.intersect=function(U){return tt.rect(t,U)},n}g(Ky,"kanbanItem");async function Zy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ht(e,t,lt(t)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:d}=t,u=s.width+20,f=s.height+20,p=Math.max(l,u),m=Math.max(c,f);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const x=`M0 0
|
|
242
242
|
a${h},${h} 1 0,0 ${p*.25},${-1*m*.1}
|
|
243
243
|
a${h},${h} 1 0,0 ${p*.25},0
|
|
244
244
|
a${h},${h} 1 0,0 ${p*.25},0
|
|
@@ -256,7 +256,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error
|
|
|
256
256
|
a${h},${h} 1 0,0 ${-1*p*.1},${-1*m*.33}
|
|
257
257
|
a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}
|
|
258
258
|
a${h},${h} 1 0,0 ${p*.1},${-1*m*.33}
|
|
259
|
-
H0 V0 Z`;if(t.look==="handDrawn"){const C=rt.svg(o),k=et(t,{}),S=C.path(x,k);y=o.insert(()=>S,":first-child"),y.attr("class","basic label-container").attr("style",Xt(d))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-p/2}, ${-m/2})`),st(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)},o}g(
|
|
259
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const C=rt.svg(o),k=et(t,{}),S=C.path(x,k);y=o.insert(()=>S,":first-child"),y.attr("class","basic label-container").attr("style",Xt(d))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-p/2}, ${-m/2})`),st(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)},o}g(Zy,"bang");async function Qy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ht(e,t,lt(t)),l=s.width+2*a,c=s.height+2*a,h=.15*l,d=.25*l,u=.35*l,f=.2*l,{cssStyles:p}=t;let m;const y=`M0 0
|
|
260
260
|
a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
|
|
261
261
|
a${u},${u} 1 0,1 ${l*.4},${-1*l*.1}
|
|
262
262
|
a${d},${d} 1 0,1 ${l*.35},${l*.2}
|
|
@@ -270,7 +270,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error
|
|
|
270
270
|
|
|
271
271
|
a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
|
|
272
272
|
a${f},${f} 1 0,1 ${l*.1},${-1*c*.65}
|
|
273
|
-
H0 V0 Z`;if(t.look==="handDrawn"){const x=rt.svg(o),C=et(t,{}),k=x.path(y,C);m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Xt(p))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),st(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)},o}g(
|
|
273
|
+
H0 V0 Z`;if(t.look==="handDrawn"){const x=rt.svg(o),C=et(t,{}),k=x.path(y,C);m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Xt(p))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),st(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)},o}g(Qy,"cloud");async function Jy(e,t){const{labelStyles:r,nodeStyles:i}=ot(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await ht(e,t,lt(t)),l=s.width+8*a,c=s.height+2*a,h=5,d=t.look==="neo"?`
|
|
274
274
|
M${-l/2} ${c/2-h}
|
|
275
275
|
v${-c+2*h}
|
|
276
276
|
q0,-${h} ${h},-${h}
|
|
@@ -290,26 +290,26 @@ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error
|
|
|
290
290
|
h${-(l-2*h)}
|
|
291
291
|
q${-h},0 ${-h},${-h}
|
|
292
292
|
Z
|
|
293
|
-
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const u=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.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(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),st(t,u),t.calcIntersect=function(f,p){return tt.rect(f,p)},t.intersect=function(f){return tt.rect(t,f)},o}g(Qy,"defaultMindmapNode");async function Jy(e,t){const r={padding:t.padding??0};return Lh(e,t,r)}g(Jy,"mindmapCircle");var kB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Fy},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:By},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Ay},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Ry},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Jm},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:ty},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Lh},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Ky},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Zy},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:vy},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:ny},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:yy},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:my},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:qy},{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:py},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:ry},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Dy},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Ym},{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:Oy},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:$y},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:sy},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:ly},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Vm},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Km},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Zm},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:xy},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Wy},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ay},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Ny},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Cy},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Qm},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:ey},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:jy},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Yy},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:iy},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:zy},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:oy},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Ey},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:wy},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:ky},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Hm},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Gm},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Py},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Iy},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Hy},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Ty},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:by}],wB=g(()=>{const t=[...Object.entries({state:My,choice:Um,note:Sy,rectWithTitle:_y,labelRect:gy,iconSquare:uy,iconCircle:cy,icon:hy,iconRounded:dy,imageSquare:fy,anchor:jm,kanbanItem:Vy,mindmapCircle:Jy,defaultMindmapNode:Qy,classBox:Xy,erBox:Eh,requirementBox:Gy}),...kB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),t0=wB();function e0(e){return e in t0}g(e0,"isValidShape");var Sa=new Map;async function Fh(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?t0[t.shape]:void 0;if(!s)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),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",Xt(t.look)),t.tooltip&&o.attr("title",t.tooltip),Sa.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}g(Fh,"insertNode");var SB=g((e,t)=>{Sa.set(t.id,e)},"setNodeElem"),vB=g(()=>{Sa.clear()},"clear"),TB=g(e=>{const t=Sa.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"),ii=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"),Zt={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},yd={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function ho(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=$t(e),t=$t(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}g(ho,"calculateDeltaAndAngle");var $t=g(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),r0=g(e=>({x:g(function(t,r,i){let o=0;const s=$t(i[0]).x<$t(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Zt,e.arrowTypeStart)){const{angle:f,deltaX:p}=ho(i[0],i[1]);o=Zt[e.arrowTypeStart]*Math.cos(f)*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Zt,e.arrowTypeEnd)){const{angle:f,deltaX:p}=ho(i[i.length-1],i[i.length-2]);o=Zt[e.arrowTypeEnd]*Math.cos(f)*(p>=0?1:-1)}const a=Math.abs($t(t).x-$t(i[i.length-1]).x),n=Math.abs($t(t).y-$t(i[i.length-1]).y),l=Math.abs($t(t).x-$t(i[0]).x),c=Math.abs($t(t).y-$t(i[0]).y),h=Zt[e.arrowTypeStart],d=Zt[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let f=d+u-a;f*=s==="right"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=s==="right"?-1:1,o+=f}return $t(t).x+o},"x"),y:g(function(t,r,i){let o=0;const s=$t(i[0]).y<$t(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Zt,e.arrowTypeStart)){const{angle:f,deltaY:p}=ho(i[0],i[1]);o=Zt[e.arrowTypeStart]*Math.abs(Math.sin(f))*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Zt,e.arrowTypeEnd)){const{angle:f,deltaY:p}=ho(i[i.length-1],i[i.length-2]);o=Zt[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(p>=0?1:-1)}const a=Math.abs($t(t).y-$t(i[i.length-1]).y),n=Math.abs($t(t).x-$t(i[i.length-1]).x),l=Math.abs($t(t).y-$t(i[0]).y),c=Math.abs($t(t).x-$t(i[0]).x),h=Zt[e.arrowTypeStart],d=Zt[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let f=d+u-a;f*=s==="up"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=s==="up"?-1:1,o+=f}return $t(t).y+o},"y")}),"getLineFunctionsWithOffset"),_B=g((e,t,r,i,o,s=!1,a)=>{t.arrowTypeStart&&xd(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&xd(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),BB={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}},LB=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],xd=g((e,t,r,i,o,s,a=!1,n)=>{const l=BB[r],c=l&&LB.includes(l.type);if(!l){V.warn(`Unknown arrow type: ${r}`);return}const h=l.type,f=`${o}_${s}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const p=n.replace(/[^\dA-Za-z]/g,"_"),m=`${f}_${p}`;if(!document.getElementById(m)){const y=document.getElementById(f);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}#${f})`)},"addEdgeMarker"),EB=g(e=>typeof e=="string"?e:kt()?.flowchart?.curve,"resolveEdgeCurveType"),Lo=new Map,Ut=new Map,FB=g(()=>{Lo.clear(),Ut.clear()},"clear"),to=g(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),i0=g(async(e,t)=>{const r=kt();let i=ee(r);const{labelStyles:o}=ot(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Oe(e,t.label,{style:to(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 f=c.children[0],p=yt(c);h=f.getBoundingClientRect(),d=h,p.attr("width",h.width),p.attr("height",h.height)}else{const f=yt(c).select("text").node();f&&typeof f.getBBox=="function"&&(d=f.getBBox())}a.attr("transform",ii(d,i)),Lo.set(t.id,s),t.width=h.width,t.height=h.height;let u;if(t.startLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(p,t.startLabelLeft,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startLeft=f,co(u,t.startLabelLeft)}if(t.startLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(p,t.startLabelRight,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startRight=f,co(u,t.startLabelRight)}if(t.endLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(f,t.endLabelLeft,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endLeft=f,co(u,t.endLabelLeft)}if(t.endLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(f,t.endLabelRight,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endRight=f,co(u,t.endLabelRight)}return c},"insertEdgeLabel");function co(e,t){ee(kt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(co,"setTerminalWidth");var o0=g((e,t)=>{V.debug("Moving label abc88 ",e.id,e.label,Lo.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=kt(),{subGraphTitleTotalMargin:o}=ya(i);if(e.label){const s=Lo.get(e.id);let a=e.x,n=e.y;if(r){const l=xe.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)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Ut.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Ut.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Ut.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Ut.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),AB=g((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),s=Math.abs(i.y-r.y);return o<.001||s<.001?t:s>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),MB=g((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),$B=g((e,t,r)=>{V.debug(`intersection calc abc89:
|
|
293
|
+
`;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const u=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.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(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),st(t,u),t.calcIntersect=function(f,p){return tt.rect(f,p)},t.intersect=function(f){return tt.rect(t,f)},o}g(Jy,"defaultMindmapNode");async function t0(e,t){const r={padding:t.padding??0};return Lh(e,t,r)}g(t0,"mindmapCircle");var wB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Ay},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:Ly},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:My},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Iy},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:ty},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:ey},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Lh},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Zy},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Qy},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Ty},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:ly},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:xy},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:yy},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:zy},{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:gy},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:iy},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Ny},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Um},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Ey},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Ry},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Oy},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:ay},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:hy},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Km},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Zm},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Qm},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Cy},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Hy},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ny},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:qy},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:by},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Jm},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:ry},{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:Uy},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:oy},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:jy},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:sy},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Fy},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Sy},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:wy},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Ym},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Vm},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Dy},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Py},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Yy},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:_y},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:ky}],SB=g(()=>{const t=[...Object.entries({state:$y,choice:Xm,note:vy,rectWithTitle:By,labelRect:my,iconSquare:fy,iconCircle:dy,icon:cy,iconRounded:uy,imageSquare:py,anchor:Wm,kanbanItem:Ky,mindmapCircle:t0,defaultMindmapNode:Jy,classBox:Gy,erBox:Eh,requirementBox:Vy}),...wB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),e0=SB();function r0(e){return e in e0}g(r0,"isValidShape");var Sa=new Map;async function Fh(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?e0[t.shape]:void 0;if(!s)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),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",Xt(t.look)),t.tooltip&&o.attr("title",t.tooltip),Sa.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}g(Fh,"insertNode");var vB=g((e,t)=>{Sa.set(t.id,e)},"setNodeElem"),TB=g(()=>{Sa.clear()},"clear"),_B=g(e=>{const t=Sa.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"),ii=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"),Zt={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},yd={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function ho(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=$t(e),t=$t(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}g(ho,"calculateDeltaAndAngle");var $t=g(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),i0=g(e=>({x:g(function(t,r,i){let o=0;const s=$t(i[0]).x<$t(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Zt,e.arrowTypeStart)){const{angle:f,deltaX:p}=ho(i[0],i[1]);o=Zt[e.arrowTypeStart]*Math.cos(f)*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Zt,e.arrowTypeEnd)){const{angle:f,deltaX:p}=ho(i[i.length-1],i[i.length-2]);o=Zt[e.arrowTypeEnd]*Math.cos(f)*(p>=0?1:-1)}const a=Math.abs($t(t).x-$t(i[i.length-1]).x),n=Math.abs($t(t).y-$t(i[i.length-1]).y),l=Math.abs($t(t).x-$t(i[0]).x),c=Math.abs($t(t).y-$t(i[0]).y),h=Zt[e.arrowTypeStart],d=Zt[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let f=d+u-a;f*=s==="right"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=s==="right"?-1:1,o+=f}return $t(t).x+o},"x"),y:g(function(t,r,i){let o=0;const s=$t(i[0]).y<$t(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Zt,e.arrowTypeStart)){const{angle:f,deltaY:p}=ho(i[0],i[1]);o=Zt[e.arrowTypeStart]*Math.abs(Math.sin(f))*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Zt,e.arrowTypeEnd)){const{angle:f,deltaY:p}=ho(i[i.length-1],i[i.length-2]);o=Zt[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(p>=0?1:-1)}const a=Math.abs($t(t).y-$t(i[i.length-1]).y),n=Math.abs($t(t).x-$t(i[i.length-1]).x),l=Math.abs($t(t).y-$t(i[0]).y),c=Math.abs($t(t).x-$t(i[0]).x),h=Zt[e.arrowTypeStart],d=Zt[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let f=d+u-a;f*=s==="up"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=s==="up"?-1:1,o+=f}return $t(t).y+o},"y")}),"getLineFunctionsWithOffset"),BB=g((e,t,r,i,o,s=!1,a)=>{t.arrowTypeStart&&xd(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&xd(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),LB={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}},EB=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],xd=g((e,t,r,i,o,s,a=!1,n)=>{const l=LB[r],c=l&&EB.includes(l.type);if(!l){V.warn(`Unknown arrow type: ${r}`);return}const h=l.type,f=`${o}_${s}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const p=n.replace(/[^\dA-Za-z]/g,"_"),m=`${f}_${p}`;if(!document.getElementById(m)){const y=document.getElementById(f);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}#${f})`)},"addEdgeMarker"),FB=g(e=>typeof e=="string"?e:kt()?.flowchart?.curve,"resolveEdgeCurveType"),Lo=new Map,Ut=new Map,AB=g(()=>{Lo.clear(),Ut.clear()},"clear"),to=g(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),o0=g(async(e,t)=>{const r=kt();let i=ee(r);const{labelStyles:o}=ot(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Oe(e,t.label,{style:to(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 f=c.children[0],p=yt(c);h=f.getBoundingClientRect(),d=h,p.attr("width",h.width),p.attr("height",h.height)}else{const f=yt(c).select("text").node();f&&typeof f.getBBox=="function"&&(d=f.getBBox())}a.attr("transform",ii(d,i)),Lo.set(t.id,s),t.width=h.width,t.height=h.height;let u;if(t.startLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(p,t.startLabelLeft,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startLeft=f,co(u,t.startLabelLeft)}if(t.startLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(p,t.startLabelRight,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startRight=f,co(u,t.startLabelRight)}if(t.endLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(f,t.endLabelLeft,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endLeft=f,co(u,t.endLabelLeft)}if(t.endLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),m=await lr(f,t.endLabelRight,to(t.labelStyle)||"",!1,!1);u=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",ii(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endRight=f,co(u,t.endLabelRight)}return c},"insertEdgeLabel");function co(e,t){ee(kt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(co,"setTerminalWidth");var s0=g((e,t)=>{V.debug("Moving label abc88 ",e.id,e.label,Lo.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=kt(),{subGraphTitleTotalMargin:o}=ya(i);if(e.label){const s=Lo.get(e.id);let a=e.x,n=e.y;if(r){const l=xe.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)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Ut.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Ut.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Ut.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Ut.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=xe.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),MB=g((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),s=Math.abs(i.y-r.y);return o<.001||s<.001?t:s>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),$B=g((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),OB=g((e,t,r)=>{V.debug(`intersection calc abc89:
|
|
294
294
|
outsidePoint: ${JSON.stringify(t)}
|
|
295
295
|
insidePoint : ${JSON.stringify(r)}
|
|
296
|
-
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-s:a+s;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(o-t.y)*a>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-o:o-l-t.y;n=h*d/c;const u={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&&(u.x=t.x,u.y=t.y),h===0&&(u.x=t.x),c===0&&(u.y=t.y),V.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${n}`,u),u}else{r.x<t.x?n=t.x-a-i:n=i-a-t.x;let d=c*n/h,u=r.x<t.x?r.x+h-n:r.x-h+n,f=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:u,_y:f}),n===0&&(u=t.x,f=t.y),h===0&&(u=t.x),c===0&&(f=t.y),{x:u,y:f}}},"intersection"),Cd=g((e,t)=>{V.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(V.info("abc88 checking point",s,t),!MB(t,s)&&!o){const a=$B(t,i,s);V.debug("abc88 inside",s,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),o=!0}else V.warn("abc88 outside",s,i),i=s,o||r.push(s)}),V.debug("returning points",r),r},"cutPathAtIntersect");function s0(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],s=e[i],a=e[i+1];(o.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}g(s0,"extractCornerPoints");var bd=g(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),OB=g(function(e){const{cornerPointPositions:t}=s0(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],s=e[i+1],a=e[i],n=bd(o,a,5),l=bd(s,a,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let u={x:a.x,y:a.y};if(Math.abs(s.x-o.x)>10&&Math.abs(s.y-o.y)>=10){V.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const f=5;a.x===n.x?u={x:c<0?n.x-f+d:n.x+f-d,y:h<0?n.y-d:n.y+d}:u={x:c<0?n.x-d:n.x+d,y:h<0?n.y-f+d:n.y+f-d}}else V.debug("Corner point skipping fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));r.push(u,l)}else r.push(e[i]);return r},"fixCorners"),RB=g((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),l=Array(n).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),a0=g(function(e,t,r,i,o,s,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}=kt();let h=t.points,d=!1;const u=o;var f=s;const p=[];for(const P in t.cssCompiledStyles)rh(P)||p.push(t.cssCompiledStyles[P]);if(c==="swimlane"){if(f.intersect&&u.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[u.intersect(h[0]),f.intersect(h[1])];else{const P=h.slice(1,-1),I=P[0],j=P[P.length-1],T=.5,U=Math.abs(h[h.length-1].x-j.x)<T&&Math.abs(h[h.length-1].y-j.y)<T,z=u.intersect(I),G=U?j:f.intersect(j),X=Math.abs(G.x-j.x)<T&&Math.abs(G.y-j.y)<T,Q=Math.abs(z.x-I.x)<T&&Math.abs(z.y-I.y)<T?[]:[z],nt=X?[]:[G];h=[...Q,...P,...nt]}h=AB(t,h)}else f.intersect&&u.intersect&&!n&&(h=h.slice(1,t.points.length-1),h.unshift(u.intersect(h[0])),h.push(f.intersect(h[h.length-1])));const m=btoa(JSON.stringify(h));t.toCluster&&(V.info("to cluster abc88",r.get(t.toCluster)),h=Cd(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=Cd(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(P=>!Number.isNaN(P.y));const x=EB(t.curve);x!=="rounded"&&(y=OB(y));let C=go;switch(x){case"linear":C=go;break;case"basis":C=Ms;break;case"cardinal":C=bf;break;case"bumpX":C=gf;break;case"bumpY":C=mf;break;case"catmullRom":C=wf;break;case"monotoneX":C=Lf;break;case"monotoneY":C=Ef;break;case"natural":C=Af;break;case"step":C=Mf;break;case"stepAfter":C=Of;break;case"stepBefore":C=$f;break;case"rounded":C=go;break;default:C=Ms}const{x:k,y:S}=r0(t),v=ff().x(k).y(S).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 E,B=x==="rounded"?n0(l0(y,t),5):v(y);const O=Array.isArray(t.style)?t.style:[t.style];let A=O.find(P=>P?.startsWith("stroke:")),D="";t.animate&&(D="edge-animation-fast"),t.animation&&(D="edge-animation-"+t.animation);let W=!1;if(t.look==="handDrawn"){const P=rt.svg(e);Object.assign([],y);const I=P.path(B,{roughness:.3,seed:l});_+=" transition",E=yt(I).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",O?O.reduce((T,U)=>T+";"+U,""):"");let j=E.attr("d");E.attr("d",j),e.node().appendChild(E.node())}else{const P=p.join(";"),I=O?O.reduce((X,K)=>X+K+";",""):"",j=(P?P+";"+I+";":I)+";"+(O?O.reduce((X,K)=>X+";"+K,""):"");E=e.append("path").attr("d",B).attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",j),A=j.match(/stroke:([^;]+)/)?.[1],W=t.animate===!0||!!t.animation||P.includes("animation");const T=E.node(),U=typeof T.getTotalLength=="function"?T.getTotalLength():0,z=yd[t.arrowTypeStart]||0,G=yd[t.arrowTypeEnd]||0;if(t.look==="neo"&&!W){const K=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?RB(U,z,G):`0 ${z} ${U-z-G} ${G}`}; stroke-dashoffset: 0;`;E.attr("style",K+E.attr("style"))}}E.attr("data-edge",!0),E.attr("data-et","edge"),E.attr("data-id",t.id),E.attr("data-points",m),E.attr("data-look",Xt(t.look)),t.showPoints&&y.forEach(P=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",P.x).attr("cy",P.y)});let R="";(kt().flowchart.arrowMarkerAbsolute||kt().state.arrowMarkerAbsolute)&&(R=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,R=R.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",t.arrowTypeStart),V.info("arrowTypeEnd",t.arrowTypeEnd);const N=!W&&t?.look==="neo";_B(E,t,R,a,i,N,A);const F=Math.floor(h.length/2),$=h[F];xe.isLabelCoordinateInPath($,E.attr("d"))||(d=!0);let q={};return d&&(q.updatedPath=h),q.originalPath=t.points,q},"insertEdge");function n0(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s<i;s++){const a=e[s],n=e[s-1],l=e[s+1];if(s===0)r+=`M${a.x},${a.y}`;else if(s===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,u=l.y-a.y,f=Math.hypot(c,h),p=Math.hypot(d,u);if(f<o||p<o){r+=`L${a.x},${a.y}`;continue}const m=c/f,y=h/f,x=d/p,C=u/p,k=m*x+y*C,S=Math.max(-1,Math.min(1,k)),v=Math.acos(S);if(v<o||Math.abs(Math.PI-v)<o){r+=`L${a.x},${a.y}`;continue}const _=Math.min(t/Math.sin(v/2),f/2,p/2),E=a.x-m*_,B=a.y-y*_,O=a.x+x*_,A=a.y+C*_;r+=`L${E},${B}`,r+=`Q${a.x},${a.y} ${O},${A}`}}return r}g(n0,"generateRoundedPath");function cl(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(cl,"calculateDeltaAndAngle");function l0(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&Zt[t.arrowTypeStart]){const o=Zt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=cl(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&Zt[t.arrowTypeEnd]){const o=Zt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=cl(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}g(l0,"applyMarkerOffsetsToPoints");var IB=g((e,t,r,i)=>{t.forEach(o=>{sL[o](e,r,i)})},"insertMarkers"),PB=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"),DB=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"),NB=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"),qB=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"),zB=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"),jB=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"),WB=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"),HB=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"),YB=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"),UB=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{transitionColor:s}=o;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",`${s}`)},"barbNeo"),XB=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"),GB=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 o=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");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),VB=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"),KB=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 o=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");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),ZB=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o;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",`${s}`),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",`${s}`)},"only_one_neo"),QB=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,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",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);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",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),JB=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o;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",`${s}`),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",`${s}`)},"one_or_more_neo"),tL=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,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",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);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",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),eL=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
|
|
296
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-s:a+s;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(o-t.y)*a>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-o:o-l-t.y;n=h*d/c;const u={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&&(u.x=t.x,u.y=t.y),h===0&&(u.x=t.x),c===0&&(u.y=t.y),V.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${n}`,u),u}else{r.x<t.x?n=t.x-a-i:n=i-a-t.x;let d=c*n/h,u=r.x<t.x?r.x+h-n:r.x-h+n,f=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:u,_y:f}),n===0&&(u=t.x,f=t.y),h===0&&(u=t.x),c===0&&(f=t.y),{x:u,y:f}}},"intersection"),Cd=g((e,t)=>{V.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(V.info("abc88 checking point",s,t),!$B(t,s)&&!o){const a=OB(t,i,s);V.debug("abc88 inside",s,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),o=!0}else V.warn("abc88 outside",s,i),i=s,o||r.push(s)}),V.debug("returning points",r),r},"cutPathAtIntersect");function a0(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],s=e[i],a=e[i+1];(o.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}g(a0,"extractCornerPoints");var bd=g(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),RB=g(function(e){const{cornerPointPositions:t}=a0(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],s=e[i+1],a=e[i],n=bd(o,a,5),l=bd(s,a,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let u={x:a.x,y:a.y};if(Math.abs(s.x-o.x)>10&&Math.abs(s.y-o.y)>=10){V.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const f=5;a.x===n.x?u={x:c<0?n.x-f+d:n.x+f-d,y:h<0?n.y-d:n.y+d}:u={x:c<0?n.x-d:n.x+d,y:h<0?n.y-f+d:n.y+f-d}}else V.debug("Corner point skipping fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));r.push(u,l)}else r.push(e[i]);return r},"fixCorners"),IB=g((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),l=Array(n).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),n0=g(function(e,t,r,i,o,s,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}=kt();let h=t.points,d=!1;const u=o;var f=s;const p=[];for(const O in t.cssCompiledStyles)rh(O)||p.push(t.cssCompiledStyles[O]);if(c==="swimlane"){if(f.intersect&&u.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[u.intersect(h[0]),f.intersect(h[1])];else{const O=h.slice(1,-1),$=O[0],j=O[O.length-1],T=.5,W=Math.abs(h[h.length-1].x-j.x)<T&&Math.abs(h[h.length-1].y-j.y)<T,z=u.intersect($),G=W?j:f.intersect(j),X=Math.abs(G.x-j.x)<T&&Math.abs(G.y-j.y)<T,Q=Math.abs(z.x-$.x)<T&&Math.abs(z.y-$.y)<T?[]:[z],nt=X?[]:[G];h=[...Q,...O,...nt]}h=MB(t,h)}else f.intersect&&u.intersect&&!n&&(h=h.slice(1,t.points.length-1),h.unshift(u.intersect(h[0])),h.push(f.intersect(h[h.length-1])));const m=btoa(JSON.stringify(h));t.toCluster&&(V.info("to cluster abc88",r.get(t.toCluster)),h=Cd(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=Cd(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(O=>!Number.isNaN(O.y));const x=FB(t.curve);x!=="rounded"&&(y=RB(y));let C=go;switch(x){case"linear":C=go;break;case"basis":C=Ms;break;case"cardinal":C=kf;break;case"bumpX":C=mf;break;case"bumpY":C=yf;break;case"catmullRom":C=Sf;break;case"monotoneX":C=Ef;break;case"monotoneY":C=Ff;break;case"natural":C=Mf;break;case"step":C=$f;break;case"stepAfter":C=Rf;break;case"stepBefore":C=Of;break;case"rounded":C=go;break;default:C=Ms}const{x:k,y:S}=i0(t),v=pf().x(k).y(S).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 E,B=x==="rounded"?l0(h0(y,t),5):v(y);const I=Array.isArray(t.style)?t.style:[t.style];let M=I.find(O=>O?.startsWith("stroke:")),D="";t.animate&&(D="edge-animation-fast"),t.animation&&(D="edge-animation-"+t.animation);let U=!1;if(t.look==="handDrawn"){const O=rt.svg(e);Object.assign([],y);const $=O.path(B,{roughness:.3,seed:l});_+=" transition",E=yt($).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",I?I.reduce((T,W)=>T+";"+W,""):"");let j=E.attr("d");E.attr("d",j),e.node().appendChild(E.node())}else{const O=p.join(";"),$=I?I.reduce((X,K)=>X+K+";",""):"",j=(O?O+";"+$+";":$)+";"+(I?I.reduce((X,K)=>X+";"+K,""):"");E=e.append("path").attr("d",B).attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",j),M=j.match(/stroke:([^;]+)/)?.[1],U=t.animate===!0||!!t.animation||O.includes("animation");const T=E.node(),W=typeof T.getTotalLength=="function"?T.getTotalLength():0,z=yd[t.arrowTypeStart]||0,G=yd[t.arrowTypeEnd]||0;if(t.look==="neo"&&!U){const K=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?IB(W,z,G):`0 ${z} ${W-z-G} ${G}`}; stroke-dashoffset: 0;`;E.attr("style",K+E.attr("style"))}}E.attr("data-edge",!0),E.attr("data-et","edge"),E.attr("data-id",t.id),E.attr("data-points",m),E.attr("data-look",Xt(t.look)),t.showPoints&&y.forEach(O=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",O.x).attr("cy",O.y)});let q="";(kt().flowchart.arrowMarkerAbsolute||kt().state.arrowMarkerAbsolute)&&(q=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,q=q.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",t.arrowTypeStart),V.info("arrowTypeEnd",t.arrowTypeEnd);const N=!U&&t?.look==="neo";BB(E,t,q,a,i,N,M);const A=Math.floor(h.length/2),F=h[A];xe.isLabelCoordinateInPath(F,E.attr("d"))||(d=!0);let P={};return d&&(P.updatedPath=h),P.originalPath=t.points,P},"insertEdge");function l0(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s<i;s++){const a=e[s],n=e[s-1],l=e[s+1];if(s===0)r+=`M${a.x},${a.y}`;else if(s===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,u=l.y-a.y,f=Math.hypot(c,h),p=Math.hypot(d,u);if(f<o||p<o){r+=`L${a.x},${a.y}`;continue}const m=c/f,y=h/f,x=d/p,C=u/p,k=m*x+y*C,S=Math.max(-1,Math.min(1,k)),v=Math.acos(S);if(v<o||Math.abs(Math.PI-v)<o){r+=`L${a.x},${a.y}`;continue}const _=Math.min(t/Math.sin(v/2),f/2,p/2),E=a.x-m*_,B=a.y-y*_,I=a.x+x*_,M=a.y+C*_;r+=`L${E},${B}`,r+=`Q${a.x},${a.y} ${I},${M}`}}return r}g(l0,"generateRoundedPath");function cl(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(cl,"calculateDeltaAndAngle");function h0(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&Zt[t.arrowTypeStart]){const o=Zt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=cl(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&Zt[t.arrowTypeEnd]){const o=Zt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=cl(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}g(h0,"applyMarkerOffsetsToPoints");var PB=g((e,t,r,i)=>{t.forEach(o=>{aL[o](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"),NB=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"),qB=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"),zB=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"),jB=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"),WB=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"),HB=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"),YB=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"),UB=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"),XB=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{transitionColor:s}=o;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",`${s}`)},"barbNeo"),GB=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"),VB=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 o=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");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),KB=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"),ZB=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 o=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");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),QB=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o;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",`${s}`),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",`${s}`)},"only_one_neo"),JB=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,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",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);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",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),tL=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o;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",`${s}`),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",`${s}`)},"one_or_more_neo"),eL=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,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",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);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",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),rL=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
297
|
L20,10
|
|
298
298
|
M20,10
|
|
299
|
-
L0,20`)},"requirement_arrow"),
|
|
299
|
+
L0,20`)},"requirement_arrow"),iL=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o;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",`${s}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
|
|
300
300
|
L20,10
|
|
301
301
|
M20,10
|
|
302
|
-
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),iL=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"),oL=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o,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",`${s}`)},"requirement_contains_neo"),sL={extension:PB,composition:DB,aggregation:NB,dependency:qB,lollipop:zB,point:jB,circle:WB,cross:HB,barb:YB,barbNeo:UB,only_one:XB,zero_or_one:GB,one_or_more:VB,zero_or_more:KB,only_one_neo:ZB,zero_or_one_neo:QB,one_or_more_neo:JB,zero_or_more_neo:tL,requirement_arrow:eL,requirement_contains:iL,requirement_arrow_neo:rL,requirement_contains_neo:oL},h0=IB,aL={common:Pi,getConfig:Ot,insertCluster:Rm,insertEdge:a0,insertEdgeLabel:i0,insertMarkers:h0,insertNode:Fh,interpolateToCurve:hh,labelHelper:ht,log:V,positionEdgeLabel:o0},Eo={},c0=g(e=>{for(const t of e)Eo[t.name]=t},"registerLayoutLoaders"),nL=g(()=>{c0([{name:"dagre",loader:g(async()=>await Promise.resolve().then(()=>require("./dagre-VKFMJZFB-DByE8-C9.cjs")),"loader")},{name:"swimlane",loader:g(async()=>await Promise.resolve().then(()=>require("./swimlanes-5IMT3BWC-CZzTj7hi.cjs")),"loader")},{name:"cose-bilkent",loader:g(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-JH36ORCC-CWD_TQFn.cjs")),"loader")}])},"registerDefaultLayoutLoaders");nL();var lL=g(async(e,t,r)=>{if(!(e.layoutAlgorithm in Eo))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const u=d.domId||d.id;d.domId=`${e.diagramId}-${u}`}const i=Eo[e.layoutAlgorithm],o=await i.loader(),{theme:s,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",`${s?.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",`${s?.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 o.render(e,t,aL,{algorithm:i.algorithm},r)},"render"),hL=g((e="",{fallback:t="dagre"}={})=>{if(e in Eo)return e;if(t in Eo)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"),Ah="comm",d0="rule",u0="decl",cL="@media",dL="@import",uL="@supports",fL="@namespace",dl="@keyframes",f0="@layer",pL="@scope",gL=Math.abs,xo=String.fromCharCode;function p0(e){return e.trim()}function ul(e,t,r){return e.replace(t,r)}function hi(e,t){return e.charCodeAt(t)|0}function Oi(e,t,r){return e.slice(t,r)}function De(e){return e.length}function g0(e){return e.length}function es(e,t){return t.push(e),e}var va=1,Ri=1,m0=0,be=0,Nt=0,ji="";function Mh(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:va,column:Ri,length:a,return:"",siblings:n}}function mL(){return Nt}function yL(){return Nt=be>0?hi(ji,--be):0,Ri--,Nt===10&&(Ri=1,va--),Nt}function Ae(){return Nt=be<m0?hi(ji,be++):0,Ri++,Nt===10&&(Ri=1,va++),Nt}function hr(){return hi(ji,be)}function gs(){return be}function Ta(e,t){return Oi(ji,e,t)}function Fo(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 xL(e){return va=Ri=1,m0=De(ji=e),be=0,[]}function CL(e){return ji="",e}function en(e){return p0(Ta(be-1,fl(e===91?e+2:e===40?e+1:e)))}function bL(e){for(;(Nt=hr())&&Nt<33;)Ae();return Fo(e)>2||Fo(Nt)>3?"":" "}function kL(e,t){for(;--t&&Ae()&&!(Nt<48||Nt>102||Nt>57&&Nt<65||Nt>70&&Nt<97););return Ta(e,gs()+(t<6&&hr()==32&&Ae()==32))}function fl(e){for(;Ae();)switch(Nt){case e:return be;case 34:case 39:e!==34&&e!==39&&fl(Nt);break;case 40:e===41&&fl(e);break;case 92:Ae();break}return be}function wL(e,t){for(;Ae()&&e+Nt!==57;)if(e+Nt===84&&hr()===47)break;return"/*"+Ta(t,be-1)+"*"+xo(e===47?e:Ae())}function SL(e){for(;!Fo(hr());)Ae();return Ta(e,be)}function vL(e){return CL(ms("",null,null,null,[""],e=xL(e),0,[0],e))}function ms(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,u=0,f=0,p=0,m=1,y=1,x=1,C=0,k=0,S="",v=o,_=s,E=i,B=S;y;)switch(p=k,k=Ae()){case 40:p!=108&&hi(B,d-1)==58?(C++,B+="("):B+=en(k);break;case 41:C--,B+=")";break;case 34:case 39:case 91:B+=en(k);break;case 9:case 10:case 13:case 32:if(C>0){B+=xo(k);break}B+=bL(p);break;case 92:B+=kL(gs()-1,7);continue;case 47:switch(hr()){case 42:case 47:es(TL(wL(Ae(),gs()),t,r,l),l),(Fo(p||1)==5||Fo(hr()||1)==5)&&De(B)&&Oi(B,-1,void 0)!==" "&&(B+=" ");break;default:B+="/"}break;case 123*m:n[c++]=De(B)*x;case 125*m:case 59:case 0:if(C>0&&k){B+=xo(k);break}switch(k){case 0:case 125:y=0;case 59+h:x==-1&&(B=ul(B,/\f/g,"")),f>0&&(De(B)-d||m===0)&&es(f>32?wd(B+";",i,r,d-1,l):wd(ul(B," ","")+";",i,r,d-2,l),l);break;case 59:B+=";";default:if(es(E=kd(B,t,r,c,h,o,n,S,v=[],_=[],d,s),s),k===123)if(h===0)ms(B,t,E,E,v,s,d,n,_);else{switch(u){case 99:if(hi(B,3)===110)break;case 108:if(hi(B,2)===97)break;default:h=0;case 100:case 109:case 115:}h?ms(e,E,E,i&&es(kd(e,E,E,0,0,o,n,S,o,v=[],d,_),_),o,_,d,n,i?v:_):ms(B,E,E,E,[""],_,0,n,_)}}c=h=f=0,m=x=1,S=B="",d=a;break;case 58:d=1+De(B),f=p;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&yL()==125)continue}switch(B+=xo(k),k*m){case 38:x=h>0?1:(B+="\f",-1);break;case 44:if(C>0)break;n[c++]=(De(B)-1)*x,x=1;break;case 64:hr()===45&&(B+=en(Ae())),u=hr(),h=d=De(S=B+=SL(gs())),k++;break;case 45:p===45&&De(B)==2&&(m=0)}}return s}function kd(e,t,r,i,o,s,a,n,l,c,h,d){for(var u=o-1,f=o===0?s:[""],p=g0(f),m=0,y=0,x=0;m<i;++m)for(var C=0,k=Oi(e,u+1,u=gL(y=a[m])),S=e;C<p;++C)(S=p0(y>0?f[C]+" "+k:ul(k,/&\f/g,f[C])))&&(l[x++]=S);return Mh(e,t,r,o===0?d0:n,l,c,h,d)}function TL(e,t,r,i){return Mh(e,t,r,Ah,xo(mL()),Oi(e,2,-2),0,i)}function wd(e,t,r,i,o){return Mh(e,t,r,u0,Oi(e,0,i),Oi(e,i+1,-1),i,o)}function pl(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function _L(e,t,r,i){switch(e.type){case f0:if(e.children.length)break;case dL:case fL:case u0:return e.return=e.return||e.value;case Ah:return"";case dl:return e.return=e.value+"{"+pl(e.children,i)+"}";case d0:if(!De(e.value=e.props.join(",")))return""}return De(r=pl(e.children,i))?e.return=e.value+"{"+r+"}":""}function BL(e){var t=g0(e);return function(r,i,o,s){for(var a="",n=0;n<t;n++)a+=e[n](r,i,o,s)||"";return a}}var y0="c4",LL=g(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),EL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./c4Diagram-LMCZKHZV-BHj3qRWp.cjs"));return{id:y0,diagram:e}},"loader"),FL={id:y0,detector:LL,loader:EL},AL=FL,x0="flowchart",ML=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),$L=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-BaQLONgC.cjs"));return{id:x0,diagram:e}},"loader"),OL={id:x0,detector:ML,loader:$L},RL=OL,C0="flowchart-v2",IL=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"),PL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-BaQLONgC.cjs"));return{id:C0,diagram:e}},"loader"),DL={id:C0,detector:IL,loader:PL},NL=DL,b0="swimlane",qL=g(e=>/^\s*swimlane-beta\b/.test(e),"detector"),zL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./swimlanesDiagram-G3AALYLV-By4sYWRa.cjs"));return{id:b0,diagram:e}},"loader"),jL={id:b0,detector:qL,loader:zL},WL=jL,k0="er",HL=g(e=>/^\s*erDiagram/.test(e),"detector"),YL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./erDiagram-Q63AITRT-fnT4vBqH.cjs"));return{id:k0,diagram:e}},"loader"),UL={id:k0,detector:HL,loader:YL},XL=UL,w0="gitGraph",GL=g(e=>/^\s*gitGraph/.test(e),"detector"),VL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./gitGraphDiagram-IHSO6WYX-DFUHvrlM.cjs"));return{id:w0,diagram:e}},"loader"),KL={id:w0,detector:GL,loader:VL},ZL=KL,S0="gantt",QL=g(e=>/^\s*gantt/.test(e),"detector"),JL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ganttDiagram-NO4QXBWP-DC3d7PwO.cjs"));return{id:S0,diagram:e}},"loader"),tE={id:S0,detector:QL,loader:JL},eE=tE,v0="info",rE=g(e=>/^\s*info/.test(e),"detector"),iE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./infoDiagram-FWYZ7A6U-CM_qocjy.cjs"));return{id:v0,diagram:e}},"loader"),oE={id:v0,detector:rE,loader:iE},T0="pie",sE=g(e=>/^\s*pie/.test(e),"detector"),aE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pieDiagram-ENE6RG2P-LLQzK8bv.cjs"));return{id:T0,diagram:e}},"loader"),nE={id:T0,detector:sE,loader:aE},_0="quadrantChart",lE=g(e=>/^\s*quadrantChart/.test(e),"detector"),hE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./quadrantDiagram-ABIIQ3AL-DjC_l1Fw.cjs"));return{id:_0,diagram:e}},"loader"),cE={id:_0,detector:lE,loader:hE},dE=cE,B0="xychart",uE=g(e=>/^\s*xychart(-beta)?/.test(e),"detector"),fE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./xychartDiagram-FW5EYKEG-D1mJfFkC.cjs"));return{id:B0,diagram:e}},"loader"),pE={id:B0,detector:uE,loader:fE},gE=pE,L0="requirement",mE=g(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),yE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./requirementDiagram-TGXJPOKE-DkGh_vLW.cjs"));return{id:L0,diagram:e}},"loader"),xE={id:L0,detector:mE,loader:yE},CE=xE,E0="sequence",bE=g(e=>/^\s*sequenceDiagram/.test(e),"detector"),kE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sequenceDiagram-DBY2YBRQ-DcWj7JMz.cjs"));return{id:E0,diagram:e}},"loader"),wE={id:E0,detector:bE,loader:kE},SE=wE,F0="class",vE=g((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),TE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-OUVF2IWQ-HX7id7VH.cjs"));return{id:F0,diagram:e}},"loader"),_E={id:F0,detector:vE,loader:TE},BE=_E,A0="classDiagram",LE=g((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),EE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-v2-EOCWNBFH-HX7id7VH.cjs"));return{id:A0,diagram:e}},"loader"),FE={id:A0,detector:LE,loader:EE},AE=FE,M0="state",ME=g((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),$E=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-2N3HPSRC-CMBwcQE6.cjs"));return{id:M0,diagram:e}},"loader"),OE={id:M0,detector:ME,loader:$E},RE=OE,$0="stateDiagram",IE=g((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),PE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-v2-6OUMAXLB-7UPtJqUO.cjs"));return{id:$0,diagram:e}},"loader"),DE={id:$0,detector:IE,loader:PE},NE=DE,O0="journey",qE=g(e=>/^\s*journey/.test(e),"detector"),zE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./journeyDiagram-5HDEW3XC-DKxRZGZY.cjs"));return{id:O0,diagram:e}},"loader"),jE={id:O0,detector:qE,loader:zE},WE=jE,HE=g((e,t,r)=>{V.debug(`rendering svg for syntax error
|
|
303
|
-
`);const i=
|
|
304
|
-
`;try{wn(o)}catch{const c=
|
|
302
|
+
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),oL=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"),sL=g((e,t,r)=>{const i=Ot(),{themeVariables:o}=i,{strokeWidth:s}=o,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",`${s}`)},"requirement_contains_neo"),aL={extension:DB,composition:NB,aggregation:qB,dependency:zB,lollipop:jB,point:WB,circle:HB,cross:YB,barb:UB,barbNeo:XB,only_one:GB,zero_or_one:VB,one_or_more:KB,zero_or_more:ZB,only_one_neo:QB,zero_or_one_neo:JB,one_or_more_neo:tL,zero_or_more_neo:eL,requirement_arrow:rL,requirement_contains:oL,requirement_arrow_neo:iL,requirement_contains_neo:sL},c0=PB,nL={common:Pi,getConfig:Ot,insertCluster:Im,insertEdge:n0,insertEdgeLabel:o0,insertMarkers:c0,insertNode:Fh,interpolateToCurve:hh,labelHelper:ht,log:V,positionEdgeLabel:s0},Eo={},d0=g(e=>{for(const t of e)Eo[t.name]=t},"registerLayoutLoaders"),lL=g(()=>{d0([{name:"dagre",loader:g(async()=>await Promise.resolve().then(()=>require("./dagre-VKFMJZFB-CfOPJOfT.cjs")),"loader")},{name:"swimlane",loader:g(async()=>await Promise.resolve().then(()=>require("./swimlanes-5IMT3BWC-DeNuvXGa.cjs")),"loader")},{name:"cose-bilkent",loader:g(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-JH36ORCC-DjBFwUgZ.cjs")),"loader")}])},"registerDefaultLayoutLoaders");lL();var hL=g(async(e,t,r)=>{if(!(e.layoutAlgorithm in Eo))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const u=d.domId||d.id;d.domId=`${e.diagramId}-${u}`}const i=Eo[e.layoutAlgorithm],o=await i.loader(),{theme:s,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",`${s?.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",`${s?.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 o.render(e,t,nL,{algorithm:i.algorithm},r)},"render"),cL=g((e="",{fallback:t="dagre"}={})=>{if(e in Eo)return e;if(t in Eo)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"),Ah="comm",u0="rule",f0="decl",dL="@media",uL="@import",fL="@supports",pL="@namespace",dl="@keyframes",p0="@layer",gL="@scope",mL=Math.abs,xo=String.fromCharCode;function g0(e){return e.trim()}function ul(e,t,r){return e.replace(t,r)}function hi(e,t){return e.charCodeAt(t)|0}function Oi(e,t,r){return e.slice(t,r)}function De(e){return e.length}function m0(e){return e.length}function es(e,t){return t.push(e),e}var va=1,Ri=1,y0=0,be=0,Nt=0,ji="";function Mh(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:va,column:Ri,length:a,return:"",siblings:n}}function yL(){return Nt}function xL(){return Nt=be>0?hi(ji,--be):0,Ri--,Nt===10&&(Ri=1,va--),Nt}function Ae(){return Nt=be<y0?hi(ji,be++):0,Ri++,Nt===10&&(Ri=1,va++),Nt}function hr(){return hi(ji,be)}function gs(){return be}function Ta(e,t){return Oi(ji,e,t)}function Fo(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 CL(e){return va=Ri=1,y0=De(ji=e),be=0,[]}function bL(e){return ji="",e}function en(e){return g0(Ta(be-1,fl(e===91?e+2:e===40?e+1:e)))}function kL(e){for(;(Nt=hr())&&Nt<33;)Ae();return Fo(e)>2||Fo(Nt)>3?"":" "}function wL(e,t){for(;--t&&Ae()&&!(Nt<48||Nt>102||Nt>57&&Nt<65||Nt>70&&Nt<97););return Ta(e,gs()+(t<6&&hr()==32&&Ae()==32))}function fl(e){for(;Ae();)switch(Nt){case e:return be;case 34:case 39:e!==34&&e!==39&&fl(Nt);break;case 40:e===41&&fl(e);break;case 92:Ae();break}return be}function SL(e,t){for(;Ae()&&e+Nt!==57;)if(e+Nt===84&&hr()===47)break;return"/*"+Ta(t,be-1)+"*"+xo(e===47?e:Ae())}function vL(e){for(;!Fo(hr());)Ae();return Ta(e,be)}function TL(e){return bL(ms("",null,null,null,[""],e=CL(e),0,[0],e))}function ms(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,u=0,f=0,p=0,m=1,y=1,x=1,C=0,k=0,S="",v=o,_=s,E=i,B=S;y;)switch(p=k,k=Ae()){case 40:p!=108&&hi(B,d-1)==58?(C++,B+="("):B+=en(k);break;case 41:C--,B+=")";break;case 34:case 39:case 91:B+=en(k);break;case 9:case 10:case 13:case 32:if(C>0){B+=xo(k);break}B+=kL(p);break;case 92:B+=wL(gs()-1,7);continue;case 47:switch(hr()){case 42:case 47:es(_L(SL(Ae(),gs()),t,r,l),l),(Fo(p||1)==5||Fo(hr()||1)==5)&&De(B)&&Oi(B,-1,void 0)!==" "&&(B+=" ");break;default:B+="/"}break;case 123*m:n[c++]=De(B)*x;case 125*m:case 59:case 0:if(C>0&&k){B+=xo(k);break}switch(k){case 0:case 125:y=0;case 59+h:x==-1&&(B=ul(B,/\f/g,"")),f>0&&(De(B)-d||m===0)&&es(f>32?wd(B+";",i,r,d-1,l):wd(ul(B," ","")+";",i,r,d-2,l),l);break;case 59:B+=";";default:if(es(E=kd(B,t,r,c,h,o,n,S,v=[],_=[],d,s),s),k===123)if(h===0)ms(B,t,E,E,v,s,d,n,_);else{switch(u){case 99:if(hi(B,3)===110)break;case 108:if(hi(B,2)===97)break;default:h=0;case 100:case 109:case 115:}h?ms(e,E,E,i&&es(kd(e,E,E,0,0,o,n,S,o,v=[],d,_),_),o,_,d,n,i?v:_):ms(B,E,E,E,[""],_,0,n,_)}}c=h=f=0,m=x=1,S=B="",d=a;break;case 58:d=1+De(B),f=p;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&xL()==125)continue}switch(B+=xo(k),k*m){case 38:x=h>0?1:(B+="\f",-1);break;case 44:if(C>0)break;n[c++]=(De(B)-1)*x,x=1;break;case 64:hr()===45&&(B+=en(Ae())),u=hr(),h=d=De(S=B+=vL(gs())),k++;break;case 45:p===45&&De(B)==2&&(m=0)}}return s}function kd(e,t,r,i,o,s,a,n,l,c,h,d){for(var u=o-1,f=o===0?s:[""],p=m0(f),m=0,y=0,x=0;m<i;++m)for(var C=0,k=Oi(e,u+1,u=mL(y=a[m])),S=e;C<p;++C)(S=g0(y>0?f[C]+" "+k:ul(k,/&\f/g,f[C])))&&(l[x++]=S);return Mh(e,t,r,o===0?u0:n,l,c,h,d)}function _L(e,t,r,i){return Mh(e,t,r,Ah,xo(yL()),Oi(e,2,-2),0,i)}function wd(e,t,r,i,o){return Mh(e,t,r,f0,Oi(e,0,i),Oi(e,i+1,-1),i,o)}function pl(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function BL(e,t,r,i){switch(e.type){case p0:if(e.children.length)break;case uL:case pL:case f0:return e.return=e.return||e.value;case Ah:return"";case dl:return e.return=e.value+"{"+pl(e.children,i)+"}";case u0:if(!De(e.value=e.props.join(",")))return""}return De(r=pl(e.children,i))?e.return=e.value+"{"+r+"}":""}function LL(e){var t=m0(e);return function(r,i,o,s){for(var a="",n=0;n<t;n++)a+=e[n](r,i,o,s)||"";return a}}var x0="c4",EL=g(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),FL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./c4Diagram-LMCZKHZV-Cr3HwHd7.cjs"));return{id:x0,diagram:e}},"loader"),AL={id:x0,detector:EL,loader:FL},ML=AL,C0="flowchart",$L=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),OL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-Cw3lE3iu.cjs"));return{id:C0,diagram:e}},"loader"),RL={id:C0,detector:$L,loader:OL},IL=RL,b0="flowchart-v2",PL=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-Cw3lE3iu.cjs"));return{id:b0,diagram:e}},"loader"),NL={id:b0,detector:PL,loader:DL},qL=NL,k0="swimlane",zL=g(e=>/^\s*swimlane-beta\b/.test(e),"detector"),jL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./swimlanesDiagram-G3AALYLV-Bxz106Lt.cjs"));return{id:k0,diagram:e}},"loader"),WL={id:k0,detector:zL,loader:jL},HL=WL,w0="er",YL=g(e=>/^\s*erDiagram/.test(e),"detector"),UL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./erDiagram-Q63AITRT-HV9x1ciI.cjs"));return{id:w0,diagram:e}},"loader"),XL={id:w0,detector:YL,loader:UL},GL=XL,S0="gitGraph",VL=g(e=>/^\s*gitGraph/.test(e),"detector"),KL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./gitGraphDiagram-IHSO6WYX-DDgZkg3G.cjs"));return{id:S0,diagram:e}},"loader"),ZL={id:S0,detector:VL,loader:KL},QL=ZL,v0="gantt",JL=g(e=>/^\s*gantt/.test(e),"detector"),tE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ganttDiagram-NO4QXBWP-XbcZyqEG.cjs"));return{id:v0,diagram:e}},"loader"),eE={id:v0,detector:JL,loader:tE},rE=eE,T0="info",iE=g(e=>/^\s*info/.test(e),"detector"),oE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./infoDiagram-FWYZ7A6U-DM1S6-Hc.cjs"));return{id:T0,diagram:e}},"loader"),sE={id:T0,detector:iE,loader:oE},_0="pie",aE=g(e=>/^\s*pie/.test(e),"detector"),nE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pieDiagram-ENE6RG2P-CEaHvWUM.cjs"));return{id:_0,diagram:e}},"loader"),lE={id:_0,detector:aE,loader:nE},B0="quadrantChart",hE=g(e=>/^\s*quadrantChart/.test(e),"detector"),cE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./quadrantDiagram-ABIIQ3AL-C5CTuaUm.cjs"));return{id:B0,diagram:e}},"loader"),dE={id:B0,detector:hE,loader:cE},uE=dE,L0="xychart",fE=g(e=>/^\s*xychart(-beta)?/.test(e),"detector"),pE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./xychartDiagram-FW5EYKEG-DDVfULUl.cjs"));return{id:L0,diagram:e}},"loader"),gE={id:L0,detector:fE,loader:pE},mE=gE,E0="requirement",yE=g(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),xE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./requirementDiagram-TGXJPOKE-h_ZfNqUh.cjs"));return{id:E0,diagram:e}},"loader"),CE={id:E0,detector:yE,loader:xE},bE=CE,F0="sequence",kE=g(e=>/^\s*sequenceDiagram/.test(e),"detector"),wE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sequenceDiagram-DBY2YBRQ-BE2rVf2w.cjs"));return{id:F0,diagram:e}},"loader"),SE={id:F0,detector:kE,loader:wE},vE=SE,A0="class",TE=g((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),_E=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-OUVF2IWQ-CEZdsWvZ.cjs"));return{id:A0,diagram:e}},"loader"),BE={id:A0,detector:TE,loader:_E},LE=BE,M0="classDiagram",EE=g((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),FE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-v2-EOCWNBFH-CEZdsWvZ.cjs"));return{id:M0,diagram:e}},"loader"),AE={id:M0,detector:EE,loader:FE},ME=AE,$0="state",$E=g((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),OE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-2N3HPSRC-Cts12p59.cjs"));return{id:$0,diagram:e}},"loader"),RE={id:$0,detector:$E,loader:OE},IE=RE,O0="stateDiagram",PE=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-B8p1-c97.cjs"));return{id:O0,diagram:e}},"loader"),NE={id:O0,detector:PE,loader:DE},qE=NE,R0="journey",zE=g(e=>/^\s*journey/.test(e),"detector"),jE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./journeyDiagram-5HDEW3XC-Cis5Fa71.cjs"));return{id:R0,diagram:e}},"loader"),WE={id:R0,detector:zE,loader:jE},HE=WE,YE=g((e,t,r)=>{V.debug(`rendering svg for syntax error
|
|
303
|
+
`);const i=If(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Fl(i,100,512,!0),o.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"),o.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"),o.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"),o.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"),o.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"),o.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"),o.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"),o.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"),I0={draw:YE},UE=I0,XE={db:{},renderer:I0,parser:{parse:g(()=>{},"parse")}},GE=XE,P0="flowchart-elk",VE=g((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),KE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-Cw3lE3iu.cjs"));return{id:P0,diagram:e}},"loader"),ZE={id:P0,detector:VE,loader:KE},QE=ZE,D0="timeline",JE=g(e=>/^\s*timeline/.test(e),"detector"),tF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./timeline-definition-FHXFAJF6-c15QQTDf.cjs"));return{id:D0,diagram:e}},"loader"),eF={id:D0,detector:JE,loader:tF},rF=eF,N0="mindmap",iF=g(e=>/^\s*mindmap/.test(e),"detector"),oF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./mindmap-definition-LN4V7U3C-CP0bNnn-.cjs"));return{id:N0,diagram:e}},"loader"),sF={id:N0,detector:iF,loader:oF},aF=sF,q0="kanban",nF=g(e=>/^\s*kanban/.test(e),"detector"),lF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./kanban-definition-HUTT4EX6-DcANcb4G.cjs"));return{id:q0,diagram:e}},"loader"),hF={id:q0,detector:nF,loader:lF},cF=hF,z0="sankey",dF=g(e=>/^\s*sankey(-beta)?/.test(e),"detector"),uF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sankeyDiagram-HTMAVEWB-DalNC8XY.cjs"));return{id:z0,diagram:e}},"loader"),fF={id:z0,detector:dF,loader:uF},pF=fF,j0="packet",gF=g(e=>/^\s*packet(-beta)?/.test(e),"detector"),mF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-NH7WQ7WH-avUTm6At.cjs"));return{id:j0,diagram:e}},"loader"),yF={id:j0,detector:gF,loader:mF},W0="radar",xF=g(e=>/^\s*radar-beta/.test(e),"detector"),CF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-WEI45ONY-DMANh2pW.cjs"));return{id:W0,diagram:e}},"loader"),bF={id:W0,detector:xF,loader:CF},H0="block",kF=g(e=>/^\s*block(-beta)?/.test(e),"detector"),wF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./blockDiagram-677ZJIJ3-3fEMZifU.cjs"));return{id:H0,diagram:e}},"loader"),SF={id:H0,detector:kF,loader:wF},vF=SF,Y0="treeView",TF=g(e=>/^\s*treeView-beta/.test(e),"detector"),_F=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-OA4YK3LP-v4R9pnOp.cjs"));return{id:Y0,diagram:e}},"loader"),BF={id:Y0,detector:TF,loader:_F},LF=BF,U0="architecture",EF=g(e=>/^\s*architecture/.test(e),"detector"),FF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./architectureDiagram-ZJ3FMSHR-DUr8yu65.cjs"));return{id:U0,diagram:e}},"loader"),AF={id:U0,detector:EF,loader:FF},MF=AF,X0="eventmodeling",$F=g(e=>/^\s*eventmodeling/.test(e),"detector"),OF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-FQU43EPY-BWf-0ZaX.cjs"));return{id:X0,diagram:e}},"loader"),RF={id:X0,detector:$F,loader:OF},IF=RF,G0="ishikawa",PF=g(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),DF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ishikawaDiagram-FXEZZL3T-CHzSqzMH.cjs"));return{id:G0,diagram:e}},"loader"),NF={id:G0,detector:PF,loader:DF},V0="venn",qF=g(e=>/^\s*venn-beta/.test(e),"detector"),zF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./vennDiagram-L72KCM5P-CjX3W2Ne.cjs"));return{id:V0,diagram:e}},"loader"),jF={id:V0,detector:qF,loader:zF},WF=jF,K0="treemap",HF=g(e=>/^\s*treemap/.test(e),"detector"),YF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-G47NLZAW-BmGTMih1.cjs"));return{id:K0,diagram:e}},"loader"),UF={id:K0,detector:HF,loader:YF},Z0="wardley",XF=g(e=>/^\s*wardley-beta/i.test(e),"detector"),GF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./wardleyDiagram-EHGQE667-UlY3HJxP.cjs"));return{id:Z0,diagram:e}},"loader"),VF={id:Z0,detector:XF,loader:GF},KF=VF,Q0="cynefin",ZF=g(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),QF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./cynefinDiagram-TSTJHNR4-CHqP9wNf.cjs"));return{id:Q0,diagram:e}},"loader"),JF={id:Q0,detector:ZF,loader:QF},J0="railroad",tA=g(e=>/^\s*railroad-beta/i.test(e),"detector"),eA=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./railroadDiagram-RFXS5EU6-C6-tc-QZ.cjs"));return{id:J0,diagram:e}},"loader"),rA={id:J0,detector:tA,loader:eA},tx="railroadEbnf",iA=g(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),oA=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ebnfDiagram-CCIWWBDH-DViSMuU5.cjs"));return{id:tx,diagram:e}},"loader"),sA={id:tx,detector:iA,loader:oA},ex="railroadAbnf",aA=g(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),nA=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./abnfDiagram-VRR7QNED-BrysG8di.cjs"));return{id:ex,diagram:e}},"loader"),lA={id:ex,detector:aA,loader:nA},rx="railroadPeg",hA=g(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),cA=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pegDiagram-2B236MQR-Brh5cxKw.cjs"));return{id:rx,diagram:e}},"loader"),dA={id:rx,detector:hA,loader:cA},Sd=!1,_a=g(()=>{Sd||(Sd=!0,vs("error",GE,e=>e.toLowerCase().trim()==="error"),vs("---",{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("---")),yn(QE,aF,MF),yn(ML,cF,ME,LE,GL,rE,sE,lE,bE,vE,HL,qL,IL,rF,QL,qE,IE,HE,uE,pF,yF,mE,vF,IF,LF,bF,NF,UF,rA,sA,lA,dA,WF,KF,JF))},"addDiagrams"),uA=g(async()=>{V.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Pr).map(async([r,{detector:i,loader:o}])=>{if(o)try{wn(r)}catch{try{const{diagram:s,id:a}=await o();vs(a,s,i)}catch(s){throw V.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Pr[r],s}}}))).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"),fA="graphics-document document";function ix(e,t){e.attr("role",fA),t!==""&&e.attr("aria-roledescription",t)}g(ix,"setA11yDiagramInfo");function ox(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}g(ox,"addSVGa11yTitleDescription");var Or,gl=(Or=class{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static async fromText(t,r={}){const i=Ot(),o=Ll(t,i);t=LT(t)+`
|
|
304
|
+
`;try{wn(o)}catch{const c=W1(o);if(!c)throw new wu(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();vs(h,d)}const{db:s,parser:a,renderer:n,init:l}=wn(o);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new Or(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},g(Or,"Diagram"),Or),vd=[],pA=g(()=>{vd.forEach(e=>{e()}),vd=[]},"attachFunctions"),gA=g(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function sx(e){const t=e.match(ku);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
|
|
305
305
|
`).map(a=>a.startsWith(r)?a.slice(r.length):a).join(`
|
|
306
|
-
`):t[2];let o=
|
|
307
|
-
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),
|
|
306
|
+
`):t[2];let o=Cg(i,{schema:xg})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const s={};return o.displayMode&&(s.displayMode=o.displayMode.toString()),o.title&&(s.title=o.title.toString()),o.config&&(s.config=o.config),{text:e.slice(t[0].length),metadata:s}}g(sx,"extractFrontMatter");var mA=g(e=>e.replace(/\r\n?/g,`
|
|
307
|
+
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),yA=g(e=>{const{text:t,metadata:r}=sx(e),{displayMode:i,title:o,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:o,config:s,text:t}},"processFrontmatter"),xA=g(e=>{const t=xe.detectInit(e)??{},r=xe.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:xT(e),directive:t}},"processDirectives");function $h(e){const t=mA(e),r=yA(t),i=xA(r.text),o=ma(r.config,i.directive);return e=gA(i.text),{code:e,title:r.title,config:o}}g($h,"preprocessDiagram");function ax(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}g(ax,"toBase64");var CA=5e4,bA="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",kA="sandbox",wA="loose",SA="http://www.w3.org/2000/svg",vA="http://www.w3.org/1999/xlink",TA="http://www.w3.org/1999/xhtml",_A="100%",BA="100%",LA="border:0;margin:0;",EA="margin:0",FA="allow-top-navigation-by-user-activation allow-popups",AA='The "iframe" tag is not supported by your browser.',MA=["foreignobject"],$A=["dominant-baseline"];function Oh(e){const t=$h(e);return ws(),N1(t.config??{}),t}g(Oh,"processAndSetConfigs");async function nx(e,t){_a();try{const{code:r,config:i}=Oh(e);return{diagramType:(await hx(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}g(nx,"parse");var Td=g((e,t,r=[])=>{const i=gu(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),OA=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=ee(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Dc(l.styles)||n.forEach(c=>{r.insertRule(Td(l.id,c,l.styles),r.cssRules.length)}),Dc(l.textStyles)||r.insertRule(Td(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 o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=kn(o)+`
|
|
308
308
|
`}else i+=`${e.themeCSS}
|
|
309
|
-
`;return i+kn(r)},"createCssStyles"),
|
|
310
|
-
${
|
|
311
|
-
</iframe>`},"putIntoIFrame"),_d=g((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",wA);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function ml(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}g(ml,"sandboxedIframe");var DA=g((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),NA=g(async function(e,t,r){_a();const i=Oh(t);t=i.code;const o=Ot();V.debug(o),t.length>(o?.maxTextSize??xA)&&(t=CA);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=g(()=>{const R=yt(u?n:c).node();R&&"remove"in R&&R.remove()},"removeTempElements");let d=yt(document.body);const u=o.securityLevel===bA,f=o.securityLevel===kA,p=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),u){const W=ml(yt(r),a);d=yt(W.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt(r);_d(d,e,l,`font-family: ${p}`,SA)}else{if(DA(document,e,l,a),u){const W=ml(yt(document.body),a);d=yt(W.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt("body");_d(d,e,l)}let m,y;try{m=await gl.fromText(t,{title:i.title})}catch(W){if(o.suppressErrorRendering)throw h(),W;m=await gl.fromText("error"),y=W}const x=d.select(c).node(),C=m.type,k=x.firstChild,S=k.firstChild,v=m.renderer.getClasses?.(t,m),_=RA(o,C,v,s),E=document.createElement("style");E.innerHTML=_,k.insertBefore(E,S);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(W){throw o.suppressErrorRendering?h():YE.draw(t,e,"11.16.0"),W}const B=d.select(`${c} svg`),O=m.db.getAccTitle?.(),A=m.db.getAccDescription?.();hx(C,B,O,A),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",vA);let D=d.select(c).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),D=IA(D,u,Ye(o.arrowMarkerAbsolute)),u){const W=d.select(c+" svg").node();D=PA(D,W)}else f||(D=Ti.sanitize(D,{ADD_TAGS:AA,ADD_ATTR:MA,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(fA(),y)throw y;return h(),{diagramType:C,svg:D,bindFunctions:m.db.bindFunctions}},"render");function nx(e={}){const t=qt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),I1(t),t?.theme&&t.theme in tr?t.themeVariables=tr[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=tr.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?R1(t):gu();Tl(r.logLevel),_a()}g(nx,"initialize");var lx=g((e,t={})=>{const{code:r}=$h(e);return gl.fromText(r,t)},"getDiagramFromText");function hx(e,t,r,i){rx(t,e),ix(t,r,i,t.attr("id"))}g(hx,"addA11yInfo");var zr=Object.freeze({render:NA,parse:ax,getDiagramFromText:lx,initialize:nx,getConfig:Ot,setConfig:mu,getSiteConfig:gu,updateSiteConfig:P1,reset:g(()=>{ws()},"reset"),globalReset:g(()=>{ws(Bi)},"globalReset"),defaultConfig:Bi});Tl(Ot().logLevel);ws(Ot());var qA=g((e,t,r)=>{V.warn(e),ph(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"),cx=g(async function(e={querySelector:".mermaid"}){try{await zA(e)}catch(t){if(ph(t)&&V.error(t.str),ir.parseError&&ir.parseError(t),!e.suppressErrors)throw V.error("Use the suppressErrors option to suppress these errors"),t}},"run"),zA=g(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=zr.getConfig();V.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");V.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(V.debug("Start On Load: "+i?.startOnLoad),zr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new xe.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(o)){if(V.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=fm(xe.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=xe.detectInit(a);h&&V.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:u}=await px(c,a,l);l.innerHTML=d,e&&await e(c),u&&u(l)}catch(d){qA(d,n,ir.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),dx=g(function(e){zr.initialize(e)},"initialize"),jA=g(async function(e,t,r){V.warn("mermaid.init is deprecated. Please use run instead."),e&&dx(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await cx(i)},"init"),WA=g(async(e,{lazyLoad:t=!0}={})=>{_a(),yn(...e),t===!1&&await dA()},"registerExternalDiagrams"),ux=g(function(){if(ir.startOnLoad){const{startOnLoad:e}=zr.getConfig();e&&ir.run().catch(t=>V.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",ux,!1);var HA=g(function(e){ir.parseError=e},"setParseErrorHandler"),Ks=[],rn=!1,fx=g(async()=>{if(!rn){for(rn=!0;Ks.length>0;){const e=Ks.shift();if(e)try{await e()}catch(t){V.error("Error executing queue",t)}}rn=!1}},"executeQueue"),YA=g(async(e,t)=>new Promise((r,i)=>{const o=g(()=>new Promise((s,a)=>{zr.parse(e,t).then(n=>{s(n),r(n)},n=>{V.error("Error parsing",n),ir.parseError?.(n),a(n),i(n)})}),"performCall");Ks.push(o),fx().catch(i)}),"parse"),px=g((e,t,r)=>new Promise((i,o)=>{const s=g(()=>new Promise((a,n)=>{zr.render(e,t,r).then(l=>{a(l),i(l)},l=>{V.error("Error parsing",l),ir.parseError?.(l),n(l),o(l)})}),"performCall");Ks.push(s),fx().catch(o)}),"render"),UA=g(()=>Object.keys(Pr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),ir={startOnLoad:!0,mermaidAPI:zr,parse:YA,render:px,init:jA,run:cx,registerExternalDiagrams:WA,registerLayoutLoaders:c0,initialize:dx,parseError:void 0,contentLoaded:ux,setParseErrorHandler:HA,detectType:Ll,registerIconPacks:tm,getRegisteredDiagramsMetadata:UA},yl=ir;const jr="flex size-11 items-center justify-center rounded border p-1 shadow",XA="flex h-11 min-w-11 items-center justify-center rounded border px-2 text-sm shadow",GA="absolute top-full z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg",Bd="flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start",gx="both-shift",Ld=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})}),VA=Object.freeze(["none","zoom","pan","pan-shift","both","both-shift"]),KA=Object.freeze(["none","zoom","pan","both"]),ZA=Object.freeze({none:"none",zoom:"zoom",pan:"pan","pan-shift":"pan",both:"both","both-shift":"both"}),ys=.3,QA=3,JA=2,Lr=.5,tM=1;function Ed(e,t){return e.panTrigger!==null&&t?e.zoom?"none":"pinch-zoom":e.zoom?"pan-x pan-y":"auto"}const eM=0;function on(e,t,r){return e.panTrigger===null||t.button!==eM?!1:t.pointerType==="touch"||t.pointerType==="pen"?r:e.panTrigger==="drag"||t.shiftKey}function rM(e,t){return e.zoom&&t.shiftKey}function iM(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 oM(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 sM(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:JA/e}}function sn(e,t){return Math.min(t.maxScale,Math.max(t.minScale,e))}function eo(e,t,r,i,o){return{scale:t,x:e.x+(i.x-o.origin.x)/t-(r.x-o.origin.x)/e.scale,y:e.y+(i.y-o.origin.y)/t-(r.y-o.origin.y)/e.scale}}function aM(e,t,r){const i=(o,s,a,n)=>{const l=(0-s)/e.scale,c=(n-s-e.scale*a)/e.scale;return Math.min(Math.max(l,c),Math.max(Math.min(l,c),o))};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 nM(e,t,r){return e*t.inline-r.inline>Lr||e*t.block-r.block>Lr}function lM(e,t){const r=s=>Math.hypot(s[1].x-s[0].x,s[1].y-s[0].y),i=s=>({x:(s[0].x+s[1].x)/2,y:(s[0].y+s[1].y)/2}),o=r(e);return o<tM?null:{ratio:r(t)/o,from:i(e),to:i(t)}}function Fd(e){return e*(1-Math.exp(-ys))}function Ad(e,t,r){const i=e<-Lr||e>Lr;return t-e>r+Lr?i?0-e:0:e<-Lr?0-e:t>r+Lr?r-t:0}const Ba=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"}}),hM=Qs(Ba),cM=Object.freeze({none:"modeNone",zoom:"modeZoom",pan:"modePan","pan-shift":"modePanShift",both:"modeBoth","both-shift":"modeBothShift"}),dM=Object.freeze({none:"modeNoneTouch",zoom:"modeZoomTouch",pan:"modePanTouch",both:"modeBothTouch"}),mx="(pointer: coarse)",uM=e=>{const t=window.matchMedia(mx);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},fM=()=>window.matchMedia(mx).matches,pM=()=>!1,gM=()=>L.useSyncExternalStore(uM,fM,pM),Rh=(e,t)=>{const[r,i]=L.useState(null),o=r!==null&&e.includes(r)?r:e[0],s=l=>l instanceof Element?l.getAttribute(t):null;return{onKeyDown:l=>{const c=s(l.target);if(c===null||l.altKey||l.ctrlKey||l.metaKey||l.shiftKey)return;const h=e.indexOf(c);if(h===-1)return;const d=l.currentTarget.ownerDocument.defaultView?.getComputedStyle(l.currentTarget).direction==="rtl",u=d?"ArrowLeft":"ArrowRight",f=d?"ArrowRight":"ArrowLeft";let p;switch(l.key){case u:p=(h+1)%e.length;break;case f:p=(h-1+e.length)%e.length;break;case"Home":p=0;break;case"End":p=e.length-1;break;default:return}l.preventDefault(),l.currentTarget.querySelector(`[${t}="${e[p]}"]`)?.focus()},onFocus:l=>{const c=s(l.target);c!==null&&e.includes(c)&&i(c)},tabIndexOf:l=>l===o?0:-1}},yx=({buttonHook:e,menuHook:t,label:r,icon:i,tabIndex:o,items:s})=>{const[a,n]=L.useState(null),[l,c]=L.useState(!1),h=a!==null,d=L.useId(),u=L.useId(),f=L.useRef(null),p=L.useRef(null),m=L.useRef(null),y=()=>Array.from(m.current?.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')??[]),x=S=>{n(null),c(!1),S&&p.current?.focus()};L.useLayoutEffect(()=>{const S=m.current;if(a===null||S===null)return;const v=S.ownerDocument.defaultView,_=S.ownerDocument.documentElement.clientWidth,E=S.getBoundingClientRect();(v?.getComputedStyle(S).direction==="rtl"?E.left<0:E.right>_)&&c(!0);const O=y(),A=O.findIndex(W=>W.getAttribute("aria-checked")==="true"),D=a==="last"?O.length-1:Math.max(A,0);O[D]?.focus()},[a]),L.useEffect(()=>{const S=f.current?.ownerDocument;if(!h||S===void 0)return;const v=_=>{_.target instanceof Node&&f.current?.contains(_.target)===!0||(n(null),c(!1))};return S.addEventListener("pointerdown",v,!0),S.addEventListener("focusin",v,!0),()=>{S.removeEventListener("pointerdown",v,!0),S.removeEventListener("focusin",v,!0)}},[h]);const C=S=>{if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),n(S.key==="ArrowUp"?"last":"chosen");return}S.key==="Escape"&&h&&(S.preventDefault(),S.stopPropagation(),x(!1))},k=S=>{const v=y(),_=v.indexOf(S.target);let E;switch(S.key){case"ArrowDown":E=(_+1)%v.length;break;case"ArrowUp":E=(_-1+v.length)%v.length;break;case"Home":E=0;break;case"End":E=v.length-1;break;case"Escape":S.preventDefault(),S.stopPropagation(),x(!0);return;default:return}S.preventDefault(),S.stopPropagation(),v[E]?.focus()};return w.jsxs("div",{ref:f,className:"relative",children:[w.jsx("button",{ref:p,id:d,type:"button",...e,tabIndex:o,onClick:()=>h?x(!1):n("chosen"),onKeyDown:C,className:jr,"aria-label":r.text,lang:r.lang,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?u:void 0,children:i}),h&&w.jsx("div",{ref:m,id:u,role:"menu","aria-labelledby":d,...t,"data-aqmd-control-menu":l?"end":"start",onKeyDown:k,className:GA,children:s.map(S=>{const v=()=>{x(!0),S.onSelect()};return S.checked===void 0?w.jsx("button",{type:"button",role:"menuitem",tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Bd,children:w.jsx("span",{children:S.label.text})},S.key):w.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":S.checked,tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Bd,children:[w.jsx("span",{className:"w-3 shrink-0","aria-hidden":"true",children:S.checked?"✓":""}),w.jsx("span",{children:S.label.text})]},S.key)})})]})},Md=new Set(["gantt"]),mM=200,yM=300,xM=Object.freeze({height:0,overflow:"hidden",visibility:"hidden",contain:"strict"}),CM="data-aqmd-mermaid-host",bM=e=>{const t=document.createElement("div");return t.setAttribute(CM,""),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 $d=Promise.resolve();const kM=e=>{const t=e instanceof Error?e.message:String(e);return t.includes("dynamically imported module")||t.includes("Importing a module script failed")},Od=e=>{e.resetStyle(),e.destroy()},an=(e,t)=>t?"grabbing":e.panTrigger==="drag"?"move":"",wM=Object.freeze({visibility:"hidden"});let xx=!1,xl=null;if(yl?.initialize)try{yl.initialize({startOnLoad:!1}),xx=!0}catch(e){xl=e instanceof Error?e:new Error(String(e))}else xl=new Error("Mermaid library or mermaid.initialize is not available.");const Cx=({chartContent:e,interaction:t,hideInteractionMenu:r=!1,labels:i,sourceLines:o})=>{const s=L.useMemo(()=>_i(Ba,i),[i]),a=L.useId(),n=L.useRef(`mermaid-chart-${Math.random().toString(36).substring(2,15)}`),l=L.useRef(0),c=L.useRef(null),h=L.useRef(null),d=L.useRef(null),u=L.useRef(null),[f,p]=L.useState(!0),[m,y]=L.useState(null),[x,C]=L.useState(null),[k,S]=L.useState(0),v=L.useRef(!1),_=gM(),[E,B]=L.useState(t??gx),O=L.useRef(Ld[E]),A=L.useRef(!1),[D,W]=L.useState(!1);L.useEffect(()=>{t&&B(t)},[t]),L.useEffect(()=>{O.current=Ld[E],u.current?.refresh()},[E]),L.useEffect(()=>{if(p(!0),y(null),C(null),!xx){y(xl?.message||"Mermaid failed to initialize globally."),p(!1);return}const T=e.trim();if(T===""){p(!1);return}const U=c.current;if(!U)throw new Error("[@aiquants/markdown] MermaidDiagram: the measuring element is not mounted");let z=!1,G=0,X=null,K=U.offsetWidth,Q=null,nt,gt;const ut=()=>{Ht.disconnect(),clearTimeout(nt)},mt=Yt=>{Q=null,ut(),y(Yt),C(null),p(!1)},Lt=Yt=>{l.current+=1;const Qt=l.current;G=Qt,X=Yt;const we=()=>!z&&Qt===G,Se=async()=>{const _t=bM(Yt);try{return await yl.render(`${n.current}-${Qt}`,T,_t)}finally{_t.remove()}};$d=$d.then(()=>we()?Se().then(_t=>{if(we()){if(typeof _t.svg!="string"||_t.svg.length===0){mt("Failed to render Mermaid diagram: SVG content is empty or invalid.");return}Q=_t.diagramType,C({svg:_t.svg,bindFunctions:typeof _t.bindFunctions=="function"?_t.bindFunctions:null}),p(!1),Md.has(_t.diagramType)?K!==Yt&&Ft():Ht.disconnect()}}).catch(_t=>{if(we()){if(console.error(`[MermaidDiagram ${n.current}] Error rendering Mermaid diagram:`,_t),kM(_t)&&!v.current){v.current=!0,gt=setTimeout(()=>S(Ct=>Ct+1),yM);return}mt(_t instanceof Error?_t.message:"An unknown error occurred while rendering the diagram.")}}):Promise.resolve())},Ft=()=>{clearTimeout(nt),nt=setTimeout(()=>{K>0&&K!==X&&Lt(K)},mM)},Mt=()=>{const Yt=U.offsetWidth;if(Yt!==K){if(K=Yt,X===null){Yt>0&&Lt(Yt);return}Q!==null&&Md.has(Q)&&Ft()}},Ht=new ResizeObserver(Mt);return Ht.observe(U),K>0&&Lt(K),()=>{z=!0,ut(),clearTimeout(gt)}},[e,k]),L.useEffect(()=>{const T=h.current;if(!T)return;const U=()=>{u.current=null,d.current&&(Od(d.current),d.current=null),A.current=!1,W(!1)};if(!x){T.innerHTML="",U();return}T.innerHTML=x.svg;const z=T.querySelector("svg");let G=!1,X;const K=[];if(z){let Q;try{Q=iM(z.getAttribute("viewBox"))}catch(ut){console.error(`[MermaidDiagram ${n.current}] Cannot size the drawing:`,ut),y(ut instanceof Error?ut.message:String(ut)),C(null);return}const nt=Q,gt=()=>{if(G)return;const ut=z.getBBox();if(!ut||ut.width===0||ut.height===0){X=setTimeout(gt,100);return}d.current&&Od(d.current);const mt=ou(z,{startScale:1,startX:0,startY:0,minScale:1,maxScale:1,origin:"0 0",step:ys,animate:!1,noBind:!0,cursor:"",overflow:"",touchAction:Ed(O.current,!1)});d.current=mt;let Lt={minScale:1,maxScale:1};const Ft=()=>{const J=mt.getPan();return{scale:mt.getScale(),x:J.x,y:J.y}},Mt=()=>{const J=T.getBoundingClientRect(),ft=z.getBoundingClientRect(),{scale:xt,x:Dt,y:At}=Ft();return{frameRect:J,frame:{inline:J.width,block:J.height},drawing:{origin:{x:ft.left-J.left-xt*Dt,y:ft.top-J.top-xt*At},inline:ft.width/xt,block:ft.height/xt}}},Ht=()=>{if(G)return;const{frame:J,drawing:ft}=Mt(),xt=nM(mt.getScale(),ft,J);A.current=xt,W(xt),br(xt),mt.setOptions({touchAction:Ed(O.current,xt)}),T.style.cursor=an(O.current,Ct?.kind==="pan"&&Ct.mouse)},Yt=()=>{const J=T.getBoundingClientRect().width;J<=0||(Lt=sM(oM(J,nt)),mt.setOptions({minScale:Lt.minScale,maxScale:Lt.maxScale}))},Qt=J=>{const ft=Ft(),{frame:xt,drawing:Dt}=Mt(),At=aM({...J,scale:sn(J.scale,Lt)},Dt,xt);return At.scale===ft.scale&&At.x===ft.x&&At.y===ft.y?!1:(mt.zoom(At.scale,{animate:!1,force:!0,silent:!0}),mt.pan(At.x,At.y,{animate:!1,force:!0}),Ht(),!0)},we=(J,ft)=>{const{drawing:xt}=Mt();return Qt(eo(Ft(),sn(J,Lt),ft,ft,xt))},Se=J=>{const ft=T.getBoundingClientRect();return{x:J.x-ft.left,y:J.y-ft.top}};u.current={zoomBy:J=>{const{frame:ft}=Mt();we(mt.getScale()*Math.exp(J*ys),{x:ft.inline/2,y:ft.block/2})},panBy:(J,ft)=>{const{drawing:xt}=Mt(),Dt=Ft();return Qt(eo(Dt,Dt.scale,{x:0,y:0},{x:J,y:ft},xt))},reset:()=>{Qt({scale:1,x:0,y:0})},panSteps:()=>{const{frame:J}=Mt();return{x:Fd(J.inline),y:Fd(J.block)}},refresh:Ht};const _t=new Map;let Ct=null;const ve=J=>({x:J.clientX,y:J.clientY}),Yr=()=>{const J=[..._t.values()];return J.length===2?[J[0],J[1]]:null},ge=J=>{if(_t.has(J.pointerId)&&_t.set(J.pointerId,ve(J)),Ct?.kind==="pinch"){const ft=Yr();if(ft===null)return;const xt=lM(Ct.last,ft);if(Ct={kind:"pinch",last:ft},xt===null)return;const{drawing:Dt}=Mt(),At=Ft();Qt(eo(At,sn(At.scale*xt.ratio,Lt),Se(xt.from),Se(xt.to),Dt));return}if(Ct?.kind==="pan"&&Ct.pointerId===J.pointerId){const ft=ve(J),{drawing:xt}=Mt(),Dt=Ft();Qt(eo(Dt,Dt.scale,Se(Ct.last),Se(ft),xt)),Ct={...Ct,last:ft}}},sr=()=>{window.removeEventListener("pointermove",ge),window.removeEventListener("pointerup",Xe),window.removeEventListener("pointercancel",Xe)},xr=()=>{sr(),window.addEventListener("pointermove",ge),window.addEventListener("pointerup",Xe),window.addEventListener("pointercancel",Xe)},Xe=J=>{if(_t.delete(J.pointerId),Ct?.kind==="pinch"){const[ft]=[..._t.entries()];Ct=ft!==void 0&&on(O.current,{button:0,shiftKey:!1,pointerType:J.pointerType},A.current)?{kind:"pan",pointerId:ft[0],last:ft[1],mouse:!1}:null}else Ct?.kind==="pan"&&Ct.pointerId===J.pointerId&&(Ct=null);Ct===null&&_t.size===0&&sr(),T.style.cursor=an(O.current,Ct?.kind==="pan"&&Ct.mouse)},Cr=J=>{const ft=O.current;if(J.pointerType==="touch"||J.pointerType==="pen"){_t.set(J.pointerId,ve(J)),xr();const xt=Yr();xt!==null&&ft.zoom?Ct={kind:"pinch",last:xt}:_t.size>1?Ct?.kind==="pan"&&!Ct.mouse&&(Ct=null):on(ft,J,A.current)&&(Ct={kind:"pan",pointerId:J.pointerId,last:ve(J),mouse:!1});return}on(ft,J,A.current)&&(Ct={kind:"pan",pointerId:J.pointerId,last:ve(J),mouse:!0},T.style.cursor=an(ft,!0),xr(),J.preventDefault())},Ur=J=>{Ct!==null&&!(Ct.kind==="pan"&&Ct.mouse)&&J.cancelable&&J.preventDefault()};let ar=!1;const br=J=>{J!==ar&&(ar=J,J?T.addEventListener("touchmove",Ur,{passive:!1}):T.removeEventListener("touchmove",Ur))},Re=J=>{const ft=J.target;if(!(ft instanceof Element)||ft===z||!z.contains(ft))return;const xt=T.getBoundingClientRect(),Dt=ft.getBoundingClientRect(),At={x:Ad(Dt.left-xt.left,Dt.right-xt.left,xt.width),y:Ad(Dt.top-xt.top,Dt.bottom-xt.top,xt.height)};if(At.x===0&&At.y===0)return;const{drawing:Xr}=Mt(),Gr=Ft();Qt(eo(Gr,Gr.scale,{x:0,y:0},At,Xr))},Te=J=>{if(!rM(O.current,J))return;const ft=J.deltaY===0?J.deltaX:J.deltaY;ft!==0&&(J.preventDefault(),we(mt.getScale()*Math.exp(Math.sign(-ft)*ys/QA),Se(ve(J))))},kr=new ResizeObserver(()=>{Yt(),Qt(Ft()),Ht()});T.addEventListener("pointerdown",Cr),T.addEventListener("focusin",Re),T.addEventListener("wheel",Te,{passive:!1}),z.addEventListener("panzoomchange",Ht),kr.observe(T),K.push(()=>{T.removeEventListener("pointerdown",Cr),T.removeEventListener("focusin",Re),br(!1),T.removeEventListener("wheel",Te),z.removeEventListener("panzoomchange",Ht),kr.disconnect(),sr()}),Yt(),Ht()};gt()}return x.bindFunctions&&x.bindFunctions(T),()=>{G=!0,clearTimeout(X);for(const Q of K)Q();U()}},[x]);const R=L.useCallback(T=>{const U=u.current;if(U===null||T.target!==T.currentTarget||T.altKey||T.ctrlKey||T.metaKey)return;const z=U.panSteps();let G;switch(T.key){case"ArrowLeft":G=U.panBy(z.x,0);break;case"ArrowRight":G=U.panBy(-z.x,0);break;case"ArrowUp":G=U.panBy(0,z.y);break;case"ArrowDown":G=U.panBy(0,-z.y);break;case"+":case"=":U.zoomBy(1),G=!0;break;case"-":U.zoomBy(-1),G=!0;break;case"0":U.reset(),G=!0;break;default:G=!1}G&&T.preventDefault()},[]),N=L.useMemo(()=>[...r?[]:["mode"],"zoom-in","zoom-out","reset",...D?["pan-left","pan-up","pan-down","pan-right"]:[]],[r,D]),{onKeyDown:F,onFocus:$,tabIndexOf:q}=Rh(N,"data-aqmd-mermaid-control"),P=(T,U,z,G,X=!1)=>w.jsx("button",{type:"button","data-aqmd-mermaid-control":T,tabIndex:q(T),onClick:z,style:X?wM:void 0,className:jr,"aria-label":s[U].text,lang:s[U].lang,children:G},T),I=T=>{const U=u.current;if(U===null)return;const z=U.panSteps();U.panBy(T.x*z.x,T.y*z.y)};let j;if(f)j=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(m)j=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: ",m]}),w.jsxs("button",{type:"button","data-aqmd-mermaid-retry":"",onClick:()=>{v.current=!1,y(null),S(T=>T+1)},lang:s.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(gn,{className:"h-4 w-4"}),s.retry.text]})]});else{const T=s[_?"interactionModeTouch":"interactionMode"],U=_?KA.map(z=>({value:z,label:s[dM[z]],checked:ZA[E]===z})):VA.map(z=>({value:z,label:s[cM[z]],checked:E===z}));j=w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-aqmd-mermaid-toolbar":"",role:"toolbar","aria-labelledby":a,onKeyDown:F,onFocus:$,className:"mb-1 flex flex-wrap items-start gap-1",children:[!r&&w.jsx(yx,{buttonHook:{"data-aqmd-mermaid-control":"mode"},menuHook:{"data-aqmd-mermaid-menu":""},label:T,icon:w.jsx(Qb,{size:18}),tabIndex:q("mode"),items:U.map(({value:z,label:G,checked:X})=>({key:z,label:G,checked:X,onSelect:()=>B(z)}))}),P("zoom-in","zoomIn",()=>u.current?.zoomBy(1),w.jsx(su,{size:20})),P("zoom-out","zoomOut",()=>u.current?.zoomBy(-1),w.jsx(au,{size:20})),P("reset","resetView",()=>u.current?.reset(),w.jsx(gn,{size:18})),P("pan-left","panLeft",()=>I({x:1,y:0}),w.jsx(Yb,{size:18}),!D),P("pan-up","panUp",()=>I({x:0,y:1}),w.jsx(Vb,{size:18}),!D),P("pan-down","panDown",()=>I({x:0,y:-1}),w.jsx(Wb,{size:18}),!D),P("pan-right","panRight",()=>I({x:-1,y:0}),w.jsx(Xb,{size:18}),!D)]}),w.jsx("span",{id:a,hidden:!0,lang:s.diagram.lang,children:s.diagram.text}),w.jsx("div",{ref:h,"data-testid":"mermaid-diagram","data-aqmd-mermaid-frame":"","data-aqmd-mermaid-overflowing":D?"true":"false",role:"group",tabIndex:0,"aria-labelledby":a,onKeyDown:R,className:"mermaid mermaid-diagram-container bg-white dark:bg-gray-400"})]})}return w.jsxs("div",{className:"relative","data-aqmd-mermaid":"","data-source-lines":o,children:[w.jsx("div",{ref:c,"data-aqmd-mermaid-measure":!0,"aria-hidden":"true",style:xM}),j]})};Cx.displayName="MermaidDiagramInternal";const Ih=L.memo(Cx),SM="unicodeTextInMathMode",vM="noCharacterMetrics",TM=/^No character metrics for '.+' in style '.+' and mode '.+'$/su,_M="consoleCommand",BM=e=>{const t=(r,i)=>o=>(i(o),e(_M,`${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())}},bx=(e,t)=>{const r=`${t?"display":"inline"}:${e}`,i=vr.get(r);if(i!==void 0)return vr.delete(r),vr.set(r,i),i;const o=EM(e,t);return vr.set(r,o),vr.size>LM&&vr.delete(vr.keys().next().value),o},LM=610,vr=new Map,EM=(e,t)=>{const r=[],i=(s,a)=>{r.push({code:s,message:a,formula:e,displayMode:t})},o=console.warn;console.warn=(...s)=>{const[a]=s;if(s.length===1&&typeof a=="string"&&TM.test(a)){i(vM,a);return}o.apply(console,s)};try{const s=mC.renderToString(e,{displayMode:t,throwOnError:!1,macros:BM(i),strict:(a,n)=>(a!==SM&&i(a,n),"ignore")});return Object.freeze({html:s,diagnostics:Object.freeze(r.map(a=>Object.freeze(a)))})}finally{console.warn=o}};const FM=[["rect",{width:"6",height:"10",x:"9",y:"7",rx:"2",key:"yn7j0q"}],["path",{d:"M4 22V2",key:"tsjzd3"}],["path",{d:"M20 22V2",key:"1bnhr8"}]],AM=Tt("align-horizontal-space-around",FM);const MM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],$M=Tt("chevron-down",MM);const OM=[["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"}]],kx=Tt("copy",OM);const RM=[["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"}]],IM=Tt("download",RM);const PM=[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]],DM=Tt("fold-horizontal",PM);const NM=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]],qM=Tt("fold-vertical",NM);const zM=[["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"}]],jM=Tt("highlighter",zM);const WM=[["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"}]],HM=Tt("maximize-2",WM);const YM=[["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"}]],UM=Tt("minimize-2",YM);const XM=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],GM=Tt("ruler",XM);const VM=[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]],KM=Tt("unfold-horizontal",VM);const ZM=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],QM=Tt("unfold-vertical",ZM),wx=24,JM=1,t5=1,e5=Object.freeze({}),nn=e=>{const{rows:t,cols:r}=Zs.measureTsv(e);return t*r},r5=26,i5=(e,t,r)=>{const i=e.length>t?Math.min(r,t):0,o=e.slice(0,t-i).map((a,n)=>({index:n,cells:a})),s=e.slice(e.length-i).map((a,n)=>({index:e.length-i+n,cells:a}));return[...o,...s]},o5=(e,t)=>Math.max(1,Math.min(e.visibleRows,t)),s5=3,a5=e=>Math.max(1,Math.min(s5,e)),n5=(e,t)=>(oe.SPREADSHEET_COLUMN_HEADER_HEIGHT_PX+e*wx)*t+oe.SPREADSHEET_SCROLLBAR_SIZE_PX,Cl=e=>Math.round(e*100),l5=(e,t,r)=>{if(t===0&&r===0)return e;const i=(e[0]?.length??0)+r,o=r===0?[...e]:e.map(s=>[...s,...Array(r).fill("")]);for(let s=0;s<t;s+=1)o.push(Array(i).fill(""));return o},Ph=e=>{let t=e.length;for(;t>1&&e[t-1].every(s=>s==="");)t-=1;const r=e[0]?.length??0;let i=r;const o=s=>{for(let a=0;a<t;a+=1)if(e[a][s]!=="")return!1;return!0};for(;i>1&&o(i-1);)i-=1;return t===0||i===0?[[""]]:t===e.length&&i===r?e:e.slice(0,t).map(s=>i===r?s:s.slice(0,i))},rs=e=>Ph(Zs.parseTsv(e)),h5=["format","hyperlink","note","comments","validation"],c5=(e,t)=>{const r=new Map;let i=!1,o=!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}`);if(h5.some(l=>s[l]!==void 0&&s[l]!==null)&&(i=!0),s.text===void 0)continue;o=!0;const a=s.text.replace(/\r\n?/gu,`
|
|
312
|
-
`),n=r.get(s.row);if(n!==void 0)n[s.col]=a;else if(e[s.row][s.col]!==a){const l=[...e[s.row]];l[s.col]=a,r.set(s.row,l)}}if(r.size>0){const s=[...e];for(const[a,n]of r)s[a]=n;return{kind:"applied",matrix:s}}return i&&!o?{kind:"format-only"}:{kind:"unchanged"}},
|
|
309
|
+
`;return i+kn(r)},"createCssStyles"),RA=g((e,t)=>pl(TL(`${e}{${t}}`),LL([g(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===dl)return;i.props=i.props.map(n=>n.startsWith(e)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[dL,fL,p0,gL,"@container","@starting-style"],dl].includes(i.type)||(V.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=Ah))},"addNamespace"),BL])),"compileCSS"),IA=g((e,t,r,i)=>{const o=OA(e,r),s=ak(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return RA(i,s)},"createUserStyles"),PA=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":BA,i=ax(`<body style="${EA}">${e}</body>`);return`<iframe style="width:${_A};height:${r};${LA}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${FA}">
|
|
310
|
+
${AA}
|
|
311
|
+
</iframe>`},"putIntoIFrame"),_d=g((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",SA);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function ml(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}g(ml,"sandboxedIframe");var NA=g((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),qA=g(async function(e,t,r){_a();const i=Oh(t);t=i.code;const o=Ot();V.debug(o),t.length>(o?.maxTextSize??CA)&&(t=bA);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=g(()=>{const q=yt(u?n:c).node();q&&"remove"in q&&q.remove()},"removeTempElements");let d=yt(document.body);const u=o.securityLevel===kA,f=o.securityLevel===wA,p=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),u){const U=ml(yt(r),a);d=yt(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt(r);_d(d,e,l,`font-family: ${p}`,vA)}else{if(NA(document,e,l,a),u){const U=ml(yt(document.body),a);d=yt(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt("body");_d(d,e,l)}let m,y;try{m=await gl.fromText(t,{title:i.title})}catch(U){if(o.suppressErrorRendering)throw h(),U;m=await gl.fromText("error"),y=U}const x=d.select(c).node(),C=m.type,k=x.firstChild,S=k.firstChild,v=m.renderer.getClasses?.(t,m),_=IA(o,C,v,s),E=document.createElement("style");E.innerHTML=_,k.insertBefore(E,S);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(U){throw o.suppressErrorRendering?h():UE.draw(t,e,"11.16.0"),U}const B=d.select(`${c} svg`),I=m.db.getAccTitle?.(),M=m.db.getAccDescription?.();cx(C,B,I,M),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",TA);let D=d.select(c).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),D=PA(D,u,Ye(o.arrowMarkerAbsolute)),u){const U=d.select(c+" svg").node();D=DA(D,U)}else f||(D=Ti.sanitize(D,{ADD_TAGS:MA,ADD_ATTR:$A,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(pA(),y)throw y;return h(),{diagramType:C,svg:D,bindFunctions:m.db.bindFunctions}},"render");function lx(e={}){const t=qt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),P1(t),t?.theme&&t.theme in tr?t.themeVariables=tr[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=tr.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?I1(t):mu();Tl(r.logLevel),_a()}g(lx,"initialize");var hx=g((e,t={})=>{const{code:r}=$h(e);return gl.fromText(r,t)},"getDiagramFromText");function cx(e,t,r,i){ix(t,e),ox(t,r,i,t.attr("id"))}g(cx,"addA11yInfo");var zr=Object.freeze({render:qA,parse:nx,getDiagramFromText:hx,initialize:lx,getConfig:Ot,setConfig:yu,getSiteConfig:mu,updateSiteConfig:D1,reset:g(()=>{ws()},"reset"),globalReset:g(()=>{ws(Bi)},"globalReset"),defaultConfig:Bi});Tl(Ot().logLevel);ws(Ot());var zA=g((e,t,r)=>{V.warn(e),ph(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"),dx=g(async function(e={querySelector:".mermaid"}){try{await jA(e)}catch(t){if(ph(t)&&V.error(t.str),ir.parseError&&ir.parseError(t),!e.suppressErrors)throw V.error("Use the suppressErrors option to suppress these errors"),t}},"run"),jA=g(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=zr.getConfig();V.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");V.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(V.debug("Start On Load: "+i?.startOnLoad),zr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new xe.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(o)){if(V.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=pm(xe.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=xe.detectInit(a);h&&V.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:u}=await gx(c,a,l);l.innerHTML=d,e&&await e(c),u&&u(l)}catch(d){zA(d,n,ir.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),ux=g(function(e){zr.initialize(e)},"initialize"),WA=g(async function(e,t,r){V.warn("mermaid.init is deprecated. Please use run instead."),e&&ux(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await dx(i)},"init"),HA=g(async(e,{lazyLoad:t=!0}={})=>{_a(),yn(...e),t===!1&&await uA()},"registerExternalDiagrams"),fx=g(function(){if(ir.startOnLoad){const{startOnLoad:e}=zr.getConfig();e&&ir.run().catch(t=>V.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",fx,!1);var YA=g(function(e){ir.parseError=e},"setParseErrorHandler"),Ks=[],rn=!1,px=g(async()=>{if(!rn){for(rn=!0;Ks.length>0;){const e=Ks.shift();if(e)try{await e()}catch(t){V.error("Error executing queue",t)}}rn=!1}},"executeQueue"),UA=g(async(e,t)=>new Promise((r,i)=>{const o=g(()=>new Promise((s,a)=>{zr.parse(e,t).then(n=>{s(n),r(n)},n=>{V.error("Error parsing",n),ir.parseError?.(n),a(n),i(n)})}),"performCall");Ks.push(o),px().catch(i)}),"parse"),gx=g((e,t,r)=>new Promise((i,o)=>{const s=g(()=>new Promise((a,n)=>{zr.render(e,t,r).then(l=>{a(l),i(l)},l=>{V.error("Error parsing",l),ir.parseError?.(l),n(l),o(l)})}),"performCall");Ks.push(s),px().catch(o)}),"render"),XA=g(()=>Object.keys(Pr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),ir={startOnLoad:!0,mermaidAPI:zr,parse:UA,render:gx,init:WA,run:dx,registerExternalDiagrams:HA,registerLayoutLoaders:d0,initialize:ux,parseError:void 0,contentLoaded:fx,setParseErrorHandler:YA,detectType:Ll,registerIconPacks:em,getRegisteredDiagramsMetadata:XA},yl=ir;const jr="flex size-11 items-center justify-center rounded border p-1 shadow",GA="flex h-11 min-w-11 items-center justify-center rounded border px-2 text-sm shadow",VA="absolute top-full z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg",Bd="flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start",mx="both-shift",Ld=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"]),ZA=Object.freeze(["none","zoom","pan","both"]),QA=Object.freeze({none:"none",zoom:"zoom",pan:"pan","pan-shift":"pan",both:"both","both-shift":"both"}),ys=.3,JA=3,tM=2,Lr=.5,eM=1;function Ed(e,t){return e.panTrigger!==null&&t?e.zoom?"none":"pinch-zoom":e.zoom?"pan-x pan-y":"auto"}const rM=0;function on(e,t,r){return e.panTrigger===null||t.button!==rM?!1:t.pointerType==="touch"||t.pointerType==="pen"?r:e.panTrigger==="drag"||t.shiftKey}function iM(e,t){return e.zoom&&t.shiftKey}function oM(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 sM(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 aM(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:tM/e}}function sn(e,t){return Math.min(t.maxScale,Math.max(t.minScale,e))}function eo(e,t,r,i,o){return{scale:t,x:e.x+(i.x-o.origin.x)/t-(r.x-o.origin.x)/e.scale,y:e.y+(i.y-o.origin.y)/t-(r.y-o.origin.y)/e.scale}}function nM(e,t,r){const i=(o,s,a,n)=>{const l=(0-s)/e.scale,c=(n-s-e.scale*a)/e.scale;return Math.min(Math.max(l,c),Math.max(Math.min(l,c),o))};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 lM(e,t,r){return e*t.inline-r.inline>Lr||e*t.block-r.block>Lr}function hM(e,t){const r=s=>Math.hypot(s[1].x-s[0].x,s[1].y-s[0].y),i=s=>({x:(s[0].x+s[1].x)/2,y:(s[0].y+s[1].y)/2}),o=r(e);return o<eM?null:{ratio:r(t)/o,from:i(e),to:i(t)}}function Fd(e){return e*(1-Math.exp(-ys))}function Ad(e,t,r){const i=e<-Lr||e>Lr;return t-e>r+Lr?i?0-e:0:e<-Lr?0-e:t>r+Lr?r-t:0}const Ba=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"}}),cM=Qs(Ba),dM=Object.freeze({none:"modeNone",zoom:"modeZoom",pan:"modePan","pan-shift":"modePanShift",both:"modeBoth","both-shift":"modeBothShift"}),uM=Object.freeze({none:"modeNoneTouch",zoom:"modeZoomTouch",pan:"modePanTouch",both:"modeBothTouch"}),yx="(pointer: coarse)",fM=e=>{const t=window.matchMedia(yx);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},pM=()=>window.matchMedia(yx).matches,gM=()=>!1,mM=()=>L.useSyncExternalStore(fM,pM,gM),Rh=(e,t)=>{const[r,i]=L.useState(null),o=r!==null&&e.includes(r)?r:e[0],s=l=>l instanceof Element?l.getAttribute(t):null;return{onKeyDown:l=>{const c=s(l.target);if(c===null||l.altKey||l.ctrlKey||l.metaKey||l.shiftKey)return;const h=e.indexOf(c);if(h===-1)return;const d=l.currentTarget.ownerDocument.defaultView?.getComputedStyle(l.currentTarget).direction==="rtl",u=d?"ArrowLeft":"ArrowRight",f=d?"ArrowRight":"ArrowLeft";let p;switch(l.key){case u:p=(h+1)%e.length;break;case f:p=(h-1+e.length)%e.length;break;case"Home":p=0;break;case"End":p=e.length-1;break;default:return}l.preventDefault(),l.currentTarget.querySelector(`[${t}="${e[p]}"]`)?.focus()},onFocus:l=>{const c=s(l.target);c!==null&&e.includes(c)&&i(c)},tabIndexOf:l=>l===o?0:-1}},xx=({buttonHook:e,menuHook:t,label:r,icon:i,tabIndex:o,items:s})=>{const[a,n]=L.useState(null),[l,c]=L.useState(!1),h=a!==null,d=L.useId(),u=L.useId(),f=L.useRef(null),p=L.useRef(null),m=L.useRef(null),y=()=>Array.from(m.current?.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')??[]),x=S=>{n(null),c(!1),S&&p.current?.focus()};L.useLayoutEffect(()=>{const S=m.current;if(a===null||S===null)return;const v=S.ownerDocument.defaultView,_=S.ownerDocument.documentElement.clientWidth,E=S.getBoundingClientRect();(v?.getComputedStyle(S).direction==="rtl"?E.left<0:E.right>_)&&c(!0);const I=y(),M=I.findIndex(U=>U.getAttribute("aria-checked")==="true"),D=a==="last"?I.length-1:Math.max(M,0);I[D]?.focus()},[a]),L.useEffect(()=>{const S=f.current?.ownerDocument;if(!h||S===void 0)return;const v=_=>{_.target instanceof Node&&f.current?.contains(_.target)===!0||(n(null),c(!1))};return S.addEventListener("pointerdown",v,!0),S.addEventListener("focusin",v,!0),()=>{S.removeEventListener("pointerdown",v,!0),S.removeEventListener("focusin",v,!0)}},[h]);const C=S=>{if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),n(S.key==="ArrowUp"?"last":"chosen");return}S.key==="Escape"&&h&&(S.preventDefault(),S.stopPropagation(),x(!1))},k=S=>{const v=y(),_=v.indexOf(S.target);let E;switch(S.key){case"ArrowDown":E=(_+1)%v.length;break;case"ArrowUp":E=(_-1+v.length)%v.length;break;case"Home":E=0;break;case"End":E=v.length-1;break;case"Escape":S.preventDefault(),S.stopPropagation(),x(!0);return;default:return}S.preventDefault(),S.stopPropagation(),v[E]?.focus()};return w.jsxs("div",{ref:f,className:"relative",children:[w.jsx("button",{ref:p,id:d,type:"button",...e,tabIndex:o,onClick:()=>h?x(!1):n("chosen"),onKeyDown:C,className:jr,"aria-label":r.text,lang:r.lang,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?u:void 0,children:i}),h&&w.jsx("div",{ref:m,id:u,role:"menu","aria-labelledby":d,...t,"data-aqmd-control-menu":l?"end":"start",onKeyDown:k,className:VA,children:s.map(S=>{const v=()=>{x(!0),S.onSelect()};return S.checked===void 0?w.jsx("button",{type:"button",role:"menuitem",tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Bd,children:w.jsx("span",{children:S.label.text})},S.key):w.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":S.checked,tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Bd,children:[w.jsx("span",{className:"w-3 shrink-0","aria-hidden":"true",children:S.checked?"✓":""}),w.jsx("span",{children:S.label.text})]},S.key)})})]})},Md=new Set(["gantt"]),yM=200,xM=300,CM=Object.freeze({height:0,overflow:"hidden",visibility:"hidden",contain:"strict"}),bM="data-aqmd-mermaid-host",kM=e=>{const t=document.createElement("div");return t.setAttribute(bM,""),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 $d=Promise.resolve();const wM=e=>{const t=e instanceof Error?e.message:String(e);return t.includes("dynamically imported module")||t.includes("Importing a module script failed")},Od=e=>{e.resetStyle(),e.destroy()},an=(e,t)=>t?"grabbing":e.panTrigger==="drag"?"move":"",SM=Object.freeze({visibility:"hidden"});let Cx=!1,xl=null;if(yl?.initialize)try{yl.initialize({startOnLoad:!1}),Cx=!0}catch(e){xl=e instanceof Error?e:new Error(String(e))}else xl=new Error("Mermaid library or mermaid.initialize is not available.");const bx=({chartContent:e,interaction:t,hideInteractionMenu:r=!1,labels:i,sourceLines:o})=>{const s=L.useMemo(()=>_i(Ba,i),[i]),a=L.useId(),n=L.useRef(`mermaid-chart-${Math.random().toString(36).substring(2,15)}`),l=L.useRef(0),c=L.useRef(null),h=L.useRef(null),d=L.useRef(null),u=L.useRef(null),[f,p]=L.useState(!0),[m,y]=L.useState(null),[x,C]=L.useState(null),[k,S]=L.useState(0),v=L.useRef(!1),_=mM(),[E,B]=L.useState(t??mx),I=L.useRef(Ld[E]),M=L.useRef(!1),[D,U]=L.useState(!1);L.useEffect(()=>{t&&B(t)},[t]),L.useEffect(()=>{I.current=Ld[E],u.current?.refresh()},[E]),L.useEffect(()=>{if(p(!0),y(null),C(null),!Cx){y(xl?.message||"Mermaid failed to initialize globally."),p(!1);return}const T=e.trim();if(T===""){p(!1);return}const W=c.current;if(!W)throw new Error("[@aiquants/markdown] MermaidDiagram: the measuring element is not mounted");let z=!1,G=0,X=null,K=W.offsetWidth,Q=null,nt,gt;const ut=()=>{Ht.disconnect(),clearTimeout(nt)},mt=Yt=>{Q=null,ut(),y(Yt),C(null),p(!1)},Lt=Yt=>{l.current+=1;const Qt=l.current;G=Qt,X=Yt;const we=()=>!z&&Qt===G,Se=async()=>{const _t=kM(Yt);try{return await yl.render(`${n.current}-${Qt}`,T,_t)}finally{_t.remove()}};$d=$d.then(()=>we()?Se().then(_t=>{if(we()){if(typeof _t.svg!="string"||_t.svg.length===0){mt("Failed to render Mermaid diagram: SVG content is empty or invalid.");return}Q=_t.diagramType,C({svg:_t.svg,bindFunctions:typeof _t.bindFunctions=="function"?_t.bindFunctions:null}),p(!1),Md.has(_t.diagramType)?K!==Yt&&Ft():Ht.disconnect()}}).catch(_t=>{if(we()){if(console.error(`[MermaidDiagram ${n.current}] Error rendering Mermaid diagram:`,_t),wM(_t)&&!v.current){v.current=!0,gt=setTimeout(()=>S(Ct=>Ct+1),xM);return}mt(_t instanceof Error?_t.message:"An unknown error occurred while rendering the diagram.")}}):Promise.resolve())},Ft=()=>{clearTimeout(nt),nt=setTimeout(()=>{K>0&&K!==X&&Lt(K)},yM)},Mt=()=>{const Yt=W.offsetWidth;if(Yt!==K){if(K=Yt,X===null){Yt>0&&Lt(Yt);return}Q!==null&&Md.has(Q)&&Ft()}},Ht=new ResizeObserver(Mt);return Ht.observe(W),K>0&&Lt(K),()=>{z=!0,ut(),clearTimeout(gt)}},[e,k]),L.useEffect(()=>{const T=h.current;if(!T)return;const W=()=>{u.current=null,d.current&&(Od(d.current),d.current=null),M.current=!1,U(!1)};if(!x){T.innerHTML="",W();return}T.innerHTML=x.svg;const z=T.querySelector("svg");let G=!1,X;const K=[];if(z){let Q;try{Q=oM(z.getAttribute("viewBox"))}catch(ut){console.error(`[MermaidDiagram ${n.current}] Cannot size the drawing:`,ut),y(ut instanceof Error?ut.message:String(ut)),C(null);return}const nt=Q,gt=()=>{if(G)return;const ut=z.getBBox();if(!ut||ut.width===0||ut.height===0){X=setTimeout(gt,100);return}d.current&&Od(d.current);const mt=su(z,{startScale:1,startX:0,startY:0,minScale:1,maxScale:1,origin:"0 0",step:ys,animate:!1,noBind:!0,cursor:"",overflow:"",touchAction:Ed(I.current,!1)});d.current=mt;let Lt={minScale:1,maxScale:1};const Ft=()=>{const J=mt.getPan();return{scale:mt.getScale(),x:J.x,y:J.y}},Mt=()=>{const J=T.getBoundingClientRect(),ft=z.getBoundingClientRect(),{scale:xt,x:Dt,y:At}=Ft();return{frameRect:J,frame:{inline:J.width,block:J.height},drawing:{origin:{x:ft.left-J.left-xt*Dt,y:ft.top-J.top-xt*At},inline:ft.width/xt,block:ft.height/xt}}},Ht=()=>{if(G)return;const{frame:J,drawing:ft}=Mt(),xt=lM(mt.getScale(),ft,J);M.current=xt,U(xt),br(xt),mt.setOptions({touchAction:Ed(I.current,xt)}),T.style.cursor=an(I.current,Ct?.kind==="pan"&&Ct.mouse)},Yt=()=>{const J=T.getBoundingClientRect().width;J<=0||(Lt=aM(sM(J,nt)),mt.setOptions({minScale:Lt.minScale,maxScale:Lt.maxScale}))},Qt=J=>{const ft=Ft(),{frame:xt,drawing:Dt}=Mt(),At=nM({...J,scale:sn(J.scale,Lt)},Dt,xt);return At.scale===ft.scale&&At.x===ft.x&&At.y===ft.y?!1:(mt.zoom(At.scale,{animate:!1,force:!0,silent:!0}),mt.pan(At.x,At.y,{animate:!1,force:!0}),Ht(),!0)},we=(J,ft)=>{const{drawing:xt}=Mt();return Qt(eo(Ft(),sn(J,Lt),ft,ft,xt))},Se=J=>{const ft=T.getBoundingClientRect();return{x:J.x-ft.left,y:J.y-ft.top}};u.current={zoomBy:J=>{const{frame:ft}=Mt();we(mt.getScale()*Math.exp(J*ys),{x:ft.inline/2,y:ft.block/2})},panBy:(J,ft)=>{const{drawing:xt}=Mt(),Dt=Ft();return Qt(eo(Dt,Dt.scale,{x:0,y:0},{x:J,y:ft},xt))},reset:()=>{Qt({scale:1,x:0,y:0})},panSteps:()=>{const{frame:J}=Mt();return{x:Fd(J.inline),y:Fd(J.block)}},refresh:Ht};const _t=new Map;let Ct=null;const ve=J=>({x:J.clientX,y:J.clientY}),Yr=()=>{const J=[..._t.values()];return J.length===2?[J[0],J[1]]:null},ge=J=>{if(_t.has(J.pointerId)&&_t.set(J.pointerId,ve(J)),Ct?.kind==="pinch"){const ft=Yr();if(ft===null)return;const xt=hM(Ct.last,ft);if(Ct={kind:"pinch",last:ft},xt===null)return;const{drawing:Dt}=Mt(),At=Ft();Qt(eo(At,sn(At.scale*xt.ratio,Lt),Se(xt.from),Se(xt.to),Dt));return}if(Ct?.kind==="pan"&&Ct.pointerId===J.pointerId){const ft=ve(J),{drawing:xt}=Mt(),Dt=Ft();Qt(eo(Dt,Dt.scale,Se(Ct.last),Se(ft),xt)),Ct={...Ct,last:ft}}},sr=()=>{window.removeEventListener("pointermove",ge),window.removeEventListener("pointerup",Xe),window.removeEventListener("pointercancel",Xe)},xr=()=>{sr(),window.addEventListener("pointermove",ge),window.addEventListener("pointerup",Xe),window.addEventListener("pointercancel",Xe)},Xe=J=>{if(_t.delete(J.pointerId),Ct?.kind==="pinch"){const[ft]=[..._t.entries()];Ct=ft!==void 0&&on(I.current,{button:0,shiftKey:!1,pointerType:J.pointerType},M.current)?{kind:"pan",pointerId:ft[0],last:ft[1],mouse:!1}:null}else Ct?.kind==="pan"&&Ct.pointerId===J.pointerId&&(Ct=null);Ct===null&&_t.size===0&&sr(),T.style.cursor=an(I.current,Ct?.kind==="pan"&&Ct.mouse)},Cr=J=>{const ft=I.current;if(J.pointerType==="touch"||J.pointerType==="pen"){_t.set(J.pointerId,ve(J)),xr();const xt=Yr();xt!==null&&ft.zoom?Ct={kind:"pinch",last:xt}:_t.size>1?Ct?.kind==="pan"&&!Ct.mouse&&(Ct=null):on(ft,J,M.current)&&(Ct={kind:"pan",pointerId:J.pointerId,last:ve(J),mouse:!1});return}on(ft,J,M.current)&&(Ct={kind:"pan",pointerId:J.pointerId,last:ve(J),mouse:!0},T.style.cursor=an(ft,!0),xr(),J.preventDefault())},Ur=J=>{Ct!==null&&!(Ct.kind==="pan"&&Ct.mouse)&&J.cancelable&&J.preventDefault()};let ar=!1;const br=J=>{J!==ar&&(ar=J,J?T.addEventListener("touchmove",Ur,{passive:!1}):T.removeEventListener("touchmove",Ur))},Re=J=>{const ft=J.target;if(!(ft instanceof Element)||ft===z||!z.contains(ft))return;const xt=T.getBoundingClientRect(),Dt=ft.getBoundingClientRect(),At={x:Ad(Dt.left-xt.left,Dt.right-xt.left,xt.width),y:Ad(Dt.top-xt.top,Dt.bottom-xt.top,xt.height)};if(At.x===0&&At.y===0)return;const{drawing:Xr}=Mt(),Gr=Ft();Qt(eo(Gr,Gr.scale,{x:0,y:0},At,Xr))},Te=J=>{if(!iM(I.current,J))return;const ft=J.deltaY===0?J.deltaX:J.deltaY;ft!==0&&(J.preventDefault(),we(mt.getScale()*Math.exp(Math.sign(-ft)*ys/JA),Se(ve(J))))},kr=new ResizeObserver(()=>{Yt(),Qt(Ft()),Ht()});T.addEventListener("pointerdown",Cr),T.addEventListener("focusin",Re),T.addEventListener("wheel",Te,{passive:!1}),z.addEventListener("panzoomchange",Ht),kr.observe(T),K.push(()=>{T.removeEventListener("pointerdown",Cr),T.removeEventListener("focusin",Re),br(!1),T.removeEventListener("wheel",Te),z.removeEventListener("panzoomchange",Ht),kr.disconnect(),sr()}),Yt(),Ht()};gt()}return x.bindFunctions&&x.bindFunctions(T),()=>{G=!0,clearTimeout(X);for(const Q of K)Q();W()}},[x]);const q=L.useCallback(T=>{const W=u.current;if(W===null||T.target!==T.currentTarget||T.altKey||T.ctrlKey||T.metaKey)return;const z=W.panSteps();let G;switch(T.key){case"ArrowLeft":G=W.panBy(z.x,0);break;case"ArrowRight":G=W.panBy(-z.x,0);break;case"ArrowUp":G=W.panBy(0,z.y);break;case"ArrowDown":G=W.panBy(0,-z.y);break;case"+":case"=":W.zoomBy(1),G=!0;break;case"-":W.zoomBy(-1),G=!0;break;case"0":W.reset(),G=!0;break;default:G=!1}G&&T.preventDefault()},[]),N=L.useMemo(()=>[...r?[]:["mode"],"zoom-in","zoom-out","reset",...D?["pan-left","pan-up","pan-down","pan-right"]:[]],[r,D]),{onKeyDown:A,onFocus:F,tabIndexOf:P}=Rh(N,"data-aqmd-mermaid-control"),O=(T,W,z,G,X=!1)=>w.jsx("button",{type:"button","data-aqmd-mermaid-control":T,tabIndex:P(T),onClick:z,style:X?SM:void 0,className:jr,"aria-label":s[W].text,lang:s[W].lang,children:G},T),$=T=>{const W=u.current;if(W===null)return;const z=W.panSteps();W.panBy(T.x*z.x,T.y*z.y)};let j;if(f)j=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(m)j=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: ",m]}),w.jsxs("button",{type:"button","data-aqmd-mermaid-retry":"",onClick:()=>{v.current=!1,y(null),S(T=>T+1)},lang:s.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(gn,{className:"h-4 w-4"}),s.retry.text]})]});else{const T=s[_?"interactionModeTouch":"interactionMode"],W=_?ZA.map(z=>({value:z,label:s[uM[z]],checked:QA[E]===z})):KA.map(z=>({value:z,label:s[dM[z]],checked:E===z}));j=w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-aqmd-mermaid-toolbar":"",role:"toolbar","aria-labelledby":a,onKeyDown:A,onFocus:F,className:"mb-1 flex flex-wrap items-start gap-1",children:[!r&&w.jsx(xx,{buttonHook:{"data-aqmd-mermaid-control":"mode"},menuHook:{"data-aqmd-mermaid-menu":""},label:T,icon:w.jsx(Jb,{size:18}),tabIndex:P("mode"),items:W.map(({value:z,label:G,checked:X})=>({key:z,label:G,checked:X,onSelect:()=>B(z)}))}),O("zoom-in","zoomIn",()=>u.current?.zoomBy(1),w.jsx(au,{size:20})),O("zoom-out","zoomOut",()=>u.current?.zoomBy(-1),w.jsx(nu,{size:20})),O("reset","resetView",()=>u.current?.reset(),w.jsx(gn,{size:18})),O("pan-left","panLeft",()=>$({x:1,y:0}),w.jsx(Ub,{size:18}),!D),O("pan-up","panUp",()=>$({x:0,y:1}),w.jsx(Kb,{size:18}),!D),O("pan-down","panDown",()=>$({x:0,y:-1}),w.jsx(Hb,{size:18}),!D),O("pan-right","panRight",()=>$({x:-1,y:0}),w.jsx(Gb,{size:18}),!D)]}),w.jsx("span",{id:a,hidden:!0,lang:s.diagram.lang,children:s.diagram.text}),w.jsx("div",{ref:h,"data-testid":"mermaid-diagram","data-aqmd-mermaid-frame":"","data-aqmd-mermaid-overflowing":D?"true":"false",role:"group",tabIndex:0,"aria-labelledby":a,onKeyDown:q,className:"mermaid mermaid-diagram-container bg-white dark:bg-gray-400"})]})}return w.jsxs("div",{className:"relative","data-aqmd-mermaid":"","data-source-lines":o,children:[w.jsx("div",{ref:c,"data-aqmd-mermaid-measure":!0,"aria-hidden":"true",style:CM}),j]})};bx.displayName="MermaidDiagramInternal";const Ih=L.memo(bx),vM="unicodeTextInMathMode",TM="noCharacterMetrics",_M=/^No character metrics for '.+' in style '.+' and mode '.+'$/su,BM="consoleCommand",LM=e=>{const t=(r,i)=>o=>(i(o),e(BM,`${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())}},kx=(e,t)=>{const r=`${t?"display":"inline"}:${e}`,i=vr.get(r);if(i!==void 0)return vr.delete(r),vr.set(r,i),i;const o=FM(e,t);return vr.set(r,o),vr.size>EM&&vr.delete(vr.keys().next().value),o},EM=610,vr=new Map,FM=(e,t)=>{const r=[],i=(s,a)=>{r.push({code:s,message:a,formula:e,displayMode:t})},o=console.warn;console.warn=(...s)=>{const[a]=s;if(s.length===1&&typeof a=="string"&&_M.test(a)){i(TM,a);return}o.apply(console,s)};try{const s=yC.renderToString(e,{displayMode:t,throwOnError:!1,macros:LM(i),strict:(a,n)=>(a!==vM&&i(a,n),"ignore")});return Object.freeze({html:s,diagnostics:Object.freeze(r.map(a=>Object.freeze(a)))})}finally{console.warn=o}};const AM=[["rect",{width:"6",height:"10",x:"9",y:"7",rx:"2",key:"yn7j0q"}],["path",{d:"M4 22V2",key:"tsjzd3"}],["path",{d:"M20 22V2",key:"1bnhr8"}]],MM=Tt("align-horizontal-space-around",AM);const $M=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],OM=Tt("chevron-down",$M);const RM=[["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"}]],wx=Tt("copy",RM);const IM=[["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"}]],PM=Tt("download",IM);const DM=[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]],NM=Tt("fold-horizontal",DM);const qM=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]],zM=Tt("fold-vertical",qM);const jM=[["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"}]],WM=Tt("highlighter",jM);const HM=[["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"}]],YM=Tt("maximize-2",HM);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"}]],XM=Tt("minimize-2",UM);const GM=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],VM=Tt("ruler",GM);const KM=[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]],ZM=Tt("unfold-horizontal",KM);const QM=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],JM=Tt("unfold-vertical",QM),Sx=24,t5=1,e5=1,r5=Object.freeze({}),nn=e=>{const{rows:t,cols:r}=Zs.measureTsv(e);return t*r},i5=26,o5=(e,t,r)=>{const i=e.length>t?Math.min(r,t):0,o=e.slice(0,t-i).map((a,n)=>({index:n,cells:a})),s=e.slice(e.length-i).map((a,n)=>({index:e.length-i+n,cells:a}));return[...o,...s]},s5=(e,t)=>Math.max(1,Math.min(e.visibleRows,t)),a5=3,n5=e=>Math.max(1,Math.min(a5,e)),l5=(e,t)=>(oe.SPREADSHEET_COLUMN_HEADER_HEIGHT_PX+e*Sx)*t+oe.SPREADSHEET_SCROLLBAR_SIZE_PX,Cl=e=>Math.round(e*100),h5=(e,t,r)=>{if(t===0&&r===0)return e;const i=(e[0]?.length??0)+r,o=r===0?[...e]:e.map(s=>[...s,...Array(r).fill("")]);for(let s=0;s<t;s+=1)o.push(Array(i).fill(""));return o},Ph=e=>{let t=e.length;for(;t>1&&e[t-1].every(s=>s==="");)t-=1;const r=e[0]?.length??0;let i=r;const o=s=>{for(let a=0;a<t;a+=1)if(e[a][s]!=="")return!1;return!0};for(;i>1&&o(i-1);)i-=1;return t===0||i===0?[[""]]:t===e.length&&i===r?e:e.slice(0,t).map(s=>i===r?s:s.slice(0,i))},rs=e=>Ph(Zs.parseTsv(e)),c5=["format","hyperlink","note","comments","validation"],d5=(e,t)=>{const r=new Map;let i=!1,o=!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}`);if(c5.some(l=>s[l]!==void 0&&s[l]!==null)&&(i=!0),s.text===void 0)continue;o=!0;const a=s.text.replace(/\r\n?/gu,`
|
|
312
|
+
`),n=r.get(s.row);if(n!==void 0)n[s.col]=a;else if(e[s.row][s.col]!==a){const l=[...e[s.row]];l[s.col]=a,r.set(s.row,l)}}if(r.size>0){const s=[...e];for(const[a,n]of r)s[a]=n;return{kind:"applied",matrix:s}}return i&&!o?{kind:"format-only"}:{kind:"unchanged"}},u5=e=>{const t=Ph(e).map(r=>{let i=r.length;for(;i>0&&r[i-1]==="";)i-=1;return i===r.length?r:r.slice(0,i)});return Zs.serializeTsv(t).replaceAll(`\r
|
|
313
313
|
`,`
|
|
314
|
-
`)},
|
|
315
|
-
${e}`,y=f===m,x=i!==void 0&&u!==null&&!y?i:void 0,C=x!==void 0,k=C&&l!==null&&l.footerRows===0?JM:0,S=C?t5:0,[v,_]=L.useState(()=>d?Dd:rs(e)),[E,B]=L.useState(0),O=L.useRef(e),A=L.useRef([]),D=L.useMemo(()=>l5(v,k,S),[v,k,S]),W=L.useRef(D);W.current=D;const R=L.useSyncExternalStore(E5,()=>xs,()=>null),[N,F]=L.useState(!1),$=N&&R===null,[q,P]=L.useState(1),[I,j]=L.useState(Pd),[T,U]=L.useState(!1),[z,G]=L.useState(null),X=L.useRef(null),K=L.useId(),Q=L.useCallback((Z,it={})=>{G(St=>({text:It.fillLabel(n[Z].text,it),lang:n[Z].lang,serial:(St?.serial??0)+1}))},[n]);L.useEffect(()=>{if(R!==null||l===null||d)return;let Z=!0;return Rd().catch(it=>{Z&&(Id(it),F(!0))}),()=>{Z=!1}},[R,l,d]),L.useEffect(()=>{const Z=u5(A.current,e);if(Z.echo){A.current=Z.pending;return}const it=x===void 0||u===null?null:x.read(u),St=it!==null&&nn(it)<=oe.SPREADSHEET_MAX_OPERATION_CELLS?it:null;if(St!==null&&St===A.current.at(-1))return;A.current=[];const Et=St===null?e:St;Et!==O.current&&(O.current=Et,_(St===null&&d?Dd:rs(Et)),B(ie=>ie+1))},[e,d,x,u]);const nt=L.useCallback(()=>{if(x===void 0||u===null)return;const Z=x.read(u);Z===null||Z===O.current||nn(Z)>oe.SPREADSHEET_MAX_OPERATION_CELLS||(A.current=[],O.current=Z,_(rs(Z)),B(it=>it+1))},[x,u]);L.useEffect(()=>x?.subscribe(()=>{A.current.length>0&&nt()}),[x,nt]);const gt=L.useCallback(Z=>{Z(),nt()},[nt]),ut=L.useMemo(()=>x===void 0?void 0:()=>gt(()=>x.undo()),[x,gt]),mt=L.useMemo(()=>x===void 0?void 0:()=>gt(()=>x.redo()),[x,gt]),Lt=L.useRef(()=>{});Lt.current=Z=>{if(x===void 0||u===null)throw new Qr("readOnly");const it=c5(W.current,Z);if(it.kind==="format-only")throw new Qr("formatRefused");if(it.kind==="unchanged")return;const St=Ph(it.matrix),Et=d5(St),ie=x.write({fenceLine:u,expected:O.current,text:Et});switch(ie){case"written":{const le=x.read(u);if(le===null)throw new TypeError("[@aiquants/markdown] SpreadsheetEditor.write answered written, but read finds no block on its fence line");O.current=le,A.current=[...A.current,le],_(le===Et?St:rs(le)),B(Vr=>Vr+1),G(null);return}case"changed":throw nt(),new Qr("editConflict");case"closesFence":throw new Qr("fenceRefused");case"unwritable":throw p(m),new Qr("unwritable");default:throw new TypeError(`[@aiquants/markdown] SpreadsheetEditor.write answered ${JSON.stringify(ie)} (written, changed, closesFence or unwritable)`)}};const[Ft]=L.useState(()=>({get rowCount(){return W.current.length},get colCount(){return W.current[0].length},getCellText:(Z,it)=>W.current[Z][it],applyEdits:(Z,it)=>Lt.current(Z),getCellFormat:()=>e5,getCellHyperlink:(Z,it)=>g5(W.current[Z][it]),findDataEdge:(Z,it)=>f5((St,Et)=>W.current[St][Et],W.current.length,W.current[0].length,Z,it)})),Mt=L.useCallback(Z=>{if(!(Z instanceof Qr))throw Z;Q(Z.reason)},[Q]),Ht=L.useCallback(Z=>Q(y?"unwritable":"readOnly"),[Q,y]),Yt=L.useCallback(Z=>{X.current?.ownerDocument.defaultView?.open(Z,"_blank","noopener,noreferrer")},[]),Qt=L.useCallback(({row:Z,displayText:it,columnName:St,readOnly:Et})=>It.fillLabel((Et===!0?n.readOnlyCellAnnouncement:n.cellAnnouncement).text,{cell:`${St}${Z+1}`,value:it===""?n.emptyCell.text:it}),[n]),we=L.useCallback(({range:Z})=>It.fillLabel(n.selectionAnnouncement.text,{range:m5(Z,oe.columnIndexToName)}),[n]),Se=L.useCallback(({axis:Z,index:it,size:St})=>Z==="column"?It.fillLabel(n.columnResized.text,{column:oe.columnIndexToName(it),size:St}):It.fillLabel(n.rowResized.text,{row:it+1,size:St}),[n]),_t=L.useRef(null),[Ct]=L.useState(x5),ve=L.useCallback(Z=>Ct.set(Z.active),[Ct]),Yr=L.useCallback(Z=>{_t.current?.executeCommand(Z)},[]),ge=Cl(q),sr=L.useRef(ge);L.useEffect(()=>{sr.current!==ge&&(sr.current=ge,Q("zoomed",{percent:ge}))},[Q,ge]);const xr=L.useCallback(Z=>P(it=>oe.clampSpreadsheetZoom(oe.stepSpreadsheetZoom(it,Z))),[]),Xe=L.useCallback(()=>P(1),[]),Cr=I.row||I.column,Ur=L.useCallback(()=>j(Z=>Z.row||Z.column?F5:Pd),[]),ar=L.useCallback(()=>{if(R===null)return;const Z=X.current?.ownerDocument.defaultView;(async()=>{if(Z==null)throw new Error("no window");const St=S5(v,R,Z.crypto.randomUUID());await v5(St,Z.navigator.clipboard,Et=>new Z.ClipboardItem(Et))})().then(()=>Q("copied"),St=>{console.error("[@aiquants/markdown] could not copy the spreadsheet",St),Q("copyFailed")})},[Q,v,R]),br=L.useCallback(Z=>{const it=X.current?.ownerDocument;it!==void 0&&L5(B5(v,Z),n.fileName.text,it)},[v,n]),Re=L.useRef(!1);L.useEffect(()=>{Re.current&&(Re.current=!1,X.current?.querySelector('[data-aqmd-spreadsheet-control="fullscreen"]')?.focus())},[T]);const Te=L.useCallback(Z=>{const it=X.current;it!==null&&(it.close(),Z?it.showModal():it.show(),Re.current=!0,U(Z))},[]),kr=L.useCallback(()=>Te(!T),[T,Te]),J=L.useCallback(Z=>{!T||Z.key!=="Escape"||Z.defaultPrevented||Z.nativeEvent.isComposing||Z.keyCode===M5||(Z.preventDefault(),Z.stopPropagation(),Te(!1))},[T,Te]),ft=L.useCallback(Z=>{Z.preventDefault(),Te(!1)},[Te]),xt=v.length,Dt=v[0].length,At=l===null?0:o5(l,D.length),Xr=D.length,Gr=L.useMemo(()=>{const[Z,it]=a==="inline"?["--aqmd-spreadsheet-box-height",At]:["--aqmd-spreadsheet-box-min-height",a5(Xr)];return{[Z]:`${n5(it,q)}px`}},[a,At,Xr,q]),No=T?n.fullscreenDialog:n.table,Wi=R?.Spreadsheet;return w.jsxs("div",{"data-aqmd-spreadsheet":"","data-aqmd-spreadsheet-layout":a,"data-source-lines":r,"data-aqmd-spreadsheet-editable":C?"":void 0,"data-aqmd-spreadsheet-fullscreen":T?"":void 0,children:[w.jsx("span",{id:K,hidden:!0,lang:No.lang,children:No.text}),w.jsxs("dialog",{ref:X,open:!0,"data-aqmd-spreadsheet-dialog":"",role:T?void 0:"group","aria-labelledby":K,onKeyDown:J,onCancel:ft,children:[l===null?w.jsx("div",{"data-aqmd-spreadsheet-error":"options",role:"alert",lang:n.optionsError.lang,children:It.fillLabel(n.optionsError.text,{word:c,frozenMax:It.SPREADSHEET_OPTION_RULES.header.max,heightMax:It.SPREADSHEET_OPTION_RULES.height.max})}):d?w.jsx("div",{"data-aqmd-spreadsheet-error":"size",role:"alert",lang:n.tooLarge.lang,children:It.fillLabel(n.tooLarge.text,{cells:new Intl.NumberFormat(o).format(h),max:new Intl.NumberFormat(o).format(oe.SPREADSHEET_MAX_OPERATION_CELLS)})}):w.jsxs(w.Fragment,{children:[w.jsx(b5,{labels:n,labelledBy:K,rows:xt,cols:Dt,canZoomIn:q<oe.SPREADSHEET_ZOOM_MAX,canZoomOut:q>oe.SPREADSHEET_ZOOM_MIN,zoom:q,onZoom:xr,onResetZoom:Xe,highlighted:Cr,onToggleHighlight:Ur,onCopy:ar,onSave:br,fullscreen:T,onToggleFullscreen:kr,gridReady:Wi!==void 0,activeCell:Ct,onTrackSize:Yr}),w.jsx("div",{"data-aqmd-spreadsheet-box":"",style:Gr,children:Wi===void 0?w.jsx($5,{matrix:v,headerRows:l.headerRows,footerRows:l.footerRows,visibleRows:At}):w.jsx(Wi,{ref:_t,adapter:Ft,dataVersion:E,defaultRowHeight:wx,frozenRows:l.headerRows,headerRows:l.headerRows,frozenTrailingRows:l.footerRows,frozenColumns:l.frozenColumns,enableFillHandle:C,readOnly:!C,labelledBy:K,enableResizeUI:!0,zoom:q,onZoomChange:P,highlight:I,onHighlightChange:j,popovers:A5,onHyperlinkOpen:Yt,onEditRejected:Mt,onReadOnlyRejected:Ht,onUndoRequest:ut,onRedoRequest:mt,formatCellAnnouncement:Qt,formatSelectionAnnouncement:we,formatResizeAnnouncement:Se,onSelectionChange:ve,locale:o})})]}),$&&w.jsxs("div",{"data-aqmd-spreadsheet-error":"load",role:"alert",children:[w.jsx("span",{lang:n.loadFailed.lang,children:n.loadFailed.text}),w.jsx("button",{type:"button","data-aqmd-spreadsheet-retry":"",lang:n.retry.lang,className:"ms-2 inline-flex min-h-11 min-w-11 items-center justify-center rounded border px-3 py-1 text-sm",onClick:()=>{F(!1),Rd().catch(Z=>{Id(Z),F(!0)})},children:n.retry.text})]}),w.jsx("p",{"data-aqmd-spreadsheet-notice":"",role:"status",children:z!==null&&w.jsx("span",{lang:z.lang,children:z.text},z.serial)})]})]})};vx.displayName="SpreadsheetBlock";const Dh=L.memo(vx),R5=Object.freeze({light:"solarized-light",dark:"github-dark-high-contrast"}),I5=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 P5(e){const t={};for(const r in e){const i=e[r];switch(r){case"class":t.className=i;break;case"style":{const o={};for(const s of i.split(";")){const a=s.indexOf(":");if(a<=0)continue;const n=s.slice(0,a).trim(),l=s.slice(a+1).trim();n===""||l===""||(o[n.startsWith("--")?n:n.replace(/-(\w)/g,(c,h)=>h.toUpperCase())]=l)}t.style=o;break}case"tabindex":t.tabIndex=Number(i);break;default:t[r]=i}}return t}const D5=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};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"})},N5=({htmlPromise:e,filename:t,code:r,sourceLines:i})=>{const o=L.use(e),s={replace:a=>{if(a instanceof wt.Element&&a.name==="pre"){const n=P5(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(D5,{code:r}),w.jsx("pre",{...n,children:wt.domToReact(a.children,s)})]})}},htmlparser2:{lowerCaseTags:!0}};return w.jsx(w.Fragment,{children:wt(o,s)})},q5=/^(diff)?:?(\w+):?([\w.-]*)?/,z5=new Map([["svg","xml"]]),j5="text",W5=e=>{const t=z5.get(e),r=t===void 0?e:t;return fn.isSpecialLang(r)||Object.hasOwn(fn.bundledLanguages,r)?r:j5},H5=()=>({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 o=i.value;let s,a,n="";if(o.startsWith("+")?(s="+",a="add",n="bg-green-200 dark:bg-green-400/90 text-green-700"):o.startsWith("-")&&(s="-",a="remove",n="bg-red-200 dark:bg-red-400/90 text-red-700"),s&&a){t.properties.dataAqmdDiff=a,i.value=o.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:s==="+"?"➕":"➖"}]};t.children.unshift(l)}}}}),Y5=e=>{const t=q5.exec(e??"");return{isDiff:t?.[1]==="diff",lang:t?.[2]||"text",filename:t?.[3]||void 0}},Nh=({lang:e,code:t,node:r,sourceLines:i})=>{const o=e??r?.lang??void 0,s=t??r?.value??"",{isDiff:a,lang:n,filename:l}=Y5(o);return n===It.SPREADSHEETS_LANGUAGE?w.jsx(Dh,{tsv:s,meta:r?.meta??void 0,sourceLines:i}):n==="mermaid"?w.jsx(Ih,{chartContent:s,sourceLines:i}):w.jsx(U5,{code:s,lang:n,isDiff:a,filename:l,sourceLines:i})},U5=({code:e,lang:t,isDiff:r,filename:i,sourceLines:o})=>{const s=L.useMemo(async()=>{const a=[];return r&&a.push(H5()),await fn.codeToHtml(e,{lang:W5(t),themes:R5,defaultColor:!1,colorReplacements:I5,transformers:a})},[e,t,r]);return w.jsx(L.Suspense,{fallback:w.jsx("div",{className:"dark:text-white","data-source-lines":o,children:"🌀 Loading code..."}),children:w.jsx(N5,{htmlPromise:s,filename:i,code:e,sourceLines:o})})},Tx=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};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"})},_x=(e,t)=>{const r=L.useMemo(()=>{try{return{kind:"rendered",html:bx(e,t).html}}catch(i){return{kind:"failed",error:i,message:`Math rendering error: ${i instanceof Error?i.message:String(i)}`}}},[e,t]);return L.useEffect(()=>{r.kind==="failed"&&console.error("An error occurred while rendering KaTeX:",r.error)},[r]),r},X5=({node:e})=>{const t=_x(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(Tx,{code:e.value}),t.kind==="rendered"?w.jsx("article",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):w.jsx("article",{className:r,children:t.message})]})},G5=/^[a-z][a-z0-9+.-]*:/i,V5=/^[/\\]{2}/,K5=/[\t\n\r]/g,Nd=32,Z5=e=>{let t=0,r=e.length;for(;t<r&&e.charCodeAt(t)<=Nd;)t+=1;for(;r>t&&e.charCodeAt(r-1)<=Nd;)r-=1;return e.slice(t,r)},Bx=e=>{const t=Z5(e).replace(K5,"");return G5.test(t)||V5.test(t)},Q5="text-link underline visited:text-link-visited",J5="inline-block w-fit",qh=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"]);[...qh].join(",");const Lx=(e,t)=>[e,t?J5:void 0,Q5].filter(r=>r!==void 0&&r.trim()!=="").join(" "),t3=new Set(["id","title","lang","dir","role"]),e3=["aria-","data-footnote-"],r3=e=>{const t={};for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();(t3.has(o)||e3.some(s=>o.startsWith(s)&&o.length>s.length))&&(t[o]=i)}return Object.freeze(t)},ye=new un.Logger(un.LogLevel.INFO,"[DifyIFramePlugin]"),i3="100%",o3="600px",s3="0",a3=e=>typeof e!="object"||e===null||!("type"in e)?null:typeof e.type=="string"?e.type:null,n3=({embed:e,iFrameAllowedDomains:t})=>{const[r,i]=L.useState(!0),[o,s]=L.useState(!1),a=L.useRef(null),n=L.useRef(null),l=L.useRef(null),{src:c}=e,h=L.useCallback(x=>{x.source===null||x.source!==a.current?.contentWindow||!fb(x.origin,t)||a3(x.data)==="dify-chatbot-iframe-ready"&&(ye.info("Dify chatbot iframe is ready"),i(C=>C&&(s(!1),n.current&&(clearTimeout(n.current),n.current=null),l.current&&(clearTimeout(l.current),l.current=null),!1)))},[t]),d=L.useCallback(()=>{const x=a.current;if(x)try{if(!x.contentDocument)throw new Error("Cannot access iframe content");i(k=>k&&(s(!1),!1))}catch{ye.info("Crossorigin error detected, showing auth prompt"),s(k=>k||(i(!1),!0))}},[]),u=L.useCallback(()=>{const x=window.open(c,"dify-oauth","width=500,height=600,scrollbars=yes,resizable=yes");if(!x){ye.error("ポップアップがブロックされました");return}const C=setInterval(()=>{if(x.closed){clearInterval(C),ye.info("ポップアップが閉じられました");try{ye.info("ポップアップURL:",x.location.href)}catch(S){ye.info("クロスオリジンのためURLにアクセスできません:",S)}const k=a.current;if(k?.src){const S=k.src;i(v=>v||!0),s(v=>v&&!1),k.src="",setTimeout(()=>{k.src=S,n.current=setTimeout(()=>{ye.warn("認証後タイムアウト: dify-chatbot-iframe-ready not received after auth"),d()},5e3)},100)}}},1e3);ye.info("ポップアップを開きました:"),ye.info("- 初期URL:",c),ye.info("- ウィンドウ名:","dify-oauth"),ye.info("- ウィンドウサイズ: 500x600")},[d,c]);L.useEffect(()=>(window.addEventListener("message",h),()=>{window.removeEventListener("message",h)}),[h]),L.useEffect(()=>{const x=setTimeout(()=>{ye.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]),L.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);const{width:f=i3,height:p=o3,frameborder:m=s3,...y}=e.attributes;return w.jsxs("div",{className:"dify-iframe-container",children:[r&&!o&&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 チャットボットを読み込み中..."})]}),o&&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:u,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||o?"hidden":"block"}`,children:w.jsx("iframe",{ref:a,...wt.attributesToProps({...y,width:f,height:p,frameborder:m},"iframe"),src:c,"data-plugin-type":"dify"})})]})},qd=Object.freeze({dify:n3}),l3=e=>Object.hasOwn(qd,e)?qd[e]:null,h3=w.jsx(L.Fragment,{}),c3=(e,t,r,i,o)=>{const s=t===null?null:l3(t),a=e.attributes.title===void 0?{title:`${i.text}: ${new URL(e.src).hostname}`,lang:i.lang}:{};return w.jsx(ZC,{embed:e,label:i,insideAnchor:o,children:s!==null?w.jsx(s,{embed:e,iFrameAllowedDomains:r}):w.jsx("iframe",{...wt.attributesToProps(e.attributes,"iframe"),...a,src:e.src})})},Ex=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof wt.Element&&t.name.toLowerCase()==="a")return!0;return!1},Fx=e=>e.some(t=>t instanceof wt.Element&&(qh.has(t.name)||Fx(t.children))),d3=(e,t,r)=>{const{class:i,"data-link-kind":o,"data-doc-path":s,"data-doc-exists":a,...n}=e.attribs,l=Lx(i,Fx(e.children)),c=n.href??"",h=o,d=h==="external"||Bx(c),u=wt.domToReact(e.children,t);if(r&&c&&!d)return w.jsx(r,{href:c,kind:h,docPath:s,docExists:a===void 0?void 0:a==="true",className:l,attributes:r3(n),children:u});d&&(n.target="_blank",n.rel="noreferrer");const f={};return o!==void 0&&(f["data-link-kind"]=o),s!==void 0&&(f["data-doc-path"]=s),a!==void 0&&(f["data-doc-exists"]=a),w.jsx("a",{...wt.attributesToProps(n,"a"),className:l,...f,children:u})},Ax=({iFrameAllowedDomains:e,embedLabels:t,linkComponent:r,renderPlaceholder:i,renderKept:o})=>{const s={replace:a=>{if(!(a instanceof wt.Element))return;const n=a.parent instanceof wt.Element?a.parent.name:null,l=ta(a.name,a.attribs,{parentName:n,iFrameAllowedDomains:e});switch(l.action){case"remove":return h3;case"unwrap":return w.jsx(L.Fragment,{children:wt.domToReact(a.children,s)});case"embed":return c3(l.embed,l.pluginType,e,t.embeddedFrame,Ex(a))}if(a.attribs={...l.attributes},l.action==="placeholder"){const h=i?.(a,l.link,s);if(h!==void 0)return h}const c=o?.(a,s);if(c!==void 0)return c;if(a.name==="a")return d3(a,s,r)}};return s};const u3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],f3=Tt("code-xml",u3),p3=e=>/\.[Ss][Vv][Gg]$/u.test(e),Mx=e=>{const t=L.useRef(e);L.useLayoutEffect(()=>{t.current=e});const r=e!==void 0;return L.useMemo(()=>{if(r)return{read:(i,o)=>{const s=t.current;return s===void 0?Promise.reject(new Error("[@aiquants/markdown] the image source stand-in was called after its reader was removed")):s.read(i,o)}}},[r])},hn="data-aqmd-svg-image-control",g3=Object.freeze(["source"]),m3=Object.freeze(["source","copy"]),y3=Object.freeze({kind:"failure",retryable:!0}),x3=({paragraph:e,image:t,path:r,name:i,reader:o,labels:s})=>{const{[vi.SOURCE_LINES_ATTRIBUTE]:a,...n}=e,[l,c]=L.useState(!1),[h,d]=L.useState(0),[u,f]=L.useState(null),[p,m]=L.useState(null),y=L.useId(),x=L.useId(),C=L.useRef(null);L.useEffect(()=>{if(!l)return;const R=new AbortController;return new Promise(N=>N(o.read(r,R.signal))).then(N=>{R.signal.aborted||f({read:h,answer:N})},N=>{R.signal.aborted||(console.error("[@aiquants/markdown] the image source reader failed without an abort",N),f({read:h,answer:y3}))}),()=>R.abort()},[l,h,r,o]);const k=l&&u!==null&&u.read===h?u.answer:null,S=k!==null&&k.kind==="text"&&!k.truncated?k.text:null,{onKeyDown:v,onFocus:_,tabIndexOf:E}=Rh(S===null?g3:m3,hn),B=R=>{m(N=>({text:s[R].text,lang:s[R].lang,serial:N===null?1:N.serial+1}))},O=()=>{if(m(null),l){c(!1);return}d(R=>R+1),c(!0)},A=()=>{C.current?.focus(),d(R=>R+1)},D=(R,N)=>{const F=R.currentTarget.ownerDocument.defaultView?.navigator.clipboard;if(F===void 0){B("copyFailed");return}F.writeText(N).then(()=>B("copied"),$=>{console.error("[@aiquants/markdown] could not copy the image source",$),B("copyFailed")})};let W;return l?k===null?W=w.jsx("p",{"data-aqmd-svg-image-loading":"",lang:s.loading.lang,children:s.loading.text}):k.kind==="failure"?W=w.jsxs("div",{"data-aqmd-svg-image-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[w.jsx("p",{lang:s.failed.lang,children:s.failed.text}),k.retryable&&w.jsxs("button",{type:"button","data-aqmd-svg-image-retry":"",onClick:A,lang:s.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(gn,{className:"h-4 w-4"}),s.retry.text]})]}):W=w.jsxs(w.Fragment,{children:[w.jsx("span",{id:x,hidden:!0,lang:s.sourceRegion.lang,children:It.fillLabel(s.sourceRegion.text,{name:i})}),w.jsx("pre",{"data-aqmd-svg-image-source":"",tabIndex:0,role:"region","aria-labelledby":x,children:k.text}),k.truncated&&w.jsx("p",{"data-aqmd-svg-image-truncated":"",lang:s.truncated.lang,children:s.truncated.text})]}):W=w.jsx("p",{...wt.attributesToProps(n,"p"),children:t}),w.jsxs("div",{"data-aqmd-svg-image":"","data-aqmd-svg-image-view":l?"source":"image","data-source-lines":a,children:[w.jsx("span",{id:y,hidden:!0,lang:s.toolbar.lang,children:s.toolbar.text}),w.jsxs("div",{"data-aqmd-svg-image-toolbar":"",role:"toolbar","aria-labelledby":y,onKeyDown:v,onFocus:_,className:"mb-1 flex flex-wrap items-center gap-1",children:[w.jsx("button",{ref:C,type:"button",[hn]:"source",tabIndex:E("source"),"aria-pressed":l,onClick:O,className:jr,"aria-label":s.source.text,lang:s.source.lang,children:w.jsx(f3,{size:20})}),S!==null&&w.jsx("button",{type:"button",[hn]:"copy",tabIndex:E("copy"),onClick:R=>D(R,S),className:jr,"aria-label":s.copy.text,lang:s.copy.lang,children:w.jsx(kx,{size:18})})]}),W,w.jsx("p",{"data-aqmd-svg-image-notice":"",role:"status",children:p!==null&&w.jsx("span",{lang:p.lang,children:p.text},p.serial)})]})},La=Object.freeze({toolbar:{text:"SVG image",lang:"en"},source:{text:"Source",lang:"en"},sourceRegion:{text:"Source of {name}",lang:"en"},loading:{text:"Loading the source…",lang:"en"},failed:{text:"The source could not be read.",lang:"en"},retry:{text:"Try again",lang:"en"},truncated:{text:"Only the beginning of this file is shown.",lang:"en"},copy:{text:"Copy the source",lang:"en"},copied:{text:"Copied the source.",lang:"en"},copyFailed:{text:"Could not copy the source.",lang:"en"}}),C3=Qs(La),b3=({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(IC,{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})]})]}),k3=(e,t,r)=>{const{src:i,alt:o,"data-asset-exists":s,"data-asset-src":a}=e.attribs;if(!i||i.trim()===""||s==="false")return w.jsx(b3,{alt:o,target:a,label:t});const n=r.rendered===0;return r.rendered+=1,w.jsx("img",{alt:"",...wt.attributesToProps({loading:n?"eager":"lazy",decoding:"async",...e.attribs})})},Ao=e=>e.map(t=>t instanceof wt.Text?t.data:t instanceof wt.Element?Ao(t.children):"").join(""),w3=(e,t)=>e.map(r=>{if(r instanceof wt.Text)return{kind:"text",text:r.data};if(!(r instanceof wt.Element))return{kind:"ignored"};if(r.name.toLowerCase()!=="a")return{kind:"element"};const i=ta(r.name,r.attribs,{parentName:"p",iFrameAllowedDomains:t});return{kind:"link",href:i.action==="keep"?i.attributes.href??null:null}}),S3=(e,t,r,i)=>{const o=e.children,s=cr.placeholderLinkOf(t,w3(o,i.iFrameAllowedDomains));if(s===null)return;const a=wt.domToReact(o,r),n=w.jsx("p",{...wt.attributesToProps(e.attribs,"p"),children:a}),l=o.find(u=>u instanceof wt.Element),c=i.embeds.linkCardEndpoint,h=c!==null&&l!==void 0&&cr.isBareLink(Ao(l.children),s)?w.jsx(rb,{href:t,endpoint:c,size:Ne.linkCardSizeOf(i.embeds),fallback:n}):n,d=Rr.resolveEmbed(s,i.embeds.providers);return d===null?h:w.jsx(db,{resolution:d,caption:a,fallback:h,theme:i.theme,labels:i.embedLabels})},v3=(e,t)=>{if(Ex(e))return null;const r=e.children.filter(c=>!(c instanceof wt.Text&&kl.test(c.data))),[i]=r;if(r.length!==1||!(i instanceof wt.Element)||i.name.toLowerCase()!=="img")return null;const o=ta(i.name,i.attribs,{parentName:"p",iFrameAllowedDomains:t});if(o.action!=="keep")return null;const{src:s,alt:a,"data-asset-src":n,"data-asset-exists":l}=o.attributes;return n===void 0||!p3(n)||s===void 0||s.trim()===""||l==="false"?null:{node:i,path:n,name:a!==void 0&&a.trim()!==""?a:n.slice(n.lastIndexOf("/")+1)}},T3={lowerCaseAttributeNames:!1},zd=2166136261,jd=16777619,kl=/^[\t\n\f\r ]*$/u,_3=`language-${It.SPREADSHEETS_LANGUAGE}`,$x=e=>e.name==="code"&&(e.attribs.class??"").split(/[\t\n\f\r ]+/u).includes(_3),B3=e=>{let t=zd,r=zd;const i=(s,a)=>{for(let n=0;n<s.length;n+=1){const l=s.charCodeAt(n);r=Math.imul(r^l,jd),a&&(t=Math.imul(t^l,jd))}},o=(s,a)=>{if(s instanceof wt.Text)i("",a),i(s.data,a);else if(s instanceof wt.Element){i("",a),i(s.name,a);for(const[l,c]of Object.entries(s.attribs))l!==vi.SOURCE_LINES_ATTRIBUTE&&(i("",a),i(l,a),i("",a),i(c,a));i("",a);const n=a&&!$x(s);for(const l of s.children)o(l,n);i("",a)}else i("\x07",a),i(s.data,a)};return o(e,!0),{fingerprint:(t>>>0).toString(36),content:(r>>>0).toString(36)}},L3=(e,t,r,i)=>{if(e==="")return{nodes:[],keys:[]};const o=wt.htmlToDOM(e,T3),s=o.filter(l=>!(l instanceof wt.Text&&kl.test(l.data))),a=zC(s.map(B3),r);let n=0;return{nodes:o.map(l=>{if(l instanceof wt.Text&&kl.test(l.data))return l.data;const{key:c,content:h}=a[n];return n+=1,w.jsx(PC,{content:h,label:i,text:()=>Ao([l]),children:wt.domToReact([l],t)},c)}),keys:a}},Ox=({htmlContent:e,theme:t="light",iFrameAllowedDomains:r=[],embeds:i=Ne.NO_EMBEDS,embedLabels:o,mermaidInteraction:s,mermaidLabels:a,spreadsheetEditor:n,spreadsheetLocale:l,spreadsheetLabels:c,linkComponent:h,missingImageLabel:d="Image not found",blockFailedLabel:u,imageSource:f,svgImageLabels:p,onMathDiagnostics:m})=>{eu(i);const y=Vd(o),x=Sx(n),C=Mx(f),k=L.useMemo(()=>_i(La,p),[p]),{blockFailed:S}=_i(Jd,{blockFailed:u}),v={rendered:0},_=[],E=L.useRef(null),B=L.useEffectEvent(R=>{m?.(R)}),O=Ax({iFrameAllowedDomains:r,embedLabels:y,linkComponent:h,renderPlaceholder:(R,N,F)=>S3(R,N,F,{embeds:i,theme:t,embedLabels:y,iFrameAllowedDomains:r}),renderKept:(R,N)=>{if(R.name==="p"&&C!==void 0){const F=v3(R,r);if(F!==null)return w.jsx(x3,{paragraph:R.attribs,image:wt.domToReact([F.node],N),path:F.path,name:F.name,reader:C,labels:k})}if(R.name==="pre"&&R.children.length===1){const F=R.children[0];if(F instanceof wt.Element&&F.name==="code"){const $=F.attribs.class??"",q=Ao(F.children),P=R.attribs[vi.SOURCE_LINES_ATTRIBUTE];return $x(F)?w.jsx(Dh,{tsv:q,meta:F.attribs[It.CODE_META_ATTRIBUTE],sourceLines:P,editor:x,locale:l,labels:c}):$.includes("language-mermaid")?w.jsx(Ih,{chartContent:q,interaction:s,labels:a,sourceLines:P}):w.jsx(Nh,{lang:$.replace("language-",""),code:q,theme:t,sourceLines:P})}}if(R.name==="img")return k3(R,d,v);if(R.name==="span"&&R.attribs.class?.includes("math")){const F=R.attribs.class.includes("display");let $=Ao(R.children).trim();F?$=$.replace(/^\\\[/,"").replace(/\\\]$/,""):$=$.replace(/^\\\(/,"").replace(/\\\)$/,"");try{const{html:q,diagnostics:P}=bx($,F);return _.push(...P),F?w.jsxs("span",{className:"group relative block",children:[w.jsx(Tx,{code:$}),w.jsx("span",{dangerouslySetInnerHTML:{__html:q}})]}):w.jsx("span",{dangerouslySetInnerHTML:{__html:q}})}catch(q){console.error("Failed to render math:",q);return}}}}),A=L.useRef([]),{nodes:D,keys:W}=L3(e,O,A.current,S);return L.useEffect(()=>{A.current=W},[W]),L.useEffect(()=>{E.current!==e&&(E.current=e,_.length>0&&B(_))},[e,_]),w.jsx("div",{className:"markdown-body","data-theme":t,children:D})};const E3=[["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"}]],F3=Tt("triangle-alert",E3);const A3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],M3=Tt("text-align-center",A3);const $3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],O3=Tt("text-align-start",$3);const R3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],I3=Tt("text-align-end",R3);const P3=[["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"}]],D3=Tt("list",P3);const N3=[["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"}]],q3=Tt("palette",N3);const z3=[["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"}]],j3=Tt("pin",z3);const W3=[["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"}]],H3=Tt("pin-off",W3),Y3=e=>`#${e.id}`,U3=e=>{let t=Number.POSITIVE_INFINITY;for(const r of e)r.depth<t&&(t=r.depth);return t},Wd="block truncate py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Rx=({headings:e,className:t="",onHeadingSelect:r,headingHref:i=Y3,label:o,labelledBy:s})=>{if(e.length===0)return null;const a=U3(e);return w.jsx("nav",{className:`toc ${t}`,"aria-label":o,"aria-labelledby":s,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:`${Wd} text-gray-600 dark:text-gray-300`,title:n.text,children:n.text}):w.jsx("a",{href:Mo(c)?c:void 0,className:`${Wd} 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)})})})},cn="--aqmd-toolbar-block-overlap",X3=({toolbar:e,content:t,scrollportTop:r,scrollportBottom:i})=>{if(e.width<=0||e.height<=0)return 0;const o=e.left<t.right&&e.right>t.left,s=e.top<r+e.height&&e.top<i,a=e.bottom-r;return o&&s&&a>0?Math.ceil(a):0},Ix=e=>`mermaid${e.charAt(0).toUpperCase()}${e.slice(1)}`,Px=Object.keys(Ba),G3=e=>`spreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`,V3=Object.keys(It.SPREADSHEET_BLOCK_LABEL_CATALOGS.en),Dx=e=>`svgImage${e.charAt(0).toUpperCase()}${e.slice(1)}`,Nx=Object.keys(La),qx=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"},...Jd,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=>[Ix(e),Ba[e]])),...Object.fromEntries(Nx.map(e=>[Dx(e),La[e]])),...Js}),K3=Qs(qx),Z3=e=>_i(qx,e),Q3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of Px){const i=e[Ix(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},J3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of V3){const i=e[G3(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},t$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of Nx){const i=e[Dx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},e$=Object.keys(Js),r$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of e$){const i=e[r];i!==void 0&&(t[r]=i)}return Object.freeze(t)},Hd=Object.freeze({left:{labelKey:"alignLeft",Icon:O3},center:{labelKey:"alignCenter",Icon:M3},right:{labelKey:"alignRight",Icon:I3}}),i$=Object.freeze({text:"ファイルを選択してください。",lang:"ja"}),o$="100%",s$=e=>e==="center"?"auto":e==="right"?"auto 0":"0 auto",wl="24px",zx=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"}),a$=zx(wl),n$=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"}),l$=e=>`calc(100cqi - var(--aqmd-toolbar-inset-inline-end, 0px) - ${e})`,h$=8,Yd=800,c$=16,d$=(e,t)=>{const r=e.defaultView;let i;const o=()=>{e.removeEventListener("click",s,!0),e.removeEventListener("pointercancel",a,!0),i!==void 0&&r?.clearTimeout(i)};function s(n){o(),!(n.timeStamp-t.timeStamp>Yd||Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY)>c$)&&(n.preventDefault(),n.stopPropagation())}function a(n){n.pointerId===t.pointerId&&o()}e.addEventListener("click",s,!0),e.addEventListener("pointercancel",a,!0),i=r?.setTimeout(o,Yd)},u$=(e,t,r)=>{const[i,o]=L.useState(null);return L.useLayoutEffect(()=>{const s=t.current;if(!e||s===null||r===null){o(null);return}const a=s.ownerDocument.defaultView;let n=0;const l=()=>{n=0;const d=s.getBoundingClientRect(),u=s.offsetHeight>0?d.height/s.offsetHeight:1,f=a?.visualViewport??null,p=f===null?Number.POSITIVE_INFINITY:f.offsetTop+f.height,m=Math.min(r.getBoundingClientRect().bottom,p);o(Math.max(0,Math.floor((m-d.top)/u-h$)))},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),s.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),s.ownerDocument.removeEventListener("scroll",c,!0)}},[e,t,r]),i};function dn({menu:e,Icon:t,buttonLabel:r,titleLabel:i,titleId:o,pinLabel:s,unpinLabel:a,isOpen:n,isPinned:l,isFront:c,onActivate:h,onToggle:d,onClose:u,onPinToggle:f,popoverClassName:p,scrollBarClearance:m,boundary:y,renderBody:x}){const C=L.useRef(null),k=L.useRef(null),S=L.useRef(null),v=u$(n,S,y),_=L.useCallback(()=>{d(),h()},[h,d]),E=L.useCallback(()=>{if(l)return;const O=C.current?.contains(document.activeElement)===!0;u(),O&&k.current?.focus()},[l,u]);L.useEffect(()=>{if(!n||l)return;const O=C.current;if(O===null)return;const A=W=>{O.contains(W.target)||(u(),W.pointerType==="touch"&&!(W.target instanceof Element&&W.target.closest("[data-aqmd-toolbar]")!==null)&&d$(O.ownerDocument,W))},D=W=>{W.key!=="Escape"||W.defaultPrevented||W.isComposing||(W.preventDefault(),u(),k.current?.focus())};return document.addEventListener("pointerdown",A),O.addEventListener("keydown",D),()=>{document.removeEventListener("pointerdown",A),O.removeEventListener("keydown",D)}},[n,l,u]);const B=l?a:s;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:S,"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:l$(m),maxBlockSize:v??void 0},children:[w.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[w.jsx("h3",{id:o,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:f,"aria-label":B.text,lang:B.lang,children:l?w.jsx(j3,{className:"h-4 w-4"}):w.jsx(H3,{className:"h-4 w-4"})})]}),x(E)]})]})}const f$=(e,t,r,i)=>{const[o,s]=L.useState(0),a=L.useRef(null);return L.useLayoutEffect(()=>{const n=e.current,l=t.current;if(r===null||n===null||l===null){a.current=null,s(0);return}const c=()=>{const p=n.getBoundingClientRect();s(X3({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 u=new ResizeObserver(c);u.observe(n),u.observe(l),u.observe(r);const f=r.querySelector("[data-aqmd-toolbar-inset-probe]");return f!==null&&u.observe(f),window.addEventListener("resize",c),window.addEventListener("scroll",d,{capture:!0,passive:!0}),()=>{a.current=null,u.disconnect(),window.removeEventListener("resize",c),window.removeEventListener("scroll",d,{capture:!0}),h!==null&&cancelAnimationFrame(h)}},[e,t,r]),L.useLayoutEffect(()=>{a.current?.()},[i]),o},p$=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,g$=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},m$=L.memo(function({parseResult:t,theme:r,styleClassName:i,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:u,spreadsheetLabels:f,imageSource:p,svgImageLabels:m,onMathDiagnostics:y}){return w.jsx("div",{className:"w-full min-w-0",children:w.jsx("div",{className:i,"data-theme":r,children:w.jsx(Ox,{htmlContent:t.htmlContent,theme:r,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:u,spreadsheetLabels:f,imageSource:p,svgImageLabels:m,onMathDiagnostics:y})})})});function jx(){const[e,t]=L.useState("toc"),[r,i]=L.useState(!1),[o,s]=L.useState(!1),[a,n]=L.useState(!1),[l,c]=L.useState(!1),[h,d]=L.useState(!1),[u,f]=L.useState(!1),p=L.useCallback(()=>t("toc"),[]),m=L.useCallback(()=>i(A=>!A),[]),y=L.useCallback(()=>i(!1),[]),x=L.useCallback(()=>c(A=>!A),[]),C=L.useCallback(()=>t("style"),[]),k=L.useCallback(()=>s(A=>!A),[]),S=L.useCallback(()=>s(!1),[]),v=L.useCallback(()=>d(A=>!A),[]),_=L.useCallback(()=>t("align"),[]),E=L.useCallback(()=>n(A=>!A),[]),B=L.useCallback(()=>n(!1),[]),O=L.useCallback(()=>f(A=>!A),[]);return{lastActiveMenu:e,isTocOpen:r,isStyleOpen:o,isAlignOpen:a,isTocPinned:l,isStylePinned:h,isAlignPinned:u,activateToc:p,toggleToc:m,closeToc:y,togglePinToc:x,activateStyle:C,toggleStyle:k,closeStyle:S,togglePinStyle:v,activateAlign:_,toggleAlign:E,closeAlign:B,togglePinAlign:O}}const y$=({error:e,labels:t})=>{if(L.isValidElement(e))return w.jsx("div",{className:"p-4",children:e});if(typeof e=="object"&&e!==null&&"message"in e){const i=e,o=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(F3,{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:o?void 0:t.defaultErrorTitle.lang,className:"font-semibold text-base text-red-900 dark:text-red-200",children:o?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 x$({parseResult:e,content:t,error:r=null,isLoading:i=!1,labels:o,theme:s,style:a,onStyleChange:n,availableStyles:l=Yi.DEFAULT_MARKDOWN_STYLES,align:c=Yi.DEFAULT_CONTENT_ALIGN,onAlignChange:h,showToc:d=!0,showStyle:u=!0,showAlign:f=!0,width:p,maxWidth:m,padding:y=16,iFrameAllowedDomains:x,embeds:C=Ne.NO_EMBEDS,emptyMessage:k,toolbar:S,linkComponent:v,onHeadingSelect:_,headingHref:E,onMathDiagnostics:B,spreadsheetEditor:O,spreadsheetLocale:A,imageSource:D,renderScrollBar:W}){const R=L.useRef(null),[N,F]=L.useState(null),$=L.useCallback(Z=>{R.current=Z,F(Z)},[]),[q,P]=L.useState(0),I=L.useRef(null),[j,T]=L.useState(null),U=L.useRef(null),z=L.useId(),G=jx(),X=S??G,K=L.useMemo(()=>Z3(o),[o]),Q=L.useMemo(()=>Q3(o),[o]),nt=L.useMemo(()=>J3(o),[o]),gt=L.useMemo(()=>t$(o),[o]),ut=Mx(D),mt=Sx(O);eu(C);const Lt=Rr.EMBED_PROVIDER_IDS.filter(Z=>C.providers.includes(Z)).join(" "),Ft=C.linkCardEndpoint,Mt=C.linkCardSize,Ht=L.useMemo(()=>{const Z=Lt.split(" "),it=Object.freeze(Rr.EMBED_PROVIDER_IDS.filter(St=>Z.includes(St)));return Object.freeze(Mt===void 0?{providers:it,linkCardEndpoint:Ft}:{providers:it,linkCardEndpoint:Ft,linkCardSize:Mt})},[Lt,Ft,Mt]),Yt=o?.embeddedVideo,Qt=o?.embeddedPost,we=o?.embeddedFrame,Se=L.useMemo(()=>r$({embeddedVideo:Yt,embeddedPost:Qt,embeddedFrame:we}),[Yt,Qt,we]),_t=L.useRef(B);L.useLayoutEffect(()=>{_t.current=B},[B]);const Ct=L.useCallback(Z=>{_t.current?.(Z)},[]),ve=k===void 0?i$:{text:k,lang:void 0},Yr=f$(R,I,j,c);if(!Yi.CONTENT_ALIGNS.includes(c))throw new TypeError(`[@aiquants/markdown] align must be one of ${Yi.CONTENT_ALIGNS.join(", ")}; got ${String(c)} (normalize it with toContentAlign)`);const ge=Number.isFinite(y)&&y>=0?y:16,sr=L.useCallback(Z=>{const it=R.current;if(it){const St=it.querySelector("[data-theme]"),Et=it.getBoundingClientRect(),ie=St?.children;let le=-1,Vr=Number.POSITIVE_INFINITY;if(ie)for(let Hi=0;Hi<ie.length;Hi+=1){const Ea=ie[Hi],zh=Math.abs(Ea.getBoundingClientRect().top-Et.top);zh<Vr&&(Vr=zh,le=Hi)}if(ie&&le>=0){const Ea=ie[le].getBoundingClientRect();U.current={childIndex:le,offset:Ea.top-Et.top}}else U.current=null}n(Z)},[n]);L.useLayoutEffect(()=>{const Z=U.current;if(!Z)return;U.current=null;const it=R.current;if(!it)return;const Et=it.querySelector("[data-theme]")?.children[Z.childIndex];if(!Et)return;const ie=it.getBoundingClientRect(),Vr=Et.getBoundingClientRect().top-ie.top;it.scrollTop+=Vr-Z.offset});const{isTocPinned:xr,closeToc:Xe}=X,Cr=L.useCallback((Z,it)=>{if(xr||Xe(),_?.(Z,it)===!0)return;it.preventDefault();const Et=R.current?.querySelector(`#${CSS.escape(Z.id)}`)??document.getElementById(Z.id);Et&&(g$(Et),Et.tabIndex<0&&!Et.hasAttribute("tabindex")&&Et.setAttribute("tabindex","-1"),Et.scrollIntoView({behavior:p$()?"instant":"smooth",block:"start"}),Et.focus({preventScroll:!0}))},[Xe,xr,_]),Ur=L.useMemo(()=>l.find(it=>it.name===a)?.className??"markdown-body",[l,a]),ar=e?.headings??[],br=!(i||r),Re=br&&e!==null,Te=br&&e===null&&t!==null,kr=Re&&d&&ar.length>0,J=Re&&u,xt=(Re||Te)&&f&&typeof h=="function"&&(p!==void 0||m!==void 0),Dt=L.useMemo(()=>w.jsx(Rx,{headings:ar,className:"text-sm",labelledBy:z,onHeadingSelect:Cr,headingHref:E}),[ar,z,Cr,E]),At=W===void 0?wl:`${q}px`,Xr=L.useMemo(()=>At===wl?a$:zx(At),[At]),Gr=kr||J||xt?w.jsxs("div",{ref:T,"data-aqmd-toolbar":!0,style:Xr,children:[w.jsx("span",{"data-aqmd-toolbar-inset-probe":!0,"aria-hidden":"true",style:n$}),xt&&h&&w.jsx(dn,{menu:"align",Icon:Hd[c].Icon,buttonLabel:K.selectAlignAria,titleLabel:K.alignTitle,pinLabel:K.pinAlignAria,unpinLabel:K.unpinAlignAria,isOpen:X.isAlignOpen,isPinned:X.isAlignPinned,isFront:X.lastActiveMenu==="align",onActivate:X.activateAlign,onToggle:X.toggleAlign,onClose:X.closeAlign,onPinToggle:X.togglePinAlign,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:N,renderBody:Z=>w.jsx("div",{className:"space-y-1",children:Yi.CONTENT_ALIGNS.map(it=>{const{labelKey:St,Icon:Et}=Hd[it],ie=K[St],le=c===it;return w.jsxs("button",{type:"button","aria-pressed":le,lang:ie.lang,className:`flex min-h-11 w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors ${le?"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(it),Z()},children:[w.jsx(Et,{className:"h-4 w-4"}),ie.text]},it)})})}),J&&w.jsx(dn,{menu:"style",Icon:q3,buttonLabel:K.selectStyleAria,titleLabel:K.styleTitle,pinLabel:K.pinStyleAria,unpinLabel:K.unpinStyleAria,isOpen:X.isStyleOpen,isPinned:X.isStylePinned,isFront:X.lastActiveMenu==="style",onActivate:X.activateStyle,onToggle:X.toggleStyle,onClose:X.closeStyle,onPinToggle:X.togglePinStyle,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:N,renderBody:Z=>w.jsx("div",{className:"space-y-1",children:l.map(it=>{const St=a===it.name;return w.jsx("button",{type:"button","aria-pressed":St,className:`min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${St?"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:()=>{sr(it.name),Z()},children:it.name},it.name)})})}),kr&&w.jsx(dn,{menu:"toc",Icon:D3,buttonLabel:K.openTocAria,titleLabel:K.tocTitle,titleId:z,pinLabel:K.pinTocAria,unpinLabel:K.unpinTocAria,isOpen:X.isTocOpen,isPinned:X.isTocPinned,isFront:X.lastActiveMenu==="toc",onActivate:X.activateToc,onToggle:X.toggleToc,onClose:X.closeToc,onPinToggle:X.togglePinToc,popoverClassName:"markdown-viewer-scrollbar-thin w-64 p-4",scrollBarClearance:At,boundary:N,renderBody:()=>Dt})]}):null,No=()=>i?w.jsxs("p",{children:[w.jsx("span",{"aria-hidden":"true",children:"🌀"})," ",w.jsx("span",{lang:K.loading.lang,children:K.loading.text})]}):r?w.jsx(y$,{error:r,labels:K}):e?w.jsx("div",{className:"relative w-full min-w-0",children:w.jsx(m$,{parseResult:e,theme:s,styleClassName:Ur,iFrameAllowedDomains:x,embeds:Ht,embedLabels:Se,linkComponent:v,missingImageLabel:K.missingImage.text,blockFailedLabel:o?.blockFailed,mermaidLabels:Q,spreadsheetEditor:mt,spreadsheetLocale:A,spreadsheetLabels:nt,imageSource:ut,svgImageLabels:gt,onMathDiagnostics:Ct})}):t!==null?w.jsx("pre",{className:"whitespace-pre-wrap break-all",children:t}):w.jsx("p",{lang:ve.lang,children:ve.text}),Wi={containerType:"inline-size",paddingInline:`${ge}px`,paddingBlockEnd:`${ge}px`,paddingBlockStart:`calc(${ge}px + var(${cn}))`,scrollPaddingBlockStart:`var(${cn})`,[cn]:`${Yr}px`};return w.jsxs(Zd,{scrollerRef:$,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:Wi},renderScrollBar:W,onBarInlineSizeChange:P,children:[Gr,w.jsx("div",{ref:I,"data-aqmd-content":!0,style:{width:p??o$,maxWidth:m,marginInline:s$(c)},children:No()})]})}const Wx=({node:e})=>w.jsx("del",{children:w.jsx(zt,{nodes:e.children})}),Hx=({node:e})=>w.jsx("em",{children:w.jsx(zt,{nodes:e.children})}),Yx=({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,"]"]})}),C$=({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}`))})}),Ux=({node:e})=>w.jsx("a",{href:e.url,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",children:"↩"}),b$=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,(o,s)=>{const a=Number(s);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/&#x([0-9a-f]+);/gi,(o,s)=>{const a=Number.parseInt(s,16);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/\s+/g," ").trim(),Xx=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"?b$(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()},k$=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"}},Gx=({node:e})=>{const t=new gC,r=`h${e.depth}`,i=e.data?.hProperties?.id,o=t.slug(Xx(e.children));return w.jsx(r,{id:i||o,className:k$(e.depth),children:w.jsx(zt,{nodes:e.children})})},w$=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==!1).map(([t,r])=>[t,r===!0?"":String(r)])),S$=({node:e,theme:t,iFrameAllowedDomains:r=[]})=>{const i=w.jsx(zt,{nodes:e.children,theme:t,iFrameAllowedDomains:r}),o=ta(e.data.tagName,w$(e.data.properties),{parentName:null,iFrameAllowedDomains:r});if(o.action==="unwrap")return i;if(o.action!=="keep"&&o.action!=="placeholder")return null;const s=e.data.tagName.toLowerCase();return w.jsx(s,{...wt.attributesToProps(o.attributes,e.data.tagName.toLowerCase()),children:i})},v$=/^\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,T$=({node:e,iFrameAllowedDomains:t=[]})=>{const r=wt(e.value,Ax({iFrameAllowedDomains:t,embedLabels:xC}));return Array.isArray(r)&&r.length===0?null:v$.test(e.value)?w.jsx("div",{children:r}):w.jsx("span",{children:r})},Vx=({node:e})=>{if(!e.url||e.url.trim()===""||!Mo(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})]})},Kx=({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}),_$=({node:e})=>{const t=_x(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})},B$=new RegExp(`<(?:${[...qh].join("|")})(?=[\\s/>])`,"i"),Zx=e=>e.some(t=>t.type==="image"||t.type==="imageReference"||t.type==="html"&&typeof t.value=="string"&&B$.test(t.value)||t.children!==void 0&&Zx(t.children)),Qx=({node:e})=>{const t=Mo(e.url)?e.url:void 0,r=t!==void 0&&Bx(t);return w.jsx("a",{className:Lx(void 0,Zx(e.children)),href:t,target:r?"_blank":void 0,rel:r?"noreferrer":void 0,children:w.jsx(zt,{nodes:e.children})})},Jx=({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})}),tC=({node:e})=>{const t=e.ordered?"ol":"ul";return w.jsx(t,{children:w.jsx(zt,{nodes:e.children})})},L$=({node:e})=>w.jsx("mark",{children:w.jsx(zt,{nodes:e.children})}),eC=({node:e})=>w.jsx("p",{children:w.jsx(zt,{nodes:e.children})}),rC=({node:e})=>w.jsx("strong",{children:w.jsx(zt,{nodes:e.children})}),E$=({node:e})=>w.jsx("sub",{children:w.jsx(zt,{nodes:e.children})}),F$=({node:e})=>w.jsx("sup",{children:w.jsx(zt,{nodes:e.children})}),Ud=e=>{const t=e.data?.hProperties;return{merged:t?.merged??!1,colSpan:t?.colSpan,rowSpan:t?.rowSpan,textAlign:t?.textAlign}},iC=({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,o)=>{const{merged:s,colSpan:a,rowSpan:n,textAlign:l}=Ud(i);return s?null:w.jsx("th",{colSpan:a,rowSpan:n,style:{textAlign:l??e.align?.[o]??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}-${o}`)})})}),w.jsx("tbody",{children:r.map((i,o)=>w.jsx("tr",{className:"border-gray-200 border-t bg-white dark:border-gray-700 dark:bg-gray-900",children:i.children.map((s,a)=>{const{merged:n,colSpan:l,rowSpan:c,textAlign:h}=Ud(s);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:s.children})},`mdast-table-node-${e.type}-${a}`)})},`mdast-table-node-${e.type}-${o}`))})]})})},oC=({node:e})=>w.jsx(w.Fragment,{children:e.value}),sC=()=>w.jsx("hr",{className:"border-gray-300 dark:border-gray-600"}),aC=({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})})]})},nC=({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,o)=>{switch(i.type){case"blockquote":return w.jsx(lC,{node:i},`mdast-node-${i.type}-${o}`);case"break":return w.jsx("br",{},`mdast-node-${i.type}-${o}`);case"code":return w.jsx(Nh,{node:i,theme:t},`mdast-node-${i.type}-${o}`);case"delete":return w.jsx(Wx,{node:i},`mdast-node-${i.type}-${o}`);case"details":return w.jsx(aC,{node:i},`mdast-node-${i.type}-${o}`);case"emphasis":return w.jsx(Hx,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteReference":return w.jsx(Yx,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteDefinition":return null;case"footnote-back-link":return w.jsx(Ux,{node:i},`mdast-node-${i.type}-${o}`);case"heading":return w.jsx(Gx,{node:i},`mdast-node-${i.type}-${o}`);case"html":return w.jsx(T$,{node:i,iFrameAllowedDomains:r},`mdast-node-${i.type}-${o}`);case"html-block-container":{const s=i,a=`mdast-node-${s.type}-${s.position?.start?.offset??"na"}-${s.position?.end?.offset??"na"}`;return w.jsx(S$,{node:s,theme:t,iFrameAllowedDomains:r},a)}case"image":return w.jsx(Vx,{node:i},`mdast-node-${i.type}-${o}`);case"inlineCode":return w.jsx(Kx,{node:i},`mdast-node-${i.type}-${o}`);case"inlineMath":return w.jsx(_$,{node:i},`mdast-node-${i.type}-${o}`);case"link":return w.jsx(Qx,{node:i},`mdast-node-${i.type}-${o}`);case"listItem":return w.jsx(Jx,{node:i},`mdast-node-${i.type}-${o}`);case"list":return w.jsx(tC,{node:i},`mdast-node-${i.type}-${o}`);case"mark":return w.jsx(L$,{node:i},`mdast-node-${i.type}-${o}`);case"math":return w.jsx(X5,{node:i},`mdast-node-${i.type}-${o}`);case"message":return w.jsx(nC,{node:i},`mdast-node-${i.type}-${o}`);case"paragraph":return w.jsx(eC,{node:i},`mdast-node-${i.type}-${o}`);case"strong":return w.jsx(rC,{node:i},`mdast-node-${i.type}-${o}`);case"subscript":return w.jsx(E$,{node:i},`mdast-node-${i.type}-${o}`);case"superscript":return w.jsx(F$,{node:i},`mdast-node-${i.type}-${o}`);case"table":return w.jsx(iC,{node:i},`mdast-node-${i.type}-${o}`);case"text":return w.jsx(oC,{node:i},`mdast-node-${i.type}-${o}`);case"thematicBreak":return w.jsx(sC,{},`mdast-node-${i.type}-${o}`);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}-${o}`);throw new Error(`Unknown node type: ${i.type}`)}}}),lC=({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})}),A$=/\s*\{#(.+?)\}\s*$/,M$=()=>e=>{fe.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,o=i.value.match(A$);if(o){const s=o[1];t.data||(t.data={});const a=t.data,n=a.hProperties||{};n.id=s,a.hProperties=n,i.value=i.value.substring(0,o.index).trimEnd(),i.value===""&&t.children.pop()}})},$$=()=>e=>{fe.visit(e,"footnoteDefinition",t=>{fe.visit(t,"paragraph",r=>{r.children.push({type:"footnote-back-link",url:`#fnref-${t.identifier}`})})})},O$=()=>e=>{fe.visit(e,"html",(t,r,i)=>{if(typeof r!="number"||!i)return;const s=t.value.trim().match(/^<a\s+href="([^"]+)"[^>]*>(.*?)<\/a>$/i);if(s){const[,a,n]=s,l={type:"link",url:a,children:[{type:"text",value:n}]};i.children.splice(r,1,l)}})},R$=()=>e=>{const t=r=>{const i=r.children;if(!i)return;let o=0;for(;o<i.length;){const s=i[o];if(s.type==="html"&&s.value.startsWith("<")&&!s.value.startsWith("</")&&s.value.match(/<([a-zA-Z0-9]+)/)){let n="",l=0;const c=[];let h=!1;for(let d=o;d<i.length;d++){const u=i[d];if(u.type==="html"){n+=u.value;const f=u.value.match(/<\/?([a-zA-Z0-9]+)/g)||[];for(const p of f){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(u.type==="text")n+=u.value;else{c.length===0&&(h=!0);break}if(l++,c.length===0){h=!0;break}}h&&i.splice(o,l,{type:"html",value:n})}o++}};fe.visit(e,"paragraph",t),fe.visit(e,"tableCell",t),fe.visit(e,"heading",t),fe.visit(e,"emphasis",t),fe.visit(e,"strong",t),fe.visit(e,"delete",t)},Xd=/\s*=\s*(\d+)(w|h|x|y)\s*/g,I$=()=>e=>{fe.visit(e,"image",t=>{const r=l=>{if(!l)return{updatedText:l,matches:[]};const c=[...l.matchAll(Xd)];return{updatedText:l.replaceAll(Xd,"").trim(),matches:c}},{updatedText:i,matches:o}=r(t.alt);t.alt=i;const{updatedText:s,matches:a}=r(t.title);t.title=s||null;const n=[...o,...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)}}})},P$=()=>e=>{fe.visit(e,(t,r,i)=>{i&&Object.defineProperty(t,"parent",{value:i,writable:!0,configurable:!0,enumerable:!1})})},Gd=/^:::(message|details)\s*(.*)/,D$=()=>e=>{function t(r){const i=[];let o=0;for(;o<r.length;){const s=r[o];if(s.type==="paragraph"&&s.children[0]?.type==="text"&&s.children[0].value.trim().startsWith(":::")){const l=s.children[0].value.trim().match(Gd);if(l){const c=o;let h=-1,d=1;const u=s.children.at(-1);if(s.children.length>1&&u?.type==="text"&&u.value.trim()===":::")h=c;else for(let f=c+1;f<r.length;f++){const p=r[f];if(p.type==="paragraph"&&p.children[0]?.type==="text"){const m=p.children[0].value.trim();Gd.test(m)?d++:m===":::"&&d--}if(d===0){h=f;break}}if(h!==-1){const f=l[1],p=l[2];let m;if(h===c){const C=s.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=s.children.slice(1);C[0]?.type==="break"&&C.shift();const k={type:"paragraph",children:C},v=r[h].children.slice(0,-1);v.at(-1)?.type==="break"&&v.pop();const _={type:"paragraph",children:v},E=r.slice(c+1,h);m=[k,...E,_].filter(B=>!(B.type==="paragraph"&&B.children.length===0))}const y=t(m);let x;if(f==="message"?x={type:"message",data:{messageType:p.trim()},children:y}:f==="details"&&(x={type:"details",data:{title:p.trim()},children:y}),x){i.push(x),o=h+1;continue}}}}const a={...s};"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),o++}return i}e.children=t(e.children)},N$=e=>{const t=[];return fe.visit(e,"heading",r=>{const i=Xx(r.children),o=r.data?.hProperties?.id;o&&i&&t.push({depth:r.depth,text:i,id:o})}),t};exports.BlockquoteNode=lC;exports.CodeNode=Nh;exports.Color=Me;exports.Color$1=Di;exports.DEFAULT_MARKDOWN_EMBED_LABELS=yC;exports.DEFAULT_MARKDOWN_VIEWER_LABELS=K3;exports.DEFAULT_MERMAID_DIAGRAM_LABELS=hM;exports.DEFAULT_MERMAID_INTERACTION=gx;exports.DEFAULT_SVG_IMAGE_LABELS=C3;exports.DeleteNode=Wx;exports.EmphasisNode=Hx;exports.FootnoteBackLinkNode=Ux;exports.FootnoteReferenceNode=Yx;exports.FootnotesSection=C$;exports.HeadingNode=Gx;exports.HostedScrollArea=Zd;exports.ImageNode=Vx;exports.InlineCodeNode=Kx;exports.JSON_SCHEMA=yg;exports.LinkNode=Qx;exports.ListItemNode=Jx;exports.ListNode=tC;exports.MarkdownRenderer=Ox;exports.MarkdownViewer=x$;exports.MermaidDiagram=Ih;exports.NodesRenderer=zt;exports.ParagraphNode=eC;exports.Rgb=se;exports.SpreadsheetBlock=Dh;exports.StrongNode=rC;exports.TableNode=iC;exports.TableOfContents=Rx;exports.TextNode=oC;exports.ThematicBreakNode=sC;exports.Utils=pt;exports.ZERO_WIDTH_SPACE=qg;exports.ZennDetailsNode=aC;exports.ZennMessageNode=nC;exports.__export=lu;exports.__name=g;exports.abs=BS;exports.acos=RS;exports.adjustChannel=_l;exports.argumentsTag=ah;exports.array=df;exports.arrayBufferTag=Bg;exports.arrayTag=_g;exports.asin=IS;exports.assignWithDepth_default=qt;exports.at=rt;exports.atan2=LS;exports.booleanTag=sh;exports.calculateMathMLDimensions=J1;exports.calculateTextDimensions=ga;exports.calculateTextHeight=fh;exports.calculateTextWidth=je;exports.cleanAndMerge=ma;exports.clear=Lu;exports.clear$1=FB;exports.clear$2=iB;exports.clear2=vB;exports.color=Fi;exports.commonDb_exports=Al;exports.common_default=Pi;exports.computeDimensionOfText=vm;exports.computeLabelTransform=ii;exports.configureLabelImages=gh;exports.configureSvgSize=Fl;exports.constant=_r;exports.constant$1=sa;exports.cos=ES;exports.createText=Oe;exports.curveBasis=Ms;exports.darken=Y;exports.dataViewTag=Eg;exports.dateTag=Sg;exports.dayjs2=hu;exports.decodeEntities=pr;exports.defaultConfig2=lk;exports.defaultConfig_default=Bl;exports.define=oa;exports.distExports=Cg;exports.edgeLabels=Lo;exports.epsilon=$n;exports.extend=Nl;exports.extractHeadings=N$;exports.float32ArrayTag=Pg;exports.float64ArrayTag=Dg;exports.generateId=Ug;exports.getAccDescription=Mu;exports.getAccTitle=Fu;exports.getConfig=Ot;exports.getConfig2=kt;exports.getDefaultExportFromCjs=Kd;exports.getDiagramTitle=Ou;exports.getEdgeId=LT;exports.getEffectiveHtmlLabels=ee;exports.getIconSVG=qi;exports.getLineFunctionsWithOffset=r0;exports.getRegisteredLayoutAlgorithm=hL;exports.getStylesFromArray=uh;exports.getSubGraphTitleMargins=ya;exports.getTag=fa;exports.getThemeVariables3=du;exports.getUrl=_u;exports.getUserDefinedConfig=q1;exports.halfPi=On;exports.hasKatex=Li;exports.hue=ow;exports.insertCluster=Rm;exports.insertEdge=a0;exports.insertEdgeLabel=i0;exports.insertNode=Fh;exports.int16ArrayTag=Rg;exports.int32ArrayTag=Ig;exports.int8ArrayTag=Og;exports.interpolateNumber=Qe;exports.interpolateRgb=Tn;exports.interpolateString=Qu;exports.isDark=ke;exports.isLabelStyle=rh;exports.isPrimitive=pa;exports.isTypedArray=mo;exports.isValidShape=e0;exports.lighten=H;exports.line=ff;exports.lineBreakRegex=Ii;exports.load=xg;exports.log=V;exports.mapTag=vg;exports.markerOffsets=Zt;exports.markers_default=h0;exports.max=FS;exports.min=AS;exports.nogamma=ql;exports.numberTag=oh;exports.objectTag=Lg;exports.parseFontSize=Io;exports.parseGenericTypes=xn;exports.pi=la;exports.positionEdgeLabel=o0;exports.positionNode=TB;exports.random=Gg;exports.regexpTag=kg;exports.registerIconPacks=tm;exports.remarkCustomHeadingId=M$;exports.remarkFootnoteBackLink=$$;exports.remarkHtmlAnchorToLink=O$;exports.remarkHtmlInHtml=R$;exports.remarkImageSize=I$;exports.remarkParentNode=P$;exports.remarkZennMessage=D$;exports.render=lL;exports.renderKatexSanitized=El;exports.rgbConvert=Vu;exports.rgba=Je;exports.sanitizeText=Ce;exports.select=yt;exports.selectSvgElement=Rf;exports.setAccDescription=Au;exports.setAccTitle=Eu;exports.setConfig2=nk;exports.setDiagramTitle=$u;exports.setNodeElem=SB;exports.setTag=Tg;exports.setupGraphViewbox=Bu;exports.setupGraphViewbox2=Ru;exports.sin=MS;exports.sqrt=$S;exports.stringTag=ih;exports.styles2String=ot;exports.symbolTag=wg;exports.tau=OS;exports.terminalLabels=Ut;exports.uint16ArrayTag=Mg;exports.uint32ArrayTag=$g;exports.uint8ArrayTag=Fg;exports.uint8ClampedArrayTag=Ag;exports.unknownIcon=Qg;exports.updateNodeBounds=st;exports.useMarkdownToolbarState=jx;exports.utils_default=xe;exports.withPath=cf;exports.wrapLabel=Vg;
|
|
314
|
+
`)},f5=(e,t)=>{const r=e.indexOf(t);return r===-1?{echo:!1,pending:[]}:{echo:!0,pending:e.slice(r+1)}},p5=(e,t,r,i,o)=>{const s=o==="down"?1:o==="up"?-1:0,a=o==="right"?1:o==="left"?-1:0,n=(d,u)=>d>=0&&d<t&&u>=0&&u<r,l=(d,u)=>e(d,u)!=="";let c=i.row+s,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+s,h+a)&&l(c+s,h+a);)c+=s,h+=a;return{row:c,col:h}}for(;n(c,h);){if(l(c,h))return{row:c,col:h};c+=s,h+=a}return{row:c-s,col:h-a}},g5=/^(?:https?:\/\/|mailto:|tel:)\S+$/iu,m5=e=>g5.test(e)?e:void 0,y5=(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}`},x5=Object.freeze(["decreaseColumnWidth","increaseColumnWidth","autoFitColumnWidth","decreaseRowHeight","increaseRowHeight"]),C5=()=>{let e=Object.freeze({row:0,col:0});const t=new Set;return{get:()=>e,set:r=>{if(!(r.row===e.row&&r.col===e.col)){e=Object.freeze({row:r.row,col:r.col});for(const i of[...t])i()}},subscribe:r=>(t.add(r),()=>{t.delete(r)})}},is="data-aqmd-spreadsheet-control",b5=Object.freeze(["zoom-in","zoom-out","reset-zoom","highlight","track-size","copy","save","save-menu","fullscreen"]),k5=({labels:e,labelledBy:t,rows:r,cols:i,canZoomIn:o,canZoomOut:s,zoom:a,onZoom:n,onResetZoom:l,highlighted:c,onToggleHighlight:h,onCopy:d,onSave:u,fullscreen:f,onToggleFullscreen:p,gridReady:m,activeCell:y,onTrackSize:x})=>{const{onKeyDown:C,onFocus:k,tabIndexOf:S}=Rh(b5,is),[v,_]=L.useState(!1),E=L.useId(),B=L.useRef(null),I=v&&m,M=(q,N,A,F,P,O,$=jr)=>w.jsx("button",{type:"button",[is]:q,tabIndex:S(q),onClick:P?A:void 0,"aria-disabled":P?void 0:"true","aria-pressed":O,className:$,"aria-label":N.text,lang:N.lang,children:F}),D=Cl(a),U={text:It.fillLabel(e.resetZoom.text,{percent:D}),lang:e.resetZoom.lang};return w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-aqmd-spreadsheet-toolbar":"",role:"toolbar","aria-labelledby":t,onKeyDown:C,onFocus:k,className:"mb-1 flex flex-wrap items-center gap-1",children:[M("zoom-in",e.zoomIn,()=>n(1),w.jsx(au,{size:20}),m&&o),M("zoom-out",e.zoomOut,()=>n(-1),w.jsx(nu,{size:20}),m&&s),M("reset-zoom",U,l,w.jsxs("span",{"data-aqmd-spreadsheet-zoom":"",children:[w.jsxs("span",{"data-aqmd-spreadsheet-zoom-widest":"","aria-hidden":"true",children:[Cl(oe.SPREADSHEET_ZOOM_MAX)," %"]}),w.jsxs("span",{children:[D," %"]})]}),m&&a!==1,void 0,GA),M("highlight",e.highlight,h,w.jsx(WM,{size:18}),m,c),w.jsx("button",{type:"button",ref:B,[is]:"track-size",tabIndex:S("track-size"),onClick:m?()=>_(q=>!q):void 0,"aria-disabled":m?void 0:"true","aria-expanded":I,"aria-controls":I?E:void 0,className:jr,"aria-label":e.trackSize.text,lang:e.trackSize.lang,children:w.jsx(VM,{size:18})}),M("copy",e.copyAll,d,w.jsx(wx,{size:18}),m),M("save",e.saveTsv,()=>u(!1),w.jsx(PM,{size:18}),!0),w.jsx(xx,{buttonHook:{[is]:"save-menu"},menuHook:{"data-aqmd-spreadsheet-menu":""},label:e.saveMenu,icon:w.jsx(OM,{size:18}),tabIndex:S("save-menu"),items:[{key:"save-with-bom",label:e.saveTsvWithBom,onSelect:()=>u(!0),hook:{"data-aqmd-spreadsheet-menu-item":"save-with-bom"}}]}),M("fullscreen",f?e.exitFullscreen:e.fullscreen,p,f?w.jsx(XM,{size:18}):w.jsx(YM,{size:18}),!0),w.jsx("span",{"data-aqmd-spreadsheet-size":"",lang:e.size.lang,className:"ms-1 text-sm",children:It.fillLabel(e.size.text,{rows:r,cols:i})})]}),I&&w.jsx(S5,{id:E,labels:e,activeCell:y,onTrackSize:x,onClose:()=>{_(!1),B.current?.focus()}})]})},w5=Object.freeze({decreaseColumnWidth:w.jsx(NM,{size:18}),increaseColumnWidth:w.jsx(ZM,{size:18}),autoFitColumnWidth:w.jsx(MM,{size:18}),decreaseRowHeight:w.jsx(zM,{size:18}),increaseRowHeight:w.jsx(JM,{size:18})}),S5=({id:e,labels:t,activeCell:r,onTrackSize:i,onClose:o})=>{const s=L.useSyncExternalStore(r.subscribe,r.get,r.get),a={column:oe.columnIndexToName(s.col),row:s.row+1},n=l=>{l.key!=="Escape"||l.defaultPrevented||(l.preventDefault(),l.stopPropagation(),o())};return w.jsx("div",{id:e,"data-aqmd-spreadsheet-track-size":"",role:"group","aria-label":t.trackSize.text,lang:t.trackSize.lang,onKeyDown:n,className:"mb-1 flex flex-wrap items-center gap-1",children:x5.map(l=>w.jsx("button",{type:"button","data-aqmd-spreadsheet-track-size-control":l,onClick:()=>i(l),className:jr,"aria-label":It.fillLabel(t[l].text,a),lang:t[l].lang,children:w5[l]},l))})},v5=(e,t,r)=>{const i={v:1,rows:e.length,cols:e[0]?.length??0,clipId:r,formats:[],validations:[],cells:e.map(s=>s.map(a=>({t:a}))),wholeRows:!1,wholeCols:!1,conditionalFormats:[]},o=t.serializeClipPayload(i);return{plain:t.serializeClipboardTsv(e),html:t.serializeHtmlTable(i,o)}},T5=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"})})])},_5="\uFEFF",B5="text/tab-separated-values;charset=utf-8",L5=(e,t)=>`${t?_5:""}${Zs.serializeTsv(e)}`,E5=(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 o=i.URL.createObjectURL(new Blob([e],{type:B5})),s=r.createElement("a");s.href=o,s.download=t,s.hidden=!0,r.body.append(s);try{s.click()}finally{s.remove(),i.setTimeout(()=>i.URL.revokeObjectURL(o),0)}},vx=e=>{const t=L.useRef(e);L.useLayoutEffect(()=>{t.current=e});const r=e!==void 0,[i]=L.useState(()=>new Set);return L.useEffect(()=>e?.subscribe(()=>{for(const o of[...i])o()}),[e,i]),L.useMemo(()=>{if(!r)return;const o=()=>{const s=t.current;if(s===void 0)throw new Error("[@aiquants/markdown] the spreadsheet editor stand-in was called after its editor was removed");return s};return{write:s=>o().write(s),read:s=>o().read(s),undo:()=>o().undo(),redo:()=>o().redo(),subscribe:s=>(i.add(s),()=>{i.delete(s)})}},[r,i])};let xs=null,ln=null;const bl=new Set,F5=e=>(bl.add(e),()=>{bl.delete(e)}),Rd=()=>xs!==null?Promise.resolve(xs):(ln??=import("@aiquants/spreadsheet").then(e=>{xs=e;for(const t of bl)t();return e},e=>{throw ln=null,e}),ln);class Qr extends Error{reason;constructor(t){super(`[@aiquants/markdown] spreadsheet edit refused: ${t}`),this.name="SpreadsheetEditRefusal",this.reason=t}}const Id=e=>{console.error("[@aiquants/markdown] could not load @aiquants/spreadsheet",e)},Pd=Object.freeze({row:!0,column:!0,intersection:!1}),A5=Object.freeze({row:!1,column:!1,intersection:!1}),Dd=Object.freeze([Object.freeze([""])]),M5=Object.freeze({link:!1}),$5=229,O5=({matrix:e,headerRows:t,footerRows:r,visibleRows:i})=>{const o=Math.min(e[0].length,i5),s=o5(e,i,r),a=Array.from({length:o},(l,c)=>oe.columnIndexToName(c)),n=l=>w.jsx("td",{"aria-hidden":"true","data-aqmd-spreadsheet-static-number":"",children:l+1});return w.jsxs("table",{"data-aqmd-spreadsheet-static":"",children:[w.jsxs("thead",{children:[w.jsxs("tr",{"aria-hidden":"true","data-aqmd-spreadsheet-static-letters":"",children:[w.jsx("td",{}),a.map(l=>w.jsx("td",{children:l},l))]}),s.filter(({index:l})=>l<t).map(({index:l,cells:c})=>w.jsxs("tr",{children:[n(l),c.slice(0,o).map((h,d)=>w.jsx("th",{scope:"col",children:h},d))]},l))]}),w.jsx("tbody",{children:s.filter(({index:l})=>l>=t).map(({index:l,cells:c})=>w.jsxs("tr",{children:[n(l),c.slice(0,o).map((h,d)=>w.jsx("td",{children:h},d))]},l))})]})},R5=e=>{try{return{options:It.parseSpreadsheetOptions(e),unreadWord:null}}catch(t){if(t instanceof It.SpreadsheetOptionsError)return{options:null,unreadWord:t.word};throw t}},Tx=({tsv:e,meta:t,sourceLines:r,editor:i,locale:o="en",labels:s,layout:a="inline"})=>{if(!Object.hasOwn(It.SPREADSHEET_BLOCK_LABEL_CATALOGS,o))throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet locale "${String(o)}" (en and ja are supported)`);if(a!=="inline"&&a!=="fill")throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet layout "${String(a)}" (inline and fill are supported)`);const n=L.useMemo(()=>_i(It.SPREADSHEET_BLOCK_LABEL_CATALOGS[o],s),[o,s]),{options:l,unreadWord:c}=L.useMemo(()=>R5(t),[t]),h=L.useMemo(()=>nn(e),[e]),d=h>oe.SPREADSHEET_MAX_OPERATION_CELLS,u=L.useMemo(()=>vi.parseSourceLines(r)?.first??null,[r]),[f,p]=L.useState(null),m=`${r??""}
|
|
315
|
+
${e}`,y=f===m,x=i!==void 0&&u!==null&&!y?i:void 0,C=x!==void 0,k=C&&l!==null&&l.footerRows===0?t5:0,S=C?e5:0,[v,_]=L.useState(()=>d?Dd:rs(e)),[E,B]=L.useState(0),I=L.useRef(e),M=L.useRef([]),D=L.useMemo(()=>h5(v,k,S),[v,k,S]),U=L.useRef(D);U.current=D;const q=L.useSyncExternalStore(F5,()=>xs,()=>null),[N,A]=L.useState(!1),F=N&&q===null,[P,O]=L.useState(1),[$,j]=L.useState(Pd),[T,W]=L.useState(!1),[z,G]=L.useState(null),X=L.useRef(null),K=L.useId(),Q=L.useCallback((Z,it={})=>{G(St=>({text:It.fillLabel(n[Z].text,it),lang:n[Z].lang,serial:(St?.serial??0)+1}))},[n]);L.useEffect(()=>{if(q!==null||l===null||d)return;let Z=!0;return Rd().catch(it=>{Z&&(Id(it),A(!0))}),()=>{Z=!1}},[q,l,d]),L.useEffect(()=>{const Z=f5(M.current,e);if(Z.echo){M.current=Z.pending;return}const it=x===void 0||u===null?null:x.read(u),St=it!==null&&nn(it)<=oe.SPREADSHEET_MAX_OPERATION_CELLS?it:null;if(St!==null&&St===M.current.at(-1))return;M.current=[];const Et=St===null?e:St;Et!==I.current&&(I.current=Et,_(St===null&&d?Dd:rs(Et)),B(ie=>ie+1))},[e,d,x,u]);const nt=L.useCallback(()=>{if(x===void 0||u===null)return;const Z=x.read(u);Z===null||Z===I.current||nn(Z)>oe.SPREADSHEET_MAX_OPERATION_CELLS||(M.current=[],I.current=Z,_(rs(Z)),B(it=>it+1))},[x,u]);L.useEffect(()=>x?.subscribe(()=>{M.current.length>0&&nt()}),[x,nt]);const gt=L.useCallback(Z=>{Z(),nt()},[nt]),ut=L.useMemo(()=>x===void 0?void 0:()=>gt(()=>x.undo()),[x,gt]),mt=L.useMemo(()=>x===void 0?void 0:()=>gt(()=>x.redo()),[x,gt]),Lt=L.useRef(()=>{});Lt.current=Z=>{if(x===void 0||u===null)throw new Qr("readOnly");const it=d5(U.current,Z);if(it.kind==="format-only")throw new Qr("formatRefused");if(it.kind==="unchanged")return;const St=Ph(it.matrix),Et=u5(St),ie=x.write({fenceLine:u,expected:I.current,text:Et});switch(ie){case"written":{const le=x.read(u);if(le===null)throw new TypeError("[@aiquants/markdown] SpreadsheetEditor.write answered written, but read finds no block on its fence line");I.current=le,M.current=[...M.current,le],_(le===Et?St:rs(le)),B(Vr=>Vr+1),G(null);return}case"changed":throw nt(),new Qr("editConflict");case"closesFence":throw new Qr("fenceRefused");case"unwritable":throw p(m),new Qr("unwritable");default:throw new TypeError(`[@aiquants/markdown] SpreadsheetEditor.write answered ${JSON.stringify(ie)} (written, changed, closesFence or unwritable)`)}};const[Ft]=L.useState(()=>({get rowCount(){return U.current.length},get colCount(){return U.current[0].length},getCellText:(Z,it)=>U.current[Z][it],applyEdits:(Z,it)=>Lt.current(Z),getCellFormat:()=>r5,getCellHyperlink:(Z,it)=>m5(U.current[Z][it]),findDataEdge:(Z,it)=>p5((St,Et)=>U.current[St][Et],U.current.length,U.current[0].length,Z,it)})),Mt=L.useCallback(Z=>{if(!(Z instanceof Qr))throw Z;Q(Z.reason)},[Q]),Ht=L.useCallback(Z=>Q(y?"unwritable":"readOnly"),[Q,y]),Yt=L.useCallback(Z=>{X.current?.ownerDocument.defaultView?.open(Z,"_blank","noopener,noreferrer")},[]),Qt=L.useCallback(({row:Z,displayText:it,columnName:St,readOnly:Et})=>It.fillLabel((Et===!0?n.readOnlyCellAnnouncement:n.cellAnnouncement).text,{cell:`${St}${Z+1}`,value:it===""?n.emptyCell.text:it}),[n]),we=L.useCallback(({range:Z})=>It.fillLabel(n.selectionAnnouncement.text,{range:y5(Z,oe.columnIndexToName)}),[n]),Se=L.useCallback(({axis:Z,index:it,size:St})=>Z==="column"?It.fillLabel(n.columnResized.text,{column:oe.columnIndexToName(it),size:St}):It.fillLabel(n.rowResized.text,{row:it+1,size:St}),[n]),_t=L.useRef(null),[Ct]=L.useState(C5),ve=L.useCallback(Z=>Ct.set(Z.active),[Ct]),Yr=L.useCallback(Z=>{_t.current?.executeCommand(Z)},[]),ge=Cl(P),sr=L.useRef(ge);L.useEffect(()=>{sr.current!==ge&&(sr.current=ge,Q("zoomed",{percent:ge}))},[Q,ge]);const xr=L.useCallback(Z=>O(it=>oe.clampSpreadsheetZoom(oe.stepSpreadsheetZoom(it,Z))),[]),Xe=L.useCallback(()=>O(1),[]),Cr=$.row||$.column,Ur=L.useCallback(()=>j(Z=>Z.row||Z.column?A5:Pd),[]),ar=L.useCallback(()=>{if(q===null)return;const Z=X.current?.ownerDocument.defaultView;(async()=>{if(Z==null)throw new Error("no window");const St=v5(v,q,Z.crypto.randomUUID());await T5(St,Z.navigator.clipboard,Et=>new Z.ClipboardItem(Et))})().then(()=>Q("copied"),St=>{console.error("[@aiquants/markdown] could not copy the spreadsheet",St),Q("copyFailed")})},[Q,v,q]),br=L.useCallback(Z=>{const it=X.current?.ownerDocument;it!==void 0&&E5(L5(v,Z),n.fileName.text,it)},[v,n]),Re=L.useRef(!1);L.useEffect(()=>{Re.current&&(Re.current=!1,X.current?.querySelector('[data-aqmd-spreadsheet-control="fullscreen"]')?.focus())},[T]);const Te=L.useCallback(Z=>{const it=X.current;it!==null&&(it.close(),Z?it.showModal():it.show(),Re.current=!0,W(Z))},[]),kr=L.useCallback(()=>Te(!T),[T,Te]),J=L.useCallback(Z=>{!T||Z.key!=="Escape"||Z.defaultPrevented||Z.nativeEvent.isComposing||Z.keyCode===$5||(Z.preventDefault(),Z.stopPropagation(),Te(!1))},[T,Te]),ft=L.useCallback(Z=>{Z.preventDefault(),Te(!1)},[Te]),xt=v.length,Dt=v[0].length,At=l===null?0:s5(l,D.length),Xr=D.length,Gr=L.useMemo(()=>{const[Z,it]=a==="inline"?["--aqmd-spreadsheet-box-height",At]:["--aqmd-spreadsheet-box-min-height",n5(Xr)];return{[Z]:`${l5(it,P)}px`}},[a,At,Xr,P]),No=T?n.fullscreenDialog:n.table,Wi=q?.Spreadsheet;return w.jsxs("div",{"data-aqmd-spreadsheet":"","data-aqmd-spreadsheet-layout":a,"data-source-lines":r,"data-aqmd-spreadsheet-editable":C?"":void 0,"data-aqmd-spreadsheet-fullscreen":T?"":void 0,children:[w.jsx("span",{id:K,hidden:!0,lang:No.lang,children:No.text}),w.jsxs("dialog",{ref:X,open:!0,"data-aqmd-spreadsheet-dialog":"",role:T?void 0:"group","aria-labelledby":K,onKeyDown:J,onCancel:ft,children:[l===null?w.jsx("div",{"data-aqmd-spreadsheet-error":"options",role:"alert",lang:n.optionsError.lang,children:It.fillLabel(n.optionsError.text,{word:c,frozenMax:It.SPREADSHEET_OPTION_RULES.header.max,heightMax:It.SPREADSHEET_OPTION_RULES.height.max})}):d?w.jsx("div",{"data-aqmd-spreadsheet-error":"size",role:"alert",lang:n.tooLarge.lang,children:It.fillLabel(n.tooLarge.text,{cells:new Intl.NumberFormat(o).format(h),max:new Intl.NumberFormat(o).format(oe.SPREADSHEET_MAX_OPERATION_CELLS)})}):w.jsxs(w.Fragment,{children:[w.jsx(k5,{labels:n,labelledBy:K,rows:xt,cols:Dt,canZoomIn:P<oe.SPREADSHEET_ZOOM_MAX,canZoomOut:P>oe.SPREADSHEET_ZOOM_MIN,zoom:P,onZoom:xr,onResetZoom:Xe,highlighted:Cr,onToggleHighlight:Ur,onCopy:ar,onSave:br,fullscreen:T,onToggleFullscreen:kr,gridReady:Wi!==void 0,activeCell:Ct,onTrackSize:Yr}),w.jsx("div",{"data-aqmd-spreadsheet-box":"",style:Gr,children:Wi===void 0?w.jsx(O5,{matrix:v,headerRows:l.headerRows,footerRows:l.footerRows,visibleRows:At}):w.jsx(Wi,{ref:_t,adapter:Ft,dataVersion:E,defaultRowHeight:Sx,frozenRows:l.headerRows,headerRows:l.headerRows,frozenTrailingRows:l.footerRows,frozenColumns:l.frozenColumns,enableFillHandle:C,readOnly:!C,labelledBy:K,enableResizeUI:!0,zoom:P,onZoomChange:O,highlight:$,onHighlightChange:j,popovers:M5,onHyperlinkOpen:Yt,onEditRejected:Mt,onReadOnlyRejected:Ht,onUndoRequest:ut,onRedoRequest:mt,formatCellAnnouncement:Qt,formatSelectionAnnouncement:we,formatResizeAnnouncement:Se,onSelectionChange:ve,locale:o})})]}),F&&w.jsxs("div",{"data-aqmd-spreadsheet-error":"load",role:"alert",children:[w.jsx("span",{lang:n.loadFailed.lang,children:n.loadFailed.text}),w.jsx("button",{type:"button","data-aqmd-spreadsheet-retry":"",lang:n.retry.lang,className:"ms-2 inline-flex min-h-11 min-w-11 items-center justify-center rounded border px-3 py-1 text-sm",onClick:()=>{A(!1),Rd().catch(Z=>{Id(Z),A(!0)})},children:n.retry.text})]}),w.jsx("p",{"data-aqmd-spreadsheet-notice":"",role:"status",children:z!==null&&w.jsx("span",{lang:z.lang,children:z.text},z.serial)})]})]})};Tx.displayName="SpreadsheetBlock";const Dh=L.memo(Tx),I5=Object.freeze({light:"solarized-light",dark:"github-dark-high-contrast"}),P5=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 D5(e){const t={};for(const r in e){const i=e[r];switch(r){case"class":t.className=i;break;case"style":{const o={};for(const s of i.split(";")){const a=s.indexOf(":");if(a<=0)continue;const n=s.slice(0,a).trim(),l=s.slice(a+1).trim();n===""||l===""||(o[n.startsWith("--")?n:n.replace(/-(\w)/g,(c,h)=>h.toUpperCase())]=l)}t.style=o;break}case"tabindex":t.tabIndex=Number(i);break;default:t[r]=i}}return t}const N5=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};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"})},q5=({htmlPromise:e,filename:t,code:r,sourceLines:i})=>{const o=L.use(e),s={replace:a=>{if(a instanceof wt.Element&&a.name==="pre"){const n=D5(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(N5,{code:r}),w.jsx("pre",{...n,children:wt.domToReact(a.children,s)})]})}},htmlparser2:{lowerCaseTags:!0}};return w.jsx(w.Fragment,{children:wt(o,s)})},z5=/^(diff)?:?(\w+):?([\w.-]*)?/,j5=new Map([["svg","xml"]]),W5="text",H5=e=>{const t=j5.get(e),r=t===void 0?e:t;return fn.isSpecialLang(r)||Object.hasOwn(fn.bundledLanguages,r)?r:W5},Y5=()=>({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 o=i.value;let s,a,n="";if(o.startsWith("+")?(s="+",a="add",n="bg-green-200 dark:bg-green-400/90 text-green-700"):o.startsWith("-")&&(s="-",a="remove",n="bg-red-200 dark:bg-red-400/90 text-red-700"),s&&a){t.properties.dataAqmdDiff=a,i.value=o.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:s==="+"?"➕":"➖"}]};t.children.unshift(l)}}}}),U5=e=>{const t=z5.exec(e??"");return{isDiff:t?.[1]==="diff",lang:t?.[2]||"text",filename:t?.[3]||void 0}},Nh=({lang:e,code:t,node:r,sourceLines:i})=>{const o=e??r?.lang??void 0,s=t??r?.value??"",{isDiff:a,lang:n,filename:l}=U5(o);return n===It.SPREADSHEETS_LANGUAGE?w.jsx(Dh,{tsv:s,meta:r?.meta??void 0,sourceLines:i}):n==="mermaid"?w.jsx(Ih,{chartContent:s,sourceLines:i}):w.jsx(X5,{code:s,lang:n,isDiff:a,filename:l,sourceLines:i})},X5=({code:e,lang:t,isDiff:r,filename:i,sourceLines:o})=>{const s=L.useMemo(async()=>{const a=[];return r&&a.push(Y5()),await fn.codeToHtml(e,{lang:H5(t),themes:I5,defaultColor:!1,colorReplacements:P5,transformers:a})},[e,t,r]);return w.jsx(L.Suspense,{fallback:w.jsx("div",{className:"dark:text-white","data-source-lines":o,children:"🌀 Loading code..."}),children:w.jsx(q5,{htmlPromise:s,filename:i,code:e,sourceLines:o})})},_x=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};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"})},Bx=(e,t)=>{const r=L.useMemo(()=>{try{return{kind:"rendered",html:kx(e,t).html}}catch(i){return{kind:"failed",error:i,message:`Math rendering error: ${i instanceof Error?i.message:String(i)}`}}},[e,t]);return L.useEffect(()=>{r.kind==="failed"&&console.error("An error occurred while rendering KaTeX:",r.error)},[r]),r},G5=({node:e})=>{const t=Bx(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(_x,{code:e.value}),t.kind==="rendered"?w.jsx("article",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):w.jsx("article",{className:r,children:t.message})]})},V5=/^[a-z][a-z0-9+.-]*:/i,K5=/^[/\\]{2}/,Z5=/[\t\n\r]/g,Nd=32,Q5=e=>{let t=0,r=e.length;for(;t<r&&e.charCodeAt(t)<=Nd;)t+=1;for(;r>t&&e.charCodeAt(r-1)<=Nd;)r-=1;return e.slice(t,r)},Lx=e=>{const t=Q5(e).replace(Z5,"");return V5.test(t)||K5.test(t)},J5="text-link underline visited:text-link-visited",t3="inline-block w-fit",qh=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"]);[...qh].join(",");const Ex=(e,t)=>[e,t?t3:void 0,J5].filter(r=>r!==void 0&&r.trim()!=="").join(" "),e3=new Set(["id","title","lang","dir","role"]),r3=["aria-","data-footnote-"],i3=e=>{const t={};for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();(e3.has(o)||r3.some(s=>o.startsWith(s)&&o.length>s.length))&&(t[o]=i)}return Object.freeze(t)},ye=new un.Logger(un.LogLevel.INFO,"[DifyIFramePlugin]"),o3="100%",s3="600px",a3="0",n3=e=>typeof e!="object"||e===null||!("type"in e)?null:typeof e.type=="string"?e.type:null,l3=({embed:e,iFrameAllowedDomains:t})=>{const[r,i]=L.useState(!0),[o,s]=L.useState(!1),a=L.useRef(null),n=L.useRef(null),l=L.useRef(null),{src:c}=e,h=L.useCallback(x=>{x.source===null||x.source!==a.current?.contentWindow||!pb(x.origin,t)||n3(x.data)==="dify-chatbot-iframe-ready"&&(ye.info("Dify chatbot iframe is ready"),i(C=>C&&(s(!1),n.current&&(clearTimeout(n.current),n.current=null),l.current&&(clearTimeout(l.current),l.current=null),!1)))},[t]),d=L.useCallback(()=>{const x=a.current;if(x)try{if(!x.contentDocument)throw new Error("Cannot access iframe content");i(k=>k&&(s(!1),!1))}catch{ye.info("Crossorigin error detected, showing auth prompt"),s(k=>k||(i(!1),!0))}},[]),u=L.useCallback(()=>{const x=window.open(c,"dify-oauth","width=500,height=600,scrollbars=yes,resizable=yes");if(!x){ye.error("ポップアップがブロックされました");return}const C=setInterval(()=>{if(x.closed){clearInterval(C),ye.info("ポップアップが閉じられました");try{ye.info("ポップアップURL:",x.location.href)}catch(S){ye.info("クロスオリジンのためURLにアクセスできません:",S)}const k=a.current;if(k?.src){const S=k.src;i(v=>v||!0),s(v=>v&&!1),k.src="",setTimeout(()=>{k.src=S,n.current=setTimeout(()=>{ye.warn("認証後タイムアウト: dify-chatbot-iframe-ready not received after auth"),d()},5e3)},100)}}},1e3);ye.info("ポップアップを開きました:"),ye.info("- 初期URL:",c),ye.info("- ウィンドウ名:","dify-oauth"),ye.info("- ウィンドウサイズ: 500x600")},[d,c]);L.useEffect(()=>(window.addEventListener("message",h),()=>{window.removeEventListener("message",h)}),[h]),L.useEffect(()=>{const x=setTimeout(()=>{ye.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]),L.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);const{width:f=o3,height:p=s3,frameborder:m=a3,...y}=e.attributes;return w.jsxs("div",{className:"dify-iframe-container",children:[r&&!o&&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 チャットボットを読み込み中..."})]}),o&&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:u,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||o?"hidden":"block"}`,children:w.jsx("iframe",{ref:a,...wt.attributesToProps({...y,width:f,height:p,frameborder:m},"iframe"),src:c,"data-plugin-type":"dify"})})]})},qd=Object.freeze({dify:l3}),h3=e=>Object.hasOwn(qd,e)?qd[e]:null,c3=w.jsx(L.Fragment,{}),d3=(e,t,r,i,o)=>{const s=t===null?null:h3(t),a=e.attributes.title===void 0?{title:`${i.text}: ${new URL(e.src).hostname}`,lang:i.lang}:{};return w.jsx(QC,{embed:e,label:i,insideAnchor:o,children:s!==null?w.jsx(s,{embed:e,iFrameAllowedDomains:r}):w.jsx("iframe",{...wt.attributesToProps(e.attributes,"iframe"),...a,src:e.src})})},Fx=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof wt.Element&&t.name.toLowerCase()==="a")return!0;return!1},Ax=e=>e.some(t=>t instanceof wt.Element&&(qh.has(t.name)||Ax(t.children))),u3=(e,t,r)=>{const{class:i,"data-link-kind":o,"data-doc-path":s,"data-doc-exists":a,...n}=e.attribs,l=Ex(i,Ax(e.children)),c=n.href??"",h=o,d=h==="external"||Lx(c),u=wt.domToReact(e.children,t);if(r&&c&&!d)return w.jsx(r,{href:c,kind:h,docPath:s,docExists:a===void 0?void 0:a==="true",className:l,attributes:i3(n),children:u});d&&(n.target="_blank",n.rel="noreferrer");const f={};return o!==void 0&&(f["data-link-kind"]=o),s!==void 0&&(f["data-doc-path"]=s),a!==void 0&&(f["data-doc-exists"]=a),w.jsx("a",{...wt.attributesToProps(n,"a"),className:l,...f,children:u})},Mx=({iFrameAllowedDomains:e,embedLabels:t,linkComponent:r,renderPlaceholder:i,renderKept:o})=>{const s={replace:a=>{if(!(a instanceof wt.Element))return;const n=a.parent instanceof wt.Element?a.parent.name:null,l=ta(a.name,a.attribs,{parentName:n,iFrameAllowedDomains:e});switch(l.action){case"remove":return c3;case"unwrap":return w.jsx(L.Fragment,{children:wt.domToReact(a.children,s)});case"embed":return d3(l.embed,l.pluginType,e,t.embeddedFrame,Fx(a))}if(a.attribs={...l.attributes},l.action==="placeholder"){const h=i?.(a,l.link,s);if(h!==void 0)return h}const c=o?.(a,s);if(c!==void 0)return c;if(a.name==="a")return u3(a,s,r)}};return s};const f3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],p3=Tt("code-xml",f3),g3=e=>/\.[Ss][Vv][Gg]$/u.test(e),$x=e=>{const t=L.useRef(e);L.useLayoutEffect(()=>{t.current=e});const r=e!==void 0;return L.useMemo(()=>{if(r)return{read:(i,o)=>{const s=t.current;return s===void 0?Promise.reject(new Error("[@aiquants/markdown] the image source stand-in was called after its reader was removed")):s.read(i,o)}}},[r])},hn="data-aqmd-svg-image-control",m3=Object.freeze(["copy","source"]),y3=Object.freeze(["source"]),x3=Object.freeze({kind:"failure",retryable:!0}),zd=(e,t,r)=>new Promise(i=>i(e.read(t,r))),C3=({paragraph:e,image:t,path:r,name:i,reader:o,labels:s})=>{const{[vi.SOURCE_LINES_ATTRIBUTE]:a,...n}=e,[l,c]=L.useState(!1),[h,d]=L.useState(0),[u,f]=L.useState(null),[p,m]=L.useState(null),y=L.useId(),x=L.useId(),C=L.useRef(null),k=L.useRef(null);L.useEffect(()=>()=>k.current?.abort(),[]),L.useEffect(()=>{if(!l)return;const F=new AbortController;return zd(o,r,F.signal).then(P=>{F.signal.aborted||f({read:h,answer:P})},P=>{F.signal.aborted||(console.error("[@aiquants/markdown] the image source reader failed without an abort",P),f({read:h,answer:x3}))}),()=>F.abort()},[l,h,r,o]);const S=l&&u!==null&&u.read===h?u.answer:null,v=S!==null&&S.kind==="text"&&!S.truncated?S.text:null,_=!l||v!==null,{onKeyDown:E,onFocus:B,tabIndexOf:I}=Rh(_?m3:y3,hn),M=F=>{m(P=>({text:s[F].text,lang:s[F].lang,serial:P===null?1:P.serial+1}))},D=()=>{if(m(null),l){c(!1);return}d(F=>F+1),c(!0)},U=()=>{C.current?.focus(),d(F=>F+1)},q=(F,P)=>{const O=F.currentTarget.ownerDocument.defaultView?.navigator.clipboard;if(O===void 0){M("copyFailed");return}O.writeText(P).then(()=>M("copied"),$=>{console.error("[@aiquants/markdown] could not copy the image source",$),M("copyFailed")})},N=F=>{const P=F.currentTarget.ownerDocument.defaultView,O=P?.navigator.clipboard;if(P===null||O===void 0||typeof P.ClipboardItem!="function"||typeof O.write!="function"){M("copyFailed");return}k.current?.abort();const $=new AbortController;k.current=$;let j=!1;const T=zd(o,r,$.signal).then(W=>{if(W.kind==="text"&&!W.truncated)return new Blob([W.text],{type:"text/plain"});throw j=!0,new Error("[@aiquants/markdown] the image source cannot be copied whole")},W=>{throw j=!0,$.signal.aborted||console.error("[@aiquants/markdown] the image source reader failed without an abort",W),W});T.catch(()=>{}),O.write([new P.ClipboardItem({"text/plain":T})]).then(()=>{$.signal.aborted||M("copied")},W=>{$.signal.aborted||(j||console.error("[@aiquants/markdown] could not copy the image source",W),M("copyFailed"))})};let A;return l?S===null?A=w.jsx("p",{"data-aqmd-svg-image-loading":"",lang:s.loading.lang,children:s.loading.text}):S.kind==="failure"?A=w.jsxs("div",{"data-aqmd-svg-image-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[w.jsx("p",{lang:s.failed.lang,children:s.failed.text}),S.retryable&&w.jsxs("button",{type:"button","data-aqmd-svg-image-retry":"",onClick:U,lang:s.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(gn,{className:"h-4 w-4"}),s.retry.text]})]}):A=w.jsxs(w.Fragment,{children:[w.jsx("span",{id:x,hidden:!0,lang:s.sourceRegion.lang,children:It.fillLabel(s.sourceRegion.text,{name:i})}),w.jsx("pre",{"data-aqmd-svg-image-source":"",tabIndex:0,role:"region","aria-labelledby":x,children:S.text}),S.truncated&&w.jsx("p",{"data-aqmd-svg-image-truncated":"",lang:s.truncated.lang,children:s.truncated.text})]}):A=w.jsx("p",{...wt.attributesToProps(n,"p"),children:t}),w.jsxs("div",{"data-aqmd-svg-image":"","data-aqmd-svg-image-view":l?"source":"image","data-source-lines":a,children:[w.jsx("span",{id:y,hidden:!0,lang:s.toolbar.lang,children:s.toolbar.text}),w.jsxs("div",{"data-aqmd-svg-image-toolbar":"",role:"toolbar","aria-labelledby":y,onKeyDown:E,onFocus:B,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:[_&&w.jsx("button",{type:"button",[hn]:"copy",tabIndex:I("copy"),onClick:F=>v===null?N(F):q(F,v),className:jr,"aria-label":s.copy.text,lang:s.copy.lang,children:w.jsx(wx,{size:18})}),w.jsx("button",{ref:C,type:"button",[hn]:"source",tabIndex:I("source"),"aria-pressed":l,onClick:D,className:jr,"aria-label":s.source.text,lang:s.source.lang,children:w.jsx(p3,{size:20})})]}),A,w.jsx("p",{"data-aqmd-svg-image-notice":"",role:"status",children:p!==null&&w.jsx("span",{lang:p.lang,children:p.text},p.serial)})]})},La=Object.freeze({toolbar:{text:"SVG image",lang:"en"},source:{text:"Source",lang:"en"},sourceRegion:{text:"Source of {name}",lang:"en"},loading:{text:"Loading the source…",lang:"en"},failed:{text:"The source could not be read.",lang:"en"},retry:{text:"Try again",lang:"en"},truncated:{text:"Only the beginning of this file is shown.",lang:"en"},copy:{text:"Copy the source",lang:"en"},copied:{text:"Copied the source.",lang:"en"},copyFailed:{text:"Could not copy the source.",lang:"en"}}),b3=Qs(La),k3=({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})]})]}),w3=(e,t,r)=>{const{src:i,alt:o,"data-asset-exists":s,"data-asset-src":a}=e.attribs;if(!i||i.trim()===""||s==="false")return w.jsx(k3,{alt:o,target:a,label:t});const n=r.rendered===0;return r.rendered+=1,w.jsx("img",{alt:"",...wt.attributesToProps({loading:n?"eager":"lazy",decoding:"async",...e.attribs})})},Ao=e=>e.map(t=>t instanceof wt.Text?t.data:t instanceof wt.Element?Ao(t.children):"").join(""),S3=(e,t)=>e.map(r=>{if(r instanceof wt.Text)return{kind:"text",text:r.data};if(!(r instanceof wt.Element))return{kind:"ignored"};if(r.name.toLowerCase()!=="a")return{kind:"element"};const i=ta(r.name,r.attribs,{parentName:"p",iFrameAllowedDomains:t});return{kind:"link",href:i.action==="keep"?i.attributes.href??null:null}}),v3=(e,t,r,i)=>{const o=e.children,s=cr.placeholderLinkOf(t,S3(o,i.iFrameAllowedDomains));if(s===null)return;const a=wt.domToReact(o,r),n=w.jsx("p",{...wt.attributesToProps(e.attribs,"p"),children:a}),l=o.find(u=>u instanceof wt.Element),c=i.embeds.linkCardEndpoint,h=c!==null&&l!==void 0&&cr.isBareLink(Ao(l.children),s)?w.jsx(ib,{href:t,endpoint:c,size:Ne.linkCardSizeOf(i.embeds),fallback:n}):n,d=Rr.resolveEmbed(s,i.embeds.providers);return d===null?h:w.jsx(ub,{resolution:d,caption:a,fallback:h,theme:i.theme,labels:i.embedLabels})},T3=(e,t)=>{if(Fx(e))return null;const r=e.children.filter(c=>!(c instanceof wt.Text&&kl.test(c.data))),[i]=r;if(r.length!==1||!(i instanceof wt.Element)||i.name.toLowerCase()!=="img")return null;const o=ta(i.name,i.attribs,{parentName:"p",iFrameAllowedDomains:t});if(o.action!=="keep")return null;const{src:s,alt:a,"data-asset-src":n,"data-asset-exists":l}=o.attributes;return n===void 0||!g3(n)||s===void 0||s.trim()===""||l==="false"?null:{node:i,path:n,name:a!==void 0&&a.trim()!==""?a:n.slice(n.lastIndexOf("/")+1)}},_3={lowerCaseAttributeNames:!1},jd=2166136261,Wd=16777619,kl=/^[\t\n\f\r ]*$/u,B3=`language-${It.SPREADSHEETS_LANGUAGE}`,Ox=e=>e.name==="code"&&(e.attribs.class??"").split(/[\t\n\f\r ]+/u).includes(B3),L3=e=>{let t=jd,r=jd;const i=(s,a)=>{for(let n=0;n<s.length;n+=1){const l=s.charCodeAt(n);r=Math.imul(r^l,Wd),a&&(t=Math.imul(t^l,Wd))}},o=(s,a)=>{if(s instanceof wt.Text)i("",a),i(s.data,a);else if(s instanceof wt.Element){i("",a),i(s.name,a);for(const[l,c]of Object.entries(s.attribs))l!==vi.SOURCE_LINES_ATTRIBUTE&&(i("",a),i(l,a),i("",a),i(c,a));i("",a);const n=a&&!Ox(s);for(const l of s.children)o(l,n);i("",a)}else i("\x07",a),i(s.data,a)};return o(e,!0),{fingerprint:(t>>>0).toString(36),content:(r>>>0).toString(36)}},E3=(e,t,r,i)=>{if(e==="")return{nodes:[],keys:[]};const o=wt.htmlToDOM(e,_3),s=o.filter(l=>!(l instanceof wt.Text&&kl.test(l.data))),a=jC(s.map(L3),r);let n=0;return{nodes:o.map(l=>{if(l instanceof wt.Text&&kl.test(l.data))return l.data;const{key:c,content:h}=a[n];return n+=1,w.jsx(DC,{content:h,label:i,text:()=>Ao([l]),children:wt.domToReact([l],t)},c)}),keys:a}},Rx=({htmlContent:e,theme:t="light",iFrameAllowedDomains:r=[],embeds:i=Ne.NO_EMBEDS,embedLabels:o,mermaidInteraction:s,mermaidLabels:a,spreadsheetEditor:n,spreadsheetLocale:l,spreadsheetLabels:c,linkComponent:h,missingImageLabel:d="Image not found",blockFailedLabel:u,imageSource:f,svgImageLabels:p,onMathDiagnostics:m})=>{ru(i);const y=Kd(o),x=vx(n),C=$x(f),k=L.useMemo(()=>_i(La,p),[p]),{blockFailed:S}=_i(tu,{blockFailed:u}),v={rendered:0},_=[],E=L.useRef(null),B=L.useEffectEvent(q=>{m?.(q)}),I=Mx({iFrameAllowedDomains:r,embedLabels:y,linkComponent:h,renderPlaceholder:(q,N,A)=>v3(q,N,A,{embeds:i,theme:t,embedLabels:y,iFrameAllowedDomains:r}),renderKept:(q,N)=>{if(q.name==="p"&&C!==void 0){const A=T3(q,r);if(A!==null)return w.jsx(C3,{paragraph:q.attribs,image:wt.domToReact([A.node],N),path:A.path,name:A.name,reader:C,labels:k})}if(q.name==="pre"&&q.children.length===1){const A=q.children[0];if(A instanceof wt.Element&&A.name==="code"){const F=A.attribs.class??"",P=Ao(A.children),O=q.attribs[vi.SOURCE_LINES_ATTRIBUTE];return Ox(A)?w.jsx(Dh,{tsv:P,meta:A.attribs[It.CODE_META_ATTRIBUTE],sourceLines:O,editor:x,locale:l,labels:c}):F.includes("language-mermaid")?w.jsx(Ih,{chartContent:P,interaction:s,labels:a,sourceLines:O}):w.jsx(Nh,{lang:F.replace("language-",""),code:P,theme:t,sourceLines:O})}}if(q.name==="img")return w3(q,d,v);if(q.name==="span"&&q.attribs.class?.includes("math")){const A=q.attribs.class.includes("display");let F=Ao(q.children).trim();A?F=F.replace(/^\\\[/,"").replace(/\\\]$/,""):F=F.replace(/^\\\(/,"").replace(/\\\)$/,"");try{const{html:P,diagnostics:O}=kx(F,A);return _.push(...O),A?w.jsxs("span",{className:"group relative block",children:[w.jsx(_x,{code:F}),w.jsx("span",{dangerouslySetInnerHTML:{__html:P}})]}):w.jsx("span",{dangerouslySetInnerHTML:{__html:P}})}catch(P){console.error("Failed to render math:",P);return}}}}),M=L.useRef([]),{nodes:D,keys:U}=E3(e,I,M.current,S);return L.useEffect(()=>{M.current=U},[U]),L.useEffect(()=>{E.current!==e&&(E.current=e,_.length>0&&B(_))},[e,_]),w.jsx("div",{className:"markdown-body","data-theme":t,children:D})};const F3=[["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"}]],A3=Tt("triangle-alert",F3);const M3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],$3=Tt("text-align-center",M3);const O3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],R3=Tt("text-align-start",O3);const I3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],P3=Tt("text-align-end",I3);const D3=[["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"}]],N3=Tt("list",D3);const q3=[["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"}]],z3=Tt("palette",q3);const j3=[["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"}]],W3=Tt("pin",j3);const H3=[["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"}]],Y3=Tt("pin-off",H3),U3=e=>`#${e.id}`,X3=e=>{let t=Number.POSITIVE_INFINITY;for(const r of e)r.depth<t&&(t=r.depth);return t},Hd="block truncate py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Ix=({headings:e,className:t="",onHeadingSelect:r,headingHref:i=U3,label:o,labelledBy:s})=>{if(e.length===0)return null;const a=X3(e);return w.jsx("nav",{className:`toc ${t}`,"aria-label":o,"aria-labelledby":s,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:`${Hd} text-gray-600 dark:text-gray-300`,title:n.text,children:n.text}):w.jsx("a",{href:Mo(c)?c:void 0,className:`${Hd} 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)})})})},cn="--aqmd-toolbar-block-overlap",G3=({toolbar:e,content:t,scrollportTop:r,scrollportBottom:i})=>{if(e.width<=0||e.height<=0)return 0;const o=e.left<t.right&&e.right>t.left,s=e.top<r+e.height&&e.top<i,a=e.bottom-r;return o&&s&&a>0?Math.ceil(a):0},Px=e=>`mermaid${e.charAt(0).toUpperCase()}${e.slice(1)}`,Dx=Object.keys(Ba),V3=e=>`spreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`,K3=Object.keys(It.SPREADSHEET_BLOCK_LABEL_CATALOGS.en),Nx=e=>`svgImage${e.charAt(0).toUpperCase()}${e.slice(1)}`,qx=Object.keys(La),zx=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"},...tu,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(Dx.map(e=>[Px(e),Ba[e]])),...Object.fromEntries(qx.map(e=>[Nx(e),La[e]])),...Js}),Z3=Qs(zx),Q3=e=>_i(zx,e),J3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of Dx){const i=e[Px(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},t$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of K3){const i=e[V3(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},e$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of qx){const i=e[Nx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},r$=Object.keys(Js),i$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of r$){const i=e[r];i!==void 0&&(t[r]=i)}return Object.freeze(t)},Yd=Object.freeze({left:{labelKey:"alignLeft",Icon:R3},center:{labelKey:"alignCenter",Icon:$3},right:{labelKey:"alignRight",Icon:P3}}),o$=Object.freeze({text:"ファイルを選択してください。",lang:"ja"}),s$="100%",a$=e=>e==="center"?"auto":e==="right"?"auto 0":"0 auto",wl="24px",jx=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"}),n$=jx(wl),l$=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"}),h$=e=>`calc(100cqi - var(--aqmd-toolbar-inset-inline-end, 0px) - ${e})`,c$=8,Ud=800,d$=16,u$=(e,t)=>{const r=e.defaultView;let i;const o=()=>{e.removeEventListener("click",s,!0),e.removeEventListener("pointercancel",a,!0),i!==void 0&&r?.clearTimeout(i)};function s(n){o(),!(n.timeStamp-t.timeStamp>Ud||Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY)>d$)&&(n.preventDefault(),n.stopPropagation())}function a(n){n.pointerId===t.pointerId&&o()}e.addEventListener("click",s,!0),e.addEventListener("pointercancel",a,!0),i=r?.setTimeout(o,Ud)},f$=(e,t,r)=>{const[i,o]=L.useState(null);return L.useLayoutEffect(()=>{const s=t.current;if(!e||s===null||r===null){o(null);return}const a=s.ownerDocument.defaultView;let n=0;const l=()=>{n=0;const d=s.getBoundingClientRect(),u=s.offsetHeight>0?d.height/s.offsetHeight:1,f=a?.visualViewport??null,p=f===null?Number.POSITIVE_INFINITY:f.offsetTop+f.height,m=Math.min(r.getBoundingClientRect().bottom,p);o(Math.max(0,Math.floor((m-d.top)/u-c$)))},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),s.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),s.ownerDocument.removeEventListener("scroll",c,!0)}},[e,t,r]),i};function dn({menu:e,Icon:t,buttonLabel:r,titleLabel:i,titleId:o,pinLabel:s,unpinLabel:a,isOpen:n,isPinned:l,isFront:c,onActivate:h,onToggle:d,onClose:u,onPinToggle:f,popoverClassName:p,scrollBarClearance:m,boundary:y,renderBody:x}){const C=L.useRef(null),k=L.useRef(null),S=L.useRef(null),v=f$(n,S,y),_=L.useCallback(()=>{d(),h()},[h,d]),E=L.useCallback(()=>{if(l)return;const I=C.current?.contains(document.activeElement)===!0;u(),I&&k.current?.focus()},[l,u]);L.useEffect(()=>{if(!n||l)return;const I=C.current;if(I===null)return;const M=U=>{I.contains(U.target)||(u(),U.pointerType==="touch"&&!(U.target instanceof Element&&U.target.closest("[data-aqmd-toolbar]")!==null)&&u$(I.ownerDocument,U))},D=U=>{U.key!=="Escape"||U.defaultPrevented||U.isComposing||(U.preventDefault(),u(),k.current?.focus())};return document.addEventListener("pointerdown",M),I.addEventListener("keydown",D),()=>{document.removeEventListener("pointerdown",M),I.removeEventListener("keydown",D)}},[n,l,u]);const B=l?a:s;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:S,"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:h$(m),maxBlockSize:v??void 0},children:[w.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[w.jsx("h3",{id:o,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:f,"aria-label":B.text,lang:B.lang,children:l?w.jsx(W3,{className:"h-4 w-4"}):w.jsx(Y3,{className:"h-4 w-4"})})]}),x(E)]})]})}const p$=(e,t,r,i)=>{const[o,s]=L.useState(0),a=L.useRef(null);return L.useLayoutEffect(()=>{const n=e.current,l=t.current;if(r===null||n===null||l===null){a.current=null,s(0);return}const c=()=>{const p=n.getBoundingClientRect();s(G3({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 u=new ResizeObserver(c);u.observe(n),u.observe(l),u.observe(r);const f=r.querySelector("[data-aqmd-toolbar-inset-probe]");return f!==null&&u.observe(f),window.addEventListener("resize",c),window.addEventListener("scroll",d,{capture:!0,passive:!0}),()=>{a.current=null,u.disconnect(),window.removeEventListener("resize",c),window.removeEventListener("scroll",d,{capture:!0}),h!==null&&cancelAnimationFrame(h)}},[e,t,r]),L.useLayoutEffect(()=>{a.current?.()},[i]),o},g$=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,m$=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},y$=L.memo(function({parseResult:t,theme:r,styleClassName:i,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:u,spreadsheetLabels:f,imageSource:p,svgImageLabels:m,onMathDiagnostics:y}){return w.jsx("div",{className:"w-full min-w-0",children:w.jsx("div",{className:i,"data-theme":r,children:w.jsx(Rx,{htmlContent:t.htmlContent,theme:r,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:u,spreadsheetLabels:f,imageSource:p,svgImageLabels:m,onMathDiagnostics:y})})})});function Wx(){const[e,t]=L.useState("toc"),[r,i]=L.useState(!1),[o,s]=L.useState(!1),[a,n]=L.useState(!1),[l,c]=L.useState(!1),[h,d]=L.useState(!1),[u,f]=L.useState(!1),p=L.useCallback(()=>t("toc"),[]),m=L.useCallback(()=>i(M=>!M),[]),y=L.useCallback(()=>i(!1),[]),x=L.useCallback(()=>c(M=>!M),[]),C=L.useCallback(()=>t("style"),[]),k=L.useCallback(()=>s(M=>!M),[]),S=L.useCallback(()=>s(!1),[]),v=L.useCallback(()=>d(M=>!M),[]),_=L.useCallback(()=>t("align"),[]),E=L.useCallback(()=>n(M=>!M),[]),B=L.useCallback(()=>n(!1),[]),I=L.useCallback(()=>f(M=>!M),[]);return{lastActiveMenu:e,isTocOpen:r,isStyleOpen:o,isAlignOpen:a,isTocPinned:l,isStylePinned:h,isAlignPinned:u,activateToc:p,toggleToc:m,closeToc:y,togglePinToc:x,activateStyle:C,toggleStyle:k,closeStyle:S,togglePinStyle:v,activateAlign:_,toggleAlign:E,closeAlign:B,togglePinAlign:I}}const x$=({error:e,labels:t})=>{if(L.isValidElement(e))return w.jsx("div",{className:"p-4",children:e});if(typeof e=="object"&&e!==null&&"message"in e){const i=e,o=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(A3,{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:o?void 0:t.defaultErrorTitle.lang,className:"font-semibold text-base text-red-900 dark:text-red-200",children:o?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 C$({parseResult:e,content:t,error:r=null,isLoading:i=!1,labels:o,theme:s,style:a,onStyleChange:n,availableStyles:l=Yi.DEFAULT_MARKDOWN_STYLES,align:c=Yi.DEFAULT_CONTENT_ALIGN,onAlignChange:h,showToc:d=!0,showStyle:u=!0,showAlign:f=!0,width:p,maxWidth:m,padding:y=16,iFrameAllowedDomains:x,embeds:C=Ne.NO_EMBEDS,emptyMessage:k,toolbar:S,linkComponent:v,onHeadingSelect:_,headingHref:E,onMathDiagnostics:B,spreadsheetEditor:I,spreadsheetLocale:M,imageSource:D,renderScrollBar:U}){const q=L.useRef(null),[N,A]=L.useState(null),F=L.useCallback(Z=>{q.current=Z,A(Z)},[]),[P,O]=L.useState(0),$=L.useRef(null),[j,T]=L.useState(null),W=L.useRef(null),z=L.useId(),G=Wx(),X=S??G,K=L.useMemo(()=>Q3(o),[o]),Q=L.useMemo(()=>J3(o),[o]),nt=L.useMemo(()=>t$(o),[o]),gt=L.useMemo(()=>e$(o),[o]),ut=$x(D),mt=vx(I);ru(C);const Lt=Rr.EMBED_PROVIDER_IDS.filter(Z=>C.providers.includes(Z)).join(" "),Ft=C.linkCardEndpoint,Mt=C.linkCardSize,Ht=L.useMemo(()=>{const Z=Lt.split(" "),it=Object.freeze(Rr.EMBED_PROVIDER_IDS.filter(St=>Z.includes(St)));return Object.freeze(Mt===void 0?{providers:it,linkCardEndpoint:Ft}:{providers:it,linkCardEndpoint:Ft,linkCardSize:Mt})},[Lt,Ft,Mt]),Yt=o?.embeddedVideo,Qt=o?.embeddedPost,we=o?.embeddedFrame,Se=L.useMemo(()=>i$({embeddedVideo:Yt,embeddedPost:Qt,embeddedFrame:we}),[Yt,Qt,we]),_t=L.useRef(B);L.useLayoutEffect(()=>{_t.current=B},[B]);const Ct=L.useCallback(Z=>{_t.current?.(Z)},[]),ve=k===void 0?o$:{text:k,lang:void 0},Yr=p$(q,$,j,c);if(!Yi.CONTENT_ALIGNS.includes(c))throw new TypeError(`[@aiquants/markdown] align must be one of ${Yi.CONTENT_ALIGNS.join(", ")}; got ${String(c)} (normalize it with toContentAlign)`);const ge=Number.isFinite(y)&&y>=0?y:16,sr=L.useCallback(Z=>{const it=q.current;if(it){const St=it.querySelector("[data-theme]"),Et=it.getBoundingClientRect(),ie=St?.children;let le=-1,Vr=Number.POSITIVE_INFINITY;if(ie)for(let Hi=0;Hi<ie.length;Hi+=1){const Ea=ie[Hi],zh=Math.abs(Ea.getBoundingClientRect().top-Et.top);zh<Vr&&(Vr=zh,le=Hi)}if(ie&&le>=0){const Ea=ie[le].getBoundingClientRect();W.current={childIndex:le,offset:Ea.top-Et.top}}else W.current=null}n(Z)},[n]);L.useLayoutEffect(()=>{const Z=W.current;if(!Z)return;W.current=null;const it=q.current;if(!it)return;const Et=it.querySelector("[data-theme]")?.children[Z.childIndex];if(!Et)return;const ie=it.getBoundingClientRect(),Vr=Et.getBoundingClientRect().top-ie.top;it.scrollTop+=Vr-Z.offset});const{isTocPinned:xr,closeToc:Xe}=X,Cr=L.useCallback((Z,it)=>{if(xr||Xe(),_?.(Z,it)===!0)return;it.preventDefault();const Et=q.current?.querySelector(`#${CSS.escape(Z.id)}`)??document.getElementById(Z.id);Et&&(m$(Et),Et.tabIndex<0&&!Et.hasAttribute("tabindex")&&Et.setAttribute("tabindex","-1"),Et.scrollIntoView({behavior:g$()?"instant":"smooth",block:"start"}),Et.focus({preventScroll:!0}))},[Xe,xr,_]),Ur=L.useMemo(()=>l.find(it=>it.name===a)?.className??"markdown-body",[l,a]),ar=e?.headings??[],br=!(i||r),Re=br&&e!==null,Te=br&&e===null&&t!==null,kr=Re&&d&&ar.length>0,J=Re&&u,xt=(Re||Te)&&f&&typeof h=="function"&&(p!==void 0||m!==void 0),Dt=L.useMemo(()=>w.jsx(Ix,{headings:ar,className:"text-sm",labelledBy:z,onHeadingSelect:Cr,headingHref:E}),[ar,z,Cr,E]),At=U===void 0?wl:`${P}px`,Xr=L.useMemo(()=>At===wl?n$:jx(At),[At]),Gr=kr||J||xt?w.jsxs("div",{ref:T,"data-aqmd-toolbar":!0,style:Xr,children:[w.jsx("span",{"data-aqmd-toolbar-inset-probe":!0,"aria-hidden":"true",style:l$}),xt&&h&&w.jsx(dn,{menu:"align",Icon:Yd[c].Icon,buttonLabel:K.selectAlignAria,titleLabel:K.alignTitle,pinLabel:K.pinAlignAria,unpinLabel:K.unpinAlignAria,isOpen:X.isAlignOpen,isPinned:X.isAlignPinned,isFront:X.lastActiveMenu==="align",onActivate:X.activateAlign,onToggle:X.toggleAlign,onClose:X.closeAlign,onPinToggle:X.togglePinAlign,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:N,renderBody:Z=>w.jsx("div",{className:"space-y-1",children:Yi.CONTENT_ALIGNS.map(it=>{const{labelKey:St,Icon:Et}=Yd[it],ie=K[St],le=c===it;return w.jsxs("button",{type:"button","aria-pressed":le,lang:ie.lang,className:`flex min-h-11 w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors ${le?"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(it),Z()},children:[w.jsx(Et,{className:"h-4 w-4"}),ie.text]},it)})})}),J&&w.jsx(dn,{menu:"style",Icon:z3,buttonLabel:K.selectStyleAria,titleLabel:K.styleTitle,pinLabel:K.pinStyleAria,unpinLabel:K.unpinStyleAria,isOpen:X.isStyleOpen,isPinned:X.isStylePinned,isFront:X.lastActiveMenu==="style",onActivate:X.activateStyle,onToggle:X.toggleStyle,onClose:X.closeStyle,onPinToggle:X.togglePinStyle,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:N,renderBody:Z=>w.jsx("div",{className:"space-y-1",children:l.map(it=>{const St=a===it.name;return w.jsx("button",{type:"button","aria-pressed":St,className:`min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${St?"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:()=>{sr(it.name),Z()},children:it.name},it.name)})})}),kr&&w.jsx(dn,{menu:"toc",Icon:N3,buttonLabel:K.openTocAria,titleLabel:K.tocTitle,titleId:z,pinLabel:K.pinTocAria,unpinLabel:K.unpinTocAria,isOpen:X.isTocOpen,isPinned:X.isTocPinned,isFront:X.lastActiveMenu==="toc",onActivate:X.activateToc,onToggle:X.toggleToc,onClose:X.closeToc,onPinToggle:X.togglePinToc,popoverClassName:"markdown-viewer-scrollbar-thin w-64 p-4",scrollBarClearance:At,boundary:N,renderBody:()=>Dt})]}):null,No=()=>i?w.jsxs("p",{children:[w.jsx("span",{"aria-hidden":"true",children:"🌀"})," ",w.jsx("span",{lang:K.loading.lang,children:K.loading.text})]}):r?w.jsx(x$,{error:r,labels:K}):e?w.jsx("div",{className:"relative w-full min-w-0",children:w.jsx(y$,{parseResult:e,theme:s,styleClassName:Ur,iFrameAllowedDomains:x,embeds:Ht,embedLabels:Se,linkComponent:v,missingImageLabel:K.missingImage.text,blockFailedLabel:o?.blockFailed,mermaidLabels:Q,spreadsheetEditor:mt,spreadsheetLocale:M,spreadsheetLabels:nt,imageSource:ut,svgImageLabels:gt,onMathDiagnostics:Ct})}):t!==null?w.jsx("pre",{className:"whitespace-pre-wrap break-all",children:t}):w.jsx("p",{lang:ve.lang,children:ve.text}),Wi={containerType:"inline-size",paddingInline:`${ge}px`,paddingBlockEnd:`${ge}px`,paddingBlockStart:`calc(${ge}px + var(${cn}))`,scrollPaddingBlockStart:`var(${cn})`,[cn]:`${Yr}px`};return w.jsxs(Qd,{scrollerRef:F,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:Wi},renderScrollBar:U,onBarInlineSizeChange:O,children:[Gr,w.jsx("div",{ref:$,"data-aqmd-content":!0,style:{width:p??s$,maxWidth:m,marginInline:a$(c)},children:No()})]})}const Hx=({node:e})=>w.jsx("del",{children:w.jsx(zt,{nodes:e.children})}),Yx=({node:e})=>w.jsx("em",{children:w.jsx(zt,{nodes:e.children})}),Ux=({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,"]"]})}),b$=({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}`))})}),Xx=({node:e})=>w.jsx("a",{href:e.url,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",children:"↩"}),k$=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,(o,s)=>{const a=Number(s);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/&#x([0-9a-f]+);/gi,(o,s)=>{const a=Number.parseInt(s,16);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/\s+/g," ").trim(),Gx=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"?k$(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()},w$=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"}},Vx=({node:e})=>{const t=new mC,r=`h${e.depth}`,i=e.data?.hProperties?.id,o=t.slug(Gx(e.children));return w.jsx(r,{id:i||o,className:w$(e.depth),children:w.jsx(zt,{nodes:e.children})})},S$=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==!1).map(([t,r])=>[t,r===!0?"":String(r)])),v$=({node:e,theme:t,iFrameAllowedDomains:r=[]})=>{const i=w.jsx(zt,{nodes:e.children,theme:t,iFrameAllowedDomains:r}),o=ta(e.data.tagName,S$(e.data.properties),{parentName:null,iFrameAllowedDomains:r});if(o.action==="unwrap")return i;if(o.action!=="keep"&&o.action!=="placeholder")return null;const s=e.data.tagName.toLowerCase();return w.jsx(s,{...wt.attributesToProps(o.attributes,e.data.tagName.toLowerCase()),children:i})},T$=/^\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,_$=({node:e,iFrameAllowedDomains:t=[]})=>{const r=wt(e.value,Mx({iFrameAllowedDomains:t,embedLabels:CC}));return Array.isArray(r)&&r.length===0?null:T$.test(e.value)?w.jsx("div",{children:r}):w.jsx("span",{children:r})},Kx=({node:e})=>{if(!e.url||e.url.trim()===""||!Mo(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})]})},Zx=({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}),B$=({node:e})=>{const t=Bx(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})},L$=new RegExp(`<(?:${[...qh].join("|")})(?=[\\s/>])`,"i"),Qx=e=>e.some(t=>t.type==="image"||t.type==="imageReference"||t.type==="html"&&typeof t.value=="string"&&L$.test(t.value)||t.children!==void 0&&Qx(t.children)),Jx=({node:e})=>{const t=Mo(e.url)?e.url:void 0,r=t!==void 0&&Lx(t);return w.jsx("a",{className:Ex(void 0,Qx(e.children)),href:t,target:r?"_blank":void 0,rel:r?"noreferrer":void 0,children:w.jsx(zt,{nodes:e.children})})},tC=({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})}),eC=({node:e})=>{const t=e.ordered?"ol":"ul";return w.jsx(t,{children:w.jsx(zt,{nodes:e.children})})},E$=({node:e})=>w.jsx("mark",{children:w.jsx(zt,{nodes:e.children})}),rC=({node:e})=>w.jsx("p",{children:w.jsx(zt,{nodes:e.children})}),iC=({node:e})=>w.jsx("strong",{children:w.jsx(zt,{nodes:e.children})}),F$=({node:e})=>w.jsx("sub",{children:w.jsx(zt,{nodes:e.children})}),A$=({node:e})=>w.jsx("sup",{children:w.jsx(zt,{nodes:e.children})}),Xd=e=>{const t=e.data?.hProperties;return{merged:t?.merged??!1,colSpan:t?.colSpan,rowSpan:t?.rowSpan,textAlign:t?.textAlign}},oC=({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,o)=>{const{merged:s,colSpan:a,rowSpan:n,textAlign:l}=Xd(i);return s?null:w.jsx("th",{colSpan:a,rowSpan:n,style:{textAlign:l??e.align?.[o]??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}-${o}`)})})}),w.jsx("tbody",{children:r.map((i,o)=>w.jsx("tr",{className:"border-gray-200 border-t bg-white dark:border-gray-700 dark:bg-gray-900",children:i.children.map((s,a)=>{const{merged:n,colSpan:l,rowSpan:c,textAlign:h}=Xd(s);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:s.children})},`mdast-table-node-${e.type}-${a}`)})},`mdast-table-node-${e.type}-${o}`))})]})})},sC=({node:e})=>w.jsx(w.Fragment,{children:e.value}),aC=()=>w.jsx("hr",{className:"border-gray-300 dark:border-gray-600"}),nC=({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})})]})},lC=({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,o)=>{switch(i.type){case"blockquote":return w.jsx(hC,{node:i},`mdast-node-${i.type}-${o}`);case"break":return w.jsx("br",{},`mdast-node-${i.type}-${o}`);case"code":return w.jsx(Nh,{node:i,theme:t},`mdast-node-${i.type}-${o}`);case"delete":return w.jsx(Hx,{node:i},`mdast-node-${i.type}-${o}`);case"details":return w.jsx(nC,{node:i},`mdast-node-${i.type}-${o}`);case"emphasis":return w.jsx(Yx,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteReference":return w.jsx(Ux,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteDefinition":return null;case"footnote-back-link":return w.jsx(Xx,{node:i},`mdast-node-${i.type}-${o}`);case"heading":return w.jsx(Vx,{node:i},`mdast-node-${i.type}-${o}`);case"html":return w.jsx(_$,{node:i,iFrameAllowedDomains:r},`mdast-node-${i.type}-${o}`);case"html-block-container":{const s=i,a=`mdast-node-${s.type}-${s.position?.start?.offset??"na"}-${s.position?.end?.offset??"na"}`;return w.jsx(v$,{node:s,theme:t,iFrameAllowedDomains:r},a)}case"image":return w.jsx(Kx,{node:i},`mdast-node-${i.type}-${o}`);case"inlineCode":return w.jsx(Zx,{node:i},`mdast-node-${i.type}-${o}`);case"inlineMath":return w.jsx(B$,{node:i},`mdast-node-${i.type}-${o}`);case"link":return w.jsx(Jx,{node:i},`mdast-node-${i.type}-${o}`);case"listItem":return w.jsx(tC,{node:i},`mdast-node-${i.type}-${o}`);case"list":return w.jsx(eC,{node:i},`mdast-node-${i.type}-${o}`);case"mark":return w.jsx(E$,{node:i},`mdast-node-${i.type}-${o}`);case"math":return w.jsx(G5,{node:i},`mdast-node-${i.type}-${o}`);case"message":return w.jsx(lC,{node:i},`mdast-node-${i.type}-${o}`);case"paragraph":return w.jsx(rC,{node:i},`mdast-node-${i.type}-${o}`);case"strong":return w.jsx(iC,{node:i},`mdast-node-${i.type}-${o}`);case"subscript":return w.jsx(F$,{node:i},`mdast-node-${i.type}-${o}`);case"superscript":return w.jsx(A$,{node:i},`mdast-node-${i.type}-${o}`);case"table":return w.jsx(oC,{node:i},`mdast-node-${i.type}-${o}`);case"text":return w.jsx(sC,{node:i},`mdast-node-${i.type}-${o}`);case"thematicBreak":return w.jsx(aC,{},`mdast-node-${i.type}-${o}`);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}-${o}`);throw new Error(`Unknown node type: ${i.type}`)}}}),hC=({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})}),M$=/\s*\{#(.+?)\}\s*$/,$$=()=>e=>{fe.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,o=i.value.match(M$);if(o){const s=o[1];t.data||(t.data={});const a=t.data,n=a.hProperties||{};n.id=s,a.hProperties=n,i.value=i.value.substring(0,o.index).trimEnd(),i.value===""&&t.children.pop()}})},O$=()=>e=>{fe.visit(e,"footnoteDefinition",t=>{fe.visit(t,"paragraph",r=>{r.children.push({type:"footnote-back-link",url:`#fnref-${t.identifier}`})})})},R$=()=>e=>{fe.visit(e,"html",(t,r,i)=>{if(typeof r!="number"||!i)return;const s=t.value.trim().match(/^<a\s+href="([^"]+)"[^>]*>(.*?)<\/a>$/i);if(s){const[,a,n]=s,l={type:"link",url:a,children:[{type:"text",value:n}]};i.children.splice(r,1,l)}})},I$=()=>e=>{const t=r=>{const i=r.children;if(!i)return;let o=0;for(;o<i.length;){const s=i[o];if(s.type==="html"&&s.value.startsWith("<")&&!s.value.startsWith("</")&&s.value.match(/<([a-zA-Z0-9]+)/)){let n="",l=0;const c=[];let h=!1;for(let d=o;d<i.length;d++){const u=i[d];if(u.type==="html"){n+=u.value;const f=u.value.match(/<\/?([a-zA-Z0-9]+)/g)||[];for(const p of f){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(u.type==="text")n+=u.value;else{c.length===0&&(h=!0);break}if(l++,c.length===0){h=!0;break}}h&&i.splice(o,l,{type:"html",value:n})}o++}};fe.visit(e,"paragraph",t),fe.visit(e,"tableCell",t),fe.visit(e,"heading",t),fe.visit(e,"emphasis",t),fe.visit(e,"strong",t),fe.visit(e,"delete",t)},Gd=/\s*=\s*(\d+)(w|h|x|y)\s*/g,P$=()=>e=>{fe.visit(e,"image",t=>{const r=l=>{if(!l)return{updatedText:l,matches:[]};const c=[...l.matchAll(Gd)];return{updatedText:l.replaceAll(Gd,"").trim(),matches:c}},{updatedText:i,matches:o}=r(t.alt);t.alt=i;const{updatedText:s,matches:a}=r(t.title);t.title=s||null;const n=[...o,...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)}}})},D$=()=>e=>{fe.visit(e,(t,r,i)=>{i&&Object.defineProperty(t,"parent",{value:i,writable:!0,configurable:!0,enumerable:!1})})},Vd=/^:::(message|details)\s*(.*)/,N$=()=>e=>{function t(r){const i=[];let o=0;for(;o<r.length;){const s=r[o];if(s.type==="paragraph"&&s.children[0]?.type==="text"&&s.children[0].value.trim().startsWith(":::")){const l=s.children[0].value.trim().match(Vd);if(l){const c=o;let h=-1,d=1;const u=s.children.at(-1);if(s.children.length>1&&u?.type==="text"&&u.value.trim()===":::")h=c;else for(let f=c+1;f<r.length;f++){const p=r[f];if(p.type==="paragraph"&&p.children[0]?.type==="text"){const m=p.children[0].value.trim();Vd.test(m)?d++:m===":::"&&d--}if(d===0){h=f;break}}if(h!==-1){const f=l[1],p=l[2];let m;if(h===c){const C=s.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=s.children.slice(1);C[0]?.type==="break"&&C.shift();const k={type:"paragraph",children:C},v=r[h].children.slice(0,-1);v.at(-1)?.type==="break"&&v.pop();const _={type:"paragraph",children:v},E=r.slice(c+1,h);m=[k,...E,_].filter(B=>!(B.type==="paragraph"&&B.children.length===0))}const y=t(m);let x;if(f==="message"?x={type:"message",data:{messageType:p.trim()},children:y}:f==="details"&&(x={type:"details",data:{title:p.trim()},children:y}),x){i.push(x),o=h+1;continue}}}}const a={...s};"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),o++}return i}e.children=t(e.children)},q$=e=>{const t=[];return fe.visit(e,"heading",r=>{const i=Gx(r.children),o=r.data?.hProperties?.id;o&&i&&t.push({depth:r.depth,text:i,id:o})}),t};exports.BlockquoteNode=hC;exports.CodeNode=Nh;exports.Color=Me;exports.Color$1=Di;exports.DEFAULT_MARKDOWN_EMBED_LABELS=xC;exports.DEFAULT_MARKDOWN_VIEWER_LABELS=Z3;exports.DEFAULT_MERMAID_DIAGRAM_LABELS=cM;exports.DEFAULT_MERMAID_INTERACTION=mx;exports.DEFAULT_SVG_IMAGE_LABELS=b3;exports.DeleteNode=Hx;exports.EmphasisNode=Yx;exports.FootnoteBackLinkNode=Xx;exports.FootnoteReferenceNode=Ux;exports.FootnotesSection=b$;exports.HeadingNode=Vx;exports.HostedScrollArea=Qd;exports.ImageNode=Kx;exports.InlineCodeNode=Zx;exports.JSON_SCHEMA=xg;exports.LinkNode=Jx;exports.ListItemNode=tC;exports.ListNode=eC;exports.MarkdownRenderer=Rx;exports.MarkdownViewer=C$;exports.MermaidDiagram=Ih;exports.NodesRenderer=zt;exports.ParagraphNode=rC;exports.Rgb=se;exports.SpreadsheetBlock=Dh;exports.StrongNode=iC;exports.TableNode=oC;exports.TableOfContents=Ix;exports.TextNode=sC;exports.ThematicBreakNode=aC;exports.Utils=pt;exports.ZERO_WIDTH_SPACE=zg;exports.ZennDetailsNode=nC;exports.ZennMessageNode=lC;exports.__export=hu;exports.__name=g;exports.abs=LS;exports.acos=IS;exports.adjustChannel=_l;exports.argumentsTag=ah;exports.array=uf;exports.arrayBufferTag=Lg;exports.arrayTag=Bg;exports.asin=PS;exports.assignWithDepth_default=qt;exports.at=rt;exports.atan2=ES;exports.booleanTag=sh;exports.calculateMathMLDimensions=tk;exports.calculateTextDimensions=ga;exports.calculateTextHeight=fh;exports.calculateTextWidth=je;exports.cleanAndMerge=ma;exports.clear=Eu;exports.clear$1=AB;exports.clear$2=oB;exports.clear2=TB;exports.color=Fi;exports.commonDb_exports=Al;exports.common_default=Pi;exports.computeDimensionOfText=Tm;exports.computeLabelTransform=ii;exports.configureLabelImages=gh;exports.configureSvgSize=Fl;exports.constant=_r;exports.constant$1=sa;exports.cos=FS;exports.createText=Oe;exports.curveBasis=Ms;exports.darken=Y;exports.dataViewTag=Fg;exports.dateTag=vg;exports.dayjs2=cu;exports.decodeEntities=pr;exports.defaultConfig2=hk;exports.defaultConfig_default=Bl;exports.define=oa;exports.distExports=bg;exports.edgeLabels=Lo;exports.epsilon=$n;exports.extend=Nl;exports.extractHeadings=q$;exports.float32ArrayTag=Dg;exports.float64ArrayTag=Ng;exports.generateId=Xg;exports.getAccDescription=$u;exports.getAccTitle=Au;exports.getConfig=Ot;exports.getConfig2=kt;exports.getDefaultExportFromCjs=Zd;exports.getDiagramTitle=Ru;exports.getEdgeId=ET;exports.getEffectiveHtmlLabels=ee;exports.getIconSVG=qi;exports.getLineFunctionsWithOffset=i0;exports.getRegisteredLayoutAlgorithm=cL;exports.getStylesFromArray=uh;exports.getSubGraphTitleMargins=ya;exports.getTag=fa;exports.getThemeVariables3=uu;exports.getUrl=Bu;exports.getUserDefinedConfig=z1;exports.halfPi=On;exports.hasKatex=Li;exports.hue=sw;exports.insertCluster=Im;exports.insertEdge=n0;exports.insertEdgeLabel=o0;exports.insertNode=Fh;exports.int16ArrayTag=Ig;exports.int32ArrayTag=Pg;exports.int8ArrayTag=Rg;exports.interpolateNumber=Qe;exports.interpolateRgb=Tn;exports.interpolateString=Ju;exports.isDark=ke;exports.isLabelStyle=rh;exports.isPrimitive=pa;exports.isTypedArray=mo;exports.isValidShape=r0;exports.lighten=H;exports.line=pf;exports.lineBreakRegex=Ii;exports.load=Cg;exports.log=V;exports.mapTag=Tg;exports.markerOffsets=Zt;exports.markers_default=c0;exports.max=AS;exports.min=MS;exports.nogamma=ql;exports.numberTag=oh;exports.objectTag=Eg;exports.parseFontSize=Io;exports.parseGenericTypes=xn;exports.pi=la;exports.positionEdgeLabel=s0;exports.positionNode=_B;exports.random=Vg;exports.regexpTag=wg;exports.registerIconPacks=em;exports.remarkCustomHeadingId=$$;exports.remarkFootnoteBackLink=O$;exports.remarkHtmlAnchorToLink=R$;exports.remarkHtmlInHtml=I$;exports.remarkImageSize=P$;exports.remarkParentNode=D$;exports.remarkZennMessage=N$;exports.render=hL;exports.renderKatexSanitized=El;exports.rgbConvert=Ku;exports.rgba=Je;exports.sanitizeText=Ce;exports.select=yt;exports.selectSvgElement=If;exports.setAccDescription=Mu;exports.setAccTitle=Fu;exports.setConfig2=lk;exports.setDiagramTitle=Ou;exports.setNodeElem=vB;exports.setTag=_g;exports.setupGraphViewbox=Lu;exports.setupGraphViewbox2=Iu;exports.sin=$S;exports.sqrt=OS;exports.stringTag=ih;exports.styles2String=ot;exports.symbolTag=Sg;exports.tau=RS;exports.terminalLabels=Ut;exports.uint16ArrayTag=$g;exports.uint32ArrayTag=Og;exports.uint8ArrayTag=Ag;exports.uint8ClampedArrayTag=Mg;exports.unknownIcon=Jg;exports.updateNodeBounds=st;exports.useMarkdownToolbarState=Wx;exports.utils_default=xe;exports.withPath=df;exports.wrapLabel=Kg;
|