@aiquants/markdown 9.0.0 → 9.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +3 -1
  2. package/dist/{abnfDiagram-VRR7QNED-BlcBSkWc.cjs → abnfDiagram-VRR7QNED-CfcidEeF.cjs} +1 -1
  3. package/dist/{abnfDiagram-VRR7QNED-DPvv0JN7.js → abnfDiagram-VRR7QNED-CqzHEoGP.js} +3 -3
  4. package/dist/{arc-DnEVH7-N.cjs → arc-BD-XC8JG.cjs} +1 -1
  5. package/dist/{arc-b3PXY3wd.js → arc-CIHnI5Tn.js} +1 -1
  6. package/dist/{architectureDiagram-ZJ3FMSHR-BPesVaHB.cjs → architectureDiagram-ZJ3FMSHR-CLgC4ySs.cjs} +1 -1
  7. package/dist/{architectureDiagram-ZJ3FMSHR-BPDNqRgJ.js → architectureDiagram-ZJ3FMSHR-CX5DaRgk.js} +2 -2
  8. package/dist/{blockDiagram-677ZJIJ3-D1wkf-um.cjs → blockDiagram-677ZJIJ3-B45jR5Ef.cjs} +1 -1
  9. package/dist/{blockDiagram-677ZJIJ3-Bif7ObTM.js → blockDiagram-677ZJIJ3-BVvPQ2BZ.js} +3 -3
  10. package/dist/{c4Diagram-LMCZKHZV-ByUwS5Pa.cjs → c4Diagram-LMCZKHZV-CUgZ93IA.cjs} +1 -1
  11. package/dist/{c4Diagram-LMCZKHZV-BTR45GVa.js → c4Diagram-LMCZKHZV-CmpNmuYQ.js} +2 -2
  12. package/dist/{channel-s9lqY49F.cjs → channel-CCNoIO-n.cjs} +1 -1
  13. package/dist/{channel-BjDEP12v.js → channel-CJnvKaiK.js} +1 -1
  14. package/dist/{chunk-2Q5K7J3B-GdBcW8di.cjs → chunk-2Q5K7J3B-CGvZIrla.cjs} +1 -1
  15. package/dist/{chunk-2Q5K7J3B-3Yxool5g.js → chunk-2Q5K7J3B-DI5NSXs3.js} +1 -1
  16. package/dist/{chunk-32BRIVSS-B08XoiLi.cjs → chunk-32BRIVSS-Buxmelj1.cjs} +1 -1
  17. package/dist/{chunk-32BRIVSS-CVTMS7GT.js → chunk-32BRIVSS-DBxZTCPU.js} +1 -1
  18. package/dist/{chunk-5VM5RSS4-D9iWNvvu.js → chunk-5VM5RSS4-B3vhx_6_.js} +1 -1
  19. package/dist/{chunk-5VM5RSS4-BQoi-IrE.cjs → chunk-5VM5RSS4-DJudqxeH.cjs} +1 -1
  20. package/dist/{chunk-EX3LRPZG-CRf3FYTC.js → chunk-EX3LRPZG-3mU4tF-T.js} +4 -4
  21. package/dist/{chunk-EX3LRPZG-BXIZ7mJ_.cjs → chunk-EX3LRPZG-BYk-yeom.cjs} +1 -1
  22. package/dist/{chunk-JWPE2WC7-D2PL9wSE.js → chunk-JWPE2WC7-05_7DU1b.js} +1 -1
  23. package/dist/{chunk-JWPE2WC7-BziKhEzJ.cjs → chunk-JWPE2WC7-CF8PY84Z.cjs} +1 -1
  24. package/dist/{chunk-MOJQB5TN-BZPg0rA4.cjs → chunk-MOJQB5TN-C1PxO_ZB.cjs} +1 -1
  25. package/dist/{chunk-MOJQB5TN-DcKI-L1a.js → chunk-MOJQB5TN-MX6h9dRz.js} +1 -1
  26. package/dist/{chunk-PUDLZKDR-DDUAtfaX.js → chunk-PUDLZKDR-CEaKE3Nm.js} +6 -6
  27. package/dist/{chunk-PUDLZKDR-DtwY_vfa.cjs → chunk-PUDLZKDR-nwjWRhQa.cjs} +1 -1
  28. package/dist/{chunk-RYQCIY6F-BczXRQc_.cjs → chunk-RYQCIY6F-0Xvnmozd.cjs} +1 -1
  29. package/dist/{chunk-RYQCIY6F-CrSm-DUq.js → chunk-RYQCIY6F-DCzkxbV-.js} +1 -1
  30. package/dist/{chunk-V7JOEXUC-fKZqn2BY.js → chunk-V7JOEXUC-9kUlPSlw.js} +5 -5
  31. package/dist/{chunk-V7JOEXUC-DHDaKlaz.cjs → chunk-V7JOEXUC-DJ6NOMBh.cjs} +1 -1
  32. package/dist/{chunk-VR4S4FIN-CB1TUCm-.js → chunk-VR4S4FIN-DTcdZAIy.js} +1 -1
  33. package/dist/{chunk-VR4S4FIN-CbOikBFH.cjs → chunk-VR4S4FIN-DjgjZOol.cjs} +1 -1
  34. package/dist/{chunk-XXDRQBXY-BNQCeyB9.cjs → chunk-XXDRQBXY-BAN-bNyU.cjs} +1 -1
  35. package/dist/{chunk-XXDRQBXY-K8anqUB1.js → chunk-XXDRQBXY-BSD7H18E.js} +1 -1
  36. package/dist/{classDiagram-v2-EOCWNBFH-0DLLfHtC.js → classDiagram-OUVF2IWQ-CAVtDASr.js} +2 -2
  37. package/dist/{classDiagram-OUVF2IWQ-D1vfgcCB.cjs → classDiagram-OUVF2IWQ-D9dkL55K.cjs} +1 -1
  38. package/dist/{classDiagram-OUVF2IWQ-0DLLfHtC.js → classDiagram-v2-EOCWNBFH-CAVtDASr.js} +2 -2
  39. package/dist/{classDiagram-v2-EOCWNBFH-D1vfgcCB.cjs → classDiagram-v2-EOCWNBFH-D9dkL55K.cjs} +1 -1
  40. package/dist/converter.wasm +0 -0
  41. package/dist/{cose-bilkent-JH36ORCC-Flvn8Q3R.cjs → cose-bilkent-JH36ORCC-KQT29htQ.cjs} +1 -1
  42. package/dist/{cose-bilkent-JH36ORCC-DSrvI7Rp.js → cose-bilkent-JH36ORCC-aJGIpkTB.js} +1 -1
  43. package/dist/{cynefinDiagram-TSTJHNR4-BGtSNTPQ.js → cynefinDiagram-TSTJHNR4-C3F_WdyT.js} +2 -2
  44. package/dist/{cynefinDiagram-TSTJHNR4-BxqOgmm9.cjs → cynefinDiagram-TSTJHNR4-C_rGUs0a.cjs} +1 -1
  45. package/dist/{dagre-VKFMJZFB-CIQyEWnl.cjs → dagre-VKFMJZFB-Bn_WdZ6A.cjs} +1 -1
  46. package/dist/{dagre-VKFMJZFB-Bq5NKuKi.js → dagre-VKFMJZFB-CrmCHDPv.js} +2 -2
  47. package/dist/{diagram-FQU43EPY-C-3vCuEY.cjs → diagram-FQU43EPY-B8Bka9S6.cjs} +1 -1
  48. package/dist/{diagram-FQU43EPY-B4shMan7.js → diagram-FQU43EPY-DuJ6IxJz.js} +2 -2
  49. package/dist/{diagram-G47NLZAW-BnJ5uYMd.js → diagram-G47NLZAW-3UXM5joI.js} +3 -3
  50. package/dist/{diagram-G47NLZAW-BnVPH5jd.cjs → diagram-G47NLZAW-D--MA_nT.cjs} +1 -1
  51. package/dist/{diagram-NH7WQ7WH-4RGgOu7p.cjs → diagram-NH7WQ7WH-Cqc8orqE.cjs} +1 -1
  52. package/dist/{diagram-NH7WQ7WH-9s11j-Nx.js → diagram-NH7WQ7WH-CtH8Gdkl.js} +2 -2
  53. package/dist/{diagram-OA4YK3LP-CgqOV0tg.js → diagram-OA4YK3LP-CWRyqD4L.js} +3 -3
  54. package/dist/{diagram-OA4YK3LP-BBtbKikh.cjs → diagram-OA4YK3LP-DfKPIPFJ.cjs} +1 -1
  55. package/dist/{diagram-WEI45ONY-DZKSviH2.cjs → diagram-WEI45ONY-BYMVLI0Q.cjs} +1 -1
  56. package/dist/{diagram-WEI45ONY-CvzP7VJ3.js → diagram-WEI45ONY-C0OrOx2a.js} +2 -2
  57. package/dist/{ebnfDiagram-CCIWWBDH-CJSyu4o9.js → ebnfDiagram-CCIWWBDH-CQ7558AK.js} +3 -3
  58. package/dist/{ebnfDiagram-CCIWWBDH-DpiouxMS.cjs → ebnfDiagram-CCIWWBDH-DZKq52yC.cjs} +1 -1
  59. package/dist/{erDiagram-Q63AITRT-BxRdYBzJ.js → erDiagram-Q63AITRT-CsCp6RSB.js} +4 -4
  60. package/dist/{erDiagram-Q63AITRT-BT1bGFxN.cjs → erDiagram-Q63AITRT-CzkYgQ0q.cjs} +1 -1
  61. package/dist/{extractHeadings-SqtThWou.js → extractHeadings-BUjTmniO.js} +2971 -2965
  62. package/dist/extractHeadings-Dkf-aqDu.cjs +314 -0
  63. package/dist/flowDiagram-23GEKE2U-DwEDOisR.cjs +1 -0
  64. package/dist/flowDiagram-23GEKE2U-aboipivB.js +7 -0
  65. package/dist/{ganttDiagram-NO4QXBWP-BXUukgtA.cjs → ganttDiagram-NO4QXBWP-7oIdk62h.cjs} +1 -1
  66. package/dist/{ganttDiagram-NO4QXBWP-BbNFbubH.js → ganttDiagram-NO4QXBWP-BVnjew_C.js} +2 -2
  67. package/dist/{gitGraphDiagram-IHSO6WYX-CtRl8SF8.cjs → gitGraphDiagram-IHSO6WYX-BufmbyyT.cjs} +1 -1
  68. package/dist/{gitGraphDiagram-IHSO6WYX-BY7URUuV.js → gitGraphDiagram-IHSO6WYX-fP0zuss4.js} +3 -3
  69. package/dist/index.cjs +1 -1
  70. package/dist/index.client.cjs +1 -1
  71. package/dist/index.client.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/{infoDiagram-FWYZ7A6U-DjbpQufv.cjs → infoDiagram-FWYZ7A6U-DerCFmks.cjs} +1 -1
  74. package/dist/{infoDiagram-FWYZ7A6U-BwM_aV37.js → infoDiagram-FWYZ7A6U-DzsSutoh.js} +1 -1
  75. package/dist/{ishikawaDiagram-FXEZZL3T-D0k3NpJW.cjs → ishikawaDiagram-FXEZZL3T-BN-byOYP.cjs} +1 -1
  76. package/dist/{ishikawaDiagram-FXEZZL3T-CWHT2wjh.js → ishikawaDiagram-FXEZZL3T-BZ_ric9v.js} +1 -1
  77. package/dist/{journeyDiagram-5HDEW3XC-BAzrW3sk.cjs → journeyDiagram-5HDEW3XC-C7iTlBhN.cjs} +1 -1
  78. package/dist/{journeyDiagram-5HDEW3XC-CTBamWVg.js → journeyDiagram-5HDEW3XC-CfZ11aJu.js} +4 -4
  79. package/dist/{kanban-definition-HUTT4EX6-vEBxhqy3.cjs → kanban-definition-HUTT4EX6-BNNQtqj9.cjs} +1 -1
  80. package/dist/{kanban-definition-HUTT4EX6-DX8ATmyc.js → kanban-definition-HUTT4EX6-De7q9Kj3.js} +2 -2
  81. package/dist/{linear-CUPbFHK0.js → linear-Bh2aX99D.js} +1 -1
  82. package/dist/{linear-DO7t2MIy.cjs → linear-D8TLf9nV.cjs} +1 -1
  83. package/dist/{mindmap-definition-LN4V7U3C-CZiyButG.js → mindmap-definition-LN4V7U3C-3bksVDiB.js} +3 -3
  84. package/dist/{mindmap-definition-LN4V7U3C-CPgbGhe0.cjs → mindmap-definition-LN4V7U3C-CmbdSctZ.cjs} +1 -1
  85. package/dist/{pegDiagram-2B236MQR-DFSWh2UC.cjs → pegDiagram-2B236MQR-BWozQII1.cjs} +1 -1
  86. package/dist/{pegDiagram-2B236MQR-BTTxMeDC.js → pegDiagram-2B236MQR-ffi6qFEn.js} +3 -3
  87. package/dist/{pieDiagram-ENE6RG2P-5OqZWuO-.js → pieDiagram-ENE6RG2P-De3q_Av5.js} +3 -3
  88. package/dist/{pieDiagram-ENE6RG2P-DWsTb8I9.cjs → pieDiagram-ENE6RG2P-DfTgyWpG.cjs} +1 -1
  89. package/dist/{quadrantDiagram-ABIIQ3AL-BnIKvRMS.cjs → quadrantDiagram-ABIIQ3AL-BZF5Z12H.cjs} +1 -1
  90. package/dist/{quadrantDiagram-ABIIQ3AL-DimV94Rb.js → quadrantDiagram-ABIIQ3AL-CP7NgI8w.js} +2 -2
  91. package/dist/{railroadDiagram-RFXS5EU6-CO_q8JT9.js → railroadDiagram-RFXS5EU6-BuWP-rUP.js} +3 -3
  92. package/dist/{railroadDiagram-RFXS5EU6-D7cUshy0.cjs → railroadDiagram-RFXS5EU6-Cui5Nx7p.cjs} +1 -1
  93. package/dist/{requirementDiagram-TGXJPOKE-CjPsjAsx.cjs → requirementDiagram-TGXJPOKE-C-WJSUrB.cjs} +1 -1
  94. package/dist/{requirementDiagram-TGXJPOKE-Ceitr12-.js → requirementDiagram-TGXJPOKE-DOEubcGx.js} +3 -3
  95. package/dist/{sankeyDiagram-HTMAVEWB-CAfuQjzU.js → sankeyDiagram-HTMAVEWB-BrD3GLG6.js} +1 -1
  96. package/dist/{sankeyDiagram-HTMAVEWB-CQhx84em.cjs → sankeyDiagram-HTMAVEWB-CyT8wRcS.cjs} +1 -1
  97. package/dist/{sequenceDiagram-DBY2YBRQ-BZ2yIdO6.js → sequenceDiagram-DBY2YBRQ-CT6w_sxa.js} +3 -3
  98. package/dist/{sequenceDiagram-DBY2YBRQ-Cr1VcoK2.cjs → sequenceDiagram-DBY2YBRQ-DmNBUeEN.cjs} +1 -1
  99. package/dist/{sizeCapture-X5ZJPWSS-CA-VZP1J.js → sizeCapture-X5ZJPWSS-Dt-2lcQO.js} +1 -1
  100. package/dist/{sizeCapture-X5ZJPWSS-B5X1945u.cjs → sizeCapture-X5ZJPWSS-h_Xsq3-D.cjs} +1 -1
  101. package/dist/{stateDiagram-2N3HPSRC-BeP4b2HS.cjs → stateDiagram-2N3HPSRC-C9dyCEcu.cjs} +1 -1
  102. package/dist/{stateDiagram-2N3HPSRC-CbAk-IE5.js → stateDiagram-2N3HPSRC-CjJrf8oq.js} +2 -2
  103. package/dist/{stateDiagram-v2-6OUMAXLB-C5uUx1aU.js → stateDiagram-v2-6OUMAXLB-APLiC-KL.js} +2 -2
  104. package/dist/{stateDiagram-v2-6OUMAXLB-L_ypLgkx.cjs → stateDiagram-v2-6OUMAXLB-BhwjG0NA.cjs} +1 -1
  105. package/dist/{swimlanes-5IMT3BWC-DGpEXqaM.cjs → swimlanes-5IMT3BWC-DRPswRoa.cjs} +1 -1
  106. package/dist/{swimlanes-5IMT3BWC-BOKZHjmn.js → swimlanes-5IMT3BWC-Dlu3b_xG.js} +3 -3
  107. package/dist/{swimlanesDiagram-G3AALYLV-BG07hh3H.js → swimlanesDiagram-G3AALYLV-CX2jbFCF.js} +2 -2
  108. package/dist/{swimlanesDiagram-G3AALYLV-DqChJVS9.cjs → swimlanesDiagram-G3AALYLV-VAEv3KP_.cjs} +1 -1
  109. package/dist/{timeline-definition-FHXFAJF6-O0HVNX0c.cjs → timeline-definition-FHXFAJF6-C6xF4zqV.cjs} +1 -1
  110. package/dist/{timeline-definition-FHXFAJF6-Ct3xWe_j.js → timeline-definition-FHXFAJF6-Ct68OfPR.js} +2 -2
  111. package/dist/{vennDiagram-L72KCM5P-DCY6NWkD.js → vennDiagram-L72KCM5P-BfTAjs8X.js} +1 -1
  112. package/dist/{vennDiagram-L72KCM5P-BqOqbGRA.cjs → vennDiagram-L72KCM5P-CUaYoUAd.cjs} +1 -1
  113. package/dist/{wardleyDiagram-EHGQE667-CYStGsZi.js → wardleyDiagram-EHGQE667-2foz0EAt.js} +2 -2
  114. package/dist/{wardleyDiagram-EHGQE667-B2Civob5.cjs → wardleyDiagram-EHGQE667-Cp3kY_DT.cjs} +1 -1
  115. package/dist/{xychartDiagram-FW5EYKEG-BifGB5it.js → xychartDiagram-FW5EYKEG-B3dGYiSE.js} +2 -2
  116. package/dist/{xychartDiagram-FW5EYKEG-C4GuhADi.cjs → xychartDiagram-FW5EYKEG-CDkSOK02.cjs} +1 -1
  117. package/package.json +7 -7
  118. package/dist/extractHeadings-B-v1O82x.cjs +0 -314
  119. package/dist/flowDiagram-23GEKE2U-C-drHfAk.js +0 -7
  120. package/dist/flowDiagram-23GEKE2U-Cr8_S21X.cjs +0 -1
@@ -0,0 +1,314 @@
1
+ "use strict";var zx=Object.create;var Fh=Object.defineProperty;var jx=Object.getOwnPropertyDescriptor;var Wx=Object.getOwnPropertyNames;var Hx=Object.getPrototypeOf,Yx=Object.prototype.hasOwnProperty;var Ux=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Wx(t))!Yx.call(e,s)&&s!==r&&Fh(e,s,{get:()=>t[s],enumerable:!(i=jx(t,s))||i.enumerable});return e};var Ah=(e,t,r)=>(r=e!=null?zx(Hx(e)):{},Ux(t||!e||!e.__esModule?Fh(r,"default",{value:e,enumerable:!0}):r,e));const E=require("react"),ze=require("./linkCards-Bjd_vW39.cjs"),Or=require("./providers-DO2t7ks4.cjs"),qi=require("./viewer-settings.cjs"),Tt=require("html-react-parser"),Ei=require("./code-blocks.cjs"),fr=require("./embeds.cjs"),ps=require("./source-lines.cjs"),rn=require("./simple-logger-9yf7ypyB.cjs"),Xx=require("shiki"),Ci=require("dompurify"),ns=require("@aiquants/spreadsheet/tsv"),Qr=require("@aiquants/spreadsheet/view"),Gx=require("github-slugger"),Vx=require("katex"),ye=require("unist-util-visit"),Vo=(e,t)=>{const r={};for(const i of Object.keys(e)){const s=t?.[i];if(s===void 0){r[i]=e[i];continue}if(typeof s!="string")throw new TypeError(`[@aiquants/markdown] label "${i}" must be a string; got ${s===null?"null":typeof s}`);r[i]={text:s,lang:void 0}}return Object.freeze(r)},dl=e=>{const t={};for(const r of Object.keys(e))t[r]=e[r].text;return Object.freeze(t)},Zo=Object.freeze({embeddedVideo:{text:"embedded video",lang:"en"},embeddedPost:{text:"embedded post",lang:"en"},embeddedFrame:{text:"Embedded content",lang:"en"}}),Zx=dl(Zo),Fd=e=>Vo(Zo,e),Kx=Fd(void 0);function Ad(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ds={exports:{}},zi={};var Mh;function Qx(){if(Mh)return zi;Mh=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,s,o){var a=null;if(o!==void 0&&(a=""+o),s.key!==void 0&&(a=""+s.key),"key"in s){o={};for(var n in s)n!=="key"&&(o[n]=s[n])}else o=s;return s=o.ref,{$$typeof:e,type:i,key:a,ref:s!==void 0?s:null,props:o}}return zi.Fragment=t,zi.jsx=r,zi.jsxs=r,zi}var ji={};var $h;function Jx(){return $h||($h=1,process.env.NODE_ENV!=="production"&&(function(){function e(L){if(L==null)return null;if(typeof L=="function")return L.$$typeof===D?null:L.displayName||L.name||null;if(typeof L=="string")return L;switch(L){case y:return"Fragment";case C:return"Profiler";case x:return"StrictMode";case T:return"Suspense";case B:return"SuspenseList";case O:return"Activity"}if(typeof L=="object")switch(typeof L.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),L.$$typeof){case m:return"Portal";case v:return L.displayName||"Context";case k:return(L._context.displayName||"Context")+".Consumer";case S:var X=L.render;return L=L.displayName,L||(L=X.displayName||X.name||"",L=L!==""?"ForwardRef("+L+")":"ForwardRef"),L;case _:return X=L.displayName||null,X!==null?X:e(L.type)||"Memo";case P:X=L._payload,L=L._init;try{return e(L(X))}catch{}}return null}function t(L){return""+L}function r(L){try{t(L);var X=!1}catch{X=!0}if(X){X=console;var Y=X.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&L[Symbol.toStringTag]||L.constructor.name||"Object";return Y.call(X,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),t(L)}}function i(L){if(L===y)return"<>";if(typeof L=="object"&&L!==null&&L.$$typeof===P)return"<...>";try{var X=e(L);return X?"<"+X+">":"<...>"}catch{return"<...>"}}function s(){var L=H.A;return L===null?null:L.getOwner()}function o(){return Error("react-stack-top-frame")}function a(L){if(U.call(L,"key")){var X=Object.getOwnPropertyDescriptor(L,"key").get;if(X&&X.isReactWarning)return!1}return L.key!==void 0}function n(L,X){function Y(){A||(A=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",X))}Y.isReactWarning=!0,Object.defineProperty(L,"key",{get:Y,configurable:!0})}function l(){var L=e(this.type);return z[L]||(z[L]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),L=this.props.ref,L!==void 0?L:null}function c(L,X,Y,G,q,K){var Z=Y.ref;return L={$$typeof:p,type:L,key:X,props:Y,_owner:G},(Z!==void 0?Z:null)!==null?Object.defineProperty(L,"ref",{enumerable:!1,get:l}):Object.defineProperty(L,"ref",{enumerable:!1,value:null}),L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(L,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(L,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(L,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L}function h(L,X,Y,G,q,K){var Z=X.children;if(Z!==void 0)if(G)if(I(Z)){for(G=0;G<Z.length;G++)d(Z[G]);Object.freeze&&Object.freeze(Z)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(Z);if(U.call(X,"key")){Z=e(L);var et=Object.keys(X).filter(function(ut){return ut!=="key"});G=0<et.length?"{key: someKey, "+et.join(": ..., ")+": ...}":"{key: someKey}",N[Z+G]||(et=0<et.length?"{"+et.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
+ let props = %s;
3
+ <%s {...props} />
4
+ React keys must be passed directly to JSX without using spread:
5
+ let props = %s;
6
+ <%s key={someKey} {...props} />`,G,Z,et,Z),N[Z+G]=!0)}if(Z=null,Y!==void 0&&(r(Y),Z=""+Y),a(X)&&(r(X.key),Z=""+X.key),"key"in X){Y={};for(var dt in X)dt!=="key"&&(Y[dt]=X[dt])}else Y=X;return Z&&n(Y,typeof L=="function"?L.displayName||L.name||"Unknown":L),c(L,Z,Y,s(),q,K)}function d(L){f(L)?L._store&&(L._store.validated=1):typeof L=="object"&&L!==null&&L.$$typeof===P&&(L._payload.status==="fulfilled"?f(L._payload.value)&&L._payload.value._store&&(L._payload.value._store.validated=1):L._store&&(L._store.validated=1))}function f(L){return typeof L=="object"&&L!==null&&L.$$typeof===p}var u=E,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),v=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),H=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,I=Array.isArray,M=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(L){return L()}};var A,z={},R=u.react_stack_bottom_frame.bind(u,o)(),$=M(i(o)),N={};ji.Fragment=y,ji.jsx=function(L,X,Y){var G=1e4>H.recentlyCreatedOwnerStacks++;return h(L,X,Y,!1,G?Error("react-stack-top-frame"):R,G?M(i(L)):$)},ji.jsxs=function(L,X,Y){var G=1e4>H.recentlyCreatedOwnerStacks++;return h(L,X,Y,!0,G?Error("react-stack-top-frame"):R,G?M(i(L)):$)}})()),ji}var Oh;function tC(){return Oh||(Oh=1,process.env.NODE_ENV==="production"?Ds.exports=Qx():Ds.exports=Jx()),Ds.exports}var w=tC();const Rh=Object.freeze({display:"flex",flexDirection:"row",inlineSize:"100%",blockSize:"100%",minInlineSize:0,minBlockSize:0}),eC=Object.freeze({flex:"1 1 0%",minInlineSize:0,minBlockSize:0,overflow:"clip"}),rC=Object.freeze({display:"flex",flex:"none",minBlockSize:0}),iC=Object.freeze({position:"absolute",insetBlock:0,insetInline:0,overflowY:"scroll",visibility:"hidden",pointerEvents:"none"}),sC=Object.freeze({scrollbarWidth:"none"}),oC=.01,Ih=Object.freeze({scroller:null,barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1}),Ta=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},aC=(e,t,r)=>{const i=getComputedStyle(e),s=Ta(i.width),o=e.getBoundingClientRect();if(s<=0||o.width<=0)return{barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1};const a=o.width/s,n=(o.width-t.getBoundingClientRect().width)/a-Ta(i.borderLeftWidth)-Ta(i.borderRightWidth),l=Math.max(0,Math.ceil(n-oC));return{barInlineSize:r.getBoundingClientRect().width/a,nativeBarInlineSize:l,overlaysScrollbars:l===0&&t.offsetWidth>0&&t.offsetWidth===t.clientWidth}},nC=(e,t,r,i,s)=>{const[o,a]=E.useState(Ih),n=E.useRef(s),l=E.useRef(0);return E.useLayoutEffect(()=>{n.current=s}),E.useLayoutEffect(()=>{const c=m=>{l.current!==m&&(l.current=m,n.current?.(m))},h=t.current,d=r.current,f=i.current;if(!e||h===null||d===null||f===null){a(Ih),c(0);return}const u=()=>{const{barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x}=aC(h,d,f);a(C=>C.scroller===h&&C.barInlineSize===m&&C.nativeBarInlineSize===y&&C.overlaysScrollbars===x?C:Object.freeze({scroller:h,barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x})),c(m)};u();const p=new ResizeObserver(u);return p.observe(h),p.observe(d),p.observe(f),window.addEventListener("resize",u),()=>{p.disconnect(),window.removeEventListener("resize",u)}},[e,t,r,i]),o},lC=(e,t)=>{if(typeof e=="function"){const r=e(t);return typeof r=="function"?r:()=>e(null)}return e!=null?(e.current=t,()=>{e.current=null}):()=>{}};function Md({scrollerProps:e,scrollerRef:t,children:r,renderScrollBar:i,rowClassName:s,rowStyle:o,onBarInlineSizeChange:a}){const n=E.useRef(null),l=E.useRef(null),c=E.useRef(null),h=i!==void 0,d=nC(h,n,l,c,a),f=E.useCallback(m=>{n.current=m;const y=lC(t,m);return()=>{n.current=null,y()}},[t]),u=h?{...e.style,position:"relative",boxSizing:"border-box",overflowY:"scroll",width:`calc(100% + ${d.nativeBarInlineSize}px)`,...d.overlaysScrollbars?sC:void 0}:e.style,p=w.jsxs("div",{...e,ref:f,style:u,children:[r,h&&w.jsx("span",{ref:l,"data-aqmd-scroll-bar-probe":!0,"aria-hidden":"true",style:iC})]});return h?w.jsxs("div",{"data-aqmd-scroll-row":!0,className:s,style:o===void 0?Rh:{...Rh,...o},children:[w.jsx("div",{"data-aqmd-scroll-clip":!0,style:eC,children:p}),w.jsx("div",{ref:c,"data-aqmd-scroll-bar":!0,style:rC,children:d.scroller!==null&&i(d.scroller)})]}):p}const hC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),Ph=e=>{const t=cC(e);return t.charAt(0).toUpperCase()+t.slice(1)},$d=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim(),dC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var uC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const fC=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:s="",children:o,iconNode:a,...n},l)=>E.createElement("svg",{ref:l,...uC,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:$d("lucide",s),...!o&&!dC(n)&&{"aria-hidden":"true"},...n},[...a.map(([c,h])=>E.createElement(c,h)),...Array.isArray(o)?o:[o]]));const Et=(e,t)=>{const r=E.forwardRef(({className:i,...s},o)=>E.createElement(fC,{ref:o,iconNode:t,className:$d(`lucide-${hC(Ph(e))}`,`lucide-${e}`,i),...s}));return r.displayName=Ph(e),r};const gC=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],pC=Et("image-off",gC);const mC=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],yC=Et("building-2",mC);const xC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Dh=Et("globe",xC),CC=/^[a-z]{2,3}$/u,bC=e=>{const t=e.trim().split("-",1)[0]?.toLowerCase()??"";return CC.test(t)?t:null},kC=()=>()=>{},wC=e=>{const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>t.disconnect()},ul=()=>E.useSyncExternalStore(kC,()=>window.location.origin,()=>null),SC=()=>E.useSyncExternalStore(wC,()=>bC(document.documentElement.lang),()=>null),vC=/^[1-9]\d{0,4}$/u,Nh=e=>e!==void 0&&vC.test(e.trim())?Number(e.trim()):null,TC=({embed:e,label:t,insideAnchor:r,children:i})=>{const s=ul(),o=new URL(e.src);if(s!==null&&o.origin!==s&&!r)return i;const a=Nh(e.attributes.width),n=Nh(e.attributes.height),l=a!==null&&n!==null?{width:"100%",maxWidth:`${a}px`,aspectRatio:`${a} / ${n}`}:void 0,c=e.attributes.title,h=c===void 0?t.lang:void 0;return w.jsx("span",{"data-embed-frame":s===null?"pending":"refused","data-aqmd-embed-surface":l===void 0?void 0:"",style:l,className:l===void 0?void 0:"flex items-center justify-center rounded-lg p-2 text-center",children:r?w.jsx("span",{lang:h,children:`${c??t.text}: ${o.hostname}`}):w.jsx("a",{href:o.href,target:"_blank",rel:"noreferrer",lang:h,children:c??`${t.text}: ${o.hostname}`})})},Od=({concurrency:e,capacity:t,timeoutMs:r})=>{for(const[h,d]of Object.entries({concurrency:e,capacity:t,timeoutMs:r}))if(!Number.isInteger(d)||d<=0)throw new RangeError(`[@aiquants/markdown] request queue ${h} must be a positive integer; got ${String(d)}`);const i=new Map,s=new Map,o=[];let a=0;const n=(h,d,f)=>{if(s.get(h)===d&&(s.delete(h),f!==null)){i.set(h,f);for(const u of i.keys()){if(i.size<=t)break;i.delete(u)}for(const u of d.subscriptions)u.listener(f)}},l=()=>{for(;a<e;){const h=o.shift();if(h===void 0)return;const d=s.get(h);if(d===void 0)continue;const f=new AbortController;d.controller=f,a+=1,new Promise(u=>u(d.start(AbortSignal.any([f.signal,AbortSignal.timeout(r)])))).then(u=>n(h,d,{ok:!0,value:u}),()=>n(h,d,f.signal.aborted?null:{ok:!1})).finally(()=>{a-=1,l()})}};return Object.freeze({subscribe:(h,d,f)=>{const u=i.get(h);if(u!==void 0)return i.delete(h),i.set(h,u),f(u),()=>{};let p=s.get(h);p===void 0&&(p={start:d,subscriptions:new Set,controller:null},s.set(h,p),o.push(h));const m=p,y={listener:f};return m.subscriptions.add(y),l(),()=>{m.subscriptions.delete(y),!(m.subscriptions.size>0||s.get(h)!==m)&&(s.delete(h),m.controller===null?o.splice(o.indexOf(h),1):m.controller.abort())}}})},_C=Od({concurrency:2,capacity:256,timeoutMs:15e3}),BC="[data-aqmd-scroll-container]",LC=async(e,t)=>{let r;try{r=await fetch(e,{credentials:"same-origin",redirect:"error",headers:{accept:"application/json"},signal:t})}catch(o){if(t.aborted)throw o;return{kind:"error",cause:"network error"}}if(r.status===204){const o=ze.linkCardSkipReasonOf(r.headers.get(ze.LINK_CARD_SKIP_HEADER));return o===null?{kind:"error",cause:"HTTP 204 without a known skip reason"}:{kind:"skip",reason:o}}if(!r.ok)return{kind:"error",cause:`HTTP ${r.status}`};let i;try{i=await r.json()}catch(o){if(t.aborted)throw o;return{kind:"error",cause:`HTTP ${r.status}, not JSON`}}const s=ze.linkCardMetadataOf(i);return s===null?{kind:"error",cause:`HTTP ${r.status}, not a JSON object`}:{kind:"card",metadata:s}},EC=e=>e.ok?e.value.kind==="card"?null:e.value.kind==="skip"?e.value.reason:e.value.cause:"network error",qh=(e,t)=>e!==null&&new URL(e).hostname!==t?e:null,_a=({tile:e,tileKind:t,primary:r,secondary:i})=>w.jsxs("span",{className:"flex min-w-0 flex-auto items-center gap-3 px-3",children:[w.jsx("span",{"aria-hidden":"true","data-link-card-icon":t,className:`flex size-8 shrink-0 items-center justify-center rounded-md bg-(--aqmd-link-card-bg-hover) text-(--aqmd-link-card-muted) ${t==="pending"?"motion-safe:animate-pulse":""}`,children:e}),w.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[w.jsx("span",{className:"truncate font-semibold text-[0.875rem] leading-5",children:r}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:i})]})]}),FC=({href:e,endpoint:t,size:r,fallback:i})=>{const s=ul(),o=E.useRef(null),a=new URL(e),n=`${t}
7
+ ${a.href}`,[l,c]=E.useState(null);E.useEffect(()=>{const x=o.current;if(x===null||s===null)return;let C=null;const k=new IntersectionObserver(v=>{C!==null||!v.some(S=>S.isIntersecting)||(k.disconnect(),C=_C.subscribe(n,S=>LC(ze.linkCardRequestOf(t,new URL(e),s),S),S=>{c({key:n,outcome:S});const T=EC(S);T!==null&&rn.linkCardLogger.info(`No link card for ${e} (${T})`)}))},{root:x.closest(BC),rootMargin:"100% 0px"});return k.observe(x),()=>{k.disconnect(),C?.()}},[n,t,e,s]);const h=l!==null&&l.key===n?l.outcome:null;if(h!==null&&!h.ok)return i;const d=h===null?null:h.value;if(d!==null&&d.kind==="error")return i;if(d===null||s===null)return w.jsx("a",{ref:o,href:e,target:"_blank",rel:"noreferrer","aria-busy":"true","data-link-card":"pending","data-link-card-size":r,children:r==="compact"?w.jsx(_a,{tile:null,tileKind:"pending",primary:a.hostname,secondary:e}):w.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-2 px-4 py-3.5",children:[w.jsx("span",{"aria-hidden":"true",className:"block h-3.5 w-2/3 rounded bg-(--aqmd-link-card-border) motion-safe:animate-pulse"}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem]",children:a.hostname}),w.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:e})]})});if(d.kind==="skip"){const{reason:x}=d,C=x==="private-network",k=C?yC:Dh;return w.jsx("a",{ref:o,href:e,target:"_blank",rel:"noreferrer","data-link-card":"compact","data-link-card-reason":x,"data-link-card-size":"compact",children:w.jsx(_a,{tile:w.jsx(k,{"aria-hidden":"true",className:"size-4"}),tileKind:C?"internal":"link",primary:a.hostname,secondary:e})})}const{metadata:f}=d,u=new URL(s).hostname,p=qh(f.image,u),m=qh(f.icon,u),y=f.siteName===null?a.hostname:`${f.siteName} · ${a.hostname}`;return r==="compact"?w.jsx("a",{ref:o,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":"compact",children:w.jsx(_a,{tile:m===null?w.jsx(Dh,{"aria-hidden":"true",className:"size-4"}):w.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 rounded-[3px]"}),tileKind:m===null?"link":"favicon",primary:f.title??e,secondary:y})}):w.jsxs("a",{ref:o,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":r,children:[w.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1 px-4 py-3.5",children:[w.jsx("span",{className:"wrap-anywhere line-clamp-2 font-semibold text-[0.9375rem] leading-5",children:f.title??e}),f.description===null?null:w.jsx("span",{className:`wrap-anywhere text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem] ${r==="banner"?"line-clamp-1":"line-clamp-2"}`,children:f.description}),w.jsxs("span",{className:"mt-1 flex items-center gap-1.5 text-(--aqmd-link-card-muted) text-xs leading-4",children:[m===null?null:w.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 shrink-0 rounded-[3px]"}),w.jsx("span",{className:"truncate",children:y})]})]}),p===null?null:w.jsx("img",{src:p,alt:"",loading:"lazy",referrerPolicy:"no-referrer"})]})},Rd=e=>{if(!Array.isArray(e.providers))throw new RangeError(`[@aiquants/markdown] embeds.providers must be an array of provider ids; got ${typeof e.providers}`);for(const t of e.providers)if(!Or.isEmbedProviderId(t))throw new RangeError(`[@aiquants/markdown] embeds.providers holds an unknown provider id ${JSON.stringify(t)}; known ids are ${Or.EMBED_PROVIDER_IDS.join(", ")}`);if(e.linkCardEndpoint!==null&&!ze.isLinkCardEndpoint(e.linkCardEndpoint))throw new RangeError(`[@aiquants/markdown] embeds.linkCardEndpoint must be null or an absolute path without a trailing "/" (segments of A-Z a-z 0-9 . _ ~ -, no "." or ".."); got ${JSON.stringify(e.linkCardEndpoint)}`);if(e.linkCardSize!==void 0&&!ze.isLinkCardSize(e.linkCardSize))throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${ze.LINK_CARD_SIZES.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);return e},Qi=new WeakMap;let Ns=0;const zh=e=>{if(e.source===null)return;const t=Qi.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(Or.EMBED_FRAME_HEIGHT_LIMITS.max,Math.max(Or.EMBED_FRAME_HEIGHT_LIMITS.min,Math.ceil(r)));i!==t.last&&(t.last=i,t.watch.set(i))},AC=(e,t)=>{const r={watch:t,last:null};return Qi.has(e)||(Ns+=1,Ns===1&&window.addEventListener("message",zh)),Qi.set(e,r),()=>{Qi.get(e)===r&&(Qi.delete(e),Ns-=1,Ns===0&&window.removeEventListener("message",zh))}},MC=Od({concurrency:2,capacity:256,timeoutMs:5e3}),$C=async(e,t)=>{const r=await fetch(e,{credentials:"omit",redirect:"error",referrerPolicy:"no-referrer",headers:{accept:"application/json"},signal:t});if(!r.ok)throw new Error(`[@aiquants/markdown] embed lookup answered ${r.status}`);return await r.json()},OC=(e,t)=>{const r=e.maxWidth===null?void 0:`${e.maxWidth}px`;switch(e.kind){case"aspect":return{width:"100%",maxWidth:r,aspectRatio:`${e.ratio[0]} / ${e.ratio[1]}`};case"fixed":return{width:"100%",maxWidth:r,height:`${e.height}px`};case"message":return{width:"100%",maxWidth:r,height:`${t??e.initialHeight}px`}}},RC=Object.freeze({marginInline:0}),Ba=Object.freeze({kind:"pending"}),IC=Object.freeze({kind:"narrow"}),PC=Object.freeze({kind:"fallback"}),DC=(e,t,r,i,s)=>{if(t===null)return Ba;let o;if(e.kind==="frame")o=e.srcOf(r);else{if(i===null)return Ba;o=i.ok?e.srcOf(i.value,r):null}if(o===null||new URL(o).origin===t)return PC;const{minWidth:a,maxWidth:n}=e.layout;if(a!==null){if(s===null)return Ba;if(Math.min(s,n??Number.POSITIVE_INFINITY)<a)return IC}return{kind:"frame",src:o}},NC=({resolution:e,caption:t,fallback:r,theme:i,labels:s})=>{const o=ul(),a=SC(),[n,l]=E.useState(null),[c,h]=E.useState(null),d=e.kind==="lookup"?e.request.href:null,[f,u]=E.useState(null);E.useEffect(()=>{if(d!==null)return MC.subscribe(d,_=>$C(new URL(d),_),_=>u({key:d,outcome:_}))},[d]);const{provider:p,layout:m}=e,y=DC(e,o,{theme:i,lang:a},f!==null&&f.key===d?f.outcome:null,n),x=E.useCallback(_=>{if(_===null)return;l(_.getBoundingClientRect().width);const P=new ResizeObserver(()=>l(_.getBoundingClientRect().width));return P.observe(_),()=>P.disconnect()},[]),C=y.kind==="frame"?y.src:null,k=c!==null&&c.src===C?c.height:null,v=E.useCallback(_=>{if(!(_===null||_.contentWindow===null||m.kind!=="message"||C===null))return AC(_.contentWindow,{origin:p.frameOrigin,src:C,heightOf:m.heightOf,set:P=>h({src:C,height:P})})},[m,p.frameOrigin,C]);if(y.kind==="fallback")return r;const S=m.minWidth===null?null:w.jsx("span",{ref:x,"aria-hidden":"true","data-embed-measure":p.id,className:"block h-0"});if(y.kind==="narrow")return w.jsxs(w.Fragment,{children:[S,r]});const T=p.content==="video"?s.embeddedVideo:s.embeddedPost,{frame:B}=p;return w.jsxs(w.Fragment,{children:[S,w.jsxs("figure",{"data-embed-provider":p.id,"data-embed-state":y.kind,style:RC,children:[w.jsx("div",{"data-embed-box":"","data-aqmd-embed-surface":"",style:OC(m,k),className:"noscript:hidden overflow-hidden rounded-lg",children:y.kind==="frame"?w.jsx("iframe",{ref:v,src:y.src,title:`${p.name}: ${T.text}`,lang:T.lang,loading:"lazy",allow:B.allow??void 0,allowFullScreen:B.allowFullScreen,sandbox:B.sandbox,referrerPolicy:B.referrerPolicy,scrolling:B.scrolling??void 0,className:"block h-full w-full border-0"},y.src):null}),w.jsx("figcaption",{className:"mt-2",children:t})]})]})},qC=["title","width","height","allow","allowfullscreen","sandbox","referrerpolicy","loading","frameborder","scrolling"],zC=(e,t)=>fr.allowedFrameUrlOf(e,t)!==null,jC=(e,t)=>{const r=new Map(Object.entries(e).map(([o,a])=>[o.toLowerCase(),a])),i=fr.allowedFrameUrlOf(r.get("src"),t);if(i===null)return null;const s={};for(const o of qC){const a=r.get(o);if(a!==void 0)if(o==="allow"){const n=fr.reduceFrameFeatures(a);n!==null&&(s.allow=n)}else if(o==="referrerpolicy"){const n=a.trim().toLowerCase();fr.EMBED_FRAME_REFERRER_POLICIES.has(n)&&(s.referrerpolicy=n)}else s[o]=a}return Object.freeze({src:i.href,attributes:Object.freeze(s)})},WC=new Set(["script","style","template","noscript","noembed","noframes","plaintext","xmp","title","head","meta","link","base","object","embed","applet","param","frame","frameset","select","datalist","track","math","foreignobject"]),HC=new Set(["id","class","title","lang","dir","role","hidden","translate","style"]),YC=new Set(["markdown-alert","markdown-alert-title","markdown-alert-note","markdown-alert-tip","markdown-alert-important","markdown-alert-warning","markdown-alert-caution","octicon","octicon-info","octicon-light-bulb","octicon-report","octicon-alert","octicon-stop","mr-2","message","message-symbol","message-content","alert","info","warning","markdown-details","markdown-details-content","footnotes","footnote-ref","footnote-backref","math","inline","display"]),jh="language-",UC=/[\t\n\f\r ]+/u,XC=new Set(["h1","h2","h3","h4","h5","h6"]),Wh=Object.freeze({sup:/^fnref\d*:\d+$/u,li:/^fn:\d+$/u}),Hh="user-content-",Gt=["align"],Ur=["width","height"],Yh=["colspan","rowspan","headers","scope","abbr","align","valign","width","height"],La=Object.freeze({a:["href","name","hreflang","data-link-kind","data-doc-path","data-doc-exists","data-footnote-ref","data-footnote-backref"],abbr:[],address:[],article:[],aside:[],audio:["src","controls","loop","muted","preload"],b:[],bdi:[],bdo:[],blockquote:["cite"],br:[],caption:Gt,cite:[],code:[Ei.CODE_META_ATTRIBUTE],col:["span",...Gt,...Ur],colgroup:["span",...Gt,...Ur],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,...Ur,"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",...Ur],tbody:[...Gt,"valign"],td:Yh,tfoot:[...Gt,"valign"],th:Yh,thead:[...Gt,"valign"],time:["datetime"],tr:[...Gt,"valign"],u:[],ul:[],var:[],video:["src","poster","controls","loop","muted","playsinline","preload",...Ur],wbr:[]}),Ea=Object.freeze({svg:["viewbox","version","xmlns","focusable","fill",...Ur],g:["fill","fill-rule","clip-rule"],path:["d","fill","fill-rule","clip-rule"]}),GC=new Set(["svg","g"]),VC=new Set(["href","src","cite","poster",fr.EMBED_LINK_ATTRIBUTE]),ZC=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu,KC=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,QC=new Set(["left","right","center","justify","start","end"]),Es=e=>KC.test(e.replace(ZC,"")),JC=e=>{let t=null;for(const r of e.split(";")){const i=r.indexOf(":");if(i<0||r.slice(0,i).trim().toLowerCase()!=="text-align")continue;const s=r.slice(i+1).trim().toLowerCase();QC.has(s)&&(t=s)}return t===null?null:`text-align: ${t}`},tb=e=>{const t=e.split(UC).filter(r=>YC.has(r)||r.startsWith(jh)&&r.length>jh.length);return t.length===0?null:t.join(" ")},eb=(e,t)=>XC.has(e)||t.startsWith(Hh)&&t.length>Hh.length||Object.hasOwn(Wh,e)&&Wh[e].test(t),rb=e=>{const t=new Map;for(const[r,i]of Object.entries(e)){const s=r.toLowerCase();t.has(s)||t.set(s,i)}return t},Wi=(e,t,r)=>{const i={};for(const[s,o]of t){if(s===ps.SOURCE_LINES_ATTRIBUTE){ps.parseSourceLines(o)!==null&&(i[s]=o);continue}if((HC.has(s)||r.includes(s)||s.startsWith("aria-")&&s.length>5)&&!(VC.has(s)&&!Es(o))&&!(s==="fill"&&/url\s*\(/iu.test(o))&&!(s==="id"&&!eb(e,o))){if(s==="class"||s==="style"){const a=s==="class"?tb(o):JC(o);a!==null&&(i[s]=a);continue}i[s]=o}}return i},ib=e=>e.get("type")?.trim().toLowerCase()==="checkbox"&&e.has("disabled"),fl=(e,t,r)=>{const i=e.toLowerCase(),s=r.parentName===null?null:r.parentName.toLowerCase(),o=rb(t);if(s!==null&&GC.has(s)){const n=i!=="svg"&&Object.hasOwn(Ea,i)?Ea[i]:void 0;return n===void 0?{action:"remove"}:{action:"keep",attributes:Wi(i,o,n)}}if(i==="svg")return{action:"keep",attributes:Wi(i,o,Ea.svg)};if(i==="iframe"){const n=jC(Object.fromEntries(o),r.iFrameAllowedDomains);return n===null?{action:"remove"}:{action:"embed",embed:n,pluginType:o.get("data-plugin-type")??null}}if(i==="p"){const n=Wi(i,o,La.p),l=o.get(fr.EMBED_LINK_ATTRIBUTE);return l!==void 0&&Es(l)?{action:"placeholder",attributes:n,link:l}:{action:"keep",attributes:n}}if(i==="input")return ib(o)?{action:"keep",attributes:Wi(i,o,["type","checked","disabled"])}:{action:"remove"};if(WC.has(i))return{action:"remove"};const a=Object.hasOwn(La,i)?La[i]:void 0;return a===void 0?{action:"unwrap"}:{action:"keep",attributes:Wi(i,o,a)}};typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(t,r){r=r||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,r.bubbles,r.cancelable,r.detail),i}));const sb=typeof document<"u"&&!!document.documentMode;let Fa;function ob(){return Fa||(Fa=document.createElement("div").style)}const Uh=["webkit","moz","ms"],qs={};function gl(e){if(qs[e])return qs[e];const t=ob();if(e in t)return qs[e]=e;const r=e[0].toUpperCase()+e.slice(1);let i=Uh.length;for(;i--;){const s=`${Uh[i]}${r}`;if(s in t)return qs[e]=s}}function zs(e,t){return parseFloat(t[gl(e)])||0}function js(e,t,r=window.getComputedStyle(e)){const i=t==="border"?"Width":"";return{left:zs(`${t}Left${i}`,r),right:zs(`${t}Right${i}`,r),top:zs(`${t}Top${i}`,r),bottom:zs(`${t}Bottom${i}`,r)}}function Jr(e,t,r){e.style[gl(t)]=r}function ab(e,t){const r=gl("transform");Jr(e,"transition",`${r} ${t.duration}ms ${t.easing}`)}function nb(e,{x:t,y:r,scale:i,isSVG:s},o){if(Jr(e,"transform",`scale(${i}) translate(${t}px, ${r}px)`),s&&sb){const a=window.getComputedStyle(e).getPropertyValue("transform");e.setAttribute("transform",a)}}function Aa(e){let t=e.parentNode;(!t||t.nodeType!==1)&&(t=document.documentElement);const r=window.getComputedStyle(e),i=window.getComputedStyle(t),s=e.getBoundingClientRect(),o=t.getBoundingClientRect();return{elem:{style:r,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,margin:js(e,"margin",r),border:js(e,"border",r)},parent:{style:i,width:o.width,height:o.height,top:o.top,bottom:o.bottom,left:o.left,right:o.right,padding:js(t,"padding",i),border:js(t,"border",i)}}}let ms={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?ms={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(ms={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function Ma(e,t,r,i){ms[e].split(" ").forEach(s=>{t.addEventListener(s,r,i)})}function $a(e,t,r){ms[e].split(" ").forEach(i=>{t.removeEventListener(i,r)})}function Id(e,t){let r=e.length;for(;r--;)if(e[r].pointerId===t.pointerId)return r;return-1}function sn(e,t){let r;if(t.touches){r=0;for(const i of t.touches)i.pointerId=r++,sn(e,i);return}r=Id(e,t),r>-1&&e.splice(r,1),e.push(t)}function lb(e,t){if(t.touches){for(;e.length;)e.pop();return}const r=Id(e,t);r>-1&&e.splice(r,1)}function Xh(e){e=e.slice(0);let t=e.pop(),r;for(;r=e.pop();)t={clientX:(r.clientX-t.clientX)/2+t.clientX,clientY:(r.clientY-t.clientY)/2+t.clientY};return t}function Oa(e){if(e.length<2)return 0;const t=e[0],r=e[1];return Math.sqrt(Math.pow(Math.abs(r.clientX-t.clientX),2)+Math.pow(Math.abs(r.clientY-t.clientY),2))}function hb(e){let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1}function cb(e){return(e.getAttribute("class")||"").trim()}function db(e,t){return e.nodeType===1&&` ${cb(e)} `.indexOf(` ${t} `)>-1}function ub(e,t){for(let r=e;r!=null;r=r.parentNode)if(db(r,t.excludeClass)||t.exclude.indexOf(r)>-1)return!0;return!1}const fb=/^http:[\w\.\/]+svg$/;function gb(e){return fb.test(e.namespaceURI)&&e.nodeName.toLowerCase()!=="svg"}function pb(e){const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}const Pd={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:e=>{e.preventDefault(),e.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:nb,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function Dd(e,t){if(!e)throw new Error("Panzoom requires an element as an argument");if(e.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!hb(e))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t={...Pd,...t};const r=gb(e),i=e.parentNode;i.style.overflow=t.overflow,i.style.userSelect="none",i.style.touchAction=t.touchAction,(t.canvas?i:e).style.cursor=t.cursor,e.style.userSelect="none",e.style.touchAction=t.touchAction,Jr(e,"transformOrigin",typeof t.origin=="string"?t.origin:r?"0 0":"50% 50%");function s(){i.style.overflow="",i.style.userSelect="",i.style.touchAction="",i.style.cursor="",e.style.cursor="",e.style.userSelect="",e.style.touchAction="",Jr(e,"transformOrigin","")}function o($={}){for(const N in $)$.hasOwnProperty(N)&&(t[N]=$[N]);($.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($,N,L){if(L.silent)return;const X=new CustomEvent($,{detail:N});e.dispatchEvent(X)}function d($,N,L){const X={x:a,y:n,scale:l,isSVG:r,originalEvent:L};return requestAnimationFrame(()=>{typeof N.animate=="boolean"&&(N.animate?ab(e,N):Jr(e,"transition","none")),N.setTransform(e,X,N),h($,X,N),h("panzoomchange",X,N)}),X}function f($,N,L,X){const Y={...t,...X},G={x:a,y:n,opts:Y};if(!X?.force&&(Y.disablePan||Y.panOnlyWhenZoomed&&l===Y.startScale))return G;if($=parseFloat($),N=parseFloat(N),Y.disableXAxis||(G.x=(Y.relative?a:0)+$),Y.disableYAxis||(G.y=(Y.relative?n:0)+N),Y.contain){const q=Aa(e),K=q.elem.width/l,Z=q.elem.height/l,et=K*L,dt=Z*L,ut=(et-K)/2,xt=(dt-Z)/2;if(Y.contain==="inside"){const Lt=(-q.elem.margin.left-q.parent.padding.left+ut)/L,It=(q.parent.width-et-q.parent.padding.left-q.elem.margin.left-q.parent.border.left-q.parent.border.right+ut)/L;G.x=Math.max(Math.min(G.x,It),Lt);const Mt=(-q.elem.margin.top-q.parent.padding.top+xt)/L,$t=(q.parent.height-dt-q.parent.padding.top-q.elem.margin.top-q.parent.border.top-q.parent.border.bottom+xt)/L;G.y=Math.max(Math.min(G.y,$t),Mt)}else if(Y.contain==="outside"){const Lt=(-(et-q.parent.width)-q.parent.padding.left-q.parent.border.left-q.parent.border.right+ut)/L,It=(ut-q.parent.padding.left)/L;G.x=Math.max(Math.min(G.x,It),Lt);const Mt=(-(dt-q.parent.height)-q.parent.padding.top-q.parent.border.top-q.parent.border.bottom+xt)/L,$t=(xt-q.parent.padding.top)/L;G.y=Math.max(Math.min(G.y,$t),Mt)}}return Y.roundPixels&&(G.x=Math.round(G.x),G.y=Math.round(G.y)),G}function u($,N){const L={...t,...N},X={scale:l,opts:L};if(!N?.force&&L.disableZoom)return X;let Y=t.minScale,G=t.maxScale;if(L.contain){const q=Aa(e),K=q.elem.width/l,Z=q.elem.height/l;if(K>1&&Z>1){const et=q.parent.width-q.parent.border.left-q.parent.border.right,dt=q.parent.height-q.parent.border.top-q.parent.border.bottom,ut=et/K,xt=dt/Z;t.contain==="inside"?G=Math.min(G,ut,xt):t.contain==="outside"&&(Y=Math.max(Y,ut,xt))}}return X.scale=Math.min(Math.max($,Y),G),X}function p($,N,L,X){const Y=f($,N,l,L);return a!==Y.x||n!==Y.y?(a=Y.x,n=Y.y,d("panzoompan",Y.opts,X)):{x:a,y:n,scale:l,isSVG:r,originalEvent:X}}function m($,N,L){const X=u($,N),Y=X.opts;if(!N?.force&&Y.disableZoom)return;$=X.scale;let G=a,q=n;if(Y.focal){const Z=Y.focal;G=(Z.x/$-Z.x/l+a*$)/$,q=(Z.y/$-Z.y/l+n*$)/$}const K=f(G,q,$,{relative:!1,force:!0});return a=K.x,n=K.y,l=$,d("panzoomzoom",Y,L)}function y($,N){const L={...t,animate:!0,...N};return m(l*Math.exp(($?1:-1)*L.step),L)}function x($){return y(!0,$)}function C($){return y(!1,$)}function k($,N,L,X){const Y=Aa(e),G={width:Y.parent.width-Y.parent.padding.left-Y.parent.padding.right-Y.parent.border.left-Y.parent.border.right,height:Y.parent.height-Y.parent.padding.top-Y.parent.padding.bottom-Y.parent.border.top-Y.parent.border.bottom};let q=N.clientX-Y.parent.left-Y.parent.padding.left-Y.parent.border.left-Y.elem.margin.left,K=N.clientY-Y.parent.top-Y.parent.padding.top-Y.parent.border.top-Y.elem.margin.top;r||(q-=Y.elem.width/l/2,K-=Y.elem.height/l/2);const Z={x:q/G.width*(G.width*$),y:K/G.height*(G.height*$)};return m($,{...L,animate:!1,focal:Z},X)}function v($,N){$.preventDefault();const L={...t,...N,animate:!1},Y=($.deltaY===0&&$.deltaX?$.deltaX:$.deltaY)<0?1:-1,G=u(l*Math.exp(Y*L.step/3),L).scale;return k(G,$,L,$)}function S($){const N={...t,animate:!0,force:!0,...$};l=u(N.startScale,N).scale;const L=f(N.startX,N.startY,l,N);return a=L.x,n=L.y,d("panzoomreset",N)}let T,B,_,P,O,D;const H=[];function U($){if(ub($.target,t))return;sn(H,$),c=!0,t.handleStartEvent($),T=a,B=n,h("panzoomstart",{x:a,y:n,scale:l,isSVG:r,originalEvent:$},t);const N=Xh(H);_=N.clientX,P=N.clientY,O=l,D=Oa(H)}function I($){if(!c||T===void 0||B===void 0||_===void 0||P===void 0)return;sn(H,$);const N=Xh(H),L=H.length>1;let X=l;if(L){D===0&&(D=Oa(H));const Y=Oa(H)-D;X=u(Y*t.step/80+O).scale,k(X,N,{animate:!1},$)}(!L||t.pinchAndPan)&&p(T+(N.clientX-_)/X,B+(N.clientY-P)/X,{animate:!1},$)}function M($){H.length===1&&h("panzoomend",{x:a,y:n,scale:l,isSVG:r,originalEvent:$},t),lb(H,$),c&&(c=!1,T=B=_=P=void 0)}let A=!1;function z(){A||(A=!0,Ma("down",t.canvas?i:e,U),Ma("move",document,I,{passive:!0}),Ma("up",document,M,{passive:!0}))}function R(){A=!1,$a("down",t.canvas?i:e,U),$a("move",document,I),$a("up",document,M)}return t.noBind||z(),{bind:z,destroy:R,eventNames:ms,getPan:()=>({x:a,y:n}),getScale:()=>l,getOptions:()=>pb(t),handleDown:U,handleMove:I,handleUp:M,pan:p,reset:S,resetStyle:s,setOptions:o,setStyle:($,N)=>Jr(e,$,N),zoom:m,zoomIn:x,zoomOut:C,zoomToPoint:k,zoomWithWheel:v}}Dd.defaultOptions=Pd;const mb=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],yb=Et("arrow-down",mb);const xb=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Cb=Et("arrow-left",xb);const bb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],kb=Et("arrow-right",bb);const wb=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Sb=Et("arrow-up",wb);const vb=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],on=Et("refresh-cw",vb);const Tb=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],_b=Et("settings-2",Tb);const Bb=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Nd=Et("zoom-in",Bb);const Lb=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],qd=Et("zoom-out",Lb);var zd=Object.defineProperty,g=(e,t)=>zd(e,"name",{value:t,configurable:!0}),jd=(e,t)=>{for(var r in t)zd(e,r,{get:t[r],enumerable:!0})},to={exports:{}},Eb=to.exports,Gh;function Fb(){return Gh||(Gh=1,(function(e,t){(function(r,i){e.exports=i()})(Eb,(function(){var r=1e3,i=6e4,s=36e5,o="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",f="quarter",u="year",p="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(I){var M=["th","st","nd","rd"],A=I%100;return"["+I+(M[(A-20)%10]||M[A]||M[0])+"]"}},k=function(I,M,A){var z=String(I);return!z||z.length>=M?I:""+Array(M+1-z.length).join(A)+I},v={s:k,z:function(I){var M=-I.utcOffset(),A=Math.abs(M),z=Math.floor(A/60),R=A%60;return(M<=0?"+":"-")+k(z,2,"0")+":"+k(R,2,"0")},m:function I(M,A){if(M.date()<A.date())return-I(A,M);var z=12*(A.year()-M.year())+(A.month()-M.month()),R=M.clone().add(z,d),$=A-R<0,N=M.clone().add(z+($?-1:1),d);return+(-(z+(A-R)/($?R-N:N-R))||0)},a:function(I){return I<0?Math.ceil(I)||0:Math.floor(I)},p:function(I){return{M:d,y:u,w:h,d:c,D:p,h:l,m:n,s:a,ms:o,Q:f}[I]||String(I||"").toLowerCase().replace(/s$/,"")},u:function(I){return I===void 0}},S="en",T={};T[S]=C;var B="$isDayjsObject",_=function(I){return I instanceof H||!(!I||!I[B])},P=function I(M,A,z){var R;if(!M)return S;if(typeof M=="string"){var $=M.toLowerCase();T[$]&&(R=$),A&&(T[$]=A,R=$);var N=M.split("-");if(!R&&N.length>1)return I(N[0])}else{var L=M.name;T[L]=M,R=L}return!z&&R&&(S=R),R||!z&&S},O=function(I,M){if(_(I))return I.clone();var A=typeof M=="object"?M:{};return A.date=I,A.args=arguments,new H(A)},D=v;D.l=P,D.i=_,D.w=function(I,M){return O(I,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var H=(function(){function I(A){this.$L=P(A.locale,null,!0),this.parse(A),this.$x=this.$x||A.x||{},this[B]=!0}var M=I.prototype;return M.parse=function(A){this.$d=(function(z){var R=z.date,$=z.utc;if(R===null)return new Date(NaN);if(D.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var N=R.match(y);if(N){var L=N[2]-1||0,X=(N[7]||"0").substring(0,3);return $?new Date(Date.UTC(N[1],L,N[3]||1,N[4]||0,N[5]||0,N[6]||0,X)):new Date(N[1],L,N[3]||1,N[4]||0,N[5]||0,N[6]||0,X)}}return new Date(R)})(A),this.init()},M.init=function(){var A=this.$d;this.$y=A.getFullYear(),this.$M=A.getMonth(),this.$D=A.getDate(),this.$W=A.getDay(),this.$H=A.getHours(),this.$m=A.getMinutes(),this.$s=A.getSeconds(),this.$ms=A.getMilliseconds()},M.$utils=function(){return D},M.isValid=function(){return this.$d.toString()!==m},M.isSame=function(A,z){var R=O(A);return this.startOf(z)<=R&&R<=this.endOf(z)},M.isAfter=function(A,z){return O(A)<this.startOf(z)},M.isBefore=function(A,z){return this.endOf(z)<O(A)},M.$g=function(A,z,R){return D.u(A)?this[z]:this.set(R,A)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(A,z){var R=this,$=!!D.u(z)||z,N=D.p(A),L=function(dt,ut){var xt=D.w(R.$u?Date.UTC(R.$y,ut,dt):new Date(R.$y,ut,dt),R);return $?xt:xt.endOf(c)},X=function(dt,ut){return D.w(R.toDate()[dt].apply(R.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(ut)),R)},Y=this.$W,G=this.$M,q=this.$D,K="set"+(this.$u?"UTC":"");switch(N){case u:return $?L(1,0):L(31,11);case d:return $?L(1,G):L(0,G+1);case h:var Z=this.$locale().weekStart||0,et=(Y<Z?Y+7:Y)-Z;return L($?q-et:q+(6-et),G);case c:case p:return X(K+"Hours",0);case l:return X(K+"Minutes",1);case n:return X(K+"Seconds",2);case a:return X(K+"Milliseconds",3);default:return this.clone()}},M.endOf=function(A){return this.startOf(A,!1)},M.$set=function(A,z){var R,$=D.p(A),N="set"+(this.$u?"UTC":""),L=(R={},R[c]=N+"Date",R[p]=N+"Date",R[d]=N+"Month",R[u]=N+"FullYear",R[l]=N+"Hours",R[n]=N+"Minutes",R[a]=N+"Seconds",R[o]=N+"Milliseconds",R)[$],X=$===c?this.$D+(z-this.$W):z;if($===d||$===u){var Y=this.clone().set(p,1);Y.$d[L](X),Y.init(),this.$d=Y.set(p,Math.min(this.$D,Y.daysInMonth())).$d}else L&&this.$d[L](X);return this.init(),this},M.set=function(A,z){return this.clone().$set(A,z)},M.get=function(A){return this[D.p(A)]()},M.add=function(A,z){var R,$=this;A=Number(A);var N=D.p(z),L=function(G){var q=O($);return D.w(q.date(q.date()+Math.round(G*A)),$)};if(N===d)return this.set(d,this.$M+A);if(N===u)return this.set(u,this.$y+A);if(N===c)return L(1);if(N===h)return L(7);var X=(R={},R[n]=i,R[l]=s,R[a]=r,R)[N]||1,Y=this.$d.getTime()+A*X;return D.w(Y,this)},M.subtract=function(A,z){return this.add(-1*A,z)},M.format=function(A){var z=this,R=this.$locale();if(!this.isValid())return R.invalidDate||m;var $=A||"YYYY-MM-DDTHH:mm:ssZ",N=D.z(this),L=this.$H,X=this.$m,Y=this.$M,G=R.weekdays,q=R.months,K=R.meridiem,Z=function(ut,xt,Lt,It){return ut&&(ut[xt]||ut(z,$))||Lt[xt].slice(0,It)},et=function(ut){return D.s(L%12||12,ut,"0")},dt=K||function(ut,xt,Lt){var It=ut<12?"AM":"PM";return Lt?It.toLowerCase():It};return $.replace(x,(function(ut,xt){return xt||(function(Lt){switch(Lt){case"YY":return String(z.$y).slice(-2);case"YYYY":return D.s(z.$y,4,"0");case"M":return Y+1;case"MM":return D.s(Y+1,2,"0");case"MMM":return Z(R.monthsShort,Y,q,3);case"MMMM":return Z(q,Y);case"D":return z.$D;case"DD":return D.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return Z(R.weekdaysMin,z.$W,G,2);case"ddd":return Z(R.weekdaysShort,z.$W,G,3);case"dddd":return G[z.$W];case"H":return String(L);case"HH":return D.s(L,2,"0");case"h":return et(1);case"hh":return et(2);case"a":return dt(L,X,!0);case"A":return dt(L,X,!1);case"m":return String(X);case"mm":return D.s(X,2,"0");case"s":return String(z.$s);case"ss":return D.s(z.$s,2,"0");case"SSS":return D.s(z.$ms,3,"0");case"Z":return N}return null})(ut)||N.replace(":","")}))},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(A,z,R){var $,N=this,L=D.p(z),X=O(A),Y=(X.utcOffset()-this.utcOffset())*i,G=this-X,q=function(){return D.m(N,X)};switch(L){case u:$=q()/12;break;case d:$=q();break;case f:$=q()/3;break;case h:$=(G-Y)/6048e5;break;case c:$=(G-Y)/864e5;break;case l:$=G/s;break;case n:$=G/i;break;case a:$=G/r;break;default:$=G}return R?$:D.a($)},M.daysInMonth=function(){return this.endOf(d).$D},M.$locale=function(){return T[this.$L]},M.locale=function(A,z){if(!A)return this.$L;var R=this.clone(),$=P(A,z,!0);return $&&(R.$L=$),R},M.clone=function(){return D.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},I})(),U=H.prototype;return O.prototype=U,[["$ms",o],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",u],["$D",p]].forEach((function(I){U[I[1]]=function(M){return this.$g(M,I[0],I[1])}})),O.extend=function(I,M){return I.$i||(I(M,H,O),I.$i=!0),O},O.locale=P,O.isDayjs=_,O.unix=function(I){return O(1e3*I)},O.en=T[S],O.Ls=T,O.p={},O}))})(to)),to.exports}var Ab=Fb();const Wd=Ad(Ab);var Qe={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},V={trace:g((...e)=>{},"trace"),debug:g((...e)=>{},"debug"),info:g((...e)=>{},"info"),warn:g((...e)=>{},"warn"),error:g((...e)=>{},"error"),fatal:g((...e)=>{},"fatal")},pl=g(function(e="fatal"){let t=Qe.fatal;typeof e=="string"?e.toLowerCase()in Qe&&(t=Qe[e]):typeof e=="number"&&(t=e),V.trace=()=>{},V.debug=()=>{},V.info=()=>{},V.warn=()=>{},V.error=()=>{},V.fatal=()=>{},t<=Qe.fatal&&(V.fatal=console.error?console.error.bind(console,Ce("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Ce("FATAL"))),t<=Qe.error&&(V.error=console.error?console.error.bind(console,Ce("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Ce("ERROR"))),t<=Qe.warn&&(V.warn=console.warn?console.warn.bind(console,Ce("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Ce("WARN"))),t<=Qe.info&&(V.info=console.info?console.info.bind(console,Ce("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Ce("INFO"))),t<=Qe.debug&&(V.debug=console.debug?console.debug.bind(console,Ce("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Ce("DEBUG"))),t<=Qe.trace&&(V.trace=console.debug?console.debug.bind(console,Ce("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Ce("TRACE")))},"setLogLevel"),Ce=g(e=>`%c${Wd().format("ss.SSS")} : ${e} : `,"format");const eo={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const s=r<.5?r*(1+t):r+t-r*t,o=2*r-s;switch(i){case"r":return eo.hue2rgb(o,s,e+1/3)*255;case"g":return eo.hue2rgb(o,s,e)*255;case"b":return eo.hue2rgb(o,s,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const s=Math.max(e,t,r),o=Math.min(e,t,r),a=(s+o)/2;if(i==="l")return a*100;if(s===o)return 0;const n=s-o,l=a>.5?n/(2-s-o):n/(s+o);if(i==="s")return l*100;switch(s){case e:return((t-r)/n+(t<r?6:0))*60;case t:return((r-e)/n+2)*60;case r:return((e-t)/n+4)*60;default:return-1}}},Mb={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},$b={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},ft={channel:eo,lang:Mb,unit:$b},cr={};for(let e=0;e<=255;e++)cr[e]=ft.unit.dec2hex(e);const Jt={ALL:0,RGB:1,HSL:2};class Ob{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 Rb{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new Ob}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Jt.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:s}=t;r===void 0&&(t.h=ft.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=ft.channel.rgb2hsl(t,"s")),s===void 0&&(t.l=ft.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:s}=t;r===void 0&&(t.r=ft.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=ft.channel.hsl2rgb(t,"g")),s===void 0&&(t.b=ft.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),ft.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),ft.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Jt.HSL)&&r!==void 0?r:(this._ensureHSL(),ft.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),ft.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),ft.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Jt.RGB)&&r!==void 0?r:(this._ensureRGB(),ft.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 Ko=new Rb({r:0,g:0,b:0,a:0},"transparent"),ri={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(ri.re);if(!t)return;const r=t[1],i=parseInt(r,16),s=r.length,o=s%4===0,a=s>4,n=a?1:17,l=a?8:4,c=o?0:-1,h=a?255:15;return Ko.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:o?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`#${cr[Math.round(t)]}${cr[Math.round(r)]}${cr[Math.round(i)]}${cr[Math.round(s*255)]}`:`#${cr[Math.round(t)]}${cr[Math.round(r)]}${cr[Math.round(i)]}`}},Lr={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(Lr.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return ft.channel.clamp.h(parseFloat(r)*.9);case"rad":return ft.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return ft.channel.clamp.h(parseFloat(r)*360)}}return ft.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Lr.re);if(!r)return;const[,i,s,o,a,n]=r;return Ko.set({h:Lr._hue2deg(i),s:ft.channel.clamp.s(parseFloat(s)),l:ft.channel.clamp.l(parseFloat(o)),a:a?ft.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:s}=e;return s<1?`hsla(${ft.lang.round(t)}, ${ft.lang.round(r)}%, ${ft.lang.round(i)}%, ${s})`:`hsl(${ft.lang.round(t)}, ${ft.lang.round(r)}%, ${ft.lang.round(i)}%)`}},ls={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=ls.colors[e];if(t)return ri.parse(t)},stringify:e=>{const t=ri.stringify(e);for(const r in ls.colors)if(ls.colors[r]===t)return r}},Ji={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(Ji.re);if(!r)return;const[,i,s,o,a,n,l,c,h]=r;return Ko.set({r:ft.channel.clamp.r(s?parseFloat(i)*2.55:parseFloat(i)),g:ft.channel.clamp.g(a?parseFloat(o)*2.55:parseFloat(o)),b:ft.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?ft.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:s}=e;return s<1?`rgba(${ft.lang.round(t)}, ${ft.lang.round(r)}, ${ft.lang.round(i)}, ${ft.lang.round(s)})`:`rgb(${ft.lang.round(t)}, ${ft.lang.round(r)}, ${ft.lang.round(i)})`}},Me={format:{keyword:ls,hex:ri,rgb:Ji,rgba:Ji,hsl:Lr,hsla:Lr},parse:e=>{if(typeof e!="string")return e;const t=ri.parse(e)||Ji.parse(e)||Lr.parse(e)||ls.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?Lr.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Ji.stringify(e):ri.stringify(e)},Hd=(e,t)=>{const r=Me.parse(e);for(const i in t)r[i]=ft.channel.clamp[i](t[i]);return Me.stringify(r)},ir=(e,t,r=0,i=1)=>{if(typeof e!="number")return Hd(e,{a:t});const s=Ko.set({r:ft.channel.clamp.r(e),g:ft.channel.clamp.g(t),b:ft.channel.clamp.b(r),a:ft.channel.clamp.a(i)});return Me.stringify(s)},Ib=e=>{const{r:t,g:r,b:i}=Me.parse(e),s=.2126*ft.channel.toLinear(t)+.7152*ft.channel.toLinear(r)+.0722*ft.channel.toLinear(i);return ft.lang.round(s)},Pb=e=>Ib(e)>=.5,ve=e=>!Pb(e),ml=(e,t,r)=>{const i=Me.parse(e),s=i[t],o=ft.channel.clamp[t](s+r);return s!==o&&(i[t]=o),Me.stringify(i)},j=(e,t)=>ml(e,"l",t),W=(e,t)=>ml(e,"l",-t),b=(e,t)=>{const r=Me.parse(e),i={};for(const s in t)t[s]&&(i[s]=r[s]+t[s]);return Hd(e,i)},Db=(e,t,r=50)=>{const{r:i,g:s,b:o,a}=Me.parse(e),{r:n,g:l,b:c,a:h}=Me.parse(t),d=r/100,f=d*2-1,u=a-h,m=((f*u===-1?f:(f+u)/(1+f*u))+1)/2,y=1-m,x=i*m+n*y,C=s*m+l*y,k=o*m+c*y,v=a*d+h*(1-d);return ir(x,C,k,v)},F=(e,t=100)=>{const r=Me.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Db(r,e,t)};var an=g((e,t,{depth:r=2,clobber:i=!1}={})=>{const s={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(o=>an(e,o,s)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(o=>{e.includes(o)||e.push(o)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(o=>{typeof t[o]=="object"&&t[o]!==null&&(e[o]===void 0||typeof e[o]=="object")?(e[o]===void 0&&(e[o]=Array.isArray(t[o])?[]:{}),e[o]=an(e[o],t[o],{depth:r-1,clobber:i})):(i||typeof e[o]!="object"&&typeof t[o]!="object")&&(e[o]=t[o])}),e)},"assignWithDepth"),qt=an,Ye="#ffffff",Ue="#f2f2f2",ct=g((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),oi,Nb=(oi=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||j(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||W(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||W(this.mainBkg,10)):(this.rowOdd=this.rowOdd||j(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||j(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||F(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ve(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(oi,"Theme"),oi),qb=g(e=>{const t=new Nb;return t.calculate(e),t},"getThemeVariables"),ai,zb=(ai=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(F("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=ir(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=W("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=W(this.sectionBkgColor,10),this.taskBorderColor=ir(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=ir(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||j(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||W(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=j(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=j(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=j(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=F(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||F(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||j(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??j(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ve(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=j(this.secondaryColor,20),this.git1=j(this.pie2||this.secondaryColor,20),this.git2=j(this.pie3||this.tertiaryColor,20),this.git3=j(this.pie4||b(this.primaryColor,{h:-30}),20),this.git4=j(this.pie5||b(this.primaryColor,{h:-60}),20),this.git5=j(this.pie6||b(this.primaryColor,{h:-90}),10),this.git6=j(this.pie7||b(this.primaryColor,{h:60}),10),this.git7=j(this.pie8||b(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||F(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||F(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||j("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||j("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||j("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||j("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||j(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||j(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||j(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||j(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ai,"Theme"),ai),jb=g(e=>{const t=new zb;return t.calculate(e),t},"getThemeVariables"),ni,Wb=(ni=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=b(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=ir(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||W(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||W(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=W(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||W(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||F(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||F(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||j(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||j(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||b(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||b(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ve(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||W(F(this.git0),25),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||F(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||F(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(Object.keys(this).forEach(i=>{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ni,"Theme"),ni),Yd=g(e=>{const t=new Wb;return t.calculate(e),t},"getThemeVariables"),li,Hb=(li=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=j("#cde498",10),this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.primaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=W(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||W(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||W(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=W(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||W(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||j(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||j(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-30}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ve(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||F(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||F(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(li,"Theme"),li),Yb=g(e=>{const t=new Hb;return t.calculate(e),t},"getThemeVariables"),hi,Ub=(hi=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=j(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.lineColor=F(this.background),this.textColor=F(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||j(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=j(this.contrast,55),this.border2=this.contrast,this.actorBorder=j(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||F(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||j(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||W(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=j(this.contrast,30),this.sectionBkgColor2=j(this.contrast,30),this.taskBorderColor=W(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=j(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=W(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ve(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=W(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||b(this.primaryColor,{h:-30}),this.git4=this.pie5||b(this.primaryColor,{h:-60}),this.git5=this.pie6||b(this.primaryColor,{h:-90}),this.git6=this.pie7||b(this.primaryColor,{h:60}),this.git7=this.pie8||b(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(hi,"Theme"),hi),Xb=g(e=>{const t=new Ub;return t.calculate(e),t},"getThemeVariables"),ci,Gb=(ci=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||j(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||b(t,{h:30}),this.cScale4=this.cScale4||b(t,{h:60}),this.cScale5=this.cScale5||b(t,{h:90}),this.cScale6=this.cScale6||b(t,{h:120}),this.cScale7=this.cScale7||b(t,{h:150}),this.cScale8=this.cScale8||b(t,{h:210,l:150}),this.cScale9=this.cScale9||b(t,{h:270}),this.cScale10=this.cScale10||b(t,{h:300}),this.cScale11=this.cScale11||b(t,{h:330}),this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=W(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=W(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||F(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||j(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||W(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ve(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ci,"Theme"),ci),Vb=g(e=>{const t=new Gb;return t.calculate(e),t},"getThemeVariables"),di,Zb=(di=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(F("#323D47"),10),this.border1="#ccc",this.border2=ir(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||j(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||F(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ve(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(di,"Theme"),di),Kb=g(e=>{const t=new Zb;return t.calculate(e),t},"getThemeVariables"),ui,Qb=(ui=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ct("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||j(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=this.mainBkg;if(this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=W(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=W(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||F(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||j(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||W(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ve(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(ui,"Theme"),ui),Jb=g(e=>{const t=new Qb;return t.calculate(e),t},"getThemeVariables"),fi,tk=(fi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(F("#323D47"),10),this.border1="#ccc",this.border2=ir(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||j(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=W(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||F(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ve(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(fi,"Theme"),fi),ek=g(e=>{const t=new tk;return t.calculate(e),t},"getThemeVariables"),gi,rk=(gi=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ct(this.primaryColor,this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||j(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||F(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||j(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||W(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||b(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ve(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(gi,"Theme"),gi),ik=g(e=>{const t=new rk;return t.calculate(e),t},"getThemeVariables"),pi,sk=(pi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=j(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=F(this.background),this.secondaryBorderColor=ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ct(this.tertiaryColor,this.darkMode),this.primaryTextColor=F(this.primaryColor),this.secondaryTextColor=F(this.secondaryColor),this.tertiaryTextColor=F(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=j(F("#323D47"),10),this.border1="#ccc",this.border2=ir(255,255,255,.25),this.arrowheadColor=F(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||b(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||b(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ct(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ct(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ct(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ct(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||F(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||F(this.tertiaryColor),this.lineColor=this.lineColor||F(this.background),this.arrowheadColor=this.arrowheadColor||F(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||W(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||F(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||j(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||F(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||j(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||W(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=W(this["cScale"+r],75);const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||ve(this.quadrant1Fill)?j(this.quadrant1Fill):W(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?W(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=j(this.git0,25),this.git1=j(this.git1,25),this.git2=j(this.git2,25),this.git3=j(this.git3,25),this.git4=j(this.git4,25),this.git5=j(this.git5,25),this.git6=j(this.git6,25),this.git7=j(this.git7,25)):(this.git0=W(this.git0,25),this.git1=W(this.git1,25),this.git2=W(this.git2,25),this.git3=W(this.git3,25),this.git4=W(this.git4,25),this.git5=W(this.git5,25),this.git6=W(this.git6,25),this.git7=W(this.git7,25)),this.gitInv0=this.gitInv0||F(this.git0),this.gitInv1=this.gitInv1||F(this.git1),this.gitInv2=this.gitInv2||F(this.git2),this.gitInv3=this.gitInv3||F(this.git3),this.gitInv4=this.gitInv4||F(this.git4),this.gitInv5=this.gitInv5||F(this.git5),this.gitInv6=this.gitInv6||F(this.git6),this.gitInv7=this.gitInv7||F(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ye,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ue}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},g(pi,"Theme"),pi),ok=g(e=>{const t=new sk;return t.calculate(e),t},"getThemeVariables"),sr={base:{getThemeVariables:qb},dark:{getThemeVariables:jb},default:{getThemeVariables:Yd},forest:{getThemeVariables:Yb},neutral:{getThemeVariables:Xb},neo:{getThemeVariables:Vb},"neo-dark":{getThemeVariables:Kb},redux:{getThemeVariables:Jb},"redux-dark":{getThemeVariables:ek},"redux-color":{getThemeVariables:ik},"redux-dark-color":{getThemeVariables:ok}},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},Ud={...Vt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:sr.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}},Xd=g((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Xd(e[i],"")]:[...r,t+i],[]),"keyify"),ak=new Set(Xd(Ud,"")),yl=Ud,nk={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},lk=g((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(V.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),mo=g(e=>{if(V.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>mo(t));return}for(const t of Object.keys(e)){if(V.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!ak.has(t)||e[t]==null){V.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=nk[t];i?lk(e[t],i):(V.debug("sanitizing object",t),mo(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(V.debug("sanitizing css option",t),e[t]=Gd(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}V.debug("After sanitization",e)}},"sanitizeDirective"),Gd=g(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),bi=Object.freeze(yl),Xe=g(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),ue=qt({},bi),yo,Rr=[],hs=qt({},bi),Qo=g((e,t)=>{let r=qt({},e),i={};for(const s of t)Kd(s),i=qt(i,s);if(r=qt(r,i),i.theme&&i.theme in sr){const s=qt({},yo),o=qt(s.themeVariables||{},i.themeVariables);r.theme&&r.theme in sr&&(r.themeVariables=sr[r.theme].getThemeVariables(o))}return hs=r,Jd(hs),hs},"updateCurrentConfig"),hk=g(e=>(ue=qt({},bi),ue=qt(ue,e),e.theme&&sr[e.theme]&&(ue.themeVariables=sr[e.theme].getThemeVariables(e.themeVariables)),Qo(ue,Rr),ue),"setSiteConfig"),ck=g(e=>{yo=qt({},e)},"saveConfigFromInitialize"),dk=g(e=>(ue=qt(ue,e),Qo(ue,Rr),ue),"updateSiteConfig"),Vd=g(()=>qt({},ue),"getSiteConfig"),Zd=g(e=>(Jd(e),qt(hs,e),At()),"setConfig"),At=g(()=>qt({},hs),"getConfig"),Kd=g(e=>{e&&(["secure",...ue.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(V.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&Kd(e[t])}))},"sanitize"),uk=g(e=>{mo(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Rr.push(e),Qo(ue,Rr)},"addDirective"),xo=g((e=ue)=>{Rr=[],Qo(e,Rr)},"reset"),fk={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},Vh={},Qd=g(e=>{Vh[e]||(V.warn(fk[e]),Vh[e]=!0)},"issueWarning"),Jd=g(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Qd("LAZY_LOAD_DEPRECATED")},"checkConfig"),gk=g(()=>{let e={};yo&&(e=qt(e,yo));for(const t of Rr)e=qt(e,t);return e},"getUserDefinedConfig"),ee=g(e=>(e.flowchart?.htmlLabels!=null&&Qd("FLOWCHART_HTML_LABELS_DEPRECATED"),Xe(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),tu=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,cs=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,pk=/\s*%%.*\n/gm,mi,eu=(mi=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},g(mi,"UnknownDiagramError"),mi),Ir={},xl=g(function(e,t){e=e.replace(tu,"").replace(cs,"").replace(pk,`
8
+ `);for(const[r,{detector:i}]of Object.entries(Ir))if(i(e,t))return r;throw new eu(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),nn=g((...e)=>{for(const{id:t,detector:r,loader:i}of e)ru(t,r,i)},"registerLazyLoadedDiagrams"),ru=g((e,t,r)=>{Ir[e]&&V.warn(`Detector with key ${e} already exists. Overwriting.`),Ir[e]={detector:t,loader:r},V.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),mk=g(e=>Ir[e].loader,"getDiagramLoader"),Fi=/<br\s*\/?>/gi,yk=g(e=>e?ou(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),xk=(()=>{let e=!1;return()=>{e||(iu(),e=!0)}})();function iu(){const e="data-temp-href-target";Ci.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),Ci.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}g(iu,"setupDompurifyHooks");var su=g(e=>(xk(),Ci.sanitize(e)),"removeScript"),Zh=g((e,t)=>{if(ee(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=su(e):r!=="loose"&&(e=ou(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=wk(e))}return e},"sanitizeMore"),we=g((e,t)=>e&&(t.dompurifyConfig?e=Ci.sanitize(Zh(e,t),t.dompurifyConfig).toString():e=Ci.sanitize(Zh(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),Ck=g((e,t)=>typeof e=="string"?we(e,t):e.flat().map(r=>we(r,t)),"sanitizeTextOrArray"),bk=g(e=>Fi.test(e),"hasBreaks"),kk=g(e=>e.split(Fi),"splitBreaks"),wk=g(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),ou=g(e=>e.replace(Fi,"#br#"),"breakToPlaceholder"),au=g(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),Sk=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),vk=g(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),ln=g(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let s=t[i];if(s===","&&i>0&&i+1<t.length){const o=t[i-1],a=t[i+1];Tk(o,a)&&(s=o+","+a,i++,r.pop())}r.push(_k(s))}return r.join("")},"parseGenericTypes"),hn=g((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),Tk=g((e,t)=>{const r=hn(e,"~"),i=hn(t,"~");return r===1&&i===1},"shouldCombineSets"),_k=g(e=>{const t=hn(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let s=i.indexOf("~"),o=i.lastIndexOf("~");for(;s!==-1&&o!==-1&&s!==o;)i[s]="<",i[o]=">",s=i.indexOf("~"),o=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),Kh=g(()=>window.MathMLElement!==void 0,"isMathMLSupported"),cn=/\$\$(.*?)\$\$/g,ki=g(e=>(e.match(cn)?.length??0)>0,"hasKatex"),Bk=g(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Cl(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const s={width:r.clientWidth,height:r.clientHeight};return r.remove(),s},"calculateMathMLDimensions"),Lk=g(async(e,t)=>{if(!ki(e))return e;if(!(Kh()||t.legacyMathML||t.forceLegacyMathML))return e.replace(cn,"MathML is unsupported in this environment.");{const{default:r}=await import("katex"),i=t.forceLegacyMathML||!Kh()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Fi).map(s=>ki(s)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${s}</div>`:`<div>${s}</div>`).join("").replace(cn,(s,o)=>r.renderToString(o,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Cl=g(async(e,t)=>we(await Lk(e,t),t),"renderKatexSanitized"),Ai={getRows:yk,sanitizeText:we,sanitizeTextOrArray:Ck,hasBreaks:bk,splitBreaks:kk,lineBreakRegex:Fi,removeScript:su,getUrl:au,evaluate:Xe,getMax:Sk,getMin:vk},Ek=g(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),Fk=g(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),bl=g(function(e,t,r,i){const s=Fk(t,r,i);Ek(e,s)},"configureSvgSize"),nu=g(function(e,t,r,i){const s=t.node().getBBox(),o=s.width,a=s.height;V.info(`SVG bounds: ${o}x${a}`,s);let n=0,l=0;V.info(`Graph bounds: ${n}x${l}`,e),n=o+r*2,l=a+r*2,V.info(`Calculated bounds: ${n}x${l}`),bl(t,l,n,i);const c=`${s.x-r} ${s.y-r} ${s.width+2*r} ${s.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),ro={};function dn(e){return[...e.cssRules].map(t=>t.cssText).join(`
9
+ `)}g(dn,"cssStyleSheetToString");var Ak=g((e,t,r,i)=>{let s="";return e in ro&&ro[e]?s=ro[e]({...r,svgId:i}):V.warn(`No theme found for ${e}`),` & {
10
+ font-family: ${r.fontFamily};
11
+ font-size: ${r.fontSize};
12
+ fill: ${r.textColor}
13
+ }
14
+ @keyframes edge-animation-frame {
15
+ from {
16
+ stroke-dashoffset: 0;
17
+ }
18
+ }
19
+ @keyframes dash {
20
+ to {
21
+ stroke-dashoffset: 0;
22
+ }
23
+ }
24
+ & .edge-animation-slow {
25
+ stroke-dasharray: 9,5 !important;
26
+ stroke-dashoffset: 900;
27
+ animation: dash 50s linear infinite;
28
+ stroke-linecap: round;
29
+ }
30
+ & .edge-animation-fast {
31
+ stroke-dasharray: 9,5 !important;
32
+ stroke-dashoffset: 900;
33
+ animation: dash 20s linear infinite;
34
+ stroke-linecap: round;
35
+ }
36
+ /* Classes common for multiple diagrams */
37
+
38
+ & .error-icon {
39
+ fill: ${r.errorBkgColor};
40
+ }
41
+ & .error-text {
42
+ fill: ${r.errorTextColor};
43
+ stroke: ${r.errorTextColor};
44
+ }
45
+
46
+ & .edge-thickness-normal {
47
+ stroke-width: ${r.strokeWidth??1}px;
48
+ }
49
+ & .edge-thickness-thick {
50
+ stroke-width: 3.5px
51
+ }
52
+ & .edge-pattern-solid {
53
+ stroke-dasharray: 0;
54
+ }
55
+ & .edge-thickness-invisible {
56
+ stroke-width: 0;
57
+ fill: none;
58
+ }
59
+ & .edge-pattern-dashed{
60
+ stroke-dasharray: 3;
61
+ }
62
+ .edge-pattern-dotted {
63
+ stroke-dasharray: 2;
64
+ }
65
+
66
+ & .marker {
67
+ fill: ${r.lineColor};
68
+ stroke: ${r.lineColor};
69
+ }
70
+ & .marker.cross {
71
+ stroke: ${r.lineColor};
72
+ }
73
+
74
+ & svg {
75
+ font-family: ${r.fontFamily};
76
+ font-size: ${r.fontSize};
77
+ }
78
+ & p {
79
+ margin: 0
80
+ }
81
+
82
+ ${s}
83
+ .node .neo-node {
84
+ stroke: ${r.nodeBorder};
85
+ }
86
+
87
+ [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
88
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
89
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
90
+ }
91
+ [data-look="neo"].swimlane.cluster rect {
92
+ filter: none;
93
+ }
94
+
95
+
96
+ [data-look="neo"].node path {
97
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
98
+ stroke-width: ${r.strokeWidth??1}px;
99
+ }
100
+
101
+ [data-look="neo"].node .outer-path {
102
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
103
+ }
104
+
105
+ [data-look="neo"].node .neo-line path {
106
+ stroke: ${r.nodeBorder};
107
+ filter: none;
108
+ }
109
+
110
+ [data-look="neo"].node circle{
111
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
112
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
113
+ }
114
+
115
+ [data-look="neo"].node circle .state-start{
116
+ fill: #000000;
117
+ }
118
+
119
+ [data-look="neo"].icon-shape .icon {
120
+ fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
121
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
122
+ }
123
+
124
+ [data-look="neo"].icon-shape .icon-neo path {
125
+ stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
126
+ filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
127
+ }
128
+
129
+ ${t}
130
+ `},"getStyles"),Mk=g((e,t)=>{t!==void 0&&(ro[e]=t)},"addStylesForDiagram"),$k=Ak,kl={};jd(kl,{clear:()=>lu,getAccDescription:()=>uu,getAccTitle:()=>cu,getDiagramTitle:()=>gu,setAccDescription:()=>du,setAccTitle:()=>hu,setDiagramTitle:()=>fu});var wl="",Sl="",vl="",Tl=g(e=>we(e,At()),"sanitizeText"),lu=g(()=>{wl="",vl="",Sl=""},"clear"),hu=g(e=>{wl=Tl(e).replace(/^\s+/g,"")},"setAccTitle"),cu=g(()=>wl,"getAccTitle"),du=g(e=>{vl=Tl(e).replace(/\n\s+/g,`
131
+ `)},"setAccDescription"),uu=g(()=>vl,"getAccDescription"),fu=g(e=>{Sl=Tl(e)},"setDiagramTitle"),gu=g(()=>Sl,"getDiagramTitle"),Qh=V,Ok=pl,wt=At,Rk=Zd,Ik=bi,_l=g(e=>we(e,wt()),"sanitizeText"),pu=nu,Pk=g(()=>kl,"getCommonDb"),Co={},bo=g((e,t,r)=>{Co[e]&&Qh.warn(`Diagram with id ${e} already registered. Overwriting.`),Co[e]=t,r&&ru(e,r),Mk(e,t.styles),t.injectUtils?.(Qh,Ok,wt,_l,pu,Pk(),()=>{})},"registerDiagram"),un=g(e=>{if(e in Co)return Co[e];throw new Dk(e)},"getDiagram"),yi,Dk=(yi=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},g(yi,"DiagramNotFoundError"),yi),Nk={value:()=>{}};function mu(){for(var e=0,t=arguments.length,r={},i;e<t;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new io(r)}function io(e){this._=e}function qk(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");if(s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}io.prototype=mu.prototype={constructor:io,on:function(e,t){var r=this._,i=qk(e+"",r),s,o=-1,a=i.length;if(arguments.length<2){for(;++o<a;)if((s=(e=i[o]).type)&&(s=zk(r[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(s=(e=i[o]).type)r[s]=Jh(r[s],e.name,t);else if(t==null)for(s in r)r[s]=Jh(r[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new io(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var r=new Array(s),i=0,s,o;i<s;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],i=0,s=o.length;i<s;++i)o[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],s=0,o=i.length;s<o;++s)i[s].value.apply(t,r)}};function zk(e,t){for(var r=0,i=e.length,s;r<i;++r)if((s=e[r]).name===t)return s.value}function Jh(e,t,r){for(var i=0,s=e.length;i<s;++i)if(e[i].name===t){e[i]=Nk,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var fn="http://www.w3.org/1999/xhtml";const tc={svg:"http://www.w3.org/2000/svg",xhtml:fn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jo(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),tc.hasOwnProperty(t)?{space:tc[t],local:e}:e}function jk(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===fn&&t.documentElement.namespaceURI===fn?t.createElement(e):t.createElementNS(r,e)}}function Wk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yu(e){var t=Jo(e);return(t.local?Wk:jk)(t)}function Hk(){}function Bl(e){return e==null?Hk:function(){return this.querySelector(e)}}function Yk(e){typeof e!="function"&&(e=Bl(e));for(var t=this._groups,r=t.length,i=new Array(r),s=0;s<r;++s)for(var o=t[s],a=o.length,n=i[s]=new Array(a),l,c,h=0;h<a;++h)(l=o[h])&&(c=e.call(l,l.__data__,h,o))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new xe(i,this._parents)}function Uk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Xk(){return[]}function xu(e){return e==null?Xk:function(){return this.querySelectorAll(e)}}function Gk(e){return function(){return Uk(e.apply(this,arguments))}}function Vk(e){typeof e=="function"?e=Gk(e):e=xu(e);for(var t=this._groups,r=t.length,i=[],s=[],o=0;o<r;++o)for(var a=t[o],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),s.push(l));return new xe(i,s)}function Cu(e){return function(){return this.matches(e)}}function bu(e){return function(t){return t.matches(e)}}var Zk=Array.prototype.find;function Kk(e){return function(){return Zk.call(this.children,e)}}function Qk(){return this.firstElementChild}function Jk(e){return this.select(e==null?Qk:Kk(typeof e=="function"?e:bu(e)))}var t1=Array.prototype.filter;function e1(){return Array.from(this.children)}function r1(e){return function(){return t1.call(this.children,e)}}function i1(e){return this.selectAll(e==null?e1:r1(typeof e=="function"?e:bu(e)))}function s1(e){typeof e!="function"&&(e=Cu(e));for(var t=this._groups,r=t.length,i=new Array(r),s=0;s<r;++s)for(var o=t[s],a=o.length,n=i[s]=[],l,c=0;c<a;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&n.push(l);return new xe(i,this._parents)}function ku(e){return new Array(e.length)}function o1(){return new xe(this._enter||this._groups.map(ku),this._parents)}function ko(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ko.prototype={constructor:ko,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function a1(e){return function(){return e}}function n1(e,t,r,i,s,o){for(var a=0,n,l=t.length,c=o.length;a<c;++a)(n=t[a])?(n.__data__=o[a],i[a]=n):r[a]=new ko(e,o[a]);for(;a<l;++a)(n=t[a])&&(s[a]=n)}function l1(e,t,r,i,s,o,a){var n,l,c=new Map,h=t.length,d=o.length,f=new Array(h),u;for(n=0;n<h;++n)(l=t[n])&&(f[n]=u=a.call(l,l.__data__,n,t)+"",c.has(u)?s[n]=l:c.set(u,l));for(n=0;n<d;++n)u=a.call(e,o[n],n,o)+"",(l=c.get(u))?(i[n]=l,l.__data__=o[n],c.delete(u)):r[n]=new ko(e,o[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(f[n])===l&&(s[n]=l)}function h1(e){return e.__data__}function c1(e,t){if(!arguments.length)return Array.from(this,h1);var r=t?l1:n1,i=this._parents,s=this._groups;typeof e!="function"&&(e=a1(e));for(var o=s.length,a=new Array(o),n=new Array(o),l=new Array(o),c=0;c<o;++c){var h=i[c],d=s[c],f=d.length,u=d1(e.call(h,h&&h.__data__,c,i)),p=u.length,m=n[c]=new Array(p),y=a[c]=new Array(p),x=l[c]=new Array(f);r(h,d,m,y,x,u,t);for(var C=0,k=0,v,S;C<p;++C)if(v=m[C]){for(C>=k&&(k=C+1);!(S=y[k])&&++k<p;);v._next=S||null}}return a=new xe(a,i),a._enter=n,a._exit=l,a}function d1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function u1(){return new xe(this._exit||this._groups.map(ku),this._parents)}function f1(e,t,r){var i=this.enter(),s=this,o=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),r==null?o.remove():r(o),i&&s?i.merge(s).order():s}function g1(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,s=r.length,o=i.length,a=Math.min(s,o),n=new Array(s),l=0;l<a;++l)for(var c=r[l],h=i[l],d=c.length,f=n[l]=new Array(d),u,p=0;p<d;++p)(u=c[p]||h[p])&&(f[p]=u);for(;l<s;++l)n[l]=r[l];return new xe(n,this._parents)}function p1(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],s=i.length-1,o=i[s],a;--s>=0;)(a=i[s])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function m1(e){e||(e=y1);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o){for(var a=r[o],n=a.length,l=s[o]=new Array(n),c,h=0;h<n;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new xe(s,this._parents).order()}function y1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function x1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function C1(){return Array.from(this)}function b1(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],s=0,o=i.length;s<o;++s){var a=i[s];if(a)return a}return null}function k1(){let e=0;for(const t of this)++e;return e}function w1(){return!this.node()}function S1(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],o=0,a=s.length,n;o<a;++o)(n=s[o])&&e.call(n,n.__data__,o,s);return this}function v1(e){return function(){this.removeAttribute(e)}}function T1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _1(e,t){return function(){this.setAttribute(e,t)}}function B1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function L1(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function E1(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function F1(e,t){var r=Jo(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?T1:v1:typeof t=="function"?r.local?E1:L1:r.local?B1:_1)(r,t))}function wu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function A1(e){return function(){this.style.removeProperty(e)}}function M1(e,t,r){return function(){this.style.setProperty(e,t,r)}}function $1(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function O1(e,t,r){return arguments.length>1?this.each((t==null?A1:typeof t=="function"?$1:M1)(e,t,r??"")):wi(this.node(),e)}function wi(e,t){return e.style.getPropertyValue(t)||wu(e).getComputedStyle(e,null).getPropertyValue(t)}function R1(e){return function(){delete this[e]}}function I1(e,t){return function(){this[e]=t}}function P1(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function D1(e,t){return arguments.length>1?this.each((t==null?R1:typeof t=="function"?P1:I1)(e,t)):this.node()[e]}function Su(e){return e.trim().split(/^|\s+/)}function Ll(e){return e.classList||new vu(e)}function vu(e){this._node=e,this._names=Su(e.getAttribute("class")||"")}vu.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Tu(e,t){for(var r=Ll(e),i=-1,s=t.length;++i<s;)r.add(t[i])}function _u(e,t){for(var r=Ll(e),i=-1,s=t.length;++i<s;)r.remove(t[i])}function N1(e){return function(){Tu(this,e)}}function q1(e){return function(){_u(this,e)}}function z1(e,t){return function(){(t.apply(this,arguments)?Tu:_u)(this,e)}}function j1(e,t){var r=Su(e+"");if(arguments.length<2){for(var i=Ll(this.node()),s=-1,o=r.length;++s<o;)if(!i.contains(r[s]))return!1;return!0}return this.each((typeof t=="function"?z1:t?N1:q1)(r,t))}function W1(){this.textContent=""}function H1(e){return function(){this.textContent=e}}function Y1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function U1(e){return arguments.length?this.each(e==null?W1:(typeof e=="function"?Y1:H1)(e)):this.node().textContent}function X1(){this.innerHTML=""}function G1(e){return function(){this.innerHTML=e}}function V1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Z1(e){return arguments.length?this.each(e==null?X1:(typeof e=="function"?V1:G1)(e)):this.node().innerHTML}function K1(){this.nextSibling&&this.parentNode.appendChild(this)}function Q1(){return this.each(K1)}function J1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function t2(){return this.each(J1)}function e2(e){var t=typeof e=="function"?e:yu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function r2(){return null}function i2(e,t){var r=typeof e=="function"?e:yu(e),i=t==null?r2:typeof t=="function"?t:Bl(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function s2(){var e=this.parentNode;e&&e.removeChild(this)}function o2(){return this.each(s2)}function a2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function n2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function l2(e){return this.select(e?n2:a2)}function h2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function c2(e){return function(t){e.call(this,t,this.__data__)}}function d2(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function u2(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,s=t.length,o;r<s;++r)o=t[r],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++i]=o;++i?t.length=i:delete this.__on}}}function f2(e,t,r){return function(){var i=this.__on,s,o=c2(t);if(i){for(var a=0,n=i.length;a<n;++a)if((s=i[a]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=r),s.value=t;return}}this.addEventListener(e.type,o,r),s={type:e.type,name:e.name,value:t,listener:o,options:r},i?i.push(s):this.__on=[s]}}function g2(e,t,r){var i=d2(e+""),s,o=i.length,a;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(s=0,h=n[l];s<o;++s)if((a=i[s]).type===h.type&&a.name===h.name)return h.value}return}for(n=t?f2:u2,s=0;s<o;++s)this.each(n(i[s],t,r));return this}function Bu(e,t,r){var i=wu(e),s=i.CustomEvent;typeof s=="function"?s=new s(t,r):(s=i.document.createEvent("Event"),r?(s.initEvent(t,r.bubbles,r.cancelable),s.detail=r.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function p2(e,t){return function(){return Bu(this,e,t)}}function m2(e,t){return function(){return Bu(this,e,t.apply(this,arguments))}}function y2(e,t){return this.each((typeof t=="function"?m2:p2)(e,t))}function*x2(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],s=0,o=i.length,a;s<o;++s)(a=i[s])&&(yield a)}var Lu=[null];function xe(e,t){this._groups=e,this._parents=t}function Fs(){return new xe([[document.documentElement]],Lu)}function C2(){return this}xe.prototype=Fs.prototype={constructor:xe,select:Yk,selectAll:Vk,selectChild:Jk,selectChildren:i1,filter:s1,data:c1,enter:o1,exit:u1,join:f1,merge:g1,selection:C2,order:p1,sort:m1,call:x1,nodes:C1,node:b1,size:k1,empty:w1,each:S1,attr:F1,style:O1,property:D1,classed:j1,text:U1,html:Z1,raise:Q1,lower:t2,append:e2,insert:i2,remove:o2,clone:l2,datum:h2,on:g2,dispatch:y2,[Symbol.iterator]:x2};function pt(e){return typeof e=="string"?new xe([[document.querySelector(e)]],[document.documentElement]):new xe([[e]],Lu)}function ta(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function El(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Mi(){}var ys=.7,wo=1/ys,ii="\\s*([+-]?\\d+)\\s*",xs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",b2=/^#([0-9a-f]{3,8})$/,k2=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),w2=new RegExp(`^rgb\\(${je},${je},${je}\\)$`),S2=new RegExp(`^rgba\\(${ii},${ii},${ii},${xs}\\)$`),v2=new RegExp(`^rgba\\(${je},${je},${je},${xs}\\)$`),T2=new RegExp(`^hsl\\(${xs},${je},${je}\\)$`),_2=new RegExp(`^hsla\\(${xs},${je},${je},${xs}\\)$`),ec={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ta(Mi,Si,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:rc,formatHex:rc,formatHex8:B2,formatHsl:L2,formatRgb:ic,toString:ic});function rc(){return this.rgb().formatHex()}function B2(){return this.rgb().formatHex8()}function L2(){return Fu(this).formatHsl()}function ic(){return this.rgb().formatRgb()}function Si(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=b2.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?sc(t):r===3?new le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Ws(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Ws(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=k2.exec(e))?new le(t[1],t[2],t[3],1):(t=w2.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=S2.exec(e))?Ws(t[1],t[2],t[3],t[4]):(t=v2.exec(e))?Ws(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=T2.exec(e))?nc(t[1],t[2]/100,t[3]/100,1):(t=_2.exec(e))?nc(t[1],t[2]/100,t[3]/100,t[4]):ec.hasOwnProperty(e)?sc(ec[e]):e==="transparent"?new le(NaN,NaN,NaN,0):null}function sc(e){return new le(e>>16&255,e>>8&255,e&255,1)}function Ws(e,t,r,i){return i<=0&&(e=t=r=NaN),new le(e,t,r,i)}function Eu(e){return e instanceof Mi||(e=Si(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function gn(e,t,r,i){return arguments.length===1?Eu(e):new le(e,t,r,i??1)}function le(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}ta(le,gn,El(Mi,{brighter(e){return e=e==null?wo:Math.pow(wo,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ys:Math.pow(ys,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new le(Mr(this.r),Mr(this.g),Mr(this.b),So(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oc,formatHex:oc,formatHex8:E2,formatRgb:ac,toString:ac}));function oc(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}`}function E2(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}${Er((isNaN(this.opacity)?1:this.opacity)*255)}`}function ac(){const e=So(this.opacity);return`${e===1?"rgb(":"rgba("}${Mr(this.r)}, ${Mr(this.g)}, ${Mr(this.b)}${e===1?")":`, ${e})`}`}function So(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Mr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Er(e){return e=Mr(e),(e<16?"0":"")+e.toString(16)}function nc(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ee(e,t,r,i)}function Fu(e){if(e instanceof Ee)return new Ee(e.h,e.s,e.l,e.opacity);if(e instanceof Mi||(e=Si(e)),!e)return new Ee;if(e instanceof Ee)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,s=Math.min(t,r,i),o=Math.max(t,r,i),a=NaN,n=o-s,l=(o+s)/2;return n?(t===o?a=(r-i)/n+(r<i)*6:r===o?a=(i-t)/n+2:a=(t-r)/n+4,n/=l<.5?o+s:2-o-s,a*=60):n=l>0&&l<1?0:a,new Ee(a,n,l,e.opacity)}function F2(e,t,r,i){return arguments.length===1?Fu(e):new Ee(e,t,r,i??1)}function Ee(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}ta(Ee,F2,El(Mi,{brighter(e){return e=e==null?wo:Math.pow(wo,e),new Ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ys:Math.pow(ys,e),new Ee(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,s=2*r-i;return new le(Ra(e>=240?e-240:e+120,s,i),Ra(e,s,i),Ra(e<120?e+240:e-120,s,i),this.opacity)},clamp(){return new Ee(lc(this.h),Hs(this.s),Hs(this.l),So(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=So(this.opacity);return`${e===1?"hsl(":"hsla("}${lc(this.h)}, ${Hs(this.s)*100}%, ${Hs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function lc(e){return e=(e||0)%360,e<0?e+360:e}function Hs(e){return Math.max(0,Math.min(1,e||0))}function Ra(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const ea=e=>()=>e;function Au(e,t){return function(r){return e+r*t}}function A2(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(i){return Math.pow(e+i*t,r)}}function M2(e,t){var r=t-e;return r?Au(e,r>180||r<-180?r-360*Math.round(r/360):r):ea(isNaN(e)?t:e)}function $2(e){return(e=+e)==1?Fl:function(t,r){return r-t?A2(t,r,e):ea(isNaN(t)?r:t)}}function Fl(e,t){var r=t-e;return r?Au(e,r):ea(isNaN(e)?t:e)}const pn=(function e(t){var r=$2(t);function i(s,o){var a=r((s=gn(s)).r,(o=gn(o)).r),n=r(s.g,o.g),l=r(s.b,o.b),c=Fl(s.opacity,o.opacity);return function(h){return s.r=a(h),s.g=n(h),s.b=l(h),s.opacity=c(h),s+""}}return i.gamma=e,i})(1);function rr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var mn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ia=new RegExp(mn.source,"g");function O2(e){return function(){return e}}function R2(e){return function(t){return e(t)+""}}function Mu(e,t){var r=mn.lastIndex=Ia.lastIndex=0,i,s,o,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=mn.exec(e))&&(s=Ia.exec(t));)(o=s.index)>r&&(o=t.slice(r,o),n[a]?n[a]+=o:n[++a]=o),(i=i[0])===(s=s[0])?n[a]?n[a]+=s:n[++a]=s:(n[++a]=null,l.push({i:a,x:rr(i,s)})),r=Ia.lastIndex;return r<t.length&&(o=t.slice(r),n[a]?n[a]+=o:n[++a]=o),n.length<2?l[0]?R2(l[0].x):O2(t):(t=l.length,function(c){for(var h=0,d;h<t;++h)n[(d=l[h]).i]=d.x(c);return n.join("")})}var hc=180/Math.PI,yn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $u(e,t,r,i,s,o){var a,n,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*r+t*i)&&(r-=e*l,i-=t*l),(n=Math.sqrt(r*r+i*i))&&(r/=n,i/=n,l/=n),e*i<t*r&&(e=-e,t=-t,l=-l,a=-a),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*hc,skewX:Math.atan(l)*hc,scaleX:a,scaleY:n}}var Ys;function I2(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?yn:$u(t.a,t.b,t.c,t.d,t.e,t.f)}function P2(e){return e==null||(Ys||(Ys=document.createElementNS("http://www.w3.org/2000/svg","g")),Ys.setAttribute("transform",e),!(e=Ys.transform.baseVal.consolidate()))?yn:(e=e.matrix,$u(e.a,e.b,e.c,e.d,e.e,e.f))}function Ou(e,t,r,i){function s(c){return c.length?c.pop()+" ":""}function o(c,h,d,f,u,p){if(c!==d||h!==f){var m=u.push("translate(",null,t,null,r);p.push({i:m-4,x:rr(c,d)},{i:m-2,x:rr(h,f)})}else(d||f)&&u.push("translate("+d+t+f+r)}function a(c,h,d,f){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(s(d)+"rotate(",null,i)-2,x:rr(c,h)})):h&&d.push(s(d)+"rotate("+h+i)}function n(c,h,d,f){c!==h?f.push({i:d.push(s(d)+"skewX(",null,i)-2,x:rr(c,h)}):h&&d.push(s(d)+"skewX("+h+i)}function l(c,h,d,f,u,p){if(c!==d||h!==f){var m=u.push(s(u)+"scale(",null,",",null,")");p.push({i:m-4,x:rr(c,d)},{i:m-2,x:rr(h,f)})}else(d!==1||f!==1)&&u.push(s(u)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),o(c.translateX,c.translateY,h.translateX,h.translateY,d,f),a(c.rotate,h.rotate,d,f),n(c.skewX,h.skewX,d,f),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(u){for(var p=-1,m=f.length,y;++p<m;)d[(y=f[p]).i]=y.x(u);return d.join("")}}}var D2=Ou(I2,"px, ","px)","deg)"),N2=Ou(P2,", ",")",")"),vi=0,ts=0,Hi=0,Ru=1e3,vo,es,To=0,Pr=0,ra=0,Cs=typeof performance=="object"&&performance.now?performance:Date,Iu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Al(){return Pr||(Iu(q2),Pr=Cs.now()+ra)}function q2(){Pr=0}function _o(){this._call=this._time=this._next=null}_o.prototype=Pu.prototype={constructor:_o,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Al():+r)+(t==null?0:+t),!this._next&&es!==this&&(es?es._next=this:vo=this,es=this),this._call=e,this._time=r,xn()},stop:function(){this._call&&(this._call=null,this._time=1/0,xn())}};function Pu(e,t,r){var i=new _o;return i.restart(e,t,r),i}function z2(){Al(),++vi;for(var e=vo,t;e;)(t=Pr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vi}function cc(){Pr=(To=Cs.now())+ra,vi=ts=0;try{z2()}finally{vi=0,W2(),Pr=0}}function j2(){var e=Cs.now(),t=e-To;t>Ru&&(ra-=t,To=e)}function W2(){for(var e,t=vo,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:vo=r);es=e,xn(i)}function xn(e){if(!vi){ts&&(ts=clearTimeout(ts));var t=e-Pr;t>24?(e<1/0&&(ts=setTimeout(cc,e-Cs.now()-ra)),Hi&&(Hi=clearInterval(Hi))):(Hi||(To=Cs.now(),Hi=setInterval(j2,Ru)),vi=1,Iu(cc))}}function dc(e,t,r){var i=new _o;return t=t==null?0:+t,i.restart(s=>{i.stop(),e(s+t)},t,r),i}var H2=mu("start","end","cancel","interrupt"),Y2=[],Du=0,uc=1,Cn=2,so=3,fc=4,bn=5,oo=6;function ia(e,t,r,i,s,o){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;U2(e,r,{name:t,index:i,group:s,on:H2,tween:Y2,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Du})}function Ml(e,t){var r=$e(e,t);if(r.state>Du)throw new Error("too late; already scheduled");return r}function Ge(e,t){var r=$e(e,t);if(r.state>so)throw new Error("too late; already running");return r}function $e(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function U2(e,t,r){var i=e.__transition,s;i[t]=r,r.timer=Pu(o,0,r.time);function o(c){r.state=uc,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var h,d,f,u;if(r.state!==uc)return l();for(h in i)if(u=i[h],u.name===r.name){if(u.state===so)return dc(a);u.state===fc?(u.state=oo,u.timer.stop(),u.on.call("interrupt",e,e.__data__,u.index,u.group),delete i[h]):+h<t&&(u.state=oo,u.timer.stop(),u.on.call("cancel",e,e.__data__,u.index,u.group),delete i[h])}if(dc(function(){r.state===so&&(r.state=fc,r.timer.restart(n,r.delay,r.time),n(c))}),r.state=Cn,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Cn){for(r.state=so,s=new Array(f=r.tween.length),h=0,d=-1;h<f;++h)(u=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(s[++d]=u);s.length=d+1}}function n(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=bn,1),d=-1,f=s.length;++d<f;)s[d].call(e,h);r.state===bn&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=oo,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function X2(e,t){var r=e.__transition,i,s,o=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((i=r[a]).name!==t){o=!1;continue}s=i.state>Cn&&i.state<bn,i.state=oo,i.timer.stop(),i.on.call(s?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}o&&delete e.__transition}}function G2(e){return this.each(function(){X2(this,e)})}function V2(e,t){var r,i;return function(){var s=Ge(this,e),o=s.tween;if(o!==r){i=r=o;for(var a=0,n=i.length;a<n;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}s.tween=i}}function Z2(e,t,r){var i,s;if(typeof r!="function")throw new Error;return function(){var o=Ge(this,e),a=o.tween;if(a!==i){s=(i=a).slice();for(var n={name:t,value:r},l=0,c=s.length;l<c;++l)if(s[l].name===t){s[l]=n;break}l===c&&s.push(n)}o.tween=s}}function K2(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=$e(this.node(),r).tween,s=0,o=i.length,a;s<o;++s)if((a=i[s]).name===e)return a.value;return null}return this.each((t==null?V2:Z2)(r,e,t))}function $l(e,t,r){var i=e._id;return e.each(function(){var s=Ge(this,i);(s.value||(s.value={}))[t]=r.apply(this,arguments)}),function(s){return $e(s,i).value[t]}}function Nu(e,t){var r;return(typeof t=="number"?rr:t instanceof Si?pn:(r=Si(t))?(t=r,pn):Mu)(e,t)}function Q2(e){return function(){this.removeAttribute(e)}}function J2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tw(e,t,r){var i,s=r+"",o;return function(){var a=this.getAttribute(e);return a===s?null:a===i?o:o=t(i=a,r)}}function ew(e,t,r){var i,s=r+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===s?null:a===i?o:o=t(i=a,r)}}function rw(e,t,r){var i,s,o;return function(){var a,n=r(this),l;return n==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=n+"",a===l?null:a===i&&l===s?o:(s=l,o=t(i=a,n)))}}function iw(e,t,r){var i,s,o;return function(){var a,n=r(this),l;return n==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=n+"",a===l?null:a===i&&l===s?o:(s=l,o=t(i=a,n)))}}function sw(e,t){var r=Jo(e),i=r==="transform"?N2:Nu;return this.attrTween(e,typeof t=="function"?(r.local?iw:rw)(r,i,$l(this,"attr."+e,t)):t==null?(r.local?J2:Q2)(r):(r.local?ew:tw)(r,i,t))}function ow(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function aw(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function nw(e,t){var r,i;function s(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&aw(e,o)),r}return s._value=t,s}function lw(e,t){var r,i;function s(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&ow(e,o)),r}return s._value=t,s}function hw(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var i=Jo(e);return this.tween(r,(i.local?nw:lw)(i,t))}function cw(e,t){return function(){Ml(this,e).delay=+t.apply(this,arguments)}}function dw(e,t){return t=+t,function(){Ml(this,e).delay=t}}function uw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cw:dw)(t,e)):$e(this.node(),t).delay}function fw(e,t){return function(){Ge(this,e).duration=+t.apply(this,arguments)}}function gw(e,t){return t=+t,function(){Ge(this,e).duration=t}}function pw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fw:gw)(t,e)):$e(this.node(),t).duration}function mw(e,t){if(typeof t!="function")throw new Error;return function(){Ge(this,e).ease=t}}function yw(e){var t=this._id;return arguments.length?this.each(mw(t,e)):$e(this.node(),t).ease}function xw(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ge(this,e).ease=r}}function Cw(e){if(typeof e!="function")throw new Error;return this.each(xw(this._id,e))}function bw(e){typeof e!="function"&&(e=Cu(e));for(var t=this._groups,r=t.length,i=new Array(r),s=0;s<r;++s)for(var o=t[s],a=o.length,n=i[s]=[],l,c=0;c<a;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&n.push(l);return new ar(i,this._parents,this._name,this._id)}function kw(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,s=r.length,o=Math.min(i,s),a=new Array(i),n=0;n<o;++n)for(var l=t[n],c=r[n],h=l.length,d=a[n]=new Array(h),f,u=0;u<h;++u)(f=l[u]||c[u])&&(d[u]=f);for(;n<i;++n)a[n]=t[n];return new ar(a,this._parents,this._name,this._id)}function ww(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function Sw(e,t,r){var i,s,o=ww(t)?Ml:Ge;return function(){var a=o(this,e),n=a.on;n!==i&&(s=(i=n).copy()).on(t,r),a.on=s}}function vw(e,t){var r=this._id;return arguments.length<2?$e(this.node(),r).on.on(e):this.each(Sw(r,e,t))}function Tw(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function _w(){return this.on("end.remove",Tw(this._id))}function Bw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Bl(e));for(var i=this._groups,s=i.length,o=new Array(s),a=0;a<s;++a)for(var n=i[a],l=n.length,c=o[a]=new Array(l),h,d,f=0;f<l;++f)(h=n[f])&&(d=e.call(h,h.__data__,f,n))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,ia(c[f],t,r,f,c,$e(h,r)));return new ar(o,this._parents,t,r)}function Lw(e){var t=this._name,r=this._id;typeof e!="function"&&(e=xu(e));for(var i=this._groups,s=i.length,o=[],a=[],n=0;n<s;++n)for(var l=i[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var f=e.call(h,h.__data__,d,l),u,p=$e(h,r),m=0,y=f.length;m<y;++m)(u=f[m])&&ia(u,t,r,m,f,p);o.push(f),a.push(h)}return new ar(o,a,t,r)}var Ew=Fs.prototype.constructor;function Fw(){return new Ew(this._groups,this._parents)}function Aw(e,t){var r,i,s;return function(){var o=wi(this,e),a=(this.style.removeProperty(e),wi(this,e));return o===a?null:o===r&&a===i?s:s=t(r=o,i=a)}}function qu(e){return function(){this.style.removeProperty(e)}}function Mw(e,t,r){var i,s=r+"",o;return function(){var a=wi(this,e);return a===s?null:a===i?o:o=t(i=a,r)}}function $w(e,t,r){var i,s,o;return function(){var a=wi(this,e),n=r(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),wi(this,e))),a===l?null:a===i&&l===s?o:(s=l,o=t(i=a,n))}}function Ow(e,t){var r,i,s,o="style."+t,a="end."+o,n;return function(){var l=Ge(this,e),c=l.on,h=l.value[o]==null?n||(n=qu(t)):void 0;(c!==r||s!==h)&&(i=(r=c).copy()).on(a,s=h),l.on=i}}function Rw(e,t,r){var i=(e+="")=="transform"?D2:Nu;return t==null?this.styleTween(e,Aw(e,i)).on("end.style."+e,qu(e)):typeof t=="function"?this.styleTween(e,$w(e,i,$l(this,"style."+e,t))).each(Ow(this._id,e)):this.styleTween(e,Mw(e,i,t),r).on("end.style."+e,null)}function Iw(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function Pw(e,t,r){var i,s;function o(){var a=t.apply(this,arguments);return a!==s&&(i=(s=a)&&Iw(e,a,r)),i}return o._value=t,o}function Dw(e,t,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,Pw(e,t,r??""))}function Nw(e){return function(){this.textContent=e}}function qw(e){return function(){var t=e(this);this.textContent=t??""}}function zw(e){return this.tween("text",typeof e=="function"?qw($l(this,"text",e)):Nw(e==null?"":e+""))}function jw(e){return function(t){this.textContent=e.call(this,t)}}function Ww(e){var t,r;function i(){var s=e.apply(this,arguments);return s!==r&&(t=(r=s)&&jw(s)),t}return i._value=e,i}function Hw(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Ww(e))}function Yw(){for(var e=this._name,t=this._id,r=zu(),i=this._groups,s=i.length,o=0;o<s;++o)for(var a=i[o],n=a.length,l,c=0;c<n;++c)if(l=a[c]){var h=$e(l,t);ia(l,e,r,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new ar(i,this._parents,e,r)}function Uw(){var e,t,r=this,i=r._id,s=r.size();return new Promise(function(o,a){var n={value:a},l={value:function(){--s===0&&o()}};r.each(function(){var c=Ge(this,i),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(n),t._.interrupt.push(n),t._.end.push(l)),c.on=t}),s===0&&o()})}var Xw=0;function ar(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function zu(){return++Xw}var Je=Fs.prototype;ar.prototype={constructor:ar,select:Bw,selectAll:Lw,selectChild:Je.selectChild,selectChildren:Je.selectChildren,filter:bw,merge:kw,selection:Fw,transition:Yw,call:Je.call,nodes:Je.nodes,node:Je.node,size:Je.size,empty:Je.empty,each:Je.each,on:vw,attr:sw,attrTween:hw,style:Rw,styleTween:Dw,text:zw,textTween:Hw,remove:_w,tween:K2,delay:uw,duration:pw,ease:yw,easeVarying:Cw,end:Uw,[Symbol.iterator]:Je[Symbol.iterator]};function Gw(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Vw={time:null,delay:0,duration:250,ease:Gw};function Zw(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Kw(e){var t,r;e instanceof ar?(t=e._id,e=e._name):(t=zu(),(r=Vw).time=Al(),e=e==null?null:e+"");for(var i=this._groups,s=i.length,o=0;o<s;++o)for(var a=i[o],n=a.length,l,c=0;c<n;++c)(l=a[c])&&ia(l,e,t,c,a,r||Zw(l,t));return new ar(i,this._parents,e,t)}Fs.prototype.interrupt=G2;Fs.prototype.transition=Kw;const kn=Math.PI,wn=2*kn,vr=1e-6,Qw=wn-vr;function ju(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Jw(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ju;const r=10**t;return function(i){this._+=i[0];for(let s=1,o=i.length;s<o;++s)this._+=Math.round(arguments[s]*r)/r+i[s]}}class tS{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ju:Jw(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,s){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+s}`}bezierCurveTo(t,r,i,s,o,a){this._append`C${+t},${+r},${+i},${+s},${this._x1=+o},${this._y1=+a}`}arcTo(t,r,i,s,o){if(t=+t,r=+r,i=+i,s=+s,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,n=this._y1,l=i-t,c=s-r,h=a-t,d=n-r,f=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(f>vr)if(!(Math.abs(d*l-c*h)>vr)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let u=i-a,p=s-n,m=l*l+c*c,y=u*u+p*p,x=Math.sqrt(m),C=Math.sqrt(f),k=o*Math.tan((kn-Math.acos((m+f-y)/(2*x*C)))/2),v=k/C,S=k/x;Math.abs(v-1)>vr&&this._append`L${t+v*h},${r+v*d}`,this._append`A${o},${o},0,0,${+(d*u>h*p)},${this._x1=t+S*l},${this._y1=r+S*c}`}}arc(t,r,i,s,o,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(s),l=i*Math.sin(s),c=t+n,h=r+l,d=1^a,f=a?s-o:o-s;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>vr||Math.abs(this._y1-h)>vr)&&this._append`L${c},${h}`,i&&(f<0&&(f=f%wn+wn),f>Qw?this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:f>vr&&this._append`A${i},${i},0,${+(f>=kn)},${d},${this._x1=t+i*Math.cos(o)},${this._y1=r+i*Math.sin(o)}`)}rect(t,r,i,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+s}h${-i}Z`}toString(){return this._}}function Tr(e){return function(){return e}}const eS=Math.abs,rS=Math.atan2,iS=Math.cos,sS=Math.max,oS=Math.min,aS=Math.sin,nS=Math.sqrt,Sn=1e-12,sa=Math.PI,vn=sa/2,lS=2*sa;function hS(e){return e>1?0:e<-1?sa:Math.acos(e)}function cS(e){return e>=1?vn:e<=-1?-vn:Math.asin(e)}function Wu(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new tS(t)}function Hu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Yu(e){this._context=e}Yu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ds(e){return new Yu(e)}function dS(e){return e[0]}function uS(e){return e[1]}function Uu(e,t){var r=Tr(!0),i=null,s=ds,o=null,a=Wu(n);e=typeof e=="function"?e:e===void 0?dS:Tr(e),t=typeof t=="function"?t:t===void 0?uS:Tr(t);function n(l){var c,h=(l=Hu(l)).length,d,f=!1,u;for(i==null&&(o=s(u=a())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(d,c,l),+t(d,c,l));if(u)return o=null,u+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:Tr(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:Tr(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Tr(!!l),n):r},n.curve=function(l){return arguments.length?(s=l,i!=null&&(o=s(i)),n):s},n.context=function(l){return arguments.length?(l==null?i=o=null:o=s(i=l),n):i},n}class Xu{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Gu(e){return new Xu(e,!0)}function Vu(e){return new Xu(e,!1)}function pr(){}function Bo(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 oa(e){this._context=e}oa.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:Bo(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:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Lo(e){return new oa(e)}function Zu(e){this._context=e}Zu.prototype={areaStart:pr,areaEnd:pr,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:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fS(e){return new Zu(e)}function Ku(e){this._context=e}Ku.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:Bo(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gS(e){return new Ku(e)}function Qu(e,t){this._basis=new oa(e),this._beta=t}Qu.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],s=t[0],o=e[r]-i,a=t[r]-s,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*o),this._beta*t[n]+(1-this._beta)*(s+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const pS=(function e(t){function r(i){return t===1?new oa(i):new Qu(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function Eo(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Ol(e,t){this._context=e,this._k=(1-t)/6}Ol.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Eo(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:Eo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Ju=(function e(t){function r(i){return new Ol(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Rl(e,t){this._context=e,this._k=(1-t)/6}Rl.prototype={areaStart:pr,areaEnd:pr,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:Eo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const mS=(function e(t){function r(i){return new Rl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Il(e,t){this._context=e,this._k=(1-t)/6}Il.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Eo(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const yS=(function e(t){function r(i){return new Il(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Pl(e,t,r){var i=e._x1,s=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Sn){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,s=(s*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Sn){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,s,o,a,e._x2,e._y2)}function tf(e,t){this._context=e,this._alpha=t}tf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Pl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ef=(function e(t){function r(i){return t?new tf(i,t):new Ol(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function rf(e,t){this._context=e,this._alpha=t}rf.prototype={areaStart:pr,areaEnd:pr,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Pl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const xS=(function e(t){function r(i){return t?new rf(i,t):new Rl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function sf(e,t){this._context=e,this._alpha=t}sf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Pl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const CS=(function e(t){function r(i){return t?new sf(i,t):new Il(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function of(e){this._context=e}of.prototype={areaStart:pr,areaEnd:pr,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function bS(e){return new of(e)}function gc(e){return e<0?-1:1}function pc(e,t,r){var i=e._x1-e._x0,s=t-e._x1,o=(e._y1-e._y0)/(i||s<0&&-0),a=(r-e._y1)/(s||i<0&&-0),n=(o*s+a*i)/(i+s);return(gc(o)+gc(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(n))||0}function mc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Pa(e,t,r){var i=e._x0,s=e._y0,o=e._x1,a=e._y1,n=(o-i)/3;e._context.bezierCurveTo(i+n,s+n*t,o-n,a-n*r,o,a)}function Fo(e){this._context=e}Fo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Pa(this,this._t0,mc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Pa(this,mc(this,r=pc(this,e,t)),r);break;default:Pa(this,this._t0,r=pc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function af(e){this._context=new nf(e)}(af.prototype=Object.create(Fo.prototype)).point=function(e,t){Fo.prototype.point.call(this,t,e)};function nf(e){this._context=e}nf.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,s,o){this._context.bezierCurveTo(t,e,i,r,o,s)}};function lf(e){return new Fo(e)}function hf(e){return new af(e)}function cf(e){this._context=e}cf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=yc(e),s=yc(t),o=0,a=1;a<r;++o,++a)this._context.bezierCurveTo(i[0][o],s[0][o],i[1][o],s[1][o],e[a],t[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function yc(e){var t,r=e.length-1,i,s=new Array(r),o=new Array(r),a=new Array(r);for(s[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=s[t]/o[t-1],o[t]-=i,a[t]-=i*a[t-1];for(s[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)s[t]=(a[t]-s[t+1])/o[t];for(o[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-s[t+1];return[s,o]}function df(e){return new cf(e)}function aa(e,t){this._context=e,this._t=t}aa.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function uf(e){return new aa(e,.5)}function ff(e){return new aa(e,0)}function gf(e){return new aa(e,1)}function rs(e,t,r){this.k=e,this.x=t,this.y=r}rs.prototype={constructor:rs,scale:function(e){return e===1?this:new rs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new rs(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+")"}};rs.prototype;var pf=g(e=>{const{securityLevel:t}=wt();let r=pt("body");if(t==="sandbox"){const o=pt(`#i${e}`).node()?.contentDocument??document;r=pt(o.body)}return r.select(`#${e}`)},"selectSvgElement");function Dl(e){return typeof e>"u"||e===null}g(Dl,"isNothing");function mf(e){return typeof e=="object"&&e!==null}g(mf,"isObject");function yf(e){return Array.isArray(e)?e:Dl(e)?[]:[e]}g(yf,"toArray");function xf(e,t){var r,i,s,o;if(t)for(o=Object.keys(t),r=0,i=o.length;r<i;r+=1)s=o[r],e[s]=t[s];return e}g(xf,"extend");function Cf(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}g(Cf,"repeat");function bf(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}g(bf,"isNegativeZero");var kS=Dl,wS=mf,SS=yf,vS=Cf,TS=bf,_S=xf,Ht={isNothing:kS,isObject:wS,toArray:SS,repeat:vS,isNegativeZero:TS,extend:_S};function Nl(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
132
+
133
+ `+e.mark.snippet),i+" "+r):i}g(Nl,"formatError");function Ti(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Nl(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}g(Ti,"YAMLException$1");Ti.prototype=Object.create(Error.prototype);Ti.prototype.constructor=Ti;Ti.prototype.toString=g(function(t){return this.name+": "+Nl(this,t)},"toString");var fe=Ti;function ao(e,t,r,i,s){var o="",a="",n=Math.floor(s/2)-1;return i-t>n&&(o=" ... ",t=i-n+o.length),r-i>n&&(a=" ...",r=i+n-a.length),{str:o+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+o.length}}g(ao,"getLine");function no(e,t){return Ht.repeat(" ",t-e.length)+e}g(no,"padStart");function kf(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],s=[],o,a=-1;o=r.exec(e.buffer);)s.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var n="",l,c,h=Math.min(e.line+t.linesAfter,s.length).toString().length,d=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)c=ao(e.buffer,i[a-l],s[a-l],e.position-(i[a]-i[a-l]),d),n=Ht.repeat(" ",t.indent)+no((e.line-l+1).toString(),h)+" | "+c.str+`
134
+ `+n;for(c=ao(e.buffer,i[a],s[a],e.position,d),n+=Ht.repeat(" ",t.indent)+no((e.line+1).toString(),h)+" | "+c.str+`
135
+ `,n+=Ht.repeat("-",t.indent+h+3+c.pos)+`^
136
+ `,l=1;l<=t.linesAfter&&!(a+l>=s.length);l++)c=ao(e.buffer,i[a+l],s[a+l],e.position-(i[a]-i[a+l]),d),n+=Ht.repeat(" ",t.indent)+no((e.line+l+1).toString(),h)+" | "+c.str+`
137
+ `;return n.replace(/\n$/,"")}g(kf,"makeSnippet");var BS=kf,LS=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ES=["scalar","sequence","mapping"];function wf(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}g(wf,"compileStyleAliases");function Sf(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(LS.indexOf(r)===-1)throw new fe('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=wf(t.styleAliases||null),ES.indexOf(this.kind)===-1)throw new fe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}g(Sf,"Type$1");var te=Sf;function Tn(e,t){var r=[];return e[t].forEach(function(i){var s=r.length;r.forEach(function(o,a){o.tag===i.tag&&o.kind===i.kind&&o.multi===i.multi&&(s=a)}),r[s]=i}),r}g(Tn,"compileList");function vf(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(s){s.multi?(e.multi[s.kind].push(s),e.multi.fallback.push(s)):e[s.kind][s.tag]=e.fallback[s.tag]=s}for(g(i,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}g(vf,"compileMap");function Ao(e){return this.extend(e)}g(Ao,"Schema$1");Ao.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 fe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(o){if(!(o instanceof te))throw new fe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new fe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new fe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(o){if(!(o instanceof te))throw new fe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var s=Object.create(Ao.prototype);return s.implicit=(this.implicit||[]).concat(r),s.explicit=(this.explicit||[]).concat(i),s.compiledImplicit=Tn(s,"implicit"),s.compiledExplicit=Tn(s,"explicit"),s.compiledTypeMap=vf(s.compiledImplicit,s.compiledExplicit),s},"extend");var FS=Ao,AS=new te("tag:yaml.org,2002:str",{kind:"scalar",construct:g(function(e){return e!==null?e:""},"construct")}),MS=new te("tag:yaml.org,2002:seq",{kind:"sequence",construct:g(function(e){return e!==null?e:[]},"construct")}),$S=new te("tag:yaml.org,2002:map",{kind:"mapping",construct:g(function(e){return e!==null?e:{}},"construct")}),OS=new FS({explicit:[AS,MS,$S]});function Tf(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}g(Tf,"resolveYamlNull");function _f(){return null}g(_f,"constructYamlNull");function Bf(e){return e===null}g(Bf,"isNull");var RS=new te("tag:yaml.org,2002:null",{kind:"scalar",resolve:Tf,construct:_f,predicate:Bf,represent:{canonical:g(function(){return"~"},"canonical"),lowercase:g(function(){return"null"},"lowercase"),uppercase:g(function(){return"NULL"},"uppercase"),camelcase:g(function(){return"Null"},"camelcase"),empty:g(function(){return""},"empty")},defaultStyle:"lowercase"});function Lf(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}g(Lf,"resolveYamlBoolean");function Ef(e){return e==="true"||e==="True"||e==="TRUE"}g(Ef,"constructYamlBoolean");function Ff(e){return Object.prototype.toString.call(e)==="[object Boolean]"}g(Ff,"isBoolean");var IS=new te("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Lf,construct:Ef,predicate:Ff,represent:{lowercase:g(function(e){return e?"true":"false"},"lowercase"),uppercase:g(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:g(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function Af(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}g(Af,"isHexCode");function Mf(e){return 48<=e&&e<=55}g(Mf,"isOctCode");function $f(e){return 48<=e&&e<=57}g($f,"isDecCode");function Of(e){if(e===null)return!1;var t=e.length,r=0,i=!1,s;if(!t)return!1;if(s=e[r],(s==="-"||s==="+")&&(s=e[++r]),s==="0"){if(r+1===t)return!0;if(s=e[++r],s==="b"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(s!=="0"&&s!=="1")return!1;i=!0}return i&&s!=="_"}if(s==="x"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!Af(e.charCodeAt(r)))return!1;i=!0}return i&&s!=="_"}if(s==="o"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!Mf(e.charCodeAt(r)))return!1;i=!0}return i&&s!=="_"}}if(s==="_")return!1;for(;r<t;r++)if(s=e[r],s!=="_"){if(!$f(e.charCodeAt(r)))return!1;i=!0}return!(!i||s==="_")}g(Of,"resolveYamlInteger");function Rf(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}g(Rf,"constructYamlInteger");function If(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ht.isNegativeZero(e)}g(If,"isInteger");var PS=new te("tag:yaml.org,2002:int",{kind:"scalar",resolve:Of,construct:Rf,predicate:If,represent:{binary:g(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:g(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:g(function(e){return e.toString(10)},"decimal"),hexadecimal:g(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),DS=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Pf(e){return!(e===null||!DS.test(e)||e[e.length-1]==="_")}g(Pf,"resolveYamlFloat");function Df(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}g(Df,"constructYamlFloat");var NS=/^[-+]?[0-9]+e/;function Nf(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ht.isNegativeZero(e))return"-0.0";return r=e.toString(10),NS.test(r)?r.replace("e",".e"):r}g(Nf,"representYamlFloat");function qf(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ht.isNegativeZero(e))}g(qf,"isFloat");var qS=new te("tag:yaml.org,2002:float",{kind:"scalar",resolve:Pf,construct:Df,predicate:qf,represent:Nf,defaultStyle:"lowercase"}),zf=OS.extend({implicit:[RS,IS,PS,qS]}),zS=zf,jf=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Wf=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Hf(e){return e===null?!1:jf.exec(e)!==null||Wf.exec(e)!==null}g(Hf,"resolveYamlTimestamp");function Yf(e){var t,r,i,s,o,a,n,l=0,c=null,h,d,f;if(t=jf.exec(e),t===null&&(t=Wf.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(r,i,s));if(o=+t[4],a=+t[5],n=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=+t[10],d=+(t[11]||0),c=(h*60+d)*6e4,t[9]==="-"&&(c=-c)),f=new Date(Date.UTC(r,i,s,o,a,n,l)),c&&f.setTime(f.getTime()-c),f}g(Yf,"constructYamlTimestamp");function Uf(e){return e.toISOString()}g(Uf,"representYamlTimestamp");var jS=new te("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Hf,construct:Yf,instanceOf:Date,represent:Uf});function Xf(e){return e==="<<"||e===null}g(Xf,"resolveYamlMerge");var WS=new te("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Xf}),ql=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
138
+ \r`;function Gf(e){if(e===null)return!1;var t,r,i=0,s=e.length,o=ql;for(r=0;r<s;r++)if(t=o.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}g(Gf,"resolveYamlBinary");function Vf(e){var t,r,i=e.replace(/[\r\n=]/g,""),s=i.length,o=ql,a=0,n=[];for(t=0;t<s;t++)t%4===0&&t&&(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)),a=a<<6|o.indexOf(i.charAt(t));return r=s%4*6,r===0?(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)):r===18?(n.push(a>>10&255),n.push(a>>2&255)):r===12&&n.push(a>>4&255),new Uint8Array(n)}g(Vf,"constructYamlBinary");function Zf(e){var t="",r=0,i,s,o=e.length,a=ql;for(i=0;i<o;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return s=o%3,s===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):s===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):s===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}g(Zf,"representYamlBinary");function Kf(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}g(Kf,"isBinary");var HS=new te("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Gf,construct:Vf,predicate:Kf,represent:Zf}),YS=Object.prototype.hasOwnProperty,US=Object.prototype.toString;function Qf(e){if(e===null)return!0;var t=[],r,i,s,o,a,n=e;for(r=0,i=n.length;r<i;r+=1){if(s=n[r],a=!1,US.call(s)!=="[object Object]")return!1;for(o in s)if(YS.call(s,o))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}g(Qf,"resolveYamlOmap");function Jf(e){return e!==null?e:[]}g(Jf,"constructYamlOmap");var XS=new te("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Qf,construct:Jf}),GS=Object.prototype.toString;function tg(e){if(e===null)return!0;var t,r,i,s,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],GS.call(i)!=="[object Object]"||(s=Object.keys(i),s.length!==1))return!1;o[t]=[s[0],i[s[0]]]}return!0}g(tg,"resolveYamlPairs");function eg(e){if(e===null)return[];var t,r,i,s,o,a=e;for(o=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],s=Object.keys(i),o[t]=[s[0],i[s[0]]];return o}g(eg,"constructYamlPairs");var VS=new te("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:tg,construct:eg}),ZS=Object.prototype.hasOwnProperty;function rg(e){if(e===null)return!0;var t,r=e;for(t in r)if(ZS.call(r,t)&&r[t]!==null)return!1;return!0}g(rg,"resolveYamlSet");function ig(e){return e!==null?e:{}}g(ig,"constructYamlSet");var KS=new te("tag:yaml.org,2002:set",{kind:"mapping",resolve:rg,construct:ig}),sg=zS.extend({implicit:[jS,WS],explicit:[HS,XS,VS,KS]}),mr=Object.prototype.hasOwnProperty,Mo=1,og=2,ag=3,$o=4,Da=1,QS=2,xc=3,JS=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,tv=/[\x85\u2028\u2029]/,ev=/[,\[\]\{\}]/,ng=/^(?:!|!!|![a-z\-]+!)$/i,lg=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _n(e){return Object.prototype.toString.call(e)}g(_n,"_class");function Fe(e){return e===10||e===13}g(Fe,"is_EOL");function gr(e){return e===9||e===32}g(gr,"is_WHITE_SPACE");function he(e){return e===9||e===32||e===10||e===13}g(he,"is_WS_OR_EOL");function Fr(e){return e===44||e===91||e===93||e===123||e===125}g(Fr,"is_FLOW_INDICATOR");function hg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}g(hg,"fromHexCode");function cg(e){return e===120?2:e===117?4:e===85?8:0}g(cg,"escapedHexLen");function dg(e){return 48<=e&&e<=57?e-48:-1}g(dg,"fromDecimalCode");function Bn(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
139
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}g(Bn,"simpleEscapeSequence");function ug(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}g(ug,"charFromCodepoint");function zl(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}g(zl,"setProperty");var fg=new Array(256),gg=new Array(256);for(kr=0;kr<256;kr++)fg[kr]=Bn(kr)?1:0,gg[kr]=Bn(kr);var kr;function pg(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||sg,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}g(pg,"State$1");function jl(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=BS(r),new fe(t,r)}g(jl,"generateError");function at(e,t){throw jl(e,t)}g(at,"throwError");function bs(e,t){e.onWarning&&e.onWarning.call(null,jl(e,t))}g(bs,"throwWarning");var Cc={YAML:g(function(t,r,i){var s,o,a;t.version!==null&&at(t,"duplication of %YAML directive"),i.length!==1&&at(t,"YAML directive accepts exactly one argument"),s=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),s===null&&at(t,"ill-formed argument of the YAML directive"),o=parseInt(s[1],10),a=parseInt(s[2],10),o!==1&&at(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&bs(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:g(function(t,r,i){var s,o;i.length!==2&&at(t,"TAG directive accepts exactly two arguments"),s=i[0],o=i[1],ng.test(s)||at(t,"ill-formed tag handle (first argument) of the TAG directive"),mr.call(t.tagMap,s)&&at(t,'there is a previously declared suffix for "'+s+'" tag handle'),lg.test(o)||at(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{at(t,"tag prefix is malformed: "+o)}t.tagMap[s]=o},"handleTagDirective")};function or(e,t,r,i){var s,o,a,n;if(t<r){if(n=e.input.slice(t,r),i)for(s=0,o=n.length;s<o;s+=1)a=n.charCodeAt(s),a===9||32<=a&&a<=1114111||at(e,"expected valid JSON character");else JS.test(n)&&at(e,"the stream contains non-printable characters");e.result+=n}}g(or,"captureSegment");function Ln(e,t,r,i){var s,o,a,n;for(Ht.isObject(r)||at(e,"cannot merge mappings; the provided source object is unacceptable"),s=Object.keys(r),a=0,n=s.length;a<n;a+=1)o=s[a],mr.call(t,o)||(zl(t,o,r[o]),i[o]=!0)}g(Ln,"mergeMappings");function Ar(e,t,r,i,s,o,a,n,l){var c,h;if(Array.isArray(s))for(s=Array.prototype.slice.call(s),c=0,h=s.length;c<h;c+=1)Array.isArray(s[c])&&at(e,"nested arrays are not supported inside keys"),typeof s=="object"&&_n(s[c])==="[object Object]"&&(s[c]="[object Object]");if(typeof s=="object"&&_n(s)==="[object Object]"&&(s="[object Object]"),s=String(s),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(c=0,h=o.length;c<h;c+=1)Ln(e,t,o[c],r);else Ln(e,t,o,r);else!e.json&&!mr.call(r,s)&&mr.call(t,s)&&(e.line=a||e.line,e.lineStart=n||e.lineStart,e.position=l||e.position,at(e,"duplicated mapping key")),zl(t,s,o),delete r[s];return t}g(Ar,"storeMappingPair");function na(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(na,"readLineBreak");function Dt(e,t,r){for(var i=0,s=e.input.charCodeAt(e.position);s!==0;){for(;gr(s);)s===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),s=e.input.charCodeAt(++e.position);if(t&&s===35)do s=e.input.charCodeAt(++e.position);while(s!==10&&s!==13&&s!==0);if(Fe(s))for(na(e),s=e.input.charCodeAt(e.position),i++,e.lineIndent=0;s===32;)e.lineIndent++,s=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&bs(e,"deficient indentation"),i}g(Dt,"skipSeparationSpace");function As(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||he(r)))}g(As,"testDocumentSeparator");function la(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ht.repeat(`
140
+ `,t-1))}g(la,"writeFoldedLines");function mg(e,t,r){var i,s,o,a,n,l,c,h,d=e.kind,f=e.result,u;if(u=e.input.charCodeAt(e.position),he(u)||Fr(u)||u===35||u===38||u===42||u===33||u===124||u===62||u===39||u===34||u===37||u===64||u===96||(u===63||u===45)&&(s=e.input.charCodeAt(e.position+1),he(s)||r&&Fr(s)))return!1;for(e.kind="scalar",e.result="",o=a=e.position,n=!1;u!==0;){if(u===58){if(s=e.input.charCodeAt(e.position+1),he(s)||r&&Fr(s))break}else if(u===35){if(i=e.input.charCodeAt(e.position-1),he(i))break}else{if(e.position===e.lineStart&&As(e)||r&&Fr(u))break;if(Fe(u))if(l=e.line,c=e.lineStart,h=e.lineIndent,Dt(e,!1,-1),e.lineIndent>=t){n=!0,u=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=h;break}}n&&(or(e,o,a,!1),la(e,e.line-l),o=a=e.position,n=!1),gr(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return or(e,o,a,!1),e.result?!0:(e.kind=d,e.result=f,!1)}g(mg,"readPlainScalar");function yg(e,t){var r,i,s;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=s=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(or(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,s=e.position;else return!0;else Fe(r)?(or(e,i,s,!0),la(e,Dt(e,!1,t)),i=s=e.position):e.position===e.lineStart&&As(e)?at(e,"unexpected end of the document within a single quoted scalar"):(e.position++,s=e.position);at(e,"unexpected end of the stream within a single quoted scalar")}g(yg,"readSingleQuotedScalar");function xg(e,t){var r,i,s,o,a,n;if(n=e.input.charCodeAt(e.position),n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return or(e,r,e.position,!0),e.position++,!0;if(n===92){if(or(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),Fe(n))Dt(e,!1,t);else if(n<256&&fg[n])e.result+=gg[n],e.position++;else if((a=cg(n))>0){for(s=a,o=0;s>0;s--)n=e.input.charCodeAt(++e.position),(a=hg(n))>=0?o=(o<<4)+a:at(e,"expected hexadecimal character");e.result+=ug(o),e.position++}else at(e,"unknown escape sequence");r=i=e.position}else Fe(n)?(or(e,r,i,!0),la(e,Dt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&As(e)?at(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}at(e,"unexpected end of the stream within a double quoted scalar")}g(xg,"readDoubleQuotedScalar");function Cg(e,t){var r=!0,i,s,o,a=e.tag,n,l=e.anchor,c,h,d,f,u,p=Object.create(null),m,y,x,C;if(C=e.input.charCodeAt(e.position),C===91)h=93,u=!1,n=[];else if(C===123)h=125,u=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),C=e.input.charCodeAt(++e.position);C!==0;){if(Dt(e,!0,t),C=e.input.charCodeAt(e.position),C===h)return e.position++,e.tag=a,e.anchor=l,e.kind=u?"mapping":"sequence",e.result=n,!0;r?C===44&&at(e,"expected the node content, but found ','"):at(e,"missed comma between flow collection entries"),y=m=x=null,d=f=!1,C===63&&(c=e.input.charCodeAt(e.position+1),he(c)&&(d=f=!0,e.position++,Dt(e,!0,t))),i=e.line,s=e.lineStart,o=e.position,Dr(e,t,Mo,!1,!0),y=e.tag,m=e.result,Dt(e,!0,t),C=e.input.charCodeAt(e.position),(f||e.line===i)&&C===58&&(d=!0,C=e.input.charCodeAt(++e.position),Dt(e,!0,t),Dr(e,t,Mo,!1,!0),x=e.result),u?Ar(e,n,p,y,m,x,i,s,o):d?n.push(Ar(e,null,p,y,m,x,i,s,o)):n.push(m),Dt(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}at(e,"unexpected end of the stream within a flow collection")}g(Cg,"readFlowCollection");function bg(e,t){var r,i,s=Da,o=!1,a=!1,n=t,l=0,c=!1,h,d;if(d=e.input.charCodeAt(e.position),d===124)i=!1;else if(d===62)i=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Da===s?s=d===43?xc:QS:at(e,"repeat of a chomping mode identifier");else if((h=dg(d))>=0)h===0?at(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?at(e,"repeat of an indentation width identifier"):(n=t+h-1,a=!0);else break;if(gr(d)){do d=e.input.charCodeAt(++e.position);while(gr(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Fe(d)&&d!==0)}for(;d!==0;){for(na(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!a||e.lineIndent<n)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>n&&(n=e.lineIndent),Fe(d)){l++;continue}if(e.lineIndent<n){s===xc?e.result+=Ht.repeat(`
141
+ `,o?1+l:l):s===Da&&o&&(e.result+=`
142
+ `);break}for(i?gr(d)?(c=!0,e.result+=Ht.repeat(`
143
+ `,o?1+l:l)):c?(c=!1,e.result+=Ht.repeat(`
144
+ `,l+1)):l===0?o&&(e.result+=" "):e.result+=Ht.repeat(`
145
+ `,l):e.result+=Ht.repeat(`
146
+ `,o?1+l:l),o=!0,a=!0,l=0,r=e.position;!Fe(d)&&d!==0;)d=e.input.charCodeAt(++e.position);or(e,r,e.position,!1)}return!0}g(bg,"readBlockScalar");function En(e,t){var r,i=e.tag,s=e.anchor,o=[],a,n=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,at(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!he(a))));){if(n=!0,e.position++,Dt(e,!0,-1)&&e.lineIndent<=t){o.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Dr(e,t,ag,!1,!0),o.push(e.result),Dt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)at(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return n?(e.tag=i,e.anchor=s,e.kind="sequence",e.result=o,!0):!1}g(En,"readBlockSequence");function kg(e,t,r){var i,s,o,a,n,l,c=e.tag,h=e.anchor,d={},f=Object.create(null),u=null,p=null,m=null,y=!1,x=!1,C;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),C=e.input.charCodeAt(e.position);C!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,at(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),o=e.line,(C===63||C===58)&&he(i))C===63?(y&&(Ar(e,d,f,u,p,null,a,n,l),u=p=m=null),x=!0,y=!0,s=!0):y?(y=!1,s=!0):at(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,C=i;else{if(a=e.line,n=e.lineStart,l=e.position,!Dr(e,r,og,!1,!0))break;if(e.line===o){for(C=e.input.charCodeAt(e.position);gr(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),he(C)||at(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Ar(e,d,f,u,p,null,a,n,l),u=p=m=null),x=!0,y=!1,s=!1,u=e.tag,p=e.result;else if(x)at(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=h,!0}else if(x)at(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=h,!0}if((e.line===o||e.lineIndent>t)&&(y&&(a=e.line,n=e.lineStart,l=e.position),Dr(e,t,$o,!0,s)&&(y?p=e.result:m=e.result),y||(Ar(e,d,f,u,p,m,a,n,l),u=p=m=null),Dt(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&C!==0)at(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Ar(e,d,f,u,p,null,a,n,l),x&&(e.tag=c,e.anchor=h,e.kind="mapping",e.result=d),x}g(kg,"readBlockMapping");function wg(e){var t,r=!1,i=!1,s,o,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&at(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,s="!!",a=e.input.charCodeAt(++e.position)):s="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(o=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):at(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!he(a);)a===33&&(i?at(e,"tag suffix cannot contain exclamation marks"):(s=e.input.slice(t-1,e.position+1),ng.test(s)||at(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),ev.test(o)&&at(e,"tag suffix cannot contain flow indicator characters")}o&&!lg.test(o)&&at(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{at(e,"tag name is malformed: "+o)}return r?e.tag=o:mr.call(e.tagMap,s)?e.tag=e.tagMap[s]+o:s==="!"?e.tag="!"+o:s==="!!"?e.tag="tag:yaml.org,2002:"+o:at(e,'undeclared tag handle "'+s+'"'),!0}g(wg,"readTagProperty");function Sg(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&at(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!he(r)&&!Fr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&at(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}g(Sg,"readAnchorProperty");function vg(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!he(i)&&!Fr(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),mr.call(e.anchorMap,r)||at(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Dt(e,!0,-1),!0}g(vg,"readAlias");function Dr(e,t,r,i,s){var o,a,n,l=1,c=!1,h=!1,d,f,u,p,m,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=n=$o===r||ag===r,i&&Dt(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;wg(e)||Sg(e);)Dt(e,!0,-1)?(c=!0,n=o,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):n=!1;if(n&&(n=c||s),(l===1||$o===r)&&(Mo===r||og===r?m=t:m=t+1,y=e.position-e.lineStart,l===1?n&&(En(e,y)||kg(e,y,m))||Cg(e,m)?h=!0:(a&&bg(e,m)||yg(e,m)||xg(e,m)?h=!0:vg(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&at(e,"alias node should not have any properties")):mg(e,m,Mo===r)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(h=n&&En(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&at(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d<f;d+=1)if(p=e.implicitTypes[d],p.resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(mr.call(e.typeMap[e.kind||"fallback"],e.tag))p=e.typeMap[e.kind||"fallback"][e.tag];else for(p=null,u=e.typeMap.multi[e.kind||"fallback"],d=0,f=u.length;d<f;d+=1)if(e.tag.slice(0,u[d].tag.length)===u[d].tag){p=u[d];break}p||at(e,"unknown tag !<"+e.tag+">"),e.result!==null&&p.kind!==e.kind&&at(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result,e.tag)?(e.result=p.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):at(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}g(Dr,"composeNode");function Tg(e){var t=e.position,r,i,s,o=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(Dt(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(o=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!he(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),s=[],i.length<1&&at(e,"directive name must not be less than one character in length");a!==0;){for(;gr(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&&!he(a);)a=e.input.charCodeAt(++e.position);s.push(e.input.slice(r,e.position))}a!==0&&na(e),mr.call(Cc,i)?Cc[i](e,i,s):bs(e,'unknown document directive "'+i+'"')}if(Dt(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Dt(e,!0,-1)):o&&at(e,"directives end mark is expected"),Dr(e,e.lineIndent-1,$o,!1,!0),Dt(e,!0,-1),e.checkLineBreaks&&tv.test(e.input.slice(t,e.position))&&bs(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&As(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Dt(e,!0,-1));return}if(e.position<e.length-1)at(e,"end of the stream or a document separator is expected");else return}g(Tg,"readDocument");function Wl(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
147
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new pg(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,at(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Tg(r);return r.documents}g(Wl,"loadDocuments");function rv(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=Wl(e,r);if(typeof t!="function")return i;for(var s=0,o=i.length;s<o;s+=1)t(i[s])}g(rv,"loadAll$1");function _g(e,t){var r=Wl(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new fe("expected a single document in the stream, but found more")}}g(_g,"load$1");var iv=_g,sv={load:iv},Bg=Object.prototype.toString,Lg=Object.prototype.hasOwnProperty,Hl=65279,ov=9,ks=10,av=13,nv=32,lv=33,hv=34,Fn=35,cv=37,dv=38,uv=39,fv=42,Eg=44,gv=45,Oo=58,pv=61,mv=62,yv=63,xv=64,Fg=91,Ag=93,Cv=96,Mg=123,bv=124,$g=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 kv=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],wv=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Og(e,t){var r,i,s,o,a,n,l;if(t===null)return{};for(r={},i=Object.keys(t),s=0,o=i.length;s<o;s+=1)a=i[s],n=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&Lg.call(l.styleAliases,n)&&(n=l.styleAliases[n]),r[a]=n;return r}g(Og,"compileStyleMap");function Rg(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new fe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Ht.repeat("0",i-t.length)+t}g(Rg,"encodeHex");var Sv=1,ws=2;function Ig(e){this.schema=e.schema||sg,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ht.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Og(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?ws:Sv,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}g(Ig,"State");function An(e,t){for(var r=Ht.repeat(" ",t),i=0,s=-1,o="",a,n=e.length;i<n;)s=e.indexOf(`
148
+ `,i),s===-1?(a=e.slice(i),i=n):(a=e.slice(i,s+1),i=s+1),a.length&&a!==`
149
+ `&&(o+=r),o+=a;return o}g(An,"indentString");function Ro(e,t){return`
150
+ `+Ht.repeat(" ",e.indent*t)}g(Ro,"generateNextLine");function Pg(e,t){var r,i,s;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(s=e.implicitTypes[r],s.resolve(t))return!0;return!1}g(Pg,"testImplicitResolving");function Ss(e){return e===nv||e===ov}g(Ss,"isWhitespace");function _i(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Hl||65536<=e&&e<=1114111}g(_i,"isPrintable");function Mn(e){return _i(e)&&e!==Hl&&e!==av&&e!==ks}g(Mn,"isNsCharOrWhitespace");function $n(e,t,r){var i=Mn(e),s=i&&!Ss(e);return(r?i:i&&e!==Eg&&e!==Fg&&e!==Ag&&e!==Mg&&e!==$g)&&e!==Fn&&!(t===Oo&&!s)||Mn(t)&&!Ss(t)&&e===Fn||t===Oo&&s}g($n,"isPlainSafe");function Dg(e){return _i(e)&&e!==Hl&&!Ss(e)&&e!==gv&&e!==yv&&e!==Oo&&e!==Eg&&e!==Fg&&e!==Ag&&e!==Mg&&e!==$g&&e!==Fn&&e!==dv&&e!==fv&&e!==lv&&e!==bv&&e!==pv&&e!==mv&&e!==uv&&e!==hv&&e!==cv&&e!==xv&&e!==Cv}g(Dg,"isPlainSafeFirst");function Ng(e){return!Ss(e)&&e!==Oo}g(Ng,"isPlainSafeLast");function ti(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(ti,"codePointAt");function Yl(e){var t=/^\n* /;return t.test(e)}g(Yl,"needIndentIndicator");var qg=1,On=2,zg=3,jg=4,Xr=5;function Wg(e,t,r,i,s,o,a,n){var l,c=0,h=null,d=!1,f=!1,u=i!==-1,p=-1,m=Dg(ti(e,0))&&Ng(ti(e,e.length-1));if(t||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=ti(e,l),!_i(c))return Xr;m=m&&$n(c,h,n),h=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=ti(e,l),c===ks)d=!0,u&&(f=f||l-p-1>i&&e[p+1]!==" ",p=l);else if(!_i(c))return Xr;m=m&&$n(c,h,n),h=c}f=f||u&&l-p-1>i&&e[p+1]!==" "}return!d&&!f?m&&!a&&!s(e)?qg:o===ws?Xr:On:r>9&&Yl(e)?Xr:a?o===ws?Xr:On:f?jg:zg}g(Wg,"chooseScalarStyle");function Hg(e,t,r,i,s){e.dump=(function(){if(t.length===0)return e.quotingType===ws?'""':"''";if(!e.noCompatMode&&(kv.indexOf(t)!==-1||wv.test(t)))return e.quotingType===ws?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return Pg(e,c)}switch(g(l,"testAmbiguity"),Wg(t,n,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,s)){case qg:return t;case On:return"'"+t.replace(/'/g,"''")+"'";case zg:return"|"+Rn(t,e.indent)+In(An(t,o));case jg:return">"+Rn(t,e.indent)+In(An(Yg(t,a),o));case Xr:return'"'+Ug(t)+'"';default:throw new fe("impossible error: invalid scalar style")}})()}g(Hg,"writeScalar");function Rn(e,t){var r=Yl(e)?String(t):"",i=e[e.length-1]===`
151
+ `,s=i&&(e[e.length-2]===`
152
+ `||e===`
153
+ `),o=s?"+":i?"":"-";return r+o+`
154
+ `}g(Rn,"blockHeader");function In(e){return e[e.length-1]===`
155
+ `?e.slice(0,-1):e}g(In,"dropEndingNewline");function Yg(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
156
+ `);return c=c!==-1?c:e.length,r.lastIndex=c,Pn(e.slice(0,c),t)})(),s=e[0]===`
157
+ `||e[0]===" ",o,a;a=r.exec(e);){var n=a[1],l=a[2];o=l[0]===" ",i+=n+(!s&&!o&&l!==""?`
158
+ `:"")+Pn(l,t),s=o}return i}g(Yg,"foldString");function Pn(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,s=0,o,a=0,n=0,l="";i=r.exec(e);)n=i.index,n-s>t&&(o=a>s?a:n,l+=`
159
+ `+e.slice(s,o),s=o+1),a=n;return l+=`
160
+ `,e.length-s>t&&a>s?l+=e.slice(s,a)+`
161
+ `+e.slice(a+1):l+=e.slice(s),l.slice(1)}g(Pn,"foldLine");function Ug(e){for(var t="",r=0,i,s=0;s<e.length;r>=65536?s+=2:s++)r=ti(e,s),i=re[r],!i&&_i(r)?(t+=e[s],r>=65536&&(t+=e[s+1])):t+=i||Rg(r);return t}g(Ug,"escapeString");function Xg(e,t,r){var i="",s=e.tag,o,a,n;for(o=0,a=r.length;o<a;o+=1)n=r[o],e.replacer&&(n=e.replacer.call(r,String(o),n)),(We(e,t,n,!1,!1)||typeof n>"u"&&We(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=s,e.dump="["+i+"]"}g(Xg,"writeFlowSequence");function Dn(e,t,r,i){var s="",o=e.tag,a,n,l;for(a=0,n=r.length;a<n;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(We(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&We(e,t+1,null,!0,!0,!1,!0))&&((!i||s!=="")&&(s+=Ro(e,t)),e.dump&&ks===e.dump.charCodeAt(0)?s+="-":s+="- ",s+=e.dump);e.tag=o,e.dump=s||"[]"}g(Dn,"writeBlockSequence");function Gg(e,t,r){var i="",s=e.tag,o=Object.keys(r),a,n,l,c,h;for(a=0,n=o.length;a<n;a+=1)h="",i!==""&&(h+=", "),e.condenseFlow&&(h+='"'),l=o[a],c=r[l],e.replacer&&(c=e.replacer.call(r,l,c)),We(e,t,l,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),We(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=s,e.dump="{"+i+"}"}g(Gg,"writeFlowMapping");function Vg(e,t,r,i){var s="",o=e.tag,a=Object.keys(r),n,l,c,h,d,f;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new fe("sortKeys must be a boolean or a function");for(n=0,l=a.length;n<l;n+=1)f="",(!i||s!=="")&&(f+=Ro(e,t)),c=a[n],h=r[c],e.replacer&&(h=e.replacer.call(r,c,h)),We(e,t+1,c,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&ks===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=Ro(e,t)),We(e,t+1,h,!0,d)&&(e.dump&&ks===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,s+=f));e.tag=o,e.dump=s||"{}"}g(Vg,"writeBlockMapping");function Nn(e,t,r){var i,s,o,a,n,l;for(s=r?e.explicitTypes:e.implicitTypes,o=0,a=s.length;o<a;o+=1)if(n=s[o],(n.instanceOf||n.predicate)&&(!n.instanceOf||typeof t=="object"&&t instanceof n.instanceOf)&&(!n.predicate||n.predicate(t))){if(r?n.multi&&n.representName?e.tag=n.representName(t):e.tag=n.tag:e.tag="?",n.represent){if(l=e.styleMap[n.tag]||n.defaultStyle,Bg.call(n.represent)==="[object Function]")i=n.represent(t,l);else if(Lg.call(n.represent,l))i=n.represent[l](t,l);else throw new fe("!<"+n.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}g(Nn,"detectType");function We(e,t,r,i,s,o,a){e.tag=null,e.dump=r,Nn(e,r,!1)||Nn(e,r,!0);var n=Bg.call(e.dump),l=i,c;i&&(i=e.flowLevel<0||e.flowLevel>t);var h=n==="[object Object]"||n==="[object Array]",d,f;if(h&&(d=e.duplicates.indexOf(r),f=d!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(s=!1),f&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(h&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),n==="[object Object]")i&&Object.keys(e.dump).length!==0?(Vg(e,t,e.dump,s),f&&(e.dump="&ref_"+d+e.dump)):(Gg(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Dn(e,t-1,e.dump,s):Dn(e,t,e.dump,s),f&&(e.dump="&ref_"+d+e.dump)):(Xg(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&Hg(e,e.dump,t,o,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new fe("unacceptable kind of an object to dump "+n)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}g(We,"writeNode");function Zg(e,t){var r=[],i=[],s,o;for(Io(e,r,i),s=0,o=i.length;s<o;s+=1)t.duplicates.push(r[i[s]]);t.usedDuplicates=new Array(o)}g(Zg,"getDuplicateReferences");function Io(e,t,r){var i,s,o;if(e!==null&&typeof e=="object")if(s=t.indexOf(e),s!==-1)r.indexOf(s)===-1&&r.push(s);else if(t.push(e),Array.isArray(e))for(s=0,o=e.length;s<o;s+=1)Io(e[s],t,r);else for(i=Object.keys(e),s=0,o=i.length;s<o;s+=1)Io(e[i[s]],t,r)}g(Io,"inspectNode");function vv(e,t){t=t||{};var r=new Ig(t);r.noRefs||Zg(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),We(r,0,i,!0,!0)?r.dump+`
162
+ `:""}g(vv,"dump$1");function Tv(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}g(Tv,"renamed");var Kg=zf,Qg=sv.load;var _v=g(e=>{const{handDrawnSeed:t}=wt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),$i=g(e=>{const t=Bv([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),Bv=g(e=>{const t=new Map;return e.forEach(r=>{const[i,s]=r.split(":");t.set(i.trim(),s?.trim())}),t},"styles2Map"),Ul=g(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),st=g(e=>{const{stylesArray:t}=$i(e),r=[],i=[],s=[],o=[];return t.forEach(a=>{const n=a[0];Ul(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&s.push(a.join(":")+" !important"),n==="fill"&&o.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:s,backgroundStyles:o}},"styles2String"),rt=g((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=wt(),{nodeBorder:s,mainBkg:o}=r,{stylesMap:a}=$i(e);return Object.assign({roughness:.7,fill:a.get("fill")||o,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||s,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:Lv(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),Lv=g(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const s=isNaN(t[0])?0:t[0];return[s,s]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),Us={},Wt={},bc;function Ev(){return bc||(bc=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.BLANK_URL=Wt.relativeFirstCharacters=Wt.whitespaceEscapeCharsRegex=Wt.urlSchemeRegex=Wt.ctrlCharactersRegex=Wt.htmlCtrlEntityRegex=Wt.htmlEntitiesRegex=Wt.invalidProtocolRegex=void 0,Wt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Wt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Wt.htmlCtrlEntityRegex=/&(newline|tab);/gi,Wt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Wt.urlSchemeRegex=/^.+(:|&colon;)/gim,Wt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Wt.relativeFirstCharacters=[".","/"],Wt.BLANK_URL="about:blank"),Wt}var kc;function Fv(){if(kc)return Us;kc=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.sanitizeUrl=o;var e=Ev();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function s(a){try{return decodeURIComponent(a)}catch{return a}}function o(a){if(!a)return e.BLANK_URL;var n,l=s(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=s(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var f=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(f))return e.BLANK_URL;var u=h.replace(/\\/g,"/");if(f==="mailto:"||f.includes("://"))return u;if(f==="http:"||f==="https:"){if(!i(u))return e.BLANK_URL;var p=new URL(u);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return u}return Us}var Jg=Fv();function Na(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Av(){}function tp(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function ha(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const ep="[object RegExp]",Xl="[object String]",Gl="[object Number]",Vl="[object Boolean]",Zl="[object Arguments]",rp="[object Symbol]",ip="[object Date]",sp="[object Map]",op="[object Set]",ap="[object Array]",np="[object ArrayBuffer]",lp="[object Object]",hp="[object DataView]",cp="[object Uint8Array]",dp="[object Uint8ClampedArray]",up="[object Uint16Array]",fp="[object Uint32Array]",gp="[object Int8Array]",pp="[object Int16Array]",mp="[object Int32Array]",yp="[object Float32Array]",xp="[object Float64Array]",wc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function Kl(e){return typeof wc.Buffer<"u"&&wc.Buffer.isBuffer(e)}function Mv(e){return Number.isSafeInteger(e)&&e>=0}function Cp(e){return e!=null&&typeof e!="function"&&Mv(e.length)}function $v(e){return e==="__proto__"}function ca(e){return e==null||typeof e!="object"&&typeof e!="function"}function Ql(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ov(e,t){return ei(e,void 0,e,new Map,t)}function ei(e,t,r,i=new Map,s=void 0){const o=s?.(e,t,r,i);if(o!==void 0)return o;if(ca(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]=ei(e[n],n,r,i,s);return Object.hasOwn(e,"index")&&(a.index=e.index),Object.hasOwn(e,"input")&&(a.input=e.input),a}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const a=new RegExp(e.source,e.flags);return a.lastIndex=e.lastIndex,a}if(e instanceof Map){const a=new Map;i.set(e,a);for(const[n,l]of e)a.set(n,ei(l,n,r,i,s));return a}if(e instanceof Set){const a=new Set;i.set(e,a);for(const n of e)a.add(ei(n,void 0,r,i,s));return a}if(Kl(e))return e.subarray();if(Ql(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=ei(e[n],n,r,i,s);return a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const a=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,a),_e(a,e,r,i,s),a}if(typeof File<"u"&&e instanceof File){const a=new File([e],e.name,{type:e.type});return i.set(e,a),_e(a,e,r,i,s),a}if(typeof Blob<"u"&&e instanceof Blob){const a=new Blob([e],{type:e.type});return i.set(e,a),_e(a,e,r,i,s),a}if(e instanceof Error){const a=structuredClone(e);return i.set(e,a),a.message=e.message,a.name=e.name,a.stack=e.stack,a.cause=e.cause,a.constructor=e.constructor,_e(a,e,r,i,s),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return i.set(e,a),_e(a,e,r,i,s),a}if(e instanceof Number){const a=new Number(e.valueOf());return i.set(e,a),_e(a,e,r,i,s),a}if(e instanceof String){const a=new String(e.valueOf());return i.set(e,a),_e(a,e,r,i,s),a}if(typeof e=="object"&&Rv(e)){const a=Object.create(Object.getPrototypeOf(e));return i.set(e,a),_e(a,e,r,i,s),a}return e}function _e(e,t,r=e,i,s){const o=[...Object.keys(t),...tp(t)];for(let a=0;a<o.length;a++){const n=o[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=ei(t[n],n,r,i,s))}}function Rv(e){switch(ha(e)){case Zl:case ap:case np:case hp:case Vl:case ip:case yp:case xp:case gp:case pp:case mp:case sp:case Gl:case lp:case ep:case op:case Xl:case rp:case cp:case dp:case up:case fp:return!0;default:return!1}}function Iv(e,t){return Ov(e,(r,i,s,o)=>{if(typeof e=="object"){if(ha(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return o.set(e,a),_e(a,e,s,o),a}switch(Object.prototype.toString.call(e)){case Gl:case Xl:case Vl:{const a=new e.constructor(e?.valueOf());return _e(a,e),a}case Zl:{const a={};return _e(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Sc(e){return Iv(e)}function qn(e){return e!==null&&typeof e=="object"&&ha(e)==="[object Arguments]"}function zn(e){return typeof e=="object"&&e!==null}function Pv(e){return zn(e)&&Cp(e)}function Ms(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const s=t?t.apply(this,i):i[0],o=r.cache;if(o.has(s))return o.get(s);const a=e.apply(this,i);return r.cache=o.set(s,a)||o,a};return r.cache=new(Ms.Cache||Map),r}Ms.Cache=Map;function us(e){return Ql(e)}function Dv(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function Nv(e){if(ca(e))return e;if(Array.isArray(e)||Ql(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function qv(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let s=e;for(let o=0;o<r.length;o++){const a=r[o];s=lo(s,a,i,new Map)}return s}function lo(e,t,r,i){if(ca(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return Nv(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let o=0;o<t.length;o++)t[o]=t[o]??void 0}const s=[...Object.keys(t),...tp(t)];for(let o=0;o<s.length;o++){const a=s[o];if($v(a))continue;let n=t[a],l=e[a];if(qn(n)&&(n={...n}),qn(l)&&(l={...l}),Kl(n)&&(n=Sc(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let f=0;f<d.length;f++){const u=d[f];h[u]=l[u]}l=h}else if(Pv(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=r(l,n,a,e,t,i);c!==void 0?e[a]=c:Array.isArray(n)||zn(l)&&zn(n)&&(Na(l)||Na(n)||us(l)||us(n))?e[a]=lo(l,n,r,i):l==null&&Na(n)?e[a]=lo({},n,r,i):l==null&&us(n)?e[a]=Sc(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function zv(e,...t){return qv(e,...t,Av)}function vc(e){if(e==null)return!0;if(Cp(e))return typeof e.splice!="function"&&typeof e!="string"&&!Kl(e)&&!us(e)&&!qn(e)?!1:e.length===0;if(typeof e=="object"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);return Dv(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var bp="​",jv={curveBasis:Lo,curveBasisClosed:fS,curveBasisOpen:gS,curveBumpX:Gu,curveBumpY:Vu,curveBundle:pS,curveCardinalClosed:mS,curveCardinalOpen:yS,curveCardinal:Ju,curveCatmullRomClosed:xS,curveCatmullRomOpen:CS,curveCatmullRom:ef,curveLinear:ds,curveLinearClosed:bS,curveMonotoneX:lf,curveMonotoneY:hf,curveNatural:df,curveStep:uf,curveStepAfter:gf,curveStepBefore:ff},Wv=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Hv=g(function(e,t){const r=kp(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);mo(a),i=qt(i,[...a])}else i=r.args;if(!i)return;let s=xl(e,t);const o="config";return i[o]!==void 0&&(s==="flowchart-v2"&&(s="flowchart"),i[s]=i[o],delete i[o]),i},"detectInit"),kp=g(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${Wv.source})(?=[}][%]{2}).*
163
+ `,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),V.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const s=[];for(;(i=cs.exec(e))!==null;)if(i.index===cs.lastIndex&&cs.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const o=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;s.push({type:o,args:a})}return s.length===0?{type:e,args:null}:s.length===1?s[0]:s}catch(r){return V.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),Yv=g(function(e){return e.replace(cs,"")},"removeDirectives"),Uv=g(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Jl(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return jv[r]??t}g(Jl,"interpolateToCurve");function wp(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?Jg.sanitizeUrl(r):r}g(wp,"formatUrl");var Xv=g((e,...t)=>{const r=e.split("."),i=r.length-1,s=r[i];let o=window;for(let a=0;a<i;a++)if(o=o[r[a]],!o){V.error(`Function name: ${e} not found in window`);return}o[s](...t)},"runFunc");function th(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}g(th,"distance");function Sp(e){let t,r=0;e.forEach(s=>{r+=th(s,t),t=s});const i=r/2;return eh(e,i)}g(Sp,"traverseEdge");function vp(e){return e.length===1?e[0]:Sp(e)}g(vp,"calcLabelPosition");var Tc=g((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),eh=g((e,t)=>{let r,i=t;for(const s of e){if(r){const o=th(s,r);if(o===0)return r;if(o<i)i-=o;else{const a=i/o;if(a<=0)return r;if(a>=1)return{x:s.x,y:s.y};if(a>0&&a<1)return{x:Tc((1-a)*r.x+a*s.x,5),y:Tc((1-a)*r.y+a*s.y,5)}}}r=s}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Gv=g((e,t,r)=>{V.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const s=eh(t,25),o=e?10:5,a=Math.atan2(t[0].y-s.y,t[0].x-s.x),n={x:0,y:0};return n.x=Math.sin(a)*o+(t[0].x+s.x)/2,n.y=-Math.cos(a)*o+(t[0].y+s.y)/2,n},"calcCardinalityPosition");function Tp(e,t,r){const i=structuredClone(r);V.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const s=25+e,o=eh(i,s),a=10+e*.5,n=Math.atan2(i[0].y-o.y,i[0].x-o.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+o.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+o.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+o.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+o.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+o.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+o.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+o.x)/2,l.y=-Math.cos(n)*a+(i[0].y+o.y)/2),l}g(Tp,"calcTerminalLabelPosition");function rh(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}g(rh,"getStylesFromArray");var _c=0,_p=g(()=>(_c++,"id-"+Math.random().toString(36).substr(2,12)+"-"+_c),"generateId");function Bp(e){let t="";const r="0123456789abcdef",i=r.length;for(let s=0;s<e;s++)t+=r.charAt(Math.floor(Math.random()*i));return t}g(Bp,"makeRandomHex");var Lp=g(e=>Bp(e.length),"random"),Vv=g(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Zv=g(function(e,t){const r=t.text.replace(Ai.lineBreakRegex," "),[,i]=$s(t.fontSize),s=e.append("text");s.attr("x",t.x),s.attr("y",t.y),s.style("text-anchor",t.anchor),s.style("font-family",t.fontFamily),s.style("font-size",i),s.style("font-weight",t.fontWeight),s.attr("fill",t.fill),t.class!==void 0&&s.attr("class",t.class);const o=s.append("tspan");return o.attr("x",t.x+t.textMargin*2),o.attr("fill",t.fill),o.text(r),s},"drawSimpleText"),Ep=Ms((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Ai.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),s=[];let o="";return i.forEach((a,n)=>{const l=He(`${a} `,r),c=He(o,r);if(l>t){const{hyphenatedStrings:f,remainingWord:u}=Kv(a,t,"-",r);s.push(o,...f),o=u}else c+l>=t?(s.push(o),o=a):o=[o,a].filter(Boolean).join(" ");n+1===i.length&&s.push(o)}),s.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),Kv=Ms((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const s=[...e],o=[];let a="";return s.forEach((n,l)=>{const c=`${a}${n}`;if(He(c,i)>=t){const d=l+1,f=s.length===d,u=`${c}${r}`;o.push(f?c:u),a=""}else a=c}),{hyphenatedStrings:o,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function ih(e,t){return da(e,t).height}g(ih,"calculateTextHeight");function He(e,t){return da(e,t).width}g(He,"calculateTextWidth");var da=Ms((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:s=400}=t;if(!e)return{width:0,height:0};const[,o]=$s(r),a=["sans-serif",i],n=e.split(Ai.lineBreakRegex),l=[],c=pt("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const f of a){let u=0;const p={width:0,height:0,lineHeight:0};for(const m of n){const y=Vv();y.text=m||bp;const x=Zv(h,y).style("font-size",o).style("font-weight",s).style("font-family",f),C=(x._groups||x)[0][0].getBBox();if(C.width===0&&C.height===0)throw new Error("svg element not in render tree");p.width=Math.round(Math.max(p.width,C.width)),u=Math.round(C.height),p.height+=u,p.lineHeight=Math.round(Math.max(p.lineHeight,u))}l.push(p)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),xi,Qv=(xi=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},g(xi,"InitIDGenerator"),xi),Xs,Jv=g(function(e){return Xs=Xs||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Xs.innerHTML=e,unescape(Xs.textContent)},"entityDecode");function sh(e){return"str"in e}g(sh,"isDetailedError");var tT=g((e,t,r,i)=>{if(!i)return;const s=e.node()?.getBBox();s&&e.append("text").text(i).attr("text-anchor","middle").attr("x",s.x+s.width/2).attr("y",-r).attr("class",t)},"insertTitle"),$s=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 ua(e,t){return zv({},e,t)}g(ua,"cleanAndMerge");var ke={assignWithDepth:qt,wrapLabel:Ep,calculateTextHeight:ih,calculateTextWidth:He,calculateTextDimensions:da,cleanAndMerge:ua,detectInit:Hv,detectDirective:kp,isSubstringInArray:Uv,interpolateToCurve:Jl,calcLabelPosition:vp,calcCardinalityPosition:Gv,calcTerminalLabelPosition:Tp,formatUrl:wp,getStylesFromArray:rh,generateId:_p,random:Lp,runFunc:Xv,entityDecode:Jv,insertTitle:tT,isLabelCoordinateInPath:Fp,parseFontSize:$s,InitIDGenerator:Qv},eT=g(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),yr=g(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),rT=g((e,t,{counter:r=0,prefix:i,suffix:s},o)=>o||`${i?`${i}_`:""}${e}_${t}_${r}${s?`_${s}`:""}`,"getEdgeId");function Xt(e){return e??null}g(Xt,"handleUndefinedAttr");function Fp(e,t){const r=Math.round(e.x),i=Math.round(e.y),s=t.replace(/(\d+\.\d+)/g,o=>Math.round(parseFloat(o)).toString());return s.includes(r.toString())||s.includes(i.toString())}g(Fp,"isLabelCoordinateInPath");var fa=g(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins");async function oh(e,t){const r=e.getElementsByTagName("img");if(!r||r.length===0)return;const i=t.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...r].map(s=>new Promise(o=>{function a(){if(s.style.display="flex",s.style.flexDirection="column",i){const n=wt().fontSize?wt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=yl.fontSize]=$s(n),h=c*l+"px";s.style.minWidth=h,s.style.maxWidth=h}else s.style.width="100%";o(s)}g(a,"setupImage"),setTimeout(()=>{s.complete&&a()}),s.addEventListener("error",a),s.addEventListener("load",a)})))}g(oh,"configureLabelImages");const iT=Object.freeze({left:0,top:0,width:16,height:16}),Po=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ap=Object.freeze({...iT,...Po}),sT=Object.freeze({...Ap,body:"",hidden:!1}),oT=Object.freeze({width:null,height:null}),aT=Object.freeze({...oT,...Po}),nT=(e,t,r,i="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;i=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const n=s.pop(),l=s.pop(),c={provider:s.length>0?s[0]:i,prefix:l,name:n};return qa(c)?c:null}const o=s[0],a=o.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return qa(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:o};return qa(n,r)?n:null}return null},qa=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function lT(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function Bc(e,t){const r=lT(e,t);for(const i in sT)i in Po?i in e&&!(i in r)&&(r[i]=Po[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function hT(e,t){const r=e.icons,i=e.aliases||Object.create(null),s=Object.create(null);function o(a){if(r[a])return s[a]=[];if(!(a in s)){s[a]=null;const n=i[a]&&i[a].parent,l=n&&o(n);l&&(s[a]=[n].concat(l))}return s[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(o),s}function Lc(e,t,r){const i=e.icons,s=e.aliases||Object.create(null);let o={};function a(n){o=Bc(i[n]||s[n],o)}return a(t),r.forEach(a),Bc(e,o)}function cT(e,t){if(e.icons[t])return Lc(e,t,[]);const r=hT(e,[t])[t];return r?Lc(e,t,r):null}const dT=/(-?[0-9.]*[0-9]+[0-9.]*)/g,uT=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ec(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(dT);if(i===null||!i.length)return e;const s=[];let o=i.shift(),a=uT.test(o);for(;;){if(a){const n=parseFloat(o);isNaN(n)?s.push(o):s.push(Math.ceil(n*t*r)/r)}else s.push(o);if(o=i.shift(),o===void 0)return s.join("");a=!a}}function fT(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const s=e.indexOf(">",i),o=e.indexOf("</"+t);if(s===-1||o===-1)break;const a=e.indexOf(">",o);if(a===-1)break;r+=e.slice(s+1,o).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function gT(e,t){return e?"<defs>"+e+"</defs>"+t:t}function pT(e,t,r){const i=fT(e);return gT(i.defs,t+i.content+r)}const mT=e=>e==="unset"||e==="undefined"||e==="none";function yT(e,t){const r={...Ap,...e},i={...aT,...t},s={left:r.left,top:r.top,width:r.width,height:r.height};let o=r.body;[r,i].forEach(m=>{const y=[],x=m.hFlip,C=m.vFlip;let k=m.rotate;x?C?k+=2:(y.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),y.push("scale(-1 1)"),s.top=s.left=0):C&&(y.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),y.push("scale(1 -1)"),s.top=s.left=0);let v;switch(k<0&&(k-=Math.floor(k/4)*4),k=k%4,k){case 1:v=s.height/2+s.top,y.unshift("rotate(90 "+v.toString()+" "+v.toString()+")");break;case 2:y.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:v=s.width/2+s.left,y.unshift("rotate(-90 "+v.toString()+" "+v.toString()+")");break}k%2===1&&(s.left!==s.top&&(v=s.left,s.left=s.top,s.top=v),s.width!==s.height&&(v=s.width,s.width=s.height,s.height=v)),y.length&&(o=pT(o,'<g transform="'+y.join(" ")+'">',"</g>"))});const a=i.width,n=i.height,l=s.width,c=s.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=Ec(d,l/c)):(h=a==="auto"?l:a,d=n===null?Ec(h,c/l):n==="auto"?c:n);const f={},u=(m,y)=>{mT(y)||(f[m]=y.toString())};u("width",h),u("height",d);const p=[s.left,s.top,l,c];return f.viewBox=p.join(" "),{attributes:f,viewBox:p,body:o}}const xT=/\sid="(\S+)"/g,Fc=new Map;function CT(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Fc.get(e)||0;return Fc.set(e,t+1),t?`${e}${t}`:e}function bT(e){const t=[];let r;for(;r=xT.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(s=>{const o=CT(s),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function kT(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}var Mp={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},jn=new Map,$p=new Map,Op=g(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(V.debug("Registering icon pack:",t.name),"loader"in t)$p.set(t.name,t.loader);else if("icons"in t)jn.set(t.name,t.icons);else throw V.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Rp=g(async(e,t)=>{const r=nT(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let s=jn.get(i);if(!s){const a=$p.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{s={...await a(),prefix:i},jn.set(i,s)}catch(n){throw V.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const o=cT(s,r.name);if(!o)throw new Error(`Icon not found: ${e}`);return o},"getRegisteredIconData"),wT=g(async e=>{try{return await Rp(e),!0}catch{return!1}},"isIconAvailable"),Oi=g(async(e,t,r)=>{let i;try{i=await Rp(e,t?.fallbackPrefix)}catch(a){V.error(a),i=Mp}const s=yT(i,t),o=kT(bT(s.body),{...s.attributes,...r});return we(o,At())},"getIconSVG");function ah(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var zr=ah();function Ip(e){zr=e}var fs={exec:()=>null};function St(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(s,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(ce.caret,"$1"),r=r.replace(s,a),i},getRegex:()=>new RegExp(r,t)};return i}var ST=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ce={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},vT=/^(?:[ \t]*(?:\n|$))+/,TT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,_T=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Os=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,BT=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,nh=/(?:[*+-]|\d{1,9}[.)])/,Pp=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Dp=St(Pp).replace(/bull/g,nh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),LT=St(Pp).replace(/bull/g,nh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),lh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ET=/^[^\n]+/,hh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,FT=St(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",hh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),AT=St(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,nh).getRegex(),ga="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ch=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,MT=St("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ch).replace("tag",ga).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Np=St(lh).replace("hr",Os).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",ga).getRegex(),$T=St(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Np).getRegex(),dh={blockquote:$T,code:TT,def:FT,fences:_T,heading:BT,hr:Os,html:MT,lheading:Dp,list:AT,newline:vT,paragraph:Np,table:fs,text:ET},Ac=St("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Os).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",ga).getRegex(),OT={...dh,lheading:LT,table:Ac,paragraph:St(lh).replace("hr",Os).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ac).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ga).getRegex()},RT={...dh,html:St(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ch).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fs,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:St(lh).replace("hr",Os).replace("heading",` *#{1,6} *[^
164
+ ]`).replace("lheading",Dp).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},IT=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,PT=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qp=/^( {2,}|\\)\n(?!\s*$)/,DT=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pa=/[\p{P}\p{S}]/u,uh=/[\s\p{P}\p{S}]/u,zp=/[^\s\p{P}\p{S}]/u,NT=St(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,uh).getRegex(),jp=/(?!~)[\p{P}\p{S}]/u,qT=/(?!~)[\s\p{P}\p{S}]/u,zT=/(?:[^\s\p{P}\p{S}]|~)/u,jT=St(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ST?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Wp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,WT=St(Wp,"u").replace(/punct/g,pa).getRegex(),HT=St(Wp,"u").replace(/punct/g,jp).getRegex(),Hp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",YT=St(Hp,"gu").replace(/notPunctSpace/g,zp).replace(/punctSpace/g,uh).replace(/punct/g,pa).getRegex(),UT=St(Hp,"gu").replace(/notPunctSpace/g,zT).replace(/punctSpace/g,qT).replace(/punct/g,jp).getRegex(),XT=St("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,zp).replace(/punctSpace/g,uh).replace(/punct/g,pa).getRegex(),GT=St(/\\(punct)/,"gu").replace(/punct/g,pa).getRegex(),VT=St(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ZT=St(ch).replace("(?:-->|$)","-->").getRegex(),KT=St("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ZT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Do=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,QT=St(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Do).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Yp=St(/^!?\[(label)\]\[(ref)\]/).replace("label",Do).replace("ref",hh).getRegex(),Up=St(/^!?\[(ref)\](?:\[\])?/).replace("ref",hh).getRegex(),JT=St("reflink|nolink(?!\\()","g").replace("reflink",Yp).replace("nolink",Up).getRegex(),Mc=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,fh={_backpedal:fs,anyPunctuation:GT,autolink:VT,blockSkip:jT,br:qp,code:PT,del:fs,emStrongLDelim:WT,emStrongRDelimAst:YT,emStrongRDelimUnd:XT,escape:IT,link:QT,nolink:Up,punctuation:NT,reflink:Yp,reflinkSearch:JT,tag:KT,text:DT,url:fs},t_={...fh,link:St(/^!?\[(label)\]\((.*?)\)/).replace("label",Do).getRegex(),reflink:St(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Do).getRegex()},Wn={...fh,emStrongRDelimAst:UT,emStrongLDelim:HT,url:St(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Mc).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:St(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Mc).getRegex()},e_={...Wn,br:St(qp).replace("{2,}","*").getRegex(),text:St(Wn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Gs={normal:dh,gfm:OT,pedantic:RT},Yi={normal:fh,gfm:Wn,breaks:e_,pedantic:t_},r_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$c=e=>r_[e];function De(e,t){if(t){if(ce.escapeTest.test(e))return e.replace(ce.escapeReplace,$c)}else if(ce.escapeTestNoEncode.test(e))return e.replace(ce.escapeReplaceNoEncode,$c);return e}function Oc(e){try{e=encodeURI(e).replace(ce.percentDecode,"%")}catch{return null}return e}function Rc(e,t){let r=e.replace(ce.findPipe,(o,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(ce.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(ce.slashPipe,"|");return i}function Ui(e,t,r){let i=e.length;if(i===0)return"";let s=0;for(;s<i&&e.charAt(i-s-1)===t;)s++;return e.slice(0,i-s)}function i_(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function Ic(e,t,r,i,s){let o=t.href,a=t.title||null,n=e[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function s_(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let s=i[1];return t.split(`
165
+ `).map(o=>{let a=o.match(r.other.beginningSpace);if(a===null)return o;let[n]=a;return n.length>=s.length?o.slice(s.length):o}).join(`
166
+ `)}var No=class{options;rules;lexer;constructor(t){this.options=t||zr}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:Ui(i,`
167
+ `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],s=s_(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:s}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let s=Ui(i,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(i=s.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:Ui(r[0],`
168
+ `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Ui(r[0],`
169
+ `).split(`
170
+ `),s="",o="",a=[];for(;i.length>0;){let n=!1,l=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))l.push(i[c]),n=!0;else if(!n)l.push(i[c]);else break;i=i.slice(c);let h=l.join(`
171
+ `),d=h.replace(this.rules.other.blockquoteSetextReplace,`
172
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
173
+ ${h}`:h,o=o?`${o}
174
+ ${d}`:d;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,a,!0),this.lexer.state.top=f,i.length===0)break;let u=a.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let p=u,m=p.raw+`
175
+ `+i.join(`
176
+ `),y=this.blockquote(m);a[a.length-1]=y,s=s.substring(0,s.length-p.raw.length)+y.raw,o=o.substring(0,o.length-p.text.length)+y.text;break}else if(u?.type==="list"){let p=u,m=p.raw+`
177
+ `+i.join(`
178
+ `),y=this.list(m);a[a.length-1]=y,s=s.substring(0,s.length-u.raw.length)+y.raw,o=o.substring(0,o.length-p.raw.length)+y.raw,i=m.substring(a.at(-1).raw.length).split(`
179
+ `);continue}}return{type:"blockquote",raw:s,tokens:a,text:o}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),s=i.length>1,o={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let a=this.rules.other.listItemRegex(i),n=!1;for(;t;){let c=!1,h="",d="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let f=r[2].split(`
180
+ `,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),u=t.split(`
181
+ `,1)[0],p=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):p?m=r[1].length+1:(m=r[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=r[1].length),p&&this.rules.other.blankLine.test(u)&&(h+=u+`
182
+ `,t=t.substring(u.length+1),c=!0),!c){let C=this.rules.other.nextBulletRegex(m),k=this.rules.other.hrRegex(m),v=this.rules.other.fencesBeginRegex(m),S=this.rules.other.headingBeginRegex(m),T=this.rules.other.htmlBeginRegex(m);for(;t;){let B=t.split(`
183
+ `,1)[0],_;if(u=B,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),_=u):_=u.replace(this.rules.other.tabCharGlobal," "),v.test(u)||S.test(u)||T.test(u)||C.test(u)||k.test(u))break;if(_.search(this.rules.other.nonSpaceChar)>=m||!u.trim())d+=`
184
+ `+_.slice(m);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(f)||S.test(f)||k.test(f))break;d+=`
185
+ `+u}!p&&!u.trim()&&(p=!0),h+=B+`
186
+ `,t=t.substring(B.length+1),f=_.slice(m)}}o.loose||(n?o.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(n=!0));let y=null,x;this.options.gfm&&(y=this.rules.other.listIsTask.exec(d),y&&(x=y[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:h,task:!!y,checked:x,loose:!1,text:d,tokens:[]}),o.raw+=h}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let c=0;c<o.items.length;c++)if(this.lexer.state.top=!1,o.items[c].tokens=this.lexer.blockTokens(o.items[c].text,[]),!o.loose){let h=o.items[c].tokens.filter(f=>f.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=d}if(o.loose)for(let c=0;c<o.items.length;c++)o.items[c].loose=!0;return o}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let i=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:i,raw:r[0],href:s,title:o}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=Rc(r[1]),s=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
187
+ `):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===s.length){for(let n of s)this.rules.other.tableAlignRight.test(n)?a.align.push("right"):this.rules.other.tableAlignCenter.test(n)?a.align.push("center"):this.rules.other.tableAlignLeft.test(n)?a.align.push("left"):a.align.push(null);for(let n=0;n<i.length;n++)a.header.push({text:i[n],tokens:this.lexer.inline(i[n]),header:!0,align:a.align[n]});for(let n of o)a.rows.push(Rc(n,a.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
188
+ `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=Ui(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=i_(r[2],"()");if(a===-2)return;if(a>-1){let n=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,n).trim(),r[3]=""}}let s=r[2],o="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],o=a[3])}else o=r[3]?r[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?s=s.slice(1):s=s.slice(1,-1)),Ic(r,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let s=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=r[s.toLowerCase()];if(!o){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return Ic(i,o,i[0],this.lexer,this.rules)}}emStrong(t,r,i=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||s[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!i||this.rules.inline.punctuation.exec(i))){let o=[...s[0]].length-1,a,n,l=o,c=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+o);(s=h.exec(r))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(n=[...a].length,s[3]||s[4]){l+=n;continue}else if((s[5]||s[6])&&o%3&&!((o+n)%3)){c+=n;continue}if(l-=n,l>0)continue;n=Math.min(n,n+l+c);let d=[...s[0]][0].length,f=t.slice(0,o+s.index+d+n);if(Math.min(o,n)%2){let p=f.slice(1,-1);return{type:"em",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}let u=f.slice(2,-2);return{type:"strong",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let i=r[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return s&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:r[0],text:i}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let i,s;return r[2]==="@"?(i=r[1],s="mailto:"+i):(i=r[1],s=i),{type:"link",raw:r[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(t){let r;if(r=this.rules.inline.url.exec(t)){let i,s;if(r[2]==="@")i=r[0],s="mailto:"+i;else{let o;do o=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(o!==r[0]);i=r[0],r[1]==="www."?s="http://"+r[0]:s=r[0]}return{type:"link",raw:r[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let i=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:i}}}},Be=class Hn{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||zr,this.options.tokenizer=this.options.tokenizer||new No,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:ce,block:Gs.normal,inline:Yi.normal};this.options.pedantic?(r.block=Gs.pedantic,r.inline=Yi.pedantic):this.options.gfm&&(r.block=Gs.gfm,this.options.breaks?r.inline=Yi.breaks:r.inline=Yi.gfm),this.tokenizer.rules=r}static get rules(){return{block:Gs,inline:Yi}}static lex(t,r){return new Hn(r).lex(t)}static lexInline(t,r){return new Hn(r).inlineTokens(t)}lex(t){t=t.replace(ce.carriageReturn,`
189
+ `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],i=!1){for(this.options.pedantic&&(t=t.replace(ce.tabCharGlobal," ").replace(ce.spaceLine,""));t;){let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},t,r))?(t=t.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.space(t)){t=t.substring(s.raw.length);let a=r.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
190
+ `:r.push(s);continue}if(s=this.tokenizer.code(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
191
+ `)?"":`
192
+ `)+s.raw,a.text+=`
193
+ `+s.text,this.inlineQueue.at(-1).src=a.text):r.push(s);continue}if(s=this.tokenizer.fences(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.heading(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.hr(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.blockquote(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.list(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.html(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.def(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
194
+ `)?"":`
195
+ `)+s.raw,a.text+=`
196
+ `+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},r.push(s));continue}if(s=this.tokenizer.table(t)){t=t.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.lheading(t)){t=t.substring(s.raw.length),r.push(s);continue}let o=t;if(this.options.extensions?.startBlock){let a=1/0,n=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},n),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(o=t.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(o))){let a=r.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
197
+ `)?"":`
198
+ `)+s.raw,a.text+=`
199
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(s),i=o.length!==t.length,t=t.substring(s.raw.length);continue}if(s=this.tokenizer.text(t)){t=t.substring(s.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
200
+ `)?"":`
201
+ `)+s.raw,a.text+=`
202
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(s);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){let i=t,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)o=s[2]?s[2].length:0,i=i.slice(0,s.index+o)+"["+"a".repeat(s[0].length-o-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,n="";for(;t;){a||(n=""),a=!1;let l;if(this.options.extensions?.inline?.some(h=>(l=h.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let h=r.at(-1);l.type==="text"&&h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(t,i,n)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),r.push(l);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,d=t.slice(1),f;this.options.extensions.startInline.forEach(u=>{f=u.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(n=l.raw.slice(-1)),a=!0;let h=r.at(-1);h?.type==="text"?(h.raw+=l.raw,h.text+=l.text):r.push(l);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return r}},qo=class{options;parser;constructor(t){this.options=t||zr}space(t){return""}code({text:t,lang:r,escaped:i}){let s=(r||"").match(ce.notSpaceStart)?.[0],o=t.replace(ce.endingNewline,"")+`
203
+ `;return s?'<pre><code class="language-'+De(s)+'">'+(i?o:De(o,!0))+`</code></pre>
204
+ `:"<pre><code>"+(i?o:De(o,!0))+`</code></pre>
205
+ `}blockquote({tokens:t}){return`<blockquote>
206
+ ${this.parser.parse(t)}</blockquote>
207
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
208
+ `}hr(t){return`<hr>
209
+ `}list(t){let r=t.ordered,i=t.start,s="";for(let n=0;n<t.items.length;n++){let l=t.items[n];s+=this.listitem(l)}let o=r?"ol":"ul",a=r&&i!==1?' start="'+i+'"':"";return"<"+o+a+`>
210
+ `+s+"</"+o+`>
211
+ `}listitem(t){let r="";if(t.task){let i=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=i+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=i+" "+De(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):r+=i+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
212
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
213
+ `}table(t){let r="",i="";for(let o=0;o<t.header.length;o++)i+=this.tablecell(t.header[o]);r+=this.tablerow({text:i});let s="";for(let o=0;o<t.rows.length;o++){let a=t.rows[o];i="";for(let n=0;n<a.length;n++)i+=this.tablecell(a[n]);s+=this.tablerow({text:i})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
214
+ <thead>
215
+ `+r+`</thead>
216
+ `+s+`</table>
217
+ `}tablerow({text:t}){return`<tr>
218
+ ${t}</tr>
219
+ `}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
220
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${De(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let s=this.parser.parseInline(i),o=Oc(t);if(o===null)return s;t=o;let a='<a href="'+t+'"';return r&&(a+=' title="'+De(r)+'"'),a+=">"+s+"</a>",a}image({href:t,title:r,text:i,tokens:s}){s&&(i=this.parser.parseInline(s,this.parser.textRenderer));let o=Oc(t);if(o===null)return De(i);t=o;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${De(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:De(t.text)}},gh=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Le=class Yn{options;renderer;textRenderer;constructor(t){this.options=t||zr,this.options.renderer=this.options.renderer||new qo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new gh}static parse(t,r){return new Yn(r).parse(t)}static parseInline(t,r){return new Yn(r).parseInline(t)}parse(t,r=!0){let i="";for(let s=0;s<t.length;s++){let o=t[s];if(this.options.extensions?.renderers?.[o.type]){let n=o,l=this.options.extensions.renderers[n.type].call({parser:this},n);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=l||"";continue}}let a=o;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let n=a,l=this.renderer.text(n);for(;s+1<t.length&&t[s+1].type==="text";)n=t[++s],l+=`
221
+ `+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let s=0;s<t.length;s++){let o=t[s];if(this.options.extensions?.renderers?.[o.type]){let n=this.options.extensions.renderers[o.type].call({parser:this},o);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=n||"";continue}}let a=o;switch(a.type){case"escape":{i+=r.text(a);break}case"html":{i+=r.html(a);break}case"link":{i+=r.link(a);break}case"image":{i+=r.image(a);break}case"strong":{i+=r.strong(a);break}case"em":{i+=r.em(a);break}case"codespan":{i+=r.codespan(a);break}case"br":{i+=r.br(a);break}case"del":{i+=r.del(a);break}case"text":{i+=r.text(a);break}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},is=class{options;block;constructor(t){this.options=t||zr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Be.lex:Be.lexInline}provideParser(){return this.block?Le.parse:Le.parseInline}},o_=class{defaults=ah();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Le;Renderer=qo;TextRenderer=gh;Lexer=Be;Tokenizer=No;Hooks=is;constructor(...t){this.use(...t)}walkTokens(t,r){let i=[];for(let s of t)switch(i=i.concat(r.call(this,s)),s.type){case"table":{let o=s;for(let a of o.header)i=i.concat(this.walkTokens(a.tokens,r));for(let a of o.rows)for(let n of a)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let o=s;i=i.concat(this.walkTokens(o.items,r));break}default:{let o=s;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{let n=o[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):o.tokens&&(i=i.concat(this.walkTokens(o.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let s={...i};if(s.async=this.defaults.async||s.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let a=r.renderers[o.name];a?r.renderers[o.name]=function(...n){let l=o.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[o.level];a?a.unshift(o.tokenizer):r[o.level]=[o.tokenizer],o.start&&(o.level==="block"?r.startBlock?r.startBlock.push(o.start):r.startBlock=[o.start]:o.level==="inline"&&(r.startInline?r.startInline.push(o.start):r.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(r.childTokens[o.name]=o.childTokens)}),s.extensions=r),i.renderer){let o=this.defaults.renderer||new qo(this.defaults);for(let a in i.renderer){if(!(a in o))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=o[n];o[n]=(...h)=>{let d=l.apply(o,h);return d===!1&&(d=c.apply(o,h)),d||""}}s.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new No(this.defaults);for(let a in i.tokenizer){if(!(a in o))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=o[n];o[n]=(...h)=>{let d=l.apply(o,h);return d===!1&&(d=c.apply(o,h)),d}}s.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new is;for(let a in i.hooks){if(!(a in o))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=o[n];is.passThroughHooks.has(a)?o[n]=h=>{if(this.defaults.async&&is.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(o,h);return c.call(o,f)})();let d=l.call(o,h);return c.call(o,d)}:o[n]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(o,h);return f===!1&&(f=await c.apply(o,h)),f})();let d=l.apply(o,h);return d===!1&&(d=c.apply(o,h)),d}}s.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,a=i.walkTokens;s.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),o&&(l=l.concat(o.call(this,n))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Be.lex(t,r??this.defaults)}parser(t,r){return Le.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let s={...i},o={...this.defaults,...s},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let n=o.hooks?await o.hooks.preprocess(r):r,l=await(o.hooks?await o.hooks.provideLexer():t?Be.lex:Be.lexInline)(n,o),c=o.hooks?await o.hooks.processAllTokens(l):l;o.walkTokens&&await Promise.all(this.walkTokens(c,o.walkTokens));let h=await(o.hooks?await o.hooks.provideParser():t?Le.parse:Le.parseInline)(c,o);return o.hooks?await o.hooks.postprocess(h):h})().catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let n=(o.hooks?o.hooks.provideLexer():t?Be.lex:Be.lexInline)(r,o);o.hooks&&(n=o.hooks.processAllTokens(n)),o.walkTokens&&this.walkTokens(n,o.walkTokens);let l=(o.hooks?o.hooks.provideParser():t?Le.parse:Le.parseInline)(n,o);return o.hooks&&(l=o.hooks.postprocess(l)),l}catch(n){return a(n)}}}onError(t,r){return i=>{if(i.message+=`
222
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+De(i.message+"",!0)+"</pre>";return r?Promise.resolve(s):s}if(r)return Promise.reject(i);throw i}}},Nr=new o_;function vt(e,t){return Nr.parse(e,t)}vt.options=vt.setOptions=function(e){return Nr.setOptions(e),vt.defaults=Nr.defaults,Ip(vt.defaults),vt};vt.getDefaults=ah;vt.defaults=zr;vt.use=function(...e){return Nr.use(...e),vt.defaults=Nr.defaults,Ip(vt.defaults),vt};vt.walkTokens=function(e,t){return Nr.walkTokens(e,t)};vt.parseInline=Nr.parseInline;vt.Parser=Le;vt.parser=Le.parse;vt.Renderer=qo;vt.TextRenderer=gh;vt.Lexer=Be;vt.lexer=Be.lex;vt.Tokenizer=No;vt.Hooks=is;vt.parse=vt;vt.options;vt.setOptions;vt.use;vt.walkTokens;vt.parseInline;Le.parse;Be.lex;function Xp(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var s=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var d,f;return(f=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&f!==void 0?f:0})):n},[]);if(s.length){var o=new RegExp(`
223
+ [ ]{`+Math.min.apply(Math,s)+"}","g");i=i.map(function(n){return n.replace(o,`
224
+ `)})}i[0]=i[0].replace(/^\r?\n/,"");var a=i[0];return t.forEach(function(n,l){var c=a.match(/(?:^|\n)( *)$/),h=c?c[1]:"",d=n;typeof n=="string"&&n.includes(`
225
+ `)&&(d=String(n).split(`
226
+ `).map(function(f,u){return u===0?f:""+h+f}).join(`
227
+ `)),a+=d+i[l+1]}),a}function Gp(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
228
+ `).replace(/\n{2,}/g,`
229
+ `);return Xp(i)}g(Gp,"preprocessMarkdown");function Vp(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}g(Vp,"nonMarkdownToLines");function Zp(e,t={}){const r=Gp(e,t),i=vt.lexer(r),s=[[]];let o=0;function a(n,l="normal"){n.type==="text"?n.text.split(`
230
+ `).forEach((h,d)=>{d!==0&&(o++,s.push([])),h.split(" ").forEach(f=>{f=f.replace(/&#39;/g,"'"),f&&s[o].push({content:f,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&s[o].push({content:n.text,type:"normal"})}return g(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?s[o].push({content:n.text,type:"normal"}):s[o].push({content:n.raw,type:"normal"})}),s}g(Zp,"markdownToLines");function Kp(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}g(Kp,"nonMarkdownToHTML");function Qp(e,{markdownAutoWrap:t}={}){const r=vt.lexer(e);function i(s){return s.type==="text"?t===!1?s.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):s.text.replace(/\n */g,"<br/>"):s.type==="strong"?`<strong>${s.tokens?.map(i).join("")}</strong>`:s.type==="em"?`<em>${s.tokens?.map(i).join("")}</em>`:s.type==="paragraph"?`<p>${s.tokens?.map(i).join("")}</p>`:s.type==="space"?"":s.type==="html"?`${s.text}`:s.type==="escape"?s.text:(V.warn(`Unsupported markdown: ${s.type}`),s.raw)}return g(i,"output"),r.map(i).join("")}g(Qp,"markdownToHTML");function Jp(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}g(Jp,"splitTextToChars");function tm(e,t){const r=Jp(t.content);return ph(e,[],r,t.type)}g(tm,"splitWordToFitWidth");function ph(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[s,...o]=r,a=[...t,s];return e([{content:a.join(""),type:i}])?ph(e,a,o,i):(t.length===0&&s&&(t.push(s),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}g(ph,"splitWordToFitWidthRecursion");function em(e,t){if(e.some(({content:r})=>r.includes(`
231
+ `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return zo(e,t)}g(em,"splitLineToFitWidth");function zo(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let s="";e[0].content===" "&&(s=" ",e.shift());const o=e.shift()??{content:" ",type:"normal"},a=[...i];if(s!==""&&a.push({content:s,type:"normal"}),a.push(o),t(a))return zo(e,t,r,a);if(i.length>0)r.push(i),e.unshift(o);else if(o.content){const[n,l]=tm(t,o);r.push([n]),l.content&&e.unshift(l)}return zo(e,t,r)}g(zo,"splitLineToFitWidthRecursion");function Un(e,t){t&&e.attr("style",t)}g(Un,"applyStyle");var Pc=16384;async function rm(e,t,r,i,s=!1,o=At()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,Pc)}px`),a.attr("height",`${Math.min(10*r,Pc)}px`);const n=a.append("xhtml:div"),l=ki(t.label)?await Cl(t.label.replace(Ai.lineBreakRegex,`
232
+ `),o):we(t.label,o),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),Un(h,t.labelStyle),h.attr("class",`${c} ${i}`),Un(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),s&&n.attr("class","labelBkg");let d=n.node().getBoundingClientRect();return d.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),d=n.node().getBoundingClientRect()),a.node()}g(rm,"addHtmlSpan");function ma(e,t,r,i=!1){const s=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&s.attr("text-anchor","middle"),s}g(ma,"createTspan");function im(e,t,r){const i=e.append("text"),s=ma(i,1,t);ya(s,r);const o=s.node().getComputedTextLength();return i.remove(),o}g(im,"computeWidthOfText");function sm(e,t,r){const i=e.append("text"),s=ma(i,1,t);ya(s,[{content:r,type:"normal"}]);const o=s.node()?.getBoundingClientRect();return o&&i.remove(),o}g(sm,"computeDimensionOfText");function om(e,t,r,i=!1,s=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");s&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=g(u=>im(a,1.1,u)<=e,"checkWidth"),f=d(h)?[h]:em(h,d);for(const u of f){const p=ma(l,c,1.1,s);ya(p,u),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}g(om,"createFormattedText");function Xn(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}g(Xn,"decodeHTMLEntities");function ya(e,t){e.text(""),t.forEach((r,i)=>{const s=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?s.text(Xn(r.content)):s.text(" "+Xn(r.content))})}g(ya,"updateTextContentAndStyles");async function am(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(s,o,a)=>(r.push((async()=>{const n=`${o}:${a}`;return await wT(n)?await Oi(n,void 0,{class:"label-icon"}):`<i class='${we(s,t).replace(":"," ")}'></i>`})()),s));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}g(am,"replaceIconSubstring");var Oe=g(async(e,t="",{style:r="",isTitle:i=!1,classes:s="",useHtmlLabels:o=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(V.debug("XYZ createText",t,r,i,s,o,n,"addSvgBackground: ",c),o){const d=a?Qp(t,h):Kp(t),f=await am(yr(d),h),u=t.replace(/\\\\/g,"\\"),p={isNode:n,label:ki(t)?u:f,labelStyle:r.replace("fill:","color:")};return await rm(e,p,l,s,c,h)}else{const d=yr(t.replace(/<br\s*\/?>/g,"<br/>")),f=a?Zp(d.replace("<br>","<br/>"),h):Vp(d),u=om(l,e,f,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(u).attr("style",p)}else{const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");pt(u).select("rect").attr("style",p.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");pt(u).select("text").attr("style",m)}return i?pt(u).selectAll("tspan.text-outer-tspan").classed("title-row",!0):pt(u).selectAll("tspan.text-outer-tspan").classed("row",!0),u}},"createText");function za(e,t,r){if(e&&e.length){const[i,s]=t,o=Math.PI/180*r,a=Math.cos(o),n=Math.sin(o);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-s)*n+i,l[1]=(c-i)*n+(h-s)*a+s}}}function a_(e,t){return e[0]===t[0]&&e[1]===t[1]}function n_(e,t,r,i=1){const s=r,o=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(s)for(const c of a)za(c,n,s);const l=(function(c,h,d){const f=[];for(const C of c){const k=[...C];a_(k[0],k[k.length-1])||k.push([k[0][0],k[0][1]]),k.length>2&&f.push(k)}const u=[];h=Math.max(h,.1);const p=[];for(const C of f)for(let k=0;k<C.length-1;k++){const v=C[k],S=C[k+1];if(v[1]!==S[1]){const T=Math.min(v[1],S[1]);p.push({ymin:T,ymax:Math.max(v[1],S[1]),x:T===v[1]?v[0]:S[0],islope:(S[0]-v[0])/(S[1]-v[1])})}}if(p.sort(((C,k)=>C.ymin<k.ymin?-1:C.ymin>k.ymin?1:C.x<k.x?-1:C.x>k.x?1:C.ymax===k.ymax?0:(C.ymax-k.ymax)/Math.abs(C.ymax-k.ymax))),!p.length)return u;let m=[],y=p[0].ymin,x=0;for(;m.length||p.length;){if(p.length){let C=-1;for(let k=0;k<p.length&&!(p[k].ymin>y);k++)C=k;p.splice(0,C+1).forEach((k=>{m.push({s:y,edge:k})}))}if(m=m.filter((C=>!(C.edge.ymax<=y))),m.sort(((C,k)=>C.edge.x===k.edge.x?0:(C.edge.x-k.edge.x)/Math.abs(C.edge.x-k.edge.x))),(d!==1||x%h==0)&&m.length>1)for(let C=0;C<m.length;C+=2){const k=C+1;if(k>=m.length)break;const v=m[C].edge,S=m[k].edge;u.push([[Math.round(v.x),y],[Math.round(S.x),y]])}y+=d,m.forEach((C=>{C.edge.x=C.edge.x+d*C.edge.islope})),x++}return u})(a,o,i);if(s){for(const c of a)za(c,n,-s);(function(c,h,d){const f=[];c.forEach((u=>f.push(...u))),za(f,h,d)})(l,n,-s)}return l}function Rs(e,t){var r;const i=t.hachureAngle+90;let s=t.hachureGap;s<0&&(s=4*t.strokeWidth),s=Math.round(Math.max(s,.1));let o=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(o=s),n_(e,s,i,o||1)}class mh{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Rs(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const s of t)i.push(...this.helper.doubleLineOps(s[0][0],s[0][1],s[1][0],s[1][1],r));return i}}function xa(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class l_ extends mh{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const s=Rs(t,Object.assign({},r,{hachureGap:i})),o=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(o),l=.5*i*Math.sin(o);for(const[c,h]of s)xa([c,h])&&a.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class h_ extends mh{fillPolygons(t,r){const i=this._fillPolygons(t,r),s=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),o=this._fillPolygons(t,s);return i.ops=i.ops.concat(o.ops),i}}class c_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Rs(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let s=r.hachureGap;s<0&&(s=4*r.strokeWidth),s=Math.max(s,.1);let o=r.fillWeight;o<0&&(o=r.strokeWidth/2);const a=s/4;for(const n of t){const l=xa(n),c=l/s,h=Math.ceil(c)-1,d=l-h*s,f=(n[0][0]+n[1][0])/2-s/4,u=Math.min(n[0][1],n[1][1]);for(let p=0;p<h;p++){const m=u+d+p*s,y=f-a+2*Math.random()*a,x=m-a+2*Math.random()*a,C=this.helper.ellipse(y,x,o,o,r);i.push(...C.ops)}}return{type:"fillSketch",ops:i}}}class d_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Rs(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,s=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,o=[];return t.forEach((a=>{const n=xa(a),l=Math.floor(n/(i+s)),c=(n+s-l*(i+s))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let u=0;u<l;u++){const p=u*(i+s),m=p+i,y=[h[0]+p*Math.cos(f)+c*Math.cos(f),h[1]+p*Math.sin(f)+c*Math.sin(f)],x=[h[0]+m*Math.cos(f)+c*Math.cos(f),h[1]+m*Math.sin(f)+c*Math.sin(f)];o.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r))}})),o}}class u_{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,s=r.zigzagOffset<0?i:r.zigzagOffset,o=Rs(t,r=Object.assign({},r,{hachureGap:i+s}));return{type:"fillSketch",ops:this.zigzagLines(o,s,r)}}zigzagLines(t,r,i){const s=[];return t.forEach((o=>{const a=xa(o),n=Math.round(a/(2*r));let l=o[0],c=o[1];l[0]>c[0]&&(l=o[1],c=o[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const f=2*d*r,u=2*(d+1)*r,p=Math.sqrt(2*Math.pow(r,2)),m=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],y=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],x=[m[0]+p*Math.cos(h+Math.PI/4),m[1]+p*Math.sin(h+Math.PI/4)];s.push(...this.helper.doubleLineOps(m[0],m[1],x[0],x[1],i),...this.helper.doubleLineOps(x[0],x[1],y[0],y[1],i))}})),s}}const de={};class f_{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const g_=0,ja=1,Dc=2,Vs={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Wa(e,t){return e.type===t}function yh(e){const t=[],r=(function(a){const n=new Array;for(;a!=="";)if(a.match(/^([ \t\r\n,]+)/))a=a.substr(RegExp.$1.length);else if(a.match(/^([aAcChHlLmMqQsStTvVzZ])/))n[n.length]={type:g_,text:RegExp.$1},a=a.substr(RegExp.$1.length);else{if(!a.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];n[n.length]={type:ja,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:Dc,text:""},n})(e);let i="BOD",s=0,o=r[s];for(;!Wa(o,Dc);){let a=0;const n=[];if(i==="BOD"){if(o.text!=="M"&&o.text!=="m")return yh("M0,0"+e);s++,a=Vs[o.text],i=o.text}else Wa(o,ja)?a=Vs[i]:(s++,a=Vs[o.text],i=o.text);if(!(s+a<r.length))throw new Error("Path data ended short");for(let l=s;l<s+a;l++){const c=r[l];if(!Wa(c,ja))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Vs[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),s+=a,o=r[s],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function nm(e){let t=0,r=0,i=0,s=0;const o=[];for(const{key:a,data:n}of e)switch(a){case"M":o.push({key:"M",data:[...n]}),[t,r]=n,[i,s]=n;break;case"m":t+=n[0],r+=n[1],o.push({key:"M",data:[t,r]}),i=t,s=r;break;case"L":o.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],o.push({key:"L",data:[t,r]});break;case"C":o.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+r:c+t));o.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":o.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));o.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":o.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],o.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":o.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],o.push({key:"V",data:[r]});break;case"S":o.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));o.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":o.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],o.push({key:"T",data:[t,r]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=i,r=s}return o}function lm(e){const t=[];let r="",i=0,s=0,o=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,s]=h,[o,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],s=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,s]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,s]});break;case"V":s=h[0],t.push({key:"L",data:[i,s]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=i+(i-n),f=s+(s-l)):(d=i,f=s),t.push({key:"C",data:[d,f,...h]}),n=h[0],l=h[1],i=h[2],s=h[3];break}case"T":{const[d,f]=h;let u=0,p=0;r==="Q"||r==="T"?(u=i+(i-n),p=s+(s-l)):(u=i,p=s);const m=i+2*(u-i)/3,y=s+2*(p-s)/3,x=d+2*(u-d)/3,C=f+2*(p-f)/3;t.push({key:"C",data:[m,y,x,C,d,f]}),n=u,l=p,i=d,s=f;break}case"Q":{const[d,f,u,p]=h,m=i+2*(d-i)/3,y=s+2*(f-s)/3,x=u+2*(d-u)/3,C=p+2*(f-p)/3;t.push({key:"C",data:[m,y,x,C,u,p]}),n=d,l=f,i=u,s=p;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),u=h[2],p=h[3],m=h[4],y=h[5],x=h[6];d===0||f===0?(t.push({key:"C",data:[i,s,y,x,y,x]}),i=y,s=x):(i!==y||s!==x)&&(hm(i,s,y,x,d,f,u,p,m).forEach((function(C){t.push({key:"C",data:C})})),i=y,s=x);break}case"Z":t.push({key:"Z",data:[]}),i=o,s=a}r=c}return t}function Xi(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function hm(e,t,r,i,s,o,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let f=[],u=0,p=0,m=0,y=0;if(c)[u,p,m,y]=c;else{[e,t]=Xi(e,t,-h),[r,i]=Xi(r,i,-h);const U=(e-r)/2,I=(t-i)/2;let M=U*U/(s*s)+I*I/(o*o);M>1&&(M=Math.sqrt(M),s*=M,o*=M);const A=s*s,z=o*o,R=A*z-A*I*I-z*U*U,$=A*I*I+z*U*U,N=(n===l?-1:1)*Math.sqrt(Math.abs(R/$));m=N*s*I/o+(e+r)/2,y=N*-o*U/s+(t+i)/2,u=Math.asin(parseFloat(((t-y)/o).toFixed(9))),p=Math.asin(parseFloat(((i-y)/o).toFixed(9))),e<m&&(u=Math.PI-u),r<m&&(p=Math.PI-p),u<0&&(u=2*Math.PI+u),p<0&&(p=2*Math.PI+p),l&&u>p&&(u-=2*Math.PI),!l&&p>u&&(p-=2*Math.PI)}let x=p-u;if(Math.abs(x)>120*Math.PI/180){const U=p,I=r,M=i;p=l&&p>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,f=hm(r=m+s*Math.cos(p),i=y+o*Math.sin(p),I,M,s,o,a,0,l,[p,U,m,y])}x=p-u;const C=Math.cos(u),k=Math.sin(u),v=Math.cos(p),S=Math.sin(p),T=Math.tan(x/4),B=4/3*s*T,_=4/3*o*T,P=[e,t],O=[e+B*k,t-_*C],D=[r+B*S,i-_*v],H=[r,i];if(O[0]=2*P[0]-O[0],O[1]=2*P[1]-O[1],c)return[O,D,H].concat(f);{f=[O,D,H].concat(f);const U=[];for(let I=0;I<f.length;I+=3){const M=Xi(f[I][0],f[I][1],h),A=Xi(f[I+1][0],f[I+1][1],h),z=Xi(f[I+2][0],f[I+2][1],h);U.push([M[0],M[1],A[0],A[1],z[0],z[1]])}return U}}const p_={randOffset:function(e,t){return ht(e,t)},randOffsetWithRange:function(e,t,r){return jo(e,t,r)},ellipse:function(e,t,r,i,s){const o=dm(r,i,s);return Gn(e,t,s,o).opset},doubleLineOps:function(e,t,r,i,s){return xr(e,t,r,i,s,!0)}};function cm(e,t,r,i,s){return{type:"path",ops:xr(e,t,r,i,s)}}function ho(e,t,r){const i=(e||[]).length;if(i>2){const s=[];for(let o=0;o<i-1;o++)s.push(...xr(e[o][0],e[o][1],e[o+1][0],e[o+1][1],r));return t&&s.push(...xr(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:s}}return i===2?cm(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function m_(e,t,r,i,s){return(function(o,a){return ho(o,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],s)}function Nc(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=Zs(r[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:Zs(r[0],1.5*(1+.22*t.roughness),jc(t));for(let o=1;o<r.length;o++){const a=r[o];if(a.length){const n=Zs(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Zs(a,1.5*(1+.22*t.roughness),jc(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&s.push(c)}}return{type:"path",ops:i.concat(s)}}return{type:"path",ops:[]}}function dm(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),s=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),o=2*Math.PI/s;let a=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return a+=ht(a*l,r),n+=ht(n*l,r),{increment:o,rx:a,ry:n}}function Gn(e,t,r,i){const[s,o]=Wc(i.increment,e,t,i.rx,i.ry,1,i.increment*jo(.1,jo(.4,1,r),r),r);let a=Wo(s,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=Wc(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=Wo(n,null,r);a=a.concat(l)}return{estimatedPoints:o,opset:{type:"path",ops:a}}}function qc(e,t,r,i,s,o,a,n,l){const c=e,h=t;let d=Math.abs(r/2),f=Math.abs(i/2);d+=ht(.01*d,l),f+=ht(.01*f,l);let u=s,p=o;for(;u<0;)u+=2*Math.PI,p+=2*Math.PI;p-u>2*Math.PI&&(u=0,p=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(p-u)/2),x=Hc(y,c,h,d,f,u,p,1,l);if(!l.disableMultiStroke){const C=Hc(y,c,h,d,f,u,p,1.5,l);x.push(...C)}return a&&(n?x.push(...xr(c,h,c+d*Math.cos(u),h+f*Math.sin(u),l),...xr(c,h,c+d*Math.cos(p),h+f*Math.sin(p),l)):x.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(u),h+f*Math.sin(u)]})),{type:"path",ops:x}}function zc(e,t){const r=lm(nm(yh(e))),i=[];let s=[0,0],o=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":o=[n[0],n[1]],s=[n[0],n[1]];break;case"L":i.push(...xr(o[0],o[1],n[0],n[1],t)),o=[n[0],n[1]];break;case"C":{const[l,c,h,d,f,u]=n;i.push(...y_(l,c,h,d,f,u,o,t)),o=[f,u];break}case"Z":i.push(...xr(o[0],o[1],s[0],s[1],t)),o=[s[0],s[1]]}return{type:"path",ops:i}}function Ha(e,t){const r=[];for(const i of e)if(i.length){const s=t.maxRandomnessOffset||0,o=i.length;if(o>2){r.push({op:"move",data:[i[0][0]+ht(s,t),i[0][1]+ht(s,t)]});for(let a=1;a<o;a++)r.push({op:"lineTo",data:[i[a][0]+ht(s,t),i[a][1]+ht(s,t)]})}}return{type:"fillPath",ops:r}}function Hr(e,t){return(function(r,i){let s=r.fillStyle||"hachure";if(!de[s])switch(s){case"zigzag":de[s]||(de[s]=new l_(i));break;case"cross-hatch":de[s]||(de[s]=new h_(i));break;case"dots":de[s]||(de[s]=new c_(i));break;case"dashed":de[s]||(de[s]=new d_(i));break;case"zigzag-line":de[s]||(de[s]=new u_(i));break;default:s="hachure",de[s]||(de[s]=new mh(i))}return de[s]})(t,p_).fillPolygons(e,t)}function jc(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function um(e){return e.randomizer||(e.randomizer=new f_(e.seed||0)),e.randomizer.next()}function jo(e,t,r,i=1){return r.roughness*i*(um(r)*(t-e)+e)}function ht(e,t,r=1){return jo(-e,e,t,r)}function xr(e,t,r,i,s,o=!1){const a=o?s.disableMultiStrokeFill:s.disableMultiStroke,n=Vn(e,t,r,i,s,!0,!1);if(a)return n;const l=Vn(e,t,r,i,s,!0,!0);return n.concat(l)}function Vn(e,t,r,i,s,o,a){const n=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=s.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,f=.2+.2*um(s);let u=s.bowing*s.maxRandomnessOffset*(i-t)/200,p=s.bowing*s.maxRandomnessOffset*(e-r)/200;u=ht(u,s,c),p=ht(p,s,c);const m=[],y=()=>ht(d,s,c),x=()=>ht(h,s,c),C=s.preserveVertices;return a?m.push({op:"move",data:[e+(C?0:y()),t+(C?0:y())]}):m.push({op:"move",data:[e+(C?0:ht(h,s,c)),t+(C?0:ht(h,s,c))]}),a?m.push({op:"bcurveTo",data:[u+e+(r-e)*f+y(),p+t+(i-t)*f+y(),u+e+2*(r-e)*f+y(),p+t+2*(i-t)*f+y(),r+(C?0:y()),i+(C?0:y())]}):m.push({op:"bcurveTo",data:[u+e+(r-e)*f+x(),p+t+(i-t)*f+x(),u+e+2*(r-e)*f+x(),p+t+2*(i-t)*f+x(),r+(C?0:x()),i+(C?0:x())]}),m}function Zs(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+ht(t,r),e[0][1]+ht(t,r)]),i.push([e[0][0]+ht(t,r),e[0][1]+ht(t,r)]);for(let s=1;s<e.length;s++)i.push([e[s][0]+ht(t,r),e[s][1]+ht(t,r)]),s===e.length-1&&i.push([e[s][0]+ht(t,r),e[s][1]+ht(t,r)]);return Wo(i,null,r)}function Wo(e,t,r){const i=e.length,s=[];if(i>3){const o=[],a=1-r.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];o[0]=[l[0],l[1]],o[1]=[l[0]+(a*e[n+1][0]-a*e[n-1][0])/6,l[1]+(a*e[n+1][1]-a*e[n-1][1])/6],o[2]=[e[n+1][0]+(a*e[n][0]-a*e[n+2][0])/6,e[n+1][1]+(a*e[n][1]-a*e[n+2][1])/6],o[3]=[e[n+1][0],e[n+1][1]],s.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}}else i===3?(s.push({op:"move",data:[e[1][0],e[1][1]]}),s.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&s.push(...Vn(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return s}function Wc(e,t,r,i,s,o,a,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+s*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+s*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+s*Math.sin(0)]),c.push([t+i*Math.cos(e),r+s*Math.sin(e)])}else{const h=ht(.5,n)-Math.PI/2;c.push([ht(o,n)+t+.9*i*Math.cos(h-e),ht(o,n)+r+.9*s*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let f=h;f<d;f+=e){const u=[ht(o,n)+t+i*Math.cos(f),ht(o,n)+r+s*Math.sin(f)];l.push(u),c.push(u)}c.push([ht(o,n)+t+i*Math.cos(h+2*Math.PI+.5*a),ht(o,n)+r+s*Math.sin(h+2*Math.PI+.5*a)]),c.push([ht(o,n)+t+.98*i*Math.cos(h+a),ht(o,n)+r+.98*s*Math.sin(h+a)]),c.push([ht(o,n)+t+.9*i*Math.cos(h+.5*a),ht(o,n)+r+.9*s*Math.sin(h+.5*a)])}return[c,l]}function Hc(e,t,r,i,s,o,a,n,l){const c=o+ht(.1,l),h=[];h.push([ht(n,l)+t+.9*i*Math.cos(c-e),ht(n,l)+r+.9*s*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([ht(n,l)+t+i*Math.cos(d),ht(n,l)+r+s*Math.sin(d)]);return h.push([t+i*Math.cos(a),r+s*Math.sin(a)]),h.push([t+i*Math.cos(a),r+s*Math.sin(a)]),Wo(h,null,l)}function y_(e,t,r,i,s,o,a,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,f=n.preserveVertices;for(let u=0;u<d;u++)u===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(f?0:ht(c[0],n)),a[1]+(f?0:ht(c[0],n))]}),h=f?[s,o]:[s+ht(c[u],n),o+ht(c[u],n)],l.push({op:"bcurveTo",data:[e+ht(c[u],n),t+ht(c[u],n),r+ht(c[u],n),i+ht(c[u],n),h[0],h[1]]});return l}function Gi(e){return[...e]}function Yc(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Gi(e[0]),Gi(e[1]),Gi(e[2]),Gi(e[2]));else{const s=[];s.push(e[0],e[0]);for(let n=1;n<e.length;n++)s.push(e[n]),n===e.length-1&&s.push(e[n]);const o=[],a=1-t;i.push(Gi(s[0]));for(let n=1;n+2<s.length;n++){const l=s[n];o[0]=[l[0],l[1]],o[1]=[l[0]+(a*s[n+1][0]-a*s[n-1][0])/6,l[1]+(a*s[n+1][1]-a*s[n-1][1])/6],o[2]=[s[n+1][0]+(a*s[n][0]-a*s[n+2][0])/6,s[n+1][1]+(a*s[n][1]-a*s[n+2][1])/6],o[3]=[s[n+1][0],s[n+1][1]],i.push(o[1],o[2],o[3])}}return i}function co(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function x_(e,t,r){const i=co(t,r);if(i===0)return co(e,t);let s=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return s=Math.max(0,Math.min(1,s)),co(e,_r(t,r,s))}function _r(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Zn(e,t,r,i){const s=i||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],f=n[l+3];let u=3*h[0]-2*c[0]-f[0];u*=u;let p=3*h[1]-2*c[1]-f[1];p*=p;let m=3*d[0]-2*f[0]-c[0];m*=m;let y=3*d[1]-2*f[1]-c[1];return y*=y,u<m&&(u=m),p<y&&(p=y),u+p})(e,t)<r){const n=e[t+0];s.length?(o=s[s.length-1],a=n,Math.sqrt(co(o,a))>1&&s.push(n)):s.push(n),s.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],f=_r(l,c,.5),u=_r(c,h,.5),p=_r(h,d,.5),m=_r(f,u,.5),y=_r(u,p,.5),x=_r(m,y,.5);Zn([l,f,m,x],0,r,s),Zn([x,y,p,d],0,r,s)}var o,a;return s}function C_(e,t){return Ho(e,0,e.length,t)}function Ho(e,t,r,i,s){const o=s||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=x_(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Ho(e,t,c+1,i,o),Ho(e,c,r,i,o)):(o.length||o.push(a),o.push(n)),o}function Ya(e,t=.15,r){const i=[],s=(e.length-1)/3;for(let o=0;o<s;o++)Zn(e,3*o,t,i);return r&&r>0?Ho(i,0,i.length,r):i}const me="none";class Yo{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,s,o){const a=this._o(o);return this._d("line",[cm(t,r,i,s,a)],a)}rectangle(t,r,i,s,o){const a=this._o(o),n=[],l=m_(t,r,i,s,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+s],[t,r+s]];a.fillStyle==="solid"?n.push(Ha([c],a)):n.push(Hr([c],a))}return a.stroke!==me&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,s,o){const a=this._o(o),n=[],l=dm(i,s,a),c=Gn(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=Gn(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(Hr([c.estimatedPoints],a));return a.stroke!==me&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,s){const o=this.ellipse(t,r,i,i,s);return o.shape="circle",o}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[ho(t,!1,i)],i)}arc(t,r,i,s,o,a,n=!1,l){const c=this._o(l),h=[],d=qc(t,r,i,s,o,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const u=qc(t,r,i,s,o,a,!0,!1,f);u.type="fillPath",h.push(u)}else h.push((function(f,u,p,m,y,x,C){const k=f,v=u;let S=Math.abs(p/2),T=Math.abs(m/2);S+=ht(.01*S,C),T+=ht(.01*T,C);let B=y,_=x;for(;B<0;)B+=2*Math.PI,_+=2*Math.PI;_-B>2*Math.PI&&(B=0,_=2*Math.PI);const P=(_-B)/C.curveStepCount,O=[];for(let D=B;D<=_;D+=P)O.push([k+S*Math.cos(D),v+T*Math.sin(D)]);return O.push([k+S*Math.cos(_),v+T*Math.sin(_)]),O.push([k,v]),Hr([O],C)})(t,r,i,s,o,a,c));return c.stroke!==me&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),s=[],o=Nc(t,i);if(i.fill&&i.fill!==me)if(i.fillStyle==="solid"){const a=Nc(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...Ya(Yc([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...Ya(Yc(c),10,(1+i.roughness)/2))}a.length&&s.push(Hr([a],i))}return i.stroke!==me&&s.push(o),this._d("curve",s,i)}polygon(t,r){const i=this._o(r),s=[],o=ho(t,!0,i);return i.fill&&(i.fillStyle==="solid"?s.push(Ha([t],i)):s.push(Hr([t],i))),i.stroke!==me&&s.push(o),this._d("polygon",s,i)}path(t,r){const i=this._o(r),s=[];if(!t)return this._d("path",s,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=i.fill&&i.fill!=="transparent"&&i.fill!==me,a=i.stroke!==me,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,f){const u=lm(nm(yh(h))),p=[];let m=[],y=[0,0],x=[];const C=()=>{x.length>=4&&m.push(...Ya(x,d)),x=[]},k=()=>{C(),m.length&&(p.push(m),m=[])};for(const{key:S,data:T}of u)switch(S){case"M":k(),y=[T[0],T[1]],m.push(y);break;case"L":C(),m.push([T[0],T[1]]);break;case"C":if(!x.length){const B=m.length?m[m.length-1]:y;x.push([B[0],B[1]])}x.push([T[0],T[1]]),x.push([T[2],T[3]]),x.push([T[4],T[5]]);break;case"Z":C(),m.push([y[0],y[1]])}if(k(),!f)return p;const v=[];for(const S of p){const T=C_(S,f);T.length&&v.push(T)}return v})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=zc(t,i);if(o)if(i.fillStyle==="solid")if(l.length===1){const h=zc(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else s.push(Ha(l,i));else s.push(Hr(l,i));return a&&(n?l.forEach((h=>{s.push(ho(h,!1,i))})):s.push(c)),this._d("path",s,i)}opsToPath(t,r){let i="";for(const s of t.ops){const o=typeof r=="number"&&r>=0?s.data.map((a=>+a.toFixed(r))):s.data;switch(s.op){case"move":i+=`M${o[0]} ${o[1]} `;break;case"bcurveTo":i+=`C${o[0]} ${o[1]}, ${o[2]} ${o[3]}, ${o[4]} ${o[5]} `;break;case"lineTo":i+=`L${o[0]} ${o[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,s=[];for(const o of r){let a=null;switch(o.type){case"path":a={d:this.opsToPath(o),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:me};break;case"fillPath":a={d:this.opsToPath(o),stroke:me,strokeWidth:0,fill:i.fill||me};break;case"fillSketch":a=this.fillSketch(o,i)}a&&s.push(a)}return s}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||me,strokeWidth:i,fill:me}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class b_{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Yo(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),s=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":s.save(),s.strokeStyle=i.stroke==="none"?"transparent":i.stroke,s.lineWidth=i.strokeWidth,i.strokeLineDash&&s.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(s.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(s,a,o),s.restore();break;case"fillPath":{s.save(),s.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(s,a,o,n),s.restore();break}case"fillSketch":this.fillSketch(s,a,i)}}fillSketch(t,r,i){let s=i.fillWeight;s<0&&(s=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=s,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,s="nonzero"){t.beginPath();for(const o of r.ops){const a=typeof i=="number"&&i>=0?o.data.map((n=>+n.toFixed(i))):o.data;switch(o.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(s):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,s,o){const a=this.gen.line(t,r,i,s,o);return this.draw(a),a}rectangle(t,r,i,s,o){const a=this.gen.rectangle(t,r,i,s,o);return this.draw(a),a}ellipse(t,r,i,s,o){const a=this.gen.ellipse(t,r,i,s,o);return this.draw(a),a}circle(t,r,i,s){const o=this.gen.circle(t,r,i,s);return this.draw(o),o}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,s,o,a,n=!1,l){const c=this.gen.arc(t,r,i,s,o,a,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Ks="http://www.w3.org/2000/svg";class k_{constructor(t,r){this.svg=t,this.gen=new Yo(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,o=s.createElementNS(Ks,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=s.createElementNS(Ks,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=s.createElementNS(Ks,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(s,n,i)}l&&o.appendChild(l)}return o}fillSketch(t,r,i){let s=i.fillWeight;s<0&&(s=i.strokeWidth/2);const o=t.createElementNS(Ks,"path");return o.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),o.setAttribute("stroke",i.fill||""),o.setAttribute("stroke-width",s+""),o.setAttribute("fill","none"),i.fillLineDash&&o.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,s,o){const a=this.gen.line(t,r,i,s,o);return this.draw(a)}rectangle(t,r,i,s,o){const a=this.gen.rectangle(t,r,i,s,o);return this.draw(a)}ellipse(t,r,i,s,o){const a=this.gen.ellipse(t,r,i,s,o);return this.draw(a)}circle(t,r,i,s){const o=this.gen.circle(t,r,i,s);return this.draw(o)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,s,o,a,n=!1,l){const c=this.gen.arc(t,r,i,s,o,a,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var it={canvas:(e,t)=>new b_(e,t),svg:(e,t)=>new k_(e,t),generator:e=>new Yo(e),newSeed:()=>Yo.newSeed()},lt=g(async(e,t,r)=>{let i;const s=t.useHtmlLabels||Xe(wt()?.htmlLabels);r?i=r:i="node default";const o=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=o.insert("g").attr("class","label").attr("style",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,we(yr(n),wt()),{useHtmlLabels:s,width:t.width||wt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},wt());let d=h.getBBox();const f=(t?.padding??0)/2;if(s){const u=h.children[0],p=pt(h);await oh(u,n),d=u.getBoundingClientRect(),p.attr("width",d.width),p.attr("height",d.height)}return s?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:a}},"labelHelper"),Ua=g(async(e,t,r)=>{const i=r.useHtmlLabels??ee(wt()),s=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),o=await Oe(s,we(yr(t),wt()),{useHtmlLabels:i,width:r.width||wt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=o.getBBox();const n=r.padding/2;if(ee(wt())){const l=o.children[0],c=pt(o);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?s.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):s.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&s.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:s}},"insertLabel"),ot=g((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),nt=g((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function Ct(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}g(Ct,"createPathFromPoints");function Cr(e,t,r,i,s,o){const a=[],l=r-e,c=i-t,h=l/o,d=2*Math.PI/h,f=t+c/2;for(let u=0;u<=50;u++){const p=u/50,m=e+p*l,y=f+s*Math.sin(d*(m-e));a.push({x:m,y})}return a}g(Cr,"generateFullSineWavePoints");function vs(e,t,r,i,s,o){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),p=t+r*Math.sin(f);a.push({x:-u,y:-p})}return a}g(vs,"generateCirclePoints");function Kn(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const s=t.find(l=>l.getAttribute("fill")!=="none"),o=t.find(l=>l.getAttribute("stroke")!=="none"),a=g((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(s){const l={fill:a(s,"fill"),"fill-opacity":a(s,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(o){const l={stroke:a(o,"stroke"),"stroke-width":a(o,"stroke-width")??"1","stroke-opacity":a(o,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}g(Kn,"mergePaths");var w_=g((e,t)=>{var r=e.x,i=e.y,s=t.x-r,o=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(o)*a>Math.abs(s)*n?(o<0&&(n=-n),l=o===0?0:n*s/o,c=n):(s<0&&(a=-a),l=a,c=s===0?0:a*o/s),{x:r+l,y:i+c}},"intersectRect"),jr=w_,S_=g(async(e,t,r,i=!1,s=!1)=>{let o=t||"";typeof o=="object"&&(o=o[0]);const a=wt(),n=ee(a);return await Oe(e,o,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:s,width:Number.POSITIVE_INFINITY},a)},"createLabel"),dr=S_,br=g((e,t,r,i,s)=>["M",e+s,t,"H",e+r-s,"A",s,s,0,0,1,e+r,t+s,"V",t+i-s,"A",s,s,0,0,1,e+r-s,t+i,"H",e+s,"A",s,s,0,0,1,e,t+i-s,"V",t+s,"A",s,s,0,0,1,e+s,t,"Z"].join(" "),"createRoundedRectPathD"),v_=g(async(e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:s}=r,{clusterBkg:o,clusterBorder:a}=i,n=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=st(t),f=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),u=Xe(r.flowchart.htmlLabels),p=t.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Oe(m,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let x=y.getBBox();if(u){const U=y.children[0],I=pt(y);x=U.getBoundingClientRect(),I.attr("width",x.width),I.attr("height",x.height)}const C=t.padding??0,k=t.width<=x.width+C?x.width+C:t.width;t.width<=x.width+C?t.diff=(k-t.width)/2-C:t.diff=-C;const v=t.height,S=t.y-v/2,T=t.y+v/2,B=t.x-k/2,_=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:S+v/3,P=p?4:0,O=x.height+2*P;let D,H;if(p){const U=Math.max(O,x.height+2*P),I=B+U,M=Math.max(0,k-U);if(t.look==="handDrawn"){const R=it.svg(f),$=rt(t,{roughness:.7,fill:o,stroke:n,fillWeight:3,seed:s}),N=rt(t,{roughness:.7,fill:"none",stroke:n,seed:s}),L=R.rectangle(B,S,U,v,$);D=f.insert(()=>L,":first-child");const X=R.rectangle(I,S,M,v,N);H=f.insert(()=>X,":first-child"),D.select("path:nth-child(2)").attr("style",h.join(";")),D.select("path").attr("style",d.join(";").replace("fill","stroke"))}else D=f.insert("rect",":first-child"),H=f.insert("rect",":first-child"),D.attr("class","swimlane-title").attr("style",c).attr("x",B).attr("y",S).attr("width",U).attr("height",v).attr("fill",o).attr("stroke",n),H.attr("class","swimlane-body").attr("style",c).attr("x",I).attr("y",S).attr("width",M).attr("height",v).attr("fill","none").attr("stroke",n);const A=B+U/2,z=t.y;m.attr("transform",`translate(${A}, ${z}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{const U=Math.max(0,_-S),I=Math.min(O,U),M=S+I,A=Math.max(0,T-M),z=t.x-k/2;if(t.look==="handDrawn"){const N=it.svg(f),L=rt(t,{roughness:.7,fill:o,stroke:n,fillWeight:3,seed:s}),X=rt(t,{roughness:.7,fill:"none",stroke:n,seed:s}),Y=N.rectangle(z,S,k,I,L);D=f.insert(()=>Y,":first-child");const G=N.rectangle(z,M,k,A,X);H=f.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=f.insert("rect",":first-child"),H=f.insert("rect",":first-child"),D.attr("class","swimlane-title").attr("style",c).attr("x",z).attr("y",S).attr("width",k).attr("height",I).attr("fill",o).attr("stroke",n),H.attr("class","swimlane-body").attr("style",c).attr("x",z).attr("y",M).attr("width",k).attr("height",A).attr("fill","none").attr("stroke",n);const R=t.x-x.width/2,$=S+(I-x.height)/2;m.attr("transform",`translate(${R}, ${$})`)}if(V.trace("Swimlane data ",t,JSON.stringify(t)),l){const U=m.select("span");U&&U.attr("style",l)}return t.offsetX=0,t.width=k,t.height=v,t.offsetY=x.height-C/2,t.intersect=function(U){return jr(t,U)},{cluster:f,labelBBox:x}},"swimlane"),fm=g(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=wt(),{themeVariables:i,handDrawnSeed:s}=r,{clusterBkg:o,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=st(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ee(r),u=d.insert("g").attr("class","cluster-label ");let p;t.labelType==="markdown"?p=await Oe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):p=await dr(u,t.label,t.labelStyle||"",!1,!0);let m=p.getBBox();if(ee(r)){const B=p.children[0],_=pt(p);m=B.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,k=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let v;if(t.look==="handDrawn"){const B=it.svg(d),_=rt(t,{roughness:.7,fill:o,stroke:a,fillWeight:3,seed:s}),P=B.path(br(C,k,y,x,0),_);v=d.insert(()=>(V.debug("Rough node insert CXC",P),P),":first-child"),v.select("path:nth-child(2)").attr("style",c.join(";")),v.select("path").attr("style",h.join(";").replace("fill","stroke"))}else v=d.insert("rect",":first-child"),v.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:S}=fa(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const B=u.select("span");B&&B.attr("style",n)}const T=v.node().getBBox();return t.offsetX=0,t.width=T.width,t.height=T.height,t.offsetY=m.height-t.padding/2,t.intersect=function(B){return jr(t,B)},{cluster:d,labelBBox:m}},"rect"),T_=g((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),s=0*t.padding,o=s/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2-o).attr("width",t.width+s).attr("height",t.height+s).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return jr(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),__=g(async(e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:s}=r,{altBackground:o,compositeBackground:a,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const u=await dr(d,t.label,t.labelStyle,void 0,!0);let p=u.getBBox();if(ee(r)){const P=u.children[0],O=pt(u);p=P.getBoundingClientRect(),O.attr("width",p.width),O.attr("height",p.height)}const m=0*t.padding,y=m/2,x=(t.width<=p.width+t.padding?p.width+t.padding:t.width)+m;t.width<=p.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height+m,k=t.height+m-p.height-6,v=t.x-x/2,S=t.y-C/2;t.width=x;const T=t.y-t.height/2-y+p.height+2;let B;if(t.look==="handDrawn"){const P=t.cssClasses.includes("statediagram-cluster-alt"),O=it.svg(c),D=t.rx||t.ry?O.path(br(v,S,x,C,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:s}):O.rectangle(v,S,x,C,{seed:s});B=c.insert(()=>D,":first-child");const H=O.rectangle(v,T,x,k,{fill:P?o:a,fillStyle:P?"hachure":"solid",stroke:l,seed:s});B=c.insert(()=>D,":first-child"),f=c.insert(()=>H)}else B=h.insert("rect",":first-child"),B.attr("class","outer").attr("x",v).attr("y",S).attr("width",x).attr("height",C).attr("data-look",t.look),f.attr("class","inner").attr("x",v).attr("y",T).attr("width",x).attr("height",k);d.attr("transform",`translate(${t.x-p.width/2}, ${S+1-(ee(r)?0:3)})`);const _=B.node().getBBox();return t.height=_.height,t.offsetX=0,t.offsetY=p.height-t.padding/2,t.labelBBox=p,t.intersect=function(P){return jr(t,P)},{cluster:c,labelBBox:p}},"roundedWithTitle"),B_=g(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=wt(),{themeVariables:i,handDrawnSeed:s}=r,{clusterBkg:o,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=st(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ee(r),u=d.insert("g").attr("class","cluster-label "),p=await Oe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=p.getBBox();if(ee(r)){const B=p.children[0],_=pt(p);m=B.getBoundingClientRect(),_.attr("width",m.width),_.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,k=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let v;if(t.look==="handDrawn"){const B=it.svg(d),_=rt(t,{roughness:.7,fill:o,stroke:a,fillWeight:4,seed:s}),P=B.path(br(C,k,y,x,t.rx),_);v=d.insert(()=>(V.debug("Rough node insert CXC",P),P),":first-child"),v.select("path:nth-child(2)").attr("style",c.join(";")),v.select("path").attr("style",h.join(";").replace("fill","stroke"))}else v=d.insert("rect",":first-child"),v.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",k).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:S}=fa(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+S})`),n){const B=u.select("span");B&&B.attr("style",n)}const T=v.node().getBBox();return t.offsetX=0,t.width=T.width,t.height=T.height,t.offsetY=m.height-t.padding/2,t.intersect=function(B){return jr(t,B)},{cluster:d,labelBBox:m}},"kanbanSection"),L_=g((e,t)=>{const r=wt(),{themeVariables:i,handDrawnSeed:s}=r,{nodeBorder:o}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,d=t.x-c/2,f=t.y-h/2;t.width=c;let u;if(t.look==="handDrawn"){const y=it.svg(a).rectangle(d,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:o,seed:s});u=a.insert(()=>y,":first-child")}else{u=n.insert("rect",":first-child");let m="outer";t.look,m="divider",u.attr("class",m).attr("x",d).attr("y",f).attr("width",c).attr("height",h).attr("data-look",t.look)}const p=u.node().getBBox();return t.height=p.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return jr(t,m)},{cluster:a,labelBBox:{}}},"divider"),E_=fm,F_={rect:fm,squareRect:E_,roundedWithTitle:__,noteGroup:T_,divider:L_,kanbanSection:B_,swimlane:v_},gm=new Map,pm=g(async(e,t)=>{const r=t.shape||"rect",i=await F_[r](e,t);return gm.set(t.id,i),i},"insertCluster"),A_=g(()=>{gm=new Map},"clear");function mm(e,t){return e.intersect(t)}g(mm,"intersectNode");var M_=mm;function ym(e,t,r,i){var s=e.x,o=e.y,a=s-i.x,n=o-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x<s&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<o&&(h=-h),{x:s+c,y:o+h}}g(ym,"intersectEllipse");var xm=ym;function Cm(e,t,r){return xm(e,t,t,r)}g(Cm,"intersectCircle");var $_=Cm;function bm(e,t,r,i){{const s=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,n=s*r.x+o*r.y+a,l=s*i.x+o*i.y+a,c=1e-6;if(n!==0&&l!==0&&Qn(n,l))return;const h=i.y-r.y,d=r.x-i.x,f=i.x*r.y-r.x*i.y,u=h*e.x+d*e.y+f,p=h*t.x+d*t.y+f;if(Math.abs(u)<c&&Math.abs(p)<c&&Qn(u,p))return;const m=s*d-h*o;if(m===0)return;const y=Math.abs(m/2);let x=o*f-d*a;const C=x<0?(x-y)/m:(x+y)/m;x=h*a-s*f;const k=x<0?(x-y)/m:(x+y)/m;return{x:C,y:k}}}g(bm,"intersectLine");function Qn(e,t){return e*t>0}g(Qn,"sameSign");var O_=bm;function km(e,t,r){let i=e.x,s=e.y,o=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=i-e.width/2-a,c=s-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],f=t[h<t.length-1?h+1:0],u=O_(e,r,{x:l+d.x,y:c+d.y},{x:l+f.x,y:c+f.y});u&&o.push(u)}return o.length?(o.length>1&&o.sort(function(h,d){let f=h.x-r.x,u=h.y-r.y,p=Math.sqrt(f*f+u*u),m=d.x-r.x,y=d.y-r.y,x=Math.sqrt(m*m+y*y);return p<x?-1:p===x?0:1}),o[0]):e}g(km,"intersectPolygon");var R_=km,tt={node:M_,circle:$_,ellipse:xm,polygon:R_,rect:jr};function wm(e,t){const{labelStyles:r}=st(t);t.labelStyle=r;const i=nt(t);let s=i;i||(s="anchor");const o=e.insert("g").attr("class",s).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,l=it.svg(o),c=rt(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,a*2,c),d=o.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Xt(n)),ot(t,d),t.intersect=function(f){return V.info("Circle intersect",t,a,f),tt.circle(t,a,f)},o}g(wm,"anchor");function Jn(e,t,r,i,s,o,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,f=(i-t)/2,u=d/s,p=f/o,m=Math.sqrt(u**2+p**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),x=l+y*o*Math.sin(h)*(a?-1:1),C=c-y*s*Math.cos(h)*(a?-1:1),k=Math.atan2((t-C)/o,(e-x)/s);let S=Math.atan2((i-C)/o,(r-x)/s)-k;a&&S<0&&(S+=2*Math.PI),!a&&S>0&&(S-=2*Math.PI);const T=[];for(let B=0;B<20;B++){const _=B/19,P=k+_*S,O=x+s*Math.cos(P),D=C+o*Math.sin(P);T.push({x:O,y:D})}return T}g(Jn,"generateArcPoints");function Sm(e,t,r){const[i,s]=[t,r].sort((o,a)=>a-o);return s*(1-Math.sqrt(1-(e/i/2)**2))}g(Sm,"calculateArcSagitta");async function vm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=g(P=>P+a,"calcTotalHeight"),l=g(P=>{const O=P/2;return[O/(2.5+P/50),O]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=n(t?.height?t?.height:h.height),[f,u]=l(d),p=Sm(d,f,u),y=(t?.width?t?.width:h.width)+o*2+p-p,x=d,{cssStyles:C}=t,k=[{x:y/2,y:-x/2},{x:-y/2,y:-x/2},...Jn(-y/2,-x/2,-y/2,x/2,f,u,!1),{x:y/2,y:x/2},...Jn(y/2,x/2,y/2,-x/2,f,u,!0)],v=it.svg(c),S=rt(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const T=Ct(k),B=v.path(T,S),_=c.insert(()=>B,":first-child");return _.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${f/2}, 0)`),ot(t,_),t.intersect=function(P){return tt.polygon(t,k,P)},c}g(vm,"bowTieRect");function lr(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}g(lr,"insertPolygonShape");var Qs=12;async function Tm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?28:s,a=t.look==="neo"?24:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width??l.width)+(t.look==="neo"?o*2:o+Qs),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,f=c,u=-h,p=0,m=[{x:d+Qs,y:u},{x:f,y:u},{x:f,y:p},{x:d,y:p},{x:d,y:u+Qs},{x:d+Qs,y:u}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=it.svg(n),k=rt(t,{}),v=Ct(m),S=C.path(v,k);y=n.insert(()=>S,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),x&&y.attr("style",x)}else y=lr(n,c,h,m);return i&&y.attr("style",i),ot(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},n}g(Tm,"card");function _m(e,t){const{nodeStyles:r}=st(t);t.label="";const i=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,o=Math.max(28,t.width??0),a=[{x:0,y:o/2},{x:o/2,y:0},{x:0,y:-o/2},{x:-o/2,y:0}],n=it.svg(i),l=rt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=Ct(a),h=n.path(c,l),d=i.insert(()=>h,":first-child");return s&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",s),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return tt.polygon(t,a,f)},i}g(_m,"choice");async function xh(e,t,r){const{labelStyles:i,nodeStyles:s}=st(t);t.labelStyle=i;const{shapeSvg:o,bbox:a,halfPadding:n}=await lt(e,t,nt(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=it.svg(o),p=rt(t,{}),m=u.circle(0,0,h*2,p);d=o.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Xt(f))}else d=o.insert("circle",":first-child").attr("class","basic label-container").attr("style",s).attr("r",h).attr("cx",0).attr("cy",0);return ot(t,d),t.calcIntersect=function(u,p){const m=u.width/2;return tt.circle(u,m,p)},t.intersect=function(u){return V.info("Circle intersect",t,h,u),tt.circle(t,h,u)},o}g(xh,"circle");function Bm(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,s={x:i/2*t,y:i/2*r},o={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${o.x},${o.y} L ${n.x},${n.y}
233
+ M ${s.x},${s.y} L ${a.x},${a.y}`}g(Bm,"createLine");function Lm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r,t.label="";const s=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),o=Math.max(30,t?.width??0),{cssStyles:a}=t,n=it.svg(s),l=rt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,o*2,l),h=Bm(o),d=n.path(h,l),f=s.insert(()=>c,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),a&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",i),ot(t,f),t.intersect=function(u){return V.info("crossedCircle intersect",t,{radius:o,point:u}),tt.circle(t,o,u)},s}g(Lm,"crossedCircle");function tr(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),p=t+r*Math.sin(f);a.push({x:-u,y:-p})}return a}g(tr,"generateCirclePoints");async function Em(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await lt(e,t,nt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+n,h=o.height+l,d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...tr(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...tr(c/2+d*2,-d,d,20,-180,-270),...tr(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...tr(c/2,h/2,d,20,0,90)],p=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...tr(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...tr(c/2+c*.1,-d,d,20,-180,-270),...tr(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...tr(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2,y:h/2+d}],m=it.svg(s),y=rt(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=Ct(u).replace("Z",""),k=m.path(C,y),v=Ct(p),S=m.path(v,{...y}),T=s.insert("g",":first-child");return T.insert(()=>S,":first-child").attr("stroke-opacity",0),T.insert(()=>k,":first-child"),T.attr("class","text"),f&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ot(t,T),t.intersect=function(B){return tt.polygon(t,p,B)},s}g(Em,"curlyBraceLeft");function er(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),p=t+r*Math.sin(f);a.push({x:u,y:p})}return a}g(er,"generateCirclePoints");async function Fm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await lt(e,t,nt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...er(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...er(c/2+d*2,-d,d,20,-180,-270),...er(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...er(c/2,h/2,d,20,0,90)],p=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...er(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...er(c/2+d*2,-d,d,20,-180,-270),...er(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...er(c/2,h/2,d,20,0,90),{x:c/2,y:h/2+d},{x:-c/2,y:h/2+d}],m=it.svg(s),y=rt(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=Ct(u).replace("Z",""),k=m.path(C,y),v=Ct(p),S=m.path(v,{...y}),T=s.insert("g",":first-child");return T.insert(()=>S,":first-child").attr("stroke-opacity",0),T.insert(()=>k,":first-child"),T.attr("class","text"),f&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ot(t,T),t.intersect=function(B){return tt.polygon(t,p,B)},s}g(Fm,"curlyBraceRight");function Zt(e,t,r,i=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),p=t+r*Math.sin(f);a.push({x:-u,y:-p})}return a}g(Zt,"generateCirclePoints");async function Am(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await lt(e,t,nt(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...Zt(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Zt(c/2+d*2,-d,d,20,-180,-270),...Zt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Zt(c/2,h/2,d,20,0,90)],p=[...Zt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Zt(-c/2-d/2,-d,d,20,0,90),...Zt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Zt(-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},...Zt(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Zt(c/2+d*2,-d,d,20,-180,-270),...Zt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Zt(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},...Zt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Zt(-c/2-d/2,-d,d,20,0,90),...Zt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Zt(-c/2+d+d/2,h/2,d,30,-180,-270)],y=it.svg(s),x=rt(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const k=Ct(u).replace("Z",""),v=y.path(k,x),T=Ct(p).replace("Z",""),B=y.path(T,x),_=Ct(m),P=y.path(_,{...x}),O=s.insert("g",":first-child");return O.insert(()=>P,":first-child").attr("stroke-opacity",0),O.insert(()=>v,":first-child"),O.insert(()=>B,":first-child"),O.attr("class","text"),f&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",i),O.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),ot(t,O),t.intersect=function(D){return tt.polygon(t,m,D)},s}g(Am,"curlyBraces");async function Mm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=20,l=5,{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=Math.max(n,(h.width+o*2)*1.25,t?.width??0),f=Math.max(l,h.height+a*2,t?.height??0),u=f/2,{cssStyles:p}=t,m=it.svg(c),y=rt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=d,C=f,k=x-u,v=C/4,S=[{x:k,y:0},{x:v,y:0},{x:0,y:C/2},{x:v,y:C},{x:k,y:C},...vs(-k,-C/2,u,50,270,90)],T=Ct(S),B=m.path(T,y),_=c.insert(()=>B,":first-child");return _.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(${-d/2}, ${-f/2})`),ot(t,_),t.intersect=function(P){return tt.polygon(t,S,P)},c}g(Mm,"curvedTrapezoid");var I_=g((e,t,r,i,s,o)=>[`M${e},${t+o}`,`a${s},${o} 0,0,0 ${r},0`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),P_=g((e,t,r,i,s,o)=>[`M${e},${t+o}`,`M${e+r},${t+o}`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),D_=g((e,t,r,i,s,o)=>[`M${e-r/2},${-i/2}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Uc=8,Xc=8;async function $m(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?24:s,a=t.look==="neo"?24:s;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.width<Xc&&(t.width=Xc);const C=y/2/(2.5+y/50);t.height=(t.height??0)-o-C*3,t.height<Uc&&(t.height=Uc)}const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t.width?t.width:l.width)+a,d=h/2,f=d/(2.5+h/50),u=(t.height?t.height:l.height)+o+f;let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=it.svg(n),x=P_(0,0,h,u,d,f),C=D_(0,f,h,u,d,f),k=rt(t,{}),v=y.path(x,k),S=y.path(C,rt(t,{fill:"none"}));p=n.insert(()=>S,":first-child"),p=n.insert(()=>v,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{const y=I_(0,0,h,u,d,f);p=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Xt(m)).attr("style",i)}return p.attr("label-offset-y",f),p.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),ot(t,p),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(y){const x=tt.rect(t,y),C=x.x-(t.x??0);if(d!=0&&(Math.abs(C)<(t.width??0)/2||Math.abs(C)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-f)){let k=f*f*(1-C*C/(d*d));k>0&&(k=Math.sqrt(k)),k=f-k,y.y-(t.y??0)>0&&(k=-k),x.y+=k}return x},n}g($m,"cylinder");async function Ri(e,t,r){const{labelStyles:i,nodeStyles:s}=st(t);t.labelStyle=i;const{shapeSvg:o,bbox:a}=await lt(e,t,nt(t)),n=Math.max(a.width+r.labelPaddingX*2,t?.width||0),l=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:f,ry:u}=t;const{cssStyles:p}=t;if(r?.rx&&r.ry&&(f=r.rx,u=r.ry),t.look==="handDrawn"){const m=it.svg(o),y=rt(t,{}),x=f||u?m.path(br(c,h,n,l,f||0),y):m.rectangle(c,h,n,l,y);d=o.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",Xt(p))}else d=o.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",s).attr("rx",Xt(f)).attr("ry",Xt(u)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return ot(t,d),t.calcIntersect=function(m,y){return tt.rect(m,y)},t.intersect=function(m){return tt.rect(t,m)},o}g(Ri,"drawRect");async function Om(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:s,padding:o,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(o??0)*2,labelPaddingY:s??o??0},c=await Ri(e,t,l);if(t.look==="handDrawn"){const u=it.svg(c),p=rt(t,{}),m=c.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return c;let x=null;if(y instanceof SVGGraphicsElement)x=y.getBBox();else return c;return c.insert(()=>u.line(x.x,x.y,x.x+x.width,x.y,p),".basic.label-container g.label"),c.insert(()=>u.line(x.x,x.y+x.height,x.x+x.width,x.y+x.height,p),".basic.label-container g.label"),m.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,f=(Number(h.attr("height"))||n)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),c}g(Om,"datastore");async function Rm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=n.width+s,h=n.height+o,d=h*.2,f=-c/2,u=-h/2-d/2,{cssStyles:p}=t,m=it.svg(a),y=rt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:f,y:u+d},{x:-f,y:u+d},{x:-f,y:-u},{x:f,y:-u},{x:f,y:u},{x:-f,y:u},{x:-f,y:u+d}],C=m.polygon(x.map(v=>[v.x,v.y]),y),k=a.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),l.attr("transform",`translate(${f+(t.padding??0)/2-(n.x-(n.left??0))}, ${u+d+(t.padding??0)/2-(n.y-(n.top??0))})`),ot(t,k),t.intersect=function(v){return tt.rect(t,v)},a}g(Rm,"dividedRectangle");async function Im(e,t){const{labelStyles:r,nodeStyles:i}=st(t),s=t.look==="neo"?12:5;t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-s;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=it.svg(n),p=rt(t,{roughness:.2,strokeWidth:2.5}),m=rt(t,{roughness:.2,strokeWidth:1.5}),y=u.circle(0,0,c*2,p),x=u.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",Xt(t.cssClasses)).attr("style",Xt(f)),d.node()?.appendChild(y),d.node()?.appendChild(x)}else{d=n.insert("g",":first-child");const u=d.insert("circle",":first-child"),p=d.insert("circle");d.attr("class","basic label-container").attr("style",i),u.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),p.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return ot(t,d),t.intersect=function(u){return V.info("DoubleCircle intersect",t,c,u),tt.circle(t,c,u)},n}g(Im,"doublecircle");function Pm(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:s}=st(t);t.label="",t.labelStyle=i;const o=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=it.svg(o),{nodeBorder:c}=r,h=rt(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=o.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",s),ot(t,f),t.intersect=function(u){return V.info("filledCircle intersect",t,{radius:a,point:u}),tt.circle(t,a,u)},o}g(Pm,"filledCircle");var Gc=10,Vc=10;async function Dm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?s*2:s;(t.width||t.height)&&(t.height=t?.height??0,t.height<Gc&&(t.height=Gc),t.width=(t?.width??0)-o-o/2,t.width<Vc&&(t.width=Vc));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:n.width)+(o??0),h=t?.height?t?.height:c+n.height,d=h,f=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:u}=t,p=it.svg(a),m=rt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=Ct(f),x=p.path(y,m),C=a.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return u&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),t.width=c,t.height=h,ot(t,C),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(k){return V.info("Triangle intersect",t,f,k),tt.polygon(t,f,k)},a}g(Dm,"flippedTriangle");function Nm(e,t,{dir:r,config:{state:i,themeVariables:s}}){const{nodeStyles:o}=st(t);t.label="";const a=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,f=it.svg(a),u=rt(t,{stroke:s.lineColor,fill:s.lineColor});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const p=f.rectangle(h,d,l,c,u),m=a.insert(()=>p,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",o),ot(t,m);const y=i?.padding??0;return t.width&&t.height&&(t.width+=y/2||0,t.height+=y/2||0),t.intersect=function(x){return tt.rect(t,x)},a}g(Nm,"forkJoin");async function qm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=15,o=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<o&&(t.height=o),t.width=(t?.width??0)-a*2,t.width<s&&(t.width=s));const{shapeSvg:l,bbox:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:Math.max(s,c.width))+a*2,d=(t?.height?t?.height:Math.max(o,c.height))+n*2,f=d/2,{cssStyles:u}=t,p=it.svg(l),m=rt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2,y:-d/2},{x:h/2-f,y:-d/2},...vs(-h/2+f,0,f,50,90,270),{x:h/2-f,y:d/2},{x:-h/2,y:d/2}],x=Ct(y),C=p.path(x,m),k=l.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),ot(t,k),t.intersect=function(v){return V.info("Pill intersect",t,{radius:f,point:v}),tt.polygon(t,y,v)},l}g(qm,"halfRoundedRectangle");var N_=g((e,t,r,i,s)=>[`M${e+s},${t}`,`L${e+r-s},${t}`,`L${e+r},${t-i/2}`,`L${e+r-s},${t-i}`,`L${e+s},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function zm(e,t){const{labelStyles:r,nodeStyles:i}=st(t),s=t.look==="neo"?3.5:4;t.labelStyle=r;const o=t.padding??0,a=70,n=32,l=t.look==="neo"?a:o,c=t.look==="neo"?n:o;if(t.width||t.height){const k=(t.height??0)/s;t.width=(t?.width??0)-2*k-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await lt(e,t,nt(t)),f=(t?.height?t?.height:d.height)+l,u=f/s,p=(t?.width?t?.width:d.width)+2*u+c,m=[{x:u,y:0},{x:p-u,y:0},{x:p,y:-f/2},{x:p-u,y:-f},{x:u,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=it.svg(h),k=rt(t,{}),v=N_(0,0,p,f,u),S=C.path(v,k);y=h.insert(()=>S,":first-child").attr("transform",`translate(${-p/2}, ${f/2})`),x&&y.attr("style",x)}else y=lr(h,p,f,m);return i&&y.attr("style",i),t.width=p,t.height=f,ot(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},h}g(zm,"hexagon");async function jm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.label="",t.labelStyle=r;const{shapeSvg:s}=await lt(e,t,nt(t)),o=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=it.svg(s),c=rt(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:o,y:0},{x:0,y:a},{x:o,y:a}],d=Ct(h),f=l.path(d,c),u=s.insert(()=>f,":first-child");return u.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&u.selectChildren("path").attr("style",i),u.attr("transform",`translate(${-o/2}, ${-a/2})`),ot(t,u),t.intersect=function(p){return V.info("Pill intersect",t,{points:h}),tt.polygon(t,h,p)},s}g(jm,"hourglass");async function Wm(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:s}=st(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await lt(e,t,"icon-shape default"),f=t.pos==="t",u=n,p=n,{nodeBorder:m}=r,{stylesMap:y}=$i(t),x=-p/2,C=-u/2,k=t.label?8:0,v=it.svg(c),S=rt(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const T=v.rectangle(x,C,p,u,S),B=Math.max(p,h.width),_=u+h.height+k,P=v.rectangle(-B/2,-_/2,B,_,{...S,fill:"transparent",stroke:"none"}),O=c.insert(()=>T,":first-child"),D=c.insert(()=>P);if(t.icon){const H=c.append("g");H.html(`<g>${await Oi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const U=H.node().getBBox(),I=U.width,M=U.height,A=U.x,z=U.y;H.attr("transform",`translate(${-I/2-A},${f?h.height/2+k/2-M/2-z:-h.height/2-k/2-M/2-z})`),H.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-_/2:_/2-h.height})`),O.attr("transform",`translate(0,${f?h.height/2+k/2:-h.height/2-k/2})`),ot(t,D),t.intersect=function(H){if(V.info("iconSquare intersect",t,H),!t.label)return tt.rect(t,H);const U=t.x??0,I=t.y??0,M=t.height??0;let A=[];return f?A=[{x:U-h.width/2,y:I-M/2},{x:U+h.width/2,y:I-M/2},{x:U+h.width/2,y:I-M/2+h.height+k},{x:U+p/2,y:I-M/2+h.height+k},{x:U+p/2,y:I+M/2},{x:U-p/2,y:I+M/2},{x:U-p/2,y:I-M/2+h.height+k},{x:U-h.width/2,y:I-M/2+h.height+k}]:A=[{x:U-p/2,y:I-M/2},{x:U+p/2,y:I-M/2},{x:U+p/2,y:I-M/2+u},{x:U+h.width/2,y:I-M/2+u},{x:U+h.width/2/2,y:I+M/2},{x:U-h.width/2,y:I+M/2},{x:U-h.width/2,y:I-M/2+u},{x:U-p/2,y:I-M/2+u}],tt.polygon(t,A,H)},c}g(Wm,"icon");async function Hm(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:s}=st(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await lt(e,t,"icon-shape default"),f=20,u=t.label?8:0,p=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=$i(t),C=it.svg(c),k=rt(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=x.get("fill");k.stroke=v??y;const S=c.append("g");t.icon&&S.html(`<g>${await Oi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const T=S.node().getBBox(),B=T.width,_=T.height,P=T.x,O=T.y,D=Math.max(B,_)*Math.SQRT2+f*2,H=C.circle(0,0,D,k),U=Math.max(D,h.width),I=D+h.height+u,M=C.rectangle(-U/2,-I/2,U,I,{...k,fill:"transparent",stroke:"none"}),A=c.insert(()=>H,":first-child"),z=c.insert(()=>M);return S.attr("transform",`translate(${-B/2-P},${p?h.height/2+u/2-_/2-O:-h.height/2-u/2-_/2-O})`),S.attr("style",`color: ${x.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-I/2:I/2-h.height})`),A.attr("transform",`translate(0,${p?h.height/2+u/2:-h.height/2-u/2})`),ot(t,z),t.intersect=function(R){return V.info("iconSquare intersect",t,R),tt.rect(t,R)},c}g(Hm,"iconCircle");async function Ym(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:s}=st(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await lt(e,t,"icon-shape default"),u=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=$i(t),k=-m/2,v=-p/2,S=t.label?8:0,T=it.svg(c),B=rt(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const _=C.get("fill");B.stroke=_??x;const P=T.path(br(k,v,m,p,5),B),O=Math.max(m,h.width),D=p+h.height+S,H=T.rectangle(-O/2,-D/2,O,D,{...B,fill:"transparent",stroke:"none"}),U=c.insert(()=>P,":first-child").attr("class","icon-shape2"),I=c.insert(()=>H);if(t.icon){const M=c.append("g");M.html(`<g>${await Oi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const A=M.node().getBBox(),z=A.width,R=A.height,$=A.x,N=A.y;M.attr("transform",`translate(${-z/2-$},${u?h.height/2+S/2-R/2-N:-h.height/2-S/2-R/2-N})`),M.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-D/2:D/2-h.height})`),U.attr("transform",`translate(0,${u?h.height/2+S/2:-h.height/2-S/2})`),ot(t,I),t.intersect=function(M){if(V.info("iconSquare intersect",t,M),!t.label)return tt.rect(t,M);const A=t.x??0,z=t.y??0,R=t.height??0;let $=[];return u?$=[{x:A-h.width/2,y:z-R/2},{x:A+h.width/2,y:z-R/2},{x:A+h.width/2,y:z-R/2+h.height+S},{x:A+m/2,y:z-R/2+h.height+S},{x:A+m/2,y:z+R/2},{x:A-m/2,y:z+R/2},{x:A-m/2,y:z-R/2+h.height+S},{x:A-h.width/2,y:z-R/2+h.height+S}]:$=[{x:A-m/2,y:z-R/2},{x:A+m/2,y:z-R/2},{x:A+m/2,y:z-R/2+p},{x:A+h.width/2,y:z-R/2+p},{x:A+h.width/2/2,y:z+R/2},{x:A-h.width/2,y:z+R/2},{x:A-h.width/2,y:z-R/2+p},{x:A-m/2,y:z-R/2+p}],tt.polygon(t,$,M)},c}g(Ym,"iconRounded");async function Um(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:s}=st(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await lt(e,t,"icon-shape default"),u=t.pos==="t",p=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=$i(t),k=-m/2,v=-p/2,S=t.label?8:0,T=it.svg(c),B=rt(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const _=C.get("fill");B.stroke=_??x;const P=T.path(br(k,v,m,p,.1),B),O=Math.max(m,h.width),D=p+h.height+S,H=T.rectangle(-O/2,-D/2,O,D,{...B,fill:"transparent",stroke:"none"}),U=c.insert(()=>P,":first-child"),I=c.insert(()=>H);if(t.icon){const M=c.append("g");M.html(`<g>${await Oi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const A=M.node().getBBox(),z=A.width,R=A.height,$=A.x,N=A.y;M.attr("transform",`translate(${-z/2-$},${u?h.height/2+S/2-R/2-N:-h.height/2-S/2-R/2-N})`),M.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-D/2:D/2-h.height})`),U.attr("transform",`translate(0,${u?h.height/2+S/2:-h.height/2-S/2})`),ot(t,I),t.intersect=function(M){if(V.info("iconSquare intersect",t,M),!t.label)return tt.rect(t,M);const A=t.x??0,z=t.y??0,R=t.height??0;let $=[];return u?$=[{x:A-h.width/2,y:z-R/2},{x:A+h.width/2,y:z-R/2},{x:A+h.width/2,y:z-R/2+h.height+S},{x:A+m/2,y:z-R/2+h.height+S},{x:A+m/2,y:z+R/2},{x:A-m/2,y:z+R/2},{x:A-m/2,y:z-R/2+h.height+S},{x:A-h.width/2,y:z-R/2+h.height+S}]:$=[{x:A-m/2,y:z-R/2},{x:A+m/2,y:z-R/2},{x:A+m/2,y:z-R/2+p},{x:A+h.width/2,y:z-R/2+p},{x:A+h.width/2/2,y:z+R/2},{x:A-h.width/2,y:z+R/2},{x:A-h.width/2,y:z-R/2+p},{x:A-m/2,y:z-R/2+p}],tt.polygon(t,$,M)},c}g(Um,"iconSquare");async function Xm(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const s=Number(i.naturalWidth.toString().replace("px","")),o=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=s/o;const{labelStyles:a}=st(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??s),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??o;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:f,label:u}=await lt(e,t,"image-shape default"),p=t.pos==="t",m=-c/2,y=-h/2,x=t.label?8:0,C=it.svg(d),k=rt(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=C.rectangle(m,y,c,h,k),S=Math.max(c,f.width),T=h+f.height+x,B=C.rectangle(-S/2,-T/2,S,T,{...k,fill:"none",stroke:"none"}),_=d.insert(()=>v,":first-child"),P=d.insert(()=>B);if(t.img){const O=d.append("image");O.attr("href",t.img),O.attr("width",c),O.attr("height",h),O.attr("preserveAspectRatio","none"),O.attr("transform",`translate(${-c/2},${p?T/2-h:-T/2})`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${p?-h/2-f.height/2-x/2:h/2-f.height/2+x/2})`),_.attr("transform",`translate(0,${p?f.height/2+x/2:-f.height/2-x/2})`),ot(t,P),t.intersect=function(O){if(V.info("iconSquare intersect",t,O),!t.label)return tt.rect(t,O);const D=t.x??0,H=t.y??0,U=t.height??0;let I=[];return p?I=[{x:D-f.width/2,y:H-U/2},{x:D+f.width/2,y:H-U/2},{x:D+f.width/2,y:H-U/2+f.height+x},{x:D+c/2,y:H-U/2+f.height+x},{x:D+c/2,y:H+U/2},{x:D-c/2,y:H+U/2},{x:D-c/2,y:H-U/2+f.height+x},{x:D-f.width/2,y:H-U/2+f.height+x}]:I=[{x:D-c/2,y:H-U/2},{x:D+c/2,y:H-U/2},{x:D+c/2,y:H-U/2+h},{x:D+f.width/2,y:H-U/2+h},{x:D+f.width/2/2,y:H+U/2},{x:D-f.width/2,y:H+U/2},{x:D-f.width/2,y:H-U/2+h},{x:D-c/2,y:H-U/2+h}],tt.polygon(t,I,O)},d}g(Xm,"imageSquare");async function Gm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=s,a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=Math.max(l.width+(a??0)*2,t?.width??0),h=Math.max(l.height+(o??0)*2,t?.height??0),d=[{x:0,y:0},{x:c,y:0},{x:c+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const p=it.svg(n),m=rt(t,{}),y=Ct(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),u&&f.attr("style",u)}else f=lr(n,c,h,d);return i&&f.attr("style",i),t.width=c,t.height=h,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(Gm,"inv_trapezoid");async function Vm(e,t){const{shapeSvg:r,bbox:i,label:s}=await lt(e,t,"label"),o=r.insert("rect",":first-child");return o.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),s.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),ot(t,o),t.intersect=function(l){return tt.rect(t,l)},r}g(Vm,"labelRect");async function Zm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=s,a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+o,h=(t?.width??l.width)+a,d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const p=it.svg(n),m=rt(t,{}),y=Ct(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=lr(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(Zm,"lean_left");async function Km(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=s,a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+o,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const p=it.svg(n),m=rt(t,{}),y=Ct(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=lr(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(Km,"lean_right");function Qm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.label="",t.labelStyle=r;const s=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=it.svg(s),d=rt(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Ct(c),u=h.path(f,d),p=s.insert(()=>u,":first-child");return p.attr("class","outer-path"),o&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",o),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),p.attr("transform",`translate(-${a/2},${-n})`),ot(t,p),t.intersect=function(m){return V.info("lightningBolt intersect",t,m),tt.polygon(t,c,m)},s}g(Qm,"lightningBolt");var q_=g((e,t,r,i,s,o,a)=>[`M${e},${t+o}`,`a${s},${o} 0,0,0 ${r},0`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+o+a}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),z_=g((e,t,r,i,s,o,a)=>[`M${e},${t+o}`,`M${e+r},${t+o}`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${i}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+o+a}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),j_=g((e,t,r,i,s,o)=>[`M${e-r/2},${-i/2}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Zc=10,Kc=10;async function Jm(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?24:s;if(t.width||t.height){const x=t.width??0;t.width=(t.width??0)-o,t.width<Kc&&(t.width=Kc);const k=x/2/(2.5+x/50);t.height=(t.height??0)-a-k*3,t.height<Zc&&(t.height=Zc)}const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+o*2,d=h/2,f=d/(2.5+h/50),u=(t?.height?t?.height:l.height)+f+a*2,p=u*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=it.svg(n),C=z_(0,0,h,u,d,f,p),k=j_(0,f,h,u,d,f),v=rt(t,{}),S=x.path(C,v),T=x.path(k,v);n.insert(()=>T,":first-child").attr("class","line"),m=n.insert(()=>S,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=q_(0,0,h,u,d,f,p);m=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",Xt(y)).attr("style",i)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),ot(t,m),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+f-(l.y-(l.top??0))})`),t.intersect=function(x){const C=tt.rect(t,x),k=C.x-(t.x??0);if(d!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-f)){let v=f*f*(1-k*k/(d*d));v>0&&(v=Math.sqrt(v)),v=f-v,x.y-(t.y??0)>0&&(v=-v),C.y+=v}return C},n}g(Jm,"linedCylinder");async function ty(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;if(t.width||t.height){const v=t.width;t.width=(v??0)*10/11-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+(o??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,f=t.look==="neo"?d/4:d/8,u=d+f,{cssStyles:p}=t,m=it.svg(n),y=rt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...Cr(-h/2-h/2*.1,u/2,h/2+h/2*.1,u/2,f,.8),{x:h/2+h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:-u/2},{x:-h/2,y:-u/2},{x:-h/2,y:u/2*1.1},{x:-h/2,y:-u/2}],C=m.polygon(x.map(v=>[v.x,v.y]),y),k=n.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(0,${-f/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-f/2-(l.y-(l.top??0))})`),ot(t,k),t.intersect=function(v){return tt.polygon(t,x,v)},n}g(ty,"linedWaveEdgedRect");async function ey(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:c.width)+o*2+2*n,f=(t?.height?t?.height:c.height)+a*2+2*n,u=d-2*n,p=f-2*n,m=-u/2,y=-p/2,{cssStyles:x}=t,C=it.svg(l),k=rt(t,{}),v=[{x:m-n,y:y+n},{x:m-n,y:y+p+n},{x:m+u-n,y:y+p+n},{x:m+u-n,y:y+p},{x:m+u,y:y+p},{x:m+u,y:y+p-n},{x:m+u+n,y:y+p-n},{x:m+u+n,y:y-n},{x:m+n,y:y-n},{x:m+n,y},{x:m,y},{x:m,y:y+n}],S=[{x:m,y:y+n},{x:m+u-n,y:y+n},{x:m+u-n,y:y+p},{x:m+u,y:y+p},{x:m+u,y},{x:m,y}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const T=Ct(v);let B=C.path(T,k);const _=Ct(S);let P=C.path(_,k);t.look!=="handDrawn"&&(B=Kn(B),P=Kn(P));const O=l.insert("g",":first-child");return O.insert(()=>B),O.insert(()=>P),O.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),ot(t,O),t.intersect=function(D){return tt.polygon(t,v,D)},l}g(ey,"multiRect");async function ry(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await lt(e,t,nt(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(o.width,t?.width??0)+l*2,f=Math.max(o.height,t?.height??0)+c*3,u=t.look==="neo"?f/4:f/8,p=f+(h?u/2:-u/2),m=-d/2,y=-p/2,x=10,{cssStyles:C}=t,k=Cr(m-x,y+p+x,m+d-x,y+p+x,u,.8),v=k?.[k.length-1],S=[{x:m-x,y:y+x},{x:m-x,y:y+p+x},...k,{x:m+d-x,y:v.y-x},{x:m+d,y:v.y-x},{x:m+d,y:v.y-2*x},{x:m+d+x,y:v.y-2*x},{x:m+d+x,y:y-x},{x:m+x,y:y-x},{x:m+x,y},{x:m,y},{x:m,y:y+x}],T=[{x:m,y:y+x},{x:m+d-x,y:y+x},{x:m+d-x,y:v.y-x},{x:m+d,y:v.y-x},{x:m+d,y},{x:m,y}],B=it.svg(s),_=rt(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const P=Ct(S),O=B.path(P,_),D=Ct(T),H=B.path(D,_),U=s.insert(()=>O,":first-child");return U.insert(()=>H),U.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",i),U.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-(o.width/2)-x-(o.x-(o.left??0))}, ${-(o.height/2)+x-u/2-(o.y-(o.top??0))})`),ot(t,U),t.intersect=function(I){return tt.polygon(t,S,I)},s}g(ry,"multiWaveEdgedRectangle");async function iy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:s}=st(t);t.labelStyle=i,t.useHtmlLabels||ee(At())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,f=-h/2,{cssStyles:u}=t,p=it.svg(a),m=rt(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=p.rectangle(d,f,c,h,m),x=a.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),u&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",u),s&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",s),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,x),t.intersect=function(C){return tt.rect(t,C)},a}g(iy,"note");var W_=g((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function sy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await lt(e,t,nt(t)),a=o.width+(t.padding??0),n=o.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=it.svg(s),p=rt(t,{}),m=W_(0,0,l),y=u.path(m,p);d=s.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&d.attr("style",f)}else d=lr(s,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),ot(t,d),t.calcIntersect=function(u,p){const m=u.width,y=[{x:m/2,y:0},{x:m,y:-m/2},{x:m/2,y:-m},{x:0,y:-m/2}],x=tt.polygon(u,y,p);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(u){return this.calcIntersect(t,u)},s}g(sy,"question");async function oy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?21:s??0,a=t.look==="neo"?12:s??0,{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width??l.width)+(t.look==="neo"?o*2:o),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),f=-h/2,u=-d/2,p=u/2,m=[{x:f+p,y:u},{x:f,y:0},{x:f+p,y:-u},{x:-f,y:-u},{x:-f,y:u}],{cssStyles:y}=t,x=it.svg(n),C=rt(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=Ct(m),v=x.path(k,C),S=n.insert(()=>v,":first-child");return S.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),S.attr("transform",`translate(${-p/2},0)`),c.attr("transform",`translate(${-p/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ot(t,S),t.intersect=function(T){return tt.polygon(t,m,T)},n}g(oy,"rect_left_inv_arrow");async function ay(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;let s;t.cssClasses?s="node "+t.cssClasses:s="node default";const o=e.insert("g").attr("class",s).attr("id",t.domId||t.id),a=o.insert("g"),n=o.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await dr(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(ee(wt())){const _=h.children[0],P=pt(h);d=_.getBoundingClientRect(),P.attr("width",d.width),P.attr("height",d.height)}V.info("Text 2",l);const f=l||[],u=h.getBBox(),p=await dr(n,Array.isArray(f)?f.join("<br/>"):f,t.labelStyle,!0,!0),m=p.children[0],y=pt(p);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const x=(t.padding||0)/2;pt(p).attr("transform","translate( "+(d.width>u.width?0:(u.width-d.width)/2)+", "+(u.height+x+5)+")"),pt(h).attr("transform","translate( "+(d.width<u.width?0:-(u.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-x+3)+")");const C=d.width+(t.padding||0),k=d.height+(t.padding||0),v=-d.width/2-x,S=-d.height/2-x;let T,B;if(t.look==="handDrawn"){const _=it.svg(o),P=rt(t,{}),O=_.path(br(v,S,C,k,t.rx||0),P),D=_.line(-d.width/2-x,-d.height/2-x+u.height+x,d.width/2+x,-d.height/2-x+u.height+x,P);B=o.insert(()=>(V.debug("Rough node insert CXC",O),D),":first-child"),T=o.insert(()=>(V.debug("Rough node insert CXC",O),O),":first-child")}else T=a.insert("rect",":first-child"),B=a.insert("line"),T.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),B.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+u.height+x).attr("y2",-d.height/2-x+u.height+x);return ot(t,T),t.intersect=function(_){return tt.rect(t,_)},o}g(ay,"rectWithTitle");async function ny(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,s={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Ri(e,t,s)}g(ny,"roundedRect");var wr=8;async function ly(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width??n.width)+s*2+(t.look==="neo"?wr:wr*2),h=(t?.height??n.height)+o*2,d=c-wr,f=h,u=wr-c/2,p=-h/2,{cssStyles:m}=t,y=it.svg(a),x=rt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:u,y:p},{x:u+d,y:p},{x:u+d,y:p+f},{x:u-wr,y:p+f},{x:u-wr,y:p},{x:u,y:p},{x:u,y:p+f}],k=y.polygon(C.map(S=>[S.x,S.y]),x),v=a.insert(()=>k,":first-child");return v.attr("class","basic label-container outer-path").attr("style",Xt(m)),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${wr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,v),t.intersect=function(S){return tt.rect(t,S)},a}g(ly,"shadedProcess");async function hy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+o*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,f=h,u=d/1.5,p=-f/2,m=-u/2,{cssStyles:y}=t,x=it.svg(n),C=rt(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=[{x:p,y:m},{x:p,y:m+u},{x:p+f,y:m+u},{x:p+f,y:m-u/2}],v=Ct(k),S=x.path(v,C),T=n.insert(()=>S,":first-child");return T.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),T.attr("transform",`translate(0, ${u/4})`),c.attr("transform",`translate(${-f/2+(t.padding??0)-(l.x-(l.left??0))}, ${-u/4+(t.padding??0)-(l.y-(l.top??0))})`),ot(t,T),t.intersect=function(B){return tt.polygon(t,k,B)},n}g(hy,"slopedRect");async function cy(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,s=t.look==="neo"?12:r,o={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:s};return Ri(e,t,o)}g(cy,"squareRect");async function dy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?20:s,a=t.look==="neo"?12:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?o*2:o),d=c/2,{cssStyles:f}=t,u=it.svg(n),p=rt(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},...vs(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...vs(h/2-d,0,d,50,270,450)],y=Ct(m),x=u.path(y,p),C=n.insert(()=>x,":first-child");return C.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&C.selectChildren("path").attr("style",i),ot(t,C),t.intersect=function(k){return tt.polygon(t,m,k)},n}g(dy,"stadium");async function uy(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return Ri(e,t,r)}g(uy,"state");function fy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:s}=st(t);t.labelStyle=i;const{cssStyles:o}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=it.svg(h),f=rt(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const u=d.circle(0,0,t.width,{...f,stroke:a,strokeWidth:2}),p=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:p,stroke:p,strokeWidth:2,fillStyle:"solid"}),x=h.insert(()=>u,":first-child");if(x.insert(()=>y),t.look!=="handDrawn"&&x.attr("class","outer-path"),o&&x.selectAll("path").attr("style",o),s&&x.selectAll("path").attr("style",s),t.width<25&&c&&t.look!=="handDrawn"){const C=e.node()?.ownerSVGElement?.id??"",k=C?`${C}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${k})`)}return ot(t,x),t.intersect=function(C){return tt.circle(t,(t.width??0)/2,C)},h}g(fy,"stateEnd");function gy(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:s}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const o=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=it.svg(o).circle(0,0,t.width,_v(i));a=o.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=o.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&s&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return ot(t,a),t.intersect=function(n){return tt.circle(t,(t.width??7)/2,n)},o}g(gy,"stateStart");var Yr=8;async function py(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t?.padding??8,o=t.look==="neo"?28:s,a=t.look==="neo"?12:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width??l.width)+2*Yr+o,h=(t?.height??l.height)+a,d=c-2*Yr,f=h,u=-c/2,p=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look==="handDrawn"){const y=it.svg(n),x=rt(t,{}),C=y.rectangle(u,p,d+16,f,x),k=y.line(u+Yr,p,u+Yr,p+f,x),v=y.line(u+Yr+d,p,u+Yr+d,p+f,x);n.insert(()=>k,":first-child"),n.insert(()=>v,":first-child");const S=n.insert(()=>C,":first-child"),{cssStyles:T}=t;S.attr("class","basic label-container").attr("style",Xt(T)),ot(t,S)}else{const y=lr(n,d,f,m);i&&y.attr("style",i),ot(t,y)}return t.intersect=function(y){return tt.polygon(t,m,y)},n}g(py,"subroutine");var Xa=.2;async function my(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-o*2-Xa*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height?t?.height:l.height)+a*2,h=Xa*c,d=Xa*c,u=(t?.width?t?.width:l.width)+o*2+h-h,p=c,m=-u/2,y=-p/2,{cssStyles:x}=t,C=it.svg(n),k=rt(t,{}),v=[{x:m-h/2,y},{x:m+u+h/2,y},{x:m+u+h/2,y:y+p},{x:m-h/2,y:y+p}],S=[{x:m+u-h/2,y:y+p},{x:m+u+h/2,y:y+p},{x:m+u+h/2,y:y+p-d}];t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const T=Ct(v),B=C.path(T,k),_=Ct(S),P=C.path(_,{...k,fillStyle:"solid"}),O=n.insert(()=>P,":first-child");return O.insert(()=>B,":first-child"),O.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",i),ot(t,O),t.intersect=function(D){return tt.polygon(t,v,D)},n}g(my,"taggedRect");async function yy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:a}=await lt(e,t,nt(t)),n=Math.max(o.width+(t.padding??0)*2,t?.width??0),l=Math.max(o.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,f=l+c,{cssStyles:u}=t,p=it.svg(s),m=rt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:f/2},...Cr(-n/2-n/2*.1,f/2,n/2+n/2*.1,f/2,c,.8),{x:n/2+n/2*.1,y:-f/2},{x:-n/2-n/2*.1,y:-f/2}],x=-n/2+n/2*.1,C=-f/2-d*.4,k=[{x:x+n-h,y:(C+l)*1.3},{x:x+n,y:C+l-d},{x:x+n,y:(C+l)*.9},...Cr(x+n,(C+l)*1.25,x+n-h,(C+l)*1.3,-l*.02,.5)],v=Ct(y),S=p.path(v,m),T=Ct(k),B=p.path(T,{...m,fillStyle:"solid"}),_=s.insert(()=>B,":first-child");return _.insert(()=>S,":first-child"),_.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(o.x-(o.left??0))},${-l/2+(t.padding??0)-c/2-(o.y-(o.top??0))})`),ot(t,_),t.intersect=function(P){return tt.polygon(t,y,P)},s}g(yy,"taggedWaveEdgedRectangle");async function xy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await lt(e,t,nt(t)),a=Math.max(o.width+(t.padding??0),t?.width||0),n=Math.max(o.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=s.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),ot(t,h),t.intersect=function(d){return tt.rect(t,d)},s}g(xy,"text");var H_=g((e,t,r,i,s,o)=>`M${e},${t}
234
+ a${s},${o} 0,0,1 0,${-i}
235
+ l${r},0
236
+ a${s},${o} 0,0,1 0,${i}
237
+ M${r},${-i}
238
+ a${s},${o} 0,0,0 0,${i}
239
+ l${-r},0`,"createCylinderPathD"),Y_=g((e,t,r,i,s,o)=>[`M${e},${t}`,`M${e+r},${t}`,`a${s},${o} 0,0,0 0,${-i}`,`l${-r},0`,`a${s},${o} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),U_=g((e,t,r,i,s,o)=>[`M${e+r/2},${-i/2}`,`a${s},${o} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),Qc=5,Jc=10;async function Cy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?12:s/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-o,t.height<Qc&&(t.height=Qc);const x=m/2/(2.5+m/50);t.width=(t.width??0)-o-x*3,t.width<Jc&&(t.width=Jc)}const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t.height?t.height:n.height)+o,h=c/2,d=h/(2.5+c/50),f=(t.width?t.width:n.width)+d+o,{cssStyles:u}=t;let p;if(t.look==="handDrawn"){const m=it.svg(a),y=Y_(0,0,f,c,d,h),x=U_(0,0,f,c,d,h),C=m.path(y,rt(t,{})),k=m.path(x,rt(t,{fill:"none"}));p=a.insert(()=>k,":first-child"),p=a.insert(()=>C,":first-child"),p.attr("class","basic label-container"),u&&p.attr("style",u)}else{const m=H_(0,0,f,c,d,h);p=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Xt(u)).attr("style",i),p.attr("class","basic label-container outer-path"),u&&p.selectAll("path").attr("style",u),i&&p.selectAll("path").attr("style",i)}return p.attr("label-offset-x",d),p.attr("transform",`translate(${-f/2}, ${c/2} )`),l.attr("transform",`translate(${-(n.width/2)-d-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,p),t.intersect=function(m){const y=tt.rect(t,m),x=y.y-(t.y??0);if(h!=0&&(Math.abs(x)<(t.height??0)/2||Math.abs(x)==(t.height??0)/2&&Math.abs(y.x-(t.x??0))>(t.width??0)/2-d)){let C=d*d*(1-x*x/(h*h));C!=0&&(C=Math.sqrt(Math.abs(C))),C=d-C,m.x-(t.x??0)>0&&(C=-C),y.x+=C}return y},a}g(Cy,"tiltedCylinder");async function by(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=(t.look==="neo",s),a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+o,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const p=it.svg(n),m=rt(t,{}),y=Ct(d),x=p.path(y,m);f=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),u&&f.attr("style",u)}else f=lr(n,h,c,d);return i&&f.attr("style",i),t.width=h,t.height=c,ot(t,f),t.intersect=function(p){return tt.polygon(t,d,p)},n}g(by,"trapezoid");async function ky(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.height<l&&(t.height=l),t.width=(t.width??0)-o*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:h.width)+o*2,f=(t?.height?t?.height:h.height)+a*2,{cssStyles:u}=t,p=it.svg(c),m=rt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-d/2*.8,y:-f/2},{x:d/2*.8,y:-f/2},{x:d/2,y:-f/2*.6},{x:d/2,y:f/2},{x:-d/2,y:f/2},{x:-d/2,y:-f/2*.6}],x=Ct(y),C=p.path(x,m),k=c.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),ot(t,k),t.intersect=function(v){return tt.polygon(t,y,v)},c}g(ky,"trapezoidalPentagon");var td=10,ed=10;async function wy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?s*2:s;(t.width||t.height)&&(t.width=((t?.width??0)-o)/2,t.width<ed&&(t.width=ed),t.height=t?.height??0,t.height<td&&(t.height=td));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=Xe(wt().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+o,d=t?.height?t?.height:h+n.height,f=d,u=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-d}],{cssStyles:p}=t,m=it.svg(a),y=rt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=Ct(u),C=m.path(x,y),k=a.insert(()=>C,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return p&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),t.width=h,t.height=d,ot(t,k),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(v){return V.info("Triangle intersect",t,u,v),tt.polygon(t,u,v)},a}g(wy,"triangle");async function Sy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:c.width)+(o??0)*2,f=(t?.height?t?.height:c.height)+(a??0)*2,u=t.look==="neo"?f/4:f/8,p=f+(n?u:-u),{cssStyles:m}=t,x=14-d,C=x>0?x/2:0,k=it.svg(l),v=rt(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const S=[{x:-d/2-C,y:p/2},...Cr(-d/2-C,p/2,d/2+C,p/2,u,.8),{x:d/2+C,y:-p/2},{x:-d/2-C,y:-p/2}],T=Ct(S),B=k.path(T,v),_=l.insert(()=>B,":first-child");return _.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(0,${-u/2})`),h.attr("transform",`translate(${-d/2+(t.padding??0)-(c.x-(c.left??0))},${-f/2+(t.padding??0)-u-(c.y-(c.top??0))})`),ot(t,_),t.intersect=function(P){return tt.polygon(t,S,P)},l}g(Sy,"waveEdgedRectangle");async function vy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?20:s;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const v=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-v*(20/9)),t.width=t.width-o*2}const{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:l.width)+o*2,h=(t?.height?t?.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:u}=t,p=it.svg(n),m=rt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...Cr(-c/2,f/2,c/2,f/2,d,1),{x:c/2,y:-f/2},...Cr(c/2,-f/2,-c/2,-f/2,d,-1)],x=Ct(y),C=p.path(x,m),k=n.insert(()=>C,":first-child");return k.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),ot(t,k),t.intersect=function(v){return tt.polygon(t,y,v)},n}g(vy,"waveRectangle");var Rt=10;async function Ty(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-Rt,10),t.height=Math.max((t?.height??0)-o*2-Rt,10));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:n.width)+s*2+Rt,h=(t?.height?t?.height:n.height)+o*2+Rt,d=c-Rt,f=h-Rt,u=-d/2,p=-f/2,{cssStyles:m}=t,y=it.svg(a),x=rt(t,{}),C=[{x:u-Rt,y:p-Rt},{x:u-Rt,y:p+f},{x:u+d,y:p+f},{x:u+d,y:p-Rt}],k=`M${u-Rt},${p-Rt} L${u+d},${p-Rt} L${u+d},${p+f} L${u-Rt},${p+f} L${u-Rt},${p-Rt}
240
+ M${u-Rt},${p} L${u+d},${p}
241
+ M${u},${p-Rt} L${u},${p+f}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const v=y.path(k,x),S=a.insert(()=>v,":first-child");return S.attr("transform",`translate(${Rt/2}, ${Rt/2})`),S.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+Rt/2-(n.x-(n.left??0))}, ${-(n.height/2)+Rt/2-(n.y-(n.top??0))})`),ot(t,S),t.intersect=function(T){return tt.polygon(t,C,T)},a}g(Ty,"windowPane");var rd=new Set(["redux-color","redux-dark-color"]),X_=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Ch(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:s}=At(),{rowEven:o,rowOdd:a,nodeBorder:n,borderColorArray:l}=s;if(t.look==="handDrawn"){const{themeVariables:K}=At(),{background:Z}=K,et={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Z}`]};await Ch(e,et)}const c=At();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:f}=t,{labelStyles:u,nodeStyles:p}=st(t);if(r.attributes.length===0&&t.label){const K={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};He(t.label,c)+K.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const Z=await Ri(e,t,K);if(i!=null&&rd.has(i)){const et=r.colorIndex??0;Z.attr("data-color-id",`color-${et%l.length}`)}if(!Xe(c.htmlLabels)){const et=Z.select("text"),dt=et.node()?.getBBox();et.attr("transform",`translate(${-dt.width/2}, 0)`)}return Z}c.htmlLabels||(h*=1.25,d*=1.25);let m=nt(t);m||(m="node default");const y=e.insert("g").attr("class",m).attr("id",t.domId||t.id),x=await Gr(y,t.label??"",c,0,0,["name"],u);x.height+=d;let C=0;const k=[],v=[];let S=0,T=0,B=0,_=0,P=!0,O=!0;for(const K of r.attributes){const Z=await Gr(y,K.type,c,0,C,["attribute-type"],u);S=Math.max(S,Z.width+h);const et=await Gr(y,K.name,c,0,C,["attribute-name"],u);T=Math.max(T,et.width+h);const dt=await Gr(y,K.keys.join(),c,0,C,["attribute-keys"],u);B=Math.max(B,dt.width+h);const ut=await Gr(y,K.comment,c,0,C,["attribute-comment"],u);_=Math.max(_,ut.width+h);const xt=Math.max(Z.height,et.height,dt.height,ut.height)+d;v.push({yOffset:C,rowHeight:xt}),C+=xt}let D=4;B<=h&&(P=!1,B=0,D--),_<=h&&(O=!1,_=0,D--);const H=y.node().getBBox();if(x.width+h*2-(S+T+B+_)>0){const K=x.width+h*2-(S+T+B+_);S+=K/D,T+=K/D,B>0&&(B+=K/D),_>0&&(_+=K/D)}const U=S+T+B+_,I=it.svg(y),M=rt(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let A=0;v.length>0&&(A=v.reduce((K,Z)=>K+(Z?.rowHeight??0),0));const z=Math.max(H.width+h*2,t?.width||0,U),R=Math.max((A??0)+x.height,t?.height||0),$=-z/2,N=-R/2;if(y.selectAll("g:not(:first-child)").each((K,Z,et)=>{const dt=pt(et[Z]),ut=dt.attr("transform");let xt=0,Lt=0;if(ut){const Mt=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ut);Mt&&(xt=parseFloat(Mt[1]),Lt=parseFloat(Mt[2]),dt.attr("class").includes("attribute-name")?xt+=S:dt.attr("class").includes("attribute-keys")?xt+=S+T:dt.attr("class").includes("attribute-comment")&&(xt+=S+T+B))}dt.attr("transform",`translate(${$+h/2+xt}, ${Lt+N+x.height+d/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(N+d/2)+")"),i!=null&&rd.has(i)){const K=r.colorIndex??0;y.attr("data-color-id",`color-${K%l.length}`)}const L=I.rectangle($,N,z,R,M),X=y.insert(()=>L,":first-child").attr("class","outer-path").attr("style",f.join(""));k.push(0);for(const[K,Z]of v.entries()){const dt=(K+1)%2===0&&Z.yOffset!==0,ut=I.rectangle($,x.height+N+Z?.yOffset,z,Z?.rowHeight,{...M,fill:dt?o:a,stroke:n});y.insert(()=>ut,"g.label").attr("style",f.join("")).attr("class",`row-rect-${dt?"even":"odd"}`)}const Y=1e-4;let G=Vr($,x.height+N,z+$,x.height+N,Y),q=I.polygon(G.map(K=>[K.x,K.y]),M);if(y.insert(()=>q).attr("class","divider"),G=Vr(S+$,x.height+N,S+$,R+N,Y),q=I.polygon(G.map(K=>[K.x,K.y]),M),y.insert(()=>q).attr("class","divider"),P){const K=S+T+$;G=Vr(K,x.height+N,K,R+N,Y),q=I.polygon(G.map(Z=>[Z.x,Z.y]),M),y.insert(()=>q).attr("class","divider")}if(O){const K=S+T+B+$;G=Vr(K,x.height+N,K,R+N,Y),q=I.polygon(G.map(Z=>[Z.x,Z.y]),M),y.insert(()=>q).attr("class","divider")}for(const K of k){const Z=x.height+N+K;G=Vr($,Z,z+$,Z,Y),q=I.polygon(G.map(et=>[et.x,et.y]),M),y.insert(()=>q).attr("class","divider")}if(ot(t,X),p&&t.look!=="handDrawn")if(i!=null&&X_.has(i))y.selectAll("path").attr("style",p);else{const Z=p.split(";")?.filter(et=>et.includes("stroke"))?.map(et=>`${et}`).join("; ");y.selectAll("path").attr("style",Z??""),y.selectAll(".row-rect-even path").attr("style",p)}return t.intersect=function(K){return tt.rect(t,K)},y}g(Ch,"erBox");async function Gr(e,t,r,i=0,s=0,o=[],a=""){const n=e.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${i}, ${s})`).attr("style",a);t!==ln(t)&&(t=ln(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=n.node().appendChild(await Oe(n,t,{width:He(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("&lt;")||t.includes("&gt;")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let c=l.getBBox();if(Xe(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=pt(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}g(Gr,"addText");function Vr(e,t,r,i,s){return e===r?[{x:e-s/2,y:t},{x:e+s/2,y:t},{x:r+s/2,y:i},{x:r-s/2,y:i}]:[{x:e,y:t-s/2},{x:e,y:t+s/2},{x:r,y:i+s/2},{x:r,y:i-s/2}]}g(Vr,"lineToPolygon");async function _y(e,t,r,i,s=r.class.padding??12){const o=i?0:3,a=e.insert("g").attr("class",nt(t)).attr("id",t.domId||t.id);let n=null,l=null,c=null,h=null,d=0,f=0,u=0;if(n=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const C=t.annotations[0];await ss(n,{text:`«${C}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await ss(l,t,0,["font-weight: bolder"]);const p=l.node().getBBox();f=p.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const C of t.members){const k=await ss(c,C,m,[C.parseClassifier()]);m+=k+o}u=c.node().getBBox().height,u<=0&&(u=s/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const C of t.methods){const k=await ss(h,C,y,[C.parseClassifier()]);y+=k+o}let x=a.node().getBBox();if(n!==null){const C=n.node().getBBox();n.attr("transform",`translate(${-C.width/2})`)}return l.attr("transform",`translate(${-p.width/2}, ${d})`),x=a.node().getBBox(),c.attr("transform",`translate(0, ${d+f+s*2})`),x=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(u?u+s*4:s*2)})`),x=a.node().getBBox(),{shapeSvg:a,bbox:x}}g(_y,"textHelper");async function ss(e,t,r,i=[]){const s=e.insert("g").attr("class","label").attr("style",i.join("; ")),o=At();let a="useHtmlLabels"in t?t.useHtmlLabels:Xe(o.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),ki(n)&&(a=!0);const l=await Oe(s,_l(yr(n)),{width:He(n,o)+50,classes:"markdown-node-label",useHtmlLabels:a},o);let c,h=1;if(a){const d=l.children[0],f=pt(l);h=d.innerHTML.split("<br>").length,d.innerHTML.includes("</math>")&&(h+=d.innerHTML.split("<mrow>").length-1);const u=d.getElementsByTagName("img");if(u){const p=n.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...u].map(m=>new Promise(y=>{function x(){if(m.style.display="flex",m.style.flexDirection="column",p){const C=o.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,v=parseInt(C,10)*5+"px";m.style.minWidth=v,m.style.maxWidth=v}else m.style.width="100%";y(m)}g(x,"setupImage"),setTimeout(()=>{m.complete&&x()}),m.addEventListener("error",x),m.addEventListener("load",x)})))}c=d.getBoundingClientRect(),f.attr("width",c.width),f.attr("height",c.height)}else{i.includes("font-weight: bolder")&&pt(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes("&gt"))&&(d.textContent=n[0]+n.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),n[1]===" "&&(d.textContent=d.textContent[0]+" "+d.textContent.substring(1))),d.textContent==="undefined"&&(d.textContent=""),c=l.getBBox()}return s.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}g(ss,"addText");async function By(e,t){const r=wt(),{themeVariables:i}=r,{useGradient:s}=i,o=r.class.padding??12,a=o,n=t.useHtmlLabels??Xe(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await _y(e,t,r,n,a),{labelStyles:d,nodeStyles:f}=st(t);t.labelStyle=d,t.cssStyles=l.styles||"";const u=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const p=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,m=it.svg(c),y=rt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=Math.max(t.width??0,h.width);let C=Math.max(t.height??0,h.height);const k=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?C+=a:l.members.length>0&&l.methods.length===0&&(C+=a*2);const v=-x/2,S=-C/2;let T=p?o*2:l.members.length===0&&l.methods.length===0?-o:0;k&&(T=o*2);const B=m.rectangle(v-o,S-o-(p?o:l.members.length===0&&l.methods.length===0?-o/2:0),x+2*o,C+2*o+T,y),_=c.insert(()=>B,":first-child");_.attr("class","basic label-container outer-path");const P=_.node().getBBox(),O=c.select(".annotation-group").node().getBBox().height-(p?o/2:0)||0,D=c.select(".label-group").node().getBBox().height-(p?o/2:0)||0,H=c.select(".members-group").node().getBBox().height-(p?o/2:0)||0,U=(O+D+S+o-(S-o-(p?o:l.members.length===0&&l.methods.length===0?-o/2:0)))/2;if(c.selectAll(".text").each((I,M,A)=>{const z=pt(A[M]),R=z.attr("transform");let $=0;if(R){const Y=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(R);Y&&($=parseFloat(Y[2]))}let N=$+S+o-(p?o:l.members.length===0&&l.methods.length===0?-o/2:0);if(z.attr("class").includes("methods-group")){const X=Math.max(H,a/2);k?N=Math.max(U,O+D+X+S+a*2+o)+a*2:N=O+D+X+S+a*4+o}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?N=$-a:N=$),n||(N-=4);let L=v;(z.attr("class").includes("label-group")||z.attr("class").includes("annotation-group"))&&(L=-z.node()?.getBBox().width/2||0,c.selectAll("text").each(function(X,Y,G){window.getComputedStyle(G[Y]).textAnchor==="middle"&&(L=0)})),z.attr("transform",`translate(${L}, ${N})`)}),l.members.length>0||l.methods.length>0||p){const I=O+D+S+o,M=m.line(P.x,I,P.x+P.width,I+.001,y);c.insert(()=>M).attr("class",`divider${t.look==="neo"&&!s?" neo-line":""}`).attr("style",u)}if(p||l.members.length>0||l.methods.length>0){const I=O+D+H+S+a*2+o,M=m.line(P.x,k?Math.max(U,I):I,P.x+P.width,(k?Math.max(U,I):I)+.001,y);c.insert(()=>M).attr("class",`divider${t.look==="neo"&&!s?" neo-line":""}`).attr("style",u)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",u),_.select(":nth-child(2)").attr("style",u),c.selectAll(".divider").select("path").attr("style",u),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",u),!n){const I=RegExp(/color\s*:\s*([^;]*)/),M=I.exec(u);if(M){const A=M[0].replace("color","fill");c.selectAll("tspan").attr("style",A)}else if(d){const A=I.exec(d);if(A){const z=A[0].replace("color","fill");c.selectAll("tspan").attr("style",z)}}}return ot(t,_),t.intersect=function(I){return tt.rect(t,I)},c}g(By,"classBox");async function Ly(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const s=t,o=t,a=20,n=20,l="verifyMethod"in t,c=nt(t),{themeVariables:h}=wt(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,u=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let p;l?p=await Ne(u,`&lt;&lt;${s.type}&gt;&gt;`,0,t.labelStyle):p=await Ne(u,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let m=p;const y=await Ne(u,s.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const P=await Ne(u,`${s.requirementId?`ID: ${s.requirementId}`:""}`,m,t.labelStyle);m+=P;const O=await Ne(u,`${s.text?`Text: ${s.text}`:""}`,m,t.labelStyle);m+=O;const D=await Ne(u,`${s.risk?`Risk: ${s.risk}`:""}`,m,t.labelStyle);m+=D,await Ne(u,`${s.verifyMethod?`Verification: ${s.verifyMethod}`:""}`,m,t.labelStyle)}else{const P=await Ne(u,`${o.type?`Type: ${o.type}`:""}`,m,t.labelStyle);m+=P,await Ne(u,`${o.docRef?`Doc Ref: ${o.docRef}`:""}`,m,t.labelStyle)}const x=(u.node()?.getBBox().width??200)+a,C=(u.node()?.getBBox().height??200)+a,k=-x/2,v=-C/2,S=it.svg(u),T=rt(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const B=S.rectangle(k,v,x,C,T),_=u.insert(()=>B,":first-child");if(_.attr("class","basic label-container outer-path").attr("style",i),d?.length){const P=t.colorIndex??0;u.attr("data-color-id",`color-${P%d.length}`)}if(u.selectAll(".label").each((P,O,D)=>{const H=pt(D[O]),U=H.attr("transform");let I=0,M=0;if(U){const $=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(U);$&&(I=parseFloat($[1]),M=parseFloat($[2]))}const A=M-C/2;let z=k+a/2;(O===0||O===1)&&(z=I),H.attr("transform",`translate(${z}, ${A+a})`)}),m>p+y+n){const P=v+p+y+n;let O;if(t.look==="neo"){const U=[[k,P],[k+x,P],[k+x,P+.001],[k,P+.001]];O=S.polygon(U,T)}else O=S.line(k,P,k+x,P,T);u.insert(()=>O).attr("class","divider")}return ot(t,_),t.intersect=function(P){return tt.rect(t,P)},i&&t.look!=="handDrawn"&&(f||d?.length)&&u.selectAll("path").attr("style",i),u}g(Ly,"requirementBox");async function Ne(e,t,r,i=""){if(t==="")return 0;const s=e.insert("g").attr("class","label").attr("style",i),o=wt(),a=o.htmlLabels??!0,n=await Oe(s,_l(yr(t)),{width:He(t,o)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},o);let l;if(a){const c=n.children[0],h=pt(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=n.getBBox(),l.height+=6}return s.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}g(Ne,"addText");var G_=g(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Ey(e,t,{config:r}){const{labelStyles:i,nodeStyles:s}=st(t);t.labelStyle=i||"";const o=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=t.padding||10;let d="",f;"ticket"in t&&t.ticket&&r?.kanban?.ticketBaseUrl&&(d=r?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),f=n.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",d).attr("target","_blank"));const u={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let p,m;f?{label:p,bbox:m}=await Ua(f,"ticket"in t&&t.ticket||"",u):{label:p,bbox:m}=await Ua(n,"ticket"in t&&t.ticket||"",u);const{label:y,bbox:x}=await Ua(n,"assigned"in t&&t.assigned||"",u);t.width=a;const C=10,k=t?.width||0,v=Math.max(m.height,x.height)/2,S=Math.max(l.height+C*2,t?.height||0)+v,T=-k/2,B=-S/2;c.attr("transform","translate("+(h-k/2)+", "+(-v-l.height/2)+")"),p.attr("transform","translate("+(h-k/2)+", "+(-v+l.height/2)+")"),y.attr("transform","translate("+(h+k/2-x.width-2*o)+", "+(-v+l.height/2)+")");let _;const{rx:P,ry:O}=t,{cssStyles:D}=t;if(t.look==="handDrawn"){const H=it.svg(n),U=rt(t,{}),I=P||O?H.path(br(T,B,k,S,P||0),U):H.rectangle(T,B,k,S,U);_=n.insert(()=>I,":first-child"),_.attr("class","basic label-container").attr("style",D||null)}else{_=n.insert("rect",":first-child"),_.attr("class","basic label-container __APA__").attr("style",s).attr("rx",P??5).attr("ry",O??5).attr("x",T).attr("y",B).attr("width",k).attr("height",S);const H="priority"in t&&t.priority;if(H){const U=n.append("line"),I=T+2,M=B+Math.floor((P??0)/2),A=B+S-Math.floor((P??0)/2);U.attr("x1",I).attr("y1",M).attr("x2",I).attr("y2",A).attr("stroke-width","4").attr("stroke",G_(H))}}return ot(t,_),t.height=S,t.intersect=function(H){return tt.rect(t,H)},n}g(Ey,"kanbanItem");async function Fy(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=o.width+10*a,c=o.height+8*a,h=.15*l,{cssStyles:d}=t,f=o.width+20,u=o.height+20,p=Math.max(l,f),m=Math.max(c,u);n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`);let y;const x=`M0 0
242
+ a${h},${h} 1 0,0 ${p*.25},${-1*m*.1}
243
+ a${h},${h} 1 0,0 ${p*.25},0
244
+ a${h},${h} 1 0,0 ${p*.25},0
245
+ a${h},${h} 1 0,0 ${p*.25},${m*.1}
246
+
247
+ a${h},${h} 1 0,0 ${p*.15},${m*.33}
248
+ a${h*.8},${h*.8} 1 0,0 0,${m*.34}
249
+ a${h},${h} 1 0,0 ${-1*p*.15},${m*.33}
250
+
251
+ a${h},${h} 1 0,0 ${-1*p*.25},${m*.15}
252
+ a${h},${h} 1 0,0 ${-1*p*.25},0
253
+ a${h},${h} 1 0,0 ${-1*p*.25},0
254
+ a${h},${h} 1 0,0 ${-1*p*.25},${-1*m*.15}
255
+
256
+ a${h},${h} 1 0,0 ${-1*p*.1},${-1*m*.33}
257
+ a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}
258
+ a${h},${h} 1 0,0 ${p*.1},${-1*m*.33}
259
+ H0 V0 Z`;if(t.look==="handDrawn"){const C=it.svg(s),k=rt(t,{}),v=C.path(x,k);y=s.insert(()=>v,":first-child"),y.attr("class","basic label-container").attr("style",Xt(d))}else y=s.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-p/2}, ${-m/2})`),ot(t,y),t.calcIntersect=function(C,k){return tt.rect(C,k)},t.intersect=function(C){return V.info("Bang intersect",t,C),tt.rect(t,C)},s}g(Fy,"bang");async function Ay(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=o.width+2*a,c=o.height+2*a,h=.15*l,d=.25*l,f=.35*l,u=.2*l,{cssStyles:p}=t;let m;const y=`M0 0
260
+ a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
261
+ a${f},${f} 1 0,1 ${l*.4},${-1*l*.1}
262
+ a${d},${d} 1 0,1 ${l*.35},${l*.2}
263
+
264
+ a${h},${h} 1 0,1 ${l*.15},${c*.35}
265
+ a${u},${u} 1 0,1 ${-1*l*.15},${c*.65}
266
+
267
+ a${d},${h} 1 0,1 ${-1*l*.25},${l*.15}
268
+ a${f},${f} 1 0,1 ${-1*l*.5},0
269
+ a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
270
+
271
+ a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
272
+ a${u},${u} 1 0,1 ${l*.1},${-1*c*.65}
273
+ H0 V0 Z`;if(t.look==="handDrawn"){const x=it.svg(s),C=rt(t,{}),k=x.path(y,C);m=s.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Xt(p))}else m=s.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),ot(t,m),t.calcIntersect=function(x,C){return tt.rect(x,C)},t.intersect=function(x){return V.info("Cloud intersect",t,x),tt.rect(t,x)},s}g(Ay,"cloud");async function My(e,t){const{labelStyles:r,nodeStyles:i}=st(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=o.width+8*a,c=o.height+2*a,h=5,d=t.look==="neo"?`
274
+ M${-l/2} ${c/2-h}
275
+ v${-c+2*h}
276
+ q0,-${h} ${h},-${h}
277
+ h${l-2*h}
278
+ q${h},0 ${h},${h}
279
+ v${c-h}
280
+ H${-l/2}
281
+ Z
282
+ `:`
283
+ M${-l/2} ${c/2-h}
284
+ v${-c+2*h}
285
+ q0,-${h} ${h},-${h}
286
+ h${l-2*h}
287
+ q${h},0 ${h},${h}
288
+ v${c-2*h}
289
+ q0,${h} ${-h},${h}
290
+ h${-(l-2*h)}
291
+ q${-h},0 ${-h},${-h}
292
+ Z
293
+ `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=s.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return s.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),s.append(()=>n.node()),ot(t,f),t.calcIntersect=function(u,p){return tt.rect(u,p)},t.intersect=function(u){return tt.rect(t,u)},s}g(My,"defaultMindmapNode");async function $y(e,t){const r={padding:t.padding??0};return xh(e,t,r)}g($y,"mindmapCircle");var V_=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:cy},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:ny},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:dy},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:py},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:$m},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Om},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:xh},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Fy},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:Ay},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:sy},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:zm},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Km},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Zm},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:by},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Gm},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Im},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:xy},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Tm},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:ly},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:gy},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:fy},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Nm},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:jm},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Em},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Fm},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Am},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Qm},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Sy},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:qm},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Cy},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Jm},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Mm},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Rm},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:wy},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Ty},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Pm},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:ky},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Dm},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:hy},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:ry},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:ey},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:vm},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Lm},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:yy},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:my},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:vy},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:oy},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:ty}],Z_=g(()=>{const t=[...Object.entries({state:uy,choice:_m,note:iy,rectWithTitle:ay,labelRect:Vm,iconSquare:Um,iconCircle:Hm,icon:Wm,iconRounded:Ym,imageSquare:Xm,anchor:wm,kanbanItem:Ey,mindmapCircle:$y,defaultMindmapNode:My,classBox:By,erBox:Ch,requirementBox:Ly}),...V_.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(s=>[s,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),Oy=Z_();function Ry(e){return e in Oy}g(Ry,"isValidShape");var Ca=new Map;async function bh(e,t,r){let i,s;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const o=t.shape?Oy[t.shape]:void 0;if(!o)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),s=await o(i,t,r)}else s=await o(e,t,r),i=s;return i.attr("data-look",Xt(t.look)),t.tooltip&&s.attr("title",t.tooltip),Ca.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}g(bh,"insertNode");var K_=g((e,t)=>{Ca.set(t.id,e)},"setNodeElem"),Q_=g(()=>{Ca.clear()},"clear"),J_=g(e=>{const t=Ca.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"),Zr=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"),Kt={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},id={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function os(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Ft(e),t=Ft(t);const[r,i]=[e.x,e.y],[s,o]=[t.x,t.y],a=s-r,n=o-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}g(os,"calculateDeltaAndAngle");var Ft=g(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),Iy=g(e=>({x:g(function(t,r,i){let s=0;const o=Ft(i[0]).x<Ft(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Kt,e.arrowTypeStart)){const{angle:u,deltaX:p}=os(i[0],i[1]);s=Kt[e.arrowTypeStart]*Math.cos(u)*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Kt,e.arrowTypeEnd)){const{angle:u,deltaX:p}=os(i[i.length-1],i[i.length-2]);s=Kt[e.arrowTypeEnd]*Math.cos(u)*(p>=0?1:-1)}const a=Math.abs(Ft(t).x-Ft(i[i.length-1]).x),n=Math.abs(Ft(t).y-Ft(i[i.length-1]).y),l=Math.abs(Ft(t).x-Ft(i[0]).x),c=Math.abs(Ft(t).y-Ft(i[0]).y),h=Kt[e.arrowTypeStart],d=Kt[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=o==="right"?-1:1,s-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=o==="right"?-1:1,s+=u}return Ft(t).x+s},"x"),y:g(function(t,r,i){let s=0;const o=Ft(i[0]).y<Ft(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Kt,e.arrowTypeStart)){const{angle:u,deltaY:p}=os(i[0],i[1]);s=Kt[e.arrowTypeStart]*Math.abs(Math.sin(u))*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Kt,e.arrowTypeEnd)){const{angle:u,deltaY:p}=os(i[i.length-1],i[i.length-2]);s=Kt[e.arrowTypeEnd]*Math.abs(Math.sin(u))*(p>=0?1:-1)}const a=Math.abs(Ft(t).y-Ft(i[i.length-1]).y),n=Math.abs(Ft(t).x-Ft(i[i.length-1]).x),l=Math.abs(Ft(t).y-Ft(i[0]).y),c=Math.abs(Ft(t).x-Ft(i[0]).x),h=Kt[e.arrowTypeStart],d=Kt[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=o==="up"?-1:1,s-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=o==="up"?-1:1,s+=u}return Ft(t).y+s},"y")}),"getLineFunctionsWithOffset"),tB=g((e,t,r,i,s,o=!1,a)=>{t.arrowTypeStart&&sd(e,"start",t.arrowTypeStart,r,i,s,o,a),t.arrowTypeEnd&&sd(e,"end",t.arrowTypeEnd,r,i,s,o,a)},"addEdgeMarkers"),eB={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},rB=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],sd=g((e,t,r,i,s,o,a=!1,n)=>{const l=eB[r],c=l&&rB.includes(l.type);if(!l){V.warn(`Unknown arrow type: ${r}`);return}const h=l.type,u=`${s}_${o}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const p=n.replace(/[^\dA-Za-z]/g,"_"),m=`${u}_${p}`;if(!document.getElementById(m)){const y=document.getElementById(u);if(y){const x=y.cloneNode(!0);x.id=m,x.querySelectorAll("path, circle, line").forEach(k=>{k.setAttribute("stroke",n),l.fill&&k.setAttribute("fill",n)}),y.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${u})`)},"addEdgeMarker"),iB=g(e=>typeof e=="string"?e:wt()?.flowchart?.curve,"resolveEdgeCurveType"),Ts=new Map,Ut=new Map,sB=g(()=>{Ts.clear(),Ut.clear()},"clear"),Vi=g(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),Py=g(async(e,t)=>{const r=wt();let i=ee(r);const{labelStyles:s}=st(t);t.labelStyle=s;const o=e.insert("g").attr("class","edgeLabel"),a=o.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Oe(e,t.label,{style:Vi(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);a.node().appendChild(c),V.info("abc82",t,t.labelType);let h=c.getBBox(),d=h;if(i){const u=c.children[0],p=pt(c);h=u.getBoundingClientRect(),d=h,p.attr("width",h.width),p.attr("height",h.height)}else{const u=pt(c).select("text").node();u&&typeof u.getBBox=="function"&&(d=u.getBBox())}a.attr("transform",Zr(d,i)),Ts.set(t.id,o),t.width=h.width,t.height=h.height;let f;if(t.startLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),p=u.insert("g").attr("class","inner"),m=await dr(p,t.startLabelLeft,Vi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=pt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",Zr(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startLeft=u,as(f,t.startLabelLeft)}if(t.startLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),p=u.insert("g").attr("class","inner"),m=await dr(p,t.startLabelRight,Vi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=pt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",Zr(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).startRight=u,as(f,t.startLabelRight)}if(t.endLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),p=u.insert("g").attr("class","inner"),m=await dr(u,t.endLabelLeft,Vi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=pt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",Zr(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endLeft=u,as(f,t.endLabelLeft)}if(t.endLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),p=u.insert("g").attr("class","inner"),m=await dr(u,t.endLabelRight,Vi(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=pt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}p.attr("transform",Zr(y,i)),Ut.get(t.id)||Ut.set(t.id,{}),Ut.get(t.id).endRight=u,as(f,t.endLabelRight)}return c},"insertEdgeLabel");function as(e,t){ee(wt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(as,"setTerminalWidth");var Dy=g((e,t)=>{V.debug("Moving label abc88 ",e.id,e.label,Ts.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=wt(),{subGraphTitleTotalMargin:s}=fa(i);if(e.label){const o=Ts.get(e.id);let a=e.x,n=e.y;if(r){const l=ke.calcLabelPosition(r);V.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}o.attr("transform",`translate(${a}, ${n+s/2})`)}if(e.startLabelLeft){const o=Ut.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=ke.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const o=Ut.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=ke.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const o=Ut.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=ke.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const o=Ut.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=ke.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),oB=g((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,s=Math.abs(i.x-r.x),o=Math.abs(i.y-r.y);return s<.001||o<.001?t:o>=s?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),aB=g((e,t)=>{const r=e.x,i=e.y,s=Math.abs(t.x-r),o=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return s>=a||o>=n},"outsideNode"),nB=g((e,t,r)=>{V.debug(`intersection calc abc89:
294
+ outsidePoint: ${JSON.stringify(t)}
295
+ insidePoint : ${JSON.stringify(r)}
296
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,s=e.y,o=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-o:a+o;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(s-t.y)*a>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-s:s-l-t.y;n=h*d/c;const f={x:r.x<t.x?r.x+n:r.x-h+n,y:r.y<t.y?r.y+c-d:r.y-c+d};return n===0&&(f.x=t.x,f.y=t.y),h===0&&(f.x=t.x),c===0&&(f.y=t.y),V.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${n}`,f),f}else{r.x<t.x?n=t.x-a-i:n=i-a-t.x;let d=c*n/h,f=r.x<t.x?r.x+h-n:r.x-h+n,u=r.y<t.y?r.y+d:r.y-d;return V.debug(`sides calc abc89, Q ${c}, q ${d}, R ${h}, r ${n}`,{_x:f,_y:u}),n===0&&(f=t.x,u=t.y),h===0&&(f=t.x),c===0&&(u=t.y),{x:f,y:u}}},"intersection"),od=g((e,t)=>{V.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],s=!1;return e.forEach(o=>{if(V.info("abc88 checking point",o,t),!aB(t,o)&&!s){const a=nB(t,i,o);V.debug("abc88 inside",o,i,a),V.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?V.warn("abc88 no intersect",a,r):r.push(a),s=!0}else V.warn("abc88 outside",o,i),i=o,s||r.push(o)}),V.debug("returning points",r),r},"cutPathAtIntersect");function Ny(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const s=e[i-1],o=e[i],a=e[i+1];(s.x===o.x&&o.y===a.y&&Math.abs(o.x-a.x)>5&&Math.abs(o.y-s.y)>5||s.y===o.y&&o.x===a.x&&Math.abs(o.x-s.x)>5&&Math.abs(o.y-a.y)>5)&&(t.push(o),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}g(Ny,"extractCornerPoints");var ad=g(function(e,t,r){const i=t.x-e.x,s=t.y-e.y,o=Math.sqrt(i*i+s*s),a=r/o;return{x:t.x-a*i,y:t.y-a*s}},"findAdjacentPoint"),lB=g(function(e){const{cornerPointPositions:t}=Ny(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const s=e[i-1],o=e[i+1],a=e[i],n=ad(s,a,5),l=ad(o,a,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let f={x:a.x,y:a.y};if(Math.abs(o.x-s.x)>10&&Math.abs(o.y-s.y)>=10){V.debug("Corner point fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));const u=5;a.x===n.x?f={x:c<0?n.x-u+d:n.x+u-d,y:h<0?n.y-d:n.y+d}:f={x:c<0?n.x-d:n.x+d,y:h<0?n.y-u+d:n.y+u-d}}else V.debug("Corner point skipping fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));r.push(f,l)}else r.push(e[i]);return r},"fixCorners"),hB=g((e,t,r)=>{const i=e-t-r,s=2,o=2,a=s+o,n=Math.floor(i/a),l=Array(n).fill(`${s} ${o}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),qy=g(function(e,t,r,i,s,o,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=wt();let h=t.points,d=!1;const f=s;var u=o;const p=[];for(const R in t.cssCompiledStyles)Ul(R)||p.push(t.cssCompiledStyles[R]);if(c==="swimlane"){if(u.intersect&&f.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[f.intersect(h[0]),u.intersect(h[1])];else{const R=h.slice(1,-1),$=R[0],N=R[R.length-1],L=.5,X=Math.abs(h[h.length-1].x-N.x)<L&&Math.abs(h[h.length-1].y-N.y)<L,Y=f.intersect($),G=X?N:u.intersect(N),q=Math.abs(G.x-N.x)<L&&Math.abs(G.y-N.y)<L,Z=Math.abs(Y.x-$.x)<L&&Math.abs(Y.y-$.y)<L?[]:[Y],et=q?[]:[G];h=[...Z,...R,...et]}h=oB(t,h)}else u.intersect&&f.intersect&&!n&&(h=h.slice(1,t.points.length-1),h.unshift(f.intersect(h[0])),h.push(u.intersect(h[h.length-1])));const m=btoa(JSON.stringify(h));t.toCluster&&(V.info("to cluster abc88",r.get(t.toCluster)),h=od(t.points,r.get(t.toCluster).node),d=!0),t.fromCluster&&(V.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(h,null,2)),h=od(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(R=>!Number.isNaN(R.y));const x=iB(t.curve);x!=="rounded"&&(y=lB(y));let C=ds;switch(x){case"linear":C=ds;break;case"basis":C=Lo;break;case"cardinal":C=Ju;break;case"bumpX":C=Gu;break;case"bumpY":C=Vu;break;case"catmullRom":C=ef;break;case"monotoneX":C=lf;break;case"monotoneY":C=hf;break;case"natural":C=df;break;case"step":C=uf;break;case"stepAfter":C=gf;break;case"stepBefore":C=ff;break;case"rounded":C=ds;break;default:C=Lo}const{x:k,y:v}=Iy(t),S=Uu().x(k).y(v).curve(C);let T;switch(t.thickness){case"normal":T="edge-thickness-normal";break;case"thick":T="edge-thickness-thick";break;case"invisible":T="edge-thickness-invisible";break;default:T="edge-thickness-normal"}switch(t.pattern){case"solid":T+=" edge-pattern-solid";break;case"dotted":T+=" edge-pattern-dotted";break;case"dashed":T+=" edge-pattern-dashed";break;default:T+=" edge-pattern-solid"}let B,_=x==="rounded"?zy(jy(y,t),5):S(y);const P=Array.isArray(t.style)?t.style:[t.style];let O=P.find(R=>R?.startsWith("stroke:")),D="";t.animate&&(D="edge-animation-fast"),t.animation&&(D="edge-animation-"+t.animation);let H=!1;if(t.look==="handDrawn"){const R=it.svg(e);Object.assign([],y);const $=R.path(_,{roughness:.3,seed:l});T+=" transition",B=pt($).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+T+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",P?P.reduce((L,X)=>L+";"+X,""):"");let N=B.attr("d");B.attr("d",N),e.node().appendChild(B.node())}else{const R=p.join(";"),$=P?P.reduce((q,K)=>q+K+";",""):"",N=(R?R+";"+$+";":$)+";"+(P?P.reduce((q,K)=>q+";"+K,""):"");B=e.append("path").attr("d",_).attr("id",`${a}-${t.id}`).attr("class"," "+T+(t.classes?" "+t.classes:"")+(D?" "+D:"")).attr("style",N),O=N.match(/stroke:([^;]+)/)?.[1],H=t.animate===!0||!!t.animation||R.includes("animation");const L=B.node(),X=typeof L.getTotalLength=="function"?L.getTotalLength():0,Y=id[t.arrowTypeStart]||0,G=id[t.arrowTypeEnd]||0;if(t.look==="neo"&&!H){const K=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?hB(X,Y,G):`0 ${Y} ${X-Y-G} ${G}`}; stroke-dashoffset: 0;`;B.attr("style",K+B.attr("style"))}}B.attr("data-edge",!0),B.attr("data-et","edge"),B.attr("data-id",t.id),B.attr("data-points",m),B.attr("data-look",Xt(t.look)),t.showPoints&&y.forEach(R=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",R.x).attr("cy",R.y)});let U="";(wt().flowchart.arrowMarkerAbsolute||wt().state.arrowMarkerAbsolute)&&(U=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,U=U.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",t.arrowTypeStart),V.info("arrowTypeEnd",t.arrowTypeEnd);const I=!H&&t?.look==="neo";tB(B,t,U,a,i,I,O);const M=Math.floor(h.length/2),A=h[M];ke.isLabelCoordinateInPath(A,B.attr("d"))||(d=!0);let z={};return d&&(z.updatedPath=h),z.originalPath=t.points,z},"insertEdge");function zy(e,t){if(e.length<2)return"";let r="";const i=e.length,s=1e-5;for(let o=0;o<i;o++){const a=e[o],n=e[o-1],l=e[o+1];if(o===0)r+=`M${a.x},${a.y}`;else if(o===i-1)r+=`L${a.x},${a.y}`;else{const c=a.x-n.x,h=a.y-n.y,d=l.x-a.x,f=l.y-a.y,u=Math.hypot(c,h),p=Math.hypot(d,f);if(u<s||p<s){r+=`L${a.x},${a.y}`;continue}const m=c/u,y=h/u,x=d/p,C=f/p,k=m*x+y*C,v=Math.max(-1,Math.min(1,k)),S=Math.acos(v);if(S<s||Math.abs(Math.PI-S)<s){r+=`L${a.x},${a.y}`;continue}const T=Math.min(t/Math.sin(S/2),u/2,p/2),B=a.x-m*T,_=a.y-y*T,P=a.x+x*T,O=a.y+C*T;r+=`L${B},${_}`,r+=`Q${a.x},${a.y} ${P},${O}`}}return r}g(zy,"generateRoundedPath");function tl(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}g(tl,"calculateDeltaAndAngle");function jy(e,t){const r=e.map(s=>({...s}));if(e.length>=2&&Kt[t.arrowTypeStart]){const s=Kt[t.arrowTypeStart],o=e[0],a=e[1],{angle:n}=tl(o,a),l=s*Math.cos(n),c=s*Math.sin(n);r[0].x=o.x+l,r[0].y=o.y+c}const i=e.length;if(i>=2&&Kt[t.arrowTypeEnd]){const s=Kt[t.arrowTypeEnd],o=e[i-1],a=e[i-2],{angle:n}=tl(a,o),l=s*Math.cos(n),c=s*Math.sin(n);r[i-1].x=o.x-l,r[i-1].y=o.y-c}return r}g(jy,"applyMarkerOffsetsToPoints");var cB=g((e,t,r,i)=>{t.forEach(s=>{$B[s](e,r,i)})},"insertMarkers"),dB=g((e,t,r)=>{V.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),uB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),fB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),gB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),pB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),mB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),yB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),xB=g((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),CB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),bB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{transitionColor:o}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${o}`)},"barbNeo"),kB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),wB=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const s=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),s.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),SB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),vB=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const s=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),s.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),TB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${o}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${o}`)},"only_one_neo"),_B=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o,mainBkg:a}=s,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${o}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${o}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${o}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${o}`)},"zero_or_one_neo"),BB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${o}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${o}`)},"one_or_more_neo"),LB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o,mainBkg:a}=s,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${o}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${o}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${o}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${o}`)},"zero_or_more_neo"),EB=g((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
297
+ L20,10
298
+ M20,10
299
+ L0,20`)},"requirement_arrow"),FB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
300
+ L20,10
301
+ M20,10
302
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),AB=g((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),MB=g((e,t,r)=>{const i=At(),{themeVariables:s}=i,{strokeWidth:o}=s,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),$B={extension:dB,composition:uB,aggregation:fB,dependency:gB,lollipop:pB,point:mB,circle:yB,cross:xB,barb:CB,barbNeo:bB,only_one:kB,zero_or_one:wB,one_or_more:SB,zero_or_more:vB,only_one_neo:TB,zero_or_one_neo:_B,one_or_more_neo:BB,zero_or_more_neo:LB,requirement_arrow:EB,requirement_contains:AB,requirement_arrow_neo:FB,requirement_contains_neo:MB},Wy=cB,OB={common:Ai,getConfig:At,insertCluster:pm,insertEdge:qy,insertEdgeLabel:Py,insertMarkers:Wy,insertNode:bh,interpolateToCurve:Jl,labelHelper:lt,log:V,positionEdgeLabel:Dy},_s={},Hy=g(e=>{for(const t of e)_s[t.name]=t},"registerLayoutLoaders"),RB=g(()=>{Hy([{name:"dagre",loader:g(async()=>await Promise.resolve().then(()=>require("./dagre-VKFMJZFB-Bn_WdZ6A.cjs")),"loader")},{name:"swimlane",loader:g(async()=>await Promise.resolve().then(()=>require("./swimlanes-5IMT3BWC-DRPswRoa.cjs")),"loader")},{name:"cose-bilkent",loader:g(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-JH36ORCC-KQT29htQ.cjs")),"loader")}])},"registerDefaultLayoutLoaders");RB();var IB=g(async(e,t,r)=>{if(!(e.layoutAlgorithm in _s))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const d of e.nodes){const f=d.domId||d.id;d.domId=`${e.diagramId}-${f}`}const i=_s[e.layoutAlgorithm],s=await i.loader(),{theme:o,themeVariables:a}=e.config,{useGradient:n,gradientStart:l,gradientStop:c}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`),n){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return s.render(e,t,OB,{algorithm:i.algorithm},r)},"render"),PB=g((e="",{fallback:t="dagre"}={})=>{if(e in _s)return e;if(t in _s)return V.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),kh="comm",Yy="rule",Uy="decl",DB="@media",NB="@import",qB="@supports",zB="@namespace",el="@keyframes",Xy="@layer",jB="@scope",WB=Math.abs,gs=String.fromCharCode;function Gy(e){return e.trim()}function rl(e,t,r){return e.replace(t,r)}function si(e,t){return e.charCodeAt(t)|0}function Bi(e,t,r){return e.slice(t,r)}function qe(e){return e.length}function Vy(e){return e.length}function Js(e,t){return t.push(e),e}var ba=1,Li=1,Zy=0,Se=0,Nt=0,Ii="";function wh(e,t,r,i,s,o,a,n){return{value:e,root:t,parent:r,type:i,props:s,children:o,line:ba,column:Li,length:a,return:"",siblings:n}}function HB(){return Nt}function YB(){return Nt=Se>0?si(Ii,--Se):0,Li--,Nt===10&&(Li=1,ba--),Nt}function Ae(){return Nt=Se<Zy?si(Ii,Se++):0,Li++,Nt===10&&(Li=1,ba++),Nt}function ur(){return si(Ii,Se)}function uo(){return Se}function ka(e,t){return Bi(Ii,e,t)}function Bs(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function UB(e){return ba=Li=1,Zy=qe(Ii=e),Se=0,[]}function XB(e){return Ii="",e}function Ga(e){return Gy(ka(Se-1,il(e===91?e+2:e===40?e+1:e)))}function GB(e){for(;(Nt=ur())&&Nt<33;)Ae();return Bs(e)>2||Bs(Nt)>3?"":" "}function VB(e,t){for(;--t&&Ae()&&!(Nt<48||Nt>102||Nt>57&&Nt<65||Nt>70&&Nt<97););return ka(e,uo()+(t<6&&ur()==32&&Ae()==32))}function il(e){for(;Ae();)switch(Nt){case e:return Se;case 34:case 39:e!==34&&e!==39&&il(Nt);break;case 40:e===41&&il(e);break;case 92:Ae();break}return Se}function ZB(e,t){for(;Ae()&&e+Nt!==57;)if(e+Nt===84&&ur()===47)break;return"/*"+ka(t,Se-1)+"*"+gs(e===47?e:Ae())}function KB(e){for(;!Bs(ur());)Ae();return ka(e,Se)}function QB(e){return XB(fo("",null,null,null,[""],e=UB(e),0,[0],e))}function fo(e,t,r,i,s,o,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,p=0,m=1,y=1,x=1,C=0,k=0,v="",S=s,T=o,B=i,_=v;y;)switch(p=k,k=Ae()){case 40:p!=108&&si(_,d-1)==58?(C++,_+="("):_+=Ga(k);break;case 41:C--,_+=")";break;case 34:case 39:case 91:_+=Ga(k);break;case 9:case 10:case 13:case 32:if(C>0){_+=gs(k);break}_+=GB(p);break;case 92:_+=VB(uo()-1,7);continue;case 47:switch(ur()){case 42:case 47:Js(JB(ZB(Ae(),uo()),t,r,l),l),(Bs(p||1)==5||Bs(ur()||1)==5)&&qe(_)&&Bi(_,-1,void 0)!==" "&&(_+=" ");break;default:_+="/"}break;case 123*m:n[c++]=qe(_)*x;case 125*m:case 59:case 0:if(C>0&&k){_+=gs(k);break}switch(k){case 0:case 125:y=0;case 59+h:x==-1&&(_=rl(_,/\f/g,"")),u>0&&(qe(_)-d||m===0)&&Js(u>32?ld(_+";",i,r,d-1,l):ld(rl(_," ","")+";",i,r,d-2,l),l);break;case 59:_+=";";default:if(Js(B=nd(_,t,r,c,h,s,n,v,S=[],T=[],d,o),o),k===123)if(h===0)fo(_,t,B,B,S,o,d,n,T);else{switch(f){case 99:if(si(_,3)===110)break;case 108:if(si(_,2)===97)break;default:h=0;case 100:case 109:case 115:}h?fo(e,B,B,i&&Js(nd(e,B,B,0,0,s,n,v,s,S=[],d,T),T),s,T,d,n,i?S:T):fo(_,B,B,B,[""],T,0,n,T)}}c=h=u=0,m=x=1,v=_="",d=a;break;case 58:d=1+qe(_),u=p;default:if(m<1){if(k==123)--m;else if(k==125&&m++==0&&YB()==125)continue}switch(_+=gs(k),k*m){case 38:x=h>0?1:(_+="\f",-1);break;case 44:if(C>0)break;n[c++]=(qe(_)-1)*x,x=1;break;case 64:ur()===45&&(_+=Ga(Ae())),f=ur(),h=d=qe(v=_+=KB(uo())),k++;break;case 45:p===45&&qe(_)==2&&(m=0)}}return o}function nd(e,t,r,i,s,o,a,n,l,c,h,d){for(var f=s-1,u=s===0?o:[""],p=Vy(u),m=0,y=0,x=0;m<i;++m)for(var C=0,k=Bi(e,f+1,f=WB(y=a[m])),v=e;C<p;++C)(v=Gy(y>0?u[C]+" "+k:rl(k,/&\f/g,u[C])))&&(l[x++]=v);return wh(e,t,r,s===0?Yy:n,l,c,h,d)}function JB(e,t,r,i){return wh(e,t,r,kh,gs(HB()),Bi(e,2,-2),0,i)}function ld(e,t,r,i,s){return wh(e,t,r,Uy,Bi(e,0,i),Bi(e,i+1,-1),i,s)}function sl(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function tL(e,t,r,i){switch(e.type){case Xy:if(e.children.length)break;case NB:case zB:case Uy:return e.return=e.return||e.value;case kh:return"";case el:return e.return=e.value+"{"+sl(e.children,i)+"}";case Yy:if(!qe(e.value=e.props.join(",")))return""}return qe(r=sl(e.children,i))?e.return=e.value+"{"+r+"}":""}function eL(e){var t=Vy(e);return function(r,i,s,o){for(var a="",n=0;n<t;n++)a+=e[n](r,i,s,o)||"";return a}}var Ky="c4",rL=g(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),iL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./c4Diagram-LMCZKHZV-CUgZ93IA.cjs"));return{id:Ky,diagram:e}},"loader"),sL={id:Ky,detector:rL,loader:iL},oL=sL,Qy="flowchart",aL=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),nL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-DwEDOisR.cjs"));return{id:Qy,diagram:e}},"loader"),lL={id:Qy,detector:aL,loader:nL},hL=lL,Jy="flowchart-v2",cL=g((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),dL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-DwEDOisR.cjs"));return{id:Jy,diagram:e}},"loader"),uL={id:Jy,detector:cL,loader:dL},fL=uL,t0="swimlane",gL=g(e=>/^\s*swimlane-beta\b/.test(e),"detector"),pL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./swimlanesDiagram-G3AALYLV-VAEv3KP_.cjs"));return{id:t0,diagram:e}},"loader"),mL={id:t0,detector:gL,loader:pL},yL=mL,e0="er",xL=g(e=>/^\s*erDiagram/.test(e),"detector"),CL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./erDiagram-Q63AITRT-CzkYgQ0q.cjs"));return{id:e0,diagram:e}},"loader"),bL={id:e0,detector:xL,loader:CL},kL=bL,r0="gitGraph",wL=g(e=>/^\s*gitGraph/.test(e),"detector"),SL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./gitGraphDiagram-IHSO6WYX-BufmbyyT.cjs"));return{id:r0,diagram:e}},"loader"),vL={id:r0,detector:wL,loader:SL},TL=vL,i0="gantt",_L=g(e=>/^\s*gantt/.test(e),"detector"),BL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ganttDiagram-NO4QXBWP-7oIdk62h.cjs"));return{id:i0,diagram:e}},"loader"),LL={id:i0,detector:_L,loader:BL},EL=LL,s0="info",FL=g(e=>/^\s*info/.test(e),"detector"),AL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./infoDiagram-FWYZ7A6U-DerCFmks.cjs"));return{id:s0,diagram:e}},"loader"),ML={id:s0,detector:FL,loader:AL},o0="pie",$L=g(e=>/^\s*pie/.test(e),"detector"),OL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pieDiagram-ENE6RG2P-DfTgyWpG.cjs"));return{id:o0,diagram:e}},"loader"),RL={id:o0,detector:$L,loader:OL},a0="quadrantChart",IL=g(e=>/^\s*quadrantChart/.test(e),"detector"),PL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./quadrantDiagram-ABIIQ3AL-BZF5Z12H.cjs"));return{id:a0,diagram:e}},"loader"),DL={id:a0,detector:IL,loader:PL},NL=DL,n0="xychart",qL=g(e=>/^\s*xychart(-beta)?/.test(e),"detector"),zL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./xychartDiagram-FW5EYKEG-CDkSOK02.cjs"));return{id:n0,diagram:e}},"loader"),jL={id:n0,detector:qL,loader:zL},WL=jL,l0="requirement",HL=g(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),YL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./requirementDiagram-TGXJPOKE-C-WJSUrB.cjs"));return{id:l0,diagram:e}},"loader"),UL={id:l0,detector:HL,loader:YL},XL=UL,h0="sequence",GL=g(e=>/^\s*sequenceDiagram/.test(e),"detector"),VL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sequenceDiagram-DBY2YBRQ-DmNBUeEN.cjs"));return{id:h0,diagram:e}},"loader"),ZL={id:h0,detector:GL,loader:VL},KL=ZL,c0="class",QL=g((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),JL=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-OUVF2IWQ-D9dkL55K.cjs"));return{id:c0,diagram:e}},"loader"),tE={id:c0,detector:QL,loader:JL},eE=tE,d0="classDiagram",rE=g((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),iE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-v2-EOCWNBFH-D9dkL55K.cjs"));return{id:d0,diagram:e}},"loader"),sE={id:d0,detector:rE,loader:iE},oE=sE,u0="state",aE=g((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),nE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-2N3HPSRC-C9dyCEcu.cjs"));return{id:u0,diagram:e}},"loader"),lE={id:u0,detector:aE,loader:nE},hE=lE,f0="stateDiagram",cE=g((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),dE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-v2-6OUMAXLB-BhwjG0NA.cjs"));return{id:f0,diagram:e}},"loader"),uE={id:f0,detector:cE,loader:dE},fE=uE,g0="journey",gE=g(e=>/^\s*journey/.test(e),"detector"),pE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./journeyDiagram-5HDEW3XC-C7iTlBhN.cjs"));return{id:g0,diagram:e}},"loader"),mE={id:g0,detector:gE,loader:pE},yE=mE,xE=g((e,t,r)=>{V.debug(`rendering svg for syntax error
303
+ `);const i=pf(t),s=i.append("g");i.attr("viewBox","0 0 2412 512"),bl(i,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),p0={draw:xE},CE=p0,bE={db:{},renderer:p0,parser:{parse:g(()=>{},"parse")}},kE=bE,m0="flowchart-elk",wE=g((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),SE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-DwEDOisR.cjs"));return{id:m0,diagram:e}},"loader"),vE={id:m0,detector:wE,loader:SE},TE=vE,y0="timeline",_E=g(e=>/^\s*timeline/.test(e),"detector"),BE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./timeline-definition-FHXFAJF6-C6xF4zqV.cjs"));return{id:y0,diagram:e}},"loader"),LE={id:y0,detector:_E,loader:BE},EE=LE,x0="mindmap",FE=g(e=>/^\s*mindmap/.test(e),"detector"),AE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./mindmap-definition-LN4V7U3C-CmbdSctZ.cjs"));return{id:x0,diagram:e}},"loader"),ME={id:x0,detector:FE,loader:AE},$E=ME,C0="kanban",OE=g(e=>/^\s*kanban/.test(e),"detector"),RE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./kanban-definition-HUTT4EX6-BNNQtqj9.cjs"));return{id:C0,diagram:e}},"loader"),IE={id:C0,detector:OE,loader:RE},PE=IE,b0="sankey",DE=g(e=>/^\s*sankey(-beta)?/.test(e),"detector"),NE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sankeyDiagram-HTMAVEWB-CyT8wRcS.cjs"));return{id:b0,diagram:e}},"loader"),qE={id:b0,detector:DE,loader:NE},zE=qE,k0="packet",jE=g(e=>/^\s*packet(-beta)?/.test(e),"detector"),WE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-NH7WQ7WH-Cqc8orqE.cjs"));return{id:k0,diagram:e}},"loader"),HE={id:k0,detector:jE,loader:WE},w0="radar",YE=g(e=>/^\s*radar-beta/.test(e),"detector"),UE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-WEI45ONY-BYMVLI0Q.cjs"));return{id:w0,diagram:e}},"loader"),XE={id:w0,detector:YE,loader:UE},S0="block",GE=g(e=>/^\s*block(-beta)?/.test(e),"detector"),VE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./blockDiagram-677ZJIJ3-B45jR5Ef.cjs"));return{id:S0,diagram:e}},"loader"),ZE={id:S0,detector:GE,loader:VE},KE=ZE,v0="treeView",QE=g(e=>/^\s*treeView-beta/.test(e),"detector"),JE=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-OA4YK3LP-DfKPIPFJ.cjs"));return{id:v0,diagram:e}},"loader"),tF={id:v0,detector:QE,loader:JE},eF=tF,T0="architecture",rF=g(e=>/^\s*architecture/.test(e),"detector"),iF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./architectureDiagram-ZJ3FMSHR-CLgC4ySs.cjs"));return{id:T0,diagram:e}},"loader"),sF={id:T0,detector:rF,loader:iF},oF=sF,_0="eventmodeling",aF=g(e=>/^\s*eventmodeling/.test(e),"detector"),nF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-FQU43EPY-B8Bka9S6.cjs"));return{id:_0,diagram:e}},"loader"),lF={id:_0,detector:aF,loader:nF},hF=lF,B0="ishikawa",cF=g(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),dF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ishikawaDiagram-FXEZZL3T-BN-byOYP.cjs"));return{id:B0,diagram:e}},"loader"),uF={id:B0,detector:cF,loader:dF},L0="venn",fF=g(e=>/^\s*venn-beta/.test(e),"detector"),gF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./vennDiagram-L72KCM5P-CUaYoUAd.cjs"));return{id:L0,diagram:e}},"loader"),pF={id:L0,detector:fF,loader:gF},mF=pF,E0="treemap",yF=g(e=>/^\s*treemap/.test(e),"detector"),xF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-G47NLZAW-D--MA_nT.cjs"));return{id:E0,diagram:e}},"loader"),CF={id:E0,detector:yF,loader:xF},F0="wardley",bF=g(e=>/^\s*wardley-beta/i.test(e),"detector"),kF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./wardleyDiagram-EHGQE667-Cp3kY_DT.cjs"));return{id:F0,diagram:e}},"loader"),wF={id:F0,detector:bF,loader:kF},SF=wF,A0="cynefin",vF=g(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),TF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./cynefinDiagram-TSTJHNR4-C_rGUs0a.cjs"));return{id:A0,diagram:e}},"loader"),_F={id:A0,detector:vF,loader:TF},M0="railroad",BF=g(e=>/^\s*railroad-beta/i.test(e),"detector"),LF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./railroadDiagram-RFXS5EU6-Cui5Nx7p.cjs"));return{id:M0,diagram:e}},"loader"),EF={id:M0,detector:BF,loader:LF},$0="railroadEbnf",FF=g(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),AF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ebnfDiagram-CCIWWBDH-DZKq52yC.cjs"));return{id:$0,diagram:e}},"loader"),MF={id:$0,detector:FF,loader:AF},O0="railroadAbnf",$F=g(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),OF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./abnfDiagram-VRR7QNED-CfcidEeF.cjs"));return{id:O0,diagram:e}},"loader"),RF={id:O0,detector:$F,loader:OF},R0="railroadPeg",IF=g(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),PF=g(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pegDiagram-2B236MQR-BWozQII1.cjs"));return{id:R0,diagram:e}},"loader"),DF={id:R0,detector:IF,loader:PF},hd=!1,wa=g(()=>{hd||(hd=!0,bo("error",kE,e=>e.toLowerCase().trim()==="error"),bo("---",{db:{clear:g(()=>{},"clear")},styles:{},renderer:{draw:g(()=>{},"draw")},parser:{parse:g(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:g(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),nn(TE,$E,oF),nn(oL,PE,oE,eE,kL,EL,ML,RL,XL,KL,yL,fL,hL,EE,TL,fE,hE,yE,NL,zE,HE,WL,KE,hF,eF,XE,uF,CF,EF,MF,RF,DF,mF,SF,_F))},"addDiagrams"),NF=g(async()=>{V.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Ir).map(async([r,{detector:i,loader:s}])=>{if(s)try{un(r)}catch{try{const{diagram:o,id:a}=await s();bo(a,o,i)}catch(o){throw V.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Ir[r],o}}}))).filter(r=>r.status==="rejected");if(t.length>0){V.error(`Failed to load ${t.length} external diagrams`);for(const r of t)V.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),qF="graphics-document document";function I0(e,t){e.attr("role",qF),t!==""&&e.attr("aria-roledescription",t)}g(I0,"setA11yDiagramInfo");function P0(e,t,r,i){if(e.insert!==void 0){if(r){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(r)}if(t){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}g(P0,"addSVGa11yTitleDescription");var $r,ol=($r=class{constructor(t,r,i,s,o){this.type=t,this.text=r,this.db=i,this.parser=s,this.renderer=o}static async fromText(t,r={}){const i=At(),s=xl(t,i);t=eT(t)+`
304
+ `;try{un(s)}catch{const c=mk(s);if(!c)throw new eu(`Diagram ${s} not found.`);const{id:h,diagram:d}=await c();bo(h,d)}const{db:o,parser:a,renderer:n,init:l}=un(s);return a.parser&&(a.parser.yy=o),o.clear?.(),l?.(i),r.title&&o.setDiagramTitle?.(r.title),await a.parse(t),new $r(s,t,o,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},g($r,"Diagram"),$r),cd=[],zF=g(()=>{cd.forEach(e=>{e()}),cd=[]},"attachFunctions"),jF=g(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function D0(e){const t=e.match(tu);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
305
+ `).map(a=>a.startsWith(r)?a.slice(r.length):a).join(`
306
+ `):t[2];let s=Qg(i,{schema:Kg})??{};s=typeof s=="object"&&!Array.isArray(s)?s:{};const o={};return s.displayMode&&(o.displayMode=s.displayMode.toString()),s.title&&(o.title=s.title.toString()),s.config&&(o.config=s.config),{text:e.slice(t[0].length),metadata:o}}g(D0,"extractFrontMatter");var WF=g(e=>e.replace(/\r\n?/g,`
307
+ `).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),HF=g(e=>{const{text:t,metadata:r}=D0(e),{displayMode:i,title:s,config:o={}}=r;return i&&(o.gantt||(o.gantt={}),o.gantt.displayMode=i),{title:s,config:o,text:t}},"processFrontmatter"),YF=g(e=>{const t=ke.detectInit(e)??{},r=ke.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:Yv(e),directive:t}},"processDirectives");function Sh(e){const t=WF(e),r=HF(t),i=YF(r.text),s=ua(r.config,i.directive);return e=jF(i.text),{code:e,title:r.title,config:s}}g(Sh,"preprocessDiagram");function N0(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}g(N0,"toBase64");var UF=5e4,XF="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",GF="sandbox",VF="loose",ZF="http://www.w3.org/2000/svg",KF="http://www.w3.org/1999/xlink",QF="http://www.w3.org/1999/xhtml",JF="100%",tA="100%",eA="border:0;margin:0;",rA="margin:0",iA="allow-top-navigation-by-user-activation allow-popups",sA='The "iframe" tag is not supported by your browser.',oA=["foreignobject"],aA=["dominant-baseline"];function vh(e){const t=Sh(e);return xo(),uk(t.config??{}),t}g(vh,"processAndSetConfigs");async function q0(e,t){wa();try{const{code:r,config:i}=vh(e);return{diagramType:(await j0(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}g(q0,"parse");var dd=g((e,t,r=[])=>{const i=Gd(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),nA=g((e,t=new Map)=>{const r=new CSSStyleSheet;if(e.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,r.cssRules.length),e.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,r.cssRules.length),t instanceof Map){const n=ee(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{vc(l.styles)||n.forEach(c=>{r.insertRule(dd(l.id,c,l.styles),r.cssRules.length)}),vc(l.textStyles)||r.insertRule(dd(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const s=new CSSStyleSheet;s.replaceSync(e.themeCSS),i=dn(s)+`
308
+ `}else i+=`${e.themeCSS}
309
+ `;return i+dn(r)},"createCssStyles"),lA=g((e,t)=>sl(QB(`${e}{${t}}`),eL([g(function(i,s,o,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===el)return;i.props=i.props.map(n=>n.startsWith(e)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[DB,qB,Xy,jB,"@container","@starting-style"],el].includes(i.type)||(V.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=kh))},"addNamespace"),tL])),"compileCSS"),hA=g((e,t,r,i)=>{const s=nA(e,r),o=$k(t,s,{...e.themeVariables,theme:e.theme,look:e.look},i);return lA(i,o)},"createUserStyles"),cA=g((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=yr(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),dA=g((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":tA,i=N0(`<body style="${rA}">${e}</body>`);return`<iframe style="width:${JF};height:${r};${eA}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${iA}">
310
+ ${sA}
311
+ </iframe>`},"putIntoIFrame"),ud=g((e,t,r,i,s)=>{const o=e.append("div");o.attr("id",r),i&&o.attr("style",i);const a=o.append("svg").attr("id",t).attr("width","100%").attr("xmlns",ZF);return s&&a.attr("xmlns:xlink",s),a.append("g"),e},"appendDivSvgG");function al(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}g(al,"sandboxedIframe");var uA=g((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),fA=g(async function(e,t,r){wa();const i=vh(t);t=i.code;const s=At();V.debug(s),t.length>(s?.maxTextSize??UF)&&(t=XF);const o=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=g(()=>{const U=pt(f?n:c).node();U&&"remove"in U&&U.remove()},"removeTempElements");let d=pt(document.body);const f=s.securityLevel===GF,u=s.securityLevel===VF,p=s.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const H=al(pt(r),a);d=pt(H.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt(r);ud(d,e,l,`font-family: ${p}`,KF)}else{if(uA(document,e,l,a),f){const H=al(pt(document.body),a);d=pt(H.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=pt("body");ud(d,e,l)}let m,y;try{m=await ol.fromText(t,{title:i.title})}catch(H){if(s.suppressErrorRendering)throw h(),H;m=await ol.fromText("error"),y=H}const x=d.select(c).node(),C=m.type,k=x.firstChild,v=k.firstChild,S=m.renderer.getClasses?.(t,m),T=hA(s,C,S,o),B=document.createElement("style");B.innerHTML=T,k.insertBefore(B,v);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(H){throw s.suppressErrorRendering?h():CE.draw(t,e,"11.16.0"),H}const _=d.select(`${c} svg`),P=m.db.getAccTitle?.(),O=m.db.getAccDescription?.();W0(C,_,P,O),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",QF);let D=d.select(c).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",s.arrowMarkerAbsolute),D=cA(D,f,Xe(s.arrowMarkerAbsolute)),f){const H=d.select(c+" svg").node();D=dA(D,H)}else u||(D=Ci.sanitize(D,{ADD_TAGS:oA,ADD_ATTR:aA,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(zF(),y)throw y;return h(),{diagramType:C,svg:D,bindFunctions:m.db.bindFunctions}},"render");function z0(e={}){const t=qt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),ck(t),t?.theme&&t.theme in sr?t.themeVariables=sr[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=sr.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?hk(t):Vd();pl(r.logLevel),wa()}g(z0,"initialize");var j0=g((e,t={})=>{const{code:r}=Sh(e);return ol.fromText(r,t)},"getDiagramFromText");function W0(e,t,r,i){I0(t,e),P0(t,r,i,t.attr("id"))}g(W0,"addA11yInfo");var qr=Object.freeze({render:fA,parse:q0,getDiagramFromText:j0,initialize:z0,getConfig:At,setConfig:Zd,getSiteConfig:Vd,updateSiteConfig:dk,reset:g(()=>{xo()},"reset"),globalReset:g(()=>{xo(bi)},"globalReset"),defaultConfig:bi});pl(At().logLevel);xo(At());var gA=g((e,t,r)=>{V.warn(e),sh(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),H0=g(async function(e={querySelector:".mermaid"}){try{await pA(e)}catch(t){if(sh(t)&&V.error(t.str),nr.parseError&&nr.parseError(t),!e.suppressErrors)throw V.error("Use the suppressErrors option to suppress these errors"),t}},"run"),pA=g(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=qr.getConfig();V.debug(`${e?"":"No "}Callback function found`);let s;if(r)s=r;else if(t)s=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");V.debug(`Found ${s.length} diagrams`),i?.startOnLoad!==void 0&&(V.debug("Start On Load: "+i?.startOnLoad),qr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const o=new ke.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(s)){if(V.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${o.next()}`;a=l.innerHTML,a=Xp(ke.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=ke.detectInit(a);h&&V.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await G0(c,a,l);l.innerHTML=d,e&&await e(c),f&&f(l)}catch(d){gA(d,n,nr.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),Y0=g(function(e){qr.initialize(e)},"initialize"),mA=g(async function(e,t,r){V.warn("mermaid.init is deprecated. Please use run instead."),e&&Y0(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await H0(i)},"init"),yA=g(async(e,{lazyLoad:t=!0}={})=>{wa(),nn(...e),t===!1&&await NF()},"registerExternalDiagrams"),U0=g(function(){if(nr.startOnLoad){const{startOnLoad:e}=qr.getConfig();e&&nr.run().catch(t=>V.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",U0,!1);var xA=g(function(e){nr.parseError=e},"setParseErrorHandler"),Uo=[],Va=!1,X0=g(async()=>{if(!Va){for(Va=!0;Uo.length>0;){const e=Uo.shift();if(e)try{await e()}catch(t){V.error("Error executing queue",t)}}Va=!1}},"executeQueue"),CA=g(async(e,t)=>new Promise((r,i)=>{const s=g(()=>new Promise((o,a)=>{qr.parse(e,t).then(n=>{o(n),r(n)},n=>{V.error("Error parsing",n),nr.parseError?.(n),a(n),i(n)})}),"performCall");Uo.push(s),X0().catch(i)}),"parse"),G0=g((e,t,r)=>new Promise((i,s)=>{const o=g(()=>new Promise((a,n)=>{qr.render(e,t,r).then(l=>{a(l),i(l)},l=>{V.error("Error parsing",l),nr.parseError?.(l),n(l),s(l)})}),"performCall");Uo.push(o),X0().catch(s)}),"render"),bA=g(()=>Object.keys(Ir).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),nr={startOnLoad:!0,mermaidAPI:qr,parse:CA,render:G0,init:mA,run:H0,registerExternalDiagrams:yA,registerLayoutLoaders:Hy,initialize:Y0,parseError:void 0,contentLoaded:U0,setParseErrorHandler:xA,detectType:xl,registerIconPacks:Op,getRegisteredDiagramsMetadata:bA},nl=nr;const Xo="flex size-11 items-center justify-center rounded border p-1 shadow",V0="absolute start-0 z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg",Z0="flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start",K0="both-shift",fd=Object.freeze({none:Object.freeze({panTrigger:null,zoom:!1}),zoom:Object.freeze({panTrigger:null,zoom:!0}),pan:Object.freeze({panTrigger:"drag",zoom:!1}),"pan-shift":Object.freeze({panTrigger:"shift-drag",zoom:!1}),both:Object.freeze({panTrigger:"drag",zoom:!0}),"both-shift":Object.freeze({panTrigger:"shift-drag",zoom:!0})}),kA=Object.freeze(["none","zoom","pan","pan-shift","both","both-shift"]),wA=Object.freeze(["none","zoom","pan","both"]),SA=Object.freeze({none:"none",zoom:"zoom",pan:"pan","pan-shift":"pan",both:"both","both-shift":"both"}),go=.3,vA=3,TA=2,Br=.5,_A=1;function gd(e,t){return e.panTrigger!==null&&t?e.zoom?"none":"pinch-zoom":e.zoom?"pan-x pan-y":"auto"}const BA=0;function Za(e,t,r){return e.panTrigger===null||t.button!==BA?!1:t.pointerType==="touch"||t.pointerType==="pen"?r:e.panTrigger==="drag"||t.shiftKey}function LA(e,t){return e.zoom&&t.shiftKey}function EA(e){if(e===null)return null;const t=e.trim().split(/[\s,]+/u),r=t.length===4?Number(t[2]):Number.NaN;if(!(Number.isFinite(r)&&r>0))throw new Error(`[@aiquants/markdown] MermaidDiagram: the drawing has no usable viewBox (${JSON.stringify(e)})`);return r}function FA(e,t){if(!(Number.isFinite(e)&&e>0&&(t===null||Number.isFinite(t)&&t>0)))throw new Error(`[@aiquants/markdown] MermaidDiagram: cannot fit a drawing ${t} px wide into a frame ${e} px wide`);return t===null?1:Math.min(1,e/t)}function AA(e){if(!(Number.isFinite(e)&&e>0&&e<=1))throw new Error(`[@aiquants/markdown] MermaidDiagram: the fit scale must be in (0, 1], got ${e}`);return{minScale:1,maxScale:TA/e}}function Ka(e,t){return Math.min(t.maxScale,Math.max(t.minScale,e))}function Zi(e,t,r,i,s){return{scale:t,x:e.x+(i.x-s.origin.x)/t-(r.x-s.origin.x)/e.scale,y:e.y+(i.y-s.origin.y)/t-(r.y-s.origin.y)/e.scale}}function MA(e,t,r){const i=(s,o,a,n)=>{const l=(0-o)/e.scale,c=(n-o-e.scale*a)/e.scale;return Math.min(Math.max(l,c),Math.max(Math.min(l,c),s))};return{scale:e.scale,x:i(e.x,t.origin.x,t.inline,r.inline),y:i(e.y,t.origin.y,t.block,r.block)}}function $A(e,t,r){return e*t.inline-r.inline>Br||e*t.block-r.block>Br}function OA(e,t){const r=o=>Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y),i=o=>({x:(o[0].x+o[1].x)/2,y:(o[0].y+o[1].y)/2}),s=r(e);return s<_A?null:{ratio:r(t)/s,from:i(e),to:i(t)}}function pd(e){return e*(1-Math.exp(-go))}function md(e,t,r){const i=e<-Br||e>Br;return t-e>r+Br?i?0-e:0:e<-Br?0-e:t>r+Br?r-t:0}const Sa=Object.freeze({interactionMode:{text:"マウス操作モード",lang:"ja"},interactionModeTouch:{text:"タッチ操作モード",lang:"ja"},modeNone:{text:"操作なし",lang:"ja"},modeZoom:{text:"拡大縮小のみ",lang:"ja"},modePan:{text:"移動のみ (左ドラッグ)",lang:"ja"},modePanShift:{text:"移動のみ (Shift+ドラッグ)",lang:"ja"},modeBoth:{text:"拡大縮小+移動 (左ドラッグ)",lang:"ja"},modeBothShift:{text:"拡大縮小+移動 (Shift+ドラッグ)",lang:"ja"},modeNoneTouch:{text:"操作なし (指はページをスクロール)",lang:"ja"},modeZoomTouch:{text:"拡大縮小のみ (2 本指)",lang:"ja"},modePanTouch:{text:"移動のみ (はみ出す図を 1 本指でドラッグ)",lang:"ja"},modeBothTouch:{text:"拡大縮小+移動 (2 本指・はみ出す図は 1 本指)",lang:"ja"},zoomIn:{text:"Zoom In",lang:"en"},zoomOut:{text:"Zoom Out",lang:"en"},resetView:{text:"Reset View",lang:"en"},panUp:{text:"Pan Up",lang:"en"},panDown:{text:"Pan Down",lang:"en"},panLeft:{text:"Pan Left",lang:"en"},panRight:{text:"Pan Right",lang:"en"},diagram:{text:"Diagram (arrow keys pan, + and - zoom, 0 resets)",lang:"en"},retry:{text:"再試行",lang:"ja"}}),RA=dl(Sa),IA=Object.freeze({none:"modeNone",zoom:"modeZoom",pan:"modePan","pan-shift":"modePanShift",both:"modeBoth","both-shift":"modeBothShift"}),PA=Object.freeze({none:"modeNoneTouch",zoom:"modeZoomTouch",pan:"modePanTouch",both:"modeBothTouch"}),Q0="(pointer: coarse)",DA=e=>{const t=window.matchMedia(Q0);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},NA=()=>window.matchMedia(Q0).matches,qA=()=>!1,zA=()=>E.useSyncExternalStore(DA,NA,qA),yd=new Set(["gantt"]),jA=200,WA=300,HA=Object.freeze({height:0,overflow:"hidden",visibility:"hidden",contain:"strict"}),YA="data-aqmd-mermaid-host",UA=e=>{const t=document.createElement("div");return t.setAttribute(YA,""),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.insetBlockStart="0",t.style.insetInlineStart=`${-e}px`,t.style.width=`${e}px`,t.style.visibility="hidden",t.style.contain="strict",document.body.append(t),t};let xd=Promise.resolve();const XA=e=>{const t=e instanceof Error?e.message:String(e);return t.includes("dynamically imported module")||t.includes("Importing a module script failed")},Cd=e=>{e.resetStyle(),e.destroy()},Qa=(e,t)=>t?"grabbing":e.panTrigger==="drag"?"move":"",GA=Object.freeze({visibility:"hidden"});let J0=!1,ll=null;if(nl?.initialize)try{nl.initialize({startOnLoad:!1}),J0=!0}catch(e){ll=e instanceof Error?e:new Error(String(e))}else ll=new Error("Mermaid library or mermaid.initialize is not available.");const tx=({chartContent:e,interaction:t,hideInteractionMenu:r=!1,labels:i,sourceLines:s})=>{const o=E.useMemo(()=>Vo(Sa,i),[i]),a=E.useId(),n=E.useId(),l=E.useRef(`mermaid-chart-${Math.random().toString(36).substring(2,15)}`),c=E.useRef(0),h=E.useRef(null),d=E.useRef(null),f=E.useRef(null),u=E.useRef(null),[p,m]=E.useState(!0),[y,x]=E.useState(null),[C,k]=E.useState(null),[v,S]=E.useState(0),T=E.useRef(!1),B=zA(),[_,P]=E.useState(t??K0),O=E.useRef(fd[_]),D=E.useRef(!1),[H,U]=E.useState(!1),[I,M]=E.useState(!1),A=E.useRef(null),z=E.useRef(null);E.useEffect(()=>{t&&P(t)},[t]),E.useEffect(()=>{O.current=fd[_],u.current?.refresh()},[_]),E.useEffect(()=>{if(!I)return;const q=K=>{A.current&&!A.current.contains(K.target)&&M(!1)};return document.addEventListener("pointerdown",q),()=>document.removeEventListener("pointerdown",q)},[I]),E.useEffect(()=>{if(m(!0),x(null),k(null),!J0){x(ll?.message||"Mermaid failed to initialize globally."),m(!1);return}const q=e.trim();if(q===""){m(!1);return}const K=h.current;if(!K)throw new Error("[@aiquants/markdown] MermaidDiagram: the measuring element is not mounted");let Z=!1,et=0,dt=null,ut=K.offsetWidth,xt=null,Lt,It;const Mt=()=>{oe.disconnect(),clearTimeout(Lt)},$t=jt=>{xt=null,Mt(),x(jt),k(null),m(!1)},ie=jt=>{c.current+=1;const Pt=c.current;et=Pt,dt=jt;const Re=()=>!Z&&Pt===et,ge=async()=>{const _t=UA(jt);try{return await nl.render(`${l.current}-${Pt}`,q,_t)}finally{_t.remove()}};xd=xd.then(()=>Re()?ge().then(_t=>{if(Re()){if(typeof _t.svg!="string"||_t.svg.length===0){$t("Failed to render Mermaid diagram: SVG content is empty or invalid.");return}xt=_t.diagramType,k({svg:_t.svg,bindFunctions:typeof _t.bindFunctions=="function"?_t.bindFunctions:null}),m(!1),yd.has(_t.diagramType)?ut!==jt&&Qt():oe.disconnect()}}).catch(_t=>{if(Re()){if(console.error(`[MermaidDiagram ${l.current}] Error rendering Mermaid diagram:`,_t),XA(_t)&&!T.current){T.current=!0,It=setTimeout(()=>S(bt=>bt+1),WA);return}$t(_t instanceof Error?_t.message:"An unknown error occurred while rendering the diagram.")}}):Promise.resolve())},Qt=()=>{clearTimeout(Lt),Lt=setTimeout(()=>{ut>0&&ut!==dt&&ie(ut)},jA)},se=()=>{const jt=K.offsetWidth;if(jt!==ut){if(ut=jt,dt===null){jt>0&&ie(jt);return}xt!==null&&yd.has(xt)&&Qt()}},oe=new ResizeObserver(se);return oe.observe(K),ut>0&&ie(ut),()=>{Z=!0,Mt(),clearTimeout(It)}},[e,v]),E.useEffect(()=>{const q=d.current;if(!q)return;const K=()=>{u.current=null,f.current&&(Cd(f.current),f.current=null),D.current=!1,U(!1)};if(!C){q.innerHTML="",K();return}q.innerHTML=C.svg;const Z=q.querySelector("svg");let et=!1,dt;const ut=[];if(Z){let xt;try{xt=EA(Z.getAttribute("viewBox"))}catch(Mt){console.error(`[MermaidDiagram ${l.current}] Cannot size the drawing:`,Mt),x(Mt instanceof Error?Mt.message:String(Mt)),k(null);return}const Lt=xt,It=()=>{if(et)return;const Mt=Z.getBBox();if(!Mt||Mt.width===0||Mt.height===0){dt=setTimeout(It,100);return}f.current&&Cd(f.current);const $t=Dd(Z,{startScale:1,startX:0,startY:0,minScale:1,maxScale:1,origin:"0 0",step:go,animate:!1,noBind:!0,cursor:"",overflow:"",touchAction:gd(O.current,!1)});f.current=$t;let ie={minScale:1,maxScale:1};const Qt=()=>{const Q=$t.getPan();return{scale:$t.getScale(),x:Q.x,y:Q.y}},se=()=>{const Q=q.getBoundingClientRect(),gt=Z.getBoundingClientRect(),{scale:kt,x:Yt,y:yt}=Qt();return{frameRect:Q,frame:{inline:Q.width,block:Q.height},drawing:{origin:{x:gt.left-Q.left-kt*Yt,y:gt.top-Q.top-kt*yt},inline:gt.width/kt,block:gt.height/kt}}},oe=()=>{if(et)return;const{frame:Q,drawing:gt}=se(),kt=$A($t.getScale(),gt,Q);D.current=kt,U(kt),Pi(kt),$t.setOptions({touchAction:gd(O.current,kt)}),q.style.cursor=Qa(O.current,bt?.kind==="pan"&&bt.mouse)},jt=()=>{const Q=q.getBoundingClientRect().width;Q<=0||(ie=AA(FA(Q,Lt)),$t.setOptions({minScale:ie.minScale,maxScale:ie.maxScale}))},Pt=Q=>{const gt=Qt(),{frame:kt,drawing:Yt}=se(),yt=MA({...Q,scale:Ka(Q.scale,ie)},Yt,kt);return yt.scale===gt.scale&&yt.x===gt.x&&yt.y===gt.y?!1:($t.zoom(yt.scale,{animate:!1,force:!0,silent:!0}),$t.pan(yt.x,yt.y,{animate:!1,force:!0}),oe(),!0)},Re=(Q,gt)=>{const{drawing:kt}=se();return Pt(Zi(Qt(),Ka(Q,ie),gt,gt,kt))},ge=Q=>{const gt=q.getBoundingClientRect();return{x:Q.x-gt.left,y:Q.y-gt.top}};u.current={zoomBy:Q=>{const{frame:gt}=se();Re($t.getScale()*Math.exp(Q*go),{x:gt.inline/2,y:gt.block/2})},panBy:(Q,gt)=>{const{drawing:kt}=se(),Yt=Qt();return Pt(Zi(Yt,Yt.scale,{x:0,y:0},{x:Q,y:gt},kt))},reset:()=>{Pt({scale:1,x:0,y:0})},panSteps:()=>{const{frame:Q}=se();return{x:pd(Q.inline),y:pd(Q.block)}},refresh:oe};const _t=new Map;let bt=null;const Te=Q=>({x:Q.clientX,y:Q.clientY}),Ve=()=>{const Q=[..._t.values()];return Q.length===2?[Q[0],Q[1]]:null},Wr=Q=>{if(_t.has(Q.pointerId)&&_t.set(Q.pointerId,Te(Q)),bt?.kind==="pinch"){const gt=Ve();if(gt===null)return;const kt=OA(bt.last,gt);if(bt={kind:"pinch",last:gt},kt===null)return;const{drawing:Yt}=se(),yt=Qt();Pt(Zi(yt,Ka(yt.scale*kt.ratio,ie),ge(kt.from),ge(kt.to),Yt));return}if(bt?.kind==="pan"&&bt.pointerId===Q.pointerId){const gt=Te(Q),{drawing:kt}=se(),Yt=Qt();Pt(Zi(Yt,Yt.scale,ge(bt.last),ge(gt),kt)),bt={...bt,last:gt}}},Ie=()=>{window.removeEventListener("pointermove",Wr),window.removeEventListener("pointerup",J),window.removeEventListener("pointercancel",J)},Ze=()=>{Ie(),window.addEventListener("pointermove",Wr),window.addEventListener("pointerup",J),window.addEventListener("pointercancel",J)},J=Q=>{if(_t.delete(Q.pointerId),bt?.kind==="pinch"){const[gt]=[..._t.entries()];bt=gt!==void 0&&Za(O.current,{button:0,shiftKey:!1,pointerType:Q.pointerType},D.current)?{kind:"pan",pointerId:gt[0],last:gt[1],mouse:!1}:null}else bt?.kind==="pan"&&bt.pointerId===Q.pointerId&&(bt=null);bt===null&&_t.size===0&&Ie(),q.style.cursor=Qa(O.current,bt?.kind==="pan"&&bt.mouse)},mt=Q=>{const gt=O.current;if(Q.pointerType==="touch"||Q.pointerType==="pen"){_t.set(Q.pointerId,Te(Q)),Ze();const kt=Ve();kt!==null&&gt.zoom?bt={kind:"pinch",last:kt}:_t.size>1?bt?.kind==="pan"&&!bt.mouse&&(bt=null):Za(gt,Q,D.current)&&(bt={kind:"pan",pointerId:Q.pointerId,last:Te(Q),mouse:!1});return}Za(gt,Q,D.current)&&(bt={kind:"pan",pointerId:Q.pointerId,last:Te(Q),mouse:!0},q.style.cursor=Qa(gt,!0),Ze(),Q.preventDefault())},Ot=Q=>{bt!==null&&!(bt.kind==="pan"&&bt.mouse)&&Q.cancelable&&Q.preventDefault()};let ae=!1;const Pi=Q=>{Q!==ae&&(ae=Q,Q?q.addEventListener("touchmove",Ot,{passive:!1}):q.removeEventListener("touchmove",Ot))},Di=Q=>{const gt=Q.target;if(!(gt instanceof Element)||gt===Z||!Z.contains(gt))return;const kt=q.getBoundingClientRect(),Yt=gt.getBoundingClientRect(),yt={x:md(Yt.left-kt.left,Yt.right-kt.left,kt.width),y:md(Yt.top-kt.top,Yt.bottom-kt.top,kt.height)};if(yt.x===0&&yt.y===0)return;const{drawing:Bt}=se(),pe=Qt();Pt(Zi(pe,pe.scale,{x:0,y:0},yt,Bt))},Is=Q=>{if(!LA(O.current,Q))return;const gt=Q.deltaY===0?Q.deltaX:Q.deltaY;gt!==0&&(Q.preventDefault(),Re($t.getScale()*Math.exp(Math.sign(-gt)*go/vA),ge(Te(Q))))},Ke=new ResizeObserver(()=>{jt(),Pt(Qt()),oe()});q.addEventListener("pointerdown",mt),q.addEventListener("focusin",Di),q.addEventListener("wheel",Is,{passive:!1}),Z.addEventListener("panzoomchange",oe),Ke.observe(q),ut.push(()=>{q.removeEventListener("pointerdown",mt),q.removeEventListener("focusin",Di),Pi(!1),q.removeEventListener("wheel",Is),Z.removeEventListener("panzoomchange",oe),Ke.disconnect(),Ie()}),jt(),oe()};It()}return C.bindFunctions&&C.bindFunctions(q),()=>{et=!0,clearTimeout(dt);for(const xt of ut)xt();K()}},[C]);const R=E.useCallback(()=>M(q=>!q),[]),$=E.useCallback(q=>{P(q),M(!1)},[]),N=E.useCallback(q=>{q.key!=="Escape"||!I||(q.preventDefault(),M(!1),z.current?.focus())},[I]),L=E.useCallback(q=>{const K=u.current;if(K===null||q.target!==q.currentTarget||q.altKey||q.ctrlKey||q.metaKey)return;const Z=K.panSteps();let et;switch(q.key){case"ArrowLeft":et=K.panBy(Z.x,0);break;case"ArrowRight":et=K.panBy(-Z.x,0);break;case"ArrowUp":et=K.panBy(0,Z.y);break;case"ArrowDown":et=K.panBy(0,-Z.y);break;case"+":case"=":K.zoomBy(1),et=!0;break;case"-":K.zoomBy(-1),et=!0;break;case"0":K.reset(),et=!0;break;default:et=!1}et&&q.preventDefault()},[]),X=(q,K,Z,et,dt=!1)=>w.jsx("button",{type:"button","data-aqmd-mermaid-control":q,onClick:Z,style:dt?GA:void 0,className:Xo,"aria-label":o[K].text,lang:o[K].lang,children:et},q),Y=q=>{const K=u.current;if(K===null)return;const Z=K.panSteps();K.panBy(q.x*Z.x,q.y*Z.y)};let G;if(p)G=w.jsx("div",{className:"flex h-32 items-center justify-center bg-white dark:bg-gray-800 dark:text-white",children:"🌀 Loading diagram..."});else if(y)G=w.jsxs("div",{"data-aqmd-mermaid-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[w.jsxs("div",{children:["Error: ",y]}),w.jsxs("button",{type:"button","data-aqmd-mermaid-retry":"",onClick:()=>{T.current=!1,x(null),S(q=>q+1)},lang:o.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[w.jsx(on,{className:"h-4 w-4"}),o.retry.text]})]});else{const q=o[B?"interactionModeTouch":"interactionMode"],K=B?wA.map(Z=>({value:Z,label:o[PA[Z]],checked:SA[_]===Z})):kA.map(Z=>({value:Z,label:o[IA[Z]],checked:_===Z}));G=w.jsxs(w.Fragment,{children:[w.jsxs("div",{"data-aqmd-mermaid-toolbar":"",className:"mb-1 flex flex-wrap items-start gap-1",children:[!r&&w.jsxs("div",{ref:A,className:"relative",children:[w.jsx("button",{ref:z,id:a,type:"button","data-aqmd-mermaid-control":"mode",onClick:R,className:Xo,"aria-label":q.text,lang:q.lang,"aria-haspopup":"menu","aria-expanded":I,onKeyDown:N,children:w.jsx(_b,{size:18})}),I&&w.jsx("div",{role:"menu","aria-labelledby":a,"data-aqmd-mermaid-menu":"",onKeyDown:N,className:V0,children:K.map(({value:Z,label:et,checked:dt})=>w.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":dt,lang:et.lang,onClick:()=>$(Z),className:Z0,children:[w.jsx("span",{className:"w-3 shrink-0","aria-hidden":"true",children:dt?"✓":""}),w.jsx("span",{children:et.text})]},Z))})]}),X("zoom-in","zoomIn",()=>u.current?.zoomBy(1),w.jsx(Nd,{size:20})),X("zoom-out","zoomOut",()=>u.current?.zoomBy(-1),w.jsx(qd,{size:20})),X("reset","resetView",()=>u.current?.reset(),w.jsx(on,{size:18})),X("pan-left","panLeft",()=>Y({x:1,y:0}),w.jsx(Cb,{size:18}),!H),X("pan-up","panUp",()=>Y({x:0,y:1}),w.jsx(Sb,{size:18}),!H),X("pan-down","panDown",()=>Y({x:0,y:-1}),w.jsx(yb,{size:18}),!H),X("pan-right","panRight",()=>Y({x:-1,y:0}),w.jsx(kb,{size:18}),!H)]}),w.jsx("span",{id:n,hidden:!0,lang:o.diagram.lang,children:o.diagram.text}),w.jsx("div",{ref:d,"data-testid":"mermaid-diagram","data-aqmd-mermaid-frame":"","data-aqmd-mermaid-overflowing":H?"true":"false",role:"group",tabIndex:0,"aria-labelledby":n,onKeyDown:L,className:"mermaid mermaid-diagram-container bg-white dark:bg-gray-400"})]})}return w.jsxs("div",{className:"relative","data-aqmd-mermaid":"","data-source-lines":s,children:[w.jsx("div",{ref:h,"data-aqmd-mermaid-measure":!0,"aria-hidden":"true",style:HA}),G]})};tx.displayName="MermaidDiagramInternal";const Th=E.memo(tx),VA="unicodeTextInMathMode",ZA="noCharacterMetrics",KA=/^No character metrics for '.+' in style '.+' and mode '.+'$/su,QA="consoleCommand",JA=e=>{const t=(r,i)=>s=>(i(s),e(QA,`${r} is ignored: a formula does not write to the console`),"");return{"\\message":t("\\message",r=>r.consumeArgs(1)),"\\errmessage":t("\\errmessage",r=>r.consumeArgs(1)),"\\show":t("\\show",r=>r.popToken())}},ex=(e,t)=>{const r=`${t?"display":"inline"}:${e}`,i=Sr.get(r);if(i!==void 0)return Sr.delete(r),Sr.set(r,i),i;const s=eM(e,t);return Sr.set(r,s),Sr.size>tM&&Sr.delete(Sr.keys().next().value),s},tM=610,Sr=new Map,eM=(e,t)=>{const r=[],i=(o,a)=>{r.push({code:o,message:a,formula:e,displayMode:t})},s=console.warn;console.warn=(...o)=>{const[a]=o;if(o.length===1&&typeof a=="string"&&KA.test(a)){i(ZA,a);return}s.apply(console,o)};try{const o=Vx.renderToString(e,{displayMode:t,throwOnError:!1,macros:JA(i),strict:(a,n)=>(a!==VA&&i(a,n),"ignore")});return Object.freeze({html:o,diagnostics:Object.freeze(r.map(a=>Object.freeze(a)))})}finally{console.warn=s}};const rM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],iM=Et("chevron-down",rM);const sM=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],oM=Et("copy",sM);const aM=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],nM=Et("download",aM);const lM=[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]],hM=Et("highlighter",lM);const cM=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],dM=Et("maximize-2",cM);const uM=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],fM=Et("minimize-2",uM),gM=Object.freeze({table:{text:"Spreadsheet",lang:"en"},zoomIn:{text:"Zoom in",lang:"en"},zoomOut:{text:"Zoom out",lang:"en"},resetZoom:{text:"Reset zoom",lang:"en"},highlight:{text:"Highlight the active row and column",lang:"en"},copyAll:{text:"Copy the whole table",lang:"en"},saveTsv:{text:"Save as TSV",lang:"en"},saveMenu:{text:"More ways to save",lang:"en"},saveTsvWithBom:{text:"Save with a BOM (for Excel)",lang:"en"},fullscreen:{text:"View full screen",lang:"en"},exitFullscreen:{text:"Exit full screen",lang:"en"},fullscreenDialog:{text:"Spreadsheet (full screen)",lang:"en"},size:{text:"Rows {rows} × columns {cols}",lang:"en"},fileName:{text:"spreadsheet.tsv",lang:"en"},copied:{text:"Copied the whole table.",lang:"en"},copyFailed:{text:"Could not copy the table: {reason}",lang:"en"},cellAnnouncement:{text:"{cell}, {value}",lang:"en"},emptyCell:{text:"blank",lang:"en"},selectionAnnouncement:{text:"{range} selected",lang:"en"},readOnly:{text:"This table is read-only here.",lang:"en"},formatRefused:{text:"This table keeps text only, so formatting and links are not saved.",lang:"en"},fenceRefused:{text:"A cell cannot begin a line with ``` or ~~~ in this table, so the change was not saved.",lang:"en"},editConflict:{text:"The table changed in the editor, so the change was not saved. Try again.",lang:"en"},optionsError:{text:"Invalid spreadsheet options: {message}",lang:"en"},loadFailed:{text:"Could not load the spreadsheet: {message}",lang:"en"},retry:{text:"Retry",lang:"en"}}),pM=Object.freeze({table:{text:"表",lang:"ja"},zoomIn:{text:"拡大",lang:"ja"},zoomOut:{text:"縮小",lang:"ja"},resetZoom:{text:"拡大率を戻す",lang:"ja"},highlight:{text:"選んだ行と列を強調",lang:"ja"},copyAll:{text:"表全体をコピー",lang:"ja"},saveTsv:{text:"TSV として保存",lang:"ja"},saveMenu:{text:"ほかの保存の方法",lang:"ja"},saveTsvWithBom:{text:"BOM を付けて保存 (Excel 向け)",lang:"ja"},fullscreen:{text:"全画面で見る",lang:"ja"},exitFullscreen:{text:"全画面を閉じる",lang:"ja"},fullscreenDialog:{text:"表 (全画面)",lang:"ja"},size:{text:"{rows} 行 × {cols} 列",lang:"ja"},fileName:{text:"表.tsv",lang:"ja"},copied:{text:"表全体をコピーしました。",lang:"ja"},copyFailed:{text:"表をコピーできませんでした: {reason}",lang:"ja"},cellAnnouncement:{text:"{cell}、{value}",lang:"ja"},emptyCell:{text:"空白",lang:"ja"},selectionAnnouncement:{text:"{range} を選択",lang:"ja"},readOnly:{text:"この表はここでは編集できません。",lang:"ja"},formatRefused:{text:"この表は文字だけを保つため、書式とリンクは保存しません。",lang:"ja"},fenceRefused:{text:"セルの行頭に ``` や ~~~ を置くと表が壊れるため、この変更は保存しませんでした。",lang:"ja"},editConflict:{text:"エディタで表が変わっていたため、この変更は保存しませんでした。もう一度お試しください。",lang:"ja"},optionsError:{text:"表の指定の誤り: {message}",lang:"ja"},loadFailed:{text:"表を読み込めませんでした: {message}",lang:"ja"},retry:{text:"再試行",lang:"ja"}}),Ls=Object.freeze({en:gM,ja:pM}),Kr=(e,t)=>e.replace(/\{([A-Za-z]+)\}/gu,(r,i)=>Object.hasOwn(t,i)?String(t[i]):r),mM=({labels:e,rows:t,cols:r,canZoomIn:i,canZoomOut:s,zoomed:o,onZoom:a,onResetZoom:n,highlighted:l,onToggleHighlight:c,onCopy:h,onSave:d,fullscreen:f,onToggleFullscreen:u,gridReady:p})=>{const[m,y]=E.useState(!1),x=E.useId(),C=E.useRef(null),k=E.useRef(null);E.useEffect(()=>{if(!m)return;const B=k.current?.ownerDocument;if(B===void 0)return;const _=P=>{P.target instanceof Node&&k.current?.contains(P.target)===!0||y(!1)};return B.addEventListener("pointerdown",_,!0),()=>B.removeEventListener("pointerdown",_,!0)},[m]);const v=B=>{B.key!=="Escape"||!m||(B.preventDefault(),B.stopPropagation(),y(!1),C.current?.focus())},S=(B,_,P,O,D,H)=>w.jsx("button",{type:"button","data-aqmd-spreadsheet-control":B,onClick:D?P:void 0,"aria-disabled":D?void 0:"true","aria-pressed":H,className:Xo,"aria-label":e[_].text,lang:e[_].lang,children:O}),T=f?"exitFullscreen":"fullscreen";return w.jsxs("div",{"data-aqmd-spreadsheet-toolbar":"",className:"mb-1 flex flex-wrap items-center gap-1",children:[S("zoom-in","zoomIn",()=>a(1),w.jsx(Nd,{size:20}),p&&i),S("zoom-out","zoomOut",()=>a(-1),w.jsx(qd,{size:20}),p&&s),S("reset-zoom","resetZoom",n,w.jsx(on,{size:18}),p&&o),S("highlight","highlight",c,w.jsx(hM,{size:18}),p,l),S("copy","copyAll",h,w.jsx(oM,{size:18}),p),w.jsxs("div",{ref:k,className:"relative flex gap-1",children:[S("save","saveTsv",()=>d(!1),w.jsx(nM,{size:18}),!0),w.jsx("button",{ref:C,type:"button","data-aqmd-spreadsheet-control":"save-menu",onClick:()=>y(B=>!B),onKeyDown:v,className:Xo,"aria-label":e.saveMenu.text,lang:e.saveMenu.lang,"aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?x:void 0,children:w.jsx(iM,{size:18})}),m&&w.jsx("div",{id:x,role:"menu","aria-label":e.saveMenu.text,lang:e.saveMenu.lang,"data-aqmd-spreadsheet-menu":"",onKeyDown:v,className:V0,children:w.jsx("button",{type:"button",role:"menuitem","data-aqmd-spreadsheet-menu-item":"save-with-bom",lang:e.saveTsvWithBom.lang,onClick:()=>{y(!1),C.current?.focus(),d(!0)},className:Z0,children:e.saveTsvWithBom.text})})]}),S("fullscreen",T,u,f?w.jsx(fM,{size:18}):w.jsx(dM,{size:18}),!0),w.jsx("span",{"data-aqmd-spreadsheet-size":"",lang:e.size.lang,className:"ms-1 text-sm",children:Kr(e.size.text,{rows:t,cols:r})})]})},yM=(e,t,r)=>{const i={v:1,rows:e.length,cols:e[0]?.length??0,clipId:r,formats:[],validations:[],cells:e.map(o=>o.map(a=>({t:a}))),wholeRows:!1,wholeCols:!1,conditionalFormats:[]},s=t.serializeClipPayload(i);return{plain:t.serializeTsv(e),html:t.serializeHtmlTable(i,s)}},xM=async(e,t,r)=>{await t.write([r({"text/plain":new Blob([e.plain],{type:"text/plain"}),"text/html":new Blob([e.html],{type:"text/html"})})])},CM="\uFEFF",bM="text/tab-separated-values;charset=utf-8",kM=(e,t)=>`${t?CM:""}${ns.serializeTsv(e)}`,wM=(e,t,r)=>{const i=r.defaultView;if(i===null)throw new Error("[@aiquants/markdown] saving a file needs a document with a window");const s=i.URL.createObjectURL(new Blob([e],{type:bM})),o=r.createElement("a");o.href=s,o.download=t,o.hidden=!0,r.body.append(o);try{o.click()}finally{o.remove(),i.setTimeout(()=>i.URL.revokeObjectURL(s),0)}},rx=24,SM=1,vM=1,TM="#f3f4f6",_M=Object.freeze({bold:!0,background:TM}),BM=Object.freeze({}),LM=(e,t)=>Math.max(1,Math.min(e.visibleRows??Ei.DEFAULT_SPREADSHEET_VISIBLE_ROWS,t)),EM=e=>Qr.SPREADSHEET_COLUMN_HEADER_HEIGHT_PX+e*rx+Qr.SPREADSHEET_SCROLLBAR_SIZE_PX,FM=(e,t,r)=>{const i=(e[0]?.length??0)+r,s=e.map(o=>[...o,...Array(r).fill("")]);for(let o=0;o<t;o+=1)s.push(Array(i).fill(""));return s},ix=e=>{let t=e.length;for(;t>1&&e[t-1].every(i=>i==="");)t-=1;let r=e[0]?.length??0;for(;r>1&&e.slice(0,t).every(i=>i[r-1]==="");)r-=1;return t===0||r===0?[[""]]:e.slice(0,t).map(i=>i.slice(0,r))},AM=["format","hyperlink","note","comments","validation"],MM=(e,t)=>{let r=null,i=!1;for(const s of t){if(!(Number.isInteger(s.row)&&Number.isInteger(s.col))||s.row<0||s.row>=e.length||s.col<0||s.col>=e[s.row].length)throw new RangeError(`[@aiquants/markdown] spreadsheet edit outside the table: row ${s.row}, column ${s.col}`);AM.some(o=>s[o]!==void 0&&s[o]!==null)&&(i=!0),s.text!==void 0&&(r??=e.map(o=>[...o]),r[s.row][s.col]=s.text.replace(/\r\n?/gu,`
312
+ `))}return r!==null?{kind:"applied",matrix:r}:i?{kind:"format-only"}:{kind:"unchanged"}},$M=e=>ns.serializeTsv(ix(e)).replaceAll(`\r
313
+ `,`
314
+ `),OM=/^ {0,3}(?:`{3}|~{3})/mu,RM=e=>OM.test(e),IM=(e,t)=>{const r=e.indexOf(t);return r===-1?{echo:!1,pending:[]}:{echo:!0,pending:e.slice(r+1)}},PM=(e,t,r,i,s)=>{const o=s==="down"?1:s==="up"?-1:0,a=s==="right"?1:s==="left"?-1:0,n=(d,f)=>d>=0&&d<t&&f>=0&&f<r,l=(d,f)=>e(d,f)!=="";let c=i.row+o,h=i.col+a;if(!n(c,h))return{row:i.row,col:i.col};if(l(i.row,i.col)&&l(c,h)){for(;n(c+o,h+a)&&l(c+o,h+a);)c+=o,h+=a;return{row:c,col:h}}for(;n(c,h);){if(l(c,h))return{row:c,col:h};c+=o,h+=a}return{row:c-o,col:h-a}},DM=/^(?:https?:\/\/|mailto:|tel:)\S+$/iu,NM=e=>DM.test(e)?e:void 0,qM=(e,t)=>{const r=`${t(e.startCol)}${e.startRow+1}`;return e.startRow===e.endRow&&e.startCol===e.endCol?r:`${r}:${t(e.endCol)}${e.endRow+1}`};let po=null,Ja=null;const hl=new Set,zM=e=>(hl.add(e),()=>{hl.delete(e)}),bd=()=>po!==null?Promise.resolve(po):(Ja??=import("@aiquants/spreadsheet").then(e=>{po=e;for(const t of hl)t();return e},e=>{throw Ja=null,e}),Ja);class Ki extends Error{reason;constructor(t){super(`[@aiquants/markdown] spreadsheet edit refused: ${t}`),this.name="SpreadsheetEditRefusal",this.reason=t}}const kd=Object.freeze({row:!0,column:!0,intersection:!1}),jM=Object.freeze({row:!1,column:!1,intersection:!1}),WM=Object.freeze({link:!1}),HM=229,YM=({matrix:e,headerRows:t,visibleRows:r})=>{const i=e.slice(0,r),s=i.slice(0,t),o=i.slice(t);return w.jsxs("table",{"data-aqmd-spreadsheet-static":"",children:[s.length>0&&w.jsx("thead",{children:s.map((a,n)=>w.jsx("tr",{children:a.map((l,c)=>w.jsx("th",{scope:"col",children:l},c))},n))}),w.jsx("tbody",{children:o.map((a,n)=>w.jsx("tr",{children:a.map((l,c)=>w.jsx("td",{children:l},c))},n))})]})},UM=e=>{try{return{options:Ei.parseSpreadsheetOptions(e),error:null}}catch(t){if(t instanceof RangeError)return{options:null,error:t.message};throw t}},sx=({tsv:e,meta:t,sourceLines:r,editor:i,locale:s="en",labels:o})=>{if(!Object.hasOwn(Ls,s))throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet locale "${String(s)}" (en and ja are supported)`);const a=E.useMemo(()=>Vo(Ls[s],o),[s,o]),{options:n,error:l}=E.useMemo(()=>UM(t),[t]),c=E.useMemo(()=>ps.parseSourceLines(r)?.first??null,[r]),h=i!==void 0&&c!==null?i:void 0,d=h!==void 0,f=d&&n!==null&&n.footerRows===0?SM:0,u=d?vM:0,[p,m]=E.useState(()=>ns.parseTsv(e)),[y,x]=E.useState(0),C=E.useRef(e),k=E.useRef([]),v=E.useRef(e);v.current=e;const S=E.useMemo(()=>FM(p,f,u),[p,f,u]),T=E.useRef(S);T.current=S;const B=E.useRef(0);B.current=n?.headerRows??0;const _=E.useRef(d);_.current=d;const P=E.useSyncExternalStore(zM,()=>po,()=>null),[O,D]=E.useState(null),[H,U]=E.useState(1),[I,M]=E.useState(kd),[A,z]=E.useState(!1),[R,$]=E.useState(null),N=E.useRef(null),L=E.useId(),X=E.useCallback((J,mt={})=>{$(Ot=>({text:Kr(a[J].text,mt),lang:a[J].lang,serial:(Ot?.serial??0)+1}))},[a]);E.useEffect(()=>{if(P!==null||l!==null)return;let J=!0;return bd().catch(mt=>{J&&D(mt instanceof Error?mt.message:String(mt))}),()=>{J=!1}},[P,l]),E.useEffect(()=>{const J=IM(k.current,e);k.current=J.pending,!(e===C.current||J.echo)&&(C.current=e,m(ns.parseTsv(e)),x(mt=>mt+1))},[e]);const Y=E.useCallback(J=>{J(),k.current=[];const mt=v.current;mt!==C.current&&(C.current=mt,m(ns.parseTsv(mt)),x(Ot=>Ot+1))},[]),G=E.useMemo(()=>h===void 0?void 0:()=>Y(()=>h.undo()),[h,Y]),q=E.useMemo(()=>h===void 0?void 0:()=>Y(()=>h.redo()),[h,Y]),K=E.useRef(()=>{});K.current=J=>{if(h===void 0||c===null)throw new Ki("readOnly");const mt=MM(T.current,J);if(mt.kind==="format-only")throw new Ki("formatRefused");if(mt.kind==="unchanged")return;const Ot=ix(mt.matrix),ae=$M(Ot);if(ae!==C.current){if(RM(ae))throw new Ki("fenceRefused");if(!h.write({fenceLine:c,expected:C.current,text:ae}))throw new Ki("editConflict");C.current=ae,k.current=[...k.current,ae],m(Ot),x(Pi=>Pi+1)}};const[Z]=E.useState(()=>({get rowCount(){return T.current.length},get colCount(){return T.current[0].length},getCellText:(J,mt)=>T.current[J][mt],applyEdits:(J,mt)=>K.current(J),isCellReadOnly:()=>!_.current,getCellFormat:J=>J<B.current?_M:BM,getCellHyperlink:(J,mt)=>NM(T.current[J][mt]),findDataEdge:(J,mt)=>PM((Ot,ae)=>T.current[Ot][ae],T.current.length,T.current[0].length,J,mt)})),et=E.useCallback(J=>{if(!(J instanceof Ki))throw J;X(J.reason)},[X]),dt=E.useCallback(J=>X("readOnly"),[X]),ut=E.useCallback(J=>{N.current?.ownerDocument.defaultView?.open(J,"_blank","noopener,noreferrer")},[]),xt=E.useCallback(({row:J,displayText:mt,columnName:Ot})=>Kr(a.cellAnnouncement.text,{cell:`${Ot}${J+1}`,value:mt===""?a.emptyCell.text:mt}),[a]),Lt=P?.columnIndexToName,It=E.useMemo(()=>Lt===void 0?void 0:({range:J})=>Kr(a.selectionAnnouncement.text,{range:qM(J,Lt)}),[Lt,a]),Mt=E.useCallback(J=>U(mt=>Qr.clampSpreadsheetZoom(Qr.stepSpreadsheetZoom(mt,J))),[]),$t=E.useCallback(()=>U(1),[]),ie=I.row||I.column,Qt=E.useCallback(()=>M(J=>J.row||J.column?jM:kd),[]),se=E.useCallback(()=>{if(P===null)return;const J=N.current?.ownerDocument.defaultView;(async()=>{if(J==null)throw new Error("no window");const Ot=yM(p,P,J.crypto.randomUUID());await xM(Ot,J.navigator.clipboard,ae=>new J.ClipboardItem(ae))})().then(()=>X("copied"),Ot=>X("copyFailed",{reason:Ot instanceof Error?Ot.message:String(Ot)}))},[X,p,P]),oe=E.useCallback(J=>{const mt=N.current?.ownerDocument;mt!==void 0&&wM(kM(p,J),a.fileName.text,mt)},[p,a]),jt=E.useRef(!1);E.useEffect(()=>{jt.current&&(jt.current=!1,N.current?.querySelector('[data-aqmd-spreadsheet-control="fullscreen"]')?.focus())},[A]);const Pt=E.useCallback(J=>{const mt=N.current;mt!==null&&(mt.close(),J?mt.showModal():mt.show(),jt.current=!0,z(J))},[]),Re=E.useCallback(()=>Pt(!A),[A,Pt]),ge=E.useCallback(J=>{!A||J.key!=="Escape"||J.defaultPrevented||J.nativeEvent.isComposing||J.keyCode===HM||(J.preventDefault(),J.stopPropagation(),Pt(!1))},[A,Pt]),_t=E.useCallback(J=>{J.preventDefault(),Pt(!1)},[Pt]),bt=p.length,Te=p[0].length,Ve=n===null?0:LM(n,S.length),Wr=E.useMemo(()=>({"--aqmd-spreadsheet-box-height":`${EM(Ve)}px`}),[Ve]),Ie=A?a.fullscreenDialog:a.table,Ze=P?.Spreadsheet;return w.jsxs("div",{"data-aqmd-spreadsheet":"","data-source-lines":r,"data-aqmd-spreadsheet-editable":d?"":void 0,"data-aqmd-spreadsheet-fullscreen":A?"":void 0,children:[w.jsx("span",{id:L,hidden:!0,lang:Ie.lang,children:Ie.text}),w.jsxs("dialog",{ref:N,open:!0,"data-aqmd-spreadsheet-dialog":"",role:A?void 0:"group","aria-labelledby":L,onKeyDown:ge,onCancel:_t,children:[l!==null?w.jsx("div",{"data-aqmd-spreadsheet-error":"options",role:"alert",lang:a.optionsError.lang,children:Kr(a.optionsError.text,{message:l})}):w.jsxs(w.Fragment,{children:[w.jsx(mM,{labels:a,rows:bt,cols:Te,canZoomIn:H<Qr.SPREADSHEET_ZOOM_MAX,canZoomOut:H>Qr.SPREADSHEET_ZOOM_MIN,zoomed:H!==1,onZoom:Mt,onResetZoom:$t,highlighted:ie,onToggleHighlight:Qt,onCopy:se,onSave:oe,fullscreen:A,onToggleFullscreen:Re,gridReady:Ze!==void 0}),w.jsx("div",{"data-aqmd-spreadsheet-box":"",style:Wr,children:Ze===void 0||n===null?w.jsx(YM,{matrix:p,headerRows:n?.headerRows??0,visibleRows:Ve}):w.jsx(Ze,{adapter:Z,dataVersion:y,defaultRowHeight:rx,frozenRows:n.headerRows,frozenTrailingRows:n.footerRows,frozenColumns:n.frozenColumns,enableFillHandle:d,enableResizeUI:!0,zoom:H,onZoomChange:U,highlight:I,onHighlightChange:M,popovers:WM,onHyperlinkOpen:ut,onEditRejected:et,onReadOnlyRejected:dt,onUndoRequest:G,onRedoRequest:q,formatCellAnnouncement:xt,formatSelectionAnnouncement:It,locale:s})})]}),O!==null&&w.jsxs("div",{"data-aqmd-spreadsheet-error":"load",role:"alert",children:[w.jsx("span",{lang:a.loadFailed.lang,children:Kr(a.loadFailed.text,{message:O})}),w.jsx("button",{type:"button","data-aqmd-spreadsheet-retry":"",lang:a.retry.lang,className:"ms-2 inline-flex min-h-11 items-center rounded border px-3 py-1 text-sm",onClick:()=>{D(null),bd().catch(J=>D(J instanceof Error?J.message:String(J)))},children:a.retry.text})]}),w.jsx("p",{"data-aqmd-spreadsheet-notice":"",role:"status",lang:R?.lang,children:R?.text})]})]})};sx.displayName="SpreadsheetBlock";const _h=E.memo(sx),XM=Object.freeze({light:"solarized-light",dark:"github-dark-high-contrast"}),GM=Object.freeze({"solarized-light":Object.freeze({"#657b83":"#435860","#93a1a1":"#4b5757","#2aa198":"#005f59","#dc322f":"#ae0010","#d33682":"#a70060","#268bd2":"#00588e","#859900":"#4e5a00","#586e75":"#43585f","#cb4b16":"#9a3100","#b58900":"#6c5100","#6c71c4":"#4a4c9c"}),"github-dark-high-contrast":Object.freeze({"#272b33":"#abb1bb"})});function VM(e){const t={};for(const r in e){const i=e[r];switch(r){case"class":t.className=i;break;case"style":{const s={};for(const o of i.split(";")){const a=o.indexOf(":");if(a<=0)continue;const n=o.slice(0,a).trim(),l=o.slice(a+1).trim();n===""||l===""||(s[n.startsWith("--")?n:n.replace(/-(\w)/g,(c,h)=>h.toUpperCase())]=l)}t.style=s;break}case"tabindex":t.tabIndex=Number(i);break;default:t[r]=i}}return t}const ZM=({code:e})=>{const[t,r]=E.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},s=>{console.error("Failed to copy: ",s)})};return w.jsx("button",{type:"button","data-aqmd-code-copy":"",className:"absolute top-2 right-2 z-10 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md px-2 py-1 text-sm transition-colors",onClick:i,children:t?"COPIED!":"Copy"})},KM=({htmlPromise:e,filename:t,code:r,sourceLines:i})=>{const s=E.use(e),o={replace:a=>{if(a instanceof Tt.Element&&a.name==="pre"){const n=VM(a.attribs),l=t?"2.2rem 0 1rem 0":"1rem 0";return n.style={...typeof n.style=="object"?n.style:{},margin:"0",padding:"0.8rem 0"},w.jsxs("div",{className:"relative",style:{margin:l},"data-aqmd-code-block":"","data-source-lines":i,children:[t&&w.jsx("div",{"data-aqmd-code-filename":"",className:"absolute -top-4 left-0 z-0 rounded-md px-2 py-0.5 text-sm",children:t}),w.jsx(ZM,{code:r}),w.jsx("pre",{...n,children:Tt.domToReact(a.children,o)})]})}},htmlparser2:{lowerCaseTags:!0}};return w.jsx(w.Fragment,{children:Tt(s,o)})},QM=/^(diff)?:?(\w+):?([\w.-]*)?/,JM=()=>({code(e){for(const t of e.children){if(t.type!=="element")continue;const r=t.children[0];if(r?.type!=="element")continue;const i=r.children[0];if(i?.type!=="text")continue;const s=i.value;let o,a,n="";if(s.startsWith("+")?(o="+",a="add",n="bg-green-200 dark:bg-green-400/90 text-green-700"):s.startsWith("-")&&(o="-",a="remove",n="bg-red-200 dark:bg-red-400/90 text-red-700"),o&&a){t.properties.dataAqmdDiff=a,i.value=s.substring(1).trimStart();const l={type:"element",tagName:"span",properties:{className:`inline-flex items-center justify-center w-4 h-4 rounded-full select-none font-bold text-[0.5rem] mr-2 ${n}`},children:[{type:"text",value:o==="+"?"➕":"➖"}]};t.children.unshift(l)}}}}),t5=e=>{const t=QM.exec(e??"");return{isDiff:t?.[1]==="diff",lang:t?.[2]||"text",filename:t?.[3]||void 0}},Bh=({lang:e,code:t,node:r,sourceLines:i})=>{const s=e??r?.lang??void 0,o=t??r?.value??"",{isDiff:a,lang:n,filename:l}=t5(s);return n===Ei.SPREADSHEETS_LANGUAGE?w.jsx(_h,{tsv:o,meta:r?.meta??void 0,sourceLines:i}):n==="mermaid"?w.jsx(Th,{chartContent:o,sourceLines:i}):w.jsx(e5,{code:o,lang:n,isDiff:a,filename:l,sourceLines:i})},e5=({code:e,lang:t,isDiff:r,filename:i,sourceLines:s})=>{const o=E.useMemo(async()=>{const a=[];return r&&a.push(JM()),await Xx.codeToHtml(e,{lang:t,themes:XM,defaultColor:!1,colorReplacements:GM,transformers:a})},[e,t,r]);return w.jsx(E.Suspense,{fallback:w.jsx("div",{className:"dark:text-white","data-source-lines":s,children:"🌀 Loading code..."}),children:w.jsx(KM,{htmlPromise:o,filename:i,code:e,sourceLines:s})})},ox=({code:e})=>{const[t,r]=E.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},s=>{console.error("Failed to copy: ",s)})};return w.jsx("button",{type:"button","data-aqmd-code-copy":"",className:"absolute right-2 z-10 inline-flex min-h-11 min-w-11 items-center justify-center rounded-md px-2 py-1 text-xs transition-colors",onClick:i,children:t?"COPIED!":"Copy"})},ax=(e,t)=>{const r=E.useMemo(()=>{try{return{kind:"rendered",html:ex(e,t).html}}catch(i){return{kind:"failed",error:i,message:`Math rendering error: ${i instanceof Error?i.message:String(i)}`}}},[e,t]);return E.useEffect(()=>{r.kind==="failed"&&console.error("An error occurred while rendering KaTeX:",r.error)},[r]),r},r5=({node:e})=>{const t=ax(e.value,!0),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return w.jsxs("div",{className:"relative",children:[w.jsx(ox,{code:e.value}),t.kind==="rendered"?w.jsx("article",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):w.jsx("article",{className:r,children:t.message})]})},i5=/^[a-z][a-z0-9+.-]*:/i,s5=/^[/\\]{2}/,o5=/[\t\n\r]/g,wd=32,a5=e=>{let t=0,r=e.length;for(;t<r&&e.charCodeAt(t)<=wd;)t+=1;for(;r>t&&e.charCodeAt(r-1)<=wd;)r-=1;return e.slice(t,r)},nx=e=>{const t=a5(e).replace(o5,"");return i5.test(t)||s5.test(t)},n5="text-link underline visited:text-link-visited",l5="inline-block w-fit",Lh=new Set(["img","picture","video","audio","svg","canvas","iframe","object","embed","address","article","aside","blockquote","details","dialog","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","menu","nav","ol","p","pre","section","table","ul"]);[...Lh].join(",");const lx=(e,t)=>[e,t?l5:void 0,n5].filter(r=>r!==void 0&&r.trim()!=="").join(" "),h5=new Set(["id","title","lang","dir","role"]),c5=["aria-","data-footnote-"],d5=e=>{const t={};for(const[r,i]of Object.entries(e)){const s=r.toLowerCase();(h5.has(s)||c5.some(o=>s.startsWith(o)&&s.length>o.length))&&(t[s]=i)}return Object.freeze(t)},be=new rn.Logger(rn.LogLevel.INFO,"[DifyIFramePlugin]"),u5="100%",f5="600px",g5="0",p5=e=>typeof e!="object"||e===null||!("type"in e)?null:typeof e.type=="string"?e.type:null,m5=({embed:e,iFrameAllowedDomains:t})=>{const[r,i]=E.useState(!0),[s,o]=E.useState(!1),a=E.useRef(null),n=E.useRef(null),l=E.useRef(null),{src:c}=e,h=E.useCallback(x=>{x.source===null||x.source!==a.current?.contentWindow||!zC(x.origin,t)||p5(x.data)==="dify-chatbot-iframe-ready"&&(be.info("Dify chatbot iframe is ready"),i(C=>C&&(o(!1),n.current&&(clearTimeout(n.current),n.current=null),l.current&&(clearTimeout(l.current),l.current=null),!1)))},[t]),d=E.useCallback(()=>{const x=a.current;if(x)try{if(!x.contentDocument)throw new Error("Cannot access iframe content");i(k=>k&&(o(!1),!1))}catch{be.info("Crossorigin error detected, showing auth prompt"),o(k=>k||(i(!1),!0))}},[]),f=E.useCallback(()=>{const x=window.open(c,"dify-oauth","width=500,height=600,scrollbars=yes,resizable=yes");if(!x){be.error("ポップアップがブロックされました");return}const C=setInterval(()=>{if(x.closed){clearInterval(C),be.info("ポップアップが閉じられました");try{be.info("ポップアップURL:",x.location.href)}catch(v){be.info("クロスオリジンのためURLにアクセスできません:",v)}const k=a.current;if(k?.src){const v=k.src;i(S=>S||!0),o(S=>S&&!1),k.src="",setTimeout(()=>{k.src=v,n.current=setTimeout(()=>{be.warn("認証後タイムアウト: dify-chatbot-iframe-ready not received after auth"),d()},5e3)},100)}}},1e3);be.info("ポップアップを開きました:"),be.info("- 初期URL:",c),be.info("- ウィンドウ名:","dify-oauth"),be.info("- ウィンドウサイズ: 500x600")},[d,c]);E.useEffect(()=>(window.addEventListener("message",h),()=>{window.removeEventListener("message",h)}),[h]),E.useEffect(()=>{const x=setTimeout(()=>{be.warn("Timeout: dify-chatbot-iframe-ready not received, checking iframe access"),d()},5e3);return l.current=x,()=>{l.current&&(clearTimeout(l.current),l.current=null)}},[d]),E.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);const{width:u=u5,height:p=f5,frameborder:m=g5,...y}=e.attributes;return w.jsxs("div",{className:"dify-iframe-container",children:[r&&!s&&w.jsxs("div",{className:"flex items-center justify-center rounded-lg bg-gray-50 p-8",children:[w.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-blue-600 border-b-2"}),w.jsx("span",{className:"ml-3 text-gray-600",children:"Dify チャットボットを読み込み中..."})]}),s&&w.jsxs("div",{className:"mb-4 rounded-lg border border-blue-200 bg-blue-50 p-6",children:[w.jsx("div",{className:"flex items-center",children:w.jsxs("div",{className:"text-blue-800",children:[w.jsx("h3",{className:"font-medium",children:"認証が必要です"}),w.jsx("p",{className:"mt-1 text-sm",children:"Dify チャットボットにアクセスするには OAuth 認証が必要です。 ポップアップウィンドウで認証を完了してください。"})]})}),w.jsx("div",{className:"mt-4",children:w.jsx("button",{type:"button",onClick:f,className:"rounded-md border border-gray-700 bg-gray-900 px-4 py-2 font-medium text-sm text-white shadow-lg transition-colors hover:bg-gray-800",children:"OAuth 認証を開始"})})]}),w.jsx("div",{className:`${r||s?"hidden":"block"}`,children:w.jsx("iframe",{ref:a,...Tt.attributesToProps({...y,width:u,height:p,frameborder:m},"iframe"),src:c,"data-plugin-type":"dify"})})]})},Sd=Object.freeze({dify:m5}),y5=e=>Object.hasOwn(Sd,e)?Sd[e]:null,x5=w.jsx(E.Fragment,{}),C5=(e,t,r,i,s)=>{const o=t===null?null:y5(t),a=e.attributes.title===void 0?{title:`${i.text}: ${new URL(e.src).hostname}`,lang:i.lang}:{};return w.jsx(TC,{embed:e,label:i,insideAnchor:s,children:o!==null?w.jsx(o,{embed:e,iFrameAllowedDomains:r}):w.jsx("iframe",{...Tt.attributesToProps(e.attributes,"iframe"),...a,src:e.src})})},b5=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof Tt.Element&&t.name.toLowerCase()==="a")return!0;return!1},hx=e=>e.some(t=>t instanceof Tt.Element&&(Lh.has(t.name)||hx(t.children))),k5=(e,t,r)=>{const{class:i,"data-link-kind":s,"data-doc-path":o,"data-doc-exists":a,...n}=e.attribs,l=lx(i,hx(e.children)),c=n.href??"",h=s,d=h==="external"||nx(c),f=Tt.domToReact(e.children,t);if(r&&c&&!d)return w.jsx(r,{href:c,kind:h,docPath:o,docExists:a===void 0?void 0:a==="true",className:l,attributes:d5(n),children:f});d&&(n.target="_blank",n.rel="noreferrer");const u={};return s!==void 0&&(u["data-link-kind"]=s),o!==void 0&&(u["data-doc-path"]=o),a!==void 0&&(u["data-doc-exists"]=a),w.jsx("a",{...Tt.attributesToProps(n,"a"),className:l,...u,children:f})},cx=({iFrameAllowedDomains:e,embedLabels:t,linkComponent:r,renderPlaceholder:i,renderKept:s})=>{const o={replace:a=>{if(!(a instanceof Tt.Element))return;const n=a.parent instanceof Tt.Element?a.parent.name:null,l=fl(a.name,a.attribs,{parentName:n,iFrameAllowedDomains:e});switch(l.action){case"remove":return x5;case"unwrap":return w.jsx(E.Fragment,{children:Tt.domToReact(a.children,o)});case"embed":return C5(l.embed,l.pluginType,e,t.embeddedFrame,b5(a))}if(a.attribs={...l.attributes},l.action==="placeholder"){const h=i?.(a,l.link,o);if(h!==void 0)return h}const c=s?.(a,o);if(c!==void 0)return c;if(a.name==="a")return k5(a,o,r)}};return o},w5=({alt:e,target:t,label:r})=>w.jsxs("span",{"data-testid":"markdown-missing-image","data-asset-src":t||void 0,role:"img","aria-label":`${e?`${r} (${e})`:r}${t?`: ${t}`:""}`,className:"my-1 inline-flex max-w-full items-center gap-2 rounded-lg border border-gray-300 border-dashed bg-gray-50 px-3 py-2 text-gray-600 text-sm dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400",children:[w.jsx(pC,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),w.jsxs("span",{className:"min-w-0",children:[w.jsx("span",{className:"font-medium",children:e?`${r} (${e})`:r}),t&&w.jsx("span",{className:"ml-2 break-all font-mono text-xs dark:text-gray-300",children:t})]})]}),S5=(e,t,r)=>{const{src:i,alt:s,"data-asset-exists":o,"data-asset-src":a}=e.attribs;if(!i||i.trim()===""||o==="false")return w.jsx(w5,{alt:s,target:a,label:t});const n=r.rendered===0;return r.rendered+=1,w.jsx("img",{alt:"",...Tt.attributesToProps({loading:n?"eager":"lazy",decoding:"async",...e.attribs})})},Go=e=>e.map(t=>t instanceof Tt.Text?t.data:t instanceof Tt.Element?Go(t.children):"").join(""),v5=(e,t)=>e.map(r=>{if(r instanceof Tt.Text)return{kind:"text",text:r.data};if(!(r instanceof Tt.Element))return{kind:"ignored"};if(r.name.toLowerCase()!=="a")return{kind:"element"};const i=fl(r.name,r.attribs,{parentName:"p",iFrameAllowedDomains:t});return{kind:"link",href:i.action==="keep"?i.attributes.href??null:null}}),T5=(e,t,r,i)=>{const s=e.children,o=fr.placeholderLinkOf(t,v5(s,i.iFrameAllowedDomains));if(o===null)return;const a=Tt.domToReact(s,r),n=w.jsx("p",{...Tt.attributesToProps(e.attribs,"p"),children:a}),l=s.find(f=>f instanceof Tt.Element),c=i.embeds.linkCardEndpoint,h=c!==null&&l!==void 0&&fr.isBareLink(Go(l.children),o)?w.jsx(FC,{href:t,endpoint:c,size:ze.linkCardSizeOf(i.embeds),fallback:n}):n,d=Or.resolveEmbed(o,i.embeds.providers);return d===null?h:w.jsx(NC,{resolution:d,caption:a,fallback:h,theme:i.theme,labels:i.embedLabels})},_5={lowerCaseAttributeNames:!1},B5=2166136261,L5=16777619,E5=/^[\t\n\f\r ]*$/u,F5=`language-${Ei.SPREADSHEETS_LANGUAGE}`,dx=e=>e.name==="code"&&(e.attribs.class??"").split(/[\t\n\f\r ]+/u).includes(F5),A5=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof Tt.Element&&(t.name==="li"||t.name==="blockquote"))return!0;return!1},M5=e=>{let t=B5;const r=s=>{for(let o=0;o<s.length;o+=1)t=Math.imul(t^s.charCodeAt(o),L5)},i=s=>{if(s instanceof Tt.Text)r(""),r(s.data);else if(s instanceof Tt.Element){r(""),r(s.name);for(const[o,a]of Object.entries(s.attribs))o!==ps.SOURCE_LINES_ATTRIBUTE&&(r(""),r(o),r(""),r(a));if(r(""),!dx(s))for(const o of s.children)i(o);r("")}else r("\x07"),r(s.data)};return i(e),(t>>>0).toString(36)},$5=(e,t)=>{if(e==="")return[];const r=new Map;return Tt.htmlToDOM(e,_5).map(i=>{if(i instanceof Tt.Text&&E5.test(i.data))return i.data;const s=M5(i),o=r.get(s)??0;return r.set(s,o+1),w.jsx(E.Fragment,{children:Tt.domToReact([i],t)},`${s}.${o}`)})},ux=({htmlContent:e,theme:t="light",iFrameAllowedDomains:r=[],embeds:i=ze.NO_EMBEDS,embedLabels:s,mermaidInteraction:o,mermaidLabels:a,spreadsheetEditor:n,spreadsheetLocale:l,spreadsheetLabels:c,linkComponent:h,missingImageLabel:d="Image not found",onMathDiagnostics:f})=>{Rd(i);const u=Fd(s),p={rendered:0},m=[],y=E.useRef(null),x=E.useEffectEvent(v=>{f?.(v)}),C=cx({iFrameAllowedDomains:r,embedLabels:u,linkComponent:h,renderPlaceholder:(v,S,T)=>T5(v,S,T,{embeds:i,theme:t,embedLabels:u,iFrameAllowedDomains:r}),renderKept:v=>{if(v.name==="pre"&&v.children.length===1){const S=v.children[0];if(S instanceof Tt.Element&&S.name==="code"){const T=S.attribs.class??"",B=Go(S.children),_=v.attribs[ps.SOURCE_LINES_ATTRIBUTE];if(dx(S)){const P=A5(v)?void 0:n;return w.jsx(_h,{tsv:B,meta:S.attribs[Ei.CODE_META_ATTRIBUTE],sourceLines:_,editor:P,locale:l,labels:c})}return T.includes("language-mermaid")?w.jsx(Th,{chartContent:B,interaction:o,labels:a,sourceLines:_}):w.jsx(Bh,{lang:T.replace("language-",""),code:B,theme:t,sourceLines:_})}}if(v.name==="img")return S5(v,d,p);if(v.name==="span"&&v.attribs.class?.includes("math")){const S=v.attribs.class.includes("display");let T=Go(v.children).trim();S?T=T.replace(/^\\\[/,"").replace(/\\\]$/,""):T=T.replace(/^\\\(/,"").replace(/\\\)$/,"");try{const{html:B,diagnostics:_}=ex(T,S);return m.push(..._),S?w.jsxs("span",{className:"group relative block",children:[w.jsx(ox,{code:T}),w.jsx("span",{dangerouslySetInnerHTML:{__html:B}})]}):w.jsx("span",{dangerouslySetInnerHTML:{__html:B}})}catch(B){console.error("Failed to render math:",B);return}}}}),k=$5(e,C);return E.useEffect(()=>{y.current!==e&&(y.current=e,m.length>0&&x(m))},[e,m]),w.jsx("div",{className:"markdown-body","data-theme":t,children:k})};const O5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],R5=Et("triangle-alert",O5);const I5=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],P5=Et("text-align-center",I5);const D5=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],N5=Et("text-align-start",D5);const q5=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],z5=Et("text-align-end",q5);const j5=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],W5=Et("list",j5);const H5=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Y5=Et("palette",H5);const U5=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],X5=Et("pin",U5);const G5=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],V5=Et("pin-off",G5),Z5=e=>`#${e.id}`,K5=e=>{let t=Number.POSITIVE_INFINITY;for(const r of e)r.depth<t&&(t=r.depth);return t},vd="block truncate py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",fx=({headings:e,className:t="",onHeadingSelect:r,headingHref:i=Z5,label:s,labelledBy:o})=>{if(e.length===0)return null;const a=K5(e);return w.jsx("nav",{className:`toc ${t}`,"aria-label":s,"aria-labelledby":o,children:w.jsx("ul",{className:"m-0 list-none p-0",children:e.map((n,l)=>{const c=n.id===""?null:i(n);return w.jsx("li",{style:{paddingLeft:`${(n.depth-a)*1}rem`},children:c===null?w.jsx("span",{className:`${vd} text-gray-600 dark:text-gray-300`,title:n.text,children:n.text}):w.jsx("a",{href:Es(c)?c:void 0,className:`${vd} text-gray-600 no-underline hover:text-blue-800 dark:text-gray-300 dark:hover:text-blue-300`,onClick:r===void 0?void 0:h=>r(n,h),title:n.text,children:n.text})},l)})})})},tn="--aqmd-toolbar-block-overlap",Q5=({toolbar:e,content:t,scrollportTop:r,scrollportBottom:i})=>{if(e.width<=0||e.height<=0)return 0;const s=e.left<t.right&&e.right>t.left,o=e.top<r+e.height&&e.top<i,a=e.bottom-r;return s&&o&&a>0?Math.ceil(a):0},gx=e=>`mermaid${e.charAt(0).toUpperCase()}${e.slice(1)}`,px=Object.keys(Sa),mx=e=>`spreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`,yx=Object.keys(Ls.en),xx=Object.freeze({loading:{text:"Loading data...",lang:"en"},errorPrefix:{text:"Error: ",lang:"en"},defaultErrorTitle:{text:"An error occurred",lang:"en"},missingImage:{text:"Image not found",lang:"en"},styleTitle:{text:"Display Style",lang:"en"},selectStyleAria:{text:"Select display style",lang:"en"},pinStyleAria:{text:"Pin style selector",lang:"en"},unpinStyleAria:{text:"Unpin style selector",lang:"en"},openTocAria:{text:"目次を開く",lang:"ja"},tocTitle:{text:"目次",lang:"ja"},pinTocAria:{text:"目次をピン留め",lang:"ja"},unpinTocAria:{text:"目次のピン留めを解除",lang:"ja"},selectAlignAria:{text:"揃えを選択",lang:"ja"},alignTitle:{text:"揃え",lang:"ja"},pinAlignAria:{text:"揃え選択をピン留め",lang:"ja"},unpinAlignAria:{text:"揃え選択のピン留めを解除",lang:"ja"},alignLeft:{text:"左揃え",lang:"ja"},alignCenter:{text:"中央揃え",lang:"ja"},alignRight:{text:"右揃え",lang:"ja"},...Object.fromEntries(px.map(e=>[gx(e),Sa[e]])),...Object.fromEntries(yx.map(e=>[mx(e),Ls.en[e]])),...Zo}),J5=dl(xx),t3=e=>Vo(xx,e),e3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of px){const i=e[gx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},r3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of yx){const i=e[mx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},i3=Object.keys(Zo),s3=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of i3){const i=e[r];i!==void 0&&(t[r]=i)}return Object.freeze(t)},Td=Object.freeze({left:{labelKey:"alignLeft",Icon:N5},center:{labelKey:"alignCenter",Icon:P5},right:{labelKey:"alignRight",Icon:z5}}),o3=Object.freeze({text:"ファイルを選択してください。",lang:"ja"}),a3="100%",n3=e=>e==="center"?"auto":e==="right"?"auto 0":"0 auto",cl="24px",Cx=e=>Object.freeze({position:"fixed",insetBlockStart:"var(--aqmd-toolbar-inset-block-start, 0px)",insetInlineEnd:`calc(var(--aqmd-toolbar-inset-inline-end, 0px) + ${e})`,zIndex:60,display:"flex",flexDirection:"row",alignItems:"flex-start",gap:"0.5rem",pointerEvents:"none"}),l3=Cx(cl),h3=Object.freeze({position:"absolute",insetBlockStart:0,insetInlineStart:0,blockSize:"var(--aqmd-toolbar-inset-block-start, 0px)",inlineSize:"var(--aqmd-toolbar-inset-inline-end, 0px)",visibility:"hidden",pointerEvents:"none"}),c3=e=>`calc(100cqi - var(--aqmd-toolbar-inset-inline-end, 0px) - ${e})`,d3=8,_d=800,u3=16,f3=(e,t)=>{const r=e.defaultView;let i;const s=()=>{e.removeEventListener("click",o,!0),e.removeEventListener("pointercancel",a,!0),i!==void 0&&r?.clearTimeout(i)};function o(n){s(),!(n.timeStamp-t.timeStamp>_d||Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY)>u3)&&(n.preventDefault(),n.stopPropagation())}function a(n){n.pointerId===t.pointerId&&s()}e.addEventListener("click",o,!0),e.addEventListener("pointercancel",a,!0),i=r?.setTimeout(s,_d)},g3=(e,t,r)=>{const[i,s]=E.useState(null);return E.useLayoutEffect(()=>{const o=t.current;if(!e||o===null||r===null){s(null);return}const a=o.ownerDocument.defaultView;let n=0;const l=()=>{n=0;const d=o.getBoundingClientRect(),f=o.offsetHeight>0?d.height/o.offsetHeight:1,u=a?.visualViewport??null,p=u===null?Number.POSITIVE_INFINITY:u.offsetTop+u.height,m=Math.min(r.getBoundingClientRect().bottom,p);s(Math.max(0,Math.floor((m-d.top)/f-d3)))},c=()=>{a!==null&&n===0&&(n=a.requestAnimationFrame(l))};l();const h=new ResizeObserver(c);return h.observe(r),a?.addEventListener("resize",c),a?.visualViewport?.addEventListener("resize",c),a?.visualViewport?.addEventListener("scroll",c),o.ownerDocument.addEventListener("scroll",c,!0),()=>{a!==null&&n!==0&&a.cancelAnimationFrame(n),h.disconnect(),a?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("scroll",c),o.ownerDocument.removeEventListener("scroll",c,!0)}},[e,t,r]),i};function en({menu:e,Icon:t,buttonLabel:r,titleLabel:i,titleId:s,pinLabel:o,unpinLabel:a,isOpen:n,isPinned:l,isFront:c,onActivate:h,onToggle:d,onClose:f,onPinToggle:u,popoverClassName:p,scrollBarClearance:m,boundary:y,renderBody:x}){const C=E.useRef(null),k=E.useRef(null),v=E.useRef(null),S=g3(n,v,y),T=E.useCallback(()=>{d(),h()},[h,d]),B=E.useCallback(()=>{if(l)return;const P=C.current?.contains(document.activeElement)===!0;f(),P&&k.current?.focus()},[l,f]);E.useEffect(()=>{if(!n||l)return;const P=C.current;if(P===null)return;const O=H=>{P.contains(H.target)||(f(),H.pointerType==="touch"&&!(H.target instanceof Element&&H.target.closest("[data-aqmd-toolbar]")!==null)&&f3(P.ownerDocument,H))},D=H=>{H.key!=="Escape"||H.defaultPrevented||H.isComposing||(H.preventDefault(),f(),k.current?.focus())};return document.addEventListener("pointerdown",O),P.addEventListener("keydown",D),()=>{document.removeEventListener("pointerdown",O),P.removeEventListener("keydown",D)}},[n,l,f]);const _=l?a:o;return w.jsxs("div",{ref:C,"data-aqmd-toolbar-menu":e,children:[w.jsx("button",{ref:k,type:"button",className:"pointer-events-auto rounded-full border border-gray-200 bg-white p-3 shadow-lg transition-colors hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700",onClick:T,"aria-label":r.text,lang:r.lang,"aria-expanded":n,children:w.jsx(t,{className:"h-5 w-5 text-gray-600 dark:text-gray-300"})}),n&&w.jsxs("div",{ref:v,"data-aqmd-toolbar-popover":e,className:`pointer-events-auto absolute end-0 top-full mt-2 box-border overflow-y-auto overscroll-contain rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-700 dark:bg-gray-800 ${p}`,style:{zIndex:c?2:1,maxInlineSize:c3(m),maxBlockSize:S??void 0},children:[w.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[w.jsx("h3",{id:s,lang:i.lang,className:"px-2 font-bold text-gray-600 text-sm uppercase tracking-wider dark:text-gray-300",children:i.text}),w.jsx("button",{type:"button",className:"rounded p-3.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200",onClick:u,"aria-label":_.text,lang:_.lang,children:l?w.jsx(X5,{className:"h-4 w-4"}):w.jsx(V5,{className:"h-4 w-4"})})]}),x(B)]})]})}const p3=(e,t,r,i)=>{const[s,o]=E.useState(0),a=E.useRef(null);return E.useLayoutEffect(()=>{const n=e.current,l=t.current;if(r===null||n===null||l===null){a.current=null,o(0);return}const c=()=>{const p=n.getBoundingClientRect();o(Q5({toolbar:r.getBoundingClientRect(),content:l.getBoundingClientRect(),scrollportTop:p.top+n.clientTop,scrollportBottom:p.bottom}))};a.current=c;let h=null;const d=()=>{h===null&&(h=requestAnimationFrame(()=>{h=null,c()}))};c();const f=new ResizeObserver(c);f.observe(n),f.observe(l),f.observe(r);const u=r.querySelector("[data-aqmd-toolbar-inset-probe]");return u!==null&&f.observe(u),window.addEventListener("resize",c),window.addEventListener("scroll",d,{capture:!0,passive:!0}),()=>{a.current=null,f.disconnect(),window.removeEventListener("resize",c),window.removeEventListener("scroll",d,{capture:!0}),h!==null&&cancelAnimationFrame(h)}},[e,t,r]),E.useLayoutEffect(()=>{a.current?.()},[i]),s},m3=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,y3=e=>{let t=null,r=e;for(;r!==null;)r.getAttribute("hidden")?.toLowerCase()==="until-found"&&(r.dispatchEvent(new Event("beforematch",{bubbles:!0})),r.removeAttribute("hidden")),r instanceof HTMLDetailsElement&&!r.open&&t!==null&&t!==Array.from(r.children).find(i=>i.localName==="summary")&&(r.open=!0),t=r,r=r.parentElement},x3=E.memo(function({parseResult:t,theme:r,styleClassName:i,iFrameAllowedDomains:s,embeds:o,embedLabels:a,linkComponent:n,missingImageLabel:l,mermaidLabels:c,spreadsheetEditor:h,spreadsheetLocale:d,spreadsheetLabels:f,onMathDiagnostics:u}){return w.jsx("div",{className:"w-full min-w-0",children:w.jsx("div",{className:i,"data-theme":r,children:w.jsx(ux,{htmlContent:t.htmlContent,theme:r,iFrameAllowedDomains:s,embeds:o,embedLabels:a,linkComponent:n,missingImageLabel:l,mermaidLabels:c,spreadsheetEditor:h,spreadsheetLocale:d,spreadsheetLabels:f,onMathDiagnostics:u})})})});function bx(){const[e,t]=E.useState("toc"),[r,i]=E.useState(!1),[s,o]=E.useState(!1),[a,n]=E.useState(!1),[l,c]=E.useState(!1),[h,d]=E.useState(!1),[f,u]=E.useState(!1),p=E.useCallback(()=>t("toc"),[]),m=E.useCallback(()=>i(O=>!O),[]),y=E.useCallback(()=>i(!1),[]),x=E.useCallback(()=>c(O=>!O),[]),C=E.useCallback(()=>t("style"),[]),k=E.useCallback(()=>o(O=>!O),[]),v=E.useCallback(()=>o(!1),[]),S=E.useCallback(()=>d(O=>!O),[]),T=E.useCallback(()=>t("align"),[]),B=E.useCallback(()=>n(O=>!O),[]),_=E.useCallback(()=>n(!1),[]),P=E.useCallback(()=>u(O=>!O),[]);return{lastActiveMenu:e,isTocOpen:r,isStyleOpen:s,isAlignOpen:a,isTocPinned:l,isStylePinned:h,isAlignPinned:f,activateToc:p,toggleToc:m,closeToc:y,togglePinToc:x,activateStyle:C,toggleStyle:k,closeStyle:v,togglePinStyle:S,activateAlign:T,toggleAlign:B,closeAlign:_,togglePinAlign:P}}const C3=({error:e,labels:t})=>{if(E.isValidElement(e))return w.jsx("div",{className:"p-4",children:e});if(typeof e=="object"&&e!==null&&"message"in e){const i=e,s=i.title!==void 0&&i.title!=="";return w.jsx("div",{className:"mx-auto my-8 max-w-lg rounded-xl border border-red-200 bg-red-50/50 p-6 shadow-sm backdrop-blur-sm dark:border-red-900/50 dark:bg-red-950/30",children:w.jsxs("div",{className:"flex items-start gap-3",children:[w.jsx("div",{className:"rounded-lg bg-red-100 p-2 text-red-600 dark:bg-red-900/50 dark:text-red-400",children:w.jsx(R5,{className:"h-5 w-5"})}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsx("h3",{lang:s?void 0:t.defaultErrorTitle.lang,className:"font-semibold text-base text-red-900 dark:text-red-200",children:s?i.title:t.defaultErrorTitle.text}),i.status&&w.jsx("span",{className:"rounded bg-red-100 px-2 py-0.5 font-medium font-mono text-red-700 text-xs dark:bg-red-900/60 dark:text-red-300",children:i.status})]}),w.jsx("p",{className:"mt-2 text-red-700 text-sm leading-relaxed dark:text-red-300/90",children:i.message})]})]})})}const r=typeof e=="string"?e:String(e);return w.jsx("div",{className:"mx-auto my-8 max-w-lg rounded-xl border border-red-200 bg-red-50/50 p-4 text-center dark:border-red-900/50 dark:bg-red-950/30",children:w.jsxs("p",{className:"font-medium text-red-700 text-sm dark:text-red-300",children:[w.jsx("span",{lang:t.errorPrefix.lang,children:t.errorPrefix.text}),r]})})};function b3({parseResult:e,content:t,error:r=null,isLoading:i=!1,labels:s,theme:o,style:a,onStyleChange:n,availableStyles:l=qi.DEFAULT_MARKDOWN_STYLES,align:c=qi.DEFAULT_CONTENT_ALIGN,onAlignChange:h,showToc:d=!0,showStyle:f=!0,showAlign:u=!0,width:p,maxWidth:m,padding:y=16,iFrameAllowedDomains:x,embeds:C=ze.NO_EMBEDS,emptyMessage:k,toolbar:v,linkComponent:S,onHeadingSelect:T,headingHref:B,onMathDiagnostics:_,spreadsheetEditor:P,spreadsheetLocale:O,renderScrollBar:D}){const H=E.useRef(null),[U,I]=E.useState(null),M=E.useCallback(yt=>{H.current=yt,I(yt)},[]),[A,z]=E.useState(0),R=E.useRef(null),[$,N]=E.useState(null),L=E.useRef(null),X=E.useId(),Y=bx(),G=v??Y,q=E.useMemo(()=>t3(s),[s]),K=E.useMemo(()=>e3(s),[s]),Z=E.useMemo(()=>r3(s),[s]),et=E.useRef(P);et.current=P;const dt=P!==void 0,ut=E.useMemo(()=>dt?{write:yt=>et.current?.write(yt)===!0,undo:()=>et.current?.undo(),redo:()=>et.current?.redo()}:void 0,[dt]);Rd(C);const xt=Or.EMBED_PROVIDER_IDS.filter(yt=>C.providers.includes(yt)).join(" "),Lt=C.linkCardEndpoint,It=C.linkCardSize,Mt=E.useMemo(()=>{const yt=xt.split(" "),Bt=Object.freeze(Or.EMBED_PROVIDER_IDS.filter(pe=>yt.includes(pe)));return Object.freeze(It===void 0?{providers:Bt,linkCardEndpoint:Lt}:{providers:Bt,linkCardEndpoint:Lt,linkCardSize:It})},[xt,Lt,It]),$t=s?.embeddedVideo,ie=s?.embeddedPost,Qt=s?.embeddedFrame,se=E.useMemo(()=>s3({embeddedVideo:$t,embeddedPost:ie,embeddedFrame:Qt}),[$t,ie,Qt]),oe=E.useRef(_);E.useLayoutEffect(()=>{oe.current=_},[_]);const jt=E.useCallback(yt=>{oe.current?.(yt)},[]),Pt=k===void 0?o3:{text:k,lang:void 0},Re=p3(H,R,$,c);if(!qi.CONTENT_ALIGNS.includes(c))throw new TypeError(`[@aiquants/markdown] align must be one of ${qi.CONTENT_ALIGNS.join(", ")}; got ${String(c)} (normalize it with toContentAlign)`);const ge=Number.isFinite(y)&&y>=0?y:16,_t=E.useCallback(yt=>{const Bt=H.current;if(Bt){const pe=Bt.querySelector("[data-theme]"),ne=Bt.getBoundingClientRect(),Pe=pe?.children;let hr=-1,Ps=Number.POSITIVE_INFINITY;if(Pe)for(let Ni=0;Ni<Pe.length;Ni+=1){const va=Pe[Ni],Eh=Math.abs(va.getBoundingClientRect().top-ne.top);Eh<Ps&&(Ps=Eh,hr=Ni)}if(Pe&&hr>=0){const va=Pe[hr].getBoundingClientRect();L.current={childIndex:hr,offset:va.top-ne.top}}else L.current=null}n(yt)},[n]);E.useLayoutEffect(()=>{const yt=L.current;if(!yt)return;L.current=null;const Bt=H.current;if(!Bt)return;const ne=Bt.querySelector("[data-theme]")?.children[yt.childIndex];if(!ne)return;const Pe=Bt.getBoundingClientRect(),Ps=ne.getBoundingClientRect().top-Pe.top;Bt.scrollTop+=Ps-yt.offset});const{isTocPinned:bt,closeToc:Te}=G,Ve=E.useCallback((yt,Bt)=>{if(bt||Te(),T?.(yt,Bt)===!0)return;Bt.preventDefault();const ne=H.current?.querySelector(`#${CSS.escape(yt.id)}`)??document.getElementById(yt.id);ne&&(y3(ne),ne.tabIndex<0&&!ne.hasAttribute("tabindex")&&ne.setAttribute("tabindex","-1"),ne.scrollIntoView({behavior:m3()?"instant":"smooth",block:"start"}),ne.focus({preventScroll:!0}))},[Te,bt,T]),Wr=E.useMemo(()=>l.find(Bt=>Bt.name===a)?.className??"markdown-body",[l,a]),Ie=e?.headings??[],Ze=!(i||r),J=Ze&&e!==null,mt=Ze&&e===null&&t!==null,Ot=J&&d&&Ie.length>0,ae=J&&f,Di=(J||mt)&&u&&typeof h=="function"&&(p!==void 0||m!==void 0),Is=E.useMemo(()=>w.jsx(fx,{headings:Ie,className:"text-sm",labelledBy:X,onHeadingSelect:Ve,headingHref:B}),[Ie,X,Ve,B]),Ke=D===void 0?cl:`${A}px`,Q=E.useMemo(()=>Ke===cl?l3:Cx(Ke),[Ke]),gt=Ot||ae||Di?w.jsxs("div",{ref:N,"data-aqmd-toolbar":!0,style:Q,children:[w.jsx("span",{"data-aqmd-toolbar-inset-probe":!0,"aria-hidden":"true",style:h3}),Di&&h&&w.jsx(en,{menu:"align",Icon:Td[c].Icon,buttonLabel:q.selectAlignAria,titleLabel:q.alignTitle,pinLabel:q.pinAlignAria,unpinLabel:q.unpinAlignAria,isOpen:G.isAlignOpen,isPinned:G.isAlignPinned,isFront:G.lastActiveMenu==="align",onActivate:G.activateAlign,onToggle:G.toggleAlign,onClose:G.closeAlign,onPinToggle:G.togglePinAlign,popoverClassName:"w-48 p-2",scrollBarClearance:Ke,boundary:U,renderBody:yt=>w.jsx("div",{className:"space-y-1",children:qi.CONTENT_ALIGNS.map(Bt=>{const{labelKey:pe,Icon:ne}=Td[Bt],Pe=q[pe],hr=c===Bt;return w.jsxs("button",{type:"button","aria-pressed":hr,lang:Pe.lang,className:`flex min-h-11 w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors ${hr?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{h(Bt),yt()},children:[w.jsx(ne,{className:"h-4 w-4"}),Pe.text]},Bt)})})}),ae&&w.jsx(en,{menu:"style",Icon:Y5,buttonLabel:q.selectStyleAria,titleLabel:q.styleTitle,pinLabel:q.pinStyleAria,unpinLabel:q.unpinStyleAria,isOpen:G.isStyleOpen,isPinned:G.isStylePinned,isFront:G.lastActiveMenu==="style",onActivate:G.activateStyle,onToggle:G.toggleStyle,onClose:G.closeStyle,onPinToggle:G.togglePinStyle,popoverClassName:"w-48 p-2",scrollBarClearance:Ke,boundary:U,renderBody:yt=>w.jsx("div",{className:"space-y-1",children:l.map(Bt=>{const pe=a===Bt.name;return w.jsx("button",{type:"button","aria-pressed":pe,className:`min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${pe?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{_t(Bt.name),yt()},children:Bt.name},Bt.name)})})}),Ot&&w.jsx(en,{menu:"toc",Icon:W5,buttonLabel:q.openTocAria,titleLabel:q.tocTitle,titleId:X,pinLabel:q.pinTocAria,unpinLabel:q.unpinTocAria,isOpen:G.isTocOpen,isPinned:G.isTocPinned,isFront:G.lastActiveMenu==="toc",onActivate:G.activateToc,onToggle:G.toggleToc,onClose:G.closeToc,onPinToggle:G.togglePinToc,popoverClassName:"markdown-viewer-scrollbar-thin w-64 p-4",scrollBarClearance:Ke,boundary:U,renderBody:()=>Is})]}):null,kt=()=>i?w.jsxs("p",{children:[w.jsx("span",{"aria-hidden":"true",children:"🌀"})," ",w.jsx("span",{lang:q.loading.lang,children:q.loading.text})]}):r?w.jsx(C3,{error:r,labels:q}):e?w.jsx("div",{className:"relative w-full min-w-0",children:w.jsx(x3,{parseResult:e,theme:o,styleClassName:Wr,iFrameAllowedDomains:x,embeds:Mt,embedLabels:se,linkComponent:S,missingImageLabel:q.missingImage.text,mermaidLabels:K,spreadsheetEditor:ut,spreadsheetLocale:O,spreadsheetLabels:Z,onMathDiagnostics:jt})}):t!==null?w.jsx("pre",{className:"whitespace-pre-wrap break-all",children:t}):w.jsx("p",{lang:Pt.lang,children:Pt.text}),Yt={containerType:"inline-size",paddingInline:`${ge}px`,paddingBlockEnd:`${ge}px`,paddingBlockStart:`calc(${ge}px + var(${tn}))`,scrollPaddingBlockStart:`var(${tn})`,[tn]:`${Re}px`};return w.jsxs(Md,{scrollerRef:M,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:Yt},renderScrollBar:D,onBarInlineSizeChange:z,children:[gt,w.jsx("div",{ref:R,"data-aqmd-content":!0,style:{width:p??a3,maxWidth:m,marginInline:n3(c)},children:kt()})]})}const kx=({node:e})=>w.jsx("del",{children:w.jsx(zt,{nodes:e.children})}),wx=({node:e})=>w.jsx("em",{children:w.jsx(zt,{nodes:e.children})}),Sx=({node:e})=>w.jsx("sup",{children:w.jsxs("a",{id:`fnref-${e.identifier}`,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",href:`#fn-${e.identifier}`,children:["[",e.identifier,"]"]})}),k3=({nodes:e,theme:t="light"})=>e.length===0?null:w.jsx("section",{className:"border-[#171717] border-t pt-4 dark:border-[#464646]",children:w.jsx("ol",{className:"pl-6 text-[#686868] text-sm dark:text-[#a4a5a9]",children:e.map((r,i)=>w.jsx("li",{id:`fn-${r.identifier}`,className:i===0?"":"mt-4",children:w.jsx(zt,{nodes:r.children,theme:t})},`mdast-node-fn-${r.identifier}-${i}`))})}),vx=({node:e})=>w.jsx("a",{href:e.url,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",children:"↩"}),w3=e=>e.replace(/<rt\b[^>]*>[\s\S]*?<\/rt>/gi,"").replace(/<rp\b[^>]*>[\s\S]*?<\/rp>/gi,"").replace(/<[^>]+>/g,"").replace(/&nbsp;/gi," ").replace(/&amp;/gi,"&").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#39;/gi,"'").replace(/&#(\d+);/g,(s,o)=>{const a=Number(o);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/&#x([0-9a-f]+);/gi,(s,o)=>{const a=Number.parseInt(o,16);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/\s+/g," ").trim(),Tx=e=>{const t=r=>{if(!r||typeof r!="object")return"";if("type"in r&&r.type==="html"){const i=r.value;return typeof i=="string"?w3(i):""}if("value"in r){const i=r.value;if(typeof i=="string")return i}return"children"in r&&Array.isArray(r.children)?r.children.map(i=>t(i)).join(""):""};return e.map(r=>t(r)).join("").replace(/\s+/g," ").trim()},S3=e=>{switch(e){case 1:return"border-b-2 border-gray-300 pb-2 text-3xl font-bold dark:border-gray-600 dark:text-gray-100";case 2:return"border-b border-gray-300 pb-2 text-2xl font-semibold dark:border-gray-600 dark:text-gray-200";case 3:return"text-xl font-semibold dark:text-gray-300";default:return"text-lg font-medium dark:text-gray-400"}},_x=({node:e})=>{const t=new Gx,r=`h${e.depth}`,i=e.data?.hProperties?.id,s=t.slug(Tx(e.children));return w.jsx(r,{id:i||s,className:S3(e.depth),children:w.jsx(zt,{nodes:e.children})})},v3=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==!1).map(([t,r])=>[t,r===!0?"":String(r)])),T3=({node:e,theme:t,iFrameAllowedDomains:r=[]})=>{const i=w.jsx(zt,{nodes:e.children,theme:t,iFrameAllowedDomains:r}),s=fl(e.data.tagName,v3(e.data.properties),{parentName:null,iFrameAllowedDomains:r});if(s.action==="unwrap")return i;if(s.action!=="keep"&&s.action!=="placeholder")return null;const o=e.data.tagName.toLowerCase();return w.jsx(o,{...Tt.attributesToProps(s.attributes,e.data.tagName.toLowerCase()),children:i})},_3=/^\s*<(address|article|aside|blockquote|details|dialog|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h[1-6]|header|hgroup|hr|li|main|nav|ol|p|pre|section|table|ul)/i,B3=({node:e,iFrameAllowedDomains:t=[]})=>{const r=Tt(e.value,cx({iFrameAllowedDomains:t,embedLabels:Kx}));return Array.isArray(r)&&r.length===0?null:_3.test(e.value)?w.jsx("div",{children:r}):w.jsx("span",{children:r})},Bx=({node:e})=>{if(!e.url||e.url.trim()===""||!Es(e.url))return null;const t=e.title??"",r=e.data?.hProperties?.width,i=e.data?.hProperties?.height;return w.jsxs("span",{style:{width:r,height:i},className:"mt-4 mb-4 inline-block w-fit max-w-full",children:[w.jsx("img",{src:e.url,alt:e.alt??"",className:"mx-auto h-full w-full",width:r,height:i}),t&&w.jsx("em",{className:"block text-center text-gray-400 text-xs",children:t})]})},Lx=({node:e})=>w.jsx("code",{className:"rounded-md bg-gray-200 px-1.5 py-1 font-mono text-gray-800 text-sm dark:bg-gray-700 dark:text-gray-200",children:e.value}),L3=({node:e})=>{const t=ax(e.value,!1),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return t.kind==="rendered"?w.jsx("span",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):w.jsx("span",{className:r,children:t.message})},E3=new RegExp(`<(?:${[...Lh].join("|")})(?=[\\s/>])`,"i"),Ex=e=>e.some(t=>t.type==="image"||t.type==="imageReference"||t.type==="html"&&typeof t.value=="string"&&E3.test(t.value)||t.children!==void 0&&Ex(t.children)),Fx=({node:e})=>{const t=Es(e.url)?e.url:void 0,r=t!==void 0&&nx(t);return w.jsx("a",{className:lx(void 0,Ex(e.children)),href:t,target:r?"_blank":void 0,rel:r?"noreferrer":void 0,children:w.jsx(zt,{nodes:e.children})})},Ax=({node:e})=>e.children.length===1&&e.children[0].type==="paragraph"?w.jsx("li",{children:w.jsx(zt,{nodes:e.children[0].children})}):w.jsx("li",{children:w.jsx(zt,{nodes:e.children})}),Mx=({node:e})=>{const t=e.ordered?"ol":"ul";return w.jsx(t,{children:w.jsx(zt,{nodes:e.children})})},F3=({node:e})=>w.jsx("mark",{children:w.jsx(zt,{nodes:e.children})}),$x=({node:e})=>w.jsx("p",{children:w.jsx(zt,{nodes:e.children})}),Ox=({node:e})=>w.jsx("strong",{children:w.jsx(zt,{nodes:e.children})}),A3=({node:e})=>w.jsx("sub",{children:w.jsx(zt,{nodes:e.children})}),M3=({node:e})=>w.jsx("sup",{children:w.jsx(zt,{nodes:e.children})}),Bd=e=>{const t=e.data?.hProperties;return{merged:t?.merged??!1,colSpan:t?.colSpan,rowSpan:t?.rowSpan,textAlign:t?.textAlign}},Rx=({node:e})=>{const[t,...r]=e.children;return w.jsx("div",{className:"overflow-x-auto",children:w.jsxs("table",{className:"w-full border-collapse border-none",children:[w.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:w.jsx("tr",{children:t.children.map((i,s)=>{const{merged:o,colSpan:a,rowSpan:n,textAlign:l}=Bd(i);return o?null:w.jsx("th",{colSpan:a,rowSpan:n,style:{textAlign:l??e.align?.[s]??void 0},className:"border border-gray-300 px-4 py-2 text-left font-semibold dark:border-gray-600 dark:text-gray-200",children:w.jsx(zt,{nodes:i.children})},`mdast-table-node-${e.type}-${s}`)})})}),w.jsx("tbody",{children:r.map((i,s)=>w.jsx("tr",{className:"border-gray-200 border-t bg-white dark:border-gray-700 dark:bg-gray-900",children:i.children.map((o,a)=>{const{merged:n,colSpan:l,rowSpan:c,textAlign:h}=Bd(o);return n?null:w.jsx("td",{colSpan:l,rowSpan:c,style:{textAlign:h??e.align?.[a]??void 0},className:"border border-gray-300 px-4 py-2 dark:border-gray-600 dark:text-gray-300",children:w.jsx(zt,{nodes:o.children})},`mdast-table-node-${e.type}-${a}`)})},`mdast-table-node-${e.type}-${s}`))})]})})},Ix=({node:e})=>w.jsx(w.Fragment,{children:e.value}),Px=()=>w.jsx("hr",{className:"border-gray-300 dark:border-gray-600"}),Dx=({node:e})=>{const t=e.data?.title||"";return w.jsxs("details",{className:"markdown-details",children:[w.jsx("summary",{children:t}),w.jsx("div",{className:"markdown-details-content",children:w.jsx(zt,{nodes:e.children})})]})},Nx=({node:e})=>{const r=["message",e.data?.messageType||"message"].filter(Boolean).join(" ");return w.jsxs("aside",{className:r,children:[w.jsx("span",{className:"message-symbol",style:{userSelect:"none"},children:"!"}),w.jsx("div",{className:"message-content",children:w.jsx(zt,{nodes:e.children})})]})},zt=({nodes:e,theme:t="light",iFrameAllowedDomains:r=[]})=>e.map((i,s)=>{switch(i.type){case"blockquote":return w.jsx(qx,{node:i},`mdast-node-${i.type}-${s}`);case"break":return w.jsx("br",{},`mdast-node-${i.type}-${s}`);case"code":return w.jsx(Bh,{node:i,theme:t},`mdast-node-${i.type}-${s}`);case"delete":return w.jsx(kx,{node:i},`mdast-node-${i.type}-${s}`);case"details":return w.jsx(Dx,{node:i},`mdast-node-${i.type}-${s}`);case"emphasis":return w.jsx(wx,{node:i},`mdast-node-${i.type}-${s}`);case"footnoteReference":return w.jsx(Sx,{node:i},`mdast-node-${i.type}-${s}`);case"footnoteDefinition":return null;case"footnote-back-link":return w.jsx(vx,{node:i},`mdast-node-${i.type}-${s}`);case"heading":return w.jsx(_x,{node:i},`mdast-node-${i.type}-${s}`);case"html":return w.jsx(B3,{node:i,iFrameAllowedDomains:r},`mdast-node-${i.type}-${s}`);case"html-block-container":{const o=i,a=`mdast-node-${o.type}-${o.position?.start?.offset??"na"}-${o.position?.end?.offset??"na"}`;return w.jsx(T3,{node:o,theme:t,iFrameAllowedDomains:r},a)}case"image":return w.jsx(Bx,{node:i},`mdast-node-${i.type}-${s}`);case"inlineCode":return w.jsx(Lx,{node:i},`mdast-node-${i.type}-${s}`);case"inlineMath":return w.jsx(L3,{node:i},`mdast-node-${i.type}-${s}`);case"link":return w.jsx(Fx,{node:i},`mdast-node-${i.type}-${s}`);case"listItem":return w.jsx(Ax,{node:i},`mdast-node-${i.type}-${s}`);case"list":return w.jsx(Mx,{node:i},`mdast-node-${i.type}-${s}`);case"mark":return w.jsx(F3,{node:i},`mdast-node-${i.type}-${s}`);case"math":return w.jsx(r5,{node:i},`mdast-node-${i.type}-${s}`);case"message":return w.jsx(Nx,{node:i},`mdast-node-${i.type}-${s}`);case"paragraph":return w.jsx($x,{node:i},`mdast-node-${i.type}-${s}`);case"strong":return w.jsx(Ox,{node:i},`mdast-node-${i.type}-${s}`);case"subscript":return w.jsx(A3,{node:i},`mdast-node-${i.type}-${s}`);case"superscript":return w.jsx(M3,{node:i},`mdast-node-${i.type}-${s}`);case"table":return w.jsx(Rx,{node:i},`mdast-node-${i.type}-${s}`);case"text":return w.jsx(Ix,{node:i},`mdast-node-${i.type}-${s}`);case"thematicBreak":return w.jsx(Px,{},`mdast-node-${i.type}-${s}`);case"yaml":return null;default:{if(process.env.NODE_ENV==="development")return w.jsxs("div",{children:[w.jsxs("p",{style:{color:"red"},children:["Unknown node type: ",i.type]}),w.jsx("pre",{children:JSON.stringify(i,null,2)})]},`mdast-node-${i.type}-${s}`);throw new Error(`Unknown node type: ${i.type}`)}}}),qx=({node:e})=>w.jsx("blockquote",{className:"my-4 border-gray-300 border-l-4 bg-gray-50 p-4 italic dark:border-gray-500 dark:bg-gray-800 dark:text-gray-300",children:w.jsx(zt,{nodes:e.children})}),$3=/\s*\{#(.+?)\}\s*$/,O3=()=>e=>{ye.visit(e,"heading",t=>{if(t.children.length===0)return;const r=t.children[t.children.length-1];if(r?.type!=="text")return;const i=r,s=i.value.match($3);if(s){const o=s[1];t.data||(t.data={});const a=t.data,n=a.hProperties||{};n.id=o,a.hProperties=n,i.value=i.value.substring(0,s.index).trimEnd(),i.value===""&&t.children.pop()}})},R3=()=>e=>{ye.visit(e,"footnoteDefinition",t=>{ye.visit(t,"paragraph",r=>{r.children.push({type:"footnote-back-link",url:`#fnref-${t.identifier}`})})})},I3=()=>e=>{ye.visit(e,"html",(t,r,i)=>{if(typeof r!="number"||!i)return;const o=t.value.trim().match(/^<a\s+href="([^"]+)"[^>]*>(.*?)<\/a>$/i);if(o){const[,a,n]=o,l={type:"link",url:a,children:[{type:"text",value:n}]};i.children.splice(r,1,l)}})},P3=()=>e=>{const t=r=>{const i=r.children;if(!i)return;let s=0;for(;s<i.length;){const o=i[s];if(o.type==="html"&&o.value.startsWith("<")&&!o.value.startsWith("</")&&o.value.match(/<([a-zA-Z0-9]+)/)){let n="",l=0;const c=[];let h=!1;for(let d=s;d<i.length;d++){const f=i[d];if(f.type==="html"){n+=f.value;const u=f.value.match(/<\/?([a-zA-Z0-9]+)/g)||[];for(const p of u){const m=p.match(/<\/?([a-zA-Z0-9]+)/);if(!m)continue;const y=m[1];p.startsWith("</")?c.length>0&&c[c.length-1]===y&&c.pop():p.startsWith("<")&&c.push(y)}}else if(f.type==="text")n+=f.value;else{c.length===0&&(h=!0);break}if(l++,c.length===0){h=!0;break}}h&&i.splice(s,l,{type:"html",value:n})}s++}};ye.visit(e,"paragraph",t),ye.visit(e,"tableCell",t),ye.visit(e,"heading",t),ye.visit(e,"emphasis",t),ye.visit(e,"strong",t),ye.visit(e,"delete",t)},Ld=/\s*=\s*(\d+)(w|h|x|y)\s*/g,D3=()=>e=>{ye.visit(e,"image",t=>{const r=l=>{if(!l)return{updatedText:l,matches:[]};const c=[...l.matchAll(Ld)];return{updatedText:l.replaceAll(Ld,"").trim(),matches:c}},{updatedText:i,matches:s}=r(t.alt);t.alt=i;const{updatedText:o,matches:a}=r(t.title);t.title=o||null;const n=[...s,...a];if(n.length>0){t.data||(t.data={}),t.data.hProperties||(t.data.hProperties={});for(const l of n){const c=Number.parseInt(l[1],10),h=l[2];h==="w"||h==="x"?t.data.hProperties.width=c:(h==="h"||h==="y")&&(t.data.hProperties.height=c)}}})},N3=()=>e=>{ye.visit(e,(t,r,i)=>{i&&Object.defineProperty(t,"parent",{value:i,writable:!0,configurable:!0,enumerable:!1})})},Ed=/^:::(message|details)\s*(.*)/,q3=()=>e=>{function t(r){const i=[];let s=0;for(;s<r.length;){const o=r[s];if(o.type==="paragraph"&&o.children[0]?.type==="text"&&o.children[0].value.trim().startsWith(":::")){const l=o.children[0].value.trim().match(Ed);if(l){const c=s;let h=-1,d=1;const f=o.children.at(-1);if(o.children.length>1&&f?.type==="text"&&f.value.trim()===":::")h=c;else for(let u=c+1;u<r.length;u++){const p=r[u];if(p.type==="paragraph"&&p.children[0]?.type==="text"){const m=p.children[0].value.trim();Ed.test(m)?d++:m===":::"&&d--}if(d===0){h=u;break}}if(h!==-1){const u=l[1],p=l[2];let m;if(h===c){const C=o.children.slice(1,-1);C[0]?.type==="break"&&C.shift(),C.at(-1)?.type==="break"&&C.pop(),m=C.length>0?[{type:"paragraph",children:C}]:[]}else{const C=o.children.slice(1);C[0]?.type==="break"&&C.shift();const k={type:"paragraph",children:C},S=r[h].children.slice(0,-1);S.at(-1)?.type==="break"&&S.pop();const T={type:"paragraph",children:S},B=r.slice(c+1,h);m=[k,...B,T].filter(_=>!(_.type==="paragraph"&&_.children.length===0))}const y=t(m);let x;if(u==="message"?x={type:"message",data:{messageType:p.trim()},children:y}:u==="details"&&(x={type:"details",data:{title:p.trim()},children:y}),x){i.push(x),s=h+1;continue}}}}const a={...o};"children"in a&&Array.isArray(a.children)&&(a.type==="blockquote"||a.type==="footnoteDefinition"||a.type==="message"||a.type==="details"?a.children=t(a.children):a.type==="list"&&(a.children=a.children.map(n=>({...n,children:t(n.children)})))),i.push(a),s++}return i}e.children=t(e.children)},z3=e=>{const t=[];return ye.visit(e,"heading",r=>{const i=Tx(r.children),s=r.data?.hProperties?.id;s&&i&&t.push({depth:r.depth,text:i,id:s})}),t};exports.BlockquoteNode=qx;exports.CodeNode=Bh;exports.Color=Me;exports.Color$1=Mi;exports.DEFAULT_MARKDOWN_EMBED_LABELS=Zx;exports.DEFAULT_MARKDOWN_VIEWER_LABELS=J5;exports.DEFAULT_MERMAID_DIAGRAM_LABELS=RA;exports.DEFAULT_MERMAID_INTERACTION=K0;exports.DeleteNode=kx;exports.EmphasisNode=wx;exports.FootnoteBackLinkNode=vx;exports.FootnoteReferenceNode=Sx;exports.FootnotesSection=k3;exports.HeadingNode=_x;exports.HostedScrollArea=Md;exports.ImageNode=Bx;exports.InlineCodeNode=Lx;exports.JSON_SCHEMA=Kg;exports.LinkNode=Fx;exports.ListItemNode=Ax;exports.ListNode=Mx;exports.MarkdownRenderer=ux;exports.MarkdownViewer=b3;exports.MermaidDiagram=Th;exports.NodesRenderer=zt;exports.ParagraphNode=$x;exports.Rgb=le;exports.SPREADSHEET_BLOCK_LABEL_CATALOGS=Ls;exports.SpreadsheetBlock=_h;exports.StrongNode=Ox;exports.TableNode=Rx;exports.TableOfContents=fx;exports.TextNode=Ix;exports.ThematicBreakNode=Px;exports.Utils=ft;exports.ZERO_WIDTH_SPACE=bp;exports.ZennDetailsNode=Dx;exports.ZennMessageNode=Nx;exports.__export=jd;exports.__name=g;exports.abs=eS;exports.acos=hS;exports.adjustChannel=ml;exports.argumentsTag=Zl;exports.array=Hu;exports.arrayBufferTag=np;exports.arrayTag=ap;exports.asin=cS;exports.assignWithDepth_default=qt;exports.at=it;exports.atan2=rS;exports.booleanTag=Vl;exports.calculateMathMLDimensions=Bk;exports.calculateTextDimensions=da;exports.calculateTextHeight=ih;exports.calculateTextWidth=He;exports.cleanAndMerge=ua;exports.clear=lu;exports.clear$1=sB;exports.clear$2=A_;exports.clear2=Q_;exports.color=Si;exports.commonDb_exports=kl;exports.common_default=Ai;exports.computeDimensionOfText=sm;exports.computeLabelTransform=Zr;exports.configureLabelImages=oh;exports.configureSvgSize=bl;exports.constant=Tr;exports.constant$1=ea;exports.cos=iS;exports.createText=Oe;exports.curveBasis=Lo;exports.darken=W;exports.dataViewTag=hp;exports.dateTag=ip;exports.dayjs2=Wd;exports.decodeEntities=yr;exports.defaultConfig2=Ik;exports.defaultConfig_default=yl;exports.define=ta;exports.distExports=Jg;exports.edgeLabels=Ts;exports.epsilon=Sn;exports.extend=El;exports.extractHeadings=z3;exports.float32ArrayTag=yp;exports.float64ArrayTag=xp;exports.generateId=_p;exports.getAccDescription=uu;exports.getAccTitle=cu;exports.getConfig=At;exports.getConfig2=wt;exports.getDefaultExportFromCjs=Ad;exports.getDiagramTitle=gu;exports.getEdgeId=rT;exports.getEffectiveHtmlLabels=ee;exports.getIconSVG=Oi;exports.getLineFunctionsWithOffset=Iy;exports.getRegisteredLayoutAlgorithm=PB;exports.getStylesFromArray=rh;exports.getSubGraphTitleMargins=fa;exports.getTag=ha;exports.getThemeVariables3=Yd;exports.getUrl=au;exports.getUserDefinedConfig=gk;exports.halfPi=vn;exports.hasKatex=ki;exports.hue=M2;exports.insertCluster=pm;exports.insertEdge=qy;exports.insertEdgeLabel=Py;exports.insertNode=bh;exports.int16ArrayTag=pp;exports.int32ArrayTag=mp;exports.int8ArrayTag=gp;exports.interpolateNumber=rr;exports.interpolateRgb=pn;exports.interpolateString=Mu;exports.isDark=ve;exports.isLabelStyle=Ul;exports.isPrimitive=ca;exports.isTypedArray=us;exports.isValidShape=Ry;exports.lighten=j;exports.line=Uu;exports.lineBreakRegex=Fi;exports.load=Qg;exports.log=V;exports.mapTag=sp;exports.markerOffsets=Kt;exports.markers_default=Wy;exports.max=sS;exports.min=oS;exports.nogamma=Fl;exports.numberTag=Gl;exports.objectTag=lp;exports.parseFontSize=$s;exports.parseGenericTypes=ln;exports.pi=sa;exports.positionEdgeLabel=Dy;exports.positionNode=J_;exports.random=Lp;exports.regexpTag=ep;exports.registerIconPacks=Op;exports.remarkCustomHeadingId=O3;exports.remarkFootnoteBackLink=R3;exports.remarkHtmlAnchorToLink=I3;exports.remarkHtmlInHtml=P3;exports.remarkImageSize=D3;exports.remarkParentNode=N3;exports.remarkZennMessage=q3;exports.render=IB;exports.renderKatexSanitized=Cl;exports.rgbConvert=Eu;exports.rgba=ir;exports.sanitizeText=we;exports.select=pt;exports.selectSvgElement=pf;exports.setAccDescription=du;exports.setAccTitle=hu;exports.setConfig2=Rk;exports.setDiagramTitle=fu;exports.setNodeElem=K_;exports.setTag=op;exports.setupGraphViewbox=nu;exports.setupGraphViewbox2=pu;exports.sin=aS;exports.sqrt=nS;exports.stringTag=Xl;exports.styles2String=st;exports.symbolTag=rp;exports.tau=lS;exports.terminalLabels=Ut;exports.uint16ArrayTag=up;exports.uint32ArrayTag=fp;exports.uint8ArrayTag=cp;exports.uint8ClampedArrayTag=dp;exports.unknownIcon=Mp;exports.updateNodeBounds=ot;exports.useMarkdownToolbarState=bx;exports.utils_default=ke;exports.withPath=Wu;exports.wrapLabel=Ep;