@aiquants/markdown 11.6.2 → 11.6.3

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 (119) hide show
  1. package/README.md +1 -1
  2. package/dist/{abnfDiagram-VRR7QNED-DxRZdLos.cjs → abnfDiagram-VRR7QNED-CrFrQUYr.cjs} +1 -1
  3. package/dist/{abnfDiagram-VRR7QNED-BxoYLblG.js → abnfDiagram-VRR7QNED-KhILPScn.js} +3 -3
  4. package/dist/{arc-CpcEBiVP.js → arc-C7tFL8sz.js} +1 -1
  5. package/dist/{arc-DPOm7M88.cjs → arc-nJjPSMMh.cjs} +1 -1
  6. package/dist/{architectureDiagram-ZJ3FMSHR-BqXA6xEy.js → architectureDiagram-ZJ3FMSHR-Bn5AeAiO.js} +2 -2
  7. package/dist/{architectureDiagram-ZJ3FMSHR-DSxM5fz-.cjs → architectureDiagram-ZJ3FMSHR-BpazTxWP.cjs} +1 -1
  8. package/dist/{blockDiagram-677ZJIJ3-B6R2sEZy.js → blockDiagram-677ZJIJ3-DIcVDikR.js} +3 -3
  9. package/dist/{blockDiagram-677ZJIJ3-D3S0NzDN.cjs → blockDiagram-677ZJIJ3-d__rtf-H.cjs} +1 -1
  10. package/dist/{c4Diagram-LMCZKHZV-B1aKWPmK.cjs → c4Diagram-LMCZKHZV-BLsyyMwv.cjs} +1 -1
  11. package/dist/{c4Diagram-LMCZKHZV-CK8-EQJi.js → c4Diagram-LMCZKHZV-CORtnDqv.js} +2 -2
  12. package/dist/{channel-8ENRM7U_.js → channel-Dqcn6_8u.js} +1 -1
  13. package/dist/{channel-DgfX8PtR.cjs → channel-qsWxsZV0.cjs} +1 -1
  14. package/dist/{chunk-2Q5K7J3B-5ByHiOwA.js → chunk-2Q5K7J3B-B82YBixL.js} +1 -1
  15. package/dist/{chunk-2Q5K7J3B-tSX9f5fU.cjs → chunk-2Q5K7J3B-DPp7JZGP.cjs} +1 -1
  16. package/dist/{chunk-32BRIVSS-DUTrdpJh.js → chunk-32BRIVSS-C5p_imjz.js} +1 -1
  17. package/dist/{chunk-32BRIVSS-CFjN16oR.cjs → chunk-32BRIVSS-D7R0a16m.cjs} +1 -1
  18. package/dist/{chunk-5VM5RSS4-CwW6aXM0.cjs → chunk-5VM5RSS4-CenBZfC-.cjs} +1 -1
  19. package/dist/{chunk-5VM5RSS4-CnX7fno_.js → chunk-5VM5RSS4-D_yaVSbR.js} +1 -1
  20. package/dist/{chunk-EX3LRPZG-CRzNzAXh.cjs → chunk-EX3LRPZG-BAjQ2zSX.cjs} +1 -1
  21. package/dist/{chunk-EX3LRPZG-C-69aUM9.js → chunk-EX3LRPZG-BfkRBnj0.js} +4 -4
  22. package/dist/{chunk-JWPE2WC7-DrR-VmWv.js → chunk-JWPE2WC7-B8rCyQFQ.js} +1 -1
  23. package/dist/{chunk-JWPE2WC7-fhBE0DFW.cjs → chunk-JWPE2WC7-BZ-2EWLU.cjs} +1 -1
  24. package/dist/{chunk-MOJQB5TN-TQ1Ymr_8.cjs → chunk-MOJQB5TN-BTRgB-C9.cjs} +1 -1
  25. package/dist/{chunk-MOJQB5TN-CAR8MmXh.js → chunk-MOJQB5TN-BVSQLGYz.js} +1 -1
  26. package/dist/{chunk-PUDLZKDR-DAF6xfgx.cjs → chunk-PUDLZKDR-D_RZQ-2E.cjs} +1 -1
  27. package/dist/{chunk-PUDLZKDR--7cUva8z.js → chunk-PUDLZKDR-qsUiVwCW.js} +6 -6
  28. package/dist/{chunk-RYQCIY6F-CnTDB6Kv.js → chunk-RYQCIY6F-DO12sF41.js} +1 -1
  29. package/dist/{chunk-RYQCIY6F-DqTjQLFd.cjs → chunk-RYQCIY6F-eXI2g3KO.cjs} +1 -1
  30. package/dist/{chunk-V7JOEXUC-BIWZWFdo.js → chunk-V7JOEXUC-DY9LoEgF.js} +5 -5
  31. package/dist/{chunk-V7JOEXUC-DQplRVxs.cjs → chunk-V7JOEXUC-L8X21gc6.cjs} +1 -1
  32. package/dist/{chunk-VR4S4FIN-C7J0XpmK.cjs → chunk-VR4S4FIN-BYlm4Bma.cjs} +1 -1
  33. package/dist/{chunk-VR4S4FIN-DxzQqHlt.js → chunk-VR4S4FIN-BjF7GPyZ.js} +1 -1
  34. package/dist/{chunk-XXDRQBXY-DFQcLWWg.cjs → chunk-XXDRQBXY-B5hmsQ5v.cjs} +1 -1
  35. package/dist/{chunk-XXDRQBXY-CC75iZMQ.js → chunk-XXDRQBXY-BrEjcB-T.js} +1 -1
  36. package/dist/{classDiagram-v2-EOCWNBFH-CmXfJocx.js → classDiagram-OUVF2IWQ-BV8sx3KS.js} +2 -2
  37. package/dist/{classDiagram-OUVF2IWQ-Ddcj3Uwq.cjs → classDiagram-OUVF2IWQ-Bo6t0BIX.cjs} +1 -1
  38. package/dist/{classDiagram-OUVF2IWQ-CmXfJocx.js → classDiagram-v2-EOCWNBFH-BV8sx3KS.js} +2 -2
  39. package/dist/{classDiagram-v2-EOCWNBFH-Ddcj3Uwq.cjs → classDiagram-v2-EOCWNBFH-Bo6t0BIX.cjs} +1 -1
  40. package/dist/converter.wasm +0 -0
  41. package/dist/{cose-bilkent-JH36ORCC-Oumpy_6v.cjs → cose-bilkent-JH36ORCC-BI7gm8G_.cjs} +1 -1
  42. package/dist/{cose-bilkent-JH36ORCC-1tSd2kLT.js → cose-bilkent-JH36ORCC-D4ARhegJ.js} +1 -1
  43. package/dist/{cynefinDiagram-TSTJHNR4-BErSYG1e.js → cynefinDiagram-TSTJHNR4-DTS-4JZ9.js} +2 -2
  44. package/dist/{cynefinDiagram-TSTJHNR4-LQJGk5ym.cjs → cynefinDiagram-TSTJHNR4-DVVqTKf1.cjs} +1 -1
  45. package/dist/{dagre-VKFMJZFB-CuJfEe1q.js → dagre-VKFMJZFB-7k8Nnf83.js} +2 -2
  46. package/dist/{dagre-VKFMJZFB-CgElKLzH.cjs → dagre-VKFMJZFB-YrvW_orC.cjs} +1 -1
  47. package/dist/{diagram-FQU43EPY-DR5v2F0Z.js → diagram-FQU43EPY-C1FwASrz.js} +2 -2
  48. package/dist/{diagram-FQU43EPY-DDiF9qdI.cjs → diagram-FQU43EPY-ClHbrdQi.cjs} +1 -1
  49. package/dist/{diagram-G47NLZAW-xzoC80ba.cjs → diagram-G47NLZAW-CEb1NBAf.cjs} +1 -1
  50. package/dist/{diagram-G47NLZAW-C9Lb71YK.js → diagram-G47NLZAW-D97pQdCw.js} +3 -3
  51. package/dist/{diagram-NH7WQ7WH-87piaHyU.js → diagram-NH7WQ7WH-63FoTYLW.js} +2 -2
  52. package/dist/{diagram-NH7WQ7WH-C2N9NHLR.cjs → diagram-NH7WQ7WH-BckXpDNE.cjs} +1 -1
  53. package/dist/{diagram-OA4YK3LP-nSppDsyY.cjs → diagram-OA4YK3LP-BtOG48sk.cjs} +1 -1
  54. package/dist/{diagram-OA4YK3LP-B2a3T-QK.js → diagram-OA4YK3LP-CZqg1Y-L.js} +3 -3
  55. package/dist/{diagram-WEI45ONY-0KDl_dOI.cjs → diagram-WEI45ONY-DMGUqioc.cjs} +1 -1
  56. package/dist/{diagram-WEI45ONY-DEGrkn7x.js → diagram-WEI45ONY-_vFrEBfE.js} +2 -2
  57. package/dist/{ebnfDiagram-CCIWWBDH-BwNmJMnC.cjs → ebnfDiagram-CCIWWBDH-Bqb2uRyt.cjs} +1 -1
  58. package/dist/{ebnfDiagram-CCIWWBDH-CF-Hez--.js → ebnfDiagram-CCIWWBDH-Dks6Q1X0.js} +3 -3
  59. package/dist/{erDiagram-Q63AITRT-DOuoCFWQ.js → erDiagram-Q63AITRT-BW4Fld3c.js} +4 -4
  60. package/dist/{erDiagram-Q63AITRT-JQ8mB_gP.cjs → erDiagram-Q63AITRT-C0ZPB7kS.cjs} +1 -1
  61. package/dist/{extractHeadings-Bq6RQBHu.js → extractHeadings-B8l_221i.js} +1358 -1347
  62. package/dist/{extractHeadings-DMlRu-i3.cjs → extractHeadings-mY43a--Q.cjs} +42 -42
  63. package/dist/flowDiagram-23GEKE2U-BG5-LciC.cjs +1 -0
  64. package/dist/flowDiagram-23GEKE2U-Bm8540P4.js +7 -0
  65. package/dist/{ganttDiagram-NO4QXBWP-NCQuQN5D.cjs → ganttDiagram-NO4QXBWP-CzxFCHSR.cjs} +1 -1
  66. package/dist/{ganttDiagram-NO4QXBWP-CFbmGZ6S.js → ganttDiagram-NO4QXBWP-DrBlybjH.js} +2 -2
  67. package/dist/{gitGraphDiagram-IHSO6WYX-DgU3_Ajk.cjs → gitGraphDiagram-IHSO6WYX-7JPlb-y9.cjs} +1 -1
  68. package/dist/{gitGraphDiagram-IHSO6WYX-94ecFvIT.js → gitGraphDiagram-IHSO6WYX-CKpx3wIX.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-CiC8yXhC.js → infoDiagram-FWYZ7A6U-15zCDsh7.js} +1 -1
  74. package/dist/{infoDiagram-FWYZ7A6U-CuBWdwjx.cjs → infoDiagram-FWYZ7A6U-DMqDp--E.cjs} +1 -1
  75. package/dist/{ishikawaDiagram-FXEZZL3T-C6Z1R3N-.js → ishikawaDiagram-FXEZZL3T-CezgZv0d.js} +1 -1
  76. package/dist/{ishikawaDiagram-FXEZZL3T-D4RXTdAU.cjs → ishikawaDiagram-FXEZZL3T-CwIryjOh.cjs} +1 -1
  77. package/dist/{journeyDiagram-5HDEW3XC-_vCflT7D.js → journeyDiagram-5HDEW3XC-BXfhi1qj.js} +4 -4
  78. package/dist/{journeyDiagram-5HDEW3XC-mv3tRB15.cjs → journeyDiagram-5HDEW3XC-D3_iIUiI.cjs} +1 -1
  79. package/dist/{kanban-definition-HUTT4EX6-2CVqb3WV.cjs → kanban-definition-HUTT4EX6-C9b9Hl4U.cjs} +1 -1
  80. package/dist/{kanban-definition-HUTT4EX6-d6Fue9SI.js → kanban-definition-HUTT4EX6-JO473DFK.js} +2 -2
  81. package/dist/{linear-CZ-0zX9A.js → linear-CCTZmAyd.js} +1 -1
  82. package/dist/{linear-wGZBDJV5.cjs → linear-Czez_zjV.cjs} +1 -1
  83. package/dist/{mindmap-definition-LN4V7U3C-CvPFKbRb.js → mindmap-definition-LN4V7U3C-BaUE2FNV.js} +3 -3
  84. package/dist/{mindmap-definition-LN4V7U3C-i_zSfuBJ.cjs → mindmap-definition-LN4V7U3C-CEr0yKcG.cjs} +1 -1
  85. package/dist/{pegDiagram-2B236MQR-B1P34Gkv.cjs → pegDiagram-2B236MQR-C2GMsOeZ.cjs} +1 -1
  86. package/dist/{pegDiagram-2B236MQR-DW92079M.js → pegDiagram-2B236MQR-CJOqtr-5.js} +3 -3
  87. package/dist/{pieDiagram-ENE6RG2P-BMtgLQuZ.js → pieDiagram-ENE6RG2P-BGtc5rg4.js} +3 -3
  88. package/dist/{pieDiagram-ENE6RG2P-DWodV_iM.cjs → pieDiagram-ENE6RG2P-BcogMjb6.cjs} +1 -1
  89. package/dist/{quadrantDiagram-ABIIQ3AL-DmzTM6g2.js → quadrantDiagram-ABIIQ3AL-BKvZITDU.js} +2 -2
  90. package/dist/{quadrantDiagram-ABIIQ3AL-DgGHlHJM.cjs → quadrantDiagram-ABIIQ3AL-C5WeORzB.cjs} +1 -1
  91. package/dist/{railroadDiagram-RFXS5EU6-DP0HnjDZ.js → railroadDiagram-RFXS5EU6-CRRT5_d6.js} +3 -3
  92. package/dist/{railroadDiagram-RFXS5EU6-vVH9AAWc.cjs → railroadDiagram-RFXS5EU6-QuwtKvjh.cjs} +1 -1
  93. package/dist/{requirementDiagram-TGXJPOKE-TQYdLBAs.cjs → requirementDiagram-TGXJPOKE-BRgQQrNj.cjs} +1 -1
  94. package/dist/{requirementDiagram-TGXJPOKE-DKTUI7CI.js → requirementDiagram-TGXJPOKE-vgr5gE8g.js} +3 -3
  95. package/dist/{sankeyDiagram-HTMAVEWB-CO5wc4-P.cjs → sankeyDiagram-HTMAVEWB-D6Es1Wm7.cjs} +1 -1
  96. package/dist/{sankeyDiagram-HTMAVEWB-BlYWTcCR.js → sankeyDiagram-HTMAVEWB-DgDkK9gc.js} +1 -1
  97. package/dist/{sequenceDiagram-DBY2YBRQ-Jk8ZVpEA.cjs → sequenceDiagram-DBY2YBRQ-8jQOuElB.cjs} +1 -1
  98. package/dist/{sequenceDiagram-DBY2YBRQ-D8OanHhC.js → sequenceDiagram-DBY2YBRQ-NvN1fPj0.js} +3 -3
  99. package/dist/{sizeCapture-X5ZJPWSS-D_3GOqqG.cjs → sizeCapture-X5ZJPWSS-CwxMDca9.cjs} +1 -1
  100. package/dist/{sizeCapture-X5ZJPWSS-2F01ERMJ.js → sizeCapture-X5ZJPWSS-D6aS7v6r.js} +1 -1
  101. package/dist/{stateDiagram-2N3HPSRC-DTzhZM4u.cjs → stateDiagram-2N3HPSRC-BspFNfXx.cjs} +1 -1
  102. package/dist/{stateDiagram-2N3HPSRC-Bax7OFZ-.js → stateDiagram-2N3HPSRC-p_Vz2smO.js} +2 -2
  103. package/dist/{stateDiagram-v2-6OUMAXLB-B_vcjsId.js → stateDiagram-v2-6OUMAXLB-B72uyXjy.js} +2 -2
  104. package/dist/{stateDiagram-v2-6OUMAXLB-DB994Mq0.cjs → stateDiagram-v2-6OUMAXLB-DI1f-TG_.cjs} +1 -1
  105. package/dist/{swimlanes-5IMT3BWC-DnJUaQXb.cjs → swimlanes-5IMT3BWC-CvZps5q1.cjs} +1 -1
  106. package/dist/{swimlanes-5IMT3BWC-BOFcVEL5.js → swimlanes-5IMT3BWC-uGUIMSL-.js} +3 -3
  107. package/dist/{swimlanesDiagram-G3AALYLV-D2TI6l_M.js → swimlanesDiagram-G3AALYLV-02us-Y45.js} +2 -2
  108. package/dist/{swimlanesDiagram-G3AALYLV-CkaRKbTf.cjs → swimlanesDiagram-G3AALYLV-C3BdWijK.cjs} +1 -1
  109. package/dist/{timeline-definition-FHXFAJF6-Bn0weCUA.js → timeline-definition-FHXFAJF6-BDUx5H8i.js} +2 -2
  110. package/dist/{timeline-definition-FHXFAJF6-BAUQCcsb.cjs → timeline-definition-FHXFAJF6-CzL3lw9x.cjs} +1 -1
  111. package/dist/{vennDiagram-L72KCM5P-C4mwLTzX.cjs → vennDiagram-L72KCM5P-C13bOAyh.cjs} +1 -1
  112. package/dist/{vennDiagram-L72KCM5P-U_ThRT92.js → vennDiagram-L72KCM5P-CNnwoatv.js} +1 -1
  113. package/dist/{wardleyDiagram-EHGQE667-a209zWox.js → wardleyDiagram-EHGQE667-CcgFzS0j.js} +2 -2
  114. package/dist/{wardleyDiagram-EHGQE667-7ABE1tnR.cjs → wardleyDiagram-EHGQE667-GK1emTpZ.cjs} +1 -1
  115. package/dist/{xychartDiagram-FW5EYKEG-dNt0UBQC.cjs → xychartDiagram-FW5EYKEG-CSOCykH7.cjs} +1 -1
  116. package/dist/{xychartDiagram-FW5EYKEG-DV1K5Km6.js → xychartDiagram-FW5EYKEG-DY1NVJlW.js} +2 -2
  117. package/package.json +9 -9
  118. package/dist/flowDiagram-23GEKE2U-65_ty-RL.cjs +0 -1
  119. package/dist/flowDiagram-23GEKE2U-Bafg06Pf.js +0 -7
@@ -1,11 +1,11 @@
1
- "use strict";var vC=Object.create;var Kh=Object.defineProperty;var TC=Object.getOwnPropertyDescriptor;var _C=Object.getOwnPropertyNames;var BC=Object.getPrototypeOf,LC=Object.prototype.hasOwnProperty;var EC=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _C(t))!LC.call(e,o)&&o!==r&&Kh(e,o,{get:()=>t[o],enumerable:!(i=TC(t,o))||i.enumerable});return e};var Zh=(e,t,r)=>(r=e!=null?vC(BC(e)):{},EC(t||!e||!e.__esModule?Kh(r,"default",{value:e,enumerable:!0}):r,e));const L=require("react"),We=require("./linkCards-Bjd_vW39.cjs"),jr=require("./providers-DO2t7ks4.cjs"),Qi=require("./viewer-settings.cjs"),St=require("html-react-parser"),It=require("./code-blocks-Cpo2S9jm.cjs"),mr=require("./embeds.cjs"),Mi=require("./source-lines.cjs"),wn=require("./simple-logger-9yf7ypyB.cjs"),Sn=require("shiki"),$i=require("dompurify"),oe=require("@aiquants/spreadsheet/view"),sa=require("@aiquants/spreadsheet/tsv"),FC=require("github-slugger"),AC=require("katex"),me=require("unist-util-visit"),Oi=(e,t)=>{const r={};for(const i of Object.keys(e)){const o=t?.[i];if(o===void 0){r[i]=e[i];continue}if(typeof o!="string")throw new TypeError(`[@aiquants/markdown] label "${i}" must be a string; got ${o===null?"null":typeof o}`);r[i]={text:o,lang:void 0}}return Object.freeze(r)},aa=e=>{const t={};for(const r of Object.keys(e))t[r]=e[r].text;return Object.freeze(t)},na=Object.freeze({embeddedVideo:{text:"embedded video",lang:"en"},embeddedPost:{text:"embedded post",lang:"en"},embeddedFrame:{text:"Embedded content",lang:"en"}}),MC=aa(na),cu=e=>Oi(na,e),$C=cu(void 0);function du(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Go={exports:{}},Ji={};var Qh;function OC(){if(Qh)return Ji;Qh=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var n in o)n!=="key"&&(s[n]=o[n])}else s=o;return o=s.ref,{$$typeof:e,type:i,key:a,ref:o!==void 0?o:null,props:s}}return Ji.Fragment=t,Ji.jsx=r,Ji.jsxs=r,Ji}var to={};var Jh;function RC(){return Jh||(Jh=1,process.env.NODE_ENV!=="production"&&(function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===P?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case y:return"Fragment";case C:return"Profiler";case x:return"StrictMode";case _:return"Suspense";case E:return"SuspenseList";case M:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case m:return"Portal";case S:return T.displayName||"Context";case w:return(T._context.displayName||"Context")+".Consumer";case v:var W=T.render;return T=T.displayName,T||(T=W.displayName||W.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case B:return W=T.displayName||null,W!==null?W:e(T.type)||"Memo";case D:W=T._payload,T=T._init;try{return e(T(W))}catch{}}return null}function t(T){return""+T}function r(T){try{t(T);var W=!1}catch{W=!0}if(W){W=console;var j=W.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return j.call(W,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),t(T)}}function i(T){if(T===y)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===D)return"<...>";try{var W=e(T);return W?"<"+W+">":"<...>"}catch{return"<...>"}}function o(){var T=U.A;return T===null?null:T.getOwner()}function s(){return Error("react-stack-top-frame")}function a(T){if(N.call(T,"key")){var W=Object.getOwnPropertyDescriptor(T,"key").get;if(W&&W.isReactWarning)return!1}return T.key!==void 0}function n(T,W){function j(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",W))}j.isReactWarning=!0,Object.defineProperty(T,"key",{get:j,configurable:!0})}function l(){var T=e(this.type);return O[T]||(O[T]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),T=this.props.ref,T!==void 0?T:null}function c(T,W,j,G,X,K){var Z=j.ref;return T={$$typeof:g,type:T,key:W,props:j,_owner:G},(Z!==void 0?Z:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:l}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function h(T,W,j,G,X,K){var Z=W.children;if(Z!==void 0)if(G)if(q(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(N.call(W,"key")){Z=e(T);var at=Object.keys(W).filter(function(ht){return ht!=="key"});G=0<at.length?"{key: someKey, "+at.join(": ..., ")+": ...}":"{key: someKey}",z[Z+G]||(at=0<at.length?"{"+at.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";var vC=Object.create;var Kh=Object.defineProperty;var TC=Object.getOwnPropertyDescriptor;var _C=Object.getOwnPropertyNames;var BC=Object.getPrototypeOf,LC=Object.prototype.hasOwnProperty;var EC=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _C(t))!LC.call(e,o)&&o!==r&&Kh(e,o,{get:()=>t[o],enumerable:!(i=TC(t,o))||i.enumerable});return e};var Zh=(e,t,r)=>(r=e!=null?vC(BC(e)):{},EC(t||!e||!e.__esModule?Kh(r,"default",{value:e,enumerable:!0}):r,e));const L=require("react"),We=require("./linkCards-Bjd_vW39.cjs"),jr=require("./providers-DO2t7ks4.cjs"),Qi=require("./viewer-settings.cjs"),St=require("html-react-parser"),It=require("./code-blocks-Cpo2S9jm.cjs"),mr=require("./embeds.cjs"),Mi=require("./source-lines.cjs"),wn=require("./simple-logger-9yf7ypyB.cjs"),Sn=require("shiki"),$i=require("dompurify"),oe=require("@aiquants/spreadsheet/view"),sa=require("@aiquants/spreadsheet/tsv"),FC=require("github-slugger"),AC=require("katex"),me=require("unist-util-visit"),Oi=(e,t)=>{const r={};for(const i of Object.keys(e)){const o=t?.[i];if(o===void 0){r[i]=e[i];continue}if(typeof o!="string")throw new TypeError(`[@aiquants/markdown] label "${i}" must be a string; got ${o===null?"null":typeof o}`);r[i]={text:o,lang:void 0}}return Object.freeze(r)},aa=e=>{const t={};for(const r of Object.keys(e))t[r]=e[r].text;return Object.freeze(t)},na=Object.freeze({embeddedVideo:{text:"embedded video",lang:"en"},embeddedPost:{text:"embedded post",lang:"en"},embeddedFrame:{text:"Embedded content",lang:"en"}}),MC=aa(na),hu=e=>Oi(na,e),$C=hu(void 0);function cu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Go={exports:{}},Ji={};var Qh;function OC(){if(Qh)return Ji;Qh=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var n in o)n!=="key"&&(s[n]=o[n])}else s=o;return o=s.ref,{$$typeof:e,type:i,key:a,ref:o!==void 0?o:null,props:s}}return Ji.Fragment=t,Ji.jsx=r,Ji.jsxs=r,Ji}var to={};var Jh;function RC(){return Jh||(Jh=1,process.env.NODE_ENV!=="production"&&(function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===P?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case y:return"Fragment";case C:return"Profiler";case x:return"StrictMode";case _:return"Suspense";case E:return"SuspenseList";case M:return"Activity"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case m:return"Portal";case S:return T.displayName||"Context";case w:return(T._context.displayName||"Context")+".Consumer";case v:var W=T.render;return T=T.displayName,T||(T=W.displayName||W.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case B:return W=T.displayName||null,W!==null?W:e(T.type)||"Memo";case D:W=T._payload,T=T._init;try{return e(T(W))}catch{}}return null}function t(T){return""+T}function r(T){try{t(T);var W=!1}catch{W=!0}if(W){W=console;var j=W.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return j.call(W,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),t(T)}}function i(T){if(T===y)return"<>";if(typeof T=="object"&&T!==null&&T.$$typeof===D)return"<...>";try{var W=e(T);return W?"<"+W+">":"<...>"}catch{return"<...>"}}function o(){var T=U.A;return T===null?null:T.getOwner()}function s(){return Error("react-stack-top-frame")}function a(T){if(N.call(T,"key")){var W=Object.getOwnPropertyDescriptor(T,"key").get;if(W&&W.isReactWarning)return!1}return T.key!==void 0}function n(T,W){function j(){$||($=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",W))}j.isReactWarning=!0,Object.defineProperty(T,"key",{get:j,configurable:!0})}function l(){var T=e(this.type);return O[T]||(O[T]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),T=this.props.ref,T!==void 0?T:null}function c(T,W,j,G,X,K){var Z=j.ref;return T={$$typeof:g,type:T,key:W,props:j,_owner:G},(Z!==void 0?Z:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:l}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(T,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(T,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function h(T,W,j,G,X,K){var Z=W.children;if(Z!==void 0)if(G)if(q(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(N.call(W,"key")){Z=e(T);var at=Object.keys(W).filter(function(ht){return ht!=="key"});G=0<at.length?"{key: someKey, "+at.join(": ..., ")+": ...}":"{key: someKey}",z[Z+G]||(at=0<at.length?"{"+at.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,G,Z,at,Z),z[Z+G]=!0)}if(Z=null,j!==void 0&&(r(j),Z=""+j),a(W)&&(r(W.key),Z=""+W.key),"key"in W){j={};for(var mt in W)mt!=="key"&&(j[mt]=W[mt])}else j=W;return Z&&n(j,typeof T=="function"?T.displayName||T.name||"Unknown":T),c(T,Z,j,o(),X,K)}function d(T){f(T)?T._store&&(T._store.validated=1):typeof T=="object"&&T!==null&&T.$$typeof===D&&(T._payload.status==="fulfilled"?f(T._payload.value)&&T._payload.value._store&&(T._payload.value._store.validated=1):T._store&&(T._store.validated=1))}function f(T){return typeof T=="object"&&T!==null&&T.$$typeof===g}var u=L,g=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"),w=Symbol.for("react.consumer"),S=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),P=Symbol.for("react.client.reference"),U=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,q=Array.isArray,A=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(T){return T()}};var $,O={},F=u.react_stack_bottom_frame.bind(u,s)(),R=A(i(s)),z={};to.Fragment=y,to.jsx=function(T,W,j){var G=1e4>U.recentlyCreatedOwnerStacks++;return h(T,W,j,!1,G?Error("react-stack-top-frame"):F,G?A(i(T)):R)},to.jsxs=function(T,W,j){var G=1e4>U.recentlyCreatedOwnerStacks++;return h(T,W,j,!0,G?Error("react-stack-top-frame"):F,G?A(i(T)):R)}})()),to}var tc;function IC(){return tc||(tc=1,process.env.NODE_ENV==="production"?Go.exports=OC():Go.exports=RC()),Go.exports}var k=IC();const ec=Object.freeze({display:"flex",flexDirection:"row",inlineSize:"100%",blockSize:"100%",minInlineSize:0,minBlockSize:0}),PC=Object.freeze({flex:"1 1 0%",minInlineSize:0,minBlockSize:0,overflow:"clip"}),DC=Object.freeze({display:"flex",flex:"none",minBlockSize:0}),NC=Object.freeze({position:"absolute",insetBlock:0,insetInline:0,overflowY:"scroll",visibility:"hidden",pointerEvents:"none"}),qC=Object.freeze({scrollbarWidth:"none"}),zC=.01,rc=Object.freeze({scroller:null,barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1}),Na=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},jC=(e,t,r)=>{const i=getComputedStyle(e),o=Na(i.width),s=e.getBoundingClientRect();if(o<=0||s.width<=0)return{barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1};const a=s.width/o,n=(s.width-t.getBoundingClientRect().width)/a-Na(i.borderLeftWidth)-Na(i.borderRightWidth),l=Math.max(0,Math.ceil(n-zC));return{barInlineSize:r.getBoundingClientRect().width/a,nativeBarInlineSize:l,overlaysScrollbars:l===0&&t.offsetWidth>0&&t.offsetWidth===t.clientWidth}},WC=(e,t,r,i,o)=>{const[s,a]=L.useState(rc),n=L.useRef(o),l=L.useRef(0);return L.useLayoutEffect(()=>{n.current=o}),L.useLayoutEffect(()=>{const c=m=>{l.current!==m&&(l.current=m,n.current?.(m))},h=t.current,d=r.current,f=i.current;if(!e||h===null||d===null||f===null){a(rc),c(0);return}const u=()=>{const{barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x}=jC(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 g=new ResizeObserver(u);return g.observe(h),g.observe(d),g.observe(f),window.addEventListener("resize",u),()=>{g.disconnect(),window.removeEventListener("resize",u)}},[e,t,r,i]),s},HC=(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 uu({scrollerProps:e,scrollerRef:t,children:r,renderScrollBar:i,rowClassName:o,rowStyle:s,onBarInlineSizeChange:a}){const n=L.useRef(null),l=L.useRef(null),c=L.useRef(null),h=i!==void 0,d=WC(h,n,l,c,a),f=L.useCallback(m=>{n.current=m;const y=HC(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?qC:void 0}:e.style,g=k.jsxs("div",{...e,ref:f,style:u,children:[r,h&&k.jsx("span",{ref:l,"data-aqmd-scroll-bar-probe":!0,"aria-hidden":"true",style:NC})]});return h?k.jsxs("div",{"data-aqmd-scroll-row":!0,className:o,style:s===void 0?ec:{...ec,...s},children:[k.jsx("div",{"data-aqmd-scroll-clip":!0,style:PC,children:g}),k.jsx("div",{ref:c,"data-aqmd-scroll-bar":!0,style:DC,children:d.scroller!==null&&i(d.scroller)})]}):g}const YC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),UC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),ic=e=>{const t=UC(e);return t.charAt(0).toUpperCase()+t.slice(1)},fu=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim(),GC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var XC={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 VC=L.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:a,...n},l)=>L.createElement("svg",{ref:l,...XC,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:fu("lucide",o),...!s&&!GC(n)&&{"aria-hidden":"true"},...n},[...a.map(([c,h])=>L.createElement(c,h)),...Array.isArray(s)?s:[s]]));const Tt=(e,t)=>{const r=L.forwardRef(({className:i,...o},s)=>L.createElement(VC,{ref:s,iconNode:t,className:fu(`lucide-${YC(ic(e))}`,`lucide-${e}`,i),...o}));return r.displayName=ic(e),r};const KC=[["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"}]],ZC=Tt("image-off",KC);class QC extends L.Component{constructor(t){super(t),this.state={content:t.content,failed:!1}}static getDerivedStateFromProps(t,r){return t.content===r.content?null:{content:t.content,failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?k.jsxs("div",{"data-aqmd-block-failure":"",children:[k.jsx("p",{"data-aqmd-block-failure-notice":"",lang:this.props.label.lang,children:this.props.label.text}),k.jsx("pre",{"data-aqmd-block-failure-text":"",children:this.props.text()})]}):this.props.children}}const gu=Object.freeze({blockFailed:{text:"This block could not be shown.",lang:"en"}}),JC=1024,_s=(e,t)=>e.fingerprint===t.fingerprint&&e.content===t.content,tb=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&_s(e[r],t[r]);)r+=1;let i=0;for(;i<e.length-r&&i<t.length-r&&_s(e[e.length-1-i],t[t.length-1-i]);)i+=1;const o=Array.from({length:r},(n,l)=>[l,l]),s=Array.from({length:i},(n,l)=>[e.length-i+l,t.length-i+l]),a=eb(e,t,r,e.length-i,t.length-i);return[...o,...a,...s]},eb=(e,t,r,i,o)=>{const s=new Set(e.slice(r,i).map(S=>S.fingerprint)),a=new Set(t.slice(r,o).map(S=>S.fingerprint)),n=[];for(let S=r;S<i;S+=1)a.has(e[S].fingerprint)&&n.push(S);const l=[];for(let S=r;S<o;S+=1)s.has(t[S].fingerprint)&&l.push(S);const c=n.length,h=l.length;if(c===0||h===0)return[];const d=(S,v)=>_s(e[n[S]],t[l[v]]),f=(S,v)=>e[n[S]].fingerprint===t[l[v]].fingerprint,u=(S,v)=>{let _=S;for(;_<c&&_+v<h&&d(_,_+v);)_+=1;return _},g=[Int32Array.of(u(0,0))],m=[Uint8Array.of(qa)],y=h-c;let x=0;for(;!(y>=-x&&y<=x&&g[x][y+x]===c);){if(x+=1,x>JC)return[];const S=g[x-1],v=B=>B>=-(x-1)&&B<=x-1?S[B+x-1]:-1,_=new Int32Array(2*x+1).fill(-1),E=new Uint8Array(2*x+1);for(let B=-x;B<=x;B+=1){if(B<-c||B>h)continue;let D=-1,M=qa;const P=v(B);P!==-1&&P<c&&P+B<h&&f(P,P+B)&&(D=P+1,M=oc);const U=v(B+1);U!==-1&&U+1<=c&&U+1>D&&(D=U+1,M=sc);const N=v(B-1);N!==-1&&N+B<=h&&N>D&&(D=N,M=za),D!==-1&&(_[B+x]=u(D,B),E[B+x]=M)}g.push(_),m.push(E)}const C=[];let w=y;for(let S=x;S>=0;S-=1){const v=g[S][w+S],_=m[S][w+S],E=_===sc?w+1:_===za?w-1:w,B=_===qa?0:g[S-1][E+S-1]+(_===za?0:1);for(let D=v-1;D>=B;D-=1)C.push([n[D],l[D+w]]);_===oc&&C.push([n[B-1],l[B-1+w]]),w=E}return C.reverse()},qa=0,oc=1,sc=2,za=3,rb=(e,t)=>{const r=e.map(()=>null),i=new Set;for(const[n,l]of tb(t,e))r[l]=t[n].key,i.add(n);const o=new Map;for(const[n,l]of t.entries()){if(i.has(n))continue;const c=o.get(l.fingerprint);c===void 0?o.set(l.fingerprint,[n]):c.push(n)}const s=n=>{for(const[l,c]of e.entries()){if(r[l]!==null)continue;const h=o.get(c.fingerprint),d=h===void 0?-1:h.findIndex(f=>n(c,t[f]));h!==void 0&&d!==-1&&(r[l]=t[h.splice(d,1)[0]].key)}};s(_s),s(()=>!0);const a=new Set(r.filter(n=>n!==null));return e.map((n,l)=>{let c=r[l];if(c===null){let h=0;for(;a.has(`${n.fingerprint}.${h}`);)h+=1;c=`${n.fingerprint}.${h}`,a.add(c)}return{...n,key:c}})};const ib=[["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"}]],ob=Tt("building-2",ib);const sb=[["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"}]],ac=Tt("globe",sb),ab=/^[a-z]{2,3}$/u,nb=e=>{const t=e.trim().split("-",1)[0]?.toLowerCase()??"";return ab.test(t)?t:null},lb=()=>()=>{},hb=e=>{const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>t.disconnect()},Ml=()=>L.useSyncExternalStore(lb,()=>window.location.origin,()=>null),cb=()=>L.useSyncExternalStore(hb,()=>nb(document.documentElement.lang),()=>null),db=/^[1-9]\d{0,4}$/u,nc=e=>e!==void 0&&db.test(e.trim())?Number(e.trim()):null,ub=({embed:e,label:t,insideAnchor:r,children:i})=>{const o=Ml(),s=new URL(e.src);if(o!==null&&s.origin!==o&&!r)return i;const a=nc(e.attributes.width),n=nc(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 k.jsx("span",{"data-embed-frame":o===null?"pending":"refused","data-aqmd-embed-surface":l===void 0?void 0:"",style:l,className:l===void 0?void 0:"flex items-center justify-center rounded-lg p-2 text-center",children:r?k.jsx("span",{lang:h,children:`${c??t.text}: ${s.hostname}`}):k.jsx("a",{href:s.href,target:"_blank",rel:"noreferrer",lang:h,children:c??`${t.text}: ${s.hostname}`})})},pu=({concurrency:e,capacity:t,timeoutMs:r})=>{for(const[h,d]of Object.entries({concurrency:e,capacity:t,timeoutMs:r}))if(!Number.isInteger(d)||d<=0)throw new RangeError(`[@aiquants/markdown] request queue ${h} must be a positive integer; got ${String(d)}`);const i=new Map,o=new Map,s=[];let a=0;const n=(h,d,f)=>{if(o.get(h)===d&&(o.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=s.shift();if(h===void 0)return;const d=o.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 g=o.get(h);g===void 0&&(g={start:d,subscriptions:new Set,controller:null},o.set(h,g),s.push(h));const m=g,y={listener:f};return m.subscriptions.add(y),l(),()=>{m.subscriptions.delete(y),!(m.subscriptions.size>0||o.get(h)!==m)&&(o.delete(h),m.controller===null?s.splice(s.indexOf(h),1):m.controller.abort())}}})},fb=pu({concurrency:2,capacity:256,timeoutMs:15e3}),gb="[data-aqmd-scroll-container]",pb=async(e,t)=>{let r;try{r=await fetch(e,{credentials:"same-origin",redirect:"error",headers:{accept:"application/json"},signal:t})}catch(s){if(t.aborted)throw s;return{kind:"error",cause:"network error"}}if(r.status===204){const s=We.linkCardSkipReasonOf(r.headers.get(We.LINK_CARD_SKIP_HEADER));return s===null?{kind:"error",cause:"HTTP 204 without a known skip reason"}:{kind:"skip",reason:s}}if(!r.ok)return{kind:"error",cause:`HTTP ${r.status}`};let i;try{i=await r.json()}catch(s){if(t.aborted)throw s;return{kind:"error",cause:`HTTP ${r.status}, not JSON`}}const o=We.linkCardMetadataOf(i);return o===null?{kind:"error",cause:`HTTP ${r.status}, not a JSON object`}:{kind:"card",metadata:o}},mb=e=>e.ok?e.value.kind==="card"?null:e.value.kind==="skip"?e.value.reason:e.value.cause:"network error",lc=(e,t)=>e!==null&&new URL(e).hostname!==t?e:null,ja=({tile:e,tileKind:t,primary:r,secondary:i})=>k.jsxs("span",{className:"flex min-w-0 flex-auto items-center gap-3 px-3",children:[k.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}),k.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[k.jsx("span",{className:"truncate font-semibold text-[0.875rem] leading-5",children:r}),k.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:i})]})]}),yb=({href:e,endpoint:t,size:r,fallback:i})=>{const o=Ml(),s=L.useRef(null),a=new URL(e),n=`${t}
7
- ${a.href}`,[l,c]=L.useState(null);L.useEffect(()=>{const x=s.current;if(x===null||o===null)return;let C=null;const w=new IntersectionObserver(S=>{C!==null||!S.some(v=>v.isIntersecting)||(w.disconnect(),C=fb.subscribe(n,v=>pb(We.linkCardRequestOf(t,new URL(e),o),v),v=>{c({key:n,outcome:v});const _=mb(v);_!==null&&wn.linkCardLogger.info(`No link card for ${e} (${_})`)}))},{root:x.closest(gb),rootMargin:"100% 0px"});return w.observe(x),()=>{w.disconnect(),C?.()}},[n,t,e,o]);const h=l!==null&&l.key===n?l.outcome:null;if(h!==null&&!h.ok)return i;const d=h===null?null:h.value;if(d!==null&&d.kind==="error")return i;if(d===null||o===null)return k.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","aria-busy":"true","data-link-card":"pending","data-link-card-size":r,children:r==="compact"?k.jsx(ja,{tile:null,tileKind:"pending",primary:a.hostname,secondary:e}):k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-2 px-4 py-3.5",children:[k.jsx("span",{"aria-hidden":"true",className:"block h-3.5 w-2/3 rounded bg-(--aqmd-link-card-border) motion-safe:animate-pulse"}),k.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem]",children:a.hostname}),k.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",w=C?ob:ac;return k.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"compact","data-link-card-reason":x,"data-link-card-size":"compact",children:k.jsx(ja,{tile:k.jsx(w,{"aria-hidden":"true",className:"size-4"}),tileKind:C?"internal":"link",primary:a.hostname,secondary:e})})}const{metadata:f}=d,u=new URL(o).hostname,g=lc(f.image,u),m=lc(f.icon,u),y=f.siteName===null?a.hostname:`${f.siteName} · ${a.hostname}`;return r==="compact"?k.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":"compact",children:k.jsx(ja,{tile:m===null?k.jsx(ac,{"aria-hidden":"true",className:"size-4"}):k.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})}):k.jsxs("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":r,children:[k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1 px-4 py-3.5",children:[k.jsx("span",{className:"wrap-anywhere line-clamp-2 font-semibold text-[0.9375rem] leading-5",children:f.title??e}),f.description===null?null:k.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}),k.jsxs("span",{className:"mt-1 flex items-center gap-1.5 text-(--aqmd-link-card-muted) text-xs leading-4",children:[m===null?null:k.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 shrink-0 rounded-[3px]"}),k.jsx("span",{className:"truncate",children:y})]})]}),g===null?null:k.jsx("img",{src:g,alt:"",loading:"lazy",referrerPolicy:"no-referrer"})]})},mu=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(!jr.isEmbedProviderId(t))throw new RangeError(`[@aiquants/markdown] embeds.providers holds an unknown provider id ${JSON.stringify(t)}; known ids are ${jr.EMBED_PROVIDER_IDS.join(", ")}`);if(e.linkCardEndpoint!==null&&!We.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&&!We.isLinkCardSize(e.linkCardSize))throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${We.LINK_CARD_SIZES.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);return e},ho=new WeakMap;let Xo=0;const hc=e=>{if(e.source===null)return;const t=ho.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(jr.EMBED_FRAME_HEIGHT_LIMITS.max,Math.max(jr.EMBED_FRAME_HEIGHT_LIMITS.min,Math.ceil(r)));i!==t.last&&(t.last=i,t.watch.set(i))},xb=(e,t)=>{const r={watch:t,last:null};return ho.has(e)||(Xo+=1,Xo===1&&window.addEventListener("message",hc)),ho.set(e,r),()=>{ho.get(e)===r&&(ho.delete(e),Xo-=1,Xo===0&&window.removeEventListener("message",hc))}},Cb=pu({concurrency:2,capacity:256,timeoutMs:5e3}),bb=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()},kb=(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`}}},wb=Object.freeze({marginInline:0}),Wa=Object.freeze({kind:"pending"}),Sb=Object.freeze({kind:"narrow"}),vb=Object.freeze({kind:"fallback"}),Tb=(e,t,r,i,o)=>{if(t===null)return Wa;let s;if(e.kind==="frame")s=e.srcOf(r);else{if(i===null)return Wa;s=i.ok?e.srcOf(i.value,r):null}if(s===null||new URL(s).origin===t)return vb;const{minWidth:a,maxWidth:n}=e.layout;if(a!==null){if(o===null)return Wa;if(Math.min(o,n??Number.POSITIVE_INFINITY)<a)return Sb}return{kind:"frame",src:s}},_b=({resolution:e,caption:t,fallback:r,theme:i,labels:o})=>{const s=Ml(),a=cb(),[n,l]=L.useState(null),[c,h]=L.useState(null),d=e.kind==="lookup"?e.request.href:null,[f,u]=L.useState(null);L.useEffect(()=>{if(d!==null)return Cb.subscribe(d,B=>bb(new URL(d),B),B=>u({key:d,outcome:B}))},[d]);const{provider:g,layout:m}=e,y=Tb(e,s,{theme:i,lang:a},f!==null&&f.key===d?f.outcome:null,n),x=L.useCallback(B=>{if(B===null)return;l(B.getBoundingClientRect().width);const D=new ResizeObserver(()=>l(B.getBoundingClientRect().width));return D.observe(B),()=>D.disconnect()},[]),C=y.kind==="frame"?y.src:null,w=c!==null&&c.src===C?c.height:null,S=L.useCallback(B=>{if(!(B===null||B.contentWindow===null||m.kind!=="message"||C===null))return xb(B.contentWindow,{origin:g.frameOrigin,src:C,heightOf:m.heightOf,set:D=>h({src:C,height:D})})},[m,g.frameOrigin,C]);if(y.kind==="fallback")return r;const v=m.minWidth===null?null:k.jsx("span",{ref:x,"aria-hidden":"true","data-embed-measure":g.id,className:"block h-0"});if(y.kind==="narrow")return k.jsxs(k.Fragment,{children:[v,r]});const _=g.content==="video"?o.embeddedVideo:o.embeddedPost,{frame:E}=g;return k.jsxs(k.Fragment,{children:[v,k.jsxs("figure",{"data-embed-provider":g.id,"data-embed-state":y.kind,style:wb,children:[k.jsx("div",{"data-embed-box":"","data-aqmd-embed-surface":"",style:kb(m,w),className:"noscript:hidden overflow-hidden rounded-lg",children:y.kind==="frame"?k.jsx("iframe",{ref:S,src:y.src,title:`${g.name}: ${_.text}`,lang:_.lang,loading:"lazy",allow:E.allow??void 0,allowFullScreen:E.allowFullScreen,sandbox:E.sandbox,referrerPolicy:E.referrerPolicy,scrolling:E.scrolling??void 0,className:"block h-full w-full border-0"},y.src):null}),k.jsx("figcaption",{className:"mt-2",children:t})]})]})},Bb=["title","width","height","allow","allowfullscreen","sandbox","referrerpolicy","loading","frameborder","scrolling"],Lb=(e,t)=>mr.allowedFrameUrlOf(e,t)!==null,Eb=(e,t)=>{const r=new Map(Object.entries(e).map(([s,a])=>[s.toLowerCase(),a])),i=mr.allowedFrameUrlOf(r.get("src"),t);if(i===null)return null;const o={};for(const s of Bb){const a=r.get(s);if(a!==void 0)if(s==="allow"){const n=mr.reduceFrameFeatures(a);n!==null&&(o.allow=n)}else if(s==="referrerpolicy"){const n=a.trim().toLowerCase();mr.EMBED_FRAME_REFERRER_POLICIES.has(n)&&(o.referrerpolicy=n)}else o[s]=a}return Object.freeze({src:i.href,attributes:Object.freeze(o)})},Fb=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"]),Ab=new Set(["id","class","title","lang","dir","role","hidden","translate","style"]),Mb=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"]),cc="language-",$b=/[\t\n\f\r ]+/u,Ob=new Set(["h1","h2","h3","h4","h5","h6"]),dc=Object.freeze({sup:/^fnref\d*:\d+$/u,li:/^fn:\d+$/u}),uc="user-content-",Kt=["align"],ni=["width","height"],fc=["colspan","rowspan","headers","scope","abbr","align","valign","width","height"],Ha=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:Kt,cite:[],code:[It.CODE_META_ATTRIBUTE],col:["span",...Kt,...ni],colgroup:["span",...Kt,...ni],dd:[],del:["cite","datetime"],details:["open"],dfn:[],div:Kt,dl:[],dt:[],em:[],figcaption:[],figure:[],footer:[],h1:Kt,h2:Kt,h3:Kt,h4:Kt,h5:Kt,h6:Kt,header:[],hgroup:[],hr:[],i:[],img:["src","alt","loading","decoding",...Kt,...ni,"data-asset-src","data-asset-exists"],ins:["cite","datetime"],kbd:[],li:["value"],main:[],mark:[],nav:[],ol:["start","reversed","type"],p:Kt,pre:[],q:["cite"],rp:[],rt:[],ruby:[],s:[],samp:[],section:["data-footnotes"],small:[],source:["src","type"],span:[],strong:[],sub:[],summary:[],sup:[],table:[...Kt,"border",...ni],tbody:[...Kt,"valign"],td:fc,tfoot:[...Kt,"valign"],th:fc,thead:[...Kt,"valign"],time:["datetime"],tr:[...Kt,"valign"],u:[],ul:[],var:[],video:["src","poster","controls","loop","muted","playsinline","preload",...ni],wbr:[]}),Ya=Object.freeze({svg:["viewbox","version","xmlns","focusable","fill",...ni],g:["fill","fill-rule","clip-rule"],path:["d","fill","fill-rule","clip-rule"]}),Rb=new Set(["svg","g"]),Ib=new Set(["href","src","cite","poster",mr.EMBED_LINK_ATTRIBUTE]),Pb=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu,Db=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,Nb=new Set(["left","right","center","justify","start","end"]),qo=e=>Db.test(e.replace(Pb,"")),qb=e=>{let t=null;for(const r of e.split(";")){const i=r.indexOf(":");if(i<0||r.slice(0,i).trim().toLowerCase()!=="text-align")continue;const o=r.slice(i+1).trim().toLowerCase();Nb.has(o)&&(t=o)}return t===null?null:`text-align: ${t}`},zb=e=>{const t=e.split($b).filter(r=>Mb.has(r)||r.startsWith(cc)&&r.length>cc.length);return t.length===0?null:t.join(" ")},jb=(e,t)=>Ob.has(e)||t.startsWith(uc)&&t.length>uc.length||Object.hasOwn(dc,e)&&dc[e].test(t),Wb=e=>{const t=new Map;for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();t.has(o)||t.set(o,i)}return t},eo=(e,t,r)=>{const i={};for(const[o,s]of t){if(o===Mi.SOURCE_LINES_ATTRIBUTE){Mi.parseSourceLines(s)!==null&&(i[o]=s);continue}if((Ab.has(o)||r.includes(o)||o.startsWith("aria-")&&o.length>5)&&!(Ib.has(o)&&!qo(s))&&!(o==="fill"&&/url\s*\(/iu.test(s))&&!(o==="id"&&!jb(e,s))){if(o==="class"||o==="style"){const a=o==="class"?zb(s):qb(s);a!==null&&(i[o]=a);continue}i[o]=s}}return i},Hb=e=>e.get("type")?.trim().toLowerCase()==="checkbox"&&e.has("disabled"),la=(e,t,r)=>{const i=e.toLowerCase(),o=r.parentName===null?null:r.parentName.toLowerCase(),s=Wb(t);if(o!==null&&Rb.has(o)){const n=i!=="svg"&&Object.hasOwn(Ya,i)?Ya[i]:void 0;return n===void 0?{action:"remove"}:{action:"keep",attributes:eo(i,s,n)}}if(i==="svg")return{action:"keep",attributes:eo(i,s,Ya.svg)};if(i==="iframe"){const n=Eb(Object.fromEntries(s),r.iFrameAllowedDomains);return n===null?{action:"remove"}:{action:"embed",embed:n,pluginType:s.get("data-plugin-type")??null}}if(i==="p"){const n=eo(i,s,Ha.p),l=s.get(mr.EMBED_LINK_ATTRIBUTE);return l!==void 0&&qo(l)?{action:"placeholder",attributes:n,link:l}:{action:"keep",attributes:n}}if(i==="input")return Hb(s)?{action:"keep",attributes:eo(i,s,["type","checked","disabled"])}:{action:"remove"};if(Fb.has(i))return{action:"remove"};const a=Object.hasOwn(Ha,i)?Ha[i]:void 0;return a===void 0?{action:"unwrap"}:{action:"keep",attributes:eo(i,s,a)}};typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(t,r){r=r||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,r.bubbles,r.cancelable,r.detail),i}));const Yb=typeof document<"u"&&!!document.documentMode;let Ua;function Ub(){return Ua||(Ua=document.createElement("div").style)}const gc=["webkit","moz","ms"],Vo={};function $l(e){if(Vo[e])return Vo[e];const t=Ub();if(e in t)return Vo[e]=e;const r=e[0].toUpperCase()+e.slice(1);let i=gc.length;for(;i--;){const o=`${gc[i]}${r}`;if(o in t)return Vo[e]=o}}function Ko(e,t){return parseFloat(t[$l(e)])||0}function Zo(e,t,r=window.getComputedStyle(e)){const i=t==="border"?"Width":"";return{left:Ko(`${t}Left${i}`,r),right:Ko(`${t}Right${i}`,r),top:Ko(`${t}Top${i}`,r),bottom:Ko(`${t}Bottom${i}`,r)}}function ui(e,t,r){e.style[$l(t)]=r}function Gb(e,t){const r=$l("transform");ui(e,"transition",`${r} ${t.duration}ms ${t.easing}`)}function Xb(e,{x:t,y:r,scale:i,isSVG:o},s){if(ui(e,"transform",`scale(${i}) translate(${t}px, ${r}px)`),o&&Yb){const a=window.getComputedStyle(e).getPropertyValue("transform");e.setAttribute("transform",a)}}function Ga(e){let t=e.parentNode;(!t||t.nodeType!==1)&&(t=document.documentElement);const r=window.getComputedStyle(e),i=window.getComputedStyle(t),o=e.getBoundingClientRect(),s=t.getBoundingClientRect();return{elem:{style:r,width:o.width,height:o.height,top:o.top,bottom:o.bottom,left:o.left,right:o.right,margin:Zo(e,"margin",r),border:Zo(e,"border",r)},parent:{style:i,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,padding:Zo(t,"padding",i),border:Zo(t,"border",i)}}}let Bo={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Bo={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Bo={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function Xa(e,t,r,i){Bo[e].split(" ").forEach(o=>{t.addEventListener(o,r,i)})}function Va(e,t,r){Bo[e].split(" ").forEach(i=>{t.removeEventListener(i,r)})}function yu(e,t){let r=e.length;for(;r--;)if(e[r].pointerId===t.pointerId)return r;return-1}function vn(e,t){let r;if(t.touches){r=0;for(const i of t.touches)i.pointerId=r++,vn(e,i);return}r=yu(e,t),r>-1&&e.splice(r,1),e.push(t)}function Vb(e,t){if(t.touches){for(;e.length;)e.pop();return}const r=yu(e,t);r>-1&&e.splice(r,1)}function pc(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 Ka(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 Kb(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 Zb(e){return(e.getAttribute("class")||"").trim()}function Qb(e,t){return e.nodeType===1&&` ${Zb(e)} `.indexOf(` ${t} `)>-1}function Jb(e,t){for(let r=e;r!=null;r=r.parentNode)if(Qb(r,t.excludeClass)||t.exclude.indexOf(r)>-1)return!0;return!1}const t1=/^http:[\w\.\/]+svg$/;function e1(e){return t1.test(e.namespaceURI)&&e.nodeName.toLowerCase()!=="svg"}function r1(e){const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}const xu={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:Xb,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function Cu(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(!Kb(e))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t={...xu,...t};const r=e1(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,ui(e,"transformOrigin",typeof t.origin=="string"?t.origin:r?"0 0":"50% 50%");function o(){i.style.overflow="",i.style.userSelect="",i.style.touchAction="",i.style.cursor="",e.style.cursor="",e.style.userSelect="",e.style.touchAction="",ui(e,"transformOrigin","")}function s(R={}){for(const z in R)R.hasOwnProperty(z)&&(t[z]=R[z]);(R.hasOwnProperty("cursor")||R.hasOwnProperty("canvas"))&&(i.style.cursor=e.style.cursor="",(t.canvas?i:e).style.cursor=t.cursor),R.hasOwnProperty("overflow")&&(i.style.overflow=R.overflow),R.hasOwnProperty("touchAction")&&(i.style.touchAction=R.touchAction,e.style.touchAction=R.touchAction)}let a=0,n=0,l=1,c=!1;m(t.startScale,{animate:!1,force:!0}),setTimeout(()=>{g(t.startX,t.startY,{animate:!1,force:!0})});function h(R,z,T){if(T.silent)return;const W=new CustomEvent(R,{detail:z});e.dispatchEvent(W)}function d(R,z,T){const W={x:a,y:n,scale:l,isSVG:r,originalEvent:T};return requestAnimationFrame(()=>{typeof z.animate=="boolean"&&(z.animate?Gb(e,z):ui(e,"transition","none")),z.setTransform(e,W,z),h(R,W,z),h("panzoomchange",W,z)}),W}function f(R,z,T,W){const j={...t,...W},G={x:a,y:n,opts:j};if(!W?.force&&(j.disablePan||j.panOnlyWhenZoomed&&l===j.startScale))return G;if(R=parseFloat(R),z=parseFloat(z),j.disableXAxis||(G.x=(j.relative?a:0)+R),j.disableYAxis||(G.y=(j.relative?n:0)+z),j.contain){const X=Ga(e),K=X.elem.width/l,Z=X.elem.height/l,at=K*T,mt=Z*T,ht=(at-K)/2,ct=(mt-Z)/2;if(j.contain==="inside"){const _t=(-X.elem.margin.left-X.parent.padding.left+ht)/T,Ct=(X.parent.width-at-X.parent.padding.left-X.elem.margin.left-X.parent.border.left-X.parent.border.right+ht)/T;G.x=Math.max(Math.min(G.x,Ct),_t);const Et=(-X.elem.margin.top-X.parent.padding.top+ct)/T,Nt=(X.parent.height-mt-X.parent.padding.top-X.elem.margin.top-X.parent.border.top-X.parent.border.bottom+ct)/T;G.y=Math.max(Math.min(G.y,Nt),Et)}else if(j.contain==="outside"){const _t=(-(at-X.parent.width)-X.parent.padding.left-X.parent.border.left-X.parent.border.right+ht)/T,Ct=(ht-X.parent.padding.left)/T;G.x=Math.max(Math.min(G.x,Ct),_t);const Et=(-(mt-X.parent.height)-X.parent.padding.top-X.parent.border.top-X.parent.border.bottom+ct)/T,Nt=(ct-X.parent.padding.top)/T;G.y=Math.max(Math.min(G.y,Nt),Et)}}return j.roundPixels&&(G.x=Math.round(G.x),G.y=Math.round(G.y)),G}function u(R,z){const T={...t,...z},W={scale:l,opts:T};if(!z?.force&&T.disableZoom)return W;let j=t.minScale,G=t.maxScale;if(T.contain){const X=Ga(e),K=X.elem.width/l,Z=X.elem.height/l;if(K>1&&Z>1){const at=X.parent.width-X.parent.border.left-X.parent.border.right,mt=X.parent.height-X.parent.border.top-X.parent.border.bottom,ht=at/K,ct=mt/Z;t.contain==="inside"?G=Math.min(G,ht,ct):t.contain==="outside"&&(j=Math.max(j,ht,ct))}}return W.scale=Math.min(Math.max(R,j),G),W}function g(R,z,T,W){const j=f(R,z,l,T);return a!==j.x||n!==j.y?(a=j.x,n=j.y,d("panzoompan",j.opts,W)):{x:a,y:n,scale:l,isSVG:r,originalEvent:W}}function m(R,z,T){const W=u(R,z),j=W.opts;if(!z?.force&&j.disableZoom)return;R=W.scale;let G=a,X=n;if(j.focal){const Z=j.focal;G=(Z.x/R-Z.x/l+a*R)/R,X=(Z.y/R-Z.y/l+n*R)/R}const K=f(G,X,R,{relative:!1,force:!0});return a=K.x,n=K.y,l=R,d("panzoomzoom",j,T)}function y(R,z){const T={...t,animate:!0,...z};return m(l*Math.exp((R?1:-1)*T.step),T)}function x(R){return y(!0,R)}function C(R){return y(!1,R)}function w(R,z,T,W){const j=Ga(e),G={width:j.parent.width-j.parent.padding.left-j.parent.padding.right-j.parent.border.left-j.parent.border.right,height:j.parent.height-j.parent.padding.top-j.parent.padding.bottom-j.parent.border.top-j.parent.border.bottom};let X=z.clientX-j.parent.left-j.parent.padding.left-j.parent.border.left-j.elem.margin.left,K=z.clientY-j.parent.top-j.parent.padding.top-j.parent.border.top-j.elem.margin.top;r||(X-=j.elem.width/l/2,K-=j.elem.height/l/2);const Z={x:X/G.width*(G.width*R),y:K/G.height*(G.height*R)};return m(R,{...T,animate:!1,focal:Z},W)}function S(R,z){R.preventDefault();const T={...t,...z,animate:!1},j=(R.deltaY===0&&R.deltaX?R.deltaX:R.deltaY)<0?1:-1,G=u(l*Math.exp(j*T.step/3),T).scale;return w(G,R,T,R)}function v(R){const z={...t,animate:!0,force:!0,...R};l=u(z.startScale,z).scale;const T=f(z.startX,z.startY,l,z);return a=T.x,n=T.y,d("panzoomreset",z)}let _,E,B,D,M,P;const U=[];function N(R){if(Jb(R.target,t))return;vn(U,R),c=!0,t.handleStartEvent(R),_=a,E=n,h("panzoomstart",{x:a,y:n,scale:l,isSVG:r,originalEvent:R},t);const z=pc(U);B=z.clientX,D=z.clientY,M=l,P=Ka(U)}function q(R){if(!c||_===void 0||E===void 0||B===void 0||D===void 0)return;vn(U,R);const z=pc(U),T=U.length>1;let W=l;if(T){P===0&&(P=Ka(U));const j=Ka(U)-P;W=u(j*t.step/80+M).scale,w(W,z,{animate:!1},R)}(!T||t.pinchAndPan)&&g(_+(z.clientX-B)/W,E+(z.clientY-D)/W,{animate:!1},R)}function A(R){U.length===1&&h("panzoomend",{x:a,y:n,scale:l,isSVG:r,originalEvent:R},t),Vb(U,R),c&&(c=!1,_=E=B=D=void 0)}let $=!1;function O(){$||($=!0,Xa("down",t.canvas?i:e,N),Xa("move",document,q,{passive:!0}),Xa("up",document,A,{passive:!0}))}function F(){$=!1,Va("down",t.canvas?i:e,N),Va("move",document,q),Va("up",document,A)}return t.noBind||O(),{bind:O,destroy:F,eventNames:Bo,getPan:()=>({x:a,y:n}),getScale:()=>l,getOptions:()=>r1(t),handleDown:N,handleMove:q,handleUp:A,pan:g,reset:v,resetStyle:o,setOptions:s,setStyle:(R,z)=>ui(e,R,z),zoom:m,zoomIn:x,zoomOut:C,zoomToPoint:w,zoomWithWheel:S}}Cu.defaultOptions=xu;const i1=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],o1=Tt("arrow-down",i1);const s1=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],a1=Tt("arrow-left",s1);const n1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],l1=Tt("arrow-right",n1);const h1=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],c1=Tt("arrow-up",h1);const d1=[["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"}]],Tn=Tt("refresh-cw",d1);const u1=[["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"}]],f1=Tt("settings-2",u1);const g1=[["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"}]],bu=Tt("zoom-in",g1);const p1=[["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"}]],ku=Tt("zoom-out",p1);var wu=Object.defineProperty,p=(e,t)=>wu(e,"name",{value:t,configurable:!0}),Su=(e,t)=>{for(var r in t)wu(e,r,{get:t[r],enumerable:!0})},ds={exports:{}},m1=ds.exports,mc;function y1(){return mc||(mc=1,(function(e,t){(function(r,i){e.exports=i()})(m1,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",f="quarter",u="year",g="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(q){var A=["th","st","nd","rd"],$=q%100;return"["+q+(A[($-20)%10]||A[$]||A[0])+"]"}},w=function(q,A,$){var O=String(q);return!O||O.length>=A?q:""+Array(A+1-O.length).join($)+q},S={s:w,z:function(q){var A=-q.utcOffset(),$=Math.abs(A),O=Math.floor($/60),F=$%60;return(A<=0?"+":"-")+w(O,2,"0")+":"+w(F,2,"0")},m:function q(A,$){if(A.date()<$.date())return-q($,A);var O=12*($.year()-A.year())+($.month()-A.month()),F=A.clone().add(O,d),R=$-F<0,z=A.clone().add(O+(R?-1:1),d);return+(-(O+($-F)/(R?F-z:z-F))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:d,y:u,w:h,d:c,D:g,h:l,m:n,s:a,ms:s,Q:f}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},v="en",_={};_[v]=C;var E="$isDayjsObject",B=function(q){return q instanceof U||!(!q||!q[E])},D=function q(A,$,O){var F;if(!A)return v;if(typeof A=="string"){var R=A.toLowerCase();_[R]&&(F=R),$&&(_[R]=$,F=R);var z=A.split("-");if(!F&&z.length>1)return q(z[0])}else{var T=A.name;_[T]=A,F=T}return!O&&F&&(v=F),F||!O&&v},M=function(q,A){if(B(q))return q.clone();var $=typeof A=="object"?A:{};return $.date=q,$.args=arguments,new U($)},P=S;P.l=D,P.i=B,P.w=function(q,A){return M(q,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var U=(function(){function q($){this.$L=D($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[E]=!0}var A=q.prototype;return A.parse=function($){this.$d=(function(O){var F=O.date,R=O.utc;if(F===null)return new Date(NaN);if(P.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var z=F.match(y);if(z){var T=z[2]-1||0,W=(z[7]||"0").substring(0,3);return R?new Date(Date.UTC(z[1],T,z[3]||1,z[4]||0,z[5]||0,z[6]||0,W)):new Date(z[1],T,z[3]||1,z[4]||0,z[5]||0,z[6]||0,W)}}return new Date(F)})($),this.init()},A.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},A.$utils=function(){return P},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function($,O){var F=M($);return this.startOf(O)<=F&&F<=this.endOf(O)},A.isAfter=function($,O){return M($)<this.startOf(O)},A.isBefore=function($,O){return this.endOf(O)<M($)},A.$g=function($,O,F){return P.u($)?this[O]:this.set(F,$)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function($,O){var F=this,R=!!P.u(O)||O,z=P.p($),T=function(mt,ht){var ct=P.w(F.$u?Date.UTC(F.$y,ht,mt):new Date(F.$y,ht,mt),F);return R?ct:ct.endOf(c)},W=function(mt,ht){return P.w(F.toDate()[mt].apply(F.toDate("s"),(R?[0,0,0,0]:[23,59,59,999]).slice(ht)),F)},j=this.$W,G=this.$M,X=this.$D,K="set"+(this.$u?"UTC":"");switch(z){case u:return R?T(1,0):T(31,11);case d:return R?T(1,G):T(0,G+1);case h:var Z=this.$locale().weekStart||0,at=(j<Z?j+7:j)-Z;return T(R?X-at:X+(6-at),G);case c:case g:return W(K+"Hours",0);case l:return W(K+"Minutes",1);case n:return W(K+"Seconds",2);case a:return W(K+"Milliseconds",3);default:return this.clone()}},A.endOf=function($){return this.startOf($,!1)},A.$set=function($,O){var F,R=P.p($),z="set"+(this.$u?"UTC":""),T=(F={},F[c]=z+"Date",F[g]=z+"Date",F[d]=z+"Month",F[u]=z+"FullYear",F[l]=z+"Hours",F[n]=z+"Minutes",F[a]=z+"Seconds",F[s]=z+"Milliseconds",F)[R],W=R===c?this.$D+(O-this.$W):O;if(R===d||R===u){var j=this.clone().set(g,1);j.$d[T](W),j.init(),this.$d=j.set(g,Math.min(this.$D,j.daysInMonth())).$d}else T&&this.$d[T](W);return this.init(),this},A.set=function($,O){return this.clone().$set($,O)},A.get=function($){return this[P.p($)]()},A.add=function($,O){var F,R=this;$=Number($);var z=P.p(O),T=function(G){var X=M(R);return P.w(X.date(X.date()+Math.round(G*$)),R)};if(z===d)return this.set(d,this.$M+$);if(z===u)return this.set(u,this.$y+$);if(z===c)return T(1);if(z===h)return T(7);var W=(F={},F[n]=i,F[l]=o,F[a]=r,F)[z]||1,j=this.$d.getTime()+$*W;return P.w(j,this)},A.subtract=function($,O){return this.add(-1*$,O)},A.format=function($){var O=this,F=this.$locale();if(!this.isValid())return F.invalidDate||m;var R=$||"YYYY-MM-DDTHH:mm:ssZ",z=P.z(this),T=this.$H,W=this.$m,j=this.$M,G=F.weekdays,X=F.months,K=F.meridiem,Z=function(ht,ct,_t,Ct){return ht&&(ht[ct]||ht(O,R))||_t[ct].slice(0,Ct)},at=function(ht){return P.s(T%12||12,ht,"0")},mt=K||function(ht,ct,_t){var Ct=ht<12?"AM":"PM";return _t?Ct.toLowerCase():Ct};return R.replace(x,(function(ht,ct){return ct||(function(_t){switch(_t){case"YY":return String(O.$y).slice(-2);case"YYYY":return P.s(O.$y,4,"0");case"M":return j+1;case"MM":return P.s(j+1,2,"0");case"MMM":return Z(F.monthsShort,j,X,3);case"MMMM":return Z(X,j);case"D":return O.$D;case"DD":return P.s(O.$D,2,"0");case"d":return String(O.$W);case"dd":return Z(F.weekdaysMin,O.$W,G,2);case"ddd":return Z(F.weekdaysShort,O.$W,G,3);case"dddd":return G[O.$W];case"H":return String(T);case"HH":return P.s(T,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return mt(T,W,!0);case"A":return mt(T,W,!1);case"m":return String(W);case"mm":return P.s(W,2,"0");case"s":return String(O.$s);case"ss":return P.s(O.$s,2,"0");case"SSS":return P.s(O.$ms,3,"0");case"Z":return z}return null})(ht)||z.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function($,O,F){var R,z=this,T=P.p(O),W=M($),j=(W.utcOffset()-this.utcOffset())*i,G=this-W,X=function(){return P.m(z,W)};switch(T){case u:R=X()/12;break;case d:R=X();break;case f:R=X()/3;break;case h:R=(G-j)/6048e5;break;case c:R=(G-j)/864e5;break;case l:R=G/o;break;case n:R=G/i;break;case a:R=G/r;break;default:R=G}return F?R:P.a(R)},A.daysInMonth=function(){return this.endOf(d).$D},A.$locale=function(){return _[this.$L]},A.locale=function($,O){if(!$)return this.$L;var F=this.clone(),R=D($,O,!0);return R&&(F.$L=R),F},A.clone=function(){return P.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},q})(),N=U.prototype;return M.prototype=N,[["$ms",s],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",u],["$D",g]].forEach((function(q){N[q[1]]=function(A){return this.$g(A,q[0],q[1])}})),M.extend=function(q,A){return q.$i||(q(A,U,M),q.$i=!0),M},M.locale=D,M.isDayjs=B,M.unix=function(q){return M(1e3*q)},M.en=_[v],M.Ls=_,M.p={},M}))})(ds)),ds.exports}var x1=y1();const vu=du(x1);var Qe={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},V={trace:p((...e)=>{},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},Ol=p(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,be("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",be("FATAL"))),t<=Qe.error&&(V.error=console.error?console.error.bind(console,be("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",be("ERROR"))),t<=Qe.warn&&(V.warn=console.warn?console.warn.bind(console,be("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",be("WARN"))),t<=Qe.info&&(V.info=console.info?console.info.bind(console,be("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",be("INFO"))),t<=Qe.debug&&(V.debug=console.debug?console.debug.bind(console,be("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",be("DEBUG"))),t<=Qe.trace&&(V.trace=console.debug?console.debug.bind(console,be("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",be("TRACE")))},"setLogLevel"),be=p(e=>`%c${vu().format("ss.SSS")} : ${e} : `,"format");const us={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return us.hue2rgb(s,o,e+1/3)*255;case"g":return us.hue2rgb(s,o,e)*255;case"b":return us.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){case e:return((t-r)/n+(t<r?6:0))*60;case t:return((r-e)/n+2)*60;case r:return((e-t)/n+4)*60;default:return-1}}},C1={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},b1={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},gt={channel:us,lang:C1,unit:b1},fr={};for(let e=0;e<=255;e++)fr[e]=gt.unit.dec2hex(e);const ie={ALL:0,RGB:1,HSL:2};class k1{constructor(){this.type=ie.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=ie.ALL}is(t){return this.type===t}}class w1{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new k1}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=ie.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=gt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=gt.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=gt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=gt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=gt.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=gt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(ie.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(ie.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(ie.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(ie.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(ie.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(ie.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(ie.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(ie.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(ie.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(ie.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(ie.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(ie.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const ha=new w1({r:0,g:0,b:0,a:0},"transparent"),pi={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(pi.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return ha.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${fr[Math.round(t)]}${fr[Math.round(r)]}${fr[Math.round(i)]}${fr[Math.round(o*255)]}`:`#${fr[Math.round(t)]}${fr[Math.round(r)]}${fr[Math.round(i)]}`}},Ir={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(Ir.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return gt.channel.clamp.h(parseFloat(r)*.9);case"rad":return gt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return gt.channel.clamp.h(parseFloat(r)*360)}}return gt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Ir.re);if(!r)return;const[,i,o,s,a,n]=r;return ha.set({h:Ir._hue2deg(i),s:gt.channel.clamp.s(parseFloat(o)),l:gt.channel.clamp.l(parseFloat(s)),a:a?gt.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${gt.lang.round(t)}, ${gt.lang.round(r)}%, ${gt.lang.round(i)}%, ${o})`:`hsl(${gt.lang.round(t)}, ${gt.lang.round(r)}%, ${gt.lang.round(i)}%)`}},Co={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=Co.colors[e];if(t)return pi.parse(t)},stringify:e=>{const t=pi.stringify(e);for(const r in Co.colors)if(Co.colors[r]===t)return r}},co={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(co.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return ha.set({r:gt.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:gt.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:gt.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?gt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${gt.lang.round(t)}, ${gt.lang.round(r)}, ${gt.lang.round(i)}, ${gt.lang.round(o)})`:`rgb(${gt.lang.round(t)}, ${gt.lang.round(r)}, ${gt.lang.round(i)})`}},Re={format:{keyword:Co,hex:pi,rgb:co,rgba:co,hsl:Ir,hsla:Ir},parse:e=>{if(typeof e!="string")return e;const t=pi.parse(e)||co.parse(e)||Ir.parse(e)||Co.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(ie.HSL)||e.data.r===void 0?Ir.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?co.stringify(e):pi.stringify(e)},Tu=(e,t)=>{const r=Re.parse(e);for(const i in t)r[i]=gt.channel.clamp[i](t[i]);return Re.stringify(r)},ir=(e,t,r=0,i=1)=>{if(typeof e!="number")return Tu(e,{a:t});const o=ha.set({r:gt.channel.clamp.r(e),g:gt.channel.clamp.g(t),b:gt.channel.clamp.b(r),a:gt.channel.clamp.a(i)});return Re.stringify(o)},S1=e=>{const{r:t,g:r,b:i}=Re.parse(e),o=.2126*gt.channel.toLinear(t)+.7152*gt.channel.toLinear(r)+.0722*gt.channel.toLinear(i);return gt.lang.round(o)},v1=e=>S1(e)>=.5,Te=e=>!v1(e),Rl=(e,t,r)=>{const i=Re.parse(e),o=i[t],s=gt.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Re.stringify(i)},H=(e,t)=>Rl(e,"l",t),Y=(e,t)=>Rl(e,"l",-t),b=(e,t)=>{const r=Re.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return Tu(e,i)},T1=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Re.parse(e),{r:n,g:l,b:c,a:h}=Re.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=o*m+l*y,w=s*m+c*y,S=a*d+h*(1-d);return ir(x,C,w,S)},I=(e,t=100)=>{const r=Re.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,T1(r,e,t)};var _n=p((e,t,{depth:r=2,clobber:i=!1}={})=>{const o={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>_n(e,s,o)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=_n(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),jt=_n,Ge="#ffffff",Xe="#f2f2f2",ut=p((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),xi,_1=(xi=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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||Y(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(this.mainBkg,10)):(this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe,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]})}},p(xi,"Theme"),xi),B1=p(e=>{const t=new _1;return t.calculate(e),t},"getThemeVariables"),Ci,L1=(Ci=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#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=Y("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Y(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||H(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=H(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=H(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=H(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=I(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]||I(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??H(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=H(this.secondaryColor,20),this.git1=H(this.pie2||this.secondaryColor,20),this.git2=H(this.pie3||this.tertiaryColor,20),this.git3=H(this.pie4||b(this.primaryColor,{h:-30}),20),this.git4=H(this.pie5||b(this.primaryColor,{h:-60}),20),this.git5=H(this.pie6||b(this.primaryColor,{h:-90}),10),this.git6=H(this.pie7||b(this.primaryColor,{h:60}),10),this.git7=H(this.pie8||b(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||I(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||I(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||H("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||H("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||H("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||H("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||H(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||H(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||H(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||H(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Ci,"Theme"),Ci),E1=p(e=>{const t=new L1;return t.calculate(e),t},"getThemeVariables"),bi,F1=(bi=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=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ut(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||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||I(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||I(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||H(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||H(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||b(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||b(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||Y(I(this.git0),25),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||I(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(bi,"Theme"),bi),_u=p(e=>{const t=new F1;return t.calculate(e),t},"getThemeVariables"),ki,A1=(ki=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=H("#cde498",10),this.primaryBorderColor=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.primaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=Y(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-30}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||I(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(ki,"Theme"),ki),M1=p(e=>{const t=new A1;return t.calculate(e),t},"getThemeVariables"),wi,$1=(wi=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=H(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=H(this.contrast,55),this.border2=this.contrast,this.actorBorder=H(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||I(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=H(this.contrast,30),this.sectionBkgColor2=H(this.contrast,30),this.taskBorderColor=Y(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=H(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Y(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Y(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||b(this.primaryColor,{h:-30}),this.git4=this.pie5||b(this.primaryColor,{h:-60}),this.git5=this.pie6||b(this.primaryColor,{h:-90}),this.git6=this.pie7||b(this.primaryColor,{h:60}),this.git7=this.pie8||b(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(wi,"Theme"),wi),O1=p(e=>{const t=new $1;return t.calculate(e),t},"getThemeVariables"),Si,R1=(Si=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=ut(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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||b(t,{h:30}),this.cScale4=this.cScale4||b(t,{h:60}),this.cScale5=this.cScale5||b(t,{h:90}),this.cScale6=this.cScale6||b(t,{h:120}),this.cScale7=this.cScale7||b(t,{h:150}),this.cScale8=this.cScale8||b(t,{h:210,l:150}),this.cScale9=this.cScale9||b(t,{h:270}),this.cScale10=this.cScale10||b(t,{h:300}),this.cScale11=this.cScale11||b(t,{h:330}),this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||I(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(Si,"Theme"),Si),I1=p(e=>{const t=new R1;return t.calculate(e),t},"getThemeVariables"),vi,P1=(vi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#323D47"),10),this.border1="#ccc",this.border2=ir(255,255,255,.25),this.arrowheadColor=I(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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(vi,"Theme"),vi),D1=p(e=>{const t=new P1;return t.calculate(e),t},"getThemeVariables"),Ti,N1=(Ti=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=ut("#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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=this.mainBkg;if(this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||I(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(Ti,"Theme"),Ti),q1=p(e=>{const t=new N1;return t.calculate(e),t},"getThemeVariables"),_i,z1=(_i=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#323D47"),10),this.border1="#ccc",this.border2=ir(255,255,255,.25),this.arrowheadColor=I(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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(_i,"Theme"),_i),j1=p(e=>{const t=new z1;return t.calculate(e),t},"getThemeVariables"),Bi,W1=(Bi=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=ut(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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||I(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(Bi,"Theme"),Bi),H1=p(e=>{const t=new W1;return t.calculate(e),t},"getThemeVariables"),Li,Y1=(Li=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#323D47"),10),this.border1="#ccc",this.border2=ir(255,255,255,.25),this.arrowheadColor=I(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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=Y(this["cScale"+r],75);const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(Li,"Theme"),Li),U1=p(e=>{const t=new Y1;return t.calculate(e),t},"getThemeVariables"),or={base:{getThemeVariables:B1},dark:{getThemeVariables:E1},default:{getThemeVariables:_u},forest:{getThemeVariables:M1},neutral:{getThemeVariables:O1},neo:{getThemeVariables:I1},"neo-dark":{getThemeVariables:D1},redux:{getThemeVariables:q1},"redux-dark":{getThemeVariables:j1},"redux-color":{getThemeVariables:H1},"redux-dark-color":{getThemeVariables:U1}},Zt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},Bu={...Zt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:or.default.getThemeVariables(),sequence:{...Zt.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Zt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Zt.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Zt.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Zt.pie,useWidth:984},xyChart:{...Zt.xyChart,useWidth:void 0},requirement:{...Zt.requirement,useWidth:void 0},packet:{...Zt.packet},eventmodeling:{...Zt.eventmodeling},treeView:{...Zt.treeView,useWidth:void 0},radar:{...Zt.radar},railroad:{...Zt.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Zt.ishikawa},sankey:{...Zt.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Zt.venn},cynefin:{...Zt.cynefin}},Lu=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Lu(e[i],"")]:[...r,t+i],[]),"keyify"),G1=new Set(Lu(Bu,"")),Il=Bu,X1={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},V1=p((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(V.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),Bs=p(e=>{if(V.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Bs(t));return}for(const t of Object.keys(e)){if(V.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!G1.has(t)||e[t]==null){V.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=X1[t];i?V1(e[t],i):(V.debug("sanitizing object",t),Bs(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(V.debug("sanitizing css option",t),e[t]=Eu(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"),Eu=p(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"),Ri=Object.freeze(Il),Ve=p(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),fe=jt({},Ri),Ls,Wr=[],bo=jt({},Ri),ca=p((e,t)=>{let r=jt({},e),i={};for(const o of t)Mu(o),i=jt(i,o);if(r=jt(r,i),i.theme&&i.theme in or){const o=jt({},Ls),s=jt(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in or&&(r.themeVariables=or[r.theme].getThemeVariables(s))}return bo=r,Ou(bo),bo},"updateCurrentConfig"),K1=p(e=>(fe=jt({},Ri),fe=jt(fe,e),e.theme&&or[e.theme]&&(fe.themeVariables=or[e.theme].getThemeVariables(e.themeVariables)),ca(fe,Wr),fe),"setSiteConfig"),Z1=p(e=>{Ls=jt({},e)},"saveConfigFromInitialize"),Q1=p(e=>(fe=jt(fe,e),ca(fe,Wr),fe),"updateSiteConfig"),Fu=p(()=>jt({},fe),"getSiteConfig"),Au=p(e=>(Ou(e),jt(bo,e),Rt()),"setConfig"),Rt=p(()=>jt({},bo),"getConfig"),Mu=p(e=>{e&&(["secure",...fe.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(V.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&Mu(e[t])}))},"sanitize"),J1=p(e=>{Bs(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Wr.push(e),ca(fe,Wr)},"addDirective"),Es=p((e=fe)=>{Wr=[],ca(e,Wr)},"reset"),tk={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."},yc={},$u=p(e=>{yc[e]||(V.warn(tk[e]),yc[e]=!0)},"issueWarning"),Ou=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&$u("LAZY_LOAD_DEPRECATED")},"checkConfig"),ek=p(()=>{let e={};Ls&&(e=jt(e,Ls));for(const t of Wr)e=jt(e,t);return e},"getUserDefinedConfig"),ae=p(e=>(e.flowchart?.htmlLabels!=null&&$u("FLOWCHART_HTML_LABELS_DEPRECATED"),Ve(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),Ru=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,ko=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,rk=/\s*%%.*\n/gm,Ei,Iu=(Ei=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},p(Ei,"UnknownDiagramError"),Ei),Hr={},Pl=p(function(e,t){e=e.replace(Ru,"").replace(ko,"").replace(rk,`
8
- `);for(const[r,{detector:i}]of Object.entries(Hr))if(i(e,t))return r;throw new Iu(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Bn=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)Pu(t,r,i)},"registerLazyLoadedDiagrams"),Pu=p((e,t,r)=>{Hr[e]&&V.warn(`Detector with key ${e} already exists. Overwriting.`),Hr[e]={detector:t,loader:r},V.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),ik=p(e=>Hr[e].loader,"getDiagramLoader"),Hi=/<br\s*\/?>/gi,ok=p(e=>e?qu(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),sk=(()=>{let e=!1;return()=>{e||(Du(),e=!0)}})();function Du(){const e="data-temp-href-target";$i.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),$i.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"))})}p(Du,"setupDompurifyHooks");var Nu=p(e=>(sk(),$i.sanitize(e)),"removeScript"),xc=p((e,t)=>{if(ae(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Nu(e):r!=="loose"&&(e=qu(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=hk(e))}return e},"sanitizeMore"),Se=p((e,t)=>e&&(t.dompurifyConfig?e=$i.sanitize(xc(e,t),t.dompurifyConfig).toString():e=$i.sanitize(xc(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),ak=p((e,t)=>typeof e=="string"?Se(e,t):e.flat().map(r=>Se(r,t)),"sanitizeTextOrArray"),nk=p(e=>Hi.test(e),"hasBreaks"),lk=p(e=>e.split(Hi),"splitBreaks"),hk=p(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),qu=p(e=>e.replace(Hi,"#br#"),"breakToPlaceholder"),zu=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),ck=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),dk=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Ln=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let o=t[i];if(o===","&&i>0&&i+1<t.length){const s=t[i-1],a=t[i+1];uk(s,a)&&(o=s+","+a,i++,r.pop())}r.push(fk(o))}return r.join("")},"parseGenericTypes"),En=p((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),uk=p((e,t)=>{const r=En(e,"~"),i=En(t,"~");return r===1&&i===1},"shouldCombineSets"),fk=p(e=>{const t=En(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),s=i.lastIndexOf("~");for(;o!==-1&&s!==-1&&o!==s;)i[o]="<",i[s]=">",o=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),Cc=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Fn=/\$\$(.*?)\$\$/g,Ii=p(e=>(e.match(Fn)?.length??0)>0,"hasKatex"),gk=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Dl(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),pk=p(async(e,t)=>{if(!Ii(e))return e;if(!(Cc()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Fn,"MathML is unsupported in this environment.");{const{default:r}=await import("katex"),i=t.forceLegacyMathML||!Cc()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Hi).map(o=>Ii(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(Fn,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Dl=p(async(e,t)=>Se(await pk(e,t),t),"renderKatexSanitized"),Yi={getRows:ok,sanitizeText:Se,sanitizeTextOrArray:ak,hasBreaks:nk,splitBreaks:lk,lineBreakRegex:Hi,removeScript:Nu,getUrl:zu,evaluate:Ve,getMax:ck,getMin:dk},mk=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),yk=p(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"),Nl=p(function(e,t,r,i){const o=yk(t,r,i);mk(e,o)},"configureSvgSize"),ju=p(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,a=o.height;V.info(`SVG bounds: ${s}x${a}`,o);let n=0,l=0;V.info(`Graph bounds: ${n}x${l}`,e),n=s+r*2,l=a+r*2,V.info(`Calculated bounds: ${n}x${l}`),Nl(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),fs={};function An(e){return[...e.cssRules].map(t=>t.cssText).join(`
6
+ <%s key={someKey} {...props} />`,G,Z,at,Z),z[Z+G]=!0)}if(Z=null,j!==void 0&&(r(j),Z=""+j),a(W)&&(r(W.key),Z=""+W.key),"key"in W){j={};for(var mt in W)mt!=="key"&&(j[mt]=W[mt])}else j=W;return Z&&n(j,typeof T=="function"?T.displayName||T.name||"Unknown":T),c(T,Z,j,o(),X,K)}function d(T){f(T)?T._store&&(T._store.validated=1):typeof T=="object"&&T!==null&&T.$$typeof===D&&(T._payload.status==="fulfilled"?f(T._payload.value)&&T._payload.value._store&&(T._payload.value._store.validated=1):T._store&&(T._store.validated=1))}function f(T){return typeof T=="object"&&T!==null&&T.$$typeof===g}var u=L,g=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"),w=Symbol.for("react.consumer"),S=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),P=Symbol.for("react.client.reference"),U=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,q=Array.isArray,A=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(T){return T()}};var $,O={},F=u.react_stack_bottom_frame.bind(u,s)(),R=A(i(s)),z={};to.Fragment=y,to.jsx=function(T,W,j){var G=1e4>U.recentlyCreatedOwnerStacks++;return h(T,W,j,!1,G?Error("react-stack-top-frame"):F,G?A(i(T)):R)},to.jsxs=function(T,W,j){var G=1e4>U.recentlyCreatedOwnerStacks++;return h(T,W,j,!0,G?Error("react-stack-top-frame"):F,G?A(i(T)):R)}})()),to}var tc;function IC(){return tc||(tc=1,process.env.NODE_ENV==="production"?Go.exports=OC():Go.exports=RC()),Go.exports}var k=IC();const ec=Object.freeze({display:"flex",flexDirection:"row",inlineSize:"100%",blockSize:"100%",minInlineSize:0,minBlockSize:0}),PC=Object.freeze({flex:"1 1 0%",minInlineSize:0,minBlockSize:0,overflow:"clip"}),DC=Object.freeze({display:"flex",flex:"none",minBlockSize:0}),NC=Object.freeze({position:"absolute",insetBlock:0,insetInline:0,overflowY:"scroll",visibility:"hidden",pointerEvents:"none"}),qC=Object.freeze({scrollbarWidth:"none"}),zC=.01,rc=Object.freeze({scroller:null,barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1}),Na=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t:0},jC=(e,t,r)=>{const i=getComputedStyle(e),o=Na(i.width),s=e.getBoundingClientRect();if(o<=0||s.width<=0)return{barInlineSize:0,nativeBarInlineSize:0,overlaysScrollbars:!1};const a=s.width/o,n=(s.width-t.getBoundingClientRect().width)/a-Na(i.borderLeftWidth)-Na(i.borderRightWidth),l=Math.max(0,Math.ceil(n-zC));return{barInlineSize:r.getBoundingClientRect().width/a,nativeBarInlineSize:l,overlaysScrollbars:l===0&&t.offsetWidth>0&&t.offsetWidth===t.clientWidth}},WC=(e,t,r,i,o)=>{const[s,a]=L.useState(rc),n=L.useRef(o),l=L.useRef(0);return L.useLayoutEffect(()=>{n.current=o}),L.useLayoutEffect(()=>{const c=m=>{l.current!==m&&(l.current=m,n.current?.(m))},h=t.current,d=r.current,f=i.current;if(!e||h===null||d===null||f===null){a(rc),c(0);return}const u=()=>{const{barInlineSize:m,nativeBarInlineSize:y,overlaysScrollbars:x}=jC(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 g=new ResizeObserver(u);return g.observe(h),g.observe(d),g.observe(f),window.addEventListener("resize",u),()=>{g.disconnect(),window.removeEventListener("resize",u)}},[e,t,r,i]),s},HC=(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 du({scrollerProps:e,scrollerRef:t,children:r,renderScrollBar:i,rowClassName:o,rowStyle:s,onBarInlineSizeChange:a}){const n=L.useRef(null),l=L.useRef(null),c=L.useRef(null),h=i!==void 0,d=WC(h,n,l,c,a),f=L.useCallback(m=>{n.current=m;const y=HC(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?qC:void 0}:e.style,g=k.jsxs("div",{...e,ref:f,style:u,children:[r,h&&k.jsx("span",{ref:l,"data-aqmd-scroll-bar-probe":!0,"aria-hidden":"true",style:NC})]});return h?k.jsxs("div",{"data-aqmd-scroll-row":!0,className:o,style:s===void 0?ec:{...ec,...s},children:[k.jsx("div",{"data-aqmd-scroll-clip":!0,style:PC,children:g}),k.jsx("div",{ref:c,"data-aqmd-scroll-bar":!0,style:DC,children:d.scroller!==null&&i(d.scroller)})]}):g}const YC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),UC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase()),ic=e=>{const t=UC(e);return t.charAt(0).toUpperCase()+t.slice(1)},uu=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim(),GC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var XC={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 VC=L.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:s,iconNode:a,...n},l)=>L.createElement("svg",{ref:l,...XC,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:uu("lucide",o),...!s&&!GC(n)&&{"aria-hidden":"true"},...n},[...a.map(([c,h])=>L.createElement(c,h)),...Array.isArray(s)?s:[s]]));const Tt=(e,t)=>{const r=L.forwardRef(({className:i,...o},s)=>L.createElement(VC,{ref:s,iconNode:t,className:uu(`lucide-${YC(ic(e))}`,`lucide-${e}`,i),...o}));return r.displayName=ic(e),r};const KC=[["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"}]],ZC=Tt("image-off",KC);class QC extends L.Component{constructor(t){super(t),this.state={content:t.content,failed:!1}}static getDerivedStateFromProps(t,r){return t.content===r.content?null:{content:t.content,failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?k.jsxs("div",{"data-aqmd-block-failure":"",children:[k.jsx("p",{"data-aqmd-block-failure-notice":"",lang:this.props.label.lang,children:this.props.label.text}),k.jsx("pre",{"data-aqmd-block-failure-text":"",children:this.props.text()})]}):this.props.children}}const fu=Object.freeze({blockFailed:{text:"This block could not be shown.",lang:"en"}}),JC=1024,_s=(e,t)=>e.fingerprint===t.fingerprint&&e.content===t.content,tb=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&_s(e[r],t[r]);)r+=1;let i=0;for(;i<e.length-r&&i<t.length-r&&_s(e[e.length-1-i],t[t.length-1-i]);)i+=1;const o=Array.from({length:r},(n,l)=>[l,l]),s=Array.from({length:i},(n,l)=>[e.length-i+l,t.length-i+l]),a=eb(e,t,r,e.length-i,t.length-i);return[...o,...a,...s]},eb=(e,t,r,i,o)=>{const s=new Set(e.slice(r,i).map(S=>S.fingerprint)),a=new Set(t.slice(r,o).map(S=>S.fingerprint)),n=[];for(let S=r;S<i;S+=1)a.has(e[S].fingerprint)&&n.push(S);const l=[];for(let S=r;S<o;S+=1)s.has(t[S].fingerprint)&&l.push(S);const c=n.length,h=l.length;if(c===0||h===0)return[];const d=(S,v)=>_s(e[n[S]],t[l[v]]),f=(S,v)=>e[n[S]].fingerprint===t[l[v]].fingerprint,u=(S,v)=>{let _=S;for(;_<c&&_+v<h&&d(_,_+v);)_+=1;return _},g=[Int32Array.of(u(0,0))],m=[Uint8Array.of(qa)],y=h-c;let x=0;for(;!(y>=-x&&y<=x&&g[x][y+x]===c);){if(x+=1,x>JC)return[];const S=g[x-1],v=B=>B>=-(x-1)&&B<=x-1?S[B+x-1]:-1,_=new Int32Array(2*x+1).fill(-1),E=new Uint8Array(2*x+1);for(let B=-x;B<=x;B+=1){if(B<-c||B>h)continue;let D=-1,M=qa;const P=v(B);P!==-1&&P<c&&P+B<h&&f(P,P+B)&&(D=P+1,M=oc);const U=v(B+1);U!==-1&&U+1<=c&&U+1>D&&(D=U+1,M=sc);const N=v(B-1);N!==-1&&N+B<=h&&N>D&&(D=N,M=za),D!==-1&&(_[B+x]=u(D,B),E[B+x]=M)}g.push(_),m.push(E)}const C=[];let w=y;for(let S=x;S>=0;S-=1){const v=g[S][w+S],_=m[S][w+S],E=_===sc?w+1:_===za?w-1:w,B=_===qa?0:g[S-1][E+S-1]+(_===za?0:1);for(let D=v-1;D>=B;D-=1)C.push([n[D],l[D+w]]);_===oc&&C.push([n[B-1],l[B-1+w]]),w=E}return C.reverse()},qa=0,oc=1,sc=2,za=3,rb=(e,t)=>{const r=e.map(()=>null),i=new Set;for(const[n,l]of tb(t,e))r[l]=t[n].key,i.add(n);const o=new Map;for(const[n,l]of t.entries()){if(i.has(n))continue;const c=o.get(l.fingerprint);c===void 0?o.set(l.fingerprint,[n]):c.push(n)}const s=n=>{for(const[l,c]of e.entries()){if(r[l]!==null)continue;const h=o.get(c.fingerprint),d=h===void 0?-1:h.findIndex(f=>n(c,t[f]));h!==void 0&&d!==-1&&(r[l]=t[h.splice(d,1)[0]].key)}};s(_s),s(()=>!0);const a=new Set(r.filter(n=>n!==null));return e.map((n,l)=>{let c=r[l];if(c===null){let h=0;for(;a.has(`${n.fingerprint}.${h}`);)h+=1;c=`${n.fingerprint}.${h}`,a.add(c)}return{...n,key:c}})};const ib=[["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"}]],ob=Tt("building-2",ib);const sb=[["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"}]],ac=Tt("globe",sb),ab=/^[a-z]{2,3}$/u,nb=e=>{const t=e.trim().split("-",1)[0]?.toLowerCase()??"";return ab.test(t)?t:null},lb=()=>()=>{},hb=e=>{const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>t.disconnect()},Ml=()=>L.useSyncExternalStore(lb,()=>window.location.origin,()=>null),cb=()=>L.useSyncExternalStore(hb,()=>nb(document.documentElement.lang),()=>null),db=/^[1-9]\d{0,4}$/u,nc=e=>e!==void 0&&db.test(e.trim())?Number(e.trim()):null,ub=({embed:e,label:t,insideAnchor:r,children:i})=>{const o=Ml(),s=new URL(e.src);if(o!==null&&s.origin!==o&&!r)return i;const a=nc(e.attributes.width),n=nc(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 k.jsx("span",{"data-embed-frame":o===null?"pending":"refused","data-aqmd-embed-surface":l===void 0?void 0:"",style:l,className:l===void 0?void 0:"flex items-center justify-center rounded-lg p-2 text-center",children:r?k.jsx("span",{lang:h,children:`${c??t.text}: ${s.hostname}`}):k.jsx("a",{href:s.href,target:"_blank",rel:"noreferrer",lang:h,children:c??`${t.text}: ${s.hostname}`})})},gu=({concurrency:e,capacity:t,timeoutMs:r})=>{for(const[h,d]of Object.entries({concurrency:e,capacity:t,timeoutMs:r}))if(!Number.isInteger(d)||d<=0)throw new RangeError(`[@aiquants/markdown] request queue ${h} must be a positive integer; got ${String(d)}`);const i=new Map,o=new Map,s=[];let a=0;const n=(h,d,f)=>{if(o.get(h)===d&&(o.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=s.shift();if(h===void 0)return;const d=o.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 g=o.get(h);g===void 0&&(g={start:d,subscriptions:new Set,controller:null},o.set(h,g),s.push(h));const m=g,y={listener:f};return m.subscriptions.add(y),l(),()=>{m.subscriptions.delete(y),!(m.subscriptions.size>0||o.get(h)!==m)&&(o.delete(h),m.controller===null?s.splice(s.indexOf(h),1):m.controller.abort())}}})},fb=gu({concurrency:2,capacity:256,timeoutMs:15e3}),gb="[data-aqmd-scroll-container]",pb=async(e,t)=>{let r;try{r=await fetch(e,{credentials:"same-origin",redirect:"error",headers:{accept:"application/json"},signal:t})}catch(s){if(t.aborted)throw s;return{kind:"error",cause:"network error"}}if(r.status===204){const s=We.linkCardSkipReasonOf(r.headers.get(We.LINK_CARD_SKIP_HEADER));return s===null?{kind:"error",cause:"HTTP 204 without a known skip reason"}:{kind:"skip",reason:s}}if(!r.ok)return{kind:"error",cause:`HTTP ${r.status}`};let i;try{i=await r.json()}catch(s){if(t.aborted)throw s;return{kind:"error",cause:`HTTP ${r.status}, not JSON`}}const o=We.linkCardMetadataOf(i);return o===null?{kind:"error",cause:`HTTP ${r.status}, not a JSON object`}:{kind:"card",metadata:o}},mb=e=>e.ok?e.value.kind==="card"?null:e.value.kind==="skip"?e.value.reason:e.value.cause:"network error",lc=(e,t)=>e!==null&&new URL(e).hostname!==t?e:null,ja=({tile:e,tileKind:t,primary:r,secondary:i})=>k.jsxs("span",{className:"flex min-w-0 flex-auto items-center gap-3 px-3",children:[k.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}),k.jsxs("span",{className:"flex min-w-0 flex-col gap-0.5",children:[k.jsx("span",{className:"truncate font-semibold text-[0.875rem] leading-5",children:r}),k.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-xs leading-4",children:i})]})]}),yb=({href:e,endpoint:t,size:r,fallback:i})=>{const o=Ml(),s=L.useRef(null),a=new URL(e),n=`${t}
7
+ ${a.href}`,[l,c]=L.useState(null);L.useEffect(()=>{const x=s.current;if(x===null||o===null)return;let C=null;const w=new IntersectionObserver(S=>{C!==null||!S.some(v=>v.isIntersecting)||(w.disconnect(),C=fb.subscribe(n,v=>pb(We.linkCardRequestOf(t,new URL(e),o),v),v=>{c({key:n,outcome:v});const _=mb(v);_!==null&&wn.linkCardLogger.info(`No link card for ${e} (${_})`)}))},{root:x.closest(gb),rootMargin:"100% 0px"});return w.observe(x),()=>{w.disconnect(),C?.()}},[n,t,e,o]);const h=l!==null&&l.key===n?l.outcome:null;if(h!==null&&!h.ok)return i;const d=h===null?null:h.value;if(d!==null&&d.kind==="error")return i;if(d===null||o===null)return k.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","aria-busy":"true","data-link-card":"pending","data-link-card-size":r,children:r==="compact"?k.jsx(ja,{tile:null,tileKind:"pending",primary:a.hostname,secondary:e}):k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-2 px-4 py-3.5",children:[k.jsx("span",{"aria-hidden":"true",className:"block h-3.5 w-2/3 rounded bg-(--aqmd-link-card-border) motion-safe:animate-pulse"}),k.jsx("span",{className:"truncate text-(--aqmd-link-card-muted) text-[0.8125rem] leading-[1.125rem]",children:a.hostname}),k.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",w=C?ob:ac;return k.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"compact","data-link-card-reason":x,"data-link-card-size":"compact",children:k.jsx(ja,{tile:k.jsx(w,{"aria-hidden":"true",className:"size-4"}),tileKind:C?"internal":"link",primary:a.hostname,secondary:e})})}const{metadata:f}=d,u=new URL(o).hostname,g=lc(f.image,u),m=lc(f.icon,u),y=f.siteName===null?a.hostname:`${f.siteName} · ${a.hostname}`;return r==="compact"?k.jsx("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":"compact",children:k.jsx(ja,{tile:m===null?k.jsx(ac,{"aria-hidden":"true",className:"size-4"}):k.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})}):k.jsxs("a",{ref:s,href:e,target:"_blank",rel:"noreferrer","data-link-card":"ready","data-link-card-size":r,children:[k.jsxs("span",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1 px-4 py-3.5",children:[k.jsx("span",{className:"wrap-anywhere line-clamp-2 font-semibold text-[0.9375rem] leading-5",children:f.title??e}),f.description===null?null:k.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}),k.jsxs("span",{className:"mt-1 flex items-center gap-1.5 text-(--aqmd-link-card-muted) text-xs leading-4",children:[m===null?null:k.jsx("img",{src:m,alt:"",width:16,height:16,loading:"lazy",referrerPolicy:"no-referrer",className:"size-4 shrink-0 rounded-[3px]"}),k.jsx("span",{className:"truncate",children:y})]})]}),g===null?null:k.jsx("img",{src:g,alt:"",loading:"lazy",referrerPolicy:"no-referrer"})]})},pu=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(!jr.isEmbedProviderId(t))throw new RangeError(`[@aiquants/markdown] embeds.providers holds an unknown provider id ${JSON.stringify(t)}; known ids are ${jr.EMBED_PROVIDER_IDS.join(", ")}`);if(e.linkCardEndpoint!==null&&!We.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&&!We.isLinkCardSize(e.linkCardSize))throw new RangeError(`[@aiquants/markdown] embeds.linkCardSize must be omitted or one of ${We.LINK_CARD_SIZES.join(", ")}; got ${JSON.stringify(e.linkCardSize)}`);return e},ho=new WeakMap;let Xo=0;const hc=e=>{if(e.source===null)return;const t=ho.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(jr.EMBED_FRAME_HEIGHT_LIMITS.max,Math.max(jr.EMBED_FRAME_HEIGHT_LIMITS.min,Math.ceil(r)));i!==t.last&&(t.last=i,t.watch.set(i))},xb=(e,t)=>{const r={watch:t,last:null};return ho.has(e)||(Xo+=1,Xo===1&&window.addEventListener("message",hc)),ho.set(e,r),()=>{ho.get(e)===r&&(ho.delete(e),Xo-=1,Xo===0&&window.removeEventListener("message",hc))}},Cb=gu({concurrency:2,capacity:256,timeoutMs:5e3}),bb=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()},kb=(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`}}},wb=Object.freeze({marginInline:0}),Wa=Object.freeze({kind:"pending"}),Sb=Object.freeze({kind:"narrow"}),vb=Object.freeze({kind:"fallback"}),Tb=(e,t,r,i,o)=>{if(t===null)return Wa;let s;if(e.kind==="frame")s=e.srcOf(r);else{if(i===null)return Wa;s=i.ok?e.srcOf(i.value,r):null}if(s===null||new URL(s).origin===t)return vb;const{minWidth:a,maxWidth:n}=e.layout;if(a!==null){if(o===null)return Wa;if(Math.min(o,n??Number.POSITIVE_INFINITY)<a)return Sb}return{kind:"frame",src:s}},_b=({resolution:e,caption:t,fallback:r,theme:i,labels:o})=>{const s=Ml(),a=cb(),[n,l]=L.useState(null),[c,h]=L.useState(null),d=e.kind==="lookup"?e.request.href:null,[f,u]=L.useState(null);L.useEffect(()=>{if(d!==null)return Cb.subscribe(d,B=>bb(new URL(d),B),B=>u({key:d,outcome:B}))},[d]);const{provider:g,layout:m}=e,y=Tb(e,s,{theme:i,lang:a},f!==null&&f.key===d?f.outcome:null,n),x=L.useCallback(B=>{if(B===null)return;l(B.getBoundingClientRect().width);const D=new ResizeObserver(()=>l(B.getBoundingClientRect().width));return D.observe(B),()=>D.disconnect()},[]),C=y.kind==="frame"?y.src:null,w=c!==null&&c.src===C?c.height:null,S=L.useCallback(B=>{if(!(B===null||B.contentWindow===null||m.kind!=="message"||C===null))return xb(B.contentWindow,{origin:g.frameOrigin,src:C,heightOf:m.heightOf,set:D=>h({src:C,height:D})})},[m,g.frameOrigin,C]);if(y.kind==="fallback")return r;const v=m.minWidth===null?null:k.jsx("span",{ref:x,"aria-hidden":"true","data-embed-measure":g.id,className:"block h-0"});if(y.kind==="narrow")return k.jsxs(k.Fragment,{children:[v,r]});const _=g.content==="video"?o.embeddedVideo:o.embeddedPost,{frame:E}=g;return k.jsxs(k.Fragment,{children:[v,k.jsxs("figure",{"data-embed-provider":g.id,"data-embed-state":y.kind,style:wb,children:[k.jsx("div",{"data-embed-box":"","data-aqmd-embed-surface":"",style:kb(m,w),className:"noscript:hidden overflow-hidden rounded-lg",children:y.kind==="frame"?k.jsx("iframe",{ref:S,src:y.src,title:`${g.name}: ${_.text}`,lang:_.lang,loading:"lazy",allow:E.allow??void 0,allowFullScreen:E.allowFullScreen,sandbox:E.sandbox,referrerPolicy:E.referrerPolicy,scrolling:E.scrolling??void 0,className:"block h-full w-full border-0"},y.src):null}),k.jsx("figcaption",{className:"mt-2",children:t})]})]})},Bb=["title","width","height","allow","allowfullscreen","sandbox","referrerpolicy","loading","frameborder","scrolling"],Lb=(e,t)=>mr.allowedFrameUrlOf(e,t)!==null,Eb=(e,t)=>{const r=new Map(Object.entries(e).map(([s,a])=>[s.toLowerCase(),a])),i=mr.allowedFrameUrlOf(r.get("src"),t);if(i===null)return null;const o={};for(const s of Bb){const a=r.get(s);if(a!==void 0)if(s==="allow"){const n=mr.reduceFrameFeatures(a);n!==null&&(o.allow=n)}else if(s==="referrerpolicy"){const n=a.trim().toLowerCase();mr.EMBED_FRAME_REFERRER_POLICIES.has(n)&&(o.referrerpolicy=n)}else o[s]=a}return Object.freeze({src:i.href,attributes:Object.freeze(o)})},Fb=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"]),Ab=new Set(["id","class","title","lang","dir","role","hidden","translate","style"]),Mb=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"]),cc="language-",$b=/[\t\n\f\r ]+/u,Ob=new Set(["h1","h2","h3","h4","h5","h6"]),dc=Object.freeze({sup:/^fnref\d*:\d+$/u,li:/^fn:\d+$/u}),uc="user-content-",Kt=["align"],ni=["width","height"],fc=["colspan","rowspan","headers","scope","abbr","align","valign","width","height"],Ha=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:Kt,cite:[],code:[It.CODE_META_ATTRIBUTE],col:["span",...Kt,...ni],colgroup:["span",...Kt,...ni],dd:[],del:["cite","datetime"],details:["open"],dfn:[],div:Kt,dl:[],dt:[],em:[],figcaption:[],figure:[],footer:[],h1:Kt,h2:Kt,h3:Kt,h4:Kt,h5:Kt,h6:Kt,header:[],hgroup:[],hr:[],i:[],img:["src","alt","loading","decoding",...Kt,...ni,"data-asset-src","data-asset-exists"],ins:["cite","datetime"],kbd:[],li:["value"],main:[],mark:[],nav:[],ol:["start","reversed","type"],p:Kt,pre:[],q:["cite"],rp:[],rt:[],ruby:[],s:[],samp:[],section:["data-footnotes"],small:[],source:["src","type"],span:[],strong:[],sub:[],summary:[],sup:[],table:[...Kt,"border",...ni],tbody:[...Kt,"valign"],td:fc,tfoot:[...Kt,"valign"],th:fc,thead:[...Kt,"valign"],time:["datetime"],tr:[...Kt,"valign"],u:[],ul:[],var:[],video:["src","poster","controls","loop","muted","playsinline","preload",...ni],wbr:[]}),Ya=Object.freeze({svg:["viewbox","version","xmlns","focusable","fill",...ni],g:["fill","fill-rule","clip-rule"],path:["d","fill","fill-rule","clip-rule"]}),Rb=new Set(["svg","g"]),Ib=new Set(["href","src","cite","poster",mr.EMBED_LINK_ATTRIBUTE]),Pb=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/gu,Db=/^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/iu,Nb=new Set(["left","right","center","justify","start","end"]),qo=e=>Db.test(e.replace(Pb,"")),qb=e=>{let t=null;for(const r of e.split(";")){const i=r.indexOf(":");if(i<0||r.slice(0,i).trim().toLowerCase()!=="text-align")continue;const o=r.slice(i+1).trim().toLowerCase();Nb.has(o)&&(t=o)}return t===null?null:`text-align: ${t}`},zb=e=>{const t=e.split($b).filter(r=>Mb.has(r)||r.startsWith(cc)&&r.length>cc.length);return t.length===0?null:t.join(" ")},jb=(e,t)=>Ob.has(e)||t.startsWith(uc)&&t.length>uc.length||Object.hasOwn(dc,e)&&dc[e].test(t),Wb=e=>{const t=new Map;for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();t.has(o)||t.set(o,i)}return t},eo=(e,t,r)=>{const i={};for(const[o,s]of t){if(o===Mi.SOURCE_LINES_ATTRIBUTE){Mi.parseSourceLines(s)!==null&&(i[o]=s);continue}if((Ab.has(o)||r.includes(o)||o.startsWith("aria-")&&o.length>5)&&!(Ib.has(o)&&!qo(s))&&!(o==="fill"&&/url\s*\(/iu.test(s))&&!(o==="id"&&!jb(e,s))){if(o==="class"||o==="style"){const a=o==="class"?zb(s):qb(s);a!==null&&(i[o]=a);continue}i[o]=s}}return i},Hb=e=>e.get("type")?.trim().toLowerCase()==="checkbox"&&e.has("disabled"),la=(e,t,r)=>{const i=e.toLowerCase(),o=r.parentName===null?null:r.parentName.toLowerCase(),s=Wb(t);if(o!==null&&Rb.has(o)){const n=i!=="svg"&&Object.hasOwn(Ya,i)?Ya[i]:void 0;return n===void 0?{action:"remove"}:{action:"keep",attributes:eo(i,s,n)}}if(i==="svg")return{action:"keep",attributes:eo(i,s,Ya.svg)};if(i==="iframe"){const n=Eb(Object.fromEntries(s),r.iFrameAllowedDomains);return n===null?{action:"remove"}:{action:"embed",embed:n,pluginType:s.get("data-plugin-type")??null}}if(i==="p"){const n=eo(i,s,Ha.p),l=s.get(mr.EMBED_LINK_ATTRIBUTE);return l!==void 0&&qo(l)?{action:"placeholder",attributes:n,link:l}:{action:"keep",attributes:n}}if(i==="input")return Hb(s)?{action:"keep",attributes:eo(i,s,["type","checked","disabled"])}:{action:"remove"};if(Fb.has(i))return{action:"remove"};const a=Object.hasOwn(Ha,i)?Ha[i]:void 0;return a===void 0?{action:"unwrap"}:{action:"keep",attributes:eo(i,s,a)}};typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(t,r){r=r||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,r.bubbles,r.cancelable,r.detail),i}));const Yb=typeof document<"u"&&!!document.documentMode;let Ua;function Ub(){return Ua||(Ua=document.createElement("div").style)}const gc=["webkit","moz","ms"],Vo={};function $l(e){if(Vo[e])return Vo[e];const t=Ub();if(e in t)return Vo[e]=e;const r=e[0].toUpperCase()+e.slice(1);let i=gc.length;for(;i--;){const o=`${gc[i]}${r}`;if(o in t)return Vo[e]=o}}function Ko(e,t){return parseFloat(t[$l(e)])||0}function Zo(e,t,r=window.getComputedStyle(e)){const i=t==="border"?"Width":"";return{left:Ko(`${t}Left${i}`,r),right:Ko(`${t}Right${i}`,r),top:Ko(`${t}Top${i}`,r),bottom:Ko(`${t}Bottom${i}`,r)}}function ui(e,t,r){e.style[$l(t)]=r}function Gb(e,t){const r=$l("transform");ui(e,"transition",`${r} ${t.duration}ms ${t.easing}`)}function Xb(e,{x:t,y:r,scale:i,isSVG:o},s){if(ui(e,"transform",`scale(${i}) translate(${t}px, ${r}px)`),o&&Yb){const a=window.getComputedStyle(e).getPropertyValue("transform");e.setAttribute("transform",a)}}function Ga(e){let t=e.parentNode;(!t||t.nodeType!==1)&&(t=document.documentElement);const r=window.getComputedStyle(e),i=window.getComputedStyle(t),o=e.getBoundingClientRect(),s=t.getBoundingClientRect();return{elem:{style:r,width:o.width,height:o.height,top:o.top,bottom:o.bottom,left:o.left,right:o.right,margin:Zo(e,"margin",r),border:Zo(e,"border",r)},parent:{style:i,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,padding:Zo(t,"padding",i),border:Zo(t,"border",i)}}}let Bo={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Bo={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Bo={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function Xa(e,t,r,i){Bo[e].split(" ").forEach(o=>{t.addEventListener(o,r,i)})}function Va(e,t,r){Bo[e].split(" ").forEach(i=>{t.removeEventListener(i,r)})}function mu(e,t){let r=e.length;for(;r--;)if(e[r].pointerId===t.pointerId)return r;return-1}function vn(e,t){let r;if(t.touches){r=0;for(const i of t.touches)i.pointerId=r++,vn(e,i);return}r=mu(e,t),r>-1&&e.splice(r,1),e.push(t)}function Vb(e,t){if(t.touches){for(;e.length;)e.pop();return}const r=mu(e,t);r>-1&&e.splice(r,1)}function pc(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 Ka(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 Kb(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 Zb(e){return(e.getAttribute("class")||"").trim()}function Qb(e,t){return e.nodeType===1&&` ${Zb(e)} `.indexOf(` ${t} `)>-1}function Jb(e,t){for(let r=e;r!=null;r=r.parentNode)if(Qb(r,t.excludeClass)||t.exclude.indexOf(r)>-1)return!0;return!1}const t1=/^http:[\w\.\/]+svg$/;function e1(e){return t1.test(e.namespaceURI)&&e.nodeName.toLowerCase()!=="svg"}function r1(e){const t={};for(const r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}const yu={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:Xb,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function xu(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(!Kb(e))throw new Error("Panzoom should be called on elements that have been attached to the DOM");t={...yu,...t};const r=e1(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,ui(e,"transformOrigin",typeof t.origin=="string"?t.origin:r?"0 0":"50% 50%");function o(){i.style.overflow="",i.style.userSelect="",i.style.touchAction="",i.style.cursor="",e.style.cursor="",e.style.userSelect="",e.style.touchAction="",ui(e,"transformOrigin","")}function s(R={}){for(const z in R)R.hasOwnProperty(z)&&(t[z]=R[z]);(R.hasOwnProperty("cursor")||R.hasOwnProperty("canvas"))&&(i.style.cursor=e.style.cursor="",(t.canvas?i:e).style.cursor=t.cursor),R.hasOwnProperty("overflow")&&(i.style.overflow=R.overflow),R.hasOwnProperty("touchAction")&&(i.style.touchAction=R.touchAction,e.style.touchAction=R.touchAction)}let a=0,n=0,l=1,c=!1;m(t.startScale,{animate:!1,force:!0}),setTimeout(()=>{g(t.startX,t.startY,{animate:!1,force:!0})});function h(R,z,T){if(T.silent)return;const W=new CustomEvent(R,{detail:z});e.dispatchEvent(W)}function d(R,z,T){const W={x:a,y:n,scale:l,isSVG:r,originalEvent:T};return requestAnimationFrame(()=>{typeof z.animate=="boolean"&&(z.animate?Gb(e,z):ui(e,"transition","none")),z.setTransform(e,W,z),h(R,W,z),h("panzoomchange",W,z)}),W}function f(R,z,T,W){const j={...t,...W},G={x:a,y:n,opts:j};if(!W?.force&&(j.disablePan||j.panOnlyWhenZoomed&&l===j.startScale))return G;if(R=parseFloat(R),z=parseFloat(z),j.disableXAxis||(G.x=(j.relative?a:0)+R),j.disableYAxis||(G.y=(j.relative?n:0)+z),j.contain){const X=Ga(e),K=X.elem.width/l,Z=X.elem.height/l,at=K*T,mt=Z*T,ht=(at-K)/2,ct=(mt-Z)/2;if(j.contain==="inside"){const _t=(-X.elem.margin.left-X.parent.padding.left+ht)/T,Ct=(X.parent.width-at-X.parent.padding.left-X.elem.margin.left-X.parent.border.left-X.parent.border.right+ht)/T;G.x=Math.max(Math.min(G.x,Ct),_t);const Et=(-X.elem.margin.top-X.parent.padding.top+ct)/T,Nt=(X.parent.height-mt-X.parent.padding.top-X.elem.margin.top-X.parent.border.top-X.parent.border.bottom+ct)/T;G.y=Math.max(Math.min(G.y,Nt),Et)}else if(j.contain==="outside"){const _t=(-(at-X.parent.width)-X.parent.padding.left-X.parent.border.left-X.parent.border.right+ht)/T,Ct=(ht-X.parent.padding.left)/T;G.x=Math.max(Math.min(G.x,Ct),_t);const Et=(-(mt-X.parent.height)-X.parent.padding.top-X.parent.border.top-X.parent.border.bottom+ct)/T,Nt=(ct-X.parent.padding.top)/T;G.y=Math.max(Math.min(G.y,Nt),Et)}}return j.roundPixels&&(G.x=Math.round(G.x),G.y=Math.round(G.y)),G}function u(R,z){const T={...t,...z},W={scale:l,opts:T};if(!z?.force&&T.disableZoom)return W;let j=t.minScale,G=t.maxScale;if(T.contain){const X=Ga(e),K=X.elem.width/l,Z=X.elem.height/l;if(K>1&&Z>1){const at=X.parent.width-X.parent.border.left-X.parent.border.right,mt=X.parent.height-X.parent.border.top-X.parent.border.bottom,ht=at/K,ct=mt/Z;t.contain==="inside"?G=Math.min(G,ht,ct):t.contain==="outside"&&(j=Math.max(j,ht,ct))}}return W.scale=Math.min(Math.max(R,j),G),W}function g(R,z,T,W){const j=f(R,z,l,T);return a!==j.x||n!==j.y?(a=j.x,n=j.y,d("panzoompan",j.opts,W)):{x:a,y:n,scale:l,isSVG:r,originalEvent:W}}function m(R,z,T){const W=u(R,z),j=W.opts;if(!z?.force&&j.disableZoom)return;R=W.scale;let G=a,X=n;if(j.focal){const Z=j.focal;G=(Z.x/R-Z.x/l+a*R)/R,X=(Z.y/R-Z.y/l+n*R)/R}const K=f(G,X,R,{relative:!1,force:!0});return a=K.x,n=K.y,l=R,d("panzoomzoom",j,T)}function y(R,z){const T={...t,animate:!0,...z};return m(l*Math.exp((R?1:-1)*T.step),T)}function x(R){return y(!0,R)}function C(R){return y(!1,R)}function w(R,z,T,W){const j=Ga(e),G={width:j.parent.width-j.parent.padding.left-j.parent.padding.right-j.parent.border.left-j.parent.border.right,height:j.parent.height-j.parent.padding.top-j.parent.padding.bottom-j.parent.border.top-j.parent.border.bottom};let X=z.clientX-j.parent.left-j.parent.padding.left-j.parent.border.left-j.elem.margin.left,K=z.clientY-j.parent.top-j.parent.padding.top-j.parent.border.top-j.elem.margin.top;r||(X-=j.elem.width/l/2,K-=j.elem.height/l/2);const Z={x:X/G.width*(G.width*R),y:K/G.height*(G.height*R)};return m(R,{...T,animate:!1,focal:Z},W)}function S(R,z){R.preventDefault();const T={...t,...z,animate:!1},j=(R.deltaY===0&&R.deltaX?R.deltaX:R.deltaY)<0?1:-1,G=u(l*Math.exp(j*T.step/3),T).scale;return w(G,R,T,R)}function v(R){const z={...t,animate:!0,force:!0,...R};l=u(z.startScale,z).scale;const T=f(z.startX,z.startY,l,z);return a=T.x,n=T.y,d("panzoomreset",z)}let _,E,B,D,M,P;const U=[];function N(R){if(Jb(R.target,t))return;vn(U,R),c=!0,t.handleStartEvent(R),_=a,E=n,h("panzoomstart",{x:a,y:n,scale:l,isSVG:r,originalEvent:R},t);const z=pc(U);B=z.clientX,D=z.clientY,M=l,P=Ka(U)}function q(R){if(!c||_===void 0||E===void 0||B===void 0||D===void 0)return;vn(U,R);const z=pc(U),T=U.length>1;let W=l;if(T){P===0&&(P=Ka(U));const j=Ka(U)-P;W=u(j*t.step/80+M).scale,w(W,z,{animate:!1},R)}(!T||t.pinchAndPan)&&g(_+(z.clientX-B)/W,E+(z.clientY-D)/W,{animate:!1},R)}function A(R){U.length===1&&h("panzoomend",{x:a,y:n,scale:l,isSVG:r,originalEvent:R},t),Vb(U,R),c&&(c=!1,_=E=B=D=void 0)}let $=!1;function O(){$||($=!0,Xa("down",t.canvas?i:e,N),Xa("move",document,q,{passive:!0}),Xa("up",document,A,{passive:!0}))}function F(){$=!1,Va("down",t.canvas?i:e,N),Va("move",document,q),Va("up",document,A)}return t.noBind||O(),{bind:O,destroy:F,eventNames:Bo,getPan:()=>({x:a,y:n}),getScale:()=>l,getOptions:()=>r1(t),handleDown:N,handleMove:q,handleUp:A,pan:g,reset:v,resetStyle:o,setOptions:s,setStyle:(R,z)=>ui(e,R,z),zoom:m,zoomIn:x,zoomOut:C,zoomToPoint:w,zoomWithWheel:S}}xu.defaultOptions=yu;const i1=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],o1=Tt("arrow-down",i1);const s1=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],a1=Tt("arrow-left",s1);const n1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],l1=Tt("arrow-right",n1);const h1=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],c1=Tt("arrow-up",h1);const d1=[["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"}]],Tn=Tt("refresh-cw",d1);const u1=[["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"}]],f1=Tt("settings-2",u1);const g1=[["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"}]],Cu=Tt("zoom-in",g1);const p1=[["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"}]],bu=Tt("zoom-out",p1);var ku=Object.defineProperty,p=(e,t)=>ku(e,"name",{value:t,configurable:!0}),wu=(e,t)=>{for(var r in t)ku(e,r,{get:t[r],enumerable:!0})},ds={exports:{}},m1=ds.exports,mc;function y1(){return mc||(mc=1,(function(e,t){(function(r,i){e.exports=i()})(m1,(function(){var r=1e3,i=6e4,o=36e5,s="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",f="quarter",u="year",g="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(q){var A=["th","st","nd","rd"],$=q%100;return"["+q+(A[($-20)%10]||A[$]||A[0])+"]"}},w=function(q,A,$){var O=String(q);return!O||O.length>=A?q:""+Array(A+1-O.length).join($)+q},S={s:w,z:function(q){var A=-q.utcOffset(),$=Math.abs(A),O=Math.floor($/60),F=$%60;return(A<=0?"+":"-")+w(O,2,"0")+":"+w(F,2,"0")},m:function q(A,$){if(A.date()<$.date())return-q($,A);var O=12*($.year()-A.year())+($.month()-A.month()),F=A.clone().add(O,d),R=$-F<0,z=A.clone().add(O+(R?-1:1),d);return+(-(O+($-F)/(R?F-z:z-F))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:d,y:u,w:h,d:c,D:g,h:l,m:n,s:a,ms:s,Q:f}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},v="en",_={};_[v]=C;var E="$isDayjsObject",B=function(q){return q instanceof U||!(!q||!q[E])},D=function q(A,$,O){var F;if(!A)return v;if(typeof A=="string"){var R=A.toLowerCase();_[R]&&(F=R),$&&(_[R]=$,F=R);var z=A.split("-");if(!F&&z.length>1)return q(z[0])}else{var T=A.name;_[T]=A,F=T}return!O&&F&&(v=F),F||!O&&v},M=function(q,A){if(B(q))return q.clone();var $=typeof A=="object"?A:{};return $.date=q,$.args=arguments,new U($)},P=S;P.l=D,P.i=B,P.w=function(q,A){return M(q,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var U=(function(){function q($){this.$L=D($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[E]=!0}var A=q.prototype;return A.parse=function($){this.$d=(function(O){var F=O.date,R=O.utc;if(F===null)return new Date(NaN);if(P.u(F))return new Date;if(F instanceof Date)return new Date(F);if(typeof F=="string"&&!/Z$/i.test(F)){var z=F.match(y);if(z){var T=z[2]-1||0,W=(z[7]||"0").substring(0,3);return R?new Date(Date.UTC(z[1],T,z[3]||1,z[4]||0,z[5]||0,z[6]||0,W)):new Date(z[1],T,z[3]||1,z[4]||0,z[5]||0,z[6]||0,W)}}return new Date(F)})($),this.init()},A.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},A.$utils=function(){return P},A.isValid=function(){return this.$d.toString()!==m},A.isSame=function($,O){var F=M($);return this.startOf(O)<=F&&F<=this.endOf(O)},A.isAfter=function($,O){return M($)<this.startOf(O)},A.isBefore=function($,O){return this.endOf(O)<M($)},A.$g=function($,O,F){return P.u($)?this[O]:this.set(F,$)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function($,O){var F=this,R=!!P.u(O)||O,z=P.p($),T=function(mt,ht){var ct=P.w(F.$u?Date.UTC(F.$y,ht,mt):new Date(F.$y,ht,mt),F);return R?ct:ct.endOf(c)},W=function(mt,ht){return P.w(F.toDate()[mt].apply(F.toDate("s"),(R?[0,0,0,0]:[23,59,59,999]).slice(ht)),F)},j=this.$W,G=this.$M,X=this.$D,K="set"+(this.$u?"UTC":"");switch(z){case u:return R?T(1,0):T(31,11);case d:return R?T(1,G):T(0,G+1);case h:var Z=this.$locale().weekStart||0,at=(j<Z?j+7:j)-Z;return T(R?X-at:X+(6-at),G);case c:case g:return W(K+"Hours",0);case l:return W(K+"Minutes",1);case n:return W(K+"Seconds",2);case a:return W(K+"Milliseconds",3);default:return this.clone()}},A.endOf=function($){return this.startOf($,!1)},A.$set=function($,O){var F,R=P.p($),z="set"+(this.$u?"UTC":""),T=(F={},F[c]=z+"Date",F[g]=z+"Date",F[d]=z+"Month",F[u]=z+"FullYear",F[l]=z+"Hours",F[n]=z+"Minutes",F[a]=z+"Seconds",F[s]=z+"Milliseconds",F)[R],W=R===c?this.$D+(O-this.$W):O;if(R===d||R===u){var j=this.clone().set(g,1);j.$d[T](W),j.init(),this.$d=j.set(g,Math.min(this.$D,j.daysInMonth())).$d}else T&&this.$d[T](W);return this.init(),this},A.set=function($,O){return this.clone().$set($,O)},A.get=function($){return this[P.p($)]()},A.add=function($,O){var F,R=this;$=Number($);var z=P.p(O),T=function(G){var X=M(R);return P.w(X.date(X.date()+Math.round(G*$)),R)};if(z===d)return this.set(d,this.$M+$);if(z===u)return this.set(u,this.$y+$);if(z===c)return T(1);if(z===h)return T(7);var W=(F={},F[n]=i,F[l]=o,F[a]=r,F)[z]||1,j=this.$d.getTime()+$*W;return P.w(j,this)},A.subtract=function($,O){return this.add(-1*$,O)},A.format=function($){var O=this,F=this.$locale();if(!this.isValid())return F.invalidDate||m;var R=$||"YYYY-MM-DDTHH:mm:ssZ",z=P.z(this),T=this.$H,W=this.$m,j=this.$M,G=F.weekdays,X=F.months,K=F.meridiem,Z=function(ht,ct,_t,Ct){return ht&&(ht[ct]||ht(O,R))||_t[ct].slice(0,Ct)},at=function(ht){return P.s(T%12||12,ht,"0")},mt=K||function(ht,ct,_t){var Ct=ht<12?"AM":"PM";return _t?Ct.toLowerCase():Ct};return R.replace(x,(function(ht,ct){return ct||(function(_t){switch(_t){case"YY":return String(O.$y).slice(-2);case"YYYY":return P.s(O.$y,4,"0");case"M":return j+1;case"MM":return P.s(j+1,2,"0");case"MMM":return Z(F.monthsShort,j,X,3);case"MMMM":return Z(X,j);case"D":return O.$D;case"DD":return P.s(O.$D,2,"0");case"d":return String(O.$W);case"dd":return Z(F.weekdaysMin,O.$W,G,2);case"ddd":return Z(F.weekdaysShort,O.$W,G,3);case"dddd":return G[O.$W];case"H":return String(T);case"HH":return P.s(T,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return mt(T,W,!0);case"A":return mt(T,W,!1);case"m":return String(W);case"mm":return P.s(W,2,"0");case"s":return String(O.$s);case"ss":return P.s(O.$s,2,"0");case"SSS":return P.s(O.$ms,3,"0");case"Z":return z}return null})(ht)||z.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function($,O,F){var R,z=this,T=P.p(O),W=M($),j=(W.utcOffset()-this.utcOffset())*i,G=this-W,X=function(){return P.m(z,W)};switch(T){case u:R=X()/12;break;case d:R=X();break;case f:R=X()/3;break;case h:R=(G-j)/6048e5;break;case c:R=(G-j)/864e5;break;case l:R=G/o;break;case n:R=G/i;break;case a:R=G/r;break;default:R=G}return F?R:P.a(R)},A.daysInMonth=function(){return this.endOf(d).$D},A.$locale=function(){return _[this.$L]},A.locale=function($,O){if(!$)return this.$L;var F=this.clone(),R=D($,O,!0);return R&&(F.$L=R),F},A.clone=function(){return P.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},q})(),N=U.prototype;return M.prototype=N,[["$ms",s],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",u],["$D",g]].forEach((function(q){N[q[1]]=function(A){return this.$g(A,q[0],q[1])}})),M.extend=function(q,A){return q.$i||(q(A,U,M),q.$i=!0),M},M.locale=D,M.isDayjs=B,M.unix=function(q){return M(1e3*q)},M.en=_[v],M.Ls=_,M.p={},M}))})(ds)),ds.exports}var x1=y1();const Su=cu(x1);var Qe={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},V={trace:p((...e)=>{},"trace"),debug:p((...e)=>{},"debug"),info:p((...e)=>{},"info"),warn:p((...e)=>{},"warn"),error:p((...e)=>{},"error"),fatal:p((...e)=>{},"fatal")},Ol=p(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,be("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",be("FATAL"))),t<=Qe.error&&(V.error=console.error?console.error.bind(console,be("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",be("ERROR"))),t<=Qe.warn&&(V.warn=console.warn?console.warn.bind(console,be("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",be("WARN"))),t<=Qe.info&&(V.info=console.info?console.info.bind(console,be("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",be("INFO"))),t<=Qe.debug&&(V.debug=console.debug?console.debug.bind(console,be("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",be("DEBUG"))),t<=Qe.trace&&(V.trace=console.debug?console.debug.bind(console,be("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",be("TRACE")))},"setLogLevel"),be=p(e=>`%c${Su().format("ss.SSS")} : ${e} : `,"format");const us={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;switch(i){case"r":return us.hue2rgb(s,o,e+1/3)*255;case"g":return us.hue2rgb(s,o,e)*255;case"b":return us.hue2rgb(s,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(i==="l")return a*100;if(o===s)return 0;const n=o-s,l=a>.5?n/(2-o-s):n/(o+s);if(i==="s")return l*100;switch(o){case e:return((t-r)/n+(t<r?6:0))*60;case t:return((r-e)/n+2)*60;case r:return((e-t)/n+4)*60;default:return-1}}},C1={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},b1={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},gt={channel:us,lang:C1,unit:b1},fr={};for(let e=0;e<=255;e++)fr[e]=gt.unit.dec2hex(e);const ie={ALL:0,RGB:1,HSL:2};class k1{constructor(){this.type=ie.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=ie.ALL}is(t){return this.type===t}}class w1{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new k1}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=ie.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=gt.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=gt.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=gt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=gt.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=gt.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=gt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(ie.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(ie.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(ie.HSL)&&r!==void 0?r:(this._ensureHSL(),gt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(ie.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(ie.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(ie.RGB)&&r!==void 0?r:(this._ensureRGB(),gt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(ie.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(ie.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(ie.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(ie.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(ie.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(ie.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const ha=new w1({r:0,g:0,b:0,a:0},"transparent"),pi={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(pi.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,s=o%4===0,a=o>4,n=a?1:17,l=a?8:4,c=s?0:-1,h=a?255:15;return ha.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:s?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${fr[Math.round(t)]}${fr[Math.round(r)]}${fr[Math.round(i)]}${fr[Math.round(o*255)]}`:`#${fr[Math.round(t)]}${fr[Math.round(r)]}${fr[Math.round(i)]}`}},Ir={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(Ir.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return gt.channel.clamp.h(parseFloat(r)*.9);case"rad":return gt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return gt.channel.clamp.h(parseFloat(r)*360)}}return gt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(Ir.re);if(!r)return;const[,i,o,s,a,n]=r;return ha.set({h:Ir._hue2deg(i),s:gt.channel.clamp.s(parseFloat(o)),l:gt.channel.clamp.l(parseFloat(s)),a:a?gt.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${gt.lang.round(t)}, ${gt.lang.round(r)}%, ${gt.lang.round(i)}%, ${o})`:`hsl(${gt.lang.round(t)}, ${gt.lang.round(r)}%, ${gt.lang.round(i)}%)`}},Co={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=Co.colors[e];if(t)return pi.parse(t)},stringify:e=>{const t=pi.stringify(e);for(const r in Co.colors)if(Co.colors[r]===t)return r}},co={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(co.re);if(!r)return;const[,i,o,s,a,n,l,c,h]=r;return ha.set({r:gt.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:gt.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:gt.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?gt.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${gt.lang.round(t)}, ${gt.lang.round(r)}, ${gt.lang.round(i)}, ${gt.lang.round(o)})`:`rgb(${gt.lang.round(t)}, ${gt.lang.round(r)}, ${gt.lang.round(i)})`}},Re={format:{keyword:Co,hex:pi,rgb:co,rgba:co,hsl:Ir,hsla:Ir},parse:e=>{if(typeof e!="string")return e;const t=pi.parse(e)||co.parse(e)||Ir.parse(e)||Co.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(ie.HSL)||e.data.r===void 0?Ir.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?co.stringify(e):pi.stringify(e)},vu=(e,t)=>{const r=Re.parse(e);for(const i in t)r[i]=gt.channel.clamp[i](t[i]);return Re.stringify(r)},ir=(e,t,r=0,i=1)=>{if(typeof e!="number")return vu(e,{a:t});const o=ha.set({r:gt.channel.clamp.r(e),g:gt.channel.clamp.g(t),b:gt.channel.clamp.b(r),a:gt.channel.clamp.a(i)});return Re.stringify(o)},S1=e=>{const{r:t,g:r,b:i}=Re.parse(e),o=.2126*gt.channel.toLinear(t)+.7152*gt.channel.toLinear(r)+.0722*gt.channel.toLinear(i);return gt.lang.round(o)},v1=e=>S1(e)>=.5,Te=e=>!v1(e),Rl=(e,t,r)=>{const i=Re.parse(e),o=i[t],s=gt.channel.clamp[t](o+r);return o!==s&&(i[t]=s),Re.stringify(i)},H=(e,t)=>Rl(e,"l",t),Y=(e,t)=>Rl(e,"l",-t),b=(e,t)=>{const r=Re.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return vu(e,i)},T1=(e,t,r=50)=>{const{r:i,g:o,b:s,a}=Re.parse(e),{r:n,g:l,b:c,a:h}=Re.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=o*m+l*y,w=s*m+c*y,S=a*d+h*(1-d);return ir(x,C,w,S)},I=(e,t=100)=>{const r=Re.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,T1(r,e,t)};var _n=p((e,t,{depth:r=2,clobber:i=!1}={})=>{const o={depth:r,clobber:i};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(s=>_n(e,s,o)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(s=>{e.includes(s)||e.push(s)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(s=>{typeof t[s]=="object"&&t[s]!==null&&(e[s]===void 0||typeof e[s]=="object")?(e[s]===void 0&&(e[s]=Array.isArray(t[s])?[]:{}),e[s]=_n(e[s],t[s],{depth:r-1,clobber:i})):(i||typeof e[s]!="object"&&typeof t[s]!="object")&&(e[s]=t[s])}),e)},"assignWithDepth"),jt=_n,Ge="#ffffff",Xe="#f2f2f2",ut=p((e,t)=>t?b(e,{s:-40,l:10}):b(e,{s:-40,l:-10}),"mkBorder"),xi,_1=(xi=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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||Y(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(this.mainBkg,10)):(this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe,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]})}},p(xi,"Theme"),xi),B1=p(e=>{const t=new _1;return t.calculate(e),t},"getThemeVariables"),Ci,L1=(Ci=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#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=Y("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=Y(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||H(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||Y(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=H(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=H(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=H(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=I(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]||I(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??H(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=H(this.secondaryColor,20),this.git1=H(this.pie2||this.secondaryColor,20),this.git2=H(this.pie3||this.tertiaryColor,20),this.git3=H(this.pie4||b(this.primaryColor,{h:-30}),20),this.git4=H(this.pie5||b(this.primaryColor,{h:-60}),20),this.git5=H(this.pie6||b(this.primaryColor,{h:-90}),10),this.git6=H(this.pie7||b(this.primaryColor,{h:60}),10),this.git7=H(this.pie8||b(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||I(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||I(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||H("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||H("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||H("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||H("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||H(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||H(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||H(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||H(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},p(Ci,"Theme"),Ci),E1=p(e=>{const t=new L1;return t.calculate(e),t},"getThemeVariables"),bi,F1=(bi=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=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ut(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||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||I(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||I(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||H(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||H(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||b(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||b(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||Y(I(this.git0),25),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||I(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(bi,"Theme"),bi),Tu=p(e=>{const t=new F1;return t.calculate(e),t},"getThemeVariables"),ki,A1=(ki=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=H("#cde498",10),this.primaryBorderColor=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.primaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=Y(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||Y(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||Y(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=Y(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||b(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||H(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-30}),this.pie5=this.pie5||b(this.secondaryColor,{l:-30}),this.pie6=this.pie6||b(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??b(this.primaryColor,{l:-30}),this.venn2=this.venn2??b(this.secondaryColor,{l:-30}),this.venn3=this.venn3??b(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??b(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??b(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??b(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??b(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??b(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||I(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(ki,"Theme"),ki),M1=p(e=>{const t=new A1;return t.calculate(e),t},"getThemeVariables"),wi,$1=(wi=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=H(this.contrast,55),this.background="#ffffff",this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.lineColor=I(this.background),this.textColor=I(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||H(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=H(this.contrast,55),this.border2=this.contrast,this.actorBorder=H(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||I(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||H(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||Y(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||b(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||b(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=H(this.contrast,30),this.sectionBkgColor2=H(this.contrast,30),this.taskBorderColor=Y(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=H(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=Y(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=b(this.primaryColor,{h:64}),this.fillType3=b(this.secondaryColor,{h:64}),this.fillType4=b(this.primaryColor,{h:-64}),this.fillType5=b(this.secondaryColor,{h:-64}),this.fillType6=b(this.primaryColor,{h:128}),this.fillType7=b(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Y(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||b(this.primaryColor,{h:-30}),this.git4=this.pie5||b(this.primaryColor,{h:-60}),this.git5=this.pie6||b(this.primaryColor,{h:-90}),this.git6=this.pie7||b(this.primaryColor,{h:60}),this.git7=this.pie8||b(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(wi,"Theme"),wi),O1=p(e=>{const t=new $1;return t.calculate(e),t},"getThemeVariables"),Si,R1=(Si=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=ut(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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||b(t,{h:30}),this.cScale4=this.cScale4||b(t,{h:60}),this.cScale5=this.cScale5||b(t,{h:90}),this.cScale6=this.cScale6||b(t,{h:120}),this.cScale7=this.cScale7||b(t,{h:150}),this.cScale8=this.cScale8||b(t,{h:210,l:150}),this.cScale9=this.cScale9||b(t,{h:270}),this.cScale10=this.cScale10||b(t,{h:300}),this.cScale11=this.cScale11||b(t,{h:330}),this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||I(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(Si,"Theme"),Si),I1=p(e=>{const t=new R1;return t.calculate(e),t},"getThemeVariables"),vi,P1=(vi=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#323D47"),10),this.border1="#ccc",this.border2=ir(255,255,255,.25),this.arrowheadColor=I(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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(vi,"Theme"),vi),D1=p(e=>{const t=new P1;return t.calculate(e),t},"getThemeVariables"),Ti,N1=(Ti=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=ut("#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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=this.mainBkg;if(this.darkMode)for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],75);else for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScale"+s]=Y(this["cScale"+s],25);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||I(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(Ti,"Theme"),Ti),q1=p(e=>{const t=new N1;return t.calculate(e),t},"getThemeVariables"),_i,z1=(_i=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#323D47"),10),this.border1="#ccc",this.border2=ir(255,255,255,.25),this.arrowheadColor=I(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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||b(this.primaryColor,{h:30}),this.cScale4=this.cScale4||b(this.primaryColor,{h:60}),this.cScale5=this.cScale5||b(this.primaryColor,{h:90}),this.cScale6=this.cScale6||b(this.primaryColor,{h:120}),this.cScale7=this.cScale7||b(this.primaryColor,{h:150}),this.cScale8=this.cScale8||b(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||b(this.primaryColor,{h:270}),this.cScale10=this.cScale10||b(this.primaryColor,{h:300}),this.cScale11=this.cScale11||b(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=Y(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(_i,"Theme"),_i),j1=p(e=>{const t=new z1;return t.calculate(e),t},"getThemeVariables"),Bi,W1=(Bi=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=ut(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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=b(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||H(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleInv"+s]=this["cScaleInv"+s]||I(this["cScale"+s]);for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this.darkMode?this["cScalePeer"+s]=this["cScalePeer"+s]||H(this["cScale"+s],10):this["cScalePeer"+s]=this["cScalePeer"+s]||Y(this["cScale"+s],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let s=0;s<this.THEME_COLOR_LIMIT;s++)this["cScaleLabel"+s]=this["cScaleLabel"+s]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let s=0;s<5;s++)this["surface"+s]=this["surface"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(5+s*3)}),this["surfacePeer"+s]=this["surfacePeer"+s]||b(this.mainBkg,{h:180,s:-15,l:o*(8+s*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||b(t,{h:64}),this.fillType3=this.fillType3||b(r,{h:64}),this.fillType4=this.fillType4||b(t,{h:-64}),this.fillType5=this.fillType5||b(r,{h:-64}),this.fillType6=this.fillType6||b(t,{h:128}),this.fillType7=this.fillType7||b(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||b(t,{l:-10}),this.pie5=this.pie5||b(r,{l:-10}),this.pie6=this.pie6||b(i,{l:-10}),this.pie7=this.pie7||b(t,{h:60,l:-10}),this.pie8=this.pie8||b(t,{h:-60,l:-10}),this.pie9=this.pie9||b(t,{h:120,l:0}),this.pie10=this.pie10||b(t,{h:60,l:-20}),this.pie11=this.pie11||b(t,{h:-60,l:-20}),this.pie12=this.pie12||b(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||b(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||b(t,{h:-30}),this.git4=this.git4||b(t,{h:-60}),this.git5=this.git5||b(t,{h:-90}),this.git6=this.git6||b(t,{h:60}),this.git7=this.git7||b(t,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(Bi,"Theme"),Bi),H1=p(e=>{const t=new W1;return t.calculate(e),t},"getThemeVariables"),Li,Y1=(Li=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=H(this.primaryColor,16),this.tertiaryColor=b(this.primaryColor,{h:-160}),this.primaryBorderColor=I(this.background),this.secondaryBorderColor=ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ut(this.tertiaryColor,this.darkMode),this.primaryTextColor=I(this.primaryColor),this.secondaryTextColor=I(this.secondaryColor),this.tertiaryTextColor=I(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=H(I("#323D47"),10),this.border1="#ccc",this.border2=ir(255,255,255,.25),this.arrowheadColor=I(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||ut(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ut(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ut(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ut(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||I(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||I(this.tertiaryColor),this.lineColor=this.lineColor||I(this.background),this.arrowheadColor=this.arrowheadColor||I(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||Y(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||I(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||H(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad";for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||I(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||H(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||Y(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=Y(this["cScale"+r],75);const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||b(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||b(this.primaryColor,{h:64}),this.fillType3=this.fillType3||b(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||b(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||b(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||b(this.primaryColor,{h:128}),this.fillType7=this.fillType7||b(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||b(this.primaryColor,{l:-10}),this.pie5=this.pie5||b(this.secondaryColor,{l:-10}),this.pie6=this.pie6||b(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||b(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||b(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||b(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||b(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||b(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||b(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||b(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||b(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||b(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||b(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||b(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||b(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Te(this.quadrant1Fill)?H(this.quadrant1Fill):Y(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?Y(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||b(this.primaryColor,{h:-30}),this.git4=this.git4||b(this.primaryColor,{h:-60}),this.git5=this.git5||b(this.primaryColor,{h:-90}),this.git6=this.git6||b(this.primaryColor,{h:60}),this.git7=this.git7||b(this.primaryColor,{h:120}),this.darkMode?(this.git0=H(this.git0,25),this.git1=H(this.git1,25),this.git2=H(this.git2,25),this.git3=H(this.git3,25),this.git4=H(this.git4,25),this.git5=H(this.git5,25),this.git6=H(this.git6,25),this.git7=H(this.git7,25)):(this.git0=Y(this.git0,25),this.git1=Y(this.git1,25),this.git2=Y(this.git2,25),this.git3=Y(this.git3,25),this.git4=Y(this.git4,25),this.git5=Y(this.git5,25),this.git6=Y(this.git6,25),this.git7=Y(this.git7,25)),this.gitInv0=this.gitInv0||I(this.git0),this.gitInv1=this.gitInv1||I(this.git1),this.gitInv2=this.gitInv2||I(this.git2),this.gitInv3=this.gitInv3||I(this.git3),this.gitInv4=this.gitInv4||I(this.git4),this.gitInv5=this.gitInv5||I(this.git5),this.gitInv6=this.gitInv6||I(this.git6),this.gitInv7=this.gitInv7||I(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||Ge,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Xe}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]})}},p(Li,"Theme"),Li),U1=p(e=>{const t=new Y1;return t.calculate(e),t},"getThemeVariables"),or={base:{getThemeVariables:B1},dark:{getThemeVariables:E1},default:{getThemeVariables:Tu},forest:{getThemeVariables:M1},neutral:{getThemeVariables:O1},neo:{getThemeVariables:I1},"neo-dark":{getThemeVariables:D1},redux:{getThemeVariables:q1},"redux-dark":{getThemeVariables:j1},"redux-color":{getThemeVariables:H1},"redux-dark-color":{getThemeVariables:U1}},Zt={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},_u={...Zt,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:or.default.getThemeVariables(),sequence:{...Zt.sequence,messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:p(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:p(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Zt.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Zt.c4,useWidth:void 0,personFont:p(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Zt.flowchart,inheritDir:!1},external_personFont:p(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:p(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:p(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:p(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:p(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:p(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:p(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:p(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:p(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:p(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:p(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:p(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:p(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:p(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:p(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:p(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:p(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:p(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:p(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:p(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:p(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Zt.pie,useWidth:984},xyChart:{...Zt.xyChart,useWidth:void 0},requirement:{...Zt.requirement,useWidth:void 0},packet:{...Zt.packet},eventmodeling:{...Zt.eventmodeling},treeView:{...Zt.treeView,useWidth:void 0},radar:{...Zt.radar},railroad:{...Zt.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Zt.ishikawa},sankey:{...Zt.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Zt.venn},cynefin:{...Zt.cynefin}},Bu=p((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...Bu(e[i],"")]:[...r,t+i],[]),"keyify"),G1=new Set(Bu(_u,"")),Il=_u,X1={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},V1=p((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(V.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),Bs=p(e=>{if(V.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Bs(t));return}for(const t of Object.keys(e)){if(V.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!G1.has(t)||e[t]==null){V.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=X1[t];i?V1(e[t],i):(V.debug("sanitizing object",t),Bs(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(V.debug("sanitizing css option",t),e[t]=Lu(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"),Lu=p(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"),Ri=Object.freeze(Il),Ve=p(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),fe=jt({},Ri),Ls,Wr=[],bo=jt({},Ri),ca=p((e,t)=>{let r=jt({},e),i={};for(const o of t)Au(o),i=jt(i,o);if(r=jt(r,i),i.theme&&i.theme in or){const o=jt({},Ls),s=jt(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in or&&(r.themeVariables=or[r.theme].getThemeVariables(s))}return bo=r,$u(bo),bo},"updateCurrentConfig"),K1=p(e=>(fe=jt({},Ri),fe=jt(fe,e),e.theme&&or[e.theme]&&(fe.themeVariables=or[e.theme].getThemeVariables(e.themeVariables)),ca(fe,Wr),fe),"setSiteConfig"),Z1=p(e=>{Ls=jt({},e)},"saveConfigFromInitialize"),Q1=p(e=>(fe=jt(fe,e),ca(fe,Wr),fe),"updateSiteConfig"),Eu=p(()=>jt({},fe),"getSiteConfig"),Fu=p(e=>($u(e),jt(bo,e),Rt()),"setConfig"),Rt=p(()=>jt({},bo),"getConfig"),Au=p(e=>{e&&(["secure",...fe.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(V.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&Au(e[t])}))},"sanitize"),J1=p(e=>{Bs(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Wr.push(e),ca(fe,Wr)},"addDirective"),Es=p((e=fe)=>{Wr=[],ca(e,Wr)},"reset"),tk={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."},yc={},Mu=p(e=>{yc[e]||(V.warn(tk[e]),yc[e]=!0)},"issueWarning"),$u=p(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Mu("LAZY_LOAD_DEPRECATED")},"checkConfig"),ek=p(()=>{let e={};Ls&&(e=jt(e,Ls));for(const t of Wr)e=jt(e,t);return e},"getUserDefinedConfig"),ae=p(e=>(e.flowchart?.htmlLabels!=null&&Mu("FLOWCHART_HTML_LABELS_DEPRECATED"),Ve(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),Ou=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,ko=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,rk=/\s*%%.*\n/gm,Ei,Ru=(Ei=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},p(Ei,"UnknownDiagramError"),Ei),Hr={},Pl=p(function(e,t){e=e.replace(Ou,"").replace(ko,"").replace(rk,`
8
+ `);for(const[r,{detector:i}]of Object.entries(Hr))if(i(e,t))return r;throw new Ru(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Bn=p((...e)=>{for(const{id:t,detector:r,loader:i}of e)Iu(t,r,i)},"registerLazyLoadedDiagrams"),Iu=p((e,t,r)=>{Hr[e]&&V.warn(`Detector with key ${e} already exists. Overwriting.`),Hr[e]={detector:t,loader:r},V.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),ik=p(e=>Hr[e].loader,"getDiagramLoader"),Hi=/<br\s*\/?>/gi,ok=p(e=>e?Nu(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),sk=(()=>{let e=!1;return()=>{e||(Pu(),e=!0)}})();function Pu(){const e="data-temp-href-target";$i.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),$i.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"))})}p(Pu,"setupDompurifyHooks");var Du=p(e=>(sk(),$i.sanitize(e)),"removeScript"),xc=p((e,t)=>{if(ae(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Du(e):r!=="loose"&&(e=Nu(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=hk(e))}return e},"sanitizeMore"),Se=p((e,t)=>e&&(t.dompurifyConfig?e=$i.sanitize(xc(e,t),t.dompurifyConfig).toString():e=$i.sanitize(xc(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),ak=p((e,t)=>typeof e=="string"?Se(e,t):e.flat().map(r=>Se(r,t)),"sanitizeTextOrArray"),nk=p(e=>Hi.test(e),"hasBreaks"),lk=p(e=>e.split(Hi),"splitBreaks"),hk=p(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),Nu=p(e=>e.replace(Hi,"#br#"),"breakToPlaceholder"),qu=p(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),ck=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),dk=p(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Ln=p(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let o=t[i];if(o===","&&i>0&&i+1<t.length){const s=t[i-1],a=t[i+1];uk(s,a)&&(o=s+","+a,i++,r.pop())}r.push(fk(o))}return r.join("")},"parseGenericTypes"),En=p((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),uk=p((e,t)=>{const r=En(e,"~"),i=En(t,"~");return r===1&&i===1},"shouldCombineSets"),fk=p(e=>{const t=En(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),s=i.lastIndexOf("~");for(;o!==-1&&s!==-1&&o!==s;)i[o]="<",i[s]=">",o=i.indexOf("~"),s=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),Cc=p(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Fn=/\$\$(.*?)\$\$/g,Ii=p(e=>(e.match(Fn)?.length??0)>0,"hasKatex"),gk=p(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Dl(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),pk=p(async(e,t)=>{if(!Ii(e))return e;if(!(Cc()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Fn,"MathML is unsupported in this environment.");{const{default:r}=await import("katex"),i=t.forceLegacyMathML||!Cc()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(Hi).map(o=>Ii(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(Fn,(o,s)=>r.renderToString(s,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Dl=p(async(e,t)=>Se(await pk(e,t),t),"renderKatexSanitized"),Yi={getRows:ok,sanitizeText:Se,sanitizeTextOrArray:ak,hasBreaks:nk,splitBreaks:lk,lineBreakRegex:Hi,removeScript:Du,getUrl:qu,evaluate:Ve,getMax:ck,getMin:dk},mk=p(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),yk=p(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"),Nl=p(function(e,t,r,i){const o=yk(t,r,i);mk(e,o)},"configureSvgSize"),zu=p(function(e,t,r,i){const o=t.node().getBBox(),s=o.width,a=o.height;V.info(`SVG bounds: ${s}x${a}`,o);let n=0,l=0;V.info(`Graph bounds: ${n}x${l}`,e),n=s+r*2,l=a+r*2,V.info(`Calculated bounds: ${n}x${l}`),Nl(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),fs={};function An(e){return[...e.cssRules].map(t=>t.cssText).join(`
9
9
  `)}p(An,"cssStyleSheetToString");var xk=p((e,t,r,i)=>{let o="";return e in fs&&fs[e]?o=fs[e]({...r,svgId:i}):V.warn(`No theme found for ${e}`),` & {
10
10
  font-family: ${r.fontFamily};
11
11
  font-size: ${r.fontSize};
@@ -127,41 +127,41 @@ ${a.href}`,[l,c]=L.useState(null);L.useEffect(()=>{const x=s.current;if(x===null
127
127
  }
128
128
 
129
129
  ${t}
130
- `},"getStyles"),Ck=p((e,t)=>{t!==void 0&&(fs[e]=t)},"addStylesForDiagram"),bk=xk,ql={};Su(ql,{clear:()=>Wu,getAccDescription:()=>Gu,getAccTitle:()=>Yu,getDiagramTitle:()=>Vu,setAccDescription:()=>Uu,setAccTitle:()=>Hu,setDiagramTitle:()=>Xu});var zl="",jl="",Wl="",Hl=p(e=>Se(e,Rt()),"sanitizeText"),Wu=p(()=>{zl="",Wl="",jl=""},"clear"),Hu=p(e=>{zl=Hl(e).replace(/^\s+/g,"")},"setAccTitle"),Yu=p(()=>zl,"getAccTitle"),Uu=p(e=>{Wl=Hl(e).replace(/\n\s+/g,`
131
- `)},"setAccDescription"),Gu=p(()=>Wl,"getAccDescription"),Xu=p(e=>{jl=Hl(e)},"setDiagramTitle"),Vu=p(()=>jl,"getDiagramTitle"),bc=V,kk=Ol,kt=Rt,wk=Au,Sk=Ri,Yl=p(e=>Se(e,kt()),"sanitizeText"),Ku=ju,vk=p(()=>ql,"getCommonDb"),Fs={},As=p((e,t,r)=>{Fs[e]&&bc.warn(`Diagram with id ${e} already registered. Overwriting.`),Fs[e]=t,r&&Pu(e,r),Ck(e,t.styles),t.injectUtils?.(bc,kk,kt,Yl,Ku,vk(),()=>{})},"registerDiagram"),Mn=p(e=>{if(e in Fs)return Fs[e];throw new Tk(e)},"getDiagram"),Fi,Tk=(Fi=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},p(Fi,"DiagramNotFoundError"),Fi),_k={value:()=>{}};function Zu(){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 gs(r)}function gs(e){this._=e}function Bk(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}gs.prototype=Zu.prototype={constructor:gs,on:function(e,t){var r=this._,i=Bk(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((o=(e=i[s]).type)&&(o=Lk(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(o=(e=i[s]).type)r[o]=kc(r[o],e.name,t);else if(t==null)for(o in r)r[o]=kc(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new gs(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,s;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,o=s.length;i<o;++i)s[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,s=i.length;o<s;++o)i[o].value.apply(t,r)}};function Lk(e,t){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===t)return o.value}function kc(e,t,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=_k,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var $n="http://www.w3.org/1999/xhtml";const wc={svg:"http://www.w3.org/2000/svg",xhtml:$n,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function da(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),wc.hasOwnProperty(t)?{space:wc[t],local:e}:e}function Ek(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===$n&&t.documentElement.namespaceURI===$n?t.createElement(e):t.createElementNS(r,e)}}function Fk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qu(e){var t=da(e);return(t.local?Fk:Ek)(t)}function Ak(){}function Ul(e){return e==null?Ak:function(){return this.querySelector(e)}}function Mk(e){typeof e!="function"&&(e=Ul(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=new Array(a),l,c,h=0;h<a;++h)(l=s[h])&&(c=e.call(l,l.__data__,h,s))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new ye(i,this._parents)}function $k(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ok(){return[]}function Ju(e){return e==null?Ok:function(){return this.querySelectorAll(e)}}function Rk(e){return function(){return $k(e.apply(this,arguments))}}function Ik(e){typeof e=="function"?e=Rk(e):e=Ju(e);for(var t=this._groups,r=t.length,i=[],o=[],s=0;s<r;++s)for(var a=t[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),o.push(l));return new ye(i,o)}function tf(e){return function(){return this.matches(e)}}function ef(e){return function(t){return t.matches(e)}}var Pk=Array.prototype.find;function Dk(e){return function(){return Pk.call(this.children,e)}}function Nk(){return this.firstElementChild}function qk(e){return this.select(e==null?Nk:Dk(typeof e=="function"?e:ef(e)))}var zk=Array.prototype.filter;function jk(){return Array.from(this.children)}function Wk(e){return function(){return zk.call(this.children,e)}}function Hk(e){return this.selectAll(e==null?jk:Wk(typeof e=="function"?e:ef(e)))}function Yk(e){typeof e!="function"&&(e=tf(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new ye(i,this._parents)}function rf(e){return new Array(e.length)}function Uk(){return new ye(this._enter||this._groups.map(rf),this._parents)}function Ms(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ms.prototype={constructor:Ms,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 Gk(e){return function(){return e}}function Xk(e,t,r,i,o,s){for(var a=0,n,l=t.length,c=s.length;a<c;++a)(n=t[a])?(n.__data__=s[a],i[a]=n):r[a]=new Ms(e,s[a]);for(;a<l;++a)(n=t[a])&&(o[a]=n)}function Vk(e,t,r,i,o,s,a){var n,l,c=new Map,h=t.length,d=s.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)?o[n]=l:c.set(u,l));for(n=0;n<d;++n)u=a.call(e,s[n],n,s)+"",(l=c.get(u))?(i[n]=l,l.__data__=s[n],c.delete(u)):r[n]=new Ms(e,s[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(f[n])===l&&(o[n]=l)}function Kk(e){return e.__data__}function Zk(e,t){if(!arguments.length)return Array.from(this,Kk);var r=t?Vk:Xk,i=this._parents,o=this._groups;typeof e!="function"&&(e=Gk(e));for(var s=o.length,a=new Array(s),n=new Array(s),l=new Array(s),c=0;c<s;++c){var h=i[c],d=o[c],f=d.length,u=Qk(e.call(h,h&&h.__data__,c,i)),g=u.length,m=n[c]=new Array(g),y=a[c]=new Array(g),x=l[c]=new Array(f);r(h,d,m,y,x,u,t);for(var C=0,w=0,S,v;C<g;++C)if(S=m[C]){for(C>=w&&(w=C+1);!(v=y[w])&&++w<g;);S._next=v||null}}return a=new ye(a,i),a._enter=n,a._exit=l,a}function Qk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Jk(){return new ye(this._exit||this._groups.map(rf),this._parents)}function t2(e,t,r){var i=this.enter(),o=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?s.remove():r(s),i&&o?i.merge(o).order():o}function e2(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,s=i.length,a=Math.min(o,s),n=new Array(o),l=0;l<a;++l)for(var c=r[l],h=i[l],d=c.length,f=n[l]=new Array(d),u,g=0;g<d;++g)(u=c[g]||h[g])&&(f[g]=u);for(;l<o;++l)n[l]=r[l];return new ye(n,this._parents)}function r2(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,s=i[o],a;--o>=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function i2(e){e||(e=o2);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s){for(var a=r[s],n=a.length,l=o[s]=new Array(n),c,h=0;h<n;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new ye(o,this._parents).order()}function o2(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function s2(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function a2(){return Array.from(this)}function n2(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length;o<s;++o){var a=i[o];if(a)return a}return null}function l2(){let e=0;for(const t of this)++e;return e}function h2(){return!this.node()}function c2(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],s=0,a=o.length,n;s<a;++s)(n=o[s])&&e.call(n,n.__data__,s,o);return this}function d2(e){return function(){this.removeAttribute(e)}}function u2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function f2(e,t){return function(){this.setAttribute(e,t)}}function g2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function p2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function m2(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 y2(e,t){var r=da(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?u2:d2:typeof t=="function"?r.local?m2:p2:r.local?g2:f2)(r,t))}function of(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function x2(e){return function(){this.style.removeProperty(e)}}function C2(e,t,r){return function(){this.style.setProperty(e,t,r)}}function b2(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function k2(e,t,r){return arguments.length>1?this.each((t==null?x2:typeof t=="function"?b2:C2)(e,t,r??"")):Pi(this.node(),e)}function Pi(e,t){return e.style.getPropertyValue(t)||of(e).getComputedStyle(e,null).getPropertyValue(t)}function w2(e){return function(){delete this[e]}}function S2(e,t){return function(){this[e]=t}}function v2(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function T2(e,t){return arguments.length>1?this.each((t==null?w2:typeof t=="function"?v2:S2)(e,t)):this.node()[e]}function sf(e){return e.trim().split(/^|\s+/)}function Gl(e){return e.classList||new af(e)}function af(e){this._node=e,this._names=sf(e.getAttribute("class")||"")}af.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 nf(e,t){for(var r=Gl(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function lf(e,t){for(var r=Gl(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function _2(e){return function(){nf(this,e)}}function B2(e){return function(){lf(this,e)}}function L2(e,t){return function(){(t.apply(this,arguments)?nf:lf)(this,e)}}function E2(e,t){var r=sf(e+"");if(arguments.length<2){for(var i=Gl(this.node()),o=-1,s=r.length;++o<s;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?L2:t?_2:B2)(r,t))}function F2(){this.textContent=""}function A2(e){return function(){this.textContent=e}}function M2(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $2(e){return arguments.length?this.each(e==null?F2:(typeof e=="function"?M2:A2)(e)):this.node().textContent}function O2(){this.innerHTML=""}function R2(e){return function(){this.innerHTML=e}}function I2(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function P2(e){return arguments.length?this.each(e==null?O2:(typeof e=="function"?I2:R2)(e)):this.node().innerHTML}function D2(){this.nextSibling&&this.parentNode.appendChild(this)}function N2(){return this.each(D2)}function q2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function z2(){return this.each(q2)}function j2(e){var t=typeof e=="function"?e:Qu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function W2(){return null}function H2(e,t){var r=typeof e=="function"?e:Qu(e),i=t==null?W2:typeof t=="function"?t:Ul(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function Y2(){var e=this.parentNode;e&&e.removeChild(this)}function U2(){return this.each(Y2)}function G2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function X2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function V2(e){return this.select(e?X2:G2)}function K2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Z2(e){return function(t){e.call(this,t,this.__data__)}}function Q2(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 J2(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,s;r<o;++r)s=t[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function tw(e,t,r){return function(){var i=this.__on,o,s=Z2(t);if(i){for(var a=0,n=i.length;a<n;++a)if((o=i[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=t;return}}this.addEventListener(e.type,s,r),o={type:e.type,name:e.name,value:t,listener:s,options:r},i?i.push(o):this.__on=[o]}}function ew(e,t,r){var i=Q2(e+""),o,s=i.length,a;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(o=0,h=n[l];o<s;++o)if((a=i[o]).type===h.type&&a.name===h.name)return h.value}return}for(n=t?tw:J2,o=0;o<s;++o)this.each(n(i[o],t,r));return this}function hf(e,t,r){var i=of(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,r):(o=i.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function rw(e,t){return function(){return hf(this,e,t)}}function iw(e,t){return function(){return hf(this,e,t.apply(this,arguments))}}function ow(e,t){return this.each((typeof t=="function"?iw:rw)(e,t))}function*sw(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length,a;o<s;++o)(a=i[o])&&(yield a)}var cf=[null];function ye(e,t){this._groups=e,this._parents=t}function zo(){return new ye([[document.documentElement]],cf)}function aw(){return this}ye.prototype=zo.prototype={constructor:ye,select:Mk,selectAll:Ik,selectChild:qk,selectChildren:Hk,filter:Yk,data:Zk,enter:Uk,exit:Jk,join:t2,merge:e2,selection:aw,order:r2,sort:i2,call:s2,nodes:a2,node:n2,size:l2,empty:h2,each:c2,attr:y2,style:k2,property:T2,classed:E2,text:$2,html:P2,raise:N2,lower:z2,append:j2,insert:H2,remove:U2,clone:V2,datum:K2,on:ew,dispatch:ow,[Symbol.iterator]:sw};function yt(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],cf)}function ua(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Xl(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Ui(){}var Lo=.7,$s=1/Lo,mi="\\s*([+-]?\\d+)\\s*",Eo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",He="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nw=/^#([0-9a-f]{3,8})$/,lw=new RegExp(`^rgb\\(${mi},${mi},${mi}\\)$`),hw=new RegExp(`^rgb\\(${He},${He},${He}\\)$`),cw=new RegExp(`^rgba\\(${mi},${mi},${mi},${Eo}\\)$`),dw=new RegExp(`^rgba\\(${He},${He},${He},${Eo}\\)$`),uw=new RegExp(`^hsl\\(${Eo},${He},${He}\\)$`),fw=new RegExp(`^hsla\\(${Eo},${He},${He},${Eo}\\)$`),Sc={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};ua(Ui,Di,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vc,formatHex:vc,formatHex8:gw,formatHsl:pw,formatRgb:Tc,toString:Tc});function vc(){return this.rgb().formatHex()}function gw(){return this.rgb().formatHex8()}function pw(){return uf(this).formatHsl()}function Tc(){return this.rgb().formatRgb()}function Di(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=nw.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?_c(t):r===3?new he(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Qo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Qo(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=lw.exec(e))?new he(t[1],t[2],t[3],1):(t=hw.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cw.exec(e))?Qo(t[1],t[2],t[3],t[4]):(t=dw.exec(e))?Qo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uw.exec(e))?Ec(t[1],t[2]/100,t[3]/100,1):(t=fw.exec(e))?Ec(t[1],t[2]/100,t[3]/100,t[4]):Sc.hasOwnProperty(e)?_c(Sc[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function _c(e){return new he(e>>16&255,e>>8&255,e&255,1)}function Qo(e,t,r,i){return i<=0&&(e=t=r=NaN),new he(e,t,r,i)}function df(e){return e instanceof Ui||(e=Di(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function On(e,t,r,i){return arguments.length===1?df(e):new he(e,t,r,i??1)}function he(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}ua(he,On,Xl(Ui,{brighter(e){return e=e==null?$s:Math.pow($s,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(qr(this.r),qr(this.g),qr(this.b),Os(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:Bc,formatHex:Bc,formatHex8:mw,formatRgb:Lc,toString:Lc}));function Bc(){return`#${Pr(this.r)}${Pr(this.g)}${Pr(this.b)}`}function mw(){return`#${Pr(this.r)}${Pr(this.g)}${Pr(this.b)}${Pr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Lc(){const e=Os(this.opacity);return`${e===1?"rgb(":"rgba("}${qr(this.r)}, ${qr(this.g)}, ${qr(this.b)}${e===1?")":`, ${e})`}`}function Os(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pr(e){return e=qr(e),(e<16?"0":"")+e.toString(16)}function Ec(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Me(e,t,r,i)}function uf(e){if(e instanceof Me)return new Me(e.h,e.s,e.l,e.opacity);if(e instanceof Ui||(e=Di(e)),!e)return new Me;if(e instanceof Me)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,n=s-o,l=(s+o)/2;return n?(t===s?a=(r-i)/n+(r<i)*6:r===s?a=(i-t)/n+2:a=(t-r)/n+4,n/=l<.5?s+o:2-s-o,a*=60):n=l>0&&l<1?0:a,new Me(a,n,l,e.opacity)}function yw(e,t,r,i){return arguments.length===1?uf(e):new Me(e,t,r,i??1)}function Me(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}ua(Me,yw,Xl(Ui,{brighter(e){return e=e==null?$s:Math.pow($s,e),new Me(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new Me(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,o=2*r-i;return new he(Za(e>=240?e-240:e+120,o,i),Za(e,o,i),Za(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Me(Fc(this.h),Jo(this.s),Jo(this.l),Os(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=Os(this.opacity);return`${e===1?"hsl(":"hsla("}${Fc(this.h)}, ${Jo(this.s)*100}%, ${Jo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Fc(e){return e=(e||0)%360,e<0?e+360:e}function Jo(e){return Math.max(0,Math.min(1,e||0))}function Za(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 fa=e=>()=>e;function ff(e,t){return function(r){return e+r*t}}function xw(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 Cw(e,t){var r=t-e;return r?ff(e,r>180||r<-180?r-360*Math.round(r/360):r):fa(isNaN(e)?t:e)}function bw(e){return(e=+e)==1?Vl:function(t,r){return r-t?xw(t,r,e):fa(isNaN(t)?r:t)}}function Vl(e,t){var r=t-e;return r?ff(e,r):fa(isNaN(e)?t:e)}const Rn=(function e(t){var r=bw(t);function i(o,s){var a=r((o=On(o)).r,(s=On(s)).r),n=r(o.g,s.g),l=r(o.b,s.b),c=Vl(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=n(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function rr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var In=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qa=new RegExp(In.source,"g");function kw(e){return function(){return e}}function ww(e){return function(t){return e(t)+""}}function gf(e,t){var r=In.lastIndex=Qa.lastIndex=0,i,o,s,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=In.exec(e))&&(o=Qa.exec(t));)(s=o.index)>r&&(s=t.slice(r,s),n[a]?n[a]+=s:n[++a]=s),(i=i[0])===(o=o[0])?n[a]?n[a]+=o:n[++a]=o:(n[++a]=null,l.push({i:a,x:rr(i,o)})),r=Qa.lastIndex;return r<t.length&&(s=t.slice(r),n[a]?n[a]+=s:n[++a]=s),n.length<2?l[0]?ww(l[0].x):kw(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 Ac=180/Math.PI,Pn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pf(e,t,r,i,o,s){var a,n,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*r+t*i)&&(r-=e*l,i-=t*l),(n=Math.sqrt(r*r+i*i))&&(r/=n,i/=n,l/=n),e*i<t*r&&(e=-e,t=-t,l=-l,a=-a),{translateX:o,translateY:s,rotate:Math.atan2(t,e)*Ac,skewX:Math.atan(l)*Ac,scaleX:a,scaleY:n}}var ts;function Sw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Pn:pf(t.a,t.b,t.c,t.d,t.e,t.f)}function vw(e){return e==null||(ts||(ts=document.createElementNS("http://www.w3.org/2000/svg","g")),ts.setAttribute("transform",e),!(e=ts.transform.baseVal.consolidate()))?Pn:(e=e.matrix,pf(e.a,e.b,e.c,e.d,e.e,e.f))}function mf(e,t,r,i){function o(c){return c.length?c.pop()+" ":""}function s(c,h,d,f,u,g){if(c!==d||h!==f){var m=u.push("translate(",null,t,null,r);g.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(o(d)+"rotate(",null,i)-2,x:rr(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function n(c,h,d,f){c!==h?f.push({i:d.push(o(d)+"skewX(",null,i)-2,x:rr(c,h)}):h&&d.push(o(d)+"skewX("+h+i)}function l(c,h,d,f,u,g){if(c!==d||h!==f){var m=u.push(o(u)+"scale(",null,",",null,")");g.push({i:m-4,x:rr(c,d)},{i:m-2,x:rr(h,f)})}else(d!==1||f!==1)&&u.push(o(u)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),s(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 g=-1,m=f.length,y;++g<m;)d[(y=f[g]).i]=y.x(u);return d.join("")}}}var Tw=mf(Sw,"px, ","px)","deg)"),_w=mf(vw,", ",")",")"),Ni=0,uo=0,ro=0,yf=1e3,Rs,fo,Is=0,Yr=0,ga=0,Fo=typeof performance=="object"&&performance.now?performance:Date,xf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Kl(){return Yr||(xf(Bw),Yr=Fo.now()+ga)}function Bw(){Yr=0}function Ps(){this._call=this._time=this._next=null}Ps.prototype=Cf.prototype={constructor:Ps,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Kl():+r)+(t==null?0:+t),!this._next&&fo!==this&&(fo?fo._next=this:Rs=this,fo=this),this._call=e,this._time=r,Dn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dn())}};function Cf(e,t,r){var i=new Ps;return i.restart(e,t,r),i}function Lw(){Kl(),++Ni;for(var e=Rs,t;e;)(t=Yr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ni}function Mc(){Yr=(Is=Fo.now())+ga,Ni=uo=0;try{Lw()}finally{Ni=0,Fw(),Yr=0}}function Ew(){var e=Fo.now(),t=e-Is;t>yf&&(ga-=t,Is=e)}function Fw(){for(var e,t=Rs,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:Rs=r);fo=e,Dn(i)}function Dn(e){if(!Ni){uo&&(uo=clearTimeout(uo));var t=e-Yr;t>24?(e<1/0&&(uo=setTimeout(Mc,e-Fo.now()-ga)),ro&&(ro=clearInterval(ro))):(ro||(Is=Fo.now(),ro=setInterval(Ew,yf)),Ni=1,xf(Mc))}}function $c(e,t,r){var i=new Ps;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var Aw=Zu("start","end","cancel","interrupt"),Mw=[],bf=0,Oc=1,Nn=2,ps=3,Rc=4,qn=5,ms=6;function pa(e,t,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;$w(e,r,{name:t,index:i,group:o,on:Aw,tween:Mw,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:bf})}function Zl(e,t){var r=Ie(e,t);if(r.state>bf)throw new Error("too late; already scheduled");return r}function Ke(e,t){var r=Ie(e,t);if(r.state>ps)throw new Error("too late; already running");return r}function Ie(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function $w(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=Cf(s,0,r.time);function s(c){r.state=Oc,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!==Oc)return l();for(h in i)if(u=i[h],u.name===r.name){if(u.state===ps)return $c(a);u.state===Rc?(u.state=ms,u.timer.stop(),u.on.call("interrupt",e,e.__data__,u.index,u.group),delete i[h]):+h<t&&(u.state=ms,u.timer.stop(),u.on.call("cancel",e,e.__data__,u.index,u.group),delete i[h])}if($c(function(){r.state===ps&&(r.state=Rc,r.timer.restart(n,r.delay,r.time),n(c))}),r.state=Nn,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Nn){for(r.state=ps,o=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))&&(o[++d]=u);o.length=d+1}}function n(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=qn,1),d=-1,f=o.length;++d<f;)o[d].call(e,h);r.state===qn&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=ms,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function Ow(e,t){var r=e.__transition,i,o,s=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((i=r[a]).name!==t){s=!1;continue}o=i.state>Nn&&i.state<qn,i.state=ms,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}s&&delete e.__transition}}function Rw(e){return this.each(function(){Ow(this,e)})}function Iw(e,t){var r,i;return function(){var o=Ke(this,e),s=o.tween;if(s!==r){i=r=s;for(var a=0,n=i.length;a<n;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function Pw(e,t,r){var i,o;if(typeof r!="function")throw new Error;return function(){var s=Ke(this,e),a=s.tween;if(a!==i){o=(i=a).slice();for(var n={name:t,value:r},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=n;break}l===c&&o.push(n)}s.tween=o}}function Dw(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=Ie(this.node(),r).tween,o=0,s=i.length,a;o<s;++o)if((a=i[o]).name===e)return a.value;return null}return this.each((t==null?Iw:Pw)(r,e,t))}function Ql(e,t,r){var i=e._id;return e.each(function(){var o=Ke(this,i);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return Ie(o,i).value[t]}}function kf(e,t){var r;return(typeof t=="number"?rr:t instanceof Di?Rn:(r=Di(t))?(t=r,Rn):gf)(e,t)}function Nw(e){return function(){this.removeAttribute(e)}}function qw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function zw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttribute(e);return a===o?null:a===i?s:s=t(i=a,r)}}function jw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===i?s:s=t(i=a,r)}}function Ww(e,t,r){var i,o,s;return function(){var a,n=r(this),l;return n==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=n+"",a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n)))}}function Hw(e,t,r){var i,o,s;return function(){var a,n=r(this),l;return n==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=n+"",a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n)))}}function Yw(e,t){var r=da(e),i=r==="transform"?_w:kf;return this.attrTween(e,typeof t=="function"?(r.local?Hw:Ww)(r,i,Ql(this,"attr."+e,t)):t==null?(r.local?qw:Nw)(r):(r.local?jw:zw)(r,i,t))}function Uw(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Gw(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Xw(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Gw(e,s)),r}return o._value=t,o}function Vw(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Uw(e,s)),r}return o._value=t,o}function Kw(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=da(e);return this.tween(r,(i.local?Xw:Vw)(i,t))}function Zw(e,t){return function(){Zl(this,e).delay=+t.apply(this,arguments)}}function Qw(e,t){return t=+t,function(){Zl(this,e).delay=t}}function Jw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Zw:Qw)(t,e)):Ie(this.node(),t).delay}function tS(e,t){return function(){Ke(this,e).duration=+t.apply(this,arguments)}}function eS(e,t){return t=+t,function(){Ke(this,e).duration=t}}function rS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tS:eS)(t,e)):Ie(this.node(),t).duration}function iS(e,t){if(typeof t!="function")throw new Error;return function(){Ke(this,e).ease=t}}function oS(e){var t=this._id;return arguments.length?this.each(iS(t,e)):Ie(this.node(),t).ease}function sS(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ke(this,e).ease=r}}function aS(e){if(typeof e!="function")throw new Error;return this.each(sS(this._id,e))}function nS(e){typeof e!="function"&&(e=tf(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new ar(i,this._parents,this._name,this._id)}function lS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,o=r.length,s=Math.min(i,o),a=new Array(i),n=0;n<s;++n)for(var l=t[n],c=r[n],h=l.length,d=a[n]=new Array(h),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 hS(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 cS(e,t,r){var i,o,s=hS(t)?Zl:Ke;return function(){var a=s(this,e),n=a.on;n!==i&&(o=(i=n).copy()).on(t,r),a.on=o}}function dS(e,t){var r=this._id;return arguments.length<2?Ie(this.node(),r).on.on(e):this.each(cS(r,e,t))}function uS(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function fS(){return this.on("end.remove",uS(this._id))}function gS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Ul(e));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a<o;++a)for(var n=i[a],l=n.length,c=s[a]=new Array(l),h,d,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,pa(c[f],t,r,f,c,Ie(h,r)));return new ar(s,this._parents,t,r)}function pS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Ju(e));for(var i=this._groups,o=i.length,s=[],a=[],n=0;n<o;++n)for(var l=i[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var f=e.call(h,h.__data__,d,l),u,g=Ie(h,r),m=0,y=f.length;m<y;++m)(u=f[m])&&pa(u,t,r,m,f,g);s.push(f),a.push(h)}return new ar(s,a,t,r)}var mS=zo.prototype.constructor;function yS(){return new mS(this._groups,this._parents)}function xS(e,t){var r,i,o;return function(){var s=Pi(this,e),a=(this.style.removeProperty(e),Pi(this,e));return s===a?null:s===r&&a===i?o:o=t(r=s,i=a)}}function wf(e){return function(){this.style.removeProperty(e)}}function CS(e,t,r){var i,o=r+"",s;return function(){var a=Pi(this,e);return a===o?null:a===i?s:s=t(i=a,r)}}function bS(e,t,r){var i,o,s;return function(){var a=Pi(this,e),n=r(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),Pi(this,e))),a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n))}}function kS(e,t){var r,i,o,s="style."+t,a="end."+s,n;return function(){var l=Ke(this,e),c=l.on,h=l.value[s]==null?n||(n=wf(t)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(a,o=h),l.on=i}}function wS(e,t,r){var i=(e+="")=="transform"?Tw:kf;return t==null?this.styleTween(e,xS(e,i)).on("end.style."+e,wf(e)):typeof t=="function"?this.styleTween(e,bS(e,i,Ql(this,"style."+e,t))).each(kS(this._id,e)):this.styleTween(e,CS(e,i,t),r).on("end.style."+e,null)}function SS(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function vS(e,t,r){var i,o;function s(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&SS(e,a,r)),i}return s._value=t,s}function TS(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,vS(e,t,r??""))}function _S(e){return function(){this.textContent=e}}function BS(e){return function(){var t=e(this);this.textContent=t??""}}function LS(e){return this.tween("text",typeof e=="function"?BS(Ql(this,"text",e)):_S(e==null?"":e+""))}function ES(e){return function(t){this.textContent=e.call(this,t)}}function FS(e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&ES(o)),t}return i._value=e,i}function AS(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,FS(e))}function MS(){for(var e=this._name,t=this._id,r=Sf(),i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)if(l=a[c]){var h=Ie(l,t);pa(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 $S(){var e,t,r=this,i=r._id,o=r.size();return new Promise(function(s,a){var n={value:a},l={value:function(){--o===0&&s()}};r.each(function(){var c=Ke(this,i),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(n),t._.interrupt.push(n),t._.end.push(l)),c.on=t}),o===0&&s()})}var OS=0;function ar(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function Sf(){return++OS}var Je=zo.prototype;ar.prototype={constructor:ar,select:gS,selectAll:pS,selectChild:Je.selectChild,selectChildren:Je.selectChildren,filter:nS,merge:lS,selection:yS,transition:MS,call:Je.call,nodes:Je.nodes,node:Je.node,size:Je.size,empty:Je.empty,each:Je.each,on:dS,attr:Yw,attrTween:Kw,style:wS,styleTween:TS,text:LS,textTween:AS,remove:fS,tween:Dw,delay:Jw,duration:rS,ease:oS,easeVarying:aS,end:$S,[Symbol.iterator]:Je[Symbol.iterator]};function RS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var IS={time:null,delay:0,duration:250,ease:RS};function PS(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 DS(e){var t,r;e instanceof ar?(t=e._id,e=e._name):(t=Sf(),(r=IS).time=Kl(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&pa(l,e,t,c,a,r||PS(l,t));return new ar(i,this._parents,e,t)}zo.prototype.interrupt=Rw;zo.prototype.transition=DS;const zn=Math.PI,jn=2*zn,Mr=1e-6,NS=jn-Mr;function vf(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function qS(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return vf;const r=10**t;return function(i){this._+=i[0];for(let o=1,s=i.length;o<s;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}class zS{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?vf:qS(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,o){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(t,r,i,o,s,a){this._append`C${+t},${+r},${+i},${+o},${this._x1=+s},${this._y1=+a}`}arcTo(t,r,i,o,s){if(t=+t,r=+r,i=+i,o=+o,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,n=this._y1,l=i-t,c=o-r,h=a-t,d=n-r,f=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(f>Mr)if(!(Math.abs(d*l-c*h)>Mr)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let u=i-a,g=o-n,m=l*l+c*c,y=u*u+g*g,x=Math.sqrt(m),C=Math.sqrt(f),w=s*Math.tan((zn-Math.acos((m+f-y)/(2*x*C)))/2),S=w/C,v=w/x;Math.abs(S-1)>Mr&&this._append`L${t+S*h},${r+S*d}`,this._append`A${s},${s},0,0,${+(d*u>h*g)},${this._x1=t+v*l},${this._y1=r+v*c}`}}arc(t,r,i,o,s,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^a,f=a?o-s:s-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>Mr||Math.abs(this._y1-h)>Mr)&&this._append`L${c},${h}`,i&&(f<0&&(f=f%jn+jn),f>NS?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>Mr&&this._append`A${i},${i},0,${+(f>=zn)},${d},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function $r(e){return function(){return e}}const jS=Math.abs,WS=Math.atan2,HS=Math.cos,YS=Math.max,US=Math.min,GS=Math.sin,XS=Math.sqrt,Wn=1e-12,ma=Math.PI,Hn=ma/2,VS=2*ma;function KS(e){return e>1?0:e<-1?ma:Math.acos(e)}function ZS(e){return e>=1?Hn:e<=-1?-Hn:Math.asin(e)}function Tf(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 zS(t)}function _f(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Bf(e){this._context=e}Bf.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 wo(e){return new Bf(e)}function QS(e){return e[0]}function JS(e){return e[1]}function Lf(e,t){var r=$r(!0),i=null,o=wo,s=null,a=Tf(n);e=typeof e=="function"?e:e===void 0?QS:$r(e),t=typeof t=="function"?t:t===void 0?JS:$r(t);function n(l){var c,h=(l=_f(l)).length,d,f=!1,u;for(i==null&&(s=o(u=a())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+e(d,c,l),+t(d,c,l));if(u)return s=null,u+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:$r(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:$r(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:$r(!!l),n):r},n.curve=function(l){return arguments.length?(o=l,i!=null&&(s=o(i)),n):o},n.context=function(l){return arguments.length?(l==null?i=s=null:s=o(i=l),n):i},n}class Ef{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 Ff(e){return new Ef(e,!0)}function Af(e){return new Ef(e,!1)}function xr(){}function Ds(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 ya(e){this._context=e}ya.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:Ds(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:Ds(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ns(e){return new ya(e)}function Mf(e){this._context=e}Mf.prototype={areaStart:xr,areaEnd:xr,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:Ds(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tv(e){return new Mf(e)}function $f(e){this._context=e}$f.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:Ds(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ev(e){return new $f(e)}function Of(e,t){this._basis=new ya(e),this._beta=t}Of.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],o=t[0],s=e[r]-i,a=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*s),this._beta*t[n]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const rv=(function e(t){function r(i){return t===1?new ya(i):new Of(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function qs(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 Jl(e,t){this._context=e,this._k=(1-t)/6}Jl.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:qs(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:qs(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 Rf=(function e(t){function r(i){return new Jl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function th(e,t){this._context=e,this._k=(1-t)/6}th.prototype={areaStart:xr,areaEnd:xr,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:qs(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 iv=(function e(t){function r(i){return new th(i,t)}return r.tension=function(i){return e(+i)},r})(0);function eh(e,t){this._context=e,this._k=(1-t)/6}eh.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:qs(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 ov=(function e(t){function r(i){return new eh(i,t)}return r.tension=function(i){return e(+i)},r})(0);function rh(e,t,r){var i=e._x1,o=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Wn){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Wn){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,s,a,e._x2,e._y2)}function If(e,t){this._context=e,this._alpha=t}If.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:rh(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 Pf=(function e(t){function r(i){return t?new If(i,t):new Jl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Df(e,t){this._context=e,this._alpha=t}Df.prototype={areaStart:xr,areaEnd:xr,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:rh(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 sv=(function e(t){function r(i){return t?new Df(i,t):new th(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Nf(e,t){this._context=e,this._alpha=t}Nf.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:rh(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 av=(function e(t){function r(i){return t?new Nf(i,t):new eh(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function qf(e){this._context=e}qf.prototype={areaStart:xr,areaEnd:xr,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 nv(e){return new qf(e)}function Ic(e){return e<0?-1:1}function Pc(e,t,r){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(r-e._y1)/(o||i<0&&-0),n=(s*o+a*i)/(i+o);return(Ic(s)+Ic(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(n))||0}function Dc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ja(e,t,r){var i=e._x0,o=e._y0,s=e._x1,a=e._y1,n=(s-i)/3;e._context.bezierCurveTo(i+n,o+n*t,s-n,a-n*r,s,a)}function zs(e){this._context=e}zs.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:Ja(this,this._t0,Dc(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,Ja(this,Dc(this,r=Pc(this,e,t)),r);break;default:Ja(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 zf(e){this._context=new jf(e)}(zf.prototype=Object.create(zs.prototype)).point=function(e,t){zs.prototype.point.call(this,t,e)};function jf(e){this._context=e}jf.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,o,s){this._context.bezierCurveTo(t,e,i,r,s,o)}};function Wf(e){return new zs(e)}function Hf(e){return new zf(e)}function Yf(e){this._context=e}Yf.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=Nc(e),o=Nc(t),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(i[0][s],o[0][s],i[1][s],o[1][s],e[a],t[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Nc(e){var t,r=e.length-1,i,o=new Array(r),s=new Array(r),a=new Array(r);for(o[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,s[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(o[r-1]=a[r-1]/s[r-1],t=r-2;t>=0;--t)o[t]=(a[t]-o[t+1])/s[t];for(s[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-o[t+1];return[o,s]}function Uf(e){return new Yf(e)}function xa(e,t){this._context=e,this._t=t}xa.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 Gf(e){return new xa(e,.5)}function Xf(e){return new xa(e,0)}function Vf(e){return new xa(e,1)}function go(e,t,r){this.k=e,this.x=t,this.y=r}go.prototype={constructor:go,scale:function(e){return e===1?this:new go(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new go(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+")"}};go.prototype;var Kf=p(e=>{const{securityLevel:t}=kt();let r=yt("body");if(t==="sandbox"){const s=yt(`#i${e}`).node()?.contentDocument??document;r=yt(s.body)}return r.select(`#${e}`)},"selectSvgElement");function ih(e){return typeof e>"u"||e===null}p(ih,"isNothing");function Zf(e){return typeof e=="object"&&e!==null}p(Zf,"isObject");function Qf(e){return Array.isArray(e)?e:ih(e)?[]:[e]}p(Qf,"toArray");function Jf(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}p(Jf,"extend");function tg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}p(tg,"repeat");function eg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}p(eg,"isNegativeZero");var lv=ih,hv=Zf,cv=Qf,dv=tg,uv=eg,fv=Jf,Ut={isNothing:lv,isObject:hv,toArray:cv,repeat:dv,isNegativeZero:uv,extend:fv};function oh(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
130
+ `},"getStyles"),Ck=p((e,t)=>{t!==void 0&&(fs[e]=t)},"addStylesForDiagram"),bk=xk,ql={};wu(ql,{clear:()=>ju,getAccDescription:()=>Uu,getAccTitle:()=>Hu,getDiagramTitle:()=>Xu,setAccDescription:()=>Yu,setAccTitle:()=>Wu,setDiagramTitle:()=>Gu});var zl="",jl="",Wl="",Hl=p(e=>Se(e,Rt()),"sanitizeText"),ju=p(()=>{zl="",Wl="",jl=""},"clear"),Wu=p(e=>{zl=Hl(e).replace(/^\s+/g,"")},"setAccTitle"),Hu=p(()=>zl,"getAccTitle"),Yu=p(e=>{Wl=Hl(e).replace(/\n\s+/g,`
131
+ `)},"setAccDescription"),Uu=p(()=>Wl,"getAccDescription"),Gu=p(e=>{jl=Hl(e)},"setDiagramTitle"),Xu=p(()=>jl,"getDiagramTitle"),bc=V,kk=Ol,kt=Rt,wk=Fu,Sk=Ri,Yl=p(e=>Se(e,kt()),"sanitizeText"),Vu=zu,vk=p(()=>ql,"getCommonDb"),Fs={},As=p((e,t,r)=>{Fs[e]&&bc.warn(`Diagram with id ${e} already registered. Overwriting.`),Fs[e]=t,r&&Iu(e,r),Ck(e,t.styles),t.injectUtils?.(bc,kk,kt,Yl,Vu,vk(),()=>{})},"registerDiagram"),Mn=p(e=>{if(e in Fs)return Fs[e];throw new Tk(e)},"getDiagram"),Fi,Tk=(Fi=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},p(Fi,"DiagramNotFoundError"),Fi),_k={value:()=>{}};function Ku(){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 gs(r)}function gs(e){this._=e}function Bk(e,t){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}gs.prototype=Ku.prototype={constructor:gs,on:function(e,t){var r=this._,i=Bk(e+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((o=(e=i[s]).type)&&(o=Lk(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(o=(e=i[s]).type)r[o]=kc(r[o],e.name,t);else if(t==null)for(o in r)r[o]=kc(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new gs(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,s;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,o=s.length;i<o;++i)s[i].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,s=i.length;o<s;++o)i[o].value.apply(t,r)}};function Lk(e,t){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===t)return o.value}function kc(e,t,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=_k,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var $n="http://www.w3.org/1999/xhtml";const wc={svg:"http://www.w3.org/2000/svg",xhtml:$n,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function da(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),wc.hasOwnProperty(t)?{space:wc[t],local:e}:e}function Ek(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===$n&&t.documentElement.namespaceURI===$n?t.createElement(e):t.createElementNS(r,e)}}function Fk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Zu(e){var t=da(e);return(t.local?Fk:Ek)(t)}function Ak(){}function Ul(e){return e==null?Ak:function(){return this.querySelector(e)}}function Mk(e){typeof e!="function"&&(e=Ul(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=new Array(a),l,c,h=0;h<a;++h)(l=s[h])&&(c=e.call(l,l.__data__,h,s))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new ye(i,this._parents)}function $k(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ok(){return[]}function Qu(e){return e==null?Ok:function(){return this.querySelectorAll(e)}}function Rk(e){return function(){return $k(e.apply(this,arguments))}}function Ik(e){typeof e=="function"?e=Rk(e):e=Qu(e);for(var t=this._groups,r=t.length,i=[],o=[],s=0;s<r;++s)for(var a=t[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),o.push(l));return new ye(i,o)}function Ju(e){return function(){return this.matches(e)}}function tf(e){return function(t){return t.matches(e)}}var Pk=Array.prototype.find;function Dk(e){return function(){return Pk.call(this.children,e)}}function Nk(){return this.firstElementChild}function qk(e){return this.select(e==null?Nk:Dk(typeof e=="function"?e:tf(e)))}var zk=Array.prototype.filter;function jk(){return Array.from(this.children)}function Wk(e){return function(){return zk.call(this.children,e)}}function Hk(e){return this.selectAll(e==null?jk:Wk(typeof e=="function"?e:tf(e)))}function Yk(e){typeof e!="function"&&(e=Ju(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new ye(i,this._parents)}function ef(e){return new Array(e.length)}function Uk(){return new ye(this._enter||this._groups.map(ef),this._parents)}function Ms(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ms.prototype={constructor:Ms,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 Gk(e){return function(){return e}}function Xk(e,t,r,i,o,s){for(var a=0,n,l=t.length,c=s.length;a<c;++a)(n=t[a])?(n.__data__=s[a],i[a]=n):r[a]=new Ms(e,s[a]);for(;a<l;++a)(n=t[a])&&(o[a]=n)}function Vk(e,t,r,i,o,s,a){var n,l,c=new Map,h=t.length,d=s.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)?o[n]=l:c.set(u,l));for(n=0;n<d;++n)u=a.call(e,s[n],n,s)+"",(l=c.get(u))?(i[n]=l,l.__data__=s[n],c.delete(u)):r[n]=new Ms(e,s[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(f[n])===l&&(o[n]=l)}function Kk(e){return e.__data__}function Zk(e,t){if(!arguments.length)return Array.from(this,Kk);var r=t?Vk:Xk,i=this._parents,o=this._groups;typeof e!="function"&&(e=Gk(e));for(var s=o.length,a=new Array(s),n=new Array(s),l=new Array(s),c=0;c<s;++c){var h=i[c],d=o[c],f=d.length,u=Qk(e.call(h,h&&h.__data__,c,i)),g=u.length,m=n[c]=new Array(g),y=a[c]=new Array(g),x=l[c]=new Array(f);r(h,d,m,y,x,u,t);for(var C=0,w=0,S,v;C<g;++C)if(S=m[C]){for(C>=w&&(w=C+1);!(v=y[w])&&++w<g;);S._next=v||null}}return a=new ye(a,i),a._enter=n,a._exit=l,a}function Qk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Jk(){return new ye(this._exit||this._groups.map(ef),this._parents)}function t2(e,t,r){var i=this.enter(),o=this,s=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?s.remove():r(s),i&&o?i.merge(o).order():o}function e2(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,s=i.length,a=Math.min(o,s),n=new Array(o),l=0;l<a;++l)for(var c=r[l],h=i[l],d=c.length,f=n[l]=new Array(d),u,g=0;g<d;++g)(u=c[g]||h[g])&&(f[g]=u);for(;l<o;++l)n[l]=r[l];return new ye(n,this._parents)}function r2(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,s=i[o],a;--o>=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function i2(e){e||(e=o2);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s){for(var a=r[s],n=a.length,l=o[s]=new Array(n),c,h=0;h<n;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new ye(o,this._parents).order()}function o2(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function s2(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function a2(){return Array.from(this)}function n2(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length;o<s;++o){var a=i[o];if(a)return a}return null}function l2(){let e=0;for(const t of this)++e;return e}function h2(){return!this.node()}function c2(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],s=0,a=o.length,n;s<a;++s)(n=o[s])&&e.call(n,n.__data__,s,o);return this}function d2(e){return function(){this.removeAttribute(e)}}function u2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function f2(e,t){return function(){this.setAttribute(e,t)}}function g2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function p2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function m2(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 y2(e,t){var r=da(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?u2:d2:typeof t=="function"?r.local?m2:p2:r.local?g2:f2)(r,t))}function rf(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function x2(e){return function(){this.style.removeProperty(e)}}function C2(e,t,r){return function(){this.style.setProperty(e,t,r)}}function b2(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function k2(e,t,r){return arguments.length>1?this.each((t==null?x2:typeof t=="function"?b2:C2)(e,t,r??"")):Pi(this.node(),e)}function Pi(e,t){return e.style.getPropertyValue(t)||rf(e).getComputedStyle(e,null).getPropertyValue(t)}function w2(e){return function(){delete this[e]}}function S2(e,t){return function(){this[e]=t}}function v2(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function T2(e,t){return arguments.length>1?this.each((t==null?w2:typeof t=="function"?v2:S2)(e,t)):this.node()[e]}function of(e){return e.trim().split(/^|\s+/)}function Gl(e){return e.classList||new sf(e)}function sf(e){this._node=e,this._names=of(e.getAttribute("class")||"")}sf.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 af(e,t){for(var r=Gl(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function nf(e,t){for(var r=Gl(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function _2(e){return function(){af(this,e)}}function B2(e){return function(){nf(this,e)}}function L2(e,t){return function(){(t.apply(this,arguments)?af:nf)(this,e)}}function E2(e,t){var r=of(e+"");if(arguments.length<2){for(var i=Gl(this.node()),o=-1,s=r.length;++o<s;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?L2:t?_2:B2)(r,t))}function F2(){this.textContent=""}function A2(e){return function(){this.textContent=e}}function M2(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $2(e){return arguments.length?this.each(e==null?F2:(typeof e=="function"?M2:A2)(e)):this.node().textContent}function O2(){this.innerHTML=""}function R2(e){return function(){this.innerHTML=e}}function I2(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function P2(e){return arguments.length?this.each(e==null?O2:(typeof e=="function"?I2:R2)(e)):this.node().innerHTML}function D2(){this.nextSibling&&this.parentNode.appendChild(this)}function N2(){return this.each(D2)}function q2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function z2(){return this.each(q2)}function j2(e){var t=typeof e=="function"?e:Zu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function W2(){return null}function H2(e,t){var r=typeof e=="function"?e:Zu(e),i=t==null?W2:typeof t=="function"?t:Ul(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function Y2(){var e=this.parentNode;e&&e.removeChild(this)}function U2(){return this.each(Y2)}function G2(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function X2(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function V2(e){return this.select(e?X2:G2)}function K2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Z2(e){return function(t){e.call(this,t,this.__data__)}}function Q2(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 J2(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,s;r<o;++r)s=t[r],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++i]=s;++i?t.length=i:delete this.__on}}}function tw(e,t,r){return function(){var i=this.__on,o,s=Z2(t);if(i){for(var a=0,n=i.length;a<n;++a)if((o=i[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=t;return}}this.addEventListener(e.type,s,r),o={type:e.type,name:e.name,value:t,listener:s,options:r},i?i.push(o):this.__on=[o]}}function ew(e,t,r){var i=Q2(e+""),o,s=i.length,a;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(o=0,h=n[l];o<s;++o)if((a=i[o]).type===h.type&&a.name===h.name)return h.value}return}for(n=t?tw:J2,o=0;o<s;++o)this.each(n(i[o],t,r));return this}function lf(e,t,r){var i=rf(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,r):(o=i.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function rw(e,t){return function(){return lf(this,e,t)}}function iw(e,t){return function(){return lf(this,e,t.apply(this,arguments))}}function ow(e,t){return this.each((typeof t=="function"?iw:rw)(e,t))}function*sw(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,s=i.length,a;o<s;++o)(a=i[o])&&(yield a)}var hf=[null];function ye(e,t){this._groups=e,this._parents=t}function zo(){return new ye([[document.documentElement]],hf)}function aw(){return this}ye.prototype=zo.prototype={constructor:ye,select:Mk,selectAll:Ik,selectChild:qk,selectChildren:Hk,filter:Yk,data:Zk,enter:Uk,exit:Jk,join:t2,merge:e2,selection:aw,order:r2,sort:i2,call:s2,nodes:a2,node:n2,size:l2,empty:h2,each:c2,attr:y2,style:k2,property:T2,classed:E2,text:$2,html:P2,raise:N2,lower:z2,append:j2,insert:H2,remove:U2,clone:V2,datum:K2,on:ew,dispatch:ow,[Symbol.iterator]:sw};function yt(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],hf)}function ua(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Xl(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function Ui(){}var Lo=.7,$s=1/Lo,mi="\\s*([+-]?\\d+)\\s*",Eo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",He="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nw=/^#([0-9a-f]{3,8})$/,lw=new RegExp(`^rgb\\(${mi},${mi},${mi}\\)$`),hw=new RegExp(`^rgb\\(${He},${He},${He}\\)$`),cw=new RegExp(`^rgba\\(${mi},${mi},${mi},${Eo}\\)$`),dw=new RegExp(`^rgba\\(${He},${He},${He},${Eo}\\)$`),uw=new RegExp(`^hsl\\(${Eo},${He},${He}\\)$`),fw=new RegExp(`^hsla\\(${Eo},${He},${He},${Eo}\\)$`),Sc={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};ua(Ui,Di,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vc,formatHex:vc,formatHex8:gw,formatHsl:pw,formatRgb:Tc,toString:Tc});function vc(){return this.rgb().formatHex()}function gw(){return this.rgb().formatHex8()}function pw(){return df(this).formatHsl()}function Tc(){return this.rgb().formatRgb()}function Di(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=nw.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?_c(t):r===3?new he(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Qo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Qo(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=lw.exec(e))?new he(t[1],t[2],t[3],1):(t=hw.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cw.exec(e))?Qo(t[1],t[2],t[3],t[4]):(t=dw.exec(e))?Qo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uw.exec(e))?Ec(t[1],t[2]/100,t[3]/100,1):(t=fw.exec(e))?Ec(t[1],t[2]/100,t[3]/100,t[4]):Sc.hasOwnProperty(e)?_c(Sc[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function _c(e){return new he(e>>16&255,e>>8&255,e&255,1)}function Qo(e,t,r,i){return i<=0&&(e=t=r=NaN),new he(e,t,r,i)}function cf(e){return e instanceof Ui||(e=Di(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function On(e,t,r,i){return arguments.length===1?cf(e):new he(e,t,r,i??1)}function he(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}ua(he,On,Xl(Ui,{brighter(e){return e=e==null?$s:Math.pow($s,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(qr(this.r),qr(this.g),qr(this.b),Os(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:Bc,formatHex:Bc,formatHex8:mw,formatRgb:Lc,toString:Lc}));function Bc(){return`#${Pr(this.r)}${Pr(this.g)}${Pr(this.b)}`}function mw(){return`#${Pr(this.r)}${Pr(this.g)}${Pr(this.b)}${Pr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Lc(){const e=Os(this.opacity);return`${e===1?"rgb(":"rgba("}${qr(this.r)}, ${qr(this.g)}, ${qr(this.b)}${e===1?")":`, ${e})`}`}function Os(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pr(e){return e=qr(e),(e<16?"0":"")+e.toString(16)}function Ec(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Me(e,t,r,i)}function df(e){if(e instanceof Me)return new Me(e.h,e.s,e.l,e.opacity);if(e instanceof Ui||(e=Di(e)),!e)return new Me;if(e instanceof Me)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),s=Math.max(t,r,i),a=NaN,n=s-o,l=(s+o)/2;return n?(t===s?a=(r-i)/n+(r<i)*6:r===s?a=(i-t)/n+2:a=(t-r)/n+4,n/=l<.5?s+o:2-s-o,a*=60):n=l>0&&l<1?0:a,new Me(a,n,l,e.opacity)}function yw(e,t,r,i){return arguments.length===1?df(e):new Me(e,t,r,i??1)}function Me(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}ua(Me,yw,Xl(Ui,{brighter(e){return e=e==null?$s:Math.pow($s,e),new Me(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new Me(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,o=2*r-i;return new he(Za(e>=240?e-240:e+120,o,i),Za(e,o,i),Za(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Me(Fc(this.h),Jo(this.s),Jo(this.l),Os(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=Os(this.opacity);return`${e===1?"hsl(":"hsla("}${Fc(this.h)}, ${Jo(this.s)*100}%, ${Jo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Fc(e){return e=(e||0)%360,e<0?e+360:e}function Jo(e){return Math.max(0,Math.min(1,e||0))}function Za(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 fa=e=>()=>e;function uf(e,t){return function(r){return e+r*t}}function xw(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 Cw(e,t){var r=t-e;return r?uf(e,r>180||r<-180?r-360*Math.round(r/360):r):fa(isNaN(e)?t:e)}function bw(e){return(e=+e)==1?Vl:function(t,r){return r-t?xw(t,r,e):fa(isNaN(t)?r:t)}}function Vl(e,t){var r=t-e;return r?uf(e,r):fa(isNaN(e)?t:e)}const Rn=(function e(t){var r=bw(t);function i(o,s){var a=r((o=On(o)).r,(s=On(s)).r),n=r(o.g,s.g),l=r(o.b,s.b),c=Vl(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=n(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function rr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var In=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qa=new RegExp(In.source,"g");function kw(e){return function(){return e}}function ww(e){return function(t){return e(t)+""}}function ff(e,t){var r=In.lastIndex=Qa.lastIndex=0,i,o,s,a=-1,n=[],l=[];for(e=e+"",t=t+"";(i=In.exec(e))&&(o=Qa.exec(t));)(s=o.index)>r&&(s=t.slice(r,s),n[a]?n[a]+=s:n[++a]=s),(i=i[0])===(o=o[0])?n[a]?n[a]+=o:n[++a]=o:(n[++a]=null,l.push({i:a,x:rr(i,o)})),r=Qa.lastIndex;return r<t.length&&(s=t.slice(r),n[a]?n[a]+=s:n[++a]=s),n.length<2?l[0]?ww(l[0].x):kw(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 Ac=180/Math.PI,Pn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gf(e,t,r,i,o,s){var a,n,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*r+t*i)&&(r-=e*l,i-=t*l),(n=Math.sqrt(r*r+i*i))&&(r/=n,i/=n,l/=n),e*i<t*r&&(e=-e,t=-t,l=-l,a=-a),{translateX:o,translateY:s,rotate:Math.atan2(t,e)*Ac,skewX:Math.atan(l)*Ac,scaleX:a,scaleY:n}}var ts;function Sw(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Pn:gf(t.a,t.b,t.c,t.d,t.e,t.f)}function vw(e){return e==null||(ts||(ts=document.createElementNS("http://www.w3.org/2000/svg","g")),ts.setAttribute("transform",e),!(e=ts.transform.baseVal.consolidate()))?Pn:(e=e.matrix,gf(e.a,e.b,e.c,e.d,e.e,e.f))}function pf(e,t,r,i){function o(c){return c.length?c.pop()+" ":""}function s(c,h,d,f,u,g){if(c!==d||h!==f){var m=u.push("translate(",null,t,null,r);g.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(o(d)+"rotate(",null,i)-2,x:rr(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function n(c,h,d,f){c!==h?f.push({i:d.push(o(d)+"skewX(",null,i)-2,x:rr(c,h)}):h&&d.push(o(d)+"skewX("+h+i)}function l(c,h,d,f,u,g){if(c!==d||h!==f){var m=u.push(o(u)+"scale(",null,",",null,")");g.push({i:m-4,x:rr(c,d)},{i:m-2,x:rr(h,f)})}else(d!==1||f!==1)&&u.push(o(u)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),s(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 g=-1,m=f.length,y;++g<m;)d[(y=f[g]).i]=y.x(u);return d.join("")}}}var Tw=pf(Sw,"px, ","px)","deg)"),_w=pf(vw,", ",")",")"),Ni=0,uo=0,ro=0,mf=1e3,Rs,fo,Is=0,Yr=0,ga=0,Fo=typeof performance=="object"&&performance.now?performance:Date,yf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Kl(){return Yr||(yf(Bw),Yr=Fo.now()+ga)}function Bw(){Yr=0}function Ps(){this._call=this._time=this._next=null}Ps.prototype=xf.prototype={constructor:Ps,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Kl():+r)+(t==null?0:+t),!this._next&&fo!==this&&(fo?fo._next=this:Rs=this,fo=this),this._call=e,this._time=r,Dn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dn())}};function xf(e,t,r){var i=new Ps;return i.restart(e,t,r),i}function Lw(){Kl(),++Ni;for(var e=Rs,t;e;)(t=Yr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ni}function Mc(){Yr=(Is=Fo.now())+ga,Ni=uo=0;try{Lw()}finally{Ni=0,Fw(),Yr=0}}function Ew(){var e=Fo.now(),t=e-Is;t>mf&&(ga-=t,Is=e)}function Fw(){for(var e,t=Rs,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:Rs=r);fo=e,Dn(i)}function Dn(e){if(!Ni){uo&&(uo=clearTimeout(uo));var t=e-Yr;t>24?(e<1/0&&(uo=setTimeout(Mc,e-Fo.now()-ga)),ro&&(ro=clearInterval(ro))):(ro||(Is=Fo.now(),ro=setInterval(Ew,mf)),Ni=1,yf(Mc))}}function $c(e,t,r){var i=new Ps;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var Aw=Ku("start","end","cancel","interrupt"),Mw=[],Cf=0,Oc=1,Nn=2,ps=3,Rc=4,qn=5,ms=6;function pa(e,t,r,i,o,s){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;$w(e,r,{name:t,index:i,group:o,on:Aw,tween:Mw,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Cf})}function Zl(e,t){var r=Ie(e,t);if(r.state>Cf)throw new Error("too late; already scheduled");return r}function Ke(e,t){var r=Ie(e,t);if(r.state>ps)throw new Error("too late; already running");return r}function Ie(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function $w(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=xf(s,0,r.time);function s(c){r.state=Oc,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!==Oc)return l();for(h in i)if(u=i[h],u.name===r.name){if(u.state===ps)return $c(a);u.state===Rc?(u.state=ms,u.timer.stop(),u.on.call("interrupt",e,e.__data__,u.index,u.group),delete i[h]):+h<t&&(u.state=ms,u.timer.stop(),u.on.call("cancel",e,e.__data__,u.index,u.group),delete i[h])}if($c(function(){r.state===ps&&(r.state=Rc,r.timer.restart(n,r.delay,r.time),n(c))}),r.state=Nn,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Nn){for(r.state=ps,o=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))&&(o[++d]=u);o.length=d+1}}function n(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=qn,1),d=-1,f=o.length;++d<f;)o[d].call(e,h);r.state===qn&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=ms,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function Ow(e,t){var r=e.__transition,i,o,s=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((i=r[a]).name!==t){s=!1;continue}o=i.state>Nn&&i.state<qn,i.state=ms,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}s&&delete e.__transition}}function Rw(e){return this.each(function(){Ow(this,e)})}function Iw(e,t){var r,i;return function(){var o=Ke(this,e),s=o.tween;if(s!==r){i=r=s;for(var a=0,n=i.length;a<n;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function Pw(e,t,r){var i,o;if(typeof r!="function")throw new Error;return function(){var s=Ke(this,e),a=s.tween;if(a!==i){o=(i=a).slice();for(var n={name:t,value:r},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=n;break}l===c&&o.push(n)}s.tween=o}}function Dw(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=Ie(this.node(),r).tween,o=0,s=i.length,a;o<s;++o)if((a=i[o]).name===e)return a.value;return null}return this.each((t==null?Iw:Pw)(r,e,t))}function Ql(e,t,r){var i=e._id;return e.each(function(){var o=Ke(this,i);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return Ie(o,i).value[t]}}function bf(e,t){var r;return(typeof t=="number"?rr:t instanceof Di?Rn:(r=Di(t))?(t=r,Rn):ff)(e,t)}function Nw(e){return function(){this.removeAttribute(e)}}function qw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function zw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttribute(e);return a===o?null:a===i?s:s=t(i=a,r)}}function jw(e,t,r){var i,o=r+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===i?s:s=t(i=a,r)}}function Ww(e,t,r){var i,o,s;return function(){var a,n=r(this),l;return n==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=n+"",a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n)))}}function Hw(e,t,r){var i,o,s;return function(){var a,n=r(this),l;return n==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=n+"",a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n)))}}function Yw(e,t){var r=da(e),i=r==="transform"?_w:bf;return this.attrTween(e,typeof t=="function"?(r.local?Hw:Ww)(r,i,Ql(this,"attr."+e,t)):t==null?(r.local?qw:Nw)(r):(r.local?jw:zw)(r,i,t))}function Uw(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Gw(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function Xw(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Gw(e,s)),r}return o._value=t,o}function Vw(e,t){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Uw(e,s)),r}return o._value=t,o}function Kw(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=da(e);return this.tween(r,(i.local?Xw:Vw)(i,t))}function Zw(e,t){return function(){Zl(this,e).delay=+t.apply(this,arguments)}}function Qw(e,t){return t=+t,function(){Zl(this,e).delay=t}}function Jw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Zw:Qw)(t,e)):Ie(this.node(),t).delay}function tS(e,t){return function(){Ke(this,e).duration=+t.apply(this,arguments)}}function eS(e,t){return t=+t,function(){Ke(this,e).duration=t}}function rS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?tS:eS)(t,e)):Ie(this.node(),t).duration}function iS(e,t){if(typeof t!="function")throw new Error;return function(){Ke(this,e).ease=t}}function oS(e){var t=this._id;return arguments.length?this.each(iS(t,e)):Ie(this.node(),t).ease}function sS(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Ke(this,e).ease=r}}function aS(e){if(typeof e!="function")throw new Error;return this.each(sS(this._id,e))}function nS(e){typeof e!="function"&&(e=Ju(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var s=t[o],a=s.length,n=i[o]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&n.push(l);return new ar(i,this._parents,this._name,this._id)}function lS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,o=r.length,s=Math.min(i,o),a=new Array(i),n=0;n<s;++n)for(var l=t[n],c=r[n],h=l.length,d=a[n]=new Array(h),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 hS(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 cS(e,t,r){var i,o,s=hS(t)?Zl:Ke;return function(){var a=s(this,e),n=a.on;n!==i&&(o=(i=n).copy()).on(t,r),a.on=o}}function dS(e,t){var r=this._id;return arguments.length<2?Ie(this.node(),r).on.on(e):this.each(cS(r,e,t))}function uS(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function fS(){return this.on("end.remove",uS(this._id))}function gS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Ul(e));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a<o;++a)for(var n=i[a],l=n.length,c=s[a]=new Array(l),h,d,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,pa(c[f],t,r,f,c,Ie(h,r)));return new ar(s,this._parents,t,r)}function pS(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Qu(e));for(var i=this._groups,o=i.length,s=[],a=[],n=0;n<o;++n)for(var l=i[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var f=e.call(h,h.__data__,d,l),u,g=Ie(h,r),m=0,y=f.length;m<y;++m)(u=f[m])&&pa(u,t,r,m,f,g);s.push(f),a.push(h)}return new ar(s,a,t,r)}var mS=zo.prototype.constructor;function yS(){return new mS(this._groups,this._parents)}function xS(e,t){var r,i,o;return function(){var s=Pi(this,e),a=(this.style.removeProperty(e),Pi(this,e));return s===a?null:s===r&&a===i?o:o=t(r=s,i=a)}}function kf(e){return function(){this.style.removeProperty(e)}}function CS(e,t,r){var i,o=r+"",s;return function(){var a=Pi(this,e);return a===o?null:a===i?s:s=t(i=a,r)}}function bS(e,t,r){var i,o,s;return function(){var a=Pi(this,e),n=r(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),Pi(this,e))),a===l?null:a===i&&l===o?s:(o=l,s=t(i=a,n))}}function kS(e,t){var r,i,o,s="style."+t,a="end."+s,n;return function(){var l=Ke(this,e),c=l.on,h=l.value[s]==null?n||(n=kf(t)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(a,o=h),l.on=i}}function wS(e,t,r){var i=(e+="")=="transform"?Tw:bf;return t==null?this.styleTween(e,xS(e,i)).on("end.style."+e,kf(e)):typeof t=="function"?this.styleTween(e,bS(e,i,Ql(this,"style."+e,t))).each(kS(this._id,e)):this.styleTween(e,CS(e,i,t),r).on("end.style."+e,null)}function SS(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function vS(e,t,r){var i,o;function s(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&SS(e,a,r)),i}return s._value=t,s}function TS(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,vS(e,t,r??""))}function _S(e){return function(){this.textContent=e}}function BS(e){return function(){var t=e(this);this.textContent=t??""}}function LS(e){return this.tween("text",typeof e=="function"?BS(Ql(this,"text",e)):_S(e==null?"":e+""))}function ES(e){return function(t){this.textContent=e.call(this,t)}}function FS(e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&ES(o)),t}return i._value=e,i}function AS(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,FS(e))}function MS(){for(var e=this._name,t=this._id,r=wf(),i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)if(l=a[c]){var h=Ie(l,t);pa(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 $S(){var e,t,r=this,i=r._id,o=r.size();return new Promise(function(s,a){var n={value:a},l={value:function(){--o===0&&s()}};r.each(function(){var c=Ke(this,i),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(n),t._.interrupt.push(n),t._.end.push(l)),c.on=t}),o===0&&s()})}var OS=0;function ar(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function wf(){return++OS}var Je=zo.prototype;ar.prototype={constructor:ar,select:gS,selectAll:pS,selectChild:Je.selectChild,selectChildren:Je.selectChildren,filter:nS,merge:lS,selection:yS,transition:MS,call:Je.call,nodes:Je.nodes,node:Je.node,size:Je.size,empty:Je.empty,each:Je.each,on:dS,attr:Yw,attrTween:Kw,style:wS,styleTween:TS,text:LS,textTween:AS,remove:fS,tween:Dw,delay:Jw,duration:rS,ease:oS,easeVarying:aS,end:$S,[Symbol.iterator]:Je[Symbol.iterator]};function RS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var IS={time:null,delay:0,duration:250,ease:RS};function PS(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 DS(e){var t,r;e instanceof ar?(t=e._id,e=e._name):(t=wf(),(r=IS).time=Kl(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],n=a.length,l,c=0;c<n;++c)(l=a[c])&&pa(l,e,t,c,a,r||PS(l,t));return new ar(i,this._parents,e,t)}zo.prototype.interrupt=Rw;zo.prototype.transition=DS;const zn=Math.PI,jn=2*zn,Mr=1e-6,NS=jn-Mr;function Sf(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function qS(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Sf;const r=10**t;return function(i){this._+=i[0];for(let o=1,s=i.length;o<s;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}class zS{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Sf:qS(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,o){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(t,r,i,o,s,a){this._append`C${+t},${+r},${+i},${+o},${this._x1=+s},${this._y1=+a}`}arcTo(t,r,i,o,s){if(t=+t,r=+r,i=+i,o=+o,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,n=this._y1,l=i-t,c=o-r,h=a-t,d=n-r,f=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(f>Mr)if(!(Math.abs(d*l-c*h)>Mr)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let u=i-a,g=o-n,m=l*l+c*c,y=u*u+g*g,x=Math.sqrt(m),C=Math.sqrt(f),w=s*Math.tan((zn-Math.acos((m+f-y)/(2*x*C)))/2),S=w/C,v=w/x;Math.abs(S-1)>Mr&&this._append`L${t+S*h},${r+S*d}`,this._append`A${s},${s},0,0,${+(d*u>h*g)},${this._x1=t+v*l},${this._y1=r+v*c}`}}arc(t,r,i,o,s,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^a,f=a?o-s:s-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>Mr||Math.abs(this._y1-h)>Mr)&&this._append`L${c},${h}`,i&&(f<0&&(f=f%jn+jn),f>NS?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>Mr&&this._append`A${i},${i},0,${+(f>=zn)},${d},${this._x1=t+i*Math.cos(s)},${this._y1=r+i*Math.sin(s)}`)}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function $r(e){return function(){return e}}const jS=Math.abs,WS=Math.atan2,HS=Math.cos,YS=Math.max,US=Math.min,GS=Math.sin,XS=Math.sqrt,Wn=1e-12,ma=Math.PI,Hn=ma/2,VS=2*ma;function KS(e){return e>1?0:e<-1?ma:Math.acos(e)}function ZS(e){return e>=1?Hn:e<=-1?-Hn:Math.asin(e)}function vf(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 zS(t)}function Tf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function _f(e){this._context=e}_f.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 wo(e){return new _f(e)}function QS(e){return e[0]}function JS(e){return e[1]}function Bf(e,t){var r=$r(!0),i=null,o=wo,s=null,a=vf(n);e=typeof e=="function"?e:e===void 0?QS:$r(e),t=typeof t=="function"?t:t===void 0?JS:$r(t);function n(l){var c,h=(l=Tf(l)).length,d,f=!1,u;for(i==null&&(s=o(u=a())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+e(d,c,l),+t(d,c,l));if(u)return s=null,u+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:$r(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:$r(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:$r(!!l),n):r},n.curve=function(l){return arguments.length?(o=l,i!=null&&(s=o(i)),n):o},n.context=function(l){return arguments.length?(l==null?i=s=null:s=o(i=l),n):i},n}class Lf{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 Ef(e){return new Lf(e,!0)}function Ff(e){return new Lf(e,!1)}function xr(){}function Ds(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 ya(e){this._context=e}ya.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:Ds(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:Ds(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ns(e){return new ya(e)}function Af(e){this._context=e}Af.prototype={areaStart:xr,areaEnd:xr,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:Ds(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tv(e){return new Af(e)}function Mf(e){this._context=e}Mf.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:Ds(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ev(e){return new Mf(e)}function $f(e,t){this._basis=new ya(e),this._beta=t}$f.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],o=t[0],s=e[r]-i,a=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*s),this._beta*t[n]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const rv=(function e(t){function r(i){return t===1?new ya(i):new $f(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function qs(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 Jl(e,t){this._context=e,this._k=(1-t)/6}Jl.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:qs(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:qs(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 Of=(function e(t){function r(i){return new Jl(i,t)}return r.tension=function(i){return e(+i)},r})(0);function th(e,t){this._context=e,this._k=(1-t)/6}th.prototype={areaStart:xr,areaEnd:xr,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:qs(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 iv=(function e(t){function r(i){return new th(i,t)}return r.tension=function(i){return e(+i)},r})(0);function eh(e,t){this._context=e,this._k=(1-t)/6}eh.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:qs(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 ov=(function e(t){function r(i){return new eh(i,t)}return r.tension=function(i){return e(+i)},r})(0);function rh(e,t,r){var i=e._x1,o=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Wn){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Wn){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,s,a,e._x2,e._y2)}function Rf(e,t){this._context=e,this._alpha=t}Rf.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:rh(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 If=(function e(t){function r(i){return t?new Rf(i,t):new Jl(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Pf(e,t){this._context=e,this._alpha=t}Pf.prototype={areaStart:xr,areaEnd:xr,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:rh(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 sv=(function e(t){function r(i){return t?new Pf(i,t):new th(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Df(e,t){this._context=e,this._alpha=t}Df.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:rh(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 av=(function e(t){function r(i){return t?new Df(i,t):new eh(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Nf(e){this._context=e}Nf.prototype={areaStart:xr,areaEnd:xr,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 nv(e){return new Nf(e)}function Ic(e){return e<0?-1:1}function Pc(e,t,r){var i=e._x1-e._x0,o=t-e._x1,s=(e._y1-e._y0)/(i||o<0&&-0),a=(r-e._y1)/(o||i<0&&-0),n=(s*o+a*i)/(i+o);return(Ic(s)+Ic(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(n))||0}function Dc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ja(e,t,r){var i=e._x0,o=e._y0,s=e._x1,a=e._y1,n=(s-i)/3;e._context.bezierCurveTo(i+n,o+n*t,s-n,a-n*r,s,a)}function zs(e){this._context=e}zs.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:Ja(this,this._t0,Dc(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,Ja(this,Dc(this,r=Pc(this,e,t)),r);break;default:Ja(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 qf(e){this._context=new zf(e)}(qf.prototype=Object.create(zs.prototype)).point=function(e,t){zs.prototype.point.call(this,t,e)};function zf(e){this._context=e}zf.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,o,s){this._context.bezierCurveTo(t,e,i,r,s,o)}};function jf(e){return new zs(e)}function Wf(e){return new qf(e)}function Hf(e){this._context=e}Hf.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=Nc(e),o=Nc(t),s=0,a=1;a<r;++s,++a)this._context.bezierCurveTo(i[0][s],o[0][s],i[1][s],o[1][s],e[a],t[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Nc(e){var t,r=e.length-1,i,o=new Array(r),s=new Array(r),a=new Array(r);for(o[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,s[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/s[t-1],s[t]-=i,a[t]-=i*a[t-1];for(o[r-1]=a[r-1]/s[r-1],t=r-2;t>=0;--t)o[t]=(a[t]-o[t+1])/s[t];for(s[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-o[t+1];return[o,s]}function Yf(e){return new Hf(e)}function xa(e,t){this._context=e,this._t=t}xa.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 xa(e,.5)}function Gf(e){return new xa(e,0)}function Xf(e){return new xa(e,1)}function go(e,t,r){this.k=e,this.x=t,this.y=r}go.prototype={constructor:go,scale:function(e){return e===1?this:new go(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new go(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+")"}};go.prototype;var Vf=p(e=>{const{securityLevel:t}=kt();let r=yt("body");if(t==="sandbox"){const s=yt(`#i${e}`).node()?.contentDocument??document;r=yt(s.body)}return r.select(`#${e}`)},"selectSvgElement");function ih(e){return typeof e>"u"||e===null}p(ih,"isNothing");function Kf(e){return typeof e=="object"&&e!==null}p(Kf,"isObject");function Zf(e){return Array.isArray(e)?e:ih(e)?[]:[e]}p(Zf,"toArray");function Qf(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}p(Qf,"extend");function Jf(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}p(Jf,"repeat");function tg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}p(tg,"isNegativeZero");var lv=ih,hv=Kf,cv=Zf,dv=Jf,uv=tg,fv=Qf,Ut={isNothing:lv,isObject:hv,toArray:cv,repeat:dv,isNegativeZero:uv,extend:fv};function oh(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
132
132
 
133
- `+e.mark.snippet),i+" "+r):i}p(oh,"formatError");function qi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=oh(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}p(qi,"YAMLException$1");qi.prototype=Object.create(Error.prototype);qi.prototype.constructor=qi;qi.prototype.toString=p(function(t){return this.name+": "+oh(this,t)},"toString");var ge=qi;function ys(e,t,r,i,o){var s="",a="",n=Math.floor(o/2)-1;return i-t>n&&(s=" ... ",t=i-n+s.length),r-i>n&&(a=" ...",r=i+n-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}p(ys,"getLine");function xs(e,t){return Ut.repeat(" ",t-e.length)+e}p(xs,"padStart");function rg(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var n="",l,c,h=Math.min(e.line+t.linesAfter,o.length).toString().length,d=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)c=ys(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),d),n=Ut.repeat(" ",t.indent)+xs((e.line-l+1).toString(),h)+" | "+c.str+`
133
+ `+e.mark.snippet),i+" "+r):i}p(oh,"formatError");function qi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=oh(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}p(qi,"YAMLException$1");qi.prototype=Object.create(Error.prototype);qi.prototype.constructor=qi;qi.prototype.toString=p(function(t){return this.name+": "+oh(this,t)},"toString");var ge=qi;function ys(e,t,r,i,o){var s="",a="",n=Math.floor(o/2)-1;return i-t>n&&(s=" ... ",t=i-n+s.length),r-i>n&&(a=" ...",r=i+n-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}p(ys,"getLine");function xs(e,t){return Ut.repeat(" ",t-e.length)+e}p(xs,"padStart");function eg(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var n="",l,c,h=Math.min(e.line+t.linesAfter,o.length).toString().length,d=t.maxLength-(t.indent+h+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)c=ys(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),d),n=Ut.repeat(" ",t.indent)+xs((e.line-l+1).toString(),h)+" | "+c.str+`
134
134
  `+n;for(c=ys(e.buffer,i[a],o[a],e.position,d),n+=Ut.repeat(" ",t.indent)+xs((e.line+1).toString(),h)+" | "+c.str+`
135
135
  `,n+=Ut.repeat("-",t.indent+h+3+c.pos)+`^
136
136
  `,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)c=ys(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),d),n+=Ut.repeat(" ",t.indent)+xs((e.line+l+1).toString(),h)+" | "+c.str+`
137
- `;return n.replace(/\n$/,"")}p(rg,"makeSnippet");var gv=rg,pv=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],mv=["scalar","sequence","mapping"];function ig(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}p(ig,"compileStyleAliases");function og(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(pv.indexOf(r)===-1)throw new ge('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=ig(t.styleAliases||null),mv.indexOf(this.kind)===-1)throw new ge('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}p(og,"Type$1");var se=og;function Yn(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}p(Yn,"compileList");function sg(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(p(i,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}p(sg,"compileMap");function js(e){return this.extend(e)}p(js,"Schema$1");js.prototype.extend=p(function(t){var r=[],i=[];if(t instanceof se)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new ge("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof se))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new ge("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new ge("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof se))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(js.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(i),o.compiledImplicit=Yn(o,"implicit"),o.compiledExplicit=Yn(o,"explicit"),o.compiledTypeMap=sg(o.compiledImplicit,o.compiledExplicit),o},"extend");var yv=js,xv=new se("tag:yaml.org,2002:str",{kind:"scalar",construct:p(function(e){return e!==null?e:""},"construct")}),Cv=new se("tag:yaml.org,2002:seq",{kind:"sequence",construct:p(function(e){return e!==null?e:[]},"construct")}),bv=new se("tag:yaml.org,2002:map",{kind:"mapping",construct:p(function(e){return e!==null?e:{}},"construct")}),kv=new yv({explicit:[xv,Cv,bv]});function ag(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}p(ag,"resolveYamlNull");function ng(){return null}p(ng,"constructYamlNull");function lg(e){return e===null}p(lg,"isNull");var wv=new se("tag:yaml.org,2002:null",{kind:"scalar",resolve:ag,construct:ng,predicate:lg,represent:{canonical:p(function(){return"~"},"canonical"),lowercase:p(function(){return"null"},"lowercase"),uppercase:p(function(){return"NULL"},"uppercase"),camelcase:p(function(){return"Null"},"camelcase"),empty:p(function(){return""},"empty")},defaultStyle:"lowercase"});function hg(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")}p(hg,"resolveYamlBoolean");function cg(e){return e==="true"||e==="True"||e==="TRUE"}p(cg,"constructYamlBoolean");function dg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}p(dg,"isBoolean");var Sv=new se("tag:yaml.org,2002:bool",{kind:"scalar",resolve:hg,construct:cg,predicate:dg,represent:{lowercase:p(function(e){return e?"true":"false"},"lowercase"),uppercase:p(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:p(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function ug(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}p(ug,"isHexCode");function fg(e){return 48<=e&&e<=55}p(fg,"isOctCode");function gg(e){return 48<=e&&e<=57}p(gg,"isDecCode");function pg(e){if(e===null)return!1;var t=e.length,r=0,i=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;i=!0}return i&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!ug(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!fg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!gg(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}p(pg,"resolveYamlInteger");function mg(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)}p(mg,"constructYamlInteger");function yg(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ut.isNegativeZero(e)}p(yg,"isInteger");var vv=new se("tag:yaml.org,2002:int",{kind:"scalar",resolve:pg,construct:mg,predicate:yg,represent:{binary:p(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:p(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:p(function(e){return e.toString(10)},"decimal"),hexadecimal:p(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"]}}),Tv=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function xg(e){return!(e===null||!Tv.test(e)||e[e.length-1]==="_")}p(xg,"resolveYamlFloat");function Cg(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)}p(Cg,"constructYamlFloat");var _v=/^[-+]?[0-9]+e/;function bg(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(Ut.isNegativeZero(e))return"-0.0";return r=e.toString(10),_v.test(r)?r.replace("e",".e"):r}p(bg,"representYamlFloat");function kg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ut.isNegativeZero(e))}p(kg,"isFloat");var Bv=new se("tag:yaml.org,2002:float",{kind:"scalar",resolve:xg,construct:Cg,predicate:kg,represent:bg,defaultStyle:"lowercase"}),wg=kv.extend({implicit:[wv,Sv,vv,Bv]}),Lv=wg,Sg=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),vg=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 Tg(e){return e===null?!1:Sg.exec(e)!==null||vg.exec(e)!==null}p(Tg,"resolveYamlTimestamp");function _g(e){var t,r,i,o,s,a,n,l=0,c=null,h,d,f;if(t=Sg.exec(e),t===null&&(t=vg.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],n=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=+t[10],d=+(t[11]||0),c=(h*60+d)*6e4,t[9]==="-"&&(c=-c)),f=new Date(Date.UTC(r,i,o,s,a,n,l)),c&&f.setTime(f.getTime()-c),f}p(_g,"constructYamlTimestamp");function Bg(e){return e.toISOString()}p(Bg,"representYamlTimestamp");var Ev=new se("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Tg,construct:_g,instanceOf:Date,represent:Bg});function Lg(e){return e==="<<"||e===null}p(Lg,"resolveYamlMerge");var Fv=new se("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Lg}),sh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
138
- \r`;function Eg(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=sh;for(r=0;r<o;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}p(Eg,"resolveYamlBinary");function Fg(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=sh,a=0,n=[];for(t=0;t<o;t++)t%4===0&&t&&(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)):r===18?(n.push(a>>10&255),n.push(a>>2&255)):r===12&&n.push(a>>4&255),new Uint8Array(n)}p(Fg,"constructYamlBinary");function Ag(e){var t="",r=0,i,o,s=e.length,a=sh;for(i=0;i<s;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}p(Ag,"representYamlBinary");function Mg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}p(Mg,"isBinary");var Av=new se("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Eg,construct:Fg,predicate:Mg,represent:Ag}),Mv=Object.prototype.hasOwnProperty,$v=Object.prototype.toString;function $g(e){if(e===null)return!0;var t=[],r,i,o,s,a,n=e;for(r=0,i=n.length;r<i;r+=1){if(o=n[r],a=!1,$v.call(o)!=="[object Object]")return!1;for(s in o)if(Mv.call(o,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}p($g,"resolveYamlOmap");function Og(e){return e!==null?e:[]}p(Og,"constructYamlOmap");var Ov=new se("tag:yaml.org,2002:omap",{kind:"sequence",resolve:$g,construct:Og}),Rv=Object.prototype.toString;function Rg(e){if(e===null)return!0;var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],Rv.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}p(Rg,"resolveYamlPairs");function Ig(e){if(e===null)return[];var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],o=Object.keys(i),s[t]=[o[0],i[o[0]]];return s}p(Ig,"constructYamlPairs");var Iv=new se("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Rg,construct:Ig}),Pv=Object.prototype.hasOwnProperty;function Pg(e){if(e===null)return!0;var t,r=e;for(t in r)if(Pv.call(r,t)&&r[t]!==null)return!1;return!0}p(Pg,"resolveYamlSet");function Dg(e){return e!==null?e:{}}p(Dg,"constructYamlSet");var Dv=new se("tag:yaml.org,2002:set",{kind:"mapping",resolve:Pg,construct:Dg}),Ng=Lv.extend({implicit:[Ev,Fv],explicit:[Av,Ov,Iv,Dv]}),Cr=Object.prototype.hasOwnProperty,Ws=1,qg=2,zg=3,Hs=4,tn=1,Nv=2,qc=3,qv=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,zv=/[\x85\u2028\u2029]/,jv=/[,\[\]\{\}]/,jg=/^(?:!|!!|![a-z\-]+!)$/i,Wg=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Un(e){return Object.prototype.toString.call(e)}p(Un,"_class");function $e(e){return e===10||e===13}p($e,"is_EOL");function yr(e){return e===9||e===32}p(yr,"is_WHITE_SPACE");function ce(e){return e===9||e===32||e===10||e===13}p(ce,"is_WS_OR_EOL");function Dr(e){return e===44||e===91||e===93||e===123||e===125}p(Dr,"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)}p(Hg,"fromHexCode");function Yg(e){return e===120?2:e===117?4:e===85?8:0}p(Yg,"escapedHexLen");function Ug(e){return 48<=e&&e<=57?e-48:-1}p(Ug,"fromDecimalCode");function Gn(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":""}p(Gn,"simpleEscapeSequence");function Gg(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}p(Gg,"charFromCodepoint");function ah(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}p(ah,"setProperty");var Xg=new Array(256),Vg=new Array(256);for(Er=0;Er<256;Er++)Xg[Er]=Gn(Er)?1:0,Vg[Er]=Gn(Er);var Er;function Kg(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Ng,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=[]}p(Kg,"State$1");function nh(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=gv(r),new ge(t,r)}p(nh,"generateError");function st(e,t){throw nh(e,t)}p(st,"throwError");function Ao(e,t){e.onWarning&&e.onWarning.call(null,nh(e,t))}p(Ao,"throwWarning");var zc={YAML:p(function(t,r,i){var o,s,a;t.version!==null&&st(t,"duplication of %YAML directive"),i.length!==1&&st(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),o===null&&st(t,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),a=parseInt(o[2],10),s!==1&&st(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&Ao(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:p(function(t,r,i){var o,s;i.length!==2&&st(t,"TAG directive accepts exactly two arguments"),o=i[0],s=i[1],jg.test(o)||st(t,"ill-formed tag handle (first argument) of the TAG directive"),Cr.call(t.tagMap,o)&&st(t,'there is a previously declared suffix for "'+o+'" tag handle'),Wg.test(s)||st(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{st(t,"tag prefix is malformed: "+s)}t.tagMap[o]=s},"handleTagDirective")};function sr(e,t,r,i){var o,s,a,n;if(t<r){if(n=e.input.slice(t,r),i)for(o=0,s=n.length;o<s;o+=1)a=n.charCodeAt(o),a===9||32<=a&&a<=1114111||st(e,"expected valid JSON character");else qv.test(n)&&st(e,"the stream contains non-printable characters");e.result+=n}}p(sr,"captureSegment");function Xn(e,t,r,i){var o,s,a,n;for(Ut.isObject(r)||st(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,n=o.length;a<n;a+=1)s=o[a],Cr.call(t,s)||(ah(t,s,r[s]),i[s]=!0)}p(Xn,"mergeMappings");function Nr(e,t,r,i,o,s,a,n,l){var c,h;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),c=0,h=o.length;c<h;c+=1)Array.isArray(o[c])&&st(e,"nested arrays are not supported inside keys"),typeof o=="object"&&Un(o[c])==="[object Object]"&&(o[c]="[object Object]");if(typeof o=="object"&&Un(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,h=s.length;c<h;c+=1)Xn(e,t,s[c],r);else Xn(e,t,s,r);else!e.json&&!Cr.call(r,o)&&Cr.call(t,o)&&(e.line=a||e.line,e.lineStart=n||e.lineStart,e.position=l||e.position,st(e,"duplicated mapping key")),ah(t,o,s),delete r[o];return t}p(Nr,"storeMappingPair");function Ca(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++):st(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}p(Ca,"readLineBreak");function qt(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;yr(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if($e(o))for(Ca(e),o=e.input.charCodeAt(e.position),i++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&Ao(e,"deficient indentation"),i}p(qt,"skipSeparationSpace");function jo(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||ce(r)))}p(jo,"testDocumentSeparator");function ba(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ut.repeat(`
140
- `,t-1))}p(ba,"writeFoldedLines");function Zg(e,t,r){var i,o,s,a,n,l,c,h,d=e.kind,f=e.result,u;if(u=e.input.charCodeAt(e.position),ce(u)||Dr(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)&&(o=e.input.charCodeAt(e.position+1),ce(o)||r&&Dr(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,n=!1;u!==0;){if(u===58){if(o=e.input.charCodeAt(e.position+1),ce(o)||r&&Dr(o))break}else if(u===35){if(i=e.input.charCodeAt(e.position-1),ce(i))break}else{if(e.position===e.lineStart&&jo(e)||r&&Dr(u))break;if($e(u))if(l=e.line,c=e.lineStart,h=e.lineIndent,qt(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&&(sr(e,s,a,!1),ba(e,e.line-l),s=a=e.position,n=!1),yr(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return sr(e,s,a,!1),e.result?!0:(e.kind=d,e.result=f,!1)}p(Zg,"readPlainScalar");function Qg(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(sr(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else $e(r)?(sr(e,i,o,!0),ba(e,qt(e,!1,t)),i=o=e.position):e.position===e.lineStart&&jo(e)?st(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);st(e,"unexpected end of the stream within a single quoted scalar")}p(Qg,"readSingleQuotedScalar");function Jg(e,t){var r,i,o,s,a,n;if(n=e.input.charCodeAt(e.position),n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return sr(e,r,e.position,!0),e.position++,!0;if(n===92){if(sr(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),$e(n))qt(e,!1,t);else if(n<256&&Xg[n])e.result+=Vg[n],e.position++;else if((a=Yg(n))>0){for(o=a,s=0;o>0;o--)n=e.input.charCodeAt(++e.position),(a=Hg(n))>=0?s=(s<<4)+a:st(e,"expected hexadecimal character");e.result+=Gg(s),e.position++}else st(e,"unknown escape sequence");r=i=e.position}else $e(n)?(sr(e,r,i,!0),ba(e,qt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&jo(e)?st(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}st(e,"unexpected end of the stream within a double quoted scalar")}p(Jg,"readDoubleQuotedScalar");function tp(e,t){var r=!0,i,o,s,a=e.tag,n,l=e.anchor,c,h,d,f,u,g=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(qt(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&&st(e,"expected the node content, but found ','"):st(e,"missed comma between flow collection entries"),y=m=x=null,d=f=!1,C===63&&(c=e.input.charCodeAt(e.position+1),ce(c)&&(d=f=!0,e.position++,qt(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Ur(e,t,Ws,!1,!0),y=e.tag,m=e.result,qt(e,!0,t),C=e.input.charCodeAt(e.position),(f||e.line===i)&&C===58&&(d=!0,C=e.input.charCodeAt(++e.position),qt(e,!0,t),Ur(e,t,Ws,!1,!0),x=e.result),u?Nr(e,n,g,y,m,x,i,o,s):d?n.push(Nr(e,null,g,y,m,x,i,o,s)):n.push(m),qt(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}st(e,"unexpected end of the stream within a flow collection")}p(tp,"readFlowCollection");function ep(e,t){var r,i,o=tn,s=!1,a=!1,n=t,l=0,c=!1,h,d;if(d=e.input.charCodeAt(e.position),d===124)i=!1;else if(d===62)i=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)tn===o?o=d===43?qc:Nv:st(e,"repeat of a chomping mode identifier");else if((h=Ug(d))>=0)h===0?st(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?st(e,"repeat of an indentation width identifier"):(n=t+h-1,a=!0);else break;if(yr(d)){do d=e.input.charCodeAt(++e.position);while(yr(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!$e(d)&&d!==0)}for(;d!==0;){for(Ca(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),$e(d)){l++;continue}if(e.lineIndent<n){o===qc?e.result+=Ut.repeat(`
137
+ `;return n.replace(/\n$/,"")}p(eg,"makeSnippet");var gv=eg,pv=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],mv=["scalar","sequence","mapping"];function rg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}p(rg,"compileStyleAliases");function ig(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(pv.indexOf(r)===-1)throw new ge('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=rg(t.styleAliases||null),mv.indexOf(this.kind)===-1)throw new ge('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}p(ig,"Type$1");var se=ig;function Yn(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}p(Yn,"compileList");function og(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(p(i,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}p(og,"compileMap");function js(e){return this.extend(e)}p(js,"Schema$1");js.prototype.extend=p(function(t){var r=[],i=[];if(t instanceof se)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new ge("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof se))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new ge("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new ge("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof se))throw new ge("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var o=Object.create(js.prototype);return o.implicit=(this.implicit||[]).concat(r),o.explicit=(this.explicit||[]).concat(i),o.compiledImplicit=Yn(o,"implicit"),o.compiledExplicit=Yn(o,"explicit"),o.compiledTypeMap=og(o.compiledImplicit,o.compiledExplicit),o},"extend");var yv=js,xv=new se("tag:yaml.org,2002:str",{kind:"scalar",construct:p(function(e){return e!==null?e:""},"construct")}),Cv=new se("tag:yaml.org,2002:seq",{kind:"sequence",construct:p(function(e){return e!==null?e:[]},"construct")}),bv=new se("tag:yaml.org,2002:map",{kind:"mapping",construct:p(function(e){return e!==null?e:{}},"construct")}),kv=new yv({explicit:[xv,Cv,bv]});function sg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}p(sg,"resolveYamlNull");function ag(){return null}p(ag,"constructYamlNull");function ng(e){return e===null}p(ng,"isNull");var wv=new se("tag:yaml.org,2002:null",{kind:"scalar",resolve:sg,construct:ag,predicate:ng,represent:{canonical:p(function(){return"~"},"canonical"),lowercase:p(function(){return"null"},"lowercase"),uppercase:p(function(){return"NULL"},"uppercase"),camelcase:p(function(){return"Null"},"camelcase"),empty:p(function(){return""},"empty")},defaultStyle:"lowercase"});function lg(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")}p(lg,"resolveYamlBoolean");function hg(e){return e==="true"||e==="True"||e==="TRUE"}p(hg,"constructYamlBoolean");function cg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}p(cg,"isBoolean");var Sv=new se("tag:yaml.org,2002:bool",{kind:"scalar",resolve:lg,construct:hg,predicate:cg,represent:{lowercase:p(function(e){return e?"true":"false"},"lowercase"),uppercase:p(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:p(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function dg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}p(dg,"isHexCode");function ug(e){return 48<=e&&e<=55}p(ug,"isOctCode");function fg(e){return 48<=e&&e<=57}p(fg,"isDecCode");function gg(e){if(e===null)return!1;var t=e.length,r=0,i=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;i=!0}return i&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!dg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!ug(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!fg(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}p(gg,"resolveYamlInteger");function pg(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)}p(pg,"constructYamlInteger");function mg(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ut.isNegativeZero(e)}p(mg,"isInteger");var vv=new se("tag:yaml.org,2002:int",{kind:"scalar",resolve:gg,construct:pg,predicate:mg,represent:{binary:p(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:p(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:p(function(e){return e.toString(10)},"decimal"),hexadecimal:p(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"]}}),Tv=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function yg(e){return!(e===null||!Tv.test(e)||e[e.length-1]==="_")}p(yg,"resolveYamlFloat");function xg(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)}p(xg,"constructYamlFloat");var _v=/^[-+]?[0-9]+e/;function Cg(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(Ut.isNegativeZero(e))return"-0.0";return r=e.toString(10),_v.test(r)?r.replace("e",".e"):r}p(Cg,"representYamlFloat");function bg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ut.isNegativeZero(e))}p(bg,"isFloat");var Bv=new se("tag:yaml.org,2002:float",{kind:"scalar",resolve:yg,construct:xg,predicate:bg,represent:Cg,defaultStyle:"lowercase"}),kg=kv.extend({implicit:[wv,Sv,vv,Bv]}),Lv=kg,wg=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Sg=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 vg(e){return e===null?!1:wg.exec(e)!==null||Sg.exec(e)!==null}p(vg,"resolveYamlTimestamp");function Tg(e){var t,r,i,o,s,a,n,l=0,c=null,h,d,f;if(t=wg.exec(e),t===null&&(t=Sg.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],n=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(h=+t[10],d=+(t[11]||0),c=(h*60+d)*6e4,t[9]==="-"&&(c=-c)),f=new Date(Date.UTC(r,i,o,s,a,n,l)),c&&f.setTime(f.getTime()-c),f}p(Tg,"constructYamlTimestamp");function _g(e){return e.toISOString()}p(_g,"representYamlTimestamp");var Ev=new se("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:vg,construct:Tg,instanceOf:Date,represent:_g});function Bg(e){return e==="<<"||e===null}p(Bg,"resolveYamlMerge");var Fv=new se("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Bg}),sh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
138
+ \r`;function Lg(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=sh;for(r=0;r<o;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}p(Lg,"resolveYamlBinary");function Eg(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=sh,a=0,n=[];for(t=0;t<o;t++)t%4===0&&t&&(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(n.push(a>>16&255),n.push(a>>8&255),n.push(a&255)):r===18?(n.push(a>>10&255),n.push(a>>2&255)):r===12&&n.push(a>>4&255),new Uint8Array(n)}p(Eg,"constructYamlBinary");function Fg(e){var t="",r=0,i,o,s=e.length,a=sh;for(i=0;i<s;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}p(Fg,"representYamlBinary");function Ag(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}p(Ag,"isBinary");var Av=new se("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Lg,construct:Eg,predicate:Ag,represent:Fg}),Mv=Object.prototype.hasOwnProperty,$v=Object.prototype.toString;function Mg(e){if(e===null)return!0;var t=[],r,i,o,s,a,n=e;for(r=0,i=n.length;r<i;r+=1){if(o=n[r],a=!1,$v.call(o)!=="[object Object]")return!1;for(s in o)if(Mv.call(o,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}p(Mg,"resolveYamlOmap");function $g(e){return e!==null?e:[]}p($g,"constructYamlOmap");var Ov=new se("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Mg,construct:$g}),Rv=Object.prototype.toString;function Og(e){if(e===null)return!0;var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],Rv.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}p(Og,"resolveYamlPairs");function Rg(e){if(e===null)return[];var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],o=Object.keys(i),s[t]=[o[0],i[o[0]]];return s}p(Rg,"constructYamlPairs");var Iv=new se("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Og,construct:Rg}),Pv=Object.prototype.hasOwnProperty;function Ig(e){if(e===null)return!0;var t,r=e;for(t in r)if(Pv.call(r,t)&&r[t]!==null)return!1;return!0}p(Ig,"resolveYamlSet");function Pg(e){return e!==null?e:{}}p(Pg,"constructYamlSet");var Dv=new se("tag:yaml.org,2002:set",{kind:"mapping",resolve:Ig,construct:Pg}),Dg=Lv.extend({implicit:[Ev,Fv],explicit:[Av,Ov,Iv,Dv]}),Cr=Object.prototype.hasOwnProperty,Ws=1,Ng=2,qg=3,Hs=4,tn=1,Nv=2,qc=3,qv=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,zv=/[\x85\u2028\u2029]/,jv=/[,\[\]\{\}]/,zg=/^(?:!|!!|![a-z\-]+!)$/i,jg=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Un(e){return Object.prototype.toString.call(e)}p(Un,"_class");function $e(e){return e===10||e===13}p($e,"is_EOL");function yr(e){return e===9||e===32}p(yr,"is_WHITE_SPACE");function ce(e){return e===9||e===32||e===10||e===13}p(ce,"is_WS_OR_EOL");function Dr(e){return e===44||e===91||e===93||e===123||e===125}p(Dr,"is_FLOW_INDICATOR");function Wg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}p(Wg,"fromHexCode");function Hg(e){return e===120?2:e===117?4:e===85?8:0}p(Hg,"escapedHexLen");function Yg(e){return 48<=e&&e<=57?e-48:-1}p(Yg,"fromDecimalCode");function Gn(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":""}p(Gn,"simpleEscapeSequence");function Ug(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}p(Ug,"charFromCodepoint");function ah(e,t,r){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}):e[t]=r}p(ah,"setProperty");var Gg=new Array(256),Xg=new Array(256);for(Er=0;Er<256;Er++)Gg[Er]=Gn(Er)?1:0,Xg[Er]=Gn(Er);var Er;function Vg(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Dg,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=[]}p(Vg,"State$1");function nh(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=gv(r),new ge(t,r)}p(nh,"generateError");function st(e,t){throw nh(e,t)}p(st,"throwError");function Ao(e,t){e.onWarning&&e.onWarning.call(null,nh(e,t))}p(Ao,"throwWarning");var zc={YAML:p(function(t,r,i){var o,s,a;t.version!==null&&st(t,"duplication of %YAML directive"),i.length!==1&&st(t,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),o===null&&st(t,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),a=parseInt(o[2],10),s!==1&&st(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=a<2,a!==1&&a!==2&&Ao(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:p(function(t,r,i){var o,s;i.length!==2&&st(t,"TAG directive accepts exactly two arguments"),o=i[0],s=i[1],zg.test(o)||st(t,"ill-formed tag handle (first argument) of the TAG directive"),Cr.call(t.tagMap,o)&&st(t,'there is a previously declared suffix for "'+o+'" tag handle'),jg.test(s)||st(t,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{st(t,"tag prefix is malformed: "+s)}t.tagMap[o]=s},"handleTagDirective")};function sr(e,t,r,i){var o,s,a,n;if(t<r){if(n=e.input.slice(t,r),i)for(o=0,s=n.length;o<s;o+=1)a=n.charCodeAt(o),a===9||32<=a&&a<=1114111||st(e,"expected valid JSON character");else qv.test(n)&&st(e,"the stream contains non-printable characters");e.result+=n}}p(sr,"captureSegment");function Xn(e,t,r,i){var o,s,a,n;for(Ut.isObject(r)||st(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,n=o.length;a<n;a+=1)s=o[a],Cr.call(t,s)||(ah(t,s,r[s]),i[s]=!0)}p(Xn,"mergeMappings");function Nr(e,t,r,i,o,s,a,n,l){var c,h;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),c=0,h=o.length;c<h;c+=1)Array.isArray(o[c])&&st(e,"nested arrays are not supported inside keys"),typeof o=="object"&&Un(o[c])==="[object Object]"&&(o[c]="[object Object]");if(typeof o=="object"&&Un(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,h=s.length;c<h;c+=1)Xn(e,t,s[c],r);else Xn(e,t,s,r);else!e.json&&!Cr.call(r,o)&&Cr.call(t,o)&&(e.line=a||e.line,e.lineStart=n||e.lineStart,e.position=l||e.position,st(e,"duplicated mapping key")),ah(t,o,s),delete r[o];return t}p(Nr,"storeMappingPair");function Ca(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++):st(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}p(Ca,"readLineBreak");function qt(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;yr(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if($e(o))for(Ca(e),o=e.input.charCodeAt(e.position),i++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&Ao(e,"deficient indentation"),i}p(qt,"skipSeparationSpace");function jo(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||ce(r)))}p(jo,"testDocumentSeparator");function ba(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ut.repeat(`
140
+ `,t-1))}p(ba,"writeFoldedLines");function Kg(e,t,r){var i,o,s,a,n,l,c,h,d=e.kind,f=e.result,u;if(u=e.input.charCodeAt(e.position),ce(u)||Dr(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)&&(o=e.input.charCodeAt(e.position+1),ce(o)||r&&Dr(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,n=!1;u!==0;){if(u===58){if(o=e.input.charCodeAt(e.position+1),ce(o)||r&&Dr(o))break}else if(u===35){if(i=e.input.charCodeAt(e.position-1),ce(i))break}else{if(e.position===e.lineStart&&jo(e)||r&&Dr(u))break;if($e(u))if(l=e.line,c=e.lineStart,h=e.lineIndent,qt(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&&(sr(e,s,a,!1),ba(e,e.line-l),s=a=e.position,n=!1),yr(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return sr(e,s,a,!1),e.result?!0:(e.kind=d,e.result=f,!1)}p(Kg,"readPlainScalar");function Zg(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(sr(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else $e(r)?(sr(e,i,o,!0),ba(e,qt(e,!1,t)),i=o=e.position):e.position===e.lineStart&&jo(e)?st(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);st(e,"unexpected end of the stream within a single quoted scalar")}p(Zg,"readSingleQuotedScalar");function Qg(e,t){var r,i,o,s,a,n;if(n=e.input.charCodeAt(e.position),n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return sr(e,r,e.position,!0),e.position++,!0;if(n===92){if(sr(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),$e(n))qt(e,!1,t);else if(n<256&&Gg[n])e.result+=Xg[n],e.position++;else if((a=Hg(n))>0){for(o=a,s=0;o>0;o--)n=e.input.charCodeAt(++e.position),(a=Wg(n))>=0?s=(s<<4)+a:st(e,"expected hexadecimal character");e.result+=Ug(s),e.position++}else st(e,"unknown escape sequence");r=i=e.position}else $e(n)?(sr(e,r,i,!0),ba(e,qt(e,!1,t)),r=i=e.position):e.position===e.lineStart&&jo(e)?st(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}st(e,"unexpected end of the stream within a double quoted scalar")}p(Qg,"readDoubleQuotedScalar");function Jg(e,t){var r=!0,i,o,s,a=e.tag,n,l=e.anchor,c,h,d,f,u,g=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(qt(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&&st(e,"expected the node content, but found ','"):st(e,"missed comma between flow collection entries"),y=m=x=null,d=f=!1,C===63&&(c=e.input.charCodeAt(e.position+1),ce(c)&&(d=f=!0,e.position++,qt(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Ur(e,t,Ws,!1,!0),y=e.tag,m=e.result,qt(e,!0,t),C=e.input.charCodeAt(e.position),(f||e.line===i)&&C===58&&(d=!0,C=e.input.charCodeAt(++e.position),qt(e,!0,t),Ur(e,t,Ws,!1,!0),x=e.result),u?Nr(e,n,g,y,m,x,i,o,s):d?n.push(Nr(e,null,g,y,m,x,i,o,s)):n.push(m),qt(e,!0,t),C=e.input.charCodeAt(e.position),C===44?(r=!0,C=e.input.charCodeAt(++e.position)):r=!1}st(e,"unexpected end of the stream within a flow collection")}p(Jg,"readFlowCollection");function tp(e,t){var r,i,o=tn,s=!1,a=!1,n=t,l=0,c=!1,h,d;if(d=e.input.charCodeAt(e.position),d===124)i=!1;else if(d===62)i=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)tn===o?o=d===43?qc:Nv:st(e,"repeat of a chomping mode identifier");else if((h=Yg(d))>=0)h===0?st(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?st(e,"repeat of an indentation width identifier"):(n=t+h-1,a=!0);else break;if(yr(d)){do d=e.input.charCodeAt(++e.position);while(yr(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!$e(d)&&d!==0)}for(;d!==0;){for(Ca(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),$e(d)){l++;continue}if(e.lineIndent<n){o===qc?e.result+=Ut.repeat(`
141
141
  `,s?1+l:l):o===tn&&s&&(e.result+=`
142
142
  `);break}for(i?yr(d)?(c=!0,e.result+=Ut.repeat(`
143
143
  `,s?1+l:l)):c?(c=!1,e.result+=Ut.repeat(`
144
144
  `,l+1)):l===0?s&&(e.result+=" "):e.result+=Ut.repeat(`
145
145
  `,l):e.result+=Ut.repeat(`
146
- `,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!$e(d)&&d!==0;)d=e.input.charCodeAt(++e.position);sr(e,r,e.position,!1)}return!0}p(ep,"readBlockScalar");function Vn(e,t){var r,i=e.tag,o=e.anchor,s=[],a,n=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,st(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!ce(a))));){if(n=!0,e.position++,qt(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Ur(e,t,zg,!1,!0),s.push(e.result),qt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)st(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return n?(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}p(Vn,"readBlockSequence");function rp(e,t,r){var i,o,s,a,n,l,c=e.tag,h=e.anchor,d={},f=Object.create(null),u=null,g=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,st(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(C===63||C===58)&&ce(i))C===63?(y&&(Nr(e,d,f,u,g,null,a,n,l),u=g=m=null),x=!0,y=!0,o=!0):y?(y=!1,o=!0):st(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,!Ur(e,r,qg,!1,!0))break;if(e.line===s){for(C=e.input.charCodeAt(e.position);yr(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),ce(C)||st(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Nr(e,d,f,u,g,null,a,n,l),u=g=m=null),x=!0,y=!1,o=!1,u=e.tag,g=e.result;else if(x)st(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=h,!0}else if(x)st(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=h,!0}if((e.line===s||e.lineIndent>t)&&(y&&(a=e.line,n=e.lineStart,l=e.position),Ur(e,t,Hs,!0,o)&&(y?g=e.result:m=e.result),y||(Nr(e,d,f,u,g,m,a,n,l),u=g=m=null),qt(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&C!==0)st(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Nr(e,d,f,u,g,null,a,n,l),x&&(e.tag=c,e.anchor=h,e.kind="mapping",e.result=d),x}p(rp,"readBlockMapping");function ip(e){var t,r=!1,i=!1,o,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&st(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,o="!!",a=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):st(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!ce(a);)a===33&&(i?st(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),jg.test(o)||st(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),jv.test(s)&&st(e,"tag suffix cannot contain flow indicator characters")}s&&!Wg.test(s)&&st(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{st(e,"tag name is malformed: "+s)}return r?e.tag=s:Cr.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:st(e,'undeclared tag handle "'+o+'"'),!0}p(ip,"readTagProperty");function op(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&st(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!ce(r)&&!Dr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&st(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}p(op,"readAnchorProperty");function sp(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!ce(i)&&!Dr(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&st(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Cr.call(e.anchorMap,r)||st(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],qt(e,!0,-1),!0}p(sp,"readAlias");function Ur(e,t,r,i,o){var s,a,n,l=1,c=!1,h=!1,d,f,u,g,m,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=n=Hs===r||zg===r,i&&qt(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;ip(e)||op(e);)qt(e,!0,-1)?(c=!0,n=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):n=!1;if(n&&(n=c||o),(l===1||Hs===r)&&(Ws===r||qg===r?m=t:m=t+1,y=e.position-e.lineStart,l===1?n&&(Vn(e,y)||rp(e,y,m))||tp(e,m)?h=!0:(a&&ep(e,m)||Qg(e,m)||Jg(e,m)?h=!0:sp(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&st(e,"alias node should not have any properties")):Zg(e,m,Ws===r)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(h=n&&Vn(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"&&st(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d<f;d+=1)if(g=e.implicitTypes[d],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Cr.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=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){g=u[d];break}g||st(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&st(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):st(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}p(Ur,"composeNode");function ap(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(qt(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!ce(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&st(e,"directive name must not be less than one character in length");a!==0;){for(;yr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!$e(a));break}if($e(a))break;for(r=e.position;a!==0&&!ce(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Ca(e),Cr.call(zc,i)?zc[i](e,i,o):Ao(e,'unknown document directive "'+i+'"')}if(qt(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,qt(e,!0,-1)):s&&st(e,"directives end mark is expected"),Ur(e,e.lineIndent-1,Hs,!1,!0),qt(e,!0,-1),e.checkLineBreaks&&zv.test(e.input.slice(t,e.position))&&Ao(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&jo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,qt(e,!0,-1));return}if(e.position<e.length-1)st(e,"end of the stream or a document separator is expected");else return}p(ap,"readDocument");function lh(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 Kg(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,st(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;)ap(r);return r.documents}p(lh,"loadDocuments");function Wv(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=lh(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}p(Wv,"loadAll$1");function np(e,t){var r=lh(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new ge("expected a single document in the stream, but found more")}}p(np,"load$1");var Hv=np,Yv={load:Hv},lp=Object.prototype.toString,hp=Object.prototype.hasOwnProperty,hh=65279,Uv=9,Mo=10,Gv=13,Xv=32,Vv=33,Kv=34,Kn=35,Zv=37,Qv=38,Jv=39,tT=42,cp=44,eT=45,Ys=58,rT=61,iT=62,oT=63,sT=64,dp=91,up=93,aT=96,fp=123,nT=124,gp=125,ne={};ne[0]="\\0";ne[7]="\\a";ne[8]="\\b";ne[9]="\\t";ne[10]="\\n";ne[11]="\\v";ne[12]="\\f";ne[13]="\\r";ne[27]="\\e";ne[34]='\\"';ne[92]="\\\\";ne[133]="\\N";ne[160]="\\_";ne[8232]="\\L";ne[8233]="\\P";var lT=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],hT=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function pp(e,t){var r,i,o,s,a,n,l;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],n=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&hp.call(l.styleAliases,n)&&(n=l.styleAliases[n]),r[a]=n;return r}p(pp,"compileStyleMap");function mp(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new ge("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Ut.repeat("0",i-t.length)+t}p(mp,"encodeHex");var cT=1,$o=2;function yp(e){this.schema=e.schema||Ng,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ut.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=pp(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==='"'?$o:cT,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}p(yp,"State");function Zn(e,t){for(var r=Ut.repeat(" ",t),i=0,o=-1,s="",a,n=e.length;i<n;)o=e.indexOf(`
146
+ `,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!$e(d)&&d!==0;)d=e.input.charCodeAt(++e.position);sr(e,r,e.position,!1)}return!0}p(tp,"readBlockScalar");function Vn(e,t){var r,i=e.tag,o=e.anchor,s=[],a,n=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,st(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!ce(a))));){if(n=!0,e.position++,qt(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Ur(e,t,qg,!1,!0),s.push(e.result),qt(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)st(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return n?(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}p(Vn,"readBlockSequence");function ep(e,t,r){var i,o,s,a,n,l,c=e.tag,h=e.anchor,d={},f=Object.create(null),u=null,g=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,st(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(C===63||C===58)&&ce(i))C===63?(y&&(Nr(e,d,f,u,g,null,a,n,l),u=g=m=null),x=!0,y=!0,o=!0):y?(y=!1,o=!0):st(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,!Ur(e,r,Ng,!1,!0))break;if(e.line===s){for(C=e.input.charCodeAt(e.position);yr(C);)C=e.input.charCodeAt(++e.position);if(C===58)C=e.input.charCodeAt(++e.position),ce(C)||st(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(Nr(e,d,f,u,g,null,a,n,l),u=g=m=null),x=!0,y=!1,o=!1,u=e.tag,g=e.result;else if(x)st(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=h,!0}else if(x)st(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=h,!0}if((e.line===s||e.lineIndent>t)&&(y&&(a=e.line,n=e.lineStart,l=e.position),Ur(e,t,Hs,!0,o)&&(y?g=e.result:m=e.result),y||(Nr(e,d,f,u,g,m,a,n,l),u=g=m=null),qt(e,!0,-1),C=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&C!==0)st(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&Nr(e,d,f,u,g,null,a,n,l),x&&(e.tag=c,e.anchor=h,e.kind="mapping",e.result=d),x}p(ep,"readBlockMapping");function rp(e){var t,r=!1,i=!1,o,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&st(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,o="!!",a=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):st(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!ce(a);)a===33&&(i?st(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),zg.test(o)||st(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),jv.test(s)&&st(e,"tag suffix cannot contain flow indicator characters")}s&&!jg.test(s)&&st(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{st(e,"tag name is malformed: "+s)}return r?e.tag=s:Cr.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:st(e,'undeclared tag handle "'+o+'"'),!0}p(rp,"readTagProperty");function ip(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&st(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!ce(r)&&!Dr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&st(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}p(ip,"readAnchorProperty");function op(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!ce(i)&&!Dr(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&st(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Cr.call(e.anchorMap,r)||st(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],qt(e,!0,-1),!0}p(op,"readAlias");function Ur(e,t,r,i,o){var s,a,n,l=1,c=!1,h=!1,d,f,u,g,m,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=n=Hs===r||qg===r,i&&qt(e,!0,-1)&&(c=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;rp(e)||ip(e);)qt(e,!0,-1)?(c=!0,n=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):n=!1;if(n&&(n=c||o),(l===1||Hs===r)&&(Ws===r||Ng===r?m=t:m=t+1,y=e.position-e.lineStart,l===1?n&&(Vn(e,y)||ep(e,y,m))||Jg(e,m)?h=!0:(a&&tp(e,m)||Zg(e,m)||Qg(e,m)?h=!0:op(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&st(e,"alias node should not have any properties")):Kg(e,m,Ws===r)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(h=n&&Vn(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"&&st(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),d=0,f=e.implicitTypes.length;d<f;d+=1)if(g=e.implicitTypes[d],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Cr.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=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){g=u[d];break}g||st(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&st(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):st(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}p(Ur,"composeNode");function sp(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(qt(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!ce(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&st(e,"directive name must not be less than one character in length");a!==0;){for(;yr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!$e(a));break}if($e(a))break;for(r=e.position;a!==0&&!ce(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Ca(e),Cr.call(zc,i)?zc[i](e,i,o):Ao(e,'unknown document directive "'+i+'"')}if(qt(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,qt(e,!0,-1)):s&&st(e,"directives end mark is expected"),Ur(e,e.lineIndent-1,Hs,!1,!0),qt(e,!0,-1),e.checkLineBreaks&&zv.test(e.input.slice(t,e.position))&&Ao(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&jo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,qt(e,!0,-1));return}if(e.position<e.length-1)st(e,"end of the stream or a document separator is expected");else return}p(sp,"readDocument");function lh(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 Vg(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,st(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;)sp(r);return r.documents}p(lh,"loadDocuments");function Wv(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=lh(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}p(Wv,"loadAll$1");function ap(e,t){var r=lh(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new ge("expected a single document in the stream, but found more")}}p(ap,"load$1");var Hv=ap,Yv={load:Hv},np=Object.prototype.toString,lp=Object.prototype.hasOwnProperty,hh=65279,Uv=9,Mo=10,Gv=13,Xv=32,Vv=33,Kv=34,Kn=35,Zv=37,Qv=38,Jv=39,tT=42,hp=44,eT=45,Ys=58,rT=61,iT=62,oT=63,sT=64,cp=91,dp=93,aT=96,up=123,nT=124,fp=125,ne={};ne[0]="\\0";ne[7]="\\a";ne[8]="\\b";ne[9]="\\t";ne[10]="\\n";ne[11]="\\v";ne[12]="\\f";ne[13]="\\r";ne[27]="\\e";ne[34]='\\"';ne[92]="\\\\";ne[133]="\\N";ne[160]="\\_";ne[8232]="\\L";ne[8233]="\\P";var lT=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],hT=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function gp(e,t){var r,i,o,s,a,n,l;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],n=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&lp.call(l.styleAliases,n)&&(n=l.styleAliases[n]),r[a]=n;return r}p(gp,"compileStyleMap");function pp(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new ge("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Ut.repeat("0",i-t.length)+t}p(pp,"encodeHex");var cT=1,$o=2;function mp(e){this.schema=e.schema||Dg,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ut.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=gp(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==='"'?$o:cT,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}p(mp,"State");function Zn(e,t){for(var r=Ut.repeat(" ",t),i=0,o=-1,s="",a,n=e.length;i<n;)o=e.indexOf(`
148
148
  `,i),o===-1?(a=e.slice(i),i=n):(a=e.slice(i,o+1),i=o+1),a.length&&a!==`
149
149
  `&&(s+=r),s+=a;return s}p(Zn,"indentString");function Us(e,t){return`
150
- `+Ut.repeat(" ",e.indent*t)}p(Us,"generateNextLine");function xp(e,t){var r,i,o;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}p(xp,"testImplicitResolving");function Oo(e){return e===Xv||e===Uv}p(Oo,"isWhitespace");function zi(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==hh||65536<=e&&e<=1114111}p(zi,"isPrintable");function Qn(e){return zi(e)&&e!==hh&&e!==Gv&&e!==Mo}p(Qn,"isNsCharOrWhitespace");function Jn(e,t,r){var i=Qn(e),o=i&&!Oo(e);return(r?i:i&&e!==cp&&e!==dp&&e!==up&&e!==fp&&e!==gp)&&e!==Kn&&!(t===Ys&&!o)||Qn(t)&&!Oo(t)&&e===Kn||t===Ys&&o}p(Jn,"isPlainSafe");function Cp(e){return zi(e)&&e!==hh&&!Oo(e)&&e!==eT&&e!==oT&&e!==Ys&&e!==cp&&e!==dp&&e!==up&&e!==fp&&e!==gp&&e!==Kn&&e!==Qv&&e!==tT&&e!==Vv&&e!==nT&&e!==rT&&e!==iT&&e!==Jv&&e!==Kv&&e!==Zv&&e!==sT&&e!==aT}p(Cp,"isPlainSafeFirst");function bp(e){return!Oo(e)&&e!==Ys}p(bp,"isPlainSafeLast");function fi(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}p(fi,"codePointAt");function ch(e){var t=/^\n* /;return t.test(e)}p(ch,"needIndentIndicator");var kp=1,tl=2,wp=3,Sp=4,li=5;function vp(e,t,r,i,o,s,a,n){var l,c=0,h=null,d=!1,f=!1,u=i!==-1,g=-1,m=Cp(fi(e,0))&&bp(fi(e,e.length-1));if(t||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=fi(e,l),!zi(c))return li;m=m&&Jn(c,h,n),h=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=fi(e,l),c===Mo)d=!0,u&&(f=f||l-g-1>i&&e[g+1]!==" ",g=l);else if(!zi(c))return li;m=m&&Jn(c,h,n),h=c}f=f||u&&l-g-1>i&&e[g+1]!==" "}return!d&&!f?m&&!a&&!o(e)?kp:s===$o?li:tl:r>9&&ch(e)?li:a?s===$o?li:tl:f?Sp:wp}p(vp,"chooseScalarStyle");function Tp(e,t,r,i,o){e.dump=(function(){if(t.length===0)return e.quotingType===$o?'""':"''";if(!e.noCompatMode&&(lT.indexOf(t)!==-1||hT.test(t)))return e.quotingType===$o?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return xp(e,c)}switch(p(l,"testAmbiguity"),vp(t,n,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case kp:return t;case tl:return"'"+t.replace(/'/g,"''")+"'";case wp:return"|"+el(t,e.indent)+rl(Zn(t,s));case Sp:return">"+el(t,e.indent)+rl(Zn(_p(t,a),s));case li:return'"'+Bp(t)+'"';default:throw new ge("impossible error: invalid scalar style")}})()}p(Tp,"writeScalar");function el(e,t){var r=ch(e)?String(t):"",i=e[e.length-1]===`
150
+ `+Ut.repeat(" ",e.indent*t)}p(Us,"generateNextLine");function yp(e,t){var r,i,o;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}p(yp,"testImplicitResolving");function Oo(e){return e===Xv||e===Uv}p(Oo,"isWhitespace");function zi(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==hh||65536<=e&&e<=1114111}p(zi,"isPrintable");function Qn(e){return zi(e)&&e!==hh&&e!==Gv&&e!==Mo}p(Qn,"isNsCharOrWhitespace");function Jn(e,t,r){var i=Qn(e),o=i&&!Oo(e);return(r?i:i&&e!==hp&&e!==cp&&e!==dp&&e!==up&&e!==fp)&&e!==Kn&&!(t===Ys&&!o)||Qn(t)&&!Oo(t)&&e===Kn||t===Ys&&o}p(Jn,"isPlainSafe");function xp(e){return zi(e)&&e!==hh&&!Oo(e)&&e!==eT&&e!==oT&&e!==Ys&&e!==hp&&e!==cp&&e!==dp&&e!==up&&e!==fp&&e!==Kn&&e!==Qv&&e!==tT&&e!==Vv&&e!==nT&&e!==rT&&e!==iT&&e!==Jv&&e!==Kv&&e!==Zv&&e!==sT&&e!==aT}p(xp,"isPlainSafeFirst");function Cp(e){return!Oo(e)&&e!==Ys}p(Cp,"isPlainSafeLast");function fi(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}p(fi,"codePointAt");function ch(e){var t=/^\n* /;return t.test(e)}p(ch,"needIndentIndicator");var bp=1,tl=2,kp=3,wp=4,li=5;function Sp(e,t,r,i,o,s,a,n){var l,c=0,h=null,d=!1,f=!1,u=i!==-1,g=-1,m=xp(fi(e,0))&&Cp(fi(e,e.length-1));if(t||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=fi(e,l),!zi(c))return li;m=m&&Jn(c,h,n),h=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=fi(e,l),c===Mo)d=!0,u&&(f=f||l-g-1>i&&e[g+1]!==" ",g=l);else if(!zi(c))return li;m=m&&Jn(c,h,n),h=c}f=f||u&&l-g-1>i&&e[g+1]!==" "}return!d&&!f?m&&!a&&!o(e)?bp:s===$o?li:tl:r>9&&ch(e)?li:a?s===$o?li:tl:f?wp:kp}p(Sp,"chooseScalarStyle");function vp(e,t,r,i,o){e.dump=(function(){if(t.length===0)return e.quotingType===$o?'""':"''";if(!e.noCompatMode&&(lT.indexOf(t)!==-1||hT.test(t)))return e.quotingType===$o?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),n=i||e.flowLevel>-1&&r>=e.flowLevel;function l(c){return yp(e,c)}switch(p(l,"testAmbiguity"),Sp(t,n,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case bp:return t;case tl:return"'"+t.replace(/'/g,"''")+"'";case kp:return"|"+el(t,e.indent)+rl(Zn(t,s));case wp:return">"+el(t,e.indent)+rl(Zn(Tp(t,a),s));case li:return'"'+_p(t)+'"';default:throw new ge("impossible error: invalid scalar style")}})()}p(vp,"writeScalar");function el(e,t){var r=ch(e)?String(t):"",i=e[e.length-1]===`
151
151
  `,o=i&&(e[e.length-2]===`
152
152
  `||e===`
153
153
  `),s=o?"+":i?"":"-";return r+s+`
154
154
  `}p(el,"blockHeader");function rl(e){return e[e.length-1]===`
155
- `?e.slice(0,-1):e}p(rl,"dropEndingNewline");function _p(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
155
+ `?e.slice(0,-1):e}p(rl,"dropEndingNewline");function Tp(e,t){for(var r=/(\n+)([^\n]*)/g,i=(function(){var c=e.indexOf(`
156
156
  `);return c=c!==-1?c:e.length,r.lastIndex=c,il(e.slice(0,c),t)})(),o=e[0]===`
157
157
  `||e[0]===" ",s,a;a=r.exec(e);){var n=a[1],l=a[2];s=l[0]===" ",i+=n+(!o&&!s&&l!==""?`
158
- `:"")+il(l,t),o=s}return i}p(_p,"foldString");function il(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,n=0,l="";i=r.exec(e);)n=i.index,n-o>t&&(s=a>o?a:n,l+=`
158
+ `:"")+il(l,t),o=s}return i}p(Tp,"foldString");function il(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,n=0,l="";i=r.exec(e);)n=i.index,n-o>t&&(s=a>o?a:n,l+=`
159
159
  `+e.slice(o,s),o=s+1),a=n;return l+=`
160
160
  `,e.length-o>t&&a>o?l+=e.slice(o,a)+`
161
- `+e.slice(a+1):l+=e.slice(o),l.slice(1)}p(il,"foldLine");function Bp(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=fi(e,o),i=ne[r],!i&&zi(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||mp(r);return t}p(Bp,"escapeString");function Lp(e,t,r){var i="",o=e.tag,s,a,n;for(s=0,a=r.length;s<a;s+=1)n=r[s],e.replacer&&(n=e.replacer.call(r,String(s),n)),(Ye(e,t,n,!1,!1)||typeof n>"u"&&Ye(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}p(Lp,"writeFlowSequence");function ol(e,t,r,i){var o="",s=e.tag,a,n,l;for(a=0,n=r.length;a<n;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(Ye(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&Ye(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=Us(e,t)),e.dump&&Mo===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}p(ol,"writeBlockSequence");function Ep(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,n,l,c,h;for(a=0,n=s.length;a<n;a+=1)h="",i!==""&&(h+=", "),e.condenseFlow&&(h+='"'),l=s[a],c=r[l],e.replacer&&(c=e.replacer.call(r,l,c)),Ye(e,t,l,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ye(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=o,e.dump="{"+i+"}"}p(Ep,"writeFlowMapping");function Fp(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),n,l,c,h,d,f;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new ge("sortKeys must be a boolean or a function");for(n=0,l=a.length;n<l;n+=1)f="",(!i||o!=="")&&(f+=Us(e,t)),c=a[n],h=r[c],e.replacer&&(h=e.replacer.call(r,c,h)),Ye(e,t+1,c,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&Mo===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=Us(e,t)),Ye(e,t+1,h,!0,d)&&(e.dump&&Mo===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,o+=f));e.tag=s,e.dump=o||"{}"}p(Fp,"writeBlockMapping");function sl(e,t,r){var i,o,s,a,n,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(n=o[s],(n.instanceOf||n.predicate)&&(!n.instanceOf||typeof t=="object"&&t instanceof n.instanceOf)&&(!n.predicate||n.predicate(t))){if(r?n.multi&&n.representName?e.tag=n.representName(t):e.tag=n.tag:e.tag="?",n.represent){if(l=e.styleMap[n.tag]||n.defaultStyle,lp.call(n.represent)==="[object Function]")i=n.represent(t,l);else if(hp.call(n.represent,l))i=n.represent[l](t,l);else throw new ge("!<"+n.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}p(sl,"detectType");function Ye(e,t,r,i,o,s,a){e.tag=null,e.dump=r,sl(e,r,!1)||sl(e,r,!0);var n=lp.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)&&(o=!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?(Fp(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(Ep(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?ol(e,t-1,e.dump,o):ol(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(Lp(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&Tp(e,e.dump,t,s,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ge("unacceptable kind of an object to dump "+n)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}p(Ye,"writeNode");function Ap(e,t){var r=[],i=[],o,s;for(Gs(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}p(Ap,"getDuplicateReferences");function Gs(e,t,r){var i,o,s;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)Gs(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)Gs(e[i[o]],t,r)}p(Gs,"inspectNode");function dT(e,t){t=t||{};var r=new yp(t);r.noRefs||Ap(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),Ye(r,0,i,!0,!0)?r.dump+`
162
- `:""}p(dT,"dump$1");function uT(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.")}}p(uT,"renamed");var Mp=wg,$p=Yv.load;var fT=p(e=>{const{handDrawnSeed:t}=kt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Gi=p(e=>{const t=gT([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),gT=p(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),dh=p(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"),it=p(e=>{const{stylesArray:t}=Gi(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];dh(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),et=p((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=kt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=Gi(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:pT(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),pT=p(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),es={},Yt={},jc;function mT(){return jc||(jc=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.BLANK_URL=Yt.relativeFirstCharacters=Yt.whitespaceEscapeCharsRegex=Yt.urlSchemeRegex=Yt.ctrlCharactersRegex=Yt.htmlCtrlEntityRegex=Yt.htmlEntitiesRegex=Yt.invalidProtocolRegex=void 0,Yt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Yt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Yt.htmlCtrlEntityRegex=/&(newline|tab);/gi,Yt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Yt.urlSchemeRegex=/^.+(:|&colon;)/gim,Yt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Yt.relativeFirstCharacters=[".","/"],Yt.BLANK_URL="about:blank"),Yt}var Wc;function yT(){if(Wc)return es;Wc=1,Object.defineProperty(es,"__esModule",{value:!0}),es.sanitizeUrl=s;var e=mT();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,l=o(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var 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 g=new URL(u);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return u}return es}var Op=yT();function en(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 xT(){}function Rp(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function ka(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Ip="[object RegExp]",uh="[object String]",fh="[object Number]",gh="[object Boolean]",ph="[object Arguments]",Pp="[object Symbol]",Dp="[object Date]",Np="[object Map]",qp="[object Set]",zp="[object Array]",jp="[object ArrayBuffer]",Wp="[object Object]",Hp="[object DataView]",Yp="[object Uint8Array]",Up="[object Uint8ClampedArray]",Gp="[object Uint16Array]",Xp="[object Uint32Array]",Vp="[object Int8Array]",Kp="[object Int16Array]",Zp="[object Int32Array]",Qp="[object Float32Array]",Jp="[object Float64Array]",Hc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function mh(e){return typeof Hc.Buffer<"u"&&Hc.Buffer.isBuffer(e)}function CT(e){return Number.isSafeInteger(e)&&e>=0}function tm(e){return e!=null&&typeof e!="function"&&CT(e.length)}function bT(e){return e==="__proto__"}function wa(e){return e==null||typeof e!="object"&&typeof e!="function"}function yh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function kT(e,t){return gi(e,void 0,e,new Map,t)}function gi(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(wa(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]=gi(e[n],n,r,i,o);return Object.hasOwn(e,"index")&&(a.index=e.index),Object.hasOwn(e,"input")&&(a.input=e.input),a}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const a=new RegExp(e.source,e.flags);return a.lastIndex=e.lastIndex,a}if(e instanceof Map){const a=new Map;i.set(e,a);for(const[n,l]of e)a.set(n,gi(l,n,r,i,o));return a}if(e instanceof Set){const a=new Set;i.set(e,a);for(const n of e)a.add(gi(n,void 0,r,i,o));return a}if(mh(e))return e.subarray();if(yh(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=gi(e[n],n,r,i,o);return a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const a=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,a),Ee(a,e,r,i,o),a}if(typeof File<"u"&&e instanceof File){const a=new File([e],e.name,{type:e.type});return i.set(e,a),Ee(a,e,r,i,o),a}if(typeof Blob<"u"&&e instanceof Blob){const a=new Blob([e],{type:e.type});return i.set(e,a),Ee(a,e,r,i,o),a}if(e instanceof Error){const a=structuredClone(e);return i.set(e,a),a.message=e.message,a.name=e.name,a.stack=e.stack,a.cause=e.cause,a.constructor=e.constructor,Ee(a,e,r,i,o),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return i.set(e,a),Ee(a,e,r,i,o),a}if(e instanceof Number){const a=new Number(e.valueOf());return i.set(e,a),Ee(a,e,r,i,o),a}if(e instanceof String){const a=new String(e.valueOf());return i.set(e,a),Ee(a,e,r,i,o),a}if(typeof e=="object"&&wT(e)){const a=Object.create(Object.getPrototypeOf(e));return i.set(e,a),Ee(a,e,r,i,o),a}return e}function Ee(e,t,r=e,i,o){const s=[...Object.keys(t),...Rp(t)];for(let a=0;a<s.length;a++){const n=s[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=gi(t[n],n,r,i,o))}}function wT(e){switch(ka(e)){case ph:case zp:case jp:case Hp:case gh:case Dp:case Qp:case Jp:case Vp:case Kp:case Zp:case Np:case fh:case Wp:case Ip:case qp:case uh:case Pp:case Yp:case Up:case Gp:case Xp:return!0;default:return!1}}function ST(e,t){return kT(e,(r,i,o,s)=>{if(typeof e=="object"){if(ka(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return s.set(e,a),Ee(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case fh:case uh:case gh:{const a=new e.constructor(e?.valueOf());return Ee(a,e),a}case ph:{const a={};return Ee(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Yc(e){return ST(e)}function al(e){return e!==null&&typeof e=="object"&&ka(e)==="[object Arguments]"}function nl(e){return typeof e=="object"&&e!==null}function vT(e){return nl(e)&&tm(e)}function Wo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);const a=e.apply(this,i);return r.cache=s.set(o,a)||s,a};return r.cache=new(Wo.Cache||Map),r}Wo.Cache=Map;function So(e){return yh(e)}function TT(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function _T(e){if(wa(e))return e;if(Array.isArray(e)||yh(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 BT(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let s=0;s<r.length;s++){const a=r[s];o=Cs(o,a,i,new Map)}return o}function Cs(e,t,r,i){if(wa(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return _T(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let s=0;s<t.length;s++)t[s]=t[s]??void 0}const o=[...Object.keys(t),...Rp(t)];for(let s=0;s<o.length;s++){const a=o[s];if(bT(a))continue;let n=t[a],l=e[a];if(al(n)&&(n={...n}),al(l)&&(l={...l}),mh(n)&&(n=Yc(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(vT(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)||nl(l)&&nl(n)&&(en(l)||en(n)||So(l)||So(n))?e[a]=Cs(l,n,r,i):l==null&&en(n)?e[a]=Cs({},n,r,i):l==null&&So(n)?e[a]=Yc(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function LT(e,...t){return BT(e,...t,xT)}function Uc(e){if(e==null)return!0;if(tm(e))return typeof e.splice!="function"&&typeof e!="string"&&!mh(e)&&!So(e)&&!al(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 TT(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var em="​",ET={curveBasis:Ns,curveBasisClosed:tv,curveBasisOpen:ev,curveBumpX:Ff,curveBumpY:Af,curveBundle:rv,curveCardinalClosed:iv,curveCardinalOpen:ov,curveCardinal:Rf,curveCatmullRomClosed:sv,curveCatmullRomOpen:av,curveCatmullRom:Pf,curveLinear:wo,curveLinearClosed:nv,curveMonotoneX:Wf,curveMonotoneY:Hf,curveNatural:Uf,curveStep:Gf,curveStepAfter:Vf,curveStepBefore:Xf},FT=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,AT=p(function(e,t){const r=rm(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);Bs(a),i=jt(i,[...a])}else i=r.args;if(!i)return;let o=Pl(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),rm=p(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${FT.source})(?=[}][%]{2}).*
163
- `,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),V.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=ko.exec(e))!==null;)if(i.index===ko.lastIndex&&ko.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return V.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),MT=p(function(e){return e.replace(ko,"")},"removeDirectives"),$T=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function xh(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return ET[r]??t}p(xh,"interpolateToCurve");function im(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?Op.sanitizeUrl(r):r}p(im,"formatUrl");var OT=p((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a<i;a++)if(s=s[r[a]],!s){V.error(`Function name: ${e} not found in window`);return}s[o](...t)},"runFunc");function Ch(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}p(Ch,"distance");function om(e){let t,r=0;e.forEach(o=>{r+=Ch(o,t),t=o});const i=r/2;return bh(e,i)}p(om,"traverseEdge");function sm(e){return e.length===1?e[0]:om(e)}p(sm,"calcLabelPosition");var Gc=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),bh=p((e,t)=>{let r,i=t;for(const o of e){if(r){const s=Ch(o,r);if(s===0)return r;if(s<i)i-=s;else{const a=i/s;if(a<=0)return r;if(a>=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:Gc((1-a)*r.x+a*o.x,5),y:Gc((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),RT=p((e,t,r)=>{V.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=bh(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function am(e,t,r){const i=structuredClone(r);V.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=bh(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2),l}p(am,"calcTerminalLabelPosition");function kh(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}}p(kh,"getStylesFromArray");var Xc=0,nm=p(()=>(Xc++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Xc),"generateId");function lm(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}p(lm,"makeRandomHex");var hm=p(e=>lm(e.length),"random"),IT=p(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"),PT=p(function(e,t){const r=t.text.replace(Yi.lineBreakRegex," "),[,i]=Ho(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),cm=Wo((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Yi.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const l=Ue(`${a} `,r),c=Ue(s,r);if(l>t){const{hyphenatedStrings:f,remainingWord:u}=DT(a,t,"-",r);o.push(s,...f),s=u}else c+l>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),DT=Wo((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,l)=>{const c=`${a}${n}`;if(Ue(c,i)>=t){const d=l+1,f=o.length===d,u=`${c}${r}`;s.push(f?c:u),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function wh(e,t){return Sa(e,t).height}p(wh,"calculateTextHeight");function Ue(e,t){return Sa(e,t).width}p(Ue,"calculateTextWidth");var Sa=Wo((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=Ho(r),a=["sans-serif",i],n=e.split(Yi.lineBreakRegex),l=[],c=yt("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 g={width:0,height:0,lineHeight:0};for(const m of n){const y=IT();y.text=m||em;const x=PT(h,y).style("font-size",s).style("font-weight",o).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");g.width=Math.round(Math.max(g.width,C.width)),u=Math.round(C.height),g.height+=u,g.lineHeight=Math.round(Math.max(g.lineHeight,u))}l.push(g)}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}`),Ai,NT=(Ai=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},p(Ai,"InitIDGenerator"),Ai),rs,qT=p(function(e){return rs=rs||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),rs.innerHTML=e,unescape(rs.textContent)},"entityDecode");function Sh(e){return"str"in e}p(Sh,"isDetailedError");var zT=p((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Ho=p(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 va(e,t){return LT({},e,t)}p(va,"cleanAndMerge");var we={assignWithDepth:jt,wrapLabel:cm,calculateTextHeight:wh,calculateTextWidth:Ue,calculateTextDimensions:Sa,cleanAndMerge:va,detectInit:AT,detectDirective:rm,isSubstringInArray:$T,interpolateToCurve:xh,calcLabelPosition:sm,calcCardinalityPosition:RT,calcTerminalLabelPosition:am,formatUrl:im,getStylesFromArray:kh,generateId:nm,random:hm,runFunc:OT,entityDecode:qT,insertTitle:zT,isLabelCoordinateInPath:dm,parseFontSize:Ho,InitIDGenerator:NT},jT=p(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"),br=p(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),WT=p((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Vt(e){return e??null}p(Vt,"handleUndefinedAttr");function dm(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}p(dm,"isLabelCoordinateInPath");var Ta=p(({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 vh(e,t){const r=e.getElementsByTagName("img");if(!r||r.length===0)return;const i=t.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...r].map(o=>new Promise(s=>{function a(){if(o.style.display="flex",o.style.flexDirection="column",i){const n=kt().fontSize?kt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=Il.fontSize]=Ho(n),h=c*l+"px";o.style.minWidth=h,o.style.maxWidth=h}else o.style.width="100%";s(o)}p(a,"setupImage"),setTimeout(()=>{o.complete&&a()}),o.addEventListener("error",a),o.addEventListener("load",a)})))}p(vh,"configureLabelImages");const HT=Object.freeze({left:0,top:0,width:16,height:16}),Xs=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),um=Object.freeze({...HT,...Xs}),YT=Object.freeze({...um,body:"",hidden:!1}),UT=Object.freeze({width:null,height:null}),GT=Object.freeze({...UT,...Xs}),XT=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return rn(c)?c:null}const s=o[0],a=s.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return rn(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return rn(n,r)?n:null}return null},rn=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function VT(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 Vc(e,t){const r=VT(e,t);for(const i in YT)i in Xs?i in e&&!(i in r)&&(r[i]=Xs[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function KT(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const n=i[a]&&i[a].parent,l=n&&s(n);l&&(o[a]=[n].concat(l))}return o[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),o}function Kc(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function a(n){s=Vc(i[n]||o[n],s)}return a(t),r.forEach(a),Vc(e,s)}function ZT(e,t){if(e.icons[t])return Kc(e,t,[]);const r=KT(e,[t])[t];return r?Kc(e,t,r):null}const QT=/(-?[0-9.]*[0-9]+[0-9.]*)/g,JT=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Zc(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(QT);if(i===null||!i.length)return e;const o=[];let s=i.shift(),a=JT.test(s);for(;;){if(a){const n=parseFloat(s);isNaN(n)?o.push(s):o.push(Math.ceil(n*t*r)/r)}else o.push(s);if(s=i.shift(),s===void 0)return o.join("");a=!a}}function t_(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),s=e.indexOf("</"+t);if(o===-1||s===-1)break;const a=e.indexOf(">",s);if(a===-1)break;r+=e.slice(o+1,s).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function e_(e,t){return e?"<defs>"+e+"</defs>"+t:t}function r_(e,t,r){const i=t_(e);return e_(i.defs,t+i.content+r)}const i_=e=>e==="unset"||e==="undefined"||e==="none";function o_(e,t){const r={...um,...e},i={...GT,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,i].forEach(m=>{const y=[],x=m.hFlip,C=m.vFlip;let w=m.rotate;x?C?w+=2:(y.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):C&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let S;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:S=o.height/2+o.top,y.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:S=o.width/2+o.left,y.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}w%2===1&&(o.left!==o.top&&(S=o.left,o.left=o.top,o.top=S),o.width!==o.height&&(S=o.width,o.width=o.height,o.height=S)),y.length&&(s=r_(s,'<g transform="'+y.join(" ")+'">',"</g>"))});const a=i.width,n=i.height,l=o.width,c=o.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=Zc(d,l/c)):(h=a==="auto"?l:a,d=n===null?Zc(h,c/l):n==="auto"?c:n);const f={},u=(m,y)=>{i_(y)||(f[m]=y.toString())};u("width",h),u("height",d);const g=[o.left,o.top,l,c];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:s}}const s_=/\sid="(\S+)"/g,Qc=new Map;function a_(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Qc.get(e)||0;return Qc.set(e,t+1),t?`${e}${t}`:e}function n_(e){const t=[];let r;for(;r=s_.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const s=a_(o),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function l_(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 fm={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},ll=new Map,gm=new Map,pm=p(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)gm.set(t.name,t.loader);else if("icons"in t)ll.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"),mm=p(async(e,t)=>{const r=XT(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=ll.get(i);if(!o){const a=gm.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},ll.set(i,o)}catch(n){throw V.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=ZT(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),h_=p(async e=>{try{return await mm(e),!0}catch{return!1}},"isIconAvailable"),Xi=p(async(e,t,r)=>{let i;try{i=await mm(e,t?.fallbackPrefix)}catch(a){V.error(a),i=fm}const o=o_(i,t),s=l_(n_(o.body),{...o.attributes,...r});return Se(s,Rt())},"getIconSVG");function Th(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Kr=Th();function ym(e){Kr=e}var vo={exec:()=>null};function vt(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(de.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var c_=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),de={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},d_=/^(?:[ \t]*(?:\n|$))+/,u_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,f_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Yo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,g_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_h=/(?:[*+-]|\d{1,9}[.)])/,xm=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Cm=vt(xm).replace(/bull/g,_h).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(),p_=vt(xm).replace(/bull/g,_h).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(),Bh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,m_=/^[^\n]+/,Lh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,y_=vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Lh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),x_=vt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_h).getRegex(),_a="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",Eh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,C_=vt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Eh).replace("tag",_a).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bm=vt(Bh).replace("hr",Yo).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",_a).getRegex(),b_=vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",bm).getRegex(),Fh={blockquote:b_,code:u_,def:y_,fences:f_,heading:g_,hr:Yo,html:C_,lheading:Cm,list:x_,newline:d_,paragraph:bm,table:vo,text:m_},Jc=vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Yo).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",_a).getRegex(),k_={...Fh,lheading:p_,table:Jc,paragraph:vt(Bh).replace("hr",Yo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Jc).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",_a).getRegex()},w_={...Fh,html:vt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Eh).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:vo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vt(Bh).replace("hr",Yo).replace("heading",` *#{1,6} *[^
164
- ]`).replace("lheading",Cm).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},S_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,v_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,km=/^( {2,}|\\)\n(?!\s*$)/,T_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ba=/[\p{P}\p{S}]/u,Ah=/[\s\p{P}\p{S}]/u,wm=/[^\s\p{P}\p{S}]/u,__=vt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ah).getRegex(),Sm=/(?!~)[\p{P}\p{S}]/u,B_=/(?!~)[\s\p{P}\p{S}]/u,L_=/(?:[^\s\p{P}\p{S}]|~)/u,E_=vt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",c_?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),vm=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,F_=vt(vm,"u").replace(/punct/g,Ba).getRegex(),A_=vt(vm,"u").replace(/punct/g,Sm).getRegex(),Tm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",M_=vt(Tm,"gu").replace(/notPunctSpace/g,wm).replace(/punctSpace/g,Ah).replace(/punct/g,Ba).getRegex(),$_=vt(Tm,"gu").replace(/notPunctSpace/g,L_).replace(/punctSpace/g,B_).replace(/punct/g,Sm).getRegex(),O_=vt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,wm).replace(/punctSpace/g,Ah).replace(/punct/g,Ba).getRegex(),R_=vt(/\\(punct)/,"gu").replace(/punct/g,Ba).getRegex(),I_=vt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),P_=vt(Eh).replace("(?:-->|$)","-->").getRegex(),D_=vt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",P_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Vs=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,N_=vt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Vs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_m=vt(/^!?\[(label)\]\[(ref)\]/).replace("label",Vs).replace("ref",Lh).getRegex(),Bm=vt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Lh).getRegex(),q_=vt("reflink|nolink(?!\\()","g").replace("reflink",_m).replace("nolink",Bm).getRegex(),td=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mh={_backpedal:vo,anyPunctuation:R_,autolink:I_,blockSkip:E_,br:km,code:v_,del:vo,emStrongLDelim:F_,emStrongRDelimAst:M_,emStrongRDelimUnd:O_,escape:S_,link:N_,nolink:Bm,punctuation:__,reflink:_m,reflinkSearch:q_,tag:D_,text:T_,url:vo},z_={...Mh,link:vt(/^!?\[(label)\]\((.*?)\)/).replace("label",Vs).getRegex(),reflink:vt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Vs).getRegex()},hl={...Mh,emStrongRDelimAst:$_,emStrongLDelim:A_,url:vt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",td).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:vt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",td).getRegex()},j_={...hl,br:vt(km).replace("{2,}","*").getRegex(),text:vt(hl.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},is={normal:Fh,gfm:k_,pedantic:w_},io={normal:Mh,gfm:hl,breaks:j_,pedantic:z_},W_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ed=e=>W_[e];function qe(e,t){if(t){if(de.escapeTest.test(e))return e.replace(de.escapeReplace,ed)}else if(de.escapeTestNoEncode.test(e))return e.replace(de.escapeReplaceNoEncode,ed);return e}function rd(e){try{e=encodeURI(e).replace(de.percentDecode,"%")}catch{return null}return e}function id(e,t){let r=e.replace(de.findPipe,(s,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(de.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(de.slashPipe,"|");return i}function oo(e,t,r){let i=e.length;if(i===0)return"";let o=0;for(;o<i&&e.charAt(i-o-1)===t;)o++;return e.slice(0,i-o)}function H_(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 od(e,t,r,i,o){let s=t.href,a=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function Y_(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
161
+ `+e.slice(a+1):l+=e.slice(o),l.slice(1)}p(il,"foldLine");function _p(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=fi(e,o),i=ne[r],!i&&zi(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||pp(r);return t}p(_p,"escapeString");function Bp(e,t,r){var i="",o=e.tag,s,a,n;for(s=0,a=r.length;s<a;s+=1)n=r[s],e.replacer&&(n=e.replacer.call(r,String(s),n)),(Ye(e,t,n,!1,!1)||typeof n>"u"&&Ye(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}p(Bp,"writeFlowSequence");function ol(e,t,r,i){var o="",s=e.tag,a,n,l;for(a=0,n=r.length;a<n;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(Ye(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&Ye(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=Us(e,t)),e.dump&&Mo===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}p(ol,"writeBlockSequence");function Lp(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,n,l,c,h;for(a=0,n=s.length;a<n;a+=1)h="",i!==""&&(h+=", "),e.condenseFlow&&(h+='"'),l=s[a],c=r[l],e.replacer&&(c=e.replacer.call(r,l,c)),Ye(e,t,l,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ye(e,t,c,!1,!1)&&(h+=e.dump,i+=h));e.tag=o,e.dump="{"+i+"}"}p(Lp,"writeFlowMapping");function Ep(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),n,l,c,h,d,f;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new ge("sortKeys must be a boolean or a function");for(n=0,l=a.length;n<l;n+=1)f="",(!i||o!=="")&&(f+=Us(e,t)),c=a[n],h=r[c],e.replacer&&(h=e.replacer.call(r,c,h)),Ye(e,t+1,c,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&Mo===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,d&&(f+=Us(e,t)),Ye(e,t+1,h,!0,d)&&(e.dump&&Mo===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,o+=f));e.tag=s,e.dump=o||"{}"}p(Ep,"writeBlockMapping");function sl(e,t,r){var i,o,s,a,n,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(n=o[s],(n.instanceOf||n.predicate)&&(!n.instanceOf||typeof t=="object"&&t instanceof n.instanceOf)&&(!n.predicate||n.predicate(t))){if(r?n.multi&&n.representName?e.tag=n.representName(t):e.tag=n.tag:e.tag="?",n.represent){if(l=e.styleMap[n.tag]||n.defaultStyle,np.call(n.represent)==="[object Function]")i=n.represent(t,l);else if(lp.call(n.represent,l))i=n.represent[l](t,l);else throw new ge("!<"+n.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}p(sl,"detectType");function Ye(e,t,r,i,o,s,a){e.tag=null,e.dump=r,sl(e,r,!1)||sl(e,r,!0);var n=np.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)&&(o=!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?(Ep(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(Lp(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?ol(e,t-1,e.dump,o):ol(e,t,e.dump,o),f&&(e.dump="&ref_"+d+e.dump)):(Bp(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if(n==="[object String]")e.tag!=="?"&&vp(e,e.dump,t,s,l);else{if(n==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new ge("unacceptable kind of an object to dump "+n)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}p(Ye,"writeNode");function Fp(e,t){var r=[],i=[],o,s;for(Gs(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}p(Fp,"getDuplicateReferences");function Gs(e,t,r){var i,o,s;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)Gs(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)Gs(e[i[o]],t,r)}p(Gs,"inspectNode");function dT(e,t){t=t||{};var r=new mp(t);r.noRefs||Fp(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),Ye(r,0,i,!0,!0)?r.dump+`
162
+ `:""}p(dT,"dump$1");function uT(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.")}}p(uT,"renamed");var Ap=kg,Mp=Yv.load;var fT=p(e=>{const{handDrawnSeed:t}=kt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Gi=p(e=>{const t=gT([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),gT=p(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),dh=p(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"),it=p(e=>{const{stylesArray:t}=Gi(e),r=[],i=[],o=[],s=[];return t.forEach(a=>{const n=a[0];dh(n)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),n.includes("stroke")&&o.push(a.join(":")+" !important"),n==="fill"&&s.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:s}},"styles2String"),et=p((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=kt(),{nodeBorder:o,mainBkg:s}=r,{stylesMap:a}=Gi(e);return Object.assign({roughness:.7,fill:a.get("fill")||s,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:pT(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),pT=p(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray"),es={},Yt={},jc;function mT(){return jc||(jc=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.BLANK_URL=Yt.relativeFirstCharacters=Yt.whitespaceEscapeCharsRegex=Yt.urlSchemeRegex=Yt.ctrlCharactersRegex=Yt.htmlCtrlEntityRegex=Yt.htmlEntitiesRegex=Yt.invalidProtocolRegex=void 0,Yt.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Yt.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Yt.htmlCtrlEntityRegex=/&(newline|tab);/gi,Yt.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Yt.urlSchemeRegex=/^.+(:|&colon;)/gim,Yt.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Yt.relativeFirstCharacters=[".","/"],Yt.BLANK_URL="about:blank"),Yt}var Wc;function yT(){if(Wc)return es;Wc=1,Object.defineProperty(es,"__esModule",{value:!0}),es.sanitizeUrl=s;var e=mT();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function s(a){if(!a)return e.BLANK_URL;var n,l=o(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var 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 g=new URL(u);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return u}return es}var $p=yT();function en(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 xT(){}function Op(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function ka(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Rp="[object RegExp]",uh="[object String]",fh="[object Number]",gh="[object Boolean]",ph="[object Arguments]",Ip="[object Symbol]",Pp="[object Date]",Dp="[object Map]",Np="[object Set]",qp="[object Array]",zp="[object ArrayBuffer]",jp="[object Object]",Wp="[object DataView]",Hp="[object Uint8Array]",Yp="[object Uint8ClampedArray]",Up="[object Uint16Array]",Gp="[object Uint32Array]",Xp="[object Int8Array]",Vp="[object Int16Array]",Kp="[object Int32Array]",Zp="[object Float32Array]",Qp="[object Float64Array]",Hc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})()||Function("return this")();function mh(e){return typeof Hc.Buffer<"u"&&Hc.Buffer.isBuffer(e)}function CT(e){return Number.isSafeInteger(e)&&e>=0}function Jp(e){return e!=null&&typeof e!="function"&&CT(e.length)}function bT(e){return e==="__proto__"}function wa(e){return e==null||typeof e!="object"&&typeof e!="function"}function yh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function kT(e,t){return gi(e,void 0,e,new Map,t)}function gi(e,t,r,i=new Map,o=void 0){const s=o?.(e,t,r,i);if(s!==void 0)return s;if(wa(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]=gi(e[n],n,r,i,o);return Object.hasOwn(e,"index")&&(a.index=e.index),Object.hasOwn(e,"input")&&(a.input=e.input),a}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const a=new RegExp(e.source,e.flags);return a.lastIndex=e.lastIndex,a}if(e instanceof Map){const a=new Map;i.set(e,a);for(const[n,l]of e)a.set(n,gi(l,n,r,i,o));return a}if(e instanceof Set){const a=new Set;i.set(e,a);for(const n of e)a.add(gi(n,void 0,r,i,o));return a}if(mh(e))return e.subarray();if(yh(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,a);for(let n=0;n<e.length;n++)a[n]=gi(e[n],n,r,i,o);return a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const a=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,a),Ee(a,e,r,i,o),a}if(typeof File<"u"&&e instanceof File){const a=new File([e],e.name,{type:e.type});return i.set(e,a),Ee(a,e,r,i,o),a}if(typeof Blob<"u"&&e instanceof Blob){const a=new Blob([e],{type:e.type});return i.set(e,a),Ee(a,e,r,i,o),a}if(e instanceof Error){const a=structuredClone(e);return i.set(e,a),a.message=e.message,a.name=e.name,a.stack=e.stack,a.cause=e.cause,a.constructor=e.constructor,Ee(a,e,r,i,o),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return i.set(e,a),Ee(a,e,r,i,o),a}if(e instanceof Number){const a=new Number(e.valueOf());return i.set(e,a),Ee(a,e,r,i,o),a}if(e instanceof String){const a=new String(e.valueOf());return i.set(e,a),Ee(a,e,r,i,o),a}if(typeof e=="object"&&wT(e)){const a=Object.create(Object.getPrototypeOf(e));return i.set(e,a),Ee(a,e,r,i,o),a}return e}function Ee(e,t,r=e,i,o){const s=[...Object.keys(t),...Op(t)];for(let a=0;a<s.length;a++){const n=s[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=gi(t[n],n,r,i,o))}}function wT(e){switch(ka(e)){case ph:case qp:case zp:case Wp:case gh:case Pp:case Zp:case Qp:case Xp:case Vp:case Kp:case Dp:case fh:case jp:case Rp:case Np:case uh:case Ip:case Hp:case Yp:case Up:case Gp:return!0;default:return!1}}function ST(e,t){return kT(e,(r,i,o,s)=>{if(typeof e=="object"){if(ka(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return s.set(e,a),Ee(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case fh:case uh:case gh:{const a=new e.constructor(e?.valueOf());return Ee(a,e),a}case ph:{const a={};return Ee(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Yc(e){return ST(e)}function al(e){return e!==null&&typeof e=="object"&&ka(e)==="[object Arguments]"}function nl(e){return typeof e=="object"&&e!==null}function vT(e){return nl(e)&&Jp(e)}function Wo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],s=r.cache;if(s.has(o))return s.get(o);const a=e.apply(this,i);return r.cache=s.set(o,a)||s,a};return r.cache=new(Wo.Cache||Map),r}Wo.Cache=Map;function So(e){return yh(e)}function TT(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function _T(e){if(wa(e))return e;if(Array.isArray(e)||yh(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 BT(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let s=0;s<r.length;s++){const a=r[s];o=Cs(o,a,i,new Map)}return o}function Cs(e,t,r,i){if(wa(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return _T(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let s=0;s<t.length;s++)t[s]=t[s]??void 0}const o=[...Object.keys(t),...Op(t)];for(let s=0;s<o.length;s++){const a=o[s];if(bT(a))continue;let n=t[a],l=e[a];if(al(n)&&(n={...n}),al(l)&&(l={...l}),mh(n)&&(n=Yc(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(vT(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)||nl(l)&&nl(n)&&(en(l)||en(n)||So(l)||So(n))?e[a]=Cs(l,n,r,i):l==null&&en(n)?e[a]=Cs({},n,r,i):l==null&&So(n)?e[a]=Yc(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function LT(e,...t){return BT(e,...t,xT)}function Uc(e){if(e==null)return!0;if(Jp(e))return typeof e.splice!="function"&&typeof e!="string"&&!mh(e)&&!So(e)&&!al(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 TT(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var tm="​",ET={curveBasis:Ns,curveBasisClosed:tv,curveBasisOpen:ev,curveBumpX:Ef,curveBumpY:Ff,curveBundle:rv,curveCardinalClosed:iv,curveCardinalOpen:ov,curveCardinal:Of,curveCatmullRomClosed:sv,curveCatmullRomOpen:av,curveCatmullRom:If,curveLinear:wo,curveLinearClosed:nv,curveMonotoneX:jf,curveMonotoneY:Wf,curveNatural:Yf,curveStep:Uf,curveStepAfter:Xf,curveStepBefore:Gf},FT=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,AT=p(function(e,t){const r=em(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(n=>n.args);Bs(a),i=jt(i,[...a])}else i=r.args;if(!i)return;let o=Pl(e,t);const s="config";return i[s]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[s],delete i[s]),i},"detectInit"),em=p(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${FT.source})(?=[}][%]{2}).*
163
+ `,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),V.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=ko.exec(e))!==null;)if(i.index===ko.lastIndex&&ko.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const s=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:s,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return V.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),MT=p(function(e){return e.replace(ko,"")},"removeDirectives"),$T=p(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function xh(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return ET[r]??t}p(xh,"interpolateToCurve");function rm(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?$p.sanitizeUrl(r):r}p(rm,"formatUrl");var OT=p((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let s=window;for(let a=0;a<i;a++)if(s=s[r[a]],!s){V.error(`Function name: ${e} not found in window`);return}s[o](...t)},"runFunc");function Ch(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}p(Ch,"distance");function im(e){let t,r=0;e.forEach(o=>{r+=Ch(o,t),t=o});const i=r/2;return bh(e,i)}p(im,"traverseEdge");function om(e){return e.length===1?e[0]:im(e)}p(om,"calcLabelPosition");var Gc=p((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),bh=p((e,t)=>{let r,i=t;for(const o of e){if(r){const s=Ch(o,r);if(s===0)return r;if(s<i)i-=s;else{const a=i/s;if(a<=0)return r;if(a>=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:Gc((1-a)*r.x+a*o.x,5),y:Gc((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),RT=p((e,t,r)=>{V.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=bh(t,25),s=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(a)*s+(t[0].x+o.x)/2,n.y=-Math.cos(a)*s+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function sm(e,t,r){const i=structuredClone(r);V.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,s=bh(i,o),a=10+e*.5,n=Math.atan2(i[0].y-s.y,i[0].x-s.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n+Math.PI)*a+(i[0].y+s.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(i[0].y+s.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(i[0].x+s.x)/2-5,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2-5):(l.x=Math.sin(n)*a+(i[0].x+s.x)/2,l.y=-Math.cos(n)*a+(i[0].y+s.y)/2),l}p(sm,"calcTerminalLabelPosition");function kh(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}}p(kh,"getStylesFromArray");var Xc=0,am=p(()=>(Xc++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Xc),"generateId");function nm(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}p(nm,"makeRandomHex");var lm=p(e=>nm(e.length),"random"),IT=p(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"),PT=p(function(e,t){const r=t.text.replace(Yi.lineBreakRegex," "),[,i]=Ho(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const s=o.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.attr("fill",t.fill),s.text(r),o},"drawSimpleText"),hm=Wo((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Yi.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let s="";return i.forEach((a,n)=>{const l=Ue(`${a} `,r),c=Ue(s,r);if(l>t){const{hyphenatedStrings:f,remainingWord:u}=DT(a,t,"-",r);o.push(s,...f),s=u}else c+l>=t?(o.push(s),s=a):s=[s,a].filter(Boolean).join(" ");n+1===i.length&&o.push(s)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),DT=Wo((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],s=[];let a="";return o.forEach((n,l)=>{const c=`${a}${n}`;if(Ue(c,i)>=t){const d=l+1,f=o.length===d,u=`${c}${r}`;s.push(f?c:u),a=""}else a=c}),{hyphenatedStrings:s,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function wh(e,t){return Sa(e,t).height}p(wh,"calculateTextHeight");function Ue(e,t){return Sa(e,t).width}p(Ue,"calculateTextWidth");var Sa=Wo((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,s]=Ho(r),a=["sans-serif",i],n=e.split(Yi.lineBreakRegex),l=[],c=yt("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 g={width:0,height:0,lineHeight:0};for(const m of n){const y=IT();y.text=m||tm;const x=PT(h,y).style("font-size",s).style("font-weight",o).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");g.width=Math.round(Math.max(g.width,C.width)),u=Math.round(C.height),g.height+=u,g.lineHeight=Math.round(Math.max(g.lineHeight,u))}l.push(g)}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}`),Ai,NT=(Ai=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},p(Ai,"InitIDGenerator"),Ai),rs,qT=p(function(e){return rs=rs||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),rs.innerHTML=e,unescape(rs.textContent)},"entityDecode");function Sh(e){return"str"in e}p(Sh,"isDetailedError");var zT=p((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Ho=p(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 va(e,t){return LT({},e,t)}p(va,"cleanAndMerge");var we={assignWithDepth:jt,wrapLabel:hm,calculateTextHeight:wh,calculateTextWidth:Ue,calculateTextDimensions:Sa,cleanAndMerge:va,detectInit:AT,detectDirective:em,isSubstringInArray:$T,interpolateToCurve:xh,calcLabelPosition:om,calcCardinalityPosition:RT,calcTerminalLabelPosition:sm,formatUrl:rm,getStylesFromArray:kh,generateId:am,random:lm,runFunc:OT,entityDecode:qT,insertTitle:zT,isLabelCoordinateInPath:cm,parseFontSize:Ho,InitIDGenerator:NT},jT=p(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"),br=p(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),WT=p((e,t,{counter:r=0,prefix:i,suffix:o},s)=>s||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Vt(e){return e??null}p(Vt,"handleUndefinedAttr");function cm(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,s=>Math.round(parseFloat(s)).toString());return o.includes(r.toString())||o.includes(i.toString())}p(cm,"isLabelCoordinateInPath");var Ta=p(({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 vh(e,t){const r=e.getElementsByTagName("img");if(!r||r.length===0)return;const i=t.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...r].map(o=>new Promise(s=>{function a(){if(o.style.display="flex",o.style.flexDirection="column",i){const n=kt().fontSize?kt().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[c=Il.fontSize]=Ho(n),h=c*l+"px";o.style.minWidth=h,o.style.maxWidth=h}else o.style.width="100%";s(o)}p(a,"setupImage"),setTimeout(()=>{o.complete&&a()}),o.addEventListener("error",a),o.addEventListener("load",a)})))}p(vh,"configureLabelImages");const HT=Object.freeze({left:0,top:0,width:16,height:16}),Xs=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),dm=Object.freeze({...HT,...Xs}),YT=Object.freeze({...dm,body:"",hidden:!1}),UT=Object.freeze({width:null,height:null}),GT=Object.freeze({...UT,...Xs}),XT=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return rn(c)?c:null}const s=o[0],a=s.split("-");if(a.length>1){const n={provider:i,prefix:a.shift(),name:a.join("-")};return rn(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:s};return rn(n,r)?n:null}return null},rn=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function VT(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 Vc(e,t){const r=VT(e,t);for(const i in YT)i in Xs?i in e&&!(i in r)&&(r[i]=Xs[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function KT(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const n=i[a]&&i[a].parent,l=n&&s(n);l&&(o[a]=[n].concat(l))}return o[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(s),o}function Kc(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let s={};function a(n){s=Vc(i[n]||o[n],s)}return a(t),r.forEach(a),Vc(e,s)}function ZT(e,t){if(e.icons[t])return Kc(e,t,[]);const r=KT(e,[t])[t];return r?Kc(e,t,r):null}const QT=/(-?[0-9.]*[0-9]+[0-9.]*)/g,JT=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Zc(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(QT);if(i===null||!i.length)return e;const o=[];let s=i.shift(),a=JT.test(s);for(;;){if(a){const n=parseFloat(s);isNaN(n)?o.push(s):o.push(Math.ceil(n*t*r)/r)}else o.push(s);if(s=i.shift(),s===void 0)return o.join("");a=!a}}function t_(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),s=e.indexOf("</"+t);if(o===-1||s===-1)break;const a=e.indexOf(">",s);if(a===-1)break;r+=e.slice(o+1,s).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function e_(e,t){return e?"<defs>"+e+"</defs>"+t:t}function r_(e,t,r){const i=t_(e);return e_(i.defs,t+i.content+r)}const i_=e=>e==="unset"||e==="undefined"||e==="none";function o_(e,t){const r={...dm,...e},i={...GT,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let s=r.body;[r,i].forEach(m=>{const y=[],x=m.hFlip,C=m.vFlip;let w=m.rotate;x?C?w+=2:(y.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),y.push("scale(-1 1)"),o.top=o.left=0):C&&(y.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),y.push("scale(1 -1)"),o.top=o.left=0);let S;switch(w<0&&(w-=Math.floor(w/4)*4),w=w%4,w){case 1:S=o.height/2+o.top,y.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:y.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:S=o.width/2+o.left,y.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}w%2===1&&(o.left!==o.top&&(S=o.left,o.left=o.top,o.top=S),o.width!==o.height&&(S=o.width,o.width=o.height,o.height=S)),y.length&&(s=r_(s,'<g transform="'+y.join(" ")+'">',"</g>"))});const a=i.width,n=i.height,l=o.width,c=o.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=Zc(d,l/c)):(h=a==="auto"?l:a,d=n===null?Zc(h,c/l):n==="auto"?c:n);const f={},u=(m,y)=>{i_(y)||(f[m]=y.toString())};u("width",h),u("height",d);const g=[o.left,o.top,l,c];return f.viewBox=g.join(" "),{attributes:f,viewBox:g,body:s}}const s_=/\sid="(\S+)"/g,Qc=new Map;function a_(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Qc.get(e)||0;return Qc.set(e,t+1),t?`${e}${t}`:e}function n_(e){const t=[];let r;for(;r=s_.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const s=a_(o),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function l_(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 um={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},ll=new Map,fm=new Map,gm=p(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)fm.set(t.name,t.loader);else if("icons"in t)ll.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"),pm=p(async(e,t)=>{const r=XT(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=ll.get(i);if(!o){const a=fm.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},ll.set(i,o)}catch(n){throw V.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const s=ZT(o,r.name);if(!s)throw new Error(`Icon not found: ${e}`);return s},"getRegisteredIconData"),h_=p(async e=>{try{return await pm(e),!0}catch{return!1}},"isIconAvailable"),Xi=p(async(e,t,r)=>{let i;try{i=await pm(e,t?.fallbackPrefix)}catch(a){V.error(a),i=um}const o=o_(i,t),s=l_(n_(o.body),{...o.attributes,...r});return Se(s,Rt())},"getIconSVG");function Th(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Kr=Th();function mm(e){Kr=e}var vo={exec:()=>null};function vt(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(de.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var c_=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),de={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},d_=/^(?:[ \t]*(?:\n|$))+/,u_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,f_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Yo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,g_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_h=/(?:[*+-]|\d{1,9}[.)])/,ym=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xm=vt(ym).replace(/bull/g,_h).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(),p_=vt(ym).replace(/bull/g,_h).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(),Bh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,m_=/^[^\n]+/,Lh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,y_=vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Lh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),x_=vt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_h).getRegex(),_a="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",Eh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,C_=vt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Eh).replace("tag",_a).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Cm=vt(Bh).replace("hr",Yo).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",_a).getRegex(),b_=vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Cm).getRegex(),Fh={blockquote:b_,code:u_,def:y_,fences:f_,heading:g_,hr:Yo,html:C_,lheading:xm,list:x_,newline:d_,paragraph:Cm,table:vo,text:m_},Jc=vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Yo).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",_a).getRegex(),k_={...Fh,lheading:p_,table:Jc,paragraph:vt(Bh).replace("hr",Yo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Jc).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",_a).getRegex()},w_={...Fh,html:vt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Eh).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:vo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vt(Bh).replace("hr",Yo).replace("heading",` *#{1,6} *[^
164
+ ]`).replace("lheading",xm).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},S_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,v_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bm=/^( {2,}|\\)\n(?!\s*$)/,T_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ba=/[\p{P}\p{S}]/u,Ah=/[\s\p{P}\p{S}]/u,km=/[^\s\p{P}\p{S}]/u,__=vt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ah).getRegex(),wm=/(?!~)[\p{P}\p{S}]/u,B_=/(?!~)[\s\p{P}\p{S}]/u,L_=/(?:[^\s\p{P}\p{S}]|~)/u,E_=vt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",c_?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Sm=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,F_=vt(Sm,"u").replace(/punct/g,Ba).getRegex(),A_=vt(Sm,"u").replace(/punct/g,wm).getRegex(),vm="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",M_=vt(vm,"gu").replace(/notPunctSpace/g,km).replace(/punctSpace/g,Ah).replace(/punct/g,Ba).getRegex(),$_=vt(vm,"gu").replace(/notPunctSpace/g,L_).replace(/punctSpace/g,B_).replace(/punct/g,wm).getRegex(),O_=vt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,km).replace(/punctSpace/g,Ah).replace(/punct/g,Ba).getRegex(),R_=vt(/\\(punct)/,"gu").replace(/punct/g,Ba).getRegex(),I_=vt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),P_=vt(Eh).replace("(?:-->|$)","-->").getRegex(),D_=vt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",P_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Vs=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,N_=vt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Vs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Tm=vt(/^!?\[(label)\]\[(ref)\]/).replace("label",Vs).replace("ref",Lh).getRegex(),_m=vt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Lh).getRegex(),q_=vt("reflink|nolink(?!\\()","g").replace("reflink",Tm).replace("nolink",_m).getRegex(),td=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mh={_backpedal:vo,anyPunctuation:R_,autolink:I_,blockSkip:E_,br:bm,code:v_,del:vo,emStrongLDelim:F_,emStrongRDelimAst:M_,emStrongRDelimUnd:O_,escape:S_,link:N_,nolink:_m,punctuation:__,reflink:Tm,reflinkSearch:q_,tag:D_,text:T_,url:vo},z_={...Mh,link:vt(/^!?\[(label)\]\((.*?)\)/).replace("label",Vs).getRegex(),reflink:vt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Vs).getRegex()},hl={...Mh,emStrongRDelimAst:$_,emStrongLDelim:A_,url:vt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",td).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:vt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",td).getRegex()},j_={...hl,br:vt(bm).replace("{2,}","*").getRegex(),text:vt(hl.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},is={normal:Fh,gfm:k_,pedantic:w_},io={normal:Mh,gfm:hl,breaks:j_,pedantic:z_},W_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ed=e=>W_[e];function qe(e,t){if(t){if(de.escapeTest.test(e))return e.replace(de.escapeReplace,ed)}else if(de.escapeTestNoEncode.test(e))return e.replace(de.escapeReplaceNoEncode,ed);return e}function rd(e){try{e=encodeURI(e).replace(de.percentDecode,"%")}catch{return null}return e}function id(e,t){let r=e.replace(de.findPipe,(s,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(de.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(de.slashPipe,"|");return i}function oo(e,t,r){let i=e.length;if(i===0)return"";let o=0;for(;o<i&&e.charAt(i-o-1)===t;)o++;return e.slice(0,i-o)}function H_(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 od(e,t,r,i,o){let s=t.href,a=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function Y_(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
165
165
  `).map(s=>{let a=s.match(r.other.beginningSpace);if(a===null)return s;let[n]=a;return n.length>=o.length?s.slice(o.length):s}).join(`
166
166
  `)}var Ks=class{options;rules;lexer;constructor(t){this.options=t||Kr}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:oo(i,`
167
167
  `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=Y_(i,r[3]||"",this.rules);return{type:"code",raw:i,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let i=r[2].trim();if(this.rules.other.endingHash.test(i)){let o=oo(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:oo(r[0],`
@@ -219,26 +219,26 @@ ${t}</tr>
219
219
  `}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
220
220
  `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${qe(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:i}){let o=this.parser.parseInline(i),s=rd(t);if(s===null)return o;t=s;let a='<a href="'+t+'"';return r&&(a+=' title="'+qe(r)+'"'),a+=">"+o+"</a>",a}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let s=rd(t);if(s===null)return qe(i);t=s;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${qe(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:qe(t.text)}},$h=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""}},Ae=class dl{options;renderer;textRenderer;constructor(t){this.options=t||Kr,this.options.renderer=this.options.renderer||new Zs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $h}static parse(t,r){return new dl(r).parse(t)}static parseInline(t,r){return new dl(r).parseInline(t)}parse(t,r=!0){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=s,l=this.options.extensions.renderers[n.type].call({parser:this},n);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){i+=l||"";continue}}let a=s;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let n=a,l=this.renderer.text(n);for(;o+1<t.length&&t[o+1].type==="text";)n=t[++o],l+=`
221
221
  `+this.renderer.text(n);r?i+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):i+=l;continue}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}parseInline(t,r=this.renderer){let i="";for(let o=0;o<t.length;o++){let s=t[o];if(this.options.extensions?.renderers?.[s.type]){let n=this.options.extensions.renderers[s.type].call({parser:this},s);if(n!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=n||"";continue}}let a=s;switch(a.type){case"escape":{i+=r.text(a);break}case"html":{i+=r.html(a);break}case"link":{i+=r.link(a);break}case"image":{i+=r.image(a);break}case"strong":{i+=r.strong(a);break}case"em":{i+=r.em(a);break}case"codespan":{i+=r.codespan(a);break}case"br":{i+=r.br(a);break}case"del":{i+=r.del(a);break}case"text":{i+=r.text(a);break}default:{let n='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(n),"";throw new Error(n)}}}return i}},po=class{options;block;constructor(t){this.options=t||Kr}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?Fe.lex:Fe.lexInline}provideParser(){return this.block?Ae.parse:Ae.parseInline}},U_=class{defaults=Th();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ae;Renderer=Zs;TextRenderer=$h;Lexer=Fe;Tokenizer=Ks;Hooks=po;constructor(...t){this.use(...t)}walkTokens(t,r){let i=[];for(let o of t)switch(i=i.concat(r.call(this,o)),o.type){case"table":{let s=o;for(let a of s.header)i=i.concat(this.walkTokens(a.tokens,r));for(let a of s.rows)for(let n of a)i=i.concat(this.walkTokens(n.tokens,r));break}case"list":{let s=o;i=i.concat(this.walkTokens(s.items,r));break}default:{let s=o;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let n=s[a].flat(1/0);i=i.concat(this.walkTokens(n,r))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,r)))}}return i}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=r.renderers[s.name];a?r.renderers[s.name]=function(...n){let l=s.renderer.apply(this,n);return l===!1&&(l=a.apply(this,n)),l}:r.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[s.level];a?a.unshift(s.tokenizer):r[s.level]=[s.tokenizer],s.start&&(s.level==="block"?r.startBlock?r.startBlock.push(s.start):r.startBlock=[s.start]:s.level==="inline"&&(r.startInline?r.startInline.push(s.start):r.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(r.childTokens[s.name]=s.childTokens)}),o.extensions=r),i.renderer){let s=this.defaults.renderer||new Zs(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let n=a,l=i.renderer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d||""}}o.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new Ks(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let n=a,l=i.tokenizer[n],c=s[n];s[n]=(...h)=>{let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new po;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let n=a,l=i.hooks[n],c=s[n];po.passThroughHooks.has(a)?s[n]=h=>{if(this.defaults.async&&po.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(s,h);return c.call(s,f)})();let d=l.call(s,h);return c.call(s,d)}:s[n]=(...h)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,h);return f===!1&&(f=await c.apply(s,h)),f})();let d=l.apply(s,h);return d===!1&&(d=c.apply(s,h)),d}}o.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(n){let l=[];return l.push(a.call(this,n)),s&&(l=l.concat(s.call(this,n))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Fe.lex(t,r??this.defaults)}parser(t,r){return Ae.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let o={...i},s={...this.defaults,...o},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=t),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(r):r,l=await(s.hooks?await s.hooks.provideLexer():t?Fe.lex:Fe.lexInline)(n,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():t?Ae.parse:Ae.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));let n=(s.hooks?s.hooks.provideLexer():t?Fe.lex:Fe.lexInline)(r,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():t?Ae.parse:Ae.parseInline)(n,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(n){return a(n)}}}onError(t,r){return i=>{if(i.message+=`
222
- Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+qe(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},Gr=new U_;function Lt(e,t){return Gr.parse(e,t)}Lt.options=Lt.setOptions=function(e){return Gr.setOptions(e),Lt.defaults=Gr.defaults,ym(Lt.defaults),Lt};Lt.getDefaults=Th;Lt.defaults=Kr;Lt.use=function(...e){return Gr.use(...e),Lt.defaults=Gr.defaults,ym(Lt.defaults),Lt};Lt.walkTokens=function(e,t){return Gr.walkTokens(e,t)};Lt.parseInline=Gr.parseInline;Lt.Parser=Ae;Lt.parser=Ae.parse;Lt.Renderer=Zs;Lt.TextRenderer=$h;Lt.Lexer=Fe;Lt.lexer=Fe.lex;Lt.Tokenizer=Ks;Lt.Hooks=po;Lt.parse=Lt;Lt.options;Lt.setOptions;Lt.use;Lt.walkTokens;Lt.parseInline;Ae.parse;Fe.lex;function Lm(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var o=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var d,f;return(f=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&f!==void 0?f:0})):n},[]);if(o.length){var s=new RegExp(`
222
+ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+qe(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},Gr=new U_;function Lt(e,t){return Gr.parse(e,t)}Lt.options=Lt.setOptions=function(e){return Gr.setOptions(e),Lt.defaults=Gr.defaults,mm(Lt.defaults),Lt};Lt.getDefaults=Th;Lt.defaults=Kr;Lt.use=function(...e){return Gr.use(...e),Lt.defaults=Gr.defaults,mm(Lt.defaults),Lt};Lt.walkTokens=function(e,t){return Gr.walkTokens(e,t)};Lt.parseInline=Gr.parseInline;Lt.Parser=Ae;Lt.parser=Ae.parse;Lt.Renderer=Zs;Lt.TextRenderer=$h;Lt.Lexer=Fe;Lt.lexer=Fe.lex;Lt.Tokenizer=Ks;Lt.Hooks=po;Lt.parse=Lt;Lt.options;Lt.setOptions;Lt.use;Lt.walkTokens;Lt.parseInline;Ae.parse;Fe.lex;function Bm(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=Array.from(typeof e=="string"?[e]:e);i[i.length-1]=i[i.length-1].replace(/\r?\n([\t ]*)$/,"");var o=i.reduce(function(n,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?n.concat(c.map(function(h){var d,f;return(f=(d=h.match(/[\t ]/g))===null||d===void 0?void 0:d.length)!==null&&f!==void 0?f:0})):n},[]);if(o.length){var s=new RegExp(`
223
223
  [ ]{`+Math.min.apply(Math,o)+"}","g");i=i.map(function(n){return n.replace(s,`
224
224
  `)})}i[0]=i[0].replace(/^\r?\n/,"");var a=i[0];return t.forEach(function(n,l){var c=a.match(/(?:^|\n)( *)$/),h=c?c[1]:"",d=n;typeof n=="string"&&n.includes(`
225
225
  `)&&(d=String(n).split(`
226
226
  `).map(function(f,u){return u===0?f:""+h+f}).join(`
227
- `)),a+=d+i[l+1]}),a}function Em(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
227
+ `)),a+=d+i[l+1]}),a}function Lm(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
228
228
  `).replace(/\n{2,}/g,`
229
- `);return Lm(i)}p(Em,"preprocessMarkdown");function Fm(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}p(Fm,"nonMarkdownToLines");function Am(e,t={}){const r=Em(e,t),i=Lt.lexer(r),o=[[]];let s=0;function a(n,l="normal"){n.type==="text"?n.text.split(`
230
- `).forEach((h,d)=>{d!==0&&(s++,o.push([])),h.split(" ").forEach(f=>{f=f.replace(/&#39;/g,"'"),f&&o[s].push({content:f,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].push({content:n.text,type:"normal"})}return p(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}p(Am,"markdownToLines");function Mm(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}p(Mm,"nonMarkdownToHTML");function $m(e,{markdownAutoWrap:t}={}){const r=Lt.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):o.text.replace(/\n */g,"<br/>"):o.type==="strong"?`<strong>${o.tokens?.map(i).join("")}</strong>`:o.type==="em"?`<em>${o.tokens?.map(i).join("")}</em>`:o.type==="paragraph"?`<p>${o.tokens?.map(i).join("")}</p>`:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(V.warn(`Unsupported markdown: ${o.type}`),o.raw)}return p(i,"output"),r.map(i).join("")}p($m,"markdownToHTML");function Om(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p(Om,"splitTextToChars");function Rm(e,t){const r=Om(t.content);return Oh(e,[],r,t.type)}p(Rm,"splitWordToFitWidth");function Oh(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?Oh(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(Oh,"splitWordToFitWidthRecursion");function Im(e,t){if(e.some(({content:r})=>r.includes(`
231
- `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Qs(e,t)}p(Im,"splitLineToFitWidth");function Qs(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(s),t(a))return Qs(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=Rm(t,s);r.push([n]),l.content&&e.unshift(l)}return Qs(e,t,r)}p(Qs,"splitLineToFitWidthRecursion");function ul(e,t){t&&e.attr("style",t)}p(ul,"applyStyle");var sd=16384;async function Pm(e,t,r,i,o=!1,s=Rt()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,sd)}px`),a.attr("height",`${Math.min(10*r,sd)}px`);const n=a.append("xhtml:div"),l=Ii(t.label)?await Dl(t.label.replace(Yi.lineBreakRegex,`
232
- `),s):Se(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),ul(h,t.labelStyle),h.attr("class",`${c} ${i}`),ul(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&n.attr("class","labelBkg");let d=n.node().getBoundingClientRect();return d.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),d=n.node().getBoundingClientRect()),a.node()}p(Pm,"addHtmlSpan");function La(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}p(La,"createTspan");function Dm(e,t,r){const i=e.append("text"),o=La(i,1,t);Ea(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}p(Dm,"computeWidthOfText");function Nm(e,t,r){const i=e.append("text"),o=La(i,1,t);Ea(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}p(Nm,"computeDimensionOfText");function qm(e,t,r,i=!1,o=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=p(u=>Dm(a,1.1,u)<=e,"checkWidth"),f=d(h)?[h]:Im(h,d);for(const u of f){const g=La(l,c,1.1,o);Ea(g,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()}p(qm,"createFormattedText");function fl(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}})}p(fl,"decodeHTMLEntities");function Ea(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(fl(r.content)):o.text(" "+fl(r.content))})}p(Ea,"updateTextContentAndStyles");async function zm(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await h_(n)?await Xi(n,void 0,{class:"label-icon"}):`<i class='${Se(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(zm,"replaceIconSubstring");var Pe=p(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(V.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?$m(t,h):Mm(t),f=await zm(br(d),h),u=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Ii(t)?u:f,labelStyle:r.replace("fill:","color:")};return await Pm(e,g,l,o,c,h)}else{const d=br(t.replace(/<br\s*\/?>/g,"<br/>")),f=a?Am(d.replace("<br>","<br/>"),h):Fm(d),u=qm(l,e,f,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(u).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");yt(u).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(u).select("text").attr("style",m)}return i?yt(u).selectAll("tspan.text-outer-tspan").classed("title-row",!0):yt(u).selectAll("tspan.text-outer-tspan").classed("row",!0),u}},"createText");function on(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*a+o}}}function G_(e,t){return e[0]===t[0]&&e[1]===t[1]}function X_(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)on(c,n,o);const l=(function(c,h,d){const f=[];for(const C of c){const w=[...C];G_(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&f.push(w)}const u=[];h=Math.max(h,.1);const g=[];for(const C of f)for(let w=0;w<C.length-1;w++){const S=C[w],v=C[w+1];if(S[1]!==v[1]){const _=Math.min(S[1],v[1]);g.push({ymin:_,ymax:Math.max(S[1],v[1]),x:_===S[1]?S[0]:v[0],islope:(v[0]-S[0])/(v[1]-S[1])})}}if(g.sort(((C,w)=>C.ymin<w.ymin?-1:C.ymin>w.ymin?1:C.x<w.x?-1:C.x>w.x?1:C.ymax===w.ymax?0:(C.ymax-w.ymax)/Math.abs(C.ymax-w.ymax))),!g.length)return u;let m=[],y=g[0].ymin,x=0;for(;m.length||g.length;){if(g.length){let C=-1;for(let w=0;w<g.length&&!(g[w].ymin>y);w++)C=w;g.splice(0,C+1).forEach((w=>{m.push({s:y,edge:w})}))}if(m=m.filter((C=>!(C.edge.ymax<=y))),m.sort(((C,w)=>C.edge.x===w.edge.x?0:(C.edge.x-w.edge.x)/Math.abs(C.edge.x-w.edge.x))),(d!==1||x%h==0)&&m.length>1)for(let C=0;C<m.length;C+=2){const w=C+1;if(w>=m.length)break;const S=m[C].edge,v=m[w].edge;u.push([[Math.round(S.x),y],[Math.round(v.x),y]])}y+=d,m.forEach((C=>{C.edge.x=C.edge.x+d*C.edge.islope})),x++}return u})(a,s,i);if(o){for(const c of a)on(c,n,-o);(function(c,h,d){const f=[];c.forEach((u=>f.push(...u))),on(f,h,d)})(l,n,-o)}return l}function Uo(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),X_(e,o,i,s||1)}class Rh{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Uo(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function Fa(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 V_ extends Rh{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Uo(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)Fa([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 K_ extends Rh{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class Z_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Uo(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const l=Fa(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,f=(n[0][0]+n[1][0])/2-o/4,u=Math.min(n[0][1],n[1][1]);for(let g=0;g<h;g++){const m=u+d+g*o,y=f-a+2*Math.random()*a,x=m-a+2*Math.random()*a,C=this.helper.ellipse(y,x,s,s,r);i.push(...C.ops)}}return{type:"fillSketch",ops:i}}}class Q_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Uo(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return t.forEach((a=>{const n=Fa(a),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let u=0;u<l;u++){const g=u*(i+o),m=g+i,y=[h[0]+g*Math.cos(f)+c*Math.cos(f),h[1]+g*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)];s.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r))}})),s}}class J_{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,s=Uo(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(s,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((s=>{const a=Fa(s),n=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const f=2*d*r,u=2*(d+1)*r,g=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]+g*Math.cos(h+Math.PI/4),m[1]+g*Math.sin(h+Math.PI/4)];o.push(...this.helper.doubleLineOps(m[0],m[1],x[0],x[1],i),...this.helper.doubleLineOps(x[0],x[1],y[0],y[1],i))}})),o}}const ue={};class tB{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const eB=0,sn=1,ad=2,os={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 an(e,t){return e.type===t}function Ih(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:eB,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:sn,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:ad,text:""},n})(e);let i="BOD",o=0,s=r[o];for(;!an(s,ad);){let a=0;const n=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return Ih("M0,0"+e);o++,a=os[s.text],i=s.text}else an(s,sn)?a=os[i]:(o++,a=os[s.text],i=s.text);if(!(o+a<r.length))throw new Error("Path data ended short");for(let l=o;l<o+a;l++){const c=r[l];if(!an(c,sn))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof os[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),o+=a,s=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function jm(e){let t=0,r=0,i=0,o=0;const s=[];for(const{key:a,data:n}of e)switch(a){case"M":s.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],s.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":s.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],s.push({key:"L",data:[t,r]});break;case"C":s.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function Wm(e){const t=[];let r="",i=0,o=0,s=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[s,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=i+(i-n),f=o+(o-l)):(d=i,f=o),t.push({key:"C",data:[d,f,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,f]=h;let u=0,g=0;r==="Q"||r==="T"?(u=i+(i-n),g=o+(o-l)):(u=i,g=o);const m=i+2*(u-i)/3,y=o+2*(g-o)/3,x=d+2*(u-d)/3,C=f+2*(g-f)/3;t.push({key:"C",data:[m,y,x,C,d,f]}),n=u,l=g,i=d,o=f;break}case"Q":{const[d,f,u,g]=h,m=i+2*(d-i)/3,y=o+2*(f-o)/3,x=u+2*(d-u)/3,C=g+2*(f-g)/3;t.push({key:"C",data:[m,y,x,C,u,g]}),n=d,l=f,i=u,o=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),u=h[2],g=h[3],m=h[4],y=h[5],x=h[6];d===0||f===0?(t.push({key:"C",data:[i,o,y,x,y,x]}),i=y,o=x):(i!==y||o!==x)&&(Hm(i,o,y,x,d,f,u,g,m).forEach((function(C){t.push({key:"C",data:C})})),i=y,o=x);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function so(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,o,s,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let f=[],u=0,g=0,m=0,y=0;if(c)[u,g,m,y]=c;else{[e,t]=so(e,t,-h),[r,i]=so(r,i,-h);const N=(e-r)/2,q=(t-i)/2;let A=N*N/(o*o)+q*q/(s*s);A>1&&(A=Math.sqrt(A),o*=A,s*=A);const $=o*o,O=s*s,F=$*O-$*q*q-O*N*N,R=$*q*q+O*N*N,z=(n===l?-1:1)*Math.sqrt(Math.abs(F/R));m=z*o*q/s+(e+r)/2,y=z*-s*N/o+(t+i)/2,u=Math.asin(parseFloat(((t-y)/s).toFixed(9))),g=Math.asin(parseFloat(((i-y)/s).toFixed(9))),e<m&&(u=Math.PI-u),r<m&&(g=Math.PI-g),u<0&&(u=2*Math.PI+u),g<0&&(g=2*Math.PI+g),l&&u>g&&(u-=2*Math.PI),!l&&g>u&&(g-=2*Math.PI)}let x=g-u;if(Math.abs(x)>120*Math.PI/180){const N=g,q=r,A=i;g=l&&g>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,f=Hm(r=m+o*Math.cos(g),i=y+s*Math.sin(g),q,A,o,s,a,0,l,[g,N,m,y])}x=g-u;const C=Math.cos(u),w=Math.sin(u),S=Math.cos(g),v=Math.sin(g),_=Math.tan(x/4),E=4/3*o*_,B=4/3*s*_,D=[e,t],M=[e+E*w,t-B*C],P=[r+E*v,i-B*S],U=[r,i];if(M[0]=2*D[0]-M[0],M[1]=2*D[1]-M[1],c)return[M,P,U].concat(f);{f=[M,P,U].concat(f);const N=[];for(let q=0;q<f.length;q+=3){const A=so(f[q][0],f[q][1],h),$=so(f[q+1][0],f[q+1][1],h),O=so(f[q+2][0],f[q+2][1],h);N.push([A[0],A[1],$[0],$[1],O[0],O[1]])}return N}}const rB={randOffset:function(e,t){return dt(e,t)},randOffsetWithRange:function(e,t,r){return Js(e,t,r)},ellipse:function(e,t,r,i,o){const s=Um(r,i,o);return gl(e,t,o,s).opset},doubleLineOps:function(e,t,r,i,o){return kr(e,t,r,i,o,!0)}};function Ym(e,t,r,i,o){return{type:"path",ops:kr(e,t,r,i,o)}}function bs(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let s=0;s<i-1;s++)o.push(...kr(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&o.push(...kr(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?Ym(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function iB(e,t,r,i,o){return(function(s,a){return bs(s,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function nd(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=ss(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:ss(r[0],1.5*(1+.22*t.roughness),cd(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const n=ss(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:ss(a,1.5*(1+.22*t.roughness),cd(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function Um(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),s=2*Math.PI/o;let a=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return a+=dt(a*l,r),n+=dt(n*l,r),{increment:s,rx:a,ry:n}}function gl(e,t,r,i){const[o,s]=dd(i.increment,e,t,i.rx,i.ry,1,i.increment*Js(.1,Js(.4,1,r),r),r);let a=ta(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=dd(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=ta(n,null,r);a=a.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function ld(e,t,r,i,o,s,a,n,l){const c=e,h=t;let d=Math.abs(r/2),f=Math.abs(i/2);d+=dt(.01*d,l),f+=dt(.01*f,l);let u=o,g=s;for(;u<0;)u+=2*Math.PI,g+=2*Math.PI;g-u>2*Math.PI&&(u=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-u)/2),x=ud(y,c,h,d,f,u,g,1,l);if(!l.disableMultiStroke){const C=ud(y,c,h,d,f,u,g,1.5,l);x.push(...C)}return a&&(n?x.push(...kr(c,h,c+d*Math.cos(u),h+f*Math.sin(u),l),...kr(c,h,c+d*Math.cos(g),h+f*Math.sin(g),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 hd(e,t){const r=Wm(jm(Ih(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...kr(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,d,f,u]=n;i.push(...oB(l,c,h,d,f,u,s,t)),s=[f,u];break}case"Z":i.push(...kr(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function nn(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+dt(o,t),i[0][1]+dt(o,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[i[a][0]+dt(o,t),i[a][1]+dt(o,t)]})}}return{type:"fillPath",ops:r}}function oi(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!ue[o])switch(o){case"zigzag":ue[o]||(ue[o]=new V_(i));break;case"cross-hatch":ue[o]||(ue[o]=new K_(i));break;case"dots":ue[o]||(ue[o]=new Z_(i));break;case"dashed":ue[o]||(ue[o]=new Q_(i));break;case"zigzag-line":ue[o]||(ue[o]=new J_(i));break;default:o="hachure",ue[o]||(ue[o]=new Rh(i))}return ue[o]})(t,rB).fillPolygons(e,t)}function cd(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Gm(e){return e.randomizer||(e.randomizer=new tB(e.seed||0)),e.randomizer.next()}function Js(e,t,r,i=1){return r.roughness*i*(Gm(r)*(t-e)+e)}function dt(e,t,r=1){return Js(-e,e,t,r)}function kr(e,t,r,i,o,s=!1){const a=s?o.disableMultiStrokeFill:o.disableMultiStroke,n=pl(e,t,r,i,o,!0,!1);if(a)return n;const l=pl(e,t,r,i,o,!0,!0);return n.concat(l)}function pl(e,t,r,i,o,s,a){const n=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,f=.2+.2*Gm(o);let u=o.bowing*o.maxRandomnessOffset*(i-t)/200,g=o.bowing*o.maxRandomnessOffset*(e-r)/200;u=dt(u,o,c),g=dt(g,o,c);const m=[],y=()=>dt(d,o,c),x=()=>dt(h,o,c),C=o.preserveVertices;return a?m.push({op:"move",data:[e+(C?0:y()),t+(C?0:y())]}):m.push({op:"move",data:[e+(C?0:dt(h,o,c)),t+(C?0:dt(h,o,c))]}),a?m.push({op:"bcurveTo",data:[u+e+(r-e)*f+y(),g+t+(i-t)*f+y(),u+e+2*(r-e)*f+y(),g+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(),g+t+(i-t)*f+x(),u+e+2*(r-e)*f+x(),g+t+2*(i-t)*f+x(),r+(C?0:x()),i+(C?0:x())]}),m}function ss(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+dt(t,r),e[0][1]+dt(t,r)]),i.push([e[0][0]+dt(t,r),e[0][1]+dt(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+dt(t,r),e[o][1]+dt(t,r)]),o===e.length-1&&i.push([e[o][0]+dt(t,r),e[o][1]+dt(t,r)]);return ta(i,null,r)}function ta(e,t,r){const i=e.length,o=[];if(i>3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*e[n+1][0]-a*e[n-1][0])/6,l[1]+(a*e[n+1][1]-a*e[n-1][1])/6],s[2]=[e[n+1][0]+(a*e[n][0]-a*e[n+2][0])/6,e[n+1][1]+(a*e[n][1]-a*e[n+2][1])/6],s[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...pl(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function dd(e,t,r,i,o,s,a,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+o*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const h=dt(.5,n)-Math.PI/2;c.push([dt(s,n)+t+.9*i*Math.cos(h-e),dt(s,n)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let f=h;f<d;f+=e){const u=[dt(s,n)+t+i*Math.cos(f),dt(s,n)+r+o*Math.sin(f)];l.push(u),c.push(u)}c.push([dt(s,n)+t+i*Math.cos(h+2*Math.PI+.5*a),dt(s,n)+r+o*Math.sin(h+2*Math.PI+.5*a)]),c.push([dt(s,n)+t+.98*i*Math.cos(h+a),dt(s,n)+r+.98*o*Math.sin(h+a)]),c.push([dt(s,n)+t+.9*i*Math.cos(h+.5*a),dt(s,n)+r+.9*o*Math.sin(h+.5*a)])}return[c,l]}function ud(e,t,r,i,o,s,a,n,l){const c=s+dt(.1,l),h=[];h.push([dt(n,l)+t+.9*i*Math.cos(c-e),dt(n,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([dt(n,l)+t+i*Math.cos(d),dt(n,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),ta(h,null,l)}function oB(e,t,r,i,o,s,a,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,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:dt(c[0],n)),a[1]+(f?0:dt(c[0],n))]}),h=f?[o,s]:[o+dt(c[u],n),s+dt(c[u],n)],l.push({op:"bcurveTo",data:[e+dt(c[u],n),t+dt(c[u],n),r+dt(c[u],n),i+dt(c[u],n),h[0],h[1]]});return l}function ao(e){return[...e]}function fd(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(ao(e[0]),ao(e[1]),ao(e[2]),ao(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const s=[],a=1-t;i.push(ao(o[0]));for(let n=1;n+2<o.length;n++){const l=o[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*o[n+1][0]-a*o[n-1][0])/6,l[1]+(a*o[n+1][1]-a*o[n-1][1])/6],s[2]=[o[n+1][0]+(a*o[n][0]-a*o[n+2][0])/6,o[n+1][1]+(a*o[n][1]-a*o[n+2][1])/6],s[3]=[o[n+1][0],o[n+1][1]],i.push(s[1],s[2],s[3])}}return i}function ks(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function sB(e,t,r){const i=ks(t,r);if(i===0)return ks(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),ks(e,Or(t,r,o))}function Or(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function ml(e,t,r,i){const o=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 g=3*h[1]-2*c[1]-f[1];g*=g;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),g<y&&(g=y),u+g})(e,t)<r){const n=e[t+0];o.length?(s=o[o.length-1],a=n,Math.sqrt(ks(s,a))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],f=Or(l,c,.5),u=Or(c,h,.5),g=Or(h,d,.5),m=Or(f,u,.5),y=Or(u,g,.5),x=Or(m,y,.5);ml([l,f,m,x],0,r,o),ml([x,y,g,d],0,r,o)}var s,a;return o}function aB(e,t){return ea(e,0,e.length,t)}function ea(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=sB(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(ea(e,t,c+1,i,s),ea(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function ln(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s<o;s++)ml(e,3*s,t,i);return r&&r>0?ea(i,0,i.length,r):i}const pe="none";class ra{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,s){const a=this._o(s);return this._d("line",[Ym(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=iB(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(nn([c],a)):n.push(oi([c],a))}return a.stroke!==pe&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],l=Um(i,o,a),c=gl(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=gl(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(oi([c.estimatedPoints],a));return a.stroke!==pe&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[bs(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],d=ld(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const u=ld(t,r,i,o,s,a,!0,!1,f);u.type="fillPath",h.push(u)}else h.push((function(f,u,g,m,y,x,C){const w=f,S=u;let v=Math.abs(g/2),_=Math.abs(m/2);v+=dt(.01*v,C),_+=dt(.01*_,C);let E=y,B=x;for(;E<0;)E+=2*Math.PI,B+=2*Math.PI;B-E>2*Math.PI&&(E=0,B=2*Math.PI);const D=(B-E)/C.curveStepCount,M=[];for(let P=E;P<=B;P+=D)M.push([w+v*Math.cos(P),S+_*Math.sin(P)]);return M.push([w+v*Math.cos(B),S+_*Math.sin(B)]),M.push([w,S]),oi([M],C)})(t,r,i,o,s,a,c));return c.stroke!==pe&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=nd(t,i);if(i.fill&&i.fill!==pe)if(i.fillStyle==="solid"){const a=nd(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...ln(fd([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...ln(fd(c),10,(1+i.roughness)/2))}a.length&&o.push(oi([a],i))}return i.stroke!==pe&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=bs(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(nn([t],i)):o.push(oi([t],i))),i.stroke!==pe&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==pe,a=i.stroke!==pe,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,f){const u=Wm(jm(Ih(h))),g=[];let m=[],y=[0,0],x=[];const C=()=>{x.length>=4&&m.push(...ln(x,d)),x=[]},w=()=>{C(),m.length&&(g.push(m),m=[])};for(const{key:v,data:_}of u)switch(v){case"M":w(),y=[_[0],_[1]],m.push(y);break;case"L":C(),m.push([_[0],_[1]]);break;case"C":if(!x.length){const E=m.length?m[m.length-1]:y;x.push([E[0],E[1]])}x.push([_[0],_[1]]),x.push([_[2],_[3]]),x.push([_[4],_[5]]);break;case"Z":C(),m.push([y[0],y[1]])}if(w(),!f)return g;const S=[];for(const v of g){const _=aB(v,f);_.length&&S.push(_)}return S})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=hd(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=hd(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(nn(l,i));else o.push(oi(l,i));return a&&(n?l.forEach((h=>{o.push(bs(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:pe};break;case"fillPath":a={d:this.opsToPath(s),stroke:pe,strokeWidth:0,fill:i.fill||pe};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||pe,strokeWidth:i,fill:pe}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class nB{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ra(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const as="http://www.w3.org/2000/svg";class lB{constructor(t,r){this.svg=t,this.gen=new ra(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(as,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(as,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(as,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(as,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var rt={canvas:(e,t)=>new nB(e,t),svg:(e,t)=>new lB(e,t),generator:e=>new ra(e),newSeed:()=>ra.newSeed()},lt=p(async(e,t,r)=>{let i;const o=t.useHtmlLabels||Ve(kt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Vt(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 Pe(a,Se(br(n),kt()),{useHtmlLabels:o,width:t.width||kt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},kt());let d=h.getBBox();const f=(t?.padding??0)/2;if(o){const u=h.children[0],g=yt(h);await vh(u,n),d=u.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return o?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:a}},"labelHelper"),hn=p(async(e,t,r)=>{const i=r.useHtmlLabels??ae(kt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Pe(o,Se(br(t),kt()),{useHtmlLabels:i,width:r.width||kt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const n=r.padding/2;if(ae(kt())){const l=s.children[0],c=yt(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):o.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:o}},"insertLabel"),ot=p((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),nt=p((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function bt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}p(bt,"createPathFromPoints");function wr(e,t,r,i,o,s){const a=[],l=r-e,c=i-t,h=l/s,d=2*Math.PI/h,f=t+c/2;for(let u=0;u<=50;u++){const g=u/50,m=e+g*l,y=f+o*Math.sin(d*(m-e));a.push({x:m,y})}return a}p(wr,"generateFullSineWavePoints");function Ro(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(Ro,"generateCirclePoints");function yl(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),s=t.find(l=>l.getAttribute("stroke")!=="none"),a=p((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}p(yl,"mergePaths");var hB=p((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),l=s===0?0:n*o/s,c=n):(o<0&&(a=-a),l=a,c=o===0?0:a*s/o),{x:r+l,y:i+c}},"intersectRect"),Zr=hB,cB=p(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=kt(),n=ae(a);return await Pe(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),gr=cB,Sr=p((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),dB=p(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,n=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=it(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=Ve(r.flowchart.htmlLabels),g=t.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Pe(m,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let x=y.getBBox();if(u){const N=y.children[0],q=yt(y);x=N.getBoundingClientRect(),q.attr("width",x.width),q.attr("height",x.height)}const C=t.padding??0,w=t.width<=x.width+C?x.width+C:t.width;t.width<=x.width+C?t.diff=(w-t.width)/2-C:t.diff=-C;const S=t.height,v=t.y-S/2,_=t.y+S/2,E=t.x-w/2,B=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:v+S/3,D=g?4:0,M=x.height+2*D;let P,U;if(g){const N=Math.max(M,x.height+2*D),q=E+N,A=Math.max(0,w-N);if(t.look==="handDrawn"){const F=rt.svg(f),R=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),z=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),T=F.rectangle(E,v,N,S,R);P=f.insert(()=>T,":first-child");const W=F.rectangle(q,v,A,S,z);U=f.insert(()=>W,":first-child"),P.select("path:nth-child(2)").attr("style",h.join(";")),P.select("path").attr("style",d.join(";").replace("fill","stroke"))}else P=f.insert("rect",":first-child"),U=f.insert("rect",":first-child"),P.attr("class","swimlane-title").attr("style",c).attr("x",E).attr("y",v).attr("width",N).attr("height",S).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",q).attr("y",v).attr("width",A).attr("height",S).attr("fill","none").attr("stroke",n);const $=E+N/2,O=t.y;m.attr("transform",`translate(${$}, ${O}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{const N=Math.max(0,B-v),q=Math.min(M,N),A=v+q,$=Math.max(0,_-A),O=t.x-w/2;if(t.look==="handDrawn"){const z=rt.svg(f),T=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),W=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),j=z.rectangle(O,v,w,q,T);P=f.insert(()=>j,":first-child");const G=z.rectangle(O,A,w,$,W);U=f.insert(()=>G,":first-child"),P.select("path:nth-child(2)").attr("style",h.join(";")),P.select("path").attr("style",d.join(";").replace("fill","stroke"))}else P=f.insert("rect",":first-child"),U=f.insert("rect",":first-child"),P.attr("class","swimlane-title").attr("style",c).attr("x",O).attr("y",v).attr("width",w).attr("height",q).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",O).attr("y",A).attr("width",w).attr("height",$).attr("fill","none").attr("stroke",n);const F=t.x-x.width/2,R=v+(q-x.height)/2;m.attr("transform",`translate(${F}, ${R})`)}if(V.trace("Swimlane data ",t,JSON.stringify(t)),l){const N=m.select("span");N&&N.attr("style",l)}return t.offsetX=0,t.width=w,t.height=S,t.offsetY=x.height-C/2,t.intersect=function(N){return Zr(t,N)},{cluster:f,labelBBox:x}},"swimlane"),Xm=p(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=it(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ae(r),u=d.insert("g").attr("class","cluster-label ");let g;t.labelType==="markdown"?g=await Pe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):g=await gr(u,t.label,t.labelStyle||"",!1,!0);let m=g.getBBox();if(ae(r)){const E=g.children[0],B=yt(g);m=E.getBoundingClientRect(),B.attr("width",m.width),B.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,w=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),D=E.path(Sr(C,w,y,x,0),B);S=d.insert(()=>(V.debug("Rough node insert CXC",D),D),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",w).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:v}=Ta(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=u.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Zr(t,E)},{cluster:d,labelBBox:m}},"rect"),uB=p((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return Zr(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),fB=p(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const u=await gr(d,t.label,t.labelStyle,void 0,!0);let g=u.getBBox();if(ae(r)){const D=u.children[0],M=yt(u);g=D.getBoundingClientRect(),M.attr("width",g.width),M.attr("height",g.height)}const m=0*t.padding,y=m/2,x=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+m;t.width<=g.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height+m,w=t.height+m-g.height-6,S=t.x-x/2,v=t.y-C/2;t.width=x;const _=t.y-t.height/2-y+g.height+2;let E;if(t.look==="handDrawn"){const D=t.cssClasses.includes("statediagram-cluster-alt"),M=rt.svg(c),P=t.rx||t.ry?M.path(Sr(S,v,x,C,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):M.rectangle(S,v,x,C,{seed:o});E=c.insert(()=>P,":first-child");const U=M.rectangle(S,_,x,w,{fill:D?s:a,fillStyle:D?"hachure":"solid",stroke:l,seed:o});E=c.insert(()=>P,":first-child"),f=c.insert(()=>U)}else E=h.insert("rect",":first-child"),E.attr("class","outer").attr("x",S).attr("y",v).attr("width",x).attr("height",C).attr("data-look",t.look),f.attr("class","inner").attr("x",S).attr("y",_).attr("width",x).attr("height",w);d.attr("transform",`translate(${t.x-g.width/2}, ${v+1-(ae(r)?0:3)})`);const B=E.node().getBBox();return t.height=B.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(D){return Zr(t,D)},{cluster:c,labelBBox:g}},"roundedWithTitle"),gB=p(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=it(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ae(r),u=d.insert("g").attr("class","cluster-label "),g=await Pe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=g.getBBox();if(ae(r)){const E=g.children[0],B=yt(g);m=E.getBoundingClientRect(),B.attr("width",m.width),B.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,w=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),D=E.path(Sr(C,w,y,x,t.rx),B);S=d.insert(()=>(V.debug("Rough node insert CXC",D),D),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",w).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:v}=Ta(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=u.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Zr(t,E)},{cluster:d,labelBBox:m}},"kanbanSection"),pB=p((e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,d=t.x-c/2,f=t.y-h/2;t.width=c;let u;if(t.look==="handDrawn"){const y=rt.svg(a).rectangle(d,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});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 g=u.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Zr(t,m)},{cluster:a,labelBBox:{}}},"divider"),mB=Xm,yB={rect:Xm,squareRect:mB,roundedWithTitle:fB,noteGroup:uB,divider:pB,kanbanSection:gB,swimlane:dB},Vm=new Map,Km=p(async(e,t)=>{const r=t.shape||"rect",i=await yB[r](e,t);return Vm.set(t.id,i),i},"insertCluster"),xB=p(()=>{Vm=new Map},"clear");function Zm(e,t){return e.intersect(t)}p(Zm,"intersectNode");var CB=Zm;function Qm(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x<o&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<s&&(h=-h),{x:o+c,y:s+h}}p(Qm,"intersectEllipse");var Jm=Qm;function ty(e,t,r){return Jm(e,t,t,r)}p(ty,"intersectCircle");var bB=ty;function ey(e,t,r,i){{const o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,n=o*r.x+s*r.y+a,l=o*i.x+s*i.y+a,c=1e-6;if(n!==0&&l!==0&&xl(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,g=h*t.x+d*t.y+f;if(Math.abs(u)<c&&Math.abs(g)<c&&xl(u,g))return;const m=o*d-h*s;if(m===0)return;const y=Math.abs(m/2);let x=s*f-d*a;const C=x<0?(x-y)/m:(x+y)/m;x=h*a-o*f;const w=x<0?(x-y)/m:(x+y)/m;return{x:C,y:w}}}p(ey,"intersectLine");function xl(e,t){return e*t>0}p(xl,"sameSign");var kB=ey;function ry(e,t,r){let i=e.x,o=e.y,s=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=i-e.width/2-a,c=o-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],f=t[h<t.length-1?h+1:0],u=kB(e,r,{x:l+d.x,y:c+d.y},{x:l+f.x,y:c+f.y});u&&s.push(u)}return s.length?(s.length>1&&s.sort(function(h,d){let f=h.x-r.x,u=h.y-r.y,g=Math.sqrt(f*f+u*u),m=d.x-r.x,y=d.y-r.y,x=Math.sqrt(m*m+y*y);return g<x?-1:g===x?0:1}),s[0]):e}p(ry,"intersectPolygon");var wB=ry,tt={node:CB,circle:bB,ellipse:Jm,polygon:wB,rect:Zr};function iy(e,t){const{labelStyles:r}=it(t);t.labelStyle=r;const i=nt(t);let o=i;i||(o="anchor");const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,l=rt.svg(s),c=et(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,a*2,c),d=s.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Vt(n)),ot(t,d),t.intersect=function(f){return V.info("Circle intersect",t,a,f),tt.circle(t,a,f)},s}p(iy,"anchor");function Cl(e,t,r,i,o,s,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,f=(i-t)/2,u=d/o,g=f/s,m=Math.sqrt(u**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),x=l+y*s*Math.sin(h)*(a?-1:1),C=c-y*o*Math.cos(h)*(a?-1:1),w=Math.atan2((t-C)/s,(e-x)/o);let v=Math.atan2((i-C)/s,(r-x)/o)-w;a&&v<0&&(v+=2*Math.PI),!a&&v>0&&(v-=2*Math.PI);const _=[];for(let E=0;E<20;E++){const B=E/19,D=w+B*v,M=x+o*Math.cos(D),P=C+s*Math.sin(D);_.push({x:M,y:P})}return _}p(Cl,"generateArcPoints");function oy(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}p(oy,"calculateArcSagitta");async function sy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=p(D=>D+a,"calcTotalHeight"),l=p(D=>{const M=D/2;return[M/(2.5+D/50),M]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=n(t?.height?t?.height:h.height),[f,u]=l(d),g=oy(d,f,u),y=(t?.width?t?.width:h.width)+s*2+g-g,x=d,{cssStyles:C}=t,w=[{x:y/2,y:-x/2},{x:-y/2,y:-x/2},...Cl(-y/2,-x/2,-y/2,x/2,f,u,!1),{x:y/2,y:x/2},...Cl(y/2,x/2,y/2,-x/2,f,u,!0)],S=rt.svg(c),v=et(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=bt(w),E=S.path(_,v),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${f/2}, 0)`),ot(t,B),t.intersect=function(D){return tt.polygon(t,w,D)},c}p(sy,"bowTieRect");function lr(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}p(lr,"insertPolygonShape");var ns=12;async function ay(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+ns),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,f=c,u=-h,g=0,m=[{x:d+ns,y:u},{x:f,y:u},{x:f,y:g},{x:d,y:g},{x:d,y:u+ns},{x:d+ns,y:u}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(n),w=et(t,{}),S=bt(m),v=C.path(S,w);y=n.insert(()=>v,":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}p(ay,"card");function ny(e,t){const{nodeStyles:r}=it(t);t.label="";const i=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=rt.svg(i),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=bt(a),h=n.path(c,l),d=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return tt.polygon(t,a,f)},i}p(ny,"choice");async function Ph(e,t,r){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await lt(e,t,nt(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(s),g=et(t,{}),m=u.circle(0,0,h*2,g);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Vt(f))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return ot(t,d),t.calcIntersect=function(u,g){const m=u.width/2;return tt.circle(u,m,g)},t.intersect=function(u){return V.info("Circle intersect",t,h,u),tt.circle(t,h,u)},s}p(Ph,"circle");function ly(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y}
233
- M ${o.x},${o.y} L ${a.x},${a.y}`}p(ly,"createLine");function hy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=rt.svg(o),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=ly(s),d=n.path(h,l),f=o.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:s,point:u}),tt.circle(t,s,u)},o}p(hy,"crossedCircle");function tr(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(tr,"generateCirclePoints");async function cy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,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=s.width+n,h=s.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)],g=[{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=rt.svg(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(u).replace("Z",""),w=m.path(C,y),S=bt(g),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>w,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,_),t.intersect=function(E){return tt.polygon(t,g,E)},o}p(cy,"curlyBraceLeft");function er(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:u,y:g})}return a}p(er,"generateCirclePoints");async function dy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,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=s.width+(t.look==="neo"?n*2:n),h=s.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)],g=[{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=rt.svg(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(u).replace("Z",""),w=m.path(C,y),S=bt(g),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>w,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,_),t.intersect=function(E){return tt.polygon(t,g,E)},o}p(dy,"curlyBraceRight");function Qt(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(Qt,"generateCirclePoints");async function uy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,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=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...Qt(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Qt(c/2+d*2,-d,d,20,-180,-270),...Qt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Qt(c/2,h/2,d,20,0,90)],g=[...Qt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Qt(-c/2-d/2,-d,d,20,0,90),...Qt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Qt(-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},...Qt(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Qt(c/2+d*2,-d,d,20,-180,-270),...Qt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Qt(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},...Qt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Qt(-c/2-d/2,-d,d,20,0,90),...Qt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Qt(-c/2+d+d/2,h/2,d,30,-180,-270)],y=rt.svg(o),x=et(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=bt(u).replace("Z",""),S=y.path(w,x),_=bt(g).replace("Z",""),E=y.path(_,x),B=bt(m),D=y.path(B,{...x}),M=o.insert("g",":first-child");return M.insert(()=>D,":first-child").attr("stroke-opacity",0),M.insert(()=>S,":first-child"),M.insert(()=>E,":first-child"),M.attr("class","text"),f&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),M.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,M),t.intersect=function(P){return tt.polygon(t,m,P)},o}p(uy,"curlyBraces");async function fy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=Math.max(n,(h.width+s*2)*1.25,t?.width??0),f=Math.max(l,h.height+a*2,t?.height??0),u=f/2,{cssStyles:g}=t,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=d,C=f,w=x-u,S=C/4,v=[{x:w,y:0},{x:S,y:0},{x:0,y:C/2},{x:S,y:C},{x:w,y:C},...Ro(-w,-C/2,u,50,270,90)],_=bt(v),E=m.path(_,y),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.attr("transform",`translate(${-d/2}, ${-f/2})`),ot(t,B),t.intersect=function(D){return tt.polygon(t,v,D)},c}p(fy,"curvedTrapezoid");var SB=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),vB=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),TB=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),gd=8,pd=8;async function gy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.width<pd&&(t.width=pd);const C=y/2/(2.5+y/50);t.height=(t.height??0)-s-C*3,t.height<gd&&(t.height=gd)}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)+s+f;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=rt.svg(n),x=vB(0,0,h,u,d,f),C=TB(0,f,h,u,d,f),w=et(t,{}),S=y.path(x,w),v=y.path(C,et(t,{fill:"none"}));g=n.insert(()=>v,":first-child"),g=n.insert(()=>S,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=SB(0,0,h,u,d,f);g=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Vt(m)).attr("style",i)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),ot(t,g),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 w=f*f*(1-C*C/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,y.y-(t.y??0)>0&&(w=-w),x.y+=w}return x},n}p(gy,"cylinder");async function Vi(e,t,r){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i;const{shapeSvg:s,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:g}=t;if(r?.rx&&r.ry&&(f=r.rx,u=r.ry),t.look==="handDrawn"){const m=rt.svg(s),y=et(t,{}),x=f||u?m.path(Sr(c,h,n,l,f||0),y):m.rectangle(c,h,n,l,y);d=s.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",Vt(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Vt(f)).attr("ry",Vt(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)},s}p(Vi,"drawRect");async function py(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await Vi(e,t,l);if(t.look==="handDrawn"){const u=rt.svg(c),g=et(t,{}),m=c.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return c;let x=null;if(y instanceof SVGGraphicsElement)x=y.getBBox();else return c;return c.insert(()=>u.line(x.x,x.y,x.x+x.width,x.y,g),".basic.label-container g.label"),c.insert(()=>u.line(x.x,x.y+x.height,x.x+x.width,x.y+x.height,g),".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}p(py,"datastore");async function my(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=n.width+o,h=n.height+s,d=h*.2,f=-c/2,u=-h/2-d/2,{cssStyles:g}=t,m=rt.svg(a),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:f,y:u+d},{x:-f,y:u+d},{x:-f,y:-u},{x:f,y:-u},{x:f,y:u},{x:-f,y:u},{x:-f,y:u+d}],C=m.polygon(x.map(S=>[S.x,S.y]),y),w=a.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&w.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,w),t.intersect=function(S){return tt.rect(t,S)},a}p(my,"dividedRectangle");async function yy(e,t){const{labelStyles:r,nodeStyles:i}=it(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(n),g=et(t,{roughness:.2,strokeWidth:2.5}),m=et(t,{roughness:.2,strokeWidth:1.5}),y=u.circle(0,0,c*2,g),x=u.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",Vt(t.cssClasses)).attr("style",Vt(f)),d.node()?.appendChild(y),d.node()?.appendChild(x)}else{d=n.insert("g",":first-child");const u=d.insert("circle",":first-child"),g=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),g.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}p(yy,"doublecircle");function xy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=it(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=rt.svg(s),{nodeBorder:c}=r,h=et(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=s.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),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),ot(t,f),t.intersect=function(u){return V.info("filledCircle intersect",t,{radius:a,point:u}),tt.circle(t,a,u)},s}p(xy,"filledCircle");var md=10,yd=10;async function Cy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<md&&(t.height=md),t.width=(t?.width??0)-s-s/2,t.width<yd&&(t.width=yd));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:n.width)+(s??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,g=rt.svg(a),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=bt(f),x=g.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(w){return V.info("Triangle intersect",t,f,w),tt.polygon(t,f,w)},a}p(Cy,"flippedTriangle");function by(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=it(t);t.label="";const a=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,f=rt.svg(a),u=et(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const g=f.rectangle(h,d,l,c,u),m=a.insert(()=>g,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),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}p(by,"forkJoin");async function ky(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=15,s=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<s&&(t.height=s),t.width=(t?.width??0)-a*2,t.width<o&&(t.width=o));const{shapeSvg:l,bbox:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:Math.max(o,c.width))+a*2,d=(t?.height?t?.height:Math.max(s,c.height))+n*2,f=d/2,{cssStyles:u}=t,g=rt.svg(l),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2,y:-d/2},{x:h/2-f,y:-d/2},...Ro(-h/2+f,0,f,50,90,270),{x:h/2-f,y:d/2},{x:-h/2,y:d/2}],x=bt(y),C=g.path(x,m),w=l.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),ot(t,w),t.intersect=function(S){return V.info("Pill intersect",t,{radius:f,point:S}),tt.polygon(t,y,S)},l}p(ky,"halfRoundedRectangle");var _B=p((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function wy(e,t){const{labelStyles:r,nodeStyles:i}=it(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,l=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const w=(t.height??0)/o;t.width=(t?.width??0)-2*w-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/o,g=(t?.width?t?.width:d.width)+2*u+c,m=[{x:u,y:0},{x:g-u,y:0},{x:g,y:-f/2},{x:g-u,y:-f},{x:u,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(h),w=et(t,{}),S=_B(0,0,g,f,u),v=C.path(S,w);y=h.insert(()=>v,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),x&&y.attr("style",x)}else y=lr(h,g,f,m);return i&&y.attr("style",i),t.width=g,t.height=f,ot(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},h}p(wy,"hexagon");async function Sy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await lt(e,t,nt(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=rt.svg(o),c=et(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=bt(h),f=l.path(d,c),u=o.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(${-s/2}, ${-a/2})`),ot(t,u),t.intersect=function(g){return V.info("Pill intersect",t,{points:h}),tt.polygon(t,h,g)},o}p(Sy,"hourglass");async function vy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await lt(e,t,"icon-shape default"),f=t.pos==="t",u=n,g=n,{nodeBorder:m}=r,{stylesMap:y}=Gi(t),x=-g/2,C=-u/2,w=t.label?8:0,S=rt.svg(c),v=et(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=S.rectangle(x,C,g,u,v),E=Math.max(g,h.width),B=u+h.height+w,D=S.rectangle(-E/2,-B/2,E,B,{...v,fill:"transparent",stroke:"none"}),M=c.insert(()=>_,":first-child"),P=c.insert(()=>D);if(t.icon){const U=c.append("g");U.html(`<g>${await Xi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const N=U.node().getBBox(),q=N.width,A=N.height,$=N.x,O=N.y;U.attr("transform",`translate(${-q/2-$},${f?h.height/2+w/2-A/2-O:-h.height/2-w/2-A/2-O})`),U.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-B/2:B/2-h.height})`),M.attr("transform",`translate(0,${f?h.height/2+w/2:-h.height/2-w/2})`),ot(t,P),t.intersect=function(U){if(V.info("iconSquare intersect",t,U),!t.label)return tt.rect(t,U);const N=t.x??0,q=t.y??0,A=t.height??0;let $=[];return f?$=[{x:N-h.width/2,y:q-A/2},{x:N+h.width/2,y:q-A/2},{x:N+h.width/2,y:q-A/2+h.height+w},{x:N+g/2,y:q-A/2+h.height+w},{x:N+g/2,y:q+A/2},{x:N-g/2,y:q+A/2},{x:N-g/2,y:q-A/2+h.height+w},{x:N-h.width/2,y:q-A/2+h.height+w}]:$=[{x:N-g/2,y:q-A/2},{x:N+g/2,y:q-A/2},{x:N+g/2,y:q-A/2+u},{x:N+h.width/2,y:q-A/2+u},{x:N+h.width/2/2,y:q+A/2},{x:N-h.width/2,y:q+A/2},{x:N-h.width/2,y:q-A/2+u},{x:N-g/2,y:q-A/2+u}],tt.polygon(t,$,U)},c}p(vy,"icon");async function Ty(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await lt(e,t,"icon-shape default"),f=20,u=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Gi(t),C=rt.svg(c),w=et(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=x.get("fill");w.stroke=S??y;const v=c.append("g");t.icon&&v.html(`<g>${await Xi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const _=v.node().getBBox(),E=_.width,B=_.height,D=_.x,M=_.y,P=Math.max(E,B)*Math.SQRT2+f*2,U=C.circle(0,0,P,w),N=Math.max(P,h.width),q=P+h.height+u,A=C.rectangle(-N/2,-q/2,N,q,{...w,fill:"transparent",stroke:"none"}),$=c.insert(()=>U,":first-child"),O=c.insert(()=>A);return v.attr("transform",`translate(${-E/2-D},${g?h.height/2+u/2-B/2-M:-h.height/2-u/2-B/2-M})`),v.attr("style",`color: ${x.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-q/2:q/2-h.height})`),$.attr("transform",`translate(0,${g?h.height/2+u/2:-h.height/2-u/2})`),ot(t,O),t.intersect=function(F){return V.info("iconSquare intersect",t,F),tt.rect(t,F)},c}p(Ty,"iconCircle");async function _y(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await lt(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Gi(t),w=-m/2,S=-g/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const D=_.path(Sr(w,S,m,g,5),E),M=Math.max(m,h.width),P=g+h.height+v,U=_.rectangle(-M/2,-P/2,M,P,{...E,fill:"transparent",stroke:"none"}),N=c.insert(()=>D,":first-child").attr("class","icon-shape2"),q=c.insert(()=>U);if(t.icon){const A=c.append("g");A.html(`<g>${await Xi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const $=A.node().getBBox(),O=$.width,F=$.height,R=$.x,z=$.y;A.attr("transform",`translate(${-O/2-R},${u?h.height/2+v/2-F/2-z:-h.height/2-v/2-F/2-z})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-P/2:P/2-h.height})`),N.attr("transform",`translate(0,${u?h.height/2+v/2:-h.height/2-v/2})`),ot(t,q),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const $=t.x??0,O=t.y??0,F=t.height??0;let R=[];return u?R=[{x:$-h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2+h.height+v},{x:$+m/2,y:O-F/2+h.height+v},{x:$+m/2,y:O+F/2},{x:$-m/2,y:O+F/2},{x:$-m/2,y:O-F/2+h.height+v},{x:$-h.width/2,y:O-F/2+h.height+v}]:R=[{x:$-m/2,y:O-F/2},{x:$+m/2,y:O-F/2},{x:$+m/2,y:O-F/2+g},{x:$+h.width/2,y:O-F/2+g},{x:$+h.width/2/2,y:O+F/2},{x:$-h.width/2,y:O+F/2},{x:$-h.width/2,y:O-F/2+g},{x:$-m/2,y:O-F/2+g}],tt.polygon(t,R,A)},c}p(_y,"iconRounded");async function By(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await lt(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Gi(t),w=-m/2,S=-g/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const D=_.path(Sr(w,S,m,g,.1),E),M=Math.max(m,h.width),P=g+h.height+v,U=_.rectangle(-M/2,-P/2,M,P,{...E,fill:"transparent",stroke:"none"}),N=c.insert(()=>D,":first-child"),q=c.insert(()=>U);if(t.icon){const A=c.append("g");A.html(`<g>${await Xi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const $=A.node().getBBox(),O=$.width,F=$.height,R=$.x,z=$.y;A.attr("transform",`translate(${-O/2-R},${u?h.height/2+v/2-F/2-z:-h.height/2-v/2-F/2-z})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-P/2:P/2-h.height})`),N.attr("transform",`translate(0,${u?h.height/2+v/2:-h.height/2-v/2})`),ot(t,q),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const $=t.x??0,O=t.y??0,F=t.height??0;let R=[];return u?R=[{x:$-h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2+h.height+v},{x:$+m/2,y:O-F/2+h.height+v},{x:$+m/2,y:O+F/2},{x:$-m/2,y:O+F/2},{x:$-m/2,y:O-F/2+h.height+v},{x:$-h.width/2,y:O-F/2+h.height+v}]:R=[{x:$-m/2,y:O-F/2},{x:$+m/2,y:O-F/2},{x:$+m/2,y:O-F/2+g},{x:$+h.width/2,y:O-F/2+g},{x:$+h.width/2/2,y:O+F/2},{x:$-h.width/2,y:O+F/2},{x:$-h.width/2,y:O-F/2+g},{x:$-m/2,y:O-F/2+g}],tt.polygon(t,R,A)},c}p(By,"iconSquare");async function Ly(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=it(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:f,label:u}=await lt(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,y=-h/2,x=t.label?8:0,C=rt.svg(d),w=et(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=C.rectangle(m,y,c,h,w),v=Math.max(c,f.width),_=h+f.height+x,E=C.rectangle(-v/2,-_/2,v,_,{...w,fill:"none",stroke:"none"}),B=d.insert(()=>S,":first-child"),D=d.insert(()=>E);if(t.img){const M=d.append("image");M.attr("href",t.img),M.attr("width",c),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-c/2},${g?_/2-h:-_/2})`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-x/2:h/2-f.height/2+x/2})`),B.attr("transform",`translate(0,${g?f.height/2+x/2:-f.height/2-x/2})`),ot(t,D),t.intersect=function(M){if(V.info("iconSquare intersect",t,M),!t.label)return tt.rect(t,M);const P=t.x??0,U=t.y??0,N=t.height??0;let q=[];return g?q=[{x:P-f.width/2,y:U-N/2},{x:P+f.width/2,y:U-N/2},{x:P+f.width/2,y:U-N/2+f.height+x},{x:P+c/2,y:U-N/2+f.height+x},{x:P+c/2,y:U+N/2},{x:P-c/2,y:U+N/2},{x:P-c/2,y:U-N/2+f.height+x},{x:P-f.width/2,y:U-N/2+f.height+x}]:q=[{x:P-c/2,y:U-N/2},{x:P+c/2,y:U-N/2},{x:P+c/2,y:U-N/2+h},{x:P+f.width/2,y:U-N/2+h},{x:P+f.width/2/2,y:U+N/2},{x:P-f.width/2,y:U+N/2},{x:P-f.width/2,y:U-N/2+h},{x:P-c/2,y:U-N/2+h}],tt.polygon(t,q,M)},d}p(Ly,"imageSquare");async function Ey(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{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+(s??0)*2,t?.height??0),d=[{x:0,y:0},{x:c,y:0},{x:c+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.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(g){return tt.polygon(t,d,g)},n}p(Ey,"inv_trapezoid");async function Fy(e,t){const{shapeSvg:r,bbox:i,label:o}=await lt(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),ot(t,s),t.intersect=function(l){return tt.rect(t,l)},r}p(Fy,"labelRect");async function Ay(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.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(g){return tt.polygon(t,d,g)},n}p(Ay,"lean_left");async function My(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.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(g){return tt.polygon(t,d,g)},n}p(My,"lean_right");function $y(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=rt.svg(o),d=et(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=bt(c),u=h.path(f,d),g=o.insert(()=>u,":first-child");return g.attr("class","outer-path"),s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${a/2},${-n})`),ot(t,g),t.intersect=function(m){return V.info("lightningBolt intersect",t,m),tt.polygon(t,c,m)},o}p($y,"lightningBolt");var BB=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),LB=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),EB=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),xd=10,Cd=10;async function Oy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const x=t.width??0;t.width=(t.width??0)-s,t.width<Cd&&(t.width=Cd);const w=x/2/(2.5+x/50);t.height=(t.height??0)-a-w*3,t.height<xd&&(t.height=xd)}const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+s*2,d=h/2,f=d/(2.5+h/50),u=(t?.height?t?.height:l.height)+f+a*2,g=u*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=rt.svg(n),C=LB(0,0,h,u,d,f,g),w=EB(0,f,h,u,d,f),S=et(t,{}),v=x.path(C,S),_=x.path(w,S);n.insert(()=>_,":first-child").attr("class","line"),m=n.insert(()=>v,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=BB(0,0,h,u,d,f,g);m=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",Vt(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),w=C.x-(t.x??0);if(d!=0&&(Math.abs(w)<(t.width??0)/2||Math.abs(w)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-f)){let S=f*f*(1-w*w/(d*d));S>0&&(S=Math.sqrt(S)),S=f-S,x.y-(t.y??0)>0&&(S=-S),C.y+=S}return C},n}p(Oy,"linedCylinder");async function Ry(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const S=t.width;t.width=(S??0)*10/11-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+(s??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,f=t.look==="neo"?d/4:d/8,u=d+f,{cssStyles:g}=t,m=rt.svg(n),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...wr(-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(S=>[S.x,S.y]),y),w=n.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),w.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,w),t.intersect=function(S){return tt.polygon(t,x,S)},n}p(Ry,"linedWaveEdgedRect");async function Iy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,f=(t?.height?t?.height:c.height)+a*2+2*n,u=d-2*n,g=f-2*n,m=-u/2,y=-g/2,{cssStyles:x}=t,C=rt.svg(l),w=et(t,{}),S=[{x:m-n,y:y+n},{x:m-n,y:y+g+n},{x:m+u-n,y:y+g+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y:y+g-n},{x:m+u+n,y:y+g-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}],v=[{x:m,y:y+n},{x:m+u-n,y:y+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y},{x:m,y}];t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const _=bt(S);let E=C.path(_,w);const B=bt(v);let D=C.path(B,w);t.look!=="handDrawn"&&(E=yl(E),D=yl(D));const M=l.insert("g",":first-child");return M.insert(()=>E),M.insert(()=>D),M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),ot(t,M),t.intersect=function(P){return tt.polygon(t,S,P)},l}p(Iy,"multiRect");async function Py(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,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(s.width,t?.width??0)+l*2,f=Math.max(s.height,t?.height??0)+c*3,u=t.look==="neo"?f/4:f/8,g=f+(h?u/2:-u/2),m=-d/2,y=-g/2,x=10,{cssStyles:C}=t,w=wr(m-x,y+g+x,m+d-x,y+g+x,u,.8),S=w?.[w.length-1],v=[{x:m-x,y:y+x},{x:m-x,y:y+g+x},...w,{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y:S.y-2*x},{x:m+d+x,y:S.y-2*x},{x:m+d+x,y:y-x},{x:m+x,y:y-x},{x:m+x,y},{x:m,y},{x:m,y:y+x}],_=[{x:m,y:y+x},{x:m+d-x,y:y+x},{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y},{x:m,y}],E=rt.svg(o),B=et(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const D=bt(v),M=E.path(D,B),P=bt(_),U=E.path(P,B),N=o.insert(()=>M,":first-child");return N.insert(()=>U),N.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",i),N.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-(s.width/2)-x-(s.x-(s.left??0))}, ${-(s.height/2)+x-u/2-(s.y-(s.top??0))})`),ot(t,N),t.intersect=function(q){return tt.polygon(t,v,q)},o}p(Py,"multiWaveEdgedRectangle");async function Dy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i,t.useHtmlLabels||ae(Rt())||(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,g=rt.svg(a),m=et(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.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),o&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,x),t.intersect=function(C){return tt.rect(t,C)},a}p(Dy,"note");var FB=p((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 Ny(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await lt(e,t,nt(t)),a=s.width+(t.padding??0),n=s.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(o),g=et(t,{}),m=FB(0,0,l),y=u.path(m,g);d=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&d.attr("style",f)}else d=lr(o,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,g){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,g);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(u){return this.calcIntersect(t,u)},o}p(Ny,"question");async function qy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width??l.width)+(t.look==="neo"?s*2:s),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),f=-h/2,u=-d/2,g=u/2,m=[{x:f+g,y:u},{x:f,y:0},{x:f+g,y:-u},{x:-f,y:-u},{x:-f,y:u}],{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=bt(m),S=x.path(w,C),v=n.insert(()=>S,":first-child");return v.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${-g/2},0)`),c.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ot(t,v),t.intersect=function(_){return tt.polygon(t,m,_)},n}p(qy,"rect_left_inv_arrow");async function zy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await gr(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(ae(kt())){const B=h.children[0],D=yt(h);d=B.getBoundingClientRect(),D.attr("width",d.width),D.attr("height",d.height)}V.info("Text 2",l);const f=l||[],u=h.getBBox(),g=await gr(n,Array.isArray(f)?f.join("<br/>"):f,t.labelStyle,!0,!0),m=g.children[0],y=yt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const x=(t.padding||0)/2;yt(g).attr("transform","translate( "+(d.width>u.width?0:(u.width-d.width)/2)+", "+(u.height+x+5)+")"),yt(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),w=d.height+(t.padding||0),S=-d.width/2-x,v=-d.height/2-x;let _,E;if(t.look==="handDrawn"){const B=rt.svg(s),D=et(t,{}),M=B.path(Sr(S,v,C,w,t.rx||0),D),P=B.line(-d.width/2-x,-d.height/2-x+u.height+x,d.width/2+x,-d.height/2-x+u.height+x,D);E=s.insert(()=>(V.debug("Rough node insert CXC",M),P),":first-child"),_=s.insert(()=>(V.debug("Rough node insert CXC",M),M),":first-child")}else _=a.insert("rect",":first-child"),E=a.insert("line"),_.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),E.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+u.height+x).attr("y2",-d.height/2-x+u.height+x);return ot(t,_),t.intersect=function(B){return tt.rect(t,B)},s}p(zy,"rectWithTitle");async function jy(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Vi(e,t,o)}p(jy,"roundedRect");var Fr=8;async function Wy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?Fr:Fr*2),h=(t?.height??n.height)+s*2,d=c-Fr,f=h,u=Fr-c/2,g=-h/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:u,y:g},{x:u+d,y:g},{x:u+d,y:g+f},{x:u-Fr,y:g+f},{x:u-Fr,y:g},{x:u,y:g},{x:u,y:g+f}],w=y.polygon(C.map(v=>[v.x,v.y]),x),S=a.insert(()=>w,":first-child");return S.attr("class","basic label-container outer-path").attr("style",Vt(m)),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${Fr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,S),t.intersect=function(v){return tt.rect(t,v)},a}p(Wy,"shadedProcess");async function Hy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+s*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,f=h,u=d/1.5,g=-f/2,m=-u/2,{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=[{x:g,y:m},{x:g,y:m+u},{x:g+f,y:m+u},{x:g+f,y:m-u/2}],S=bt(w),v=x.path(S,C),_=n.insert(()=>v,":first-child");return _.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(0, ${u/4})`),c.attr("transform",`translate(${-f/2+(t.padding??0)-(l.x-(l.left??0))}, ${-u/4+(t.padding??0)-(l.y-(l.top??0))})`),ot(t,_),t.intersect=function(E){return tt.polygon(t,w,E)},n}p(Hy,"slopedRect");async function Yy(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return Vi(e,t,s)}p(Yy,"squareRect");async function Uy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:f}=t,u=rt.svg(n),g=et(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-c/2},{x:h/2-d,y:-c/2},...Ro(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...Ro(h/2-d,0,d,50,270,450)],y=bt(m),x=u.path(y,g),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(w){return tt.polygon(t,m,w)},n}p(Uy,"stadium");async function Gy(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return Vi(e,t,r)}p(Gy,"state");function Xy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=rt.svg(h),f=et(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const u=d.circle(0,0,t.width,{...f,stroke:a,strokeWidth:2}),g=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),x=h.insert(()=>u,":first-child");if(x.insert(()=>y),t.look!=="handDrawn"&&x.attr("class","outer-path"),s&&x.selectAll("path").attr("style",s),o&&x.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const C=e.node()?.ownerSVGElement?.id??"",w=C?`${C}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${w})`)}return ot(t,x),t.intersect=function(C){return tt.circle(t,(t.width??0)/2,C)},h}p(Xy,"stateEnd");function Vy(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=rt.svg(s).circle(0,0,t.width,fT(i));a=s.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return ot(t,a),t.intersect=function(n){return tt.circle(t,(t.width??7)/2,n)},s}p(Vy,"stateStart");var si=8;async function Ky(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width??l.width)+2*si+s,h=(t?.height??l.height)+a,d=c-2*si,f=h,u=-c/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look==="handDrawn"){const y=rt.svg(n),x=et(t,{}),C=y.rectangle(u,g,d+16,f,x),w=y.line(u+si,g,u+si,g+f,x),S=y.line(u+si+d,g,u+si+d,g+f,x);n.insert(()=>w,":first-child"),n.insert(()=>S,":first-child");const v=n.insert(()=>C,":first-child"),{cssStyles:_}=t;v.attr("class","basic label-container").attr("style",Vt(_)),ot(t,v)}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}p(Ky,"subroutine");var cn=.2;async function Zy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-cn*(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=cn*c,d=cn*c,u=(t?.width?t?.width:l.width)+s*2+h-h,g=c,m=-u/2,y=-g/2,{cssStyles:x}=t,C=rt.svg(n),w=et(t,{}),S=[{x:m-h/2,y},{x:m+u+h/2,y},{x:m+u+h/2,y:y+g},{x:m-h/2,y:y+g}],v=[{x:m+u-h/2,y:y+g},{x:m+u+h/2,y:y+g},{x:m+u+h/2,y:y+g-d}];t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const _=bt(S),E=C.path(_,w),B=bt(v),D=C.path(B,{...w,fillStyle:"solid"}),M=n.insert(()=>D,":first-child");return M.insert(()=>E,":first-child"),M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),ot(t,M),t.intersect=function(P){return tt.polygon(t,S,P)},n}p(Zy,"taggedRect");async function Qy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await lt(e,t,nt(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,f=l+c,{cssStyles:u}=t,g=rt.svg(o),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:f/2},...wr(-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,w=[{x:x+n-h,y:(C+l)*1.3},{x:x+n,y:C+l-d},{x:x+n,y:(C+l)*.9},...wr(x+n,(C+l)*1.25,x+n-h,(C+l)*1.3,-l*.02,.5)],S=bt(y),v=g.path(S,m),_=bt(w),E=g.path(_,{...m,fillStyle:"solid"}),B=o.insert(()=>E,":first-child");return B.insert(()=>v,":first-child"),B.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),ot(t,B),t.intersect=function(D){return tt.polygon(t,y,D)},o}p(Qy,"taggedWaveEdgedRectangle");async function Jy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await lt(e,t,nt(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=o.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),ot(t,h),t.intersect=function(d){return tt.rect(t,d)},o}p(Jy,"text");var AB=p((e,t,r,i,o,s)=>`M${e},${t}
229
+ `);return Bm(i)}p(Lm,"preprocessMarkdown");function Em(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}p(Em,"nonMarkdownToLines");function Fm(e,t={}){const r=Lm(e,t),i=Lt.lexer(r),o=[[]];let s=0;function a(n,l="normal"){n.type==="text"?n.text.split(`
230
+ `).forEach((h,d)=>{d!==0&&(s++,o.push([])),h.split(" ").forEach(f=>{f=f.replace(/&#39;/g,"'"),f&&o[s].push({content:f,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&o[s].push({content:n.text,type:"normal"})}return p(a,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?o[s].push({content:n.text,type:"normal"}):o[s].push({content:n.raw,type:"normal"})}),o}p(Fm,"markdownToLines");function Am(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}p(Am,"nonMarkdownToHTML");function Mm(e,{markdownAutoWrap:t}={}){const r=Lt.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):o.text.replace(/\n */g,"<br/>"):o.type==="strong"?`<strong>${o.tokens?.map(i).join("")}</strong>`:o.type==="em"?`<em>${o.tokens?.map(i).join("")}</em>`:o.type==="paragraph"?`<p>${o.tokens?.map(i).join("")}</p>`:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(V.warn(`Unsupported markdown: ${o.type}`),o.raw)}return p(i,"output"),r.map(i).join("")}p(Mm,"markdownToHTML");function $m(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}p($m,"splitTextToChars");function Om(e,t){const r=$m(t.content);return Oh(e,[],r,t.type)}p(Om,"splitWordToFitWidth");function Oh(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...s]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?Oh(e,a,s,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}p(Oh,"splitWordToFitWidthRecursion");function Rm(e,t){if(e.some(({content:r})=>r.includes(`
231
+ `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Qs(e,t)}p(Rm,"splitLineToFitWidth");function Qs(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const s=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(s),t(a))return Qs(e,t,r,a);if(i.length>0)r.push(i),e.unshift(s);else if(s.content){const[n,l]=Om(t,s);r.push([n]),l.content&&e.unshift(l)}return Qs(e,t,r)}p(Qs,"splitLineToFitWidthRecursion");function ul(e,t){t&&e.attr("style",t)}p(ul,"applyStyle");var sd=16384;async function Im(e,t,r,i,o=!1,s=Rt()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,sd)}px`),a.attr("height",`${Math.min(10*r,sd)}px`);const n=a.append("xhtml:div"),l=Ii(t.label)?await Dl(t.label.replace(Yi.lineBreakRegex,`
232
+ `),s):Se(t.label,s),c=t.isNode?"nodeLabel":"edgeLabel",h=n.append("span");h.html(l),ul(h,t.labelStyle),h.attr("class",`${c} ${i}`),ul(n,t.labelStyle),n.style("display","table-cell"),n.style("white-space","nowrap"),n.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(n.style("max-width",r+"px"),n.style("text-align","center")),n.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&n.attr("class","labelBkg");let d=n.node().getBoundingClientRect();return d.width===r&&(n.style("display","table"),n.style("white-space","break-spaces"),n.style("width",r+"px"),d=n.node().getBoundingClientRect()),a.node()}p(Im,"addHtmlSpan");function La(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}p(La,"createTspan");function Pm(e,t,r){const i=e.append("text"),o=La(i,1,t);Ea(o,r);const s=o.node().getComputedTextLength();return i.remove(),s}p(Pm,"computeWidthOfText");function Dm(e,t,r){const i=e.append("text"),o=La(i,1,t);Ea(o,[{content:r,type:"normal"}]);const s=o.node()?.getBoundingClientRect();return s&&i.remove(),s}p(Dm,"computeDimensionOfText");function Nm(e,t,r,i=!1,o=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=p(u=>Pm(a,1.1,u)<=e,"checkWidth"),f=d(h)?[h]:Rm(h,d);for(const u of f){const g=La(l,c,1.1,o);Ea(g,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()}p(Nm,"createFormattedText");function fl(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}})}p(fl,"decodeHTMLEntities");function Ea(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(fl(r.content)):o.text(" "+fl(r.content))})}p(Ea,"updateTextContentAndStyles");async function qm(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,s,a)=>(r.push((async()=>{const n=`${s}:${a}`;return await h_(n)?await Xi(n,void 0,{class:"label-icon"}):`<i class='${Se(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}p(qm,"replaceIconSubstring");var Pe=p(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:s=!0,markdown:a=!0,isNode:n=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(V.debug("XYZ createText",t,r,i,o,s,n,"addSvgBackground: ",c),s){const d=a?Mm(t,h):Am(t),f=await qm(br(d),h),u=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Ii(t)?u:f,labelStyle:r.replace("fill:","color:")};return await Im(e,g,l,o,c,h)}else{const d=br(t.replace(/<br\s*\/?>/g,"<br/>")),f=a?Fm(d.replace("<br>","<br/>"),h):Em(d),u=Nm(l,e,f,t?c:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(u).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");yt(u).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");yt(u).select("text").attr("style",m)}return i?yt(u).selectAll("tspan.text-outer-tspan").classed("title-row",!0):yt(u).selectAll("tspan.text-outer-tspan").classed("row",!0),u}},"createText");function on(e,t,r){if(e&&e.length){const[i,o]=t,s=Math.PI/180*r,a=Math.cos(s),n=Math.sin(s);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*a+o}}}function G_(e,t){return e[0]===t[0]&&e[1]===t[1]}function X_(e,t,r,i=1){const o=r,s=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of a)on(c,n,o);const l=(function(c,h,d){const f=[];for(const C of c){const w=[...C];G_(w[0],w[w.length-1])||w.push([w[0][0],w[0][1]]),w.length>2&&f.push(w)}const u=[];h=Math.max(h,.1);const g=[];for(const C of f)for(let w=0;w<C.length-1;w++){const S=C[w],v=C[w+1];if(S[1]!==v[1]){const _=Math.min(S[1],v[1]);g.push({ymin:_,ymax:Math.max(S[1],v[1]),x:_===S[1]?S[0]:v[0],islope:(v[0]-S[0])/(v[1]-S[1])})}}if(g.sort(((C,w)=>C.ymin<w.ymin?-1:C.ymin>w.ymin?1:C.x<w.x?-1:C.x>w.x?1:C.ymax===w.ymax?0:(C.ymax-w.ymax)/Math.abs(C.ymax-w.ymax))),!g.length)return u;let m=[],y=g[0].ymin,x=0;for(;m.length||g.length;){if(g.length){let C=-1;for(let w=0;w<g.length&&!(g[w].ymin>y);w++)C=w;g.splice(0,C+1).forEach((w=>{m.push({s:y,edge:w})}))}if(m=m.filter((C=>!(C.edge.ymax<=y))),m.sort(((C,w)=>C.edge.x===w.edge.x?0:(C.edge.x-w.edge.x)/Math.abs(C.edge.x-w.edge.x))),(d!==1||x%h==0)&&m.length>1)for(let C=0;C<m.length;C+=2){const w=C+1;if(w>=m.length)break;const S=m[C].edge,v=m[w].edge;u.push([[Math.round(S.x),y],[Math.round(v.x),y]])}y+=d,m.forEach((C=>{C.edge.x=C.edge.x+d*C.edge.islope})),x++}return u})(a,s,i);if(o){for(const c of a)on(c,n,-o);(function(c,h,d){const f=[];c.forEach((u=>f.push(...u))),on(f,h,d)})(l,n,-o)}return l}function Uo(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let s=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(s=o),X_(e,o,i,s||1)}class Rh{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Uo(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function Fa(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 V_ extends Rh{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Uo(t,Object.assign({},r,{hachureGap:i})),s=Math.PI/180*r.hachureAngle,a=[],n=.5*i*Math.cos(s),l=.5*i*Math.sin(s);for(const[c,h]of o)Fa([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 K_ extends Rh{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),s=this._fillPolygons(t,o);return i.ops=i.ops.concat(s.ops),i}}class Z_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Uo(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const a=o/4;for(const n of t){const l=Fa(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,f=(n[0][0]+n[1][0])/2-o/4,u=Math.min(n[0][1],n[1][1]);for(let g=0;g<h;g++){const m=u+d+g*o,y=f-a+2*Math.random()*a,x=m-a+2*Math.random()*a,C=this.helper.ellipse(y,x,s,s,r);i.push(...C.ops)}}return{type:"fillSketch",ops:i}}}class Q_{constructor(t){this.helper=t}fillPolygons(t,r){const i=Uo(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,s=[];return t.forEach((a=>{const n=Fa(a),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let u=0;u<l;u++){const g=u*(i+o),m=g+i,y=[h[0]+g*Math.cos(f)+c*Math.cos(f),h[1]+g*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)];s.push(...this.helper.doubleLineOps(y[0],y[1],x[0],x[1],r))}})),s}}class J_{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,s=Uo(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(s,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((s=>{const a=Fa(s),n=Math.round(a/(2*r));let l=s[0],c=s[1];l[0]>c[0]&&(l=s[1],c=s[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const f=2*d*r,u=2*(d+1)*r,g=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]+g*Math.cos(h+Math.PI/4),m[1]+g*Math.sin(h+Math.PI/4)];o.push(...this.helper.doubleLineOps(m[0],m[1],x[0],x[1],i),...this.helper.doubleLineOps(x[0],x[1],y[0],y[1],i))}})),o}}const ue={};class tB{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const eB=0,sn=1,ad=2,os={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 an(e,t){return e.type===t}function Ih(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:eB,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:sn,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:ad,text:""},n})(e);let i="BOD",o=0,s=r[o];for(;!an(s,ad);){let a=0;const n=[];if(i==="BOD"){if(s.text!=="M"&&s.text!=="m")return Ih("M0,0"+e);o++,a=os[s.text],i=s.text}else an(s,sn)?a=os[i]:(o++,a=os[s.text],i=s.text);if(!(o+a<r.length))throw new Error("Path data ended short");for(let l=o;l<o+a;l++){const c=r[l];if(!an(c,sn))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof os[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),o+=a,s=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function zm(e){let t=0,r=0,i=0,o=0;const s=[];for(const{key:a,data:n}of e)switch(a){case"M":s.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],s.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":s.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],s.push({key:"L",data:[t,r]});break;case"C":s.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":s.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":s.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],s.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":s.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],s.push({key:"H",data:[t]});break;case"V":s.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],s.push({key:"V",data:[r]});break;case"S":s.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));s.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":s.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],s.push({key:"T",data:[t,r]});break;case"Z":case"z":s.push({key:"Z",data:[]}),t=i,r=o}return s}function jm(e){const t=[];let r="",i=0,o=0,s=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[s,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,f=0;r==="C"||r==="S"?(d=i+(i-n),f=o+(o-l)):(d=i,f=o),t.push({key:"C",data:[d,f,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,f]=h;let u=0,g=0;r==="Q"||r==="T"?(u=i+(i-n),g=o+(o-l)):(u=i,g=o);const m=i+2*(u-i)/3,y=o+2*(g-o)/3,x=d+2*(u-d)/3,C=f+2*(g-f)/3;t.push({key:"C",data:[m,y,x,C,d,f]}),n=u,l=g,i=d,o=f;break}case"Q":{const[d,f,u,g]=h,m=i+2*(d-i)/3,y=o+2*(f-o)/3,x=u+2*(d-u)/3,C=g+2*(f-g)/3;t.push({key:"C",data:[m,y,x,C,u,g]}),n=d,l=f,i=u,o=g;break}case"A":{const d=Math.abs(h[0]),f=Math.abs(h[1]),u=h[2],g=h[3],m=h[4],y=h[5],x=h[6];d===0||f===0?(t.push({key:"C",data:[i,o,y,x,y,x]}),i=y,o=x):(i!==y||o!==x)&&(Wm(i,o,y,x,d,f,u,g,m).forEach((function(C){t.push({key:"C",data:C})})),i=y,o=x);break}case"Z":t.push({key:"Z",data:[]}),i=s,o=a}r=c}return t}function so(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function Wm(e,t,r,i,o,s,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let f=[],u=0,g=0,m=0,y=0;if(c)[u,g,m,y]=c;else{[e,t]=so(e,t,-h),[r,i]=so(r,i,-h);const N=(e-r)/2,q=(t-i)/2;let A=N*N/(o*o)+q*q/(s*s);A>1&&(A=Math.sqrt(A),o*=A,s*=A);const $=o*o,O=s*s,F=$*O-$*q*q-O*N*N,R=$*q*q+O*N*N,z=(n===l?-1:1)*Math.sqrt(Math.abs(F/R));m=z*o*q/s+(e+r)/2,y=z*-s*N/o+(t+i)/2,u=Math.asin(parseFloat(((t-y)/s).toFixed(9))),g=Math.asin(parseFloat(((i-y)/s).toFixed(9))),e<m&&(u=Math.PI-u),r<m&&(g=Math.PI-g),u<0&&(u=2*Math.PI+u),g<0&&(g=2*Math.PI+g),l&&u>g&&(u-=2*Math.PI),!l&&g>u&&(g-=2*Math.PI)}let x=g-u;if(Math.abs(x)>120*Math.PI/180){const N=g,q=r,A=i;g=l&&g>u?u+120*Math.PI/180*1:u+120*Math.PI/180*-1,f=Wm(r=m+o*Math.cos(g),i=y+s*Math.sin(g),q,A,o,s,a,0,l,[g,N,m,y])}x=g-u;const C=Math.cos(u),w=Math.sin(u),S=Math.cos(g),v=Math.sin(g),_=Math.tan(x/4),E=4/3*o*_,B=4/3*s*_,D=[e,t],M=[e+E*w,t-B*C],P=[r+E*v,i-B*S],U=[r,i];if(M[0]=2*D[0]-M[0],M[1]=2*D[1]-M[1],c)return[M,P,U].concat(f);{f=[M,P,U].concat(f);const N=[];for(let q=0;q<f.length;q+=3){const A=so(f[q][0],f[q][1],h),$=so(f[q+1][0],f[q+1][1],h),O=so(f[q+2][0],f[q+2][1],h);N.push([A[0],A[1],$[0],$[1],O[0],O[1]])}return N}}const rB={randOffset:function(e,t){return dt(e,t)},randOffsetWithRange:function(e,t,r){return Js(e,t,r)},ellipse:function(e,t,r,i,o){const s=Ym(r,i,o);return gl(e,t,o,s).opset},doubleLineOps:function(e,t,r,i,o){return kr(e,t,r,i,o,!0)}};function Hm(e,t,r,i,o){return{type:"path",ops:kr(e,t,r,i,o)}}function bs(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let s=0;s<i-1;s++)o.push(...kr(e[s][0],e[s][1],e[s+1][0],e[s+1][1],r));return t&&o.push(...kr(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?Hm(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function iB(e,t,r,i,o){return(function(s,a){return bs(s,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function nd(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=ss(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:ss(r[0],1.5*(1+.22*t.roughness),cd(t));for(let s=1;s<r.length;s++){const a=r[s];if(a.length){const n=ss(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:ss(a,1.5*(1+.22*t.roughness),cd(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function Ym(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),s=2*Math.PI/o;let a=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return a+=dt(a*l,r),n+=dt(n*l,r),{increment:s,rx:a,ry:n}}function gl(e,t,r,i){const[o,s]=dd(i.increment,e,t,i.rx,i.ry,1,i.increment*Js(.1,Js(.4,1,r),r),r);let a=ta(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=dd(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=ta(n,null,r);a=a.concat(l)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function ld(e,t,r,i,o,s,a,n,l){const c=e,h=t;let d=Math.abs(r/2),f=Math.abs(i/2);d+=dt(.01*d,l),f+=dt(.01*f,l);let u=o,g=s;for(;u<0;)u+=2*Math.PI,g+=2*Math.PI;g-u>2*Math.PI&&(u=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,y=Math.min(m/2,(g-u)/2),x=ud(y,c,h,d,f,u,g,1,l);if(!l.disableMultiStroke){const C=ud(y,c,h,d,f,u,g,1.5,l);x.push(...C)}return a&&(n?x.push(...kr(c,h,c+d*Math.cos(u),h+f*Math.sin(u),l),...kr(c,h,c+d*Math.cos(g),h+f*Math.sin(g),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 hd(e,t){const r=jm(zm(Ih(e))),i=[];let o=[0,0],s=[0,0];for(const{key:a,data:n}of r)switch(a){case"M":s=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...kr(s[0],s[1],n[0],n[1],t)),s=[n[0],n[1]];break;case"C":{const[l,c,h,d,f,u]=n;i.push(...oB(l,c,h,d,f,u,s,t)),s=[f,u];break}case"Z":i.push(...kr(s[0],s[1],o[0],o[1],t)),s=[o[0],o[1]]}return{type:"path",ops:i}}function nn(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,s=i.length;if(s>2){r.push({op:"move",data:[i[0][0]+dt(o,t),i[0][1]+dt(o,t)]});for(let a=1;a<s;a++)r.push({op:"lineTo",data:[i[a][0]+dt(o,t),i[a][1]+dt(o,t)]})}}return{type:"fillPath",ops:r}}function oi(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!ue[o])switch(o){case"zigzag":ue[o]||(ue[o]=new V_(i));break;case"cross-hatch":ue[o]||(ue[o]=new K_(i));break;case"dots":ue[o]||(ue[o]=new Z_(i));break;case"dashed":ue[o]||(ue[o]=new Q_(i));break;case"zigzag-line":ue[o]||(ue[o]=new J_(i));break;default:o="hachure",ue[o]||(ue[o]=new Rh(i))}return ue[o]})(t,rB).fillPolygons(e,t)}function cd(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 tB(e.seed||0)),e.randomizer.next()}function Js(e,t,r,i=1){return r.roughness*i*(Um(r)*(t-e)+e)}function dt(e,t,r=1){return Js(-e,e,t,r)}function kr(e,t,r,i,o,s=!1){const a=s?o.disableMultiStrokeFill:o.disableMultiStroke,n=pl(e,t,r,i,o,!0,!1);if(a)return n;const l=pl(e,t,r,i,o,!0,!0);return n.concat(l)}function pl(e,t,r,i,o,s,a){const n=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,f=.2+.2*Um(o);let u=o.bowing*o.maxRandomnessOffset*(i-t)/200,g=o.bowing*o.maxRandomnessOffset*(e-r)/200;u=dt(u,o,c),g=dt(g,o,c);const m=[],y=()=>dt(d,o,c),x=()=>dt(h,o,c),C=o.preserveVertices;return a?m.push({op:"move",data:[e+(C?0:y()),t+(C?0:y())]}):m.push({op:"move",data:[e+(C?0:dt(h,o,c)),t+(C?0:dt(h,o,c))]}),a?m.push({op:"bcurveTo",data:[u+e+(r-e)*f+y(),g+t+(i-t)*f+y(),u+e+2*(r-e)*f+y(),g+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(),g+t+(i-t)*f+x(),u+e+2*(r-e)*f+x(),g+t+2*(i-t)*f+x(),r+(C?0:x()),i+(C?0:x())]}),m}function ss(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+dt(t,r),e[0][1]+dt(t,r)]),i.push([e[0][0]+dt(t,r),e[0][1]+dt(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+dt(t,r),e[o][1]+dt(t,r)]),o===e.length-1&&i.push([e[o][0]+dt(t,r),e[o][1]+dt(t,r)]);return ta(i,null,r)}function ta(e,t,r){const i=e.length,o=[];if(i>3){const s=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*e[n+1][0]-a*e[n-1][0])/6,l[1]+(a*e[n+1][1]-a*e[n-1][1])/6],s[2]=[e[n+1][0]+(a*e[n][0]-a*e[n+2][0])/6,e[n+1][1]+(a*e[n][1]-a*e[n+2][1])/6],s[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...pl(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function dd(e,t,r,i,o,s,a,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+o*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const h=dt(.5,n)-Math.PI/2;c.push([dt(s,n)+t+.9*i*Math.cos(h-e),dt(s,n)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let f=h;f<d;f+=e){const u=[dt(s,n)+t+i*Math.cos(f),dt(s,n)+r+o*Math.sin(f)];l.push(u),c.push(u)}c.push([dt(s,n)+t+i*Math.cos(h+2*Math.PI+.5*a),dt(s,n)+r+o*Math.sin(h+2*Math.PI+.5*a)]),c.push([dt(s,n)+t+.98*i*Math.cos(h+a),dt(s,n)+r+.98*o*Math.sin(h+a)]),c.push([dt(s,n)+t+.9*i*Math.cos(h+.5*a),dt(s,n)+r+.9*o*Math.sin(h+.5*a)])}return[c,l]}function ud(e,t,r,i,o,s,a,n,l){const c=s+dt(.1,l),h=[];h.push([dt(n,l)+t+.9*i*Math.cos(c-e),dt(n,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([dt(n,l)+t+i*Math.cos(d),dt(n,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),ta(h,null,l)}function oB(e,t,r,i,o,s,a,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,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:dt(c[0],n)),a[1]+(f?0:dt(c[0],n))]}),h=f?[o,s]:[o+dt(c[u],n),s+dt(c[u],n)],l.push({op:"bcurveTo",data:[e+dt(c[u],n),t+dt(c[u],n),r+dt(c[u],n),i+dt(c[u],n),h[0],h[1]]});return l}function ao(e){return[...e]}function fd(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(ao(e[0]),ao(e[1]),ao(e[2]),ao(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const s=[],a=1-t;i.push(ao(o[0]));for(let n=1;n+2<o.length;n++){const l=o[n];s[0]=[l[0],l[1]],s[1]=[l[0]+(a*o[n+1][0]-a*o[n-1][0])/6,l[1]+(a*o[n+1][1]-a*o[n-1][1])/6],s[2]=[o[n+1][0]+(a*o[n][0]-a*o[n+2][0])/6,o[n+1][1]+(a*o[n][1]-a*o[n+2][1])/6],s[3]=[o[n+1][0],o[n+1][1]],i.push(s[1],s[2],s[3])}}return i}function ks(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function sB(e,t,r){const i=ks(t,r);if(i===0)return ks(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),ks(e,Or(t,r,o))}function Or(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function ml(e,t,r,i){const o=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 g=3*h[1]-2*c[1]-f[1];g*=g;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),g<y&&(g=y),u+g})(e,t)<r){const n=e[t+0];o.length?(s=o[o.length-1],a=n,Math.sqrt(ks(s,a))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],f=Or(l,c,.5),u=Or(c,h,.5),g=Or(h,d,.5),m=Or(f,u,.5),y=Or(u,g,.5),x=Or(m,y,.5);ml([l,f,m,x],0,r,o),ml([x,y,g,d],0,r,o)}var s,a;return o}function aB(e,t){return ea(e,0,e.length,t)}function ea(e,t,r,i,o){const s=o||[],a=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=sB(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(ea(e,t,c+1,i,s),ea(e,c,r,i,s)):(s.length||s.push(a),s.push(n)),s}function ln(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let s=0;s<o;s++)ml(e,3*s,t,i);return r&&r>0?ea(i,0,i.length,r):i}const pe="none";class ra{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,s){const a=this._o(s);return this._d("line",[Hm(t,r,i,o,a)],a)}rectangle(t,r,i,o,s){const a=this._o(s),n=[],l=iB(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?n.push(nn([c],a)):n.push(oi([c],a))}return a.stroke!==pe&&n.push(l),this._d("rectangle",n,a)}ellipse(t,r,i,o,s){const a=this._o(s),n=[],l=Ym(i,o,a),c=gl(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=gl(t,r,a,l).opset;h.type="fillPath",n.push(h)}else n.push(oi([c.estimatedPoints],a));return a.stroke!==pe&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,r,i,o){const s=this.ellipse(t,r,i,i,o);return s.shape="circle",s}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[bs(t,!1,i)],i)}arc(t,r,i,o,s,a,n=!1,l){const c=this._o(l),h=[],d=ld(t,r,i,o,s,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const f=Object.assign({},c);f.disableMultiStroke=!0;const u=ld(t,r,i,o,s,a,!0,!1,f);u.type="fillPath",h.push(u)}else h.push((function(f,u,g,m,y,x,C){const w=f,S=u;let v=Math.abs(g/2),_=Math.abs(m/2);v+=dt(.01*v,C),_+=dt(.01*_,C);let E=y,B=x;for(;E<0;)E+=2*Math.PI,B+=2*Math.PI;B-E>2*Math.PI&&(E=0,B=2*Math.PI);const D=(B-E)/C.curveStepCount,M=[];for(let P=E;P<=B;P+=D)M.push([w+v*Math.cos(P),S+_*Math.sin(P)]);return M.push([w+v*Math.cos(B),S+_*Math.sin(B)]),M.push([w,S]),oi([M],C)})(t,r,i,o,s,a,c));return c.stroke!==pe&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],s=nd(t,i);if(i.fill&&i.fill!==pe)if(i.fillStyle==="solid"){const a=nd(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...ln(fd([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...ln(fd(c),10,(1+i.roughness)/2))}a.length&&o.push(oi([a],i))}return i.stroke!==pe&&o.push(s),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],s=bs(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(nn([t],i)):o.push(oi([t],i))),i.stroke!==pe&&o.push(s),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&i.fill!=="transparent"&&i.fill!==pe,a=i.stroke!==pe,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,f){const u=jm(zm(Ih(h))),g=[];let m=[],y=[0,0],x=[];const C=()=>{x.length>=4&&m.push(...ln(x,d)),x=[]},w=()=>{C(),m.length&&(g.push(m),m=[])};for(const{key:v,data:_}of u)switch(v){case"M":w(),y=[_[0],_[1]],m.push(y);break;case"L":C(),m.push([_[0],_[1]]);break;case"C":if(!x.length){const E=m.length?m[m.length-1]:y;x.push([E[0],E[1]])}x.push([_[0],_[1]]),x.push([_[2],_[3]]),x.push([_[4],_[5]]);break;case"Z":C(),m.push([y[0],y[1]])}if(w(),!f)return g;const S=[];for(const v of g){const _=aB(v,f);_.length&&S.push(_)}return S})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=hd(t,i);if(s)if(i.fillStyle==="solid")if(l.length===1){const h=hd(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(nn(l,i));else o.push(oi(l,i));return a&&(n?l.forEach((h=>{o.push(bs(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const s=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${s[0]} ${s[1]} `;break;case"bcurveTo":i+=`C${s[0]} ${s[1]}, ${s[2]} ${s[3]}, ${s[4]} ${s[5]} `;break;case"lineTo":i+=`L${s[0]} ${s[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const s of r){let a=null;switch(s.type){case"path":a={d:this.opsToPath(s),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:pe};break;case"fillPath":a={d:this.opsToPath(s),stroke:pe,strokeWidth:0,fill:i.fill||pe};break;case"fillSketch":a=this.fillSketch(s,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||pe,strokeWidth:i,fill:pe}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class nB{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ra(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,a,s),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,s,n),o.restore();break}case"fillSketch":this.fillSketch(o,a,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const s of r.ops){const a=typeof i=="number"&&i>=0?s.data.map((n=>+n.toFixed(i))):s.data;switch(s.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a),a}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a),a}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a),a}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s),s}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const as="http://www.w3.org/2000/svg";class lB{constructor(t,r){this.svg=t,this.gen=new ra(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,s=o.createElementNS(as,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(as,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(as,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&s.appendChild(l)}return s}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const s=t.createElementNS(as,"path");return s.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",o+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,s){const a=this.gen.line(t,r,i,o,s);return this.draw(a)}rectangle(t,r,i,o,s){const a=this.gen.rectangle(t,r,i,o,s);return this.draw(a)}ellipse(t,r,i,o,s){const a=this.gen.ellipse(t,r,i,o,s);return this.draw(a)}circle(t,r,i,o){const s=this.gen.circle(t,r,i,o);return this.draw(s)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,s,a,n=!1,l){const c=this.gen.arc(t,r,i,o,s,a,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var rt={canvas:(e,t)=>new nB(e,t),svg:(e,t)=>new lB(e,t),generator:e=>new ra(e),newSeed:()=>ra.newSeed()},lt=p(async(e,t,r)=>{let i;const o=t.useHtmlLabels||Ve(kt()?.htmlLabels);r?i=r:i="node default";const s=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=s.insert("g").attr("class","label").attr("style",Vt(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 Pe(a,Se(br(n),kt()),{useHtmlLabels:o,width:t.width||kt().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},kt());let d=h.getBBox();const f=(t?.padding??0)/2;if(o){const u=h.children[0],g=yt(h);await vh(u,n),d=u.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return o?a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):a.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:s,bbox:d,halfPadding:f,label:a}},"labelHelper"),hn=p(async(e,t,r)=>{const i=r.useHtmlLabels??ae(kt()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),s=await Pe(o,Se(br(t),kt()),{useHtmlLabels:i,width:r.width||kt()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let a=s.getBBox();const n=r.padding/2;if(ae(kt())){const l=s.children[0],c=yt(s);a=l.getBoundingClientRect(),c.attr("width",a.width),c.attr("height",a.height)}return i?o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"):o.attr("transform","translate(0, "+-a.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-a.width/2+", "+-a.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:a,halfPadding:n,label:o}},"insertLabel"),ot=p((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),nt=p((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function bt(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}p(bt,"createPathFromPoints");function wr(e,t,r,i,o,s){const a=[],l=r-e,c=i-t,h=l/s,d=2*Math.PI/h,f=t+c/2;for(let u=0;u<=50;u++){const g=u/50,m=e+g*l,y=f+o*Math.sin(d*(m-e));a.push({x:m,y})}return a}p(wr,"generateFullSineWavePoints");function Ro(e,t,r,i,o,s){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(Ro,"generateCirclePoints");function yl(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),s=t.find(l=>l.getAttribute("stroke")!=="none"),a=p((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(s){const l={stroke:a(s,"stroke"),"stroke-width":a(s,"stroke-width")??"1","stroke-opacity":a(s,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}p(yl,"mergePaths");var hB=p((e,t)=>{var r=e.x,i=e.y,o=t.x-r,s=t.y-i,a=e.width/2,n=e.height/2,l,c;return Math.abs(s)*a>Math.abs(o)*n?(s<0&&(n=-n),l=s===0?0:n*o/s,c=n):(o<0&&(a=-a),l=a,c=o===0?0:a*s/o),{x:r+l,y:i+c}},"intersectRect"),Zr=hB,cB=p(async(e,t,r,i=!1,o=!1)=>{let s=t||"";typeof s=="object"&&(s=s[0]);const a=kt(),n=ae(a);return await Pe(e,s,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),gr=cB,Sr=p((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),dB=p(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,n=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=it(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=Ve(r.flowchart.htmlLabels),g=t.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),y=await Pe(m,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let x=y.getBBox();if(u){const N=y.children[0],q=yt(y);x=N.getBoundingClientRect(),q.attr("width",x.width),q.attr("height",x.height)}const C=t.padding??0,w=t.width<=x.width+C?x.width+C:t.width;t.width<=x.width+C?t.diff=(w-t.width)/2-C:t.diff=-C;const S=t.height,v=t.y-S/2,_=t.y+S/2,E=t.x-w/2,B=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:v+S/3,D=g?4:0,M=x.height+2*D;let P,U;if(g){const N=Math.max(M,x.height+2*D),q=E+N,A=Math.max(0,w-N);if(t.look==="handDrawn"){const F=rt.svg(f),R=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),z=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),T=F.rectangle(E,v,N,S,R);P=f.insert(()=>T,":first-child");const W=F.rectangle(q,v,A,S,z);U=f.insert(()=>W,":first-child"),P.select("path:nth-child(2)").attr("style",h.join(";")),P.select("path").attr("style",d.join(";").replace("fill","stroke"))}else P=f.insert("rect",":first-child"),U=f.insert("rect",":first-child"),P.attr("class","swimlane-title").attr("style",c).attr("x",E).attr("y",v).attr("width",N).attr("height",S).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",q).attr("y",v).attr("width",A).attr("height",S).attr("fill","none").attr("stroke",n);const $=E+N/2,O=t.y;m.attr("transform",`translate(${$}, ${O}) rotate(-90) translate(${-x.width/2}, ${-x.height/2})`)}else{const N=Math.max(0,B-v),q=Math.min(M,N),A=v+q,$=Math.max(0,_-A),O=t.x-w/2;if(t.look==="handDrawn"){const z=rt.svg(f),T=et(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:o}),W=et(t,{roughness:.7,fill:"none",stroke:n,seed:o}),j=z.rectangle(O,v,w,q,T);P=f.insert(()=>j,":first-child");const G=z.rectangle(O,A,w,$,W);U=f.insert(()=>G,":first-child"),P.select("path:nth-child(2)").attr("style",h.join(";")),P.select("path").attr("style",d.join(";").replace("fill","stroke"))}else P=f.insert("rect",":first-child"),U=f.insert("rect",":first-child"),P.attr("class","swimlane-title").attr("style",c).attr("x",O).attr("y",v).attr("width",w).attr("height",q).attr("fill",s).attr("stroke",n),U.attr("class","swimlane-body").attr("style",c).attr("x",O).attr("y",A).attr("width",w).attr("height",$).attr("fill","none").attr("stroke",n);const F=t.x-x.width/2,R=v+(q-x.height)/2;m.attr("transform",`translate(${F}, ${R})`)}if(V.trace("Swimlane data ",t,JSON.stringify(t)),l){const N=m.select("span");N&&N.attr("style",l)}return t.offsetX=0,t.width=w,t.height=S,t.offsetY=x.height-C/2,t.intersect=function(N){return Zr(t,N)},{cluster:f,labelBBox:x}},"swimlane"),Gm=p(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=it(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ae(r),u=d.insert("g").attr("class","cluster-label ");let g;t.labelType==="markdown"?g=await Pe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):g=await gr(u,t.label,t.labelStyle||"",!1,!0);let m=g.getBBox();if(ae(r)){const E=g.children[0],B=yt(g);m=E.getBoundingClientRect(),B.attr("width",m.width),B.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,w=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:3,seed:o}),D=E.path(Sr(C,w,y,x,0),B);S=d.insert(()=>(V.debug("Rough node insert CXC",D),D),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",w).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:v}=Ta(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=u.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Zr(t,E)},{cluster:d,labelBBox:m}},"rect"),uB=p((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,s=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-s).attr("y",t.y-t.height/2-s).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return Zr(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),fB=p(async(e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:s,compositeBackground:a,compositeTitleBackground:n,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let f=c.append("rect");const u=await gr(d,t.label,t.labelStyle,void 0,!0);let g=u.getBBox();if(ae(r)){const D=u.children[0],M=yt(u);g=D.getBoundingClientRect(),M.attr("width",g.width),M.attr("height",g.height)}const m=0*t.padding,y=m/2,x=(t.width<=g.width+t.padding?g.width+t.padding:t.width)+m;t.width<=g.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const C=t.height+m,w=t.height+m-g.height-6,S=t.x-x/2,v=t.y-C/2;t.width=x;const _=t.y-t.height/2-y+g.height+2;let E;if(t.look==="handDrawn"){const D=t.cssClasses.includes("statediagram-cluster-alt"),M=rt.svg(c),P=t.rx||t.ry?M.path(Sr(S,v,x,C,10),{roughness:.7,fill:n,fillStyle:"solid",stroke:l,seed:o}):M.rectangle(S,v,x,C,{seed:o});E=c.insert(()=>P,":first-child");const U=M.rectangle(S,_,x,w,{fill:D?s:a,fillStyle:D?"hachure":"solid",stroke:l,seed:o});E=c.insert(()=>P,":first-child"),f=c.insert(()=>U)}else E=h.insert("rect",":first-child"),E.attr("class","outer").attr("x",S).attr("y",v).attr("width",x).attr("height",C).attr("data-look",t.look),f.attr("class","inner").attr("x",S).attr("y",_).attr("width",x).attr("height",w);d.attr("transform",`translate(${t.x-g.width/2}, ${v+1-(ae(r)?0:3)})`);const B=E.node().getBBox();return t.height=B.height,t.offsetX=0,t.offsetY=g.height-t.padding/2,t.labelBBox=g,t.intersect=function(D){return Zr(t,D)},{cluster:c,labelBBox:g}},"roundedWithTitle"),gB=p(async(e,t)=>{V.info("Creating subgraph rect for ",t.id,t);const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:s,clusterBorder:a}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=it(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),f=ae(r),u=d.insert("g").attr("class","cluster-label "),g=await Pe(u,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let m=g.getBBox();if(ae(r)){const E=g.children[0],B=yt(g);m=E.getBoundingClientRect(),B.attr("width",m.width),B.attr("height",m.height)}const y=t.width<=m.width+t.padding?m.width+t.padding:t.width;t.width<=m.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,C=t.x-y/2,w=t.y-x/2;V.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const E=rt.svg(d),B=et(t,{roughness:.7,fill:s,stroke:a,fillWeight:4,seed:o}),D=E.path(Sr(C,w,y,x,t.rx),B);S=d.insert(()=>(V.debug("Rough node insert CXC",D),D),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",C).attr("y",w).attr("width",y).attr("height",x);const{subGraphTitleTopMargin:v}=Ta(r);if(u.attr("transform",`translate(${t.x-m.width/2}, ${t.y-t.height/2+v})`),n){const E=u.select("span");E&&E.attr("style",n)}const _=S.node().getBBox();return t.offsetX=0,t.width=_.width,t.height=_.height,t.offsetY=m.height-t.padding/2,t.intersect=function(E){return Zr(t,E)},{cluster:d,labelBBox:m}},"kanbanSection"),pB=p((e,t)=>{const r=kt(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:s}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),n=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,d=t.x-c/2,f=t.y-h/2;t.width=c;let u;if(t.look==="handDrawn"){const y=rt.svg(a).rectangle(d,f,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:s,seed:o});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 g=u.node().getBBox();return t.height=g.height,t.offsetX=0,t.offsetY=0,t.intersect=function(m){return Zr(t,m)},{cluster:a,labelBBox:{}}},"divider"),mB=Gm,yB={rect:Gm,squareRect:mB,roundedWithTitle:fB,noteGroup:uB,divider:pB,kanbanSection:gB,swimlane:dB},Xm=new Map,Vm=p(async(e,t)=>{const r=t.shape||"rect",i=await yB[r](e,t);return Xm.set(t.id,i),i},"insertCluster"),xB=p(()=>{Xm=new Map},"clear");function Km(e,t){return e.intersect(t)}p(Km,"intersectNode");var CB=Km;function Zm(e,t,r,i){var o=e.x,s=e.y,a=o-i.x,n=s-i.y,l=Math.sqrt(t*t*n*n+r*r*a*a),c=Math.abs(t*r*a/l);i.x<o&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<s&&(h=-h),{x:o+c,y:s+h}}p(Zm,"intersectEllipse");var Qm=Zm;function Jm(e,t,r){return Qm(e,t,t,r)}p(Jm,"intersectCircle");var bB=Jm;function ty(e,t,r,i){{const o=t.y-e.y,s=e.x-t.x,a=t.x*e.y-e.x*t.y,n=o*r.x+s*r.y+a,l=o*i.x+s*i.y+a,c=1e-6;if(n!==0&&l!==0&&xl(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,g=h*t.x+d*t.y+f;if(Math.abs(u)<c&&Math.abs(g)<c&&xl(u,g))return;const m=o*d-h*s;if(m===0)return;const y=Math.abs(m/2);let x=s*f-d*a;const C=x<0?(x-y)/m:(x+y)/m;x=h*a-o*f;const w=x<0?(x-y)/m:(x+y)/m;return{x:C,y:w}}}p(ty,"intersectLine");function xl(e,t){return e*t>0}p(xl,"sameSign");var kB=ty;function ey(e,t,r){let i=e.x,o=e.y,s=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=i-e.width/2-a,c=o-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],f=t[h<t.length-1?h+1:0],u=kB(e,r,{x:l+d.x,y:c+d.y},{x:l+f.x,y:c+f.y});u&&s.push(u)}return s.length?(s.length>1&&s.sort(function(h,d){let f=h.x-r.x,u=h.y-r.y,g=Math.sqrt(f*f+u*u),m=d.x-r.x,y=d.y-r.y,x=Math.sqrt(m*m+y*y);return g<x?-1:g===x?0:1}),s[0]):e}p(ey,"intersectPolygon");var wB=ey,tt={node:CB,circle:bB,ellipse:Qm,polygon:wB,rect:Zr};function ry(e,t){const{labelStyles:r}=it(t);t.labelStyle=r;const i=nt(t);let o=i;i||(o="anchor");const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,l=rt.svg(s),c=et(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,a*2,c),d=s.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Vt(n)),ot(t,d),t.intersect=function(f){return V.info("Circle intersect",t,a,f),tt.circle(t,a,f)},s}p(ry,"anchor");function Cl(e,t,r,i,o,s,a){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,f=(i-t)/2,u=d/o,g=f/s,m=Math.sqrt(u**2+g**2);if(m>1)throw new Error("The given radii are too small to create an arc between the points.");const y=Math.sqrt(1-m**2),x=l+y*s*Math.sin(h)*(a?-1:1),C=c-y*o*Math.cos(h)*(a?-1:1),w=Math.atan2((t-C)/s,(e-x)/o);let v=Math.atan2((i-C)/s,(r-x)/o)-w;a&&v<0&&(v+=2*Math.PI),!a&&v>0&&(v-=2*Math.PI);const _=[];for(let E=0;E<20;E++){const B=E/19,D=w+B*v,M=x+o*Math.cos(D),P=C+s*Math.sin(D);_.push({x:M,y:P})}return _}p(Cl,"generateArcPoints");function iy(e,t,r){const[i,o]=[t,r].sort((s,a)=>a-s);return o*(1-Math.sqrt(1-(e/i/2)**2))}p(iy,"calculateArcSagitta");async function oy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=p(D=>D+a,"calcTotalHeight"),l=p(D=>{const M=D/2;return[M/(2.5+D/50),M]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=n(t?.height?t?.height:h.height),[f,u]=l(d),g=iy(d,f,u),y=(t?.width?t?.width:h.width)+s*2+g-g,x=d,{cssStyles:C}=t,w=[{x:y/2,y:-x/2},{x:-y/2,y:-x/2},...Cl(-y/2,-x/2,-y/2,x/2,f,u,!1),{x:y/2,y:x/2},...Cl(y/2,x/2,y/2,-x/2,f,u,!0)],S=rt.svg(c),v=et(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=bt(w),E=S.path(_,v),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(${f/2}, 0)`),ot(t,B),t.intersect=function(D){return tt.polygon(t,w,D)},c}p(oy,"bowTieRect");function lr(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}p(lr,"insertPolygonShape");var ns=12;async function sy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width??l.width)+(t.look==="neo"?s*2:s+ns),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,f=c,u=-h,g=0,m=[{x:d+ns,y:u},{x:f,y:u},{x:f,y:g},{x:d,y:g},{x:d,y:u+ns},{x:d+ns,y:u}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(n),w=et(t,{}),S=bt(m),v=C.path(S,w);y=n.insert(()=>v,":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}p(sy,"card");function ay(e,t){const{nodeStyles:r}=it(t);t.label="";const i=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,s=Math.max(28,t.width??0),a=[{x:0,y:s/2},{x:s/2,y:0},{x:0,y:-s/2},{x:-s/2,y:0}],n=rt.svg(i),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=bt(a),h=n.path(c,l),d=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(f){return tt.polygon(t,a,f)},i}p(ay,"choice");async function Ph(e,t,r){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i;const{shapeSvg:s,bbox:a,halfPadding:n}=await lt(e,t,nt(t)),l=16,c=r?.padding??n,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(s),g=et(t,{}),m=u.circle(0,0,h*2,g);d=s.insert(()=>m,":first-child"),d.attr("class","basic label-container").attr("style",Vt(f))}else d=s.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return ot(t,d),t.calcIntersect=function(u,g){const m=u.width/2;return tt.circle(u,m,g)},t.intersect=function(u){return V.info("Circle intersect",t,h,u),tt.circle(t,h,u)},s}p(Ph,"circle");function ny(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},s={x:-(i/2)*t,y:i/2*r},a={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${s.x},${s.y} L ${n.x},${n.y}
233
+ M ${o.x},${o.y} L ${a.x},${a.y}`}p(ny,"createLine");function ly(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),s=Math.max(30,t?.width??0),{cssStyles:a}=t,n=rt.svg(o),l=et(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,s*2,l),h=ny(s),d=n.path(h,l),f=o.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:s,point:u}),tt.circle(t,s,u)},o}p(ly,"crossedCircle");function tr(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(tr,"generateCirclePoints");async function hy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,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=s.width+n,h=s.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)],g=[{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=rt.svg(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(u).replace("Z",""),w=m.path(C,y),S=bt(g),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>w,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,_),t.intersect=function(E){return tt.polygon(t,g,E)},o}p(hy,"curlyBraceLeft");function er(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:u,y:g})}return a}p(er,"generateCirclePoints");async function cy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,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=s.width+(t.look==="neo"?n*2:n),h=s.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)],g=[{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=rt.svg(o),y=et(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=bt(u).replace("Z",""),w=m.path(C,y),S=bt(g),v=m.path(S,{...y}),_=o.insert("g",":first-child");return _.insert(()=>v,":first-child").attr("stroke-opacity",0),_.insert(()=>w,":first-child"),_.attr("class","text"),f&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,_),t.intersect=function(E){return tt.polygon(t,g,E)},o}p(cy,"curlyBraceRight");function Qt(e,t,r,i=100,o=0,s=180){const a=[],n=o*Math.PI/180,h=(s*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const f=n+d*h,u=e+r*Math.cos(f),g=t+r*Math.sin(f);a.push({x:-u,y:-g})}return a}p(Qt,"generateCirclePoints");async function dy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,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=s.width+(t.look==="neo"?n*2:n),h=s.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:f}=t,u=[...Qt(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Qt(c/2+d*2,-d,d,20,-180,-270),...Qt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Qt(c/2,h/2,d,20,0,90)],g=[...Qt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Qt(-c/2-d/2,-d,d,20,0,90),...Qt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Qt(-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},...Qt(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Qt(c/2+d*2,-d,d,20,-180,-270),...Qt(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Qt(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},...Qt(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Qt(-c/2-d/2,-d,d,20,0,90),...Qt(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Qt(-c/2+d+d/2,h/2,d,30,-180,-270)],y=rt.svg(o),x=et(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=bt(u).replace("Z",""),S=y.path(w,x),_=bt(g).replace("Z",""),E=y.path(_,x),B=bt(m),D=y.path(B,{...x}),M=o.insert("g",":first-child");return M.insert(()=>D,":first-child").attr("stroke-opacity",0),M.insert(()=>S,":first-child"),M.insert(()=>E,":first-child"),M.attr("class","text"),f&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),M.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(s.x-(s.left??0))},${-h/2+(t.padding??0)/2-(s.y-(s.top??0))})`),ot(t,M),t.intersect=function(P){return tt.polygon(t,m,P)},o}p(dy,"curlyBraces");async function uy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=Math.max(n,(h.width+s*2)*1.25,t?.width??0),f=Math.max(l,h.height+a*2,t?.height??0),u=f/2,{cssStyles:g}=t,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=d,C=f,w=x-u,S=C/4,v=[{x:w,y:0},{x:S,y:0},{x:0,y:C/2},{x:S,y:C},{x:w,y:C},...Ro(-w,-C/2,u,50,270,90)],_=bt(v),E=m.path(_,y),B=c.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",i),B.attr("transform",`translate(${-d/2}, ${-f/2})`),ot(t,B),t.intersect=function(D){return tt.polygon(t,v,D)},c}p(uy,"curvedTrapezoid");var SB=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),vB=p((e,t,r,i,o,s)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),TB=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),gd=8,pd=8;async function fy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?24:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.width<pd&&(t.width=pd);const C=y/2/(2.5+y/50);t.height=(t.height??0)-s-C*3,t.height<gd&&(t.height=gd)}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)+s+f;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=rt.svg(n),x=vB(0,0,h,u,d,f),C=TB(0,f,h,u,d,f),w=et(t,{}),S=y.path(x,w),v=y.path(C,et(t,{fill:"none"}));g=n.insert(()=>v,":first-child"),g=n.insert(()=>S,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=SB(0,0,h,u,d,f);g=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Vt(m)).attr("style",i)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(u/2+f)})`),ot(t,g),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 w=f*f*(1-C*C/(d*d));w>0&&(w=Math.sqrt(w)),w=f-w,y.y-(t.y??0)>0&&(w=-w),x.y+=w}return x},n}p(fy,"cylinder");async function Vi(e,t,r){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i;const{shapeSvg:s,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:g}=t;if(r?.rx&&r.ry&&(f=r.rx,u=r.ry),t.look==="handDrawn"){const m=rt.svg(s),y=et(t,{}),x=f||u?m.path(Sr(c,h,n,l,f||0),y):m.rectangle(c,h,n,l,y);d=s.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",Vt(g))}else d=s.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Vt(f)).attr("ry",Vt(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)},s}p(Vi,"drawRect");async function gy(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:s,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(s??0)*2,labelPaddingY:o??s??0},c=await Vi(e,t,l);if(t.look==="handDrawn"){const u=rt.svg(c),g=et(t,{}),m=c.select(".basic.label-container > path:nth-child(2)"),y=m.node();if(!y)return c;let x=null;if(y instanceof SVGGraphicsElement)x=y.getBBox();else return c;return c.insert(()=>u.line(x.x,x.y,x.x+x.width,x.y,g),".basic.label-container g.label"),c.insert(()=>u.line(x.x,x.y+x.height,x.x+x.width,x.y+x.height,g),".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}p(gy,"datastore");async function py(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=n.width+o,h=n.height+s,d=h*.2,f=-c/2,u=-h/2-d/2,{cssStyles:g}=t,m=rt.svg(a),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:f,y:u+d},{x:-f,y:u+d},{x:-f,y:-u},{x:f,y:-u},{x:f,y:u},{x:-f,y:u},{x:-f,y:u+d}],C=m.polygon(x.map(S=>[S.x,S.y]),y),w=a.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&w.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,w),t.intersect=function(S){return tt.rect(t,S)},a}p(py,"dividedRectangle");async function my(e,t){const{labelStyles:r,nodeStyles:i}=it(t),o=t.look==="neo"?12:5;t.labelStyle=r;const s=t.padding??0,a=t.look==="neo"?16:s,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(n),g=et(t,{roughness:.2,strokeWidth:2.5}),m=et(t,{roughness:.2,strokeWidth:1.5}),y=u.circle(0,0,c*2,g),x=u.circle(0,0,h*2,m);d=n.insert("g",":first-child"),d.attr("class",Vt(t.cssClasses)).attr("style",Vt(f)),d.node()?.appendChild(y),d.node()?.appendChild(x)}else{d=n.insert("g",":first-child");const u=d.insert("circle",":first-child"),g=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),g.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}p(my,"doublecircle");function yy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=it(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=rt.svg(s),{nodeBorder:c}=r,h=et(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),f=s.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),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),ot(t,f),t.intersect=function(u){return V.info("filledCircle intersect",t,{radius:a,point:u}),tt.circle(t,a,u)},s}p(yy,"filledCircle");var md=10,yd=10;async function xy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<md&&(t.height=md),t.width=(t?.width??0)-s-s/2,t.width<yd&&(t.width=yd));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:n.width)+(s??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,g=rt.svg(a),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=bt(f),x=g.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(w){return V.info("Triangle intersect",t,f,w),tt.polygon(t,f,w)},a}p(xy,"flippedTriangle");function Cy(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:s}=it(t);t.label="";const a=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,f=rt.svg(a),u=et(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const g=f.rectangle(h,d,l,c,u),m=a.insert(()=>g,":first-child");n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),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}p(Cy,"forkJoin");async function by(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=15,s=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<s&&(t.height=s),t.width=(t?.width??0)-a*2,t.width<o&&(t.width=o));const{shapeSvg:l,bbox:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:Math.max(o,c.width))+a*2,d=(t?.height?t?.height:Math.max(s,c.height))+n*2,f=d/2,{cssStyles:u}=t,g=rt.svg(l),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2,y:-d/2},{x:h/2-f,y:-d/2},...Ro(-h/2+f,0,f,50,90,270),{x:h/2-f,y:d/2},{x:-h/2,y:d/2}],x=bt(y),C=g.path(x,m),w=l.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),ot(t,w),t.intersect=function(S){return V.info("Pill intersect",t,{radius:f,point:S}),tt.polygon(t,y,S)},l}p(by,"halfRoundedRectangle");var _B=p((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function ky(e,t){const{labelStyles:r,nodeStyles:i}=it(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const s=t.padding??0,a=70,n=32,l=t.look==="neo"?a:s,c=t.look==="neo"?n:s;if(t.width||t.height){const w=(t.height??0)/o;t.width=(t?.width??0)-2*w-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/o,g=(t?.width?t?.width:d.width)+2*u+c,m=[{x:u,y:0},{x:g-u,y:0},{x:g,y:-f/2},{x:g-u,y:-f},{x:u,y:-f},{x:0,y:-f/2}];let y;const{cssStyles:x}=t;if(t.look==="handDrawn"){const C=rt.svg(h),w=et(t,{}),S=_B(0,0,g,f,u),v=C.path(S,w);y=h.insert(()=>v,":first-child").attr("transform",`translate(${-g/2}, ${f/2})`),x&&y.attr("style",x)}else y=lr(h,g,f,m);return i&&y.attr("style",i),t.width=g,t.height=f,ot(t,y),t.intersect=function(C){return tt.polygon(t,m,C)},h}p(ky,"hexagon");async function wy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await lt(e,t,nt(t)),s=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=rt.svg(o),c=et(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:s,y:0},{x:0,y:a},{x:s,y:a}],d=bt(h),f=l.path(d,c),u=o.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(${-s/2}, ${-a/2})`),ot(t,u),t.intersect=function(g){return V.info("Pill intersect",t,{points:h}),tt.polygon(t,h,g)},o}p(wy,"hourglass");async function Sy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await lt(e,t,"icon-shape default"),f=t.pos==="t",u=n,g=n,{nodeBorder:m}=r,{stylesMap:y}=Gi(t),x=-g/2,C=-u/2,w=t.label?8:0,S=rt.svg(c),v=et(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const _=S.rectangle(x,C,g,u,v),E=Math.max(g,h.width),B=u+h.height+w,D=S.rectangle(-E/2,-B/2,E,B,{...v,fill:"transparent",stroke:"none"}),M=c.insert(()=>_,":first-child"),P=c.insert(()=>D);if(t.icon){const U=c.append("g");U.html(`<g>${await Xi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const N=U.node().getBBox(),q=N.width,A=N.height,$=N.x,O=N.y;U.attr("transform",`translate(${-q/2-$},${f?h.height/2+w/2-A/2-O:-h.height/2-w/2-A/2-O})`),U.attr("style",`color: ${y.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-B/2:B/2-h.height})`),M.attr("transform",`translate(0,${f?h.height/2+w/2:-h.height/2-w/2})`),ot(t,P),t.intersect=function(U){if(V.info("iconSquare intersect",t,U),!t.label)return tt.rect(t,U);const N=t.x??0,q=t.y??0,A=t.height??0;let $=[];return f?$=[{x:N-h.width/2,y:q-A/2},{x:N+h.width/2,y:q-A/2},{x:N+h.width/2,y:q-A/2+h.height+w},{x:N+g/2,y:q-A/2+h.height+w},{x:N+g/2,y:q+A/2},{x:N-g/2,y:q+A/2},{x:N-g/2,y:q-A/2+h.height+w},{x:N-h.width/2,y:q-A/2+h.height+w}]:$=[{x:N-g/2,y:q-A/2},{x:N+g/2,y:q-A/2},{x:N+g/2,y:q-A/2+u},{x:N+h.width/2,y:q-A/2+u},{x:N+h.width/2/2,y:q+A/2},{x:N-h.width/2,y:q+A/2},{x:N-h.width/2,y:q-A/2+u},{x:N-g/2,y:q-A/2+u}],tt.polygon(t,$,U)},c}p(Sy,"icon");async function vy(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await lt(e,t,"icon-shape default"),f=20,u=t.label?8:0,g=t.pos==="t",{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=Gi(t),C=rt.svg(c),w=et(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=x.get("fill");w.stroke=S??y;const v=c.append("g");t.icon&&v.html(`<g>${await Xi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const _=v.node().getBBox(),E=_.width,B=_.height,D=_.x,M=_.y,P=Math.max(E,B)*Math.SQRT2+f*2,U=C.circle(0,0,P,w),N=Math.max(P,h.width),q=P+h.height+u,A=C.rectangle(-N/2,-q/2,N,q,{...w,fill:"transparent",stroke:"none"}),$=c.insert(()=>U,":first-child"),O=c.insert(()=>A);return v.attr("transform",`translate(${-E/2-D},${g?h.height/2+u/2-B/2-M:-h.height/2-u/2-B/2-M})`),v.attr("style",`color: ${x.get("stroke")??m};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-q/2:q/2-h.height})`),$.attr("transform",`translate(0,${g?h.height/2+u/2:-h.height/2-u/2})`),ot(t,O),t.intersect=function(F){return V.info("iconSquare intersect",t,F),tt.rect(t,F)},c}p(vy,"iconCircle");async function Ty(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await lt(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Gi(t),w=-m/2,S=-g/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const D=_.path(Sr(w,S,m,g,5),E),M=Math.max(m,h.width),P=g+h.height+v,U=_.rectangle(-M/2,-P/2,M,P,{...E,fill:"transparent",stroke:"none"}),N=c.insert(()=>D,":first-child").attr("class","icon-shape2"),q=c.insert(()=>U);if(t.icon){const A=c.append("g");A.html(`<g>${await Xi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const $=A.node().getBBox(),O=$.width,F=$.height,R=$.x,z=$.y;A.attr("transform",`translate(${-O/2-R},${u?h.height/2+v/2-F/2-z:-h.height/2-v/2-F/2-z})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-P/2:P/2-h.height})`),N.attr("transform",`translate(0,${u?h.height/2+v/2:-h.height/2-v/2})`),ot(t,q),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const $=t.x??0,O=t.y??0,F=t.height??0;let R=[];return u?R=[{x:$-h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2+h.height+v},{x:$+m/2,y:O-F/2+h.height+v},{x:$+m/2,y:O+F/2},{x:$-m/2,y:O+F/2},{x:$-m/2,y:O-F/2+h.height+v},{x:$-h.width/2,y:O-F/2+h.height+v}]:R=[{x:$-m/2,y:O-F/2},{x:$+m/2,y:O-F/2},{x:$+m/2,y:O-F/2+g},{x:$+h.width/2,y:O-F/2+g},{x:$+h.width/2/2,y:O+F/2},{x:$-h.width/2,y:O+F/2},{x:$-h.width/2,y:O-F/2+g},{x:$-m/2,y:O-F/2+g}],tt.polygon(t,R,A)},c}p(Ty,"iconRounded");async function _y(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=it(t);t.labelStyle=o;const s=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(s,a),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:f}=await lt(e,t,"icon-shape default"),u=t.pos==="t",g=n+d*2,m=n+d*2,{nodeBorder:y,mainBkg:x}=r,{stylesMap:C}=Gi(t),w=-m/2,S=-g/2,v=t.label?8:0,_=rt.svg(c),E=et(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");const B=C.get("fill");E.stroke=B??x;const D=_.path(Sr(w,S,m,g,.1),E),M=Math.max(m,h.width),P=g+h.height+v,U=_.rectangle(-M/2,-P/2,M,P,{...E,fill:"transparent",stroke:"none"}),N=c.insert(()=>D,":first-child"),q=c.insert(()=>U);if(t.icon){const A=c.append("g");A.html(`<g>${await Xi(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const $=A.node().getBBox(),O=$.width,F=$.height,R=$.x,z=$.y;A.attr("transform",`translate(${-O/2-R},${u?h.height/2+v/2-F/2-z:-h.height/2-v/2-F/2-z})`),A.attr("style",`color: ${C.get("stroke")??y};`)}return f.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-P/2:P/2-h.height})`),N.attr("transform",`translate(0,${u?h.height/2+v/2:-h.height/2-v/2})`),ot(t,q),t.intersect=function(A){if(V.info("iconSquare intersect",t,A),!t.label)return tt.rect(t,A);const $=t.x??0,O=t.y??0,F=t.height??0;let R=[];return u?R=[{x:$-h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2},{x:$+h.width/2,y:O-F/2+h.height+v},{x:$+m/2,y:O-F/2+h.height+v},{x:$+m/2,y:O+F/2},{x:$-m/2,y:O+F/2},{x:$-m/2,y:O-F/2+h.height+v},{x:$-h.width/2,y:O-F/2+h.height+v}]:R=[{x:$-m/2,y:O-F/2},{x:$+m/2,y:O-F/2},{x:$+m/2,y:O-F/2+g},{x:$+h.width/2,y:O-F/2+g},{x:$+h.width/2/2,y:O+F/2},{x:$-h.width/2,y:O+F/2},{x:$-h.width/2,y:O-F/2+g},{x:$-m/2,y:O-F/2+g}],tt.polygon(t,R,A)},c}p(_y,"iconSquare");async function By(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),s=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/s;const{labelStyles:a}=it(t);t.labelStyle=a;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??s;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:f,label:u}=await lt(e,t,"image-shape default"),g=t.pos==="t",m=-c/2,y=-h/2,x=t.label?8:0,C=rt.svg(d),w=et(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=C.rectangle(m,y,c,h,w),v=Math.max(c,f.width),_=h+f.height+x,E=C.rectangle(-v/2,-_/2,v,_,{...w,fill:"none",stroke:"none"}),B=d.insert(()=>S,":first-child"),D=d.insert(()=>E);if(t.img){const M=d.append("image");M.attr("href",t.img),M.attr("width",c),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-c/2},${g?_/2-h:-_/2})`)}return u.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${g?-h/2-f.height/2-x/2:h/2-f.height/2+x/2})`),B.attr("transform",`translate(0,${g?f.height/2+x/2:-f.height/2-x/2})`),ot(t,D),t.intersect=function(M){if(V.info("iconSquare intersect",t,M),!t.label)return tt.rect(t,M);const P=t.x??0,U=t.y??0,N=t.height??0;let q=[];return g?q=[{x:P-f.width/2,y:U-N/2},{x:P+f.width/2,y:U-N/2},{x:P+f.width/2,y:U-N/2+f.height+x},{x:P+c/2,y:U-N/2+f.height+x},{x:P+c/2,y:U+N/2},{x:P-c/2,y:U+N/2},{x:P-c/2,y:U-N/2+f.height+x},{x:P-f.width/2,y:U-N/2+f.height+x}]:q=[{x:P-c/2,y:U-N/2},{x:P+c/2,y:U-N/2},{x:P+c/2,y:U-N/2+h},{x:P+f.width/2,y:U-N/2+h},{x:P+f.width/2/2,y:U+N/2},{x:P-f.width/2,y:U+N/2},{x:P-f.width/2,y:U-N/2+h},{x:P-c/2,y:U-N/2+h}],tt.polygon(t,q,M)},d}p(By,"imageSquare");async function Ly(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{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+(s??0)*2,t?.height??0),d=[{x:0,y:0},{x:c,y:0},{x:c+3*h/6,y:-h},{x:-3*h/6,y:-h}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.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(g){return tt.polygon(t,d,g)},n}p(Ly,"inv_trapezoid");async function Ey(e,t){const{shapeSvg:r,bbox:i,label:o}=await lt(e,t,"label"),s=r.insert("rect",":first-child");return s.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),ot(t,s),t.intersect=function(l){return tt.rect(t,l)},r}p(Ey,"labelRect");async function Fy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.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(g){return tt.polygon(t,d,g)},n}p(Fy,"lean_left");async function Ay(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=o,a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.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(g){return tt.polygon(t,d,g)},n}p(Ay,"lean_right");function My(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",nt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=rt.svg(o),d=et(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=bt(c),u=h.path(f,d),g=o.insert(()=>u,":first-child");return g.attr("class","outer-path"),s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${a/2},${-n})`),ot(t,g),t.intersect=function(m){return V.info("lightningBolt intersect",t,m),tt.polygon(t,c,m)},o}p(My,"lightningBolt");var BB=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`a${o},${s} 0,0,0 ${r},0`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),LB=p((e,t,r,i,o,s,a)=>[`M${e},${t+s}`,`M${e+r},${t+s}`,`a${o},${s} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${s} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+s+a}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),EB=p((e,t,r,i,o,s)=>[`M${e-r/2},${-i/2}`,`a${o},${s} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),xd=10,Cd=10;async function $y(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const x=t.width??0;t.width=(t.width??0)-s,t.width<Cd&&(t.width=Cd);const w=x/2/(2.5+x/50);t.height=(t.height??0)-a-w*3,t.height<xd&&(t.height=xd)}const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+s*2,d=h/2,f=d/(2.5+h/50),u=(t?.height?t?.height:l.height)+f+a*2,g=u*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=rt.svg(n),C=LB(0,0,h,u,d,f,g),w=EB(0,f,h,u,d,f),S=et(t,{}),v=x.path(C,S),_=x.path(w,S);n.insert(()=>_,":first-child").attr("class","line"),m=n.insert(()=>v,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const x=BB(0,0,h,u,d,f,g);m=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",Vt(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),w=C.x-(t.x??0);if(d!=0&&(Math.abs(w)<(t.width??0)/2||Math.abs(w)==(t.width??0)/2&&Math.abs(C.y-(t.y??0))>(t.height??0)/2-f)){let S=f*f*(1-w*w/(d*d));S>0&&(S=Math.sqrt(S)),S=f-S,x.y-(t.y??0)>0&&(S=-S),C.y+=S}return C},n}p($y,"linedCylinder");async function Oy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const S=t.width;t.width=(S??0)*10/11-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+(s??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,f=t.look==="neo"?d/4:d/8,u=d+f,{cssStyles:g}=t,m=rt.svg(n),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:-h/2-h/2*.1,y:-u/2},{x:-h/2-h/2*.1,y:u/2},...wr(-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(S=>[S.x,S.y]),y),w=n.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),w.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,w),t.intersect=function(S){return tt.polygon(t,x,S)},n}p(Oy,"linedWaveEdgedRect");async function Ry(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:c.width)+s*2+2*n,f=(t?.height?t?.height:c.height)+a*2+2*n,u=d-2*n,g=f-2*n,m=-u/2,y=-g/2,{cssStyles:x}=t,C=rt.svg(l),w=et(t,{}),S=[{x:m-n,y:y+n},{x:m-n,y:y+g+n},{x:m+u-n,y:y+g+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y:y+g-n},{x:m+u+n,y:y+g-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}],v=[{x:m,y:y+n},{x:m+u-n,y:y+n},{x:m+u-n,y:y+g},{x:m+u,y:y+g},{x:m+u,y},{x:m,y}];t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const _=bt(S);let E=C.path(_,w);const B=bt(v);let D=C.path(B,w);t.look!=="handDrawn"&&(E=yl(E),D=yl(D));const M=l.insert("g",":first-child");return M.insert(()=>E),M.insert(()=>D),M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),ot(t,M),t.intersect=function(P){return tt.polygon(t,S,P)},l}p(Ry,"multiRect");async function Iy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,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(s.width,t?.width??0)+l*2,f=Math.max(s.height,t?.height??0)+c*3,u=t.look==="neo"?f/4:f/8,g=f+(h?u/2:-u/2),m=-d/2,y=-g/2,x=10,{cssStyles:C}=t,w=wr(m-x,y+g+x,m+d-x,y+g+x,u,.8),S=w?.[w.length-1],v=[{x:m-x,y:y+x},{x:m-x,y:y+g+x},...w,{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y:S.y-2*x},{x:m+d+x,y:S.y-2*x},{x:m+d+x,y:y-x},{x:m+x,y:y-x},{x:m+x,y},{x:m,y},{x:m,y:y+x}],_=[{x:m,y:y+x},{x:m+d-x,y:y+x},{x:m+d-x,y:S.y-x},{x:m+d,y:S.y-x},{x:m+d,y},{x:m,y}],E=rt.svg(o),B=et(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const D=bt(v),M=E.path(D,B),P=bt(_),U=E.path(P,B),N=o.insert(()=>M,":first-child");return N.insert(()=>U),N.attr("class","basic label-container outer-path"),C&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",C),i&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",i),N.attr("transform",`translate(0,${-u/2})`),a.attr("transform",`translate(${-(s.width/2)-x-(s.x-(s.left??0))}, ${-(s.height/2)+x-u/2-(s.y-(s.top??0))})`),ot(t,N),t.intersect=function(q){return tt.polygon(t,v,q)},o}p(Iy,"multiWaveEdgedRectangle");async function Py(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i,t.useHtmlLabels||ae(Rt())||(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,g=rt.svg(a),m=et(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=g.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),o&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,x),t.intersect=function(C){return tt.rect(t,C)},a}p(Py,"note");var FB=p((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 Dy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await lt(e,t,nt(t)),a=s.width+(t.padding??0),n=s.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const u=rt.svg(o),g=et(t,{}),m=FB(0,0,l),y=u.path(m,g);d=o.insert(()=>y,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),f&&d.attr("style",f)}else d=lr(o,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,g){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,g);return{x:x.x-.5,y:x.y-.5}},t.intersect=function(u){return this.calcIntersect(t,u)},o}p(Dy,"question");async function Ny(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width??l.width)+(t.look==="neo"?s*2:s),d=(t?.height??l.height)+(t.look==="neo"?a*2:a),f=-h/2,u=-d/2,g=u/2,m=[{x:f+g,y:u},{x:f,y:0},{x:f+g,y:-u},{x:-f,y:-u},{x:-f,y:u}],{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=bt(m),S=x.path(w,C),v=n.insert(()=>S,":first-child");return v.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),v.attr("transform",`translate(${-g/2},0)`),c.attr("transform",`translate(${-g/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ot(t,v),t.intersect=function(_){return tt.polygon(t,m,_)},n}p(Ny,"rect_left_inv_arrow");async function qy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=s.insert("g"),n=s.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await gr(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(ae(kt())){const B=h.children[0],D=yt(h);d=B.getBoundingClientRect(),D.attr("width",d.width),D.attr("height",d.height)}V.info("Text 2",l);const f=l||[],u=h.getBBox(),g=await gr(n,Array.isArray(f)?f.join("<br/>"):f,t.labelStyle,!0,!0),m=g.children[0],y=yt(g);d=m.getBoundingClientRect(),y.attr("width",d.width),y.attr("height",d.height);const x=(t.padding||0)/2;yt(g).attr("transform","translate( "+(d.width>u.width?0:(u.width-d.width)/2)+", "+(u.height+x+5)+")"),yt(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),w=d.height+(t.padding||0),S=-d.width/2-x,v=-d.height/2-x;let _,E;if(t.look==="handDrawn"){const B=rt.svg(s),D=et(t,{}),M=B.path(Sr(S,v,C,w,t.rx||0),D),P=B.line(-d.width/2-x,-d.height/2-x+u.height+x,d.width/2+x,-d.height/2-x+u.height+x,D);E=s.insert(()=>(V.debug("Rough node insert CXC",M),P),":first-child"),_=s.insert(()=>(V.debug("Rough node insert CXC",M),M),":first-child")}else _=a.insert("rect",":first-child"),E=a.insert("line"),_.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-x).attr("y",-d.height/2-x).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),E.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+u.height+x).attr("y2",-d.height/2-x+u.height+x);return ot(t,_),t.intersect=function(B){return tt.rect(t,B)},s}p(qy,"rectWithTitle");async function zy(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return Vi(e,t,o)}p(zy,"roundedRect");var Fr=8;async function jy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?Fr:Fr*2),h=(t?.height??n.height)+s*2,d=c-Fr,f=h,u=Fr-c/2,g=-h/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const C=[{x:u,y:g},{x:u+d,y:g},{x:u+d,y:g+f},{x:u-Fr,y:g+f},{x:u-Fr,y:g},{x:u,y:g},{x:u,y:g+f}],w=y.polygon(C.map(v=>[v.x,v.y]),x),S=a.insert(()=>w,":first-child");return S.attr("class","basic label-container outer-path").attr("style",Vt(m)),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),m&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${Fr/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ot(t,S),t.intersect=function(v){return tt.rect(t,v)},a}p(jy,"shadedProcess");async function Wy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-s*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await lt(e,t,nt(t)),h=(t?.width?t?.width:l.width)+s*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,f=h,u=d/1.5,g=-f/2,m=-u/2,{cssStyles:y}=t,x=rt.svg(n),C=et(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const w=[{x:g,y:m},{x:g,y:m+u},{x:g+f,y:m+u},{x:g+f,y:m-u/2}],S=bt(w),v=x.path(S,C),_=n.insert(()=>v,":first-child");return _.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",y),i&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",i),_.attr("transform",`translate(0, ${u/4})`),c.attr("transform",`translate(${-f/2+(t.padding??0)-(l.x-(l.left??0))}, ${-u/4+(t.padding??0)-(l.y-(l.top??0))})`),ot(t,_),t.intersect=function(E){return tt.polygon(t,w,E)},n}p(Wy,"slopedRect");async function Hy(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,s={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return Vi(e,t,s)}p(Hy,"squareRect");async function Yy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?s*2:s),d=c/2,{cssStyles:f}=t,u=rt.svg(n),g=et(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2+d,y:-c/2},{x:h/2-d,y:-c/2},...Ro(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...Ro(h/2-d,0,d,50,270,450)],y=bt(m),x=u.path(y,g),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(w){return tt.polygon(t,m,w)},n}p(Yy,"stadium");async function Uy(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return Vi(e,t,r)}p(Uy,"state");function Gy(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i;const{cssStyles:s}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=rt.svg(h),f=et(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const u=d.circle(0,0,t.width,{...f,stroke:a,strokeWidth:2}),g=n??l,m=(t.width??0)*5/14,y=d.circle(0,0,m,{...f,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),x=h.insert(()=>u,":first-child");if(x.insert(()=>y),t.look!=="handDrawn"&&x.attr("class","outer-path"),s&&x.selectAll("path").attr("style",s),o&&x.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const C=e.node()?.ownerSVGElement?.id??"",w=C?`${C}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${w})`)}return ot(t,x),t.intersect=function(C){return tt.circle(t,(t.width??0)/2,C)},h}p(Gy,"stateEnd");function Xy(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=rt.svg(s).circle(0,0,t.width,fT(i));a=s.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=s.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return ot(t,a),t.intersect=function(n){return tt.circle(t,(t.width??7)/2,n)},s}p(Xy,"stateStart");var si=8;async function Vy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t?.padding??8,s=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width??l.width)+2*si+s,h=(t?.height??l.height)+a,d=c-2*si,f=h,u=-c/2,g=-h/2,m=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look==="handDrawn"){const y=rt.svg(n),x=et(t,{}),C=y.rectangle(u,g,d+16,f,x),w=y.line(u+si,g,u+si,g+f,x),S=y.line(u+si+d,g,u+si+d,g+f,x);n.insert(()=>w,":first-child"),n.insert(()=>S,":first-child");const v=n.insert(()=>C,":first-child"),{cssStyles:_}=t;v.attr("class","basic label-container").attr("style",Vt(_)),ot(t,v)}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}p(Vy,"subroutine");var cn=.2;async function Ky(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-s*2-cn*(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=cn*c,d=cn*c,u=(t?.width?t?.width:l.width)+s*2+h-h,g=c,m=-u/2,y=-g/2,{cssStyles:x}=t,C=rt.svg(n),w=et(t,{}),S=[{x:m-h/2,y},{x:m+u+h/2,y},{x:m+u+h/2,y:y+g},{x:m-h/2,y:y+g}],v=[{x:m+u-h/2,y:y+g},{x:m+u+h/2,y:y+g},{x:m+u+h/2,y:y+g-d}];t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const _=bt(S),E=C.path(_,w),B=bt(v),D=C.path(B,{...w,fillStyle:"solid"}),M=n.insert(()=>D,":first-child");return M.insert(()=>E,":first-child"),M.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),ot(t,M),t.intersect=function(P){return tt.polygon(t,S,P)},n}p(Ky,"taggedRect");async function Zy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,label:a}=await lt(e,t,nt(t)),n=Math.max(s.width+(t.padding??0)*2,t?.width??0),l=Math.max(s.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,f=l+c,{cssStyles:u}=t,g=rt.svg(o),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-n/2-n/2*.1,y:f/2},...wr(-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,w=[{x:x+n-h,y:(C+l)*1.3},{x:x+n,y:C+l-d},{x:x+n,y:(C+l)*.9},...wr(x+n,(C+l)*1.25,x+n-h,(C+l)*1.3,-l*.02,.5)],S=bt(y),v=g.path(S,m),_=bt(w),E=g.path(_,{...m,fillStyle:"solid"}),B=o.insert(()=>E,":first-child");return B.insert(()=>v,":first-child"),B.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(s.x-(s.left??0))},${-l/2+(t.padding??0)-c/2-(s.y-(s.top??0))})`),ot(t,B),t.intersect=function(D){return tt.polygon(t,y,D)},o}p(Zy,"taggedWaveEdgedRectangle");async function Qy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s}=await lt(e,t,nt(t)),a=Math.max(s.width+(t.padding??0),t?.width||0),n=Math.max(s.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=o.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),ot(t,h),t.intersect=function(d){return tt.rect(t,d)},o}p(Qy,"text");var AB=p((e,t,r,i,o,s)=>`M${e},${t}
234
234
  a${o},${s} 0,0,1 0,${-i}
235
235
  l${r},0
236
236
  a${o},${s} 0,0,1 0,${i}
237
237
  M${r},${-i}
238
238
  a${o},${s} 0,0,0 0,${i}
239
- l${-r},0`,"createCylinderPathD"),MB=p((e,t,r,i,o,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),$B=p((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),bd=5,kd=10;async function t0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?12:o/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-s,t.height<bd&&(t.height=bd);const x=m/2/(2.5+m/50);t.width=(t.width??0)-s-x*3,t.width<kd&&(t.width=kd)}const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t.height?t.height:n.height)+s,h=c/2,d=h/(2.5+c/50),f=(t.width?t.width:n.width)+d+s,{cssStyles:u}=t;let g;if(t.look==="handDrawn"){const m=rt.svg(a),y=MB(0,0,f,c,d,h),x=$B(0,0,f,c,d,h),C=m.path(y,et(t,{})),w=m.path(x,et(t,{fill:"none"}));g=a.insert(()=>w,":first-child"),g=a.insert(()=>C,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{const m=AB(0,0,f,c,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Vt(u)).attr("style",i),g.attr("class","basic label-container outer-path"),u&&g.selectAll("path").attr("style",u),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",d),g.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,g),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}p(t0,"tiltedCylinder");async function e0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.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(g){return tt.polygon(t,d,g)},n}p(e0,"trapezoid");async function r0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.height<l&&(t.height=l),t.width=(t.width??0)-s*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:h.width)+s*2,f=(t?.height?t?.height:h.height)+a*2,{cssStyles:u}=t,g=rt.svg(c),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-d/2*.8,y:-f/2},{x:d/2*.8,y:-f/2},{x:d/2,y:-f/2*.6},{x:d/2,y:f/2},{x:-d/2,y:f/2},{x:-d/2,y:-f/2*.6}],x=bt(y),C=g.path(x,m),w=c.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),ot(t,w),t.intersect=function(S){return tt.polygon(t,y,S)},c}p(r0,"trapezoidalPentagon");var wd=10,Sd=10;async function i0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.width<Sd&&(t.width=Sd),t.height=t?.height??0,t.height<wd&&(t.height=wd));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=Ve(kt().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+s,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:g}=t,m=rt.svg(a),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=bt(u),C=m.path(x,y),w=a.insert(()=>C,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),t.width=h,t.height=d,ot(t,w),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(S){return V.info("Triangle intersect",t,u,S),tt.polygon(t,u,S)},a}p(i0,"triangle");async function o0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:c.width)+(s??0)*2,f=(t?.height?t?.height:c.height)+(a??0)*2,u=t.look==="neo"?f/4:f/8,g=f+(n?u:-u),{cssStyles:m}=t,x=14-d,C=x>0?x/2:0,w=rt.svg(l),S=et(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const v=[{x:-d/2-C,y:g/2},...wr(-d/2-C,g/2,d/2+C,g/2,u,.8),{x:d/2+C,y:-g/2},{x:-d/2-C,y:-g/2}],_=bt(v),E=w.path(_,S),B=l.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-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,B),t.intersect=function(D){return tt.polygon(t,v,D)},l}p(o0,"waveEdgedRectangle");async function s0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const S=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-S*(20/9)),t.width=t.width-s*2}const{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:l.width)+s*2,h=(t?.height?t?.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:u}=t,g=rt.svg(n),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...wr(-c/2,f/2,c/2,f/2,d,1),{x:c/2,y:-f/2},...wr(c/2,-f/2,-c/2,-f/2,d,-1)],x=bt(y),C=g.path(x,m),w=n.insert(()=>C,":first-child");return w.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),ot(t,w),t.intersect=function(S){return tt.polygon(t,y,S)},n}p(s0,"waveRectangle");var Dt=10;async function a0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-Dt,10),t.height=Math.max((t?.height??0)-s*2-Dt,10));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:n.width)+o*2+Dt,h=(t?.height?t?.height:n.height)+s*2+Dt,d=c-Dt,f=h-Dt,u=-d/2,g=-f/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{}),C=[{x:u-Dt,y:g-Dt},{x:u-Dt,y:g+f},{x:u+d,y:g+f},{x:u+d,y:g-Dt}],w=`M${u-Dt},${g-Dt} L${u+d},${g-Dt} L${u+d},${g+f} L${u-Dt},${g+f} L${u-Dt},${g-Dt}
239
+ l${-r},0`,"createCylinderPathD"),MB=p((e,t,r,i,o,s)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${s} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${s} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),$B=p((e,t,r,i,o,s)=>[`M${e+r/2},${-i/2}`,`a${o},${s} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),bd=5,kd=10;async function Jy(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?12:o/2;if(t.width||t.height){const m=t.height??0;t.height=(t.height??0)-s,t.height<bd&&(t.height=bd);const x=m/2/(2.5+m/50);t.width=(t.width??0)-s-x*3,t.width<kd&&(t.width=kd)}const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t.height?t.height:n.height)+s,h=c/2,d=h/(2.5+c/50),f=(t.width?t.width:n.width)+d+s,{cssStyles:u}=t;let g;if(t.look==="handDrawn"){const m=rt.svg(a),y=MB(0,0,f,c,d,h),x=$B(0,0,f,c,d,h),C=m.path(y,et(t,{})),w=m.path(x,et(t,{fill:"none"}));g=a.insert(()=>w,":first-child"),g=a.insert(()=>C,":first-child"),g.attr("class","basic label-container"),u&&g.attr("style",u)}else{const m=AB(0,0,f,c,d,h);g=a.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Vt(u)).attr("style",i),g.attr("class","basic label-container outer-path"),u&&g.selectAll("path").attr("style",u),i&&g.selectAll("path").attr("style",i)}return g.attr("label-offset-x",d),g.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,g),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}p(Jy,"tiltedCylinder");async function t0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.height??l.height)+s,h=(t?.width??l.width)+a,d=[{x:-3*c/6,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:0,y:-c}];let f;const{cssStyles:u}=t;if(t.look==="handDrawn"){const g=rt.svg(n),m=et(t,{}),y=bt(d),x=g.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(g){return tt.polygon(t,d,g)},n}p(t0,"trapezoid");async function e0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o,n=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.height<l&&(t.height=l),t.width=(t.width??0)-s*2,t.width<n&&(t.width=n));const{shapeSvg:c,bbox:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:h.width)+s*2,f=(t?.height?t?.height:h.height)+a*2,{cssStyles:u}=t,g=rt.svg(c),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-d/2*.8,y:-f/2},{x:d/2*.8,y:-f/2},{x:d/2,y:-f/2*.6},{x:d/2,y:f/2},{x:-d/2,y:f/2},{x:-d/2,y:-f/2*.6}],x=bt(y),C=g.path(x,m),w=c.insert(()=>C,":first-child");return w.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),ot(t,w),t.intersect=function(S){return tt.polygon(t,y,S)},c}p(e0,"trapezoidalPentagon");var wd=10,Sd=10;async function r0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-s)/2,t.width<Sd&&(t.width=Sd),t.height=t?.height??0,t.height<wd&&(t.height=wd));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=Ve(kt().flowchart?.htmlLabels),h=(t?.width?t?.width:n.width)+s,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:g}=t,m=rt.svg(a),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=bt(u),C=m.path(x,y),w=a.insert(()=>C,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`).attr("class","outer-path");return g&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",i),t.width=h,t.height=d,ot(t,w),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${d/2-(n.height+(t.padding??0)/(c?2:1)-(n.y-(n.top??0)))})`),t.intersect=function(S){return V.info("Triangle intersect",t,u,S),tt.polygon(t,u,S)},a}p(r0,"triangle");async function i0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let n=!0;(t.width||t.height)&&(n=!1,t.width=(t?.width??0)-s*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await lt(e,t,nt(t)),d=(t?.width?t?.width:c.width)+(s??0)*2,f=(t?.height?t?.height:c.height)+(a??0)*2,u=t.look==="neo"?f/4:f/8,g=f+(n?u:-u),{cssStyles:m}=t,x=14-d,C=x>0?x/2:0,w=rt.svg(l),S=et(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const v=[{x:-d/2-C,y:g/2},...wr(-d/2-C,g/2,d/2+C,g/2,u,.8),{x:d/2+C,y:-g/2},{x:-d/2-C,y:-g/2}],_=bt(v),E=w.path(_,S),B=l.insert(()=>E,":first-child");return B.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&B.selectAll("path").attr("style",i),B.attr("transform",`translate(0,${-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,B),t.intersect=function(D){return tt.polygon(t,v,D)},l}p(i0,"waveEdgedRectangle");async function o0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.padding??0,s=t.look==="neo"?16:o,a=t.look==="neo"?20:o;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);const S=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-a-S*(20/9)),t.width=t.width-s*2}const{shapeSvg:n,bbox:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:l.width)+s*2,h=(t?.height?t?.height:l.height)+a,d=h/8,f=h+d*2,{cssStyles:u}=t,g=rt.svg(n),m=et(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-c/2,y:f/2},...wr(-c/2,f/2,c/2,f/2,d,1),{x:c/2,y:-f/2},...wr(c/2,-f/2,-c/2,-f/2,d,-1)],x=bt(y),C=g.path(x,m),w=n.insert(()=>C,":first-child");return w.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&w.selectAll("path").attr("style",i),ot(t,w),t.intersect=function(S){return tt.polygon(t,y,S)},n}p(o0,"waveRectangle");var Dt=10;async function s0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-Dt,10),t.height=Math.max((t?.height??0)-s*2-Dt,10));const{shapeSvg:a,bbox:n,label:l}=await lt(e,t,nt(t)),c=(t?.width?t?.width:n.width)+o*2+Dt,h=(t?.height?t?.height:n.height)+s*2+Dt,d=c-Dt,f=h-Dt,u=-d/2,g=-f/2,{cssStyles:m}=t,y=rt.svg(a),x=et(t,{}),C=[{x:u-Dt,y:g-Dt},{x:u-Dt,y:g+f},{x:u+d,y:g+f},{x:u+d,y:g-Dt}],w=`M${u-Dt},${g-Dt} L${u+d},${g-Dt} L${u+d},${g+f} L${u-Dt},${g+f} L${u-Dt},${g-Dt}
240
240
  M${u-Dt},${g} L${u+d},${g}
241
- M${u},${g-Dt} L${u},${g+f}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=y.path(w,x),v=a.insert(()=>S,":first-child");return v.attr("transform",`translate(${Dt/2}, ${Dt/2})`),v.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+Dt/2-(n.x-(n.left??0))}, ${-(n.height/2)+Dt/2-(n.y-(n.top??0))})`),ot(t,v),t.intersect=function(_){return tt.polygon(t,C,_)},a}p(a0,"windowPane");var vd=new Set(["redux-color","redux-dark-color"]),OB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Dh(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Rt(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:K}=Rt(),{background:Z}=K,at={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Z}`]};await Dh(e,at)}const c=Rt();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:f}=t,{labelStyles:u,nodeStyles:g}=it(t);if(r.attributes.length===0&&t.label){const K={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Ue(t.label,c)+K.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const Z=await Vi(e,t,K);if(i!=null&&vd.has(i)){const at=r.colorIndex??0;Z.attr("data-color-id",`color-${at%l.length}`)}if(!Ve(c.htmlLabels)){const at=Z.select("text"),mt=at.node()?.getBBox();at.attr("transform",`translate(${-mt.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 hi(y,t.label??"",c,0,0,["name"],u);x.height+=d;let C=0;const w=[],S=[];let v=0,_=0,E=0,B=0,D=!0,M=!0;for(const K of r.attributes){const Z=await hi(y,K.type,c,0,C,["attribute-type"],u);v=Math.max(v,Z.width+h);const at=await hi(y,K.name,c,0,C,["attribute-name"],u);_=Math.max(_,at.width+h);const mt=await hi(y,K.keys.join(),c,0,C,["attribute-keys"],u);E=Math.max(E,mt.width+h);const ht=await hi(y,K.comment,c,0,C,["attribute-comment"],u);B=Math.max(B,ht.width+h);const ct=Math.max(Z.height,at.height,mt.height,ht.height)+d;S.push({yOffset:C,rowHeight:ct}),C+=ct}let P=4;E<=h&&(D=!1,E=0,P--),B<=h&&(M=!1,B=0,P--);const U=y.node().getBBox();if(x.width+h*2-(v+_+E+B)>0){const K=x.width+h*2-(v+_+E+B);v+=K/P,_+=K/P,E>0&&(E+=K/P),B>0&&(B+=K/P)}const N=v+_+E+B,q=rt.svg(y),A=et(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let $=0;S.length>0&&($=S.reduce((K,Z)=>K+(Z?.rowHeight??0),0));const O=Math.max(U.width+h*2,t?.width||0,N),F=Math.max(($??0)+x.height,t?.height||0),R=-O/2,z=-F/2;if(y.selectAll("g:not(:first-child)").each((K,Z,at)=>{const mt=yt(at[Z]),ht=mt.attr("transform");let ct=0,_t=0;if(ht){const Et=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ht);Et&&(ct=parseFloat(Et[1]),_t=parseFloat(Et[2]),mt.attr("class").includes("attribute-name")?ct+=v:mt.attr("class").includes("attribute-keys")?ct+=v+_:mt.attr("class").includes("attribute-comment")&&(ct+=v+_+E))}mt.attr("transform",`translate(${R+h/2+ct}, ${_t+z+x.height+d/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(z+d/2)+")"),i!=null&&vd.has(i)){const K=r.colorIndex??0;y.attr("data-color-id",`color-${K%l.length}`)}const T=q.rectangle(R,z,O,F,A),W=y.insert(()=>T,":first-child").attr("class","outer-path").attr("style",f.join(""));w.push(0);for(const[K,Z]of S.entries()){const mt=(K+1)%2===0&&Z.yOffset!==0,ht=q.rectangle(R,x.height+z+Z?.yOffset,O,Z?.rowHeight,{...A,fill:mt?s:a,stroke:n});y.insert(()=>ht,"g.label").attr("style",f.join("")).attr("class",`row-rect-${mt?"even":"odd"}`)}const j=1e-4;let G=ci(R,x.height+z,O+R,x.height+z,j),X=q.polygon(G.map(K=>[K.x,K.y]),A);if(y.insert(()=>X).attr("class","divider"),G=ci(v+R,x.height+z,v+R,F+z,j),X=q.polygon(G.map(K=>[K.x,K.y]),A),y.insert(()=>X).attr("class","divider"),D){const K=v+_+R;G=ci(K,x.height+z,K,F+z,j),X=q.polygon(G.map(Z=>[Z.x,Z.y]),A),y.insert(()=>X).attr("class","divider")}if(M){const K=v+_+E+R;G=ci(K,x.height+z,K,F+z,j),X=q.polygon(G.map(Z=>[Z.x,Z.y]),A),y.insert(()=>X).attr("class","divider")}for(const K of w){const Z=x.height+z+K;G=ci(R,Z,O+R,Z,j),X=q.polygon(G.map(at=>[at.x,at.y]),A),y.insert(()=>X).attr("class","divider")}if(ot(t,W),g&&t.look!=="handDrawn")if(i!=null&&OB.has(i))y.selectAll("path").attr("style",g);else{const Z=g.split(";")?.filter(at=>at.includes("stroke"))?.map(at=>`${at}`).join("; ");y.selectAll("path").attr("style",Z??""),y.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(K){return tt.rect(t,K)},y}p(Dh,"erBox");async function hi(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==Ln(t)&&(t=Ln(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=n.node().appendChild(await Pe(n,t,{width:Ue(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(Ve(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=yt(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}p(hi,"addText");function ci(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}p(ci,"lineToPolygon");async function n0(e,t,r,i,o=r.class.padding??12){const s=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 mo(n,{text:`«${C}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await mo(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const C of t.members){const w=await mo(c,C,m,[C.parseClassifier()]);m+=w+s}u=c.node().getBBox().height,u<=0&&(u=o/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const C of t.methods){const w=await mo(h,C,y,[C.parseClassifier()]);y+=w+s}let x=a.node().getBBox();if(n!==null){const C=n.node().getBBox();n.attr("transform",`translate(${-C.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),x=a.node().getBBox(),c.attr("transform",`translate(0, ${d+f+o*2})`),x=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(u?u+o*4:o*2)})`),x=a.node().getBBox(),{shapeSvg:a,bbox:x}}p(n0,"textHelper");async function mo(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=Rt();let a="useHtmlLabels"in t?t.useHtmlLabels:Ve(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),Ii(n)&&(a=!0);const l=await Pe(o,Yl(br(n)),{width:Ue(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const d=l.children[0],f=yt(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 g=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",g){const C=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,S=parseInt(C,10)*5+"px";m.style.minWidth=S,m.style.maxWidth=S}else m.style.width="100%";y(m)}p(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")&&yt(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 o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}p(mo,"addText");async function l0(e,t){const r=kt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??Ve(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await n0(e,t,r,n,a),{labelStyles:d,nodeStyles:f}=it(t);t.labelStyle=d,t.cssStyles=l.styles||"";const u=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=Math.max(t.width??0,h.width);let C=Math.max(t.height??0,h.height);const w=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?C+=a:l.members.length>0&&l.methods.length===0&&(C+=a*2);const S=-x/2,v=-C/2;let _=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;w&&(_=s*2);const E=m.rectangle(S-s,v-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),x+2*s,C+2*s+_,y),B=c.insert(()=>E,":first-child");B.attr("class","basic label-container outer-path");const D=B.node().getBBox(),M=c.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,P=c.select(".label-group").node().getBBox().height-(g?s/2:0)||0,U=c.select(".members-group").node().getBBox().height-(g?s/2:0)||0,N=(M+P+v+s-(v-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((q,A,$)=>{const O=yt($[A]),F=O.attr("transform");let R=0;if(F){const j=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(F);j&&(R=parseFloat(j[2]))}let z=R+v+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(O.attr("class").includes("methods-group")){const W=Math.max(U,a/2);w?z=Math.max(N,M+P+W+v+a*2+s)+a*2:z=M+P+W+v+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?z=R-a:z=R),n||(z-=4);let T=S;(O.attr("class").includes("label-group")||O.attr("class").includes("annotation-group"))&&(T=-O.node()?.getBBox().width/2||0,c.selectAll("text").each(function(W,j,G){window.getComputedStyle(G[j]).textAnchor==="middle"&&(T=0)})),O.attr("transform",`translate(${T}, ${z})`)}),l.members.length>0||l.methods.length>0||g){const q=M+P+v+s,A=m.line(D.x,q,D.x+D.width,q+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(g||l.members.length>0||l.methods.length>0){const q=M+P+U+v+a*2+s,A=m.line(D.x,w?Math.max(N,q):q,D.x+D.width,(w?Math.max(N,q):q)+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",u),B.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 q=RegExp(/color\s*:\s*([^;]*)/),A=q.exec(u);if(A){const $=A[0].replace("color","fill");c.selectAll("tspan").attr("style",$)}else if(d){const $=q.exec(d);if($){const O=$[0].replace("color","fill");c.selectAll("tspan").attr("style",O)}}}return ot(t,B),t.intersect=function(q){return tt.rect(t,q)},c}p(l0,"classBox");async function h0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=nt(t),{themeVariables:h}=kt(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,u=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let g;l?g=await ze(u,`&lt;&lt;${o.type}&gt;&gt;`,0,t.labelStyle):g=await ze(u,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let m=g;const y=await ze(u,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const D=await ze(u,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=D;const M=await ze(u,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=M;const P=await ze(u,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=P,await ze(u,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const D=await ze(u,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=D,await ze(u,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const x=(u.node()?.getBBox().width??200)+a,C=(u.node()?.getBBox().height??200)+a,w=-x/2,S=-C/2,v=rt.svg(u),_=et(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const E=v.rectangle(w,S,x,C,_),B=u.insert(()=>E,":first-child");if(B.attr("class","basic label-container outer-path").attr("style",i),d?.length){const D=t.colorIndex??0;u.attr("data-color-id",`color-${D%d.length}`)}if(u.selectAll(".label").each((D,M,P)=>{const U=yt(P[M]),N=U.attr("transform");let q=0,A=0;if(N){const R=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(N);R&&(q=parseFloat(R[1]),A=parseFloat(R[2]))}const $=A-C/2;let O=w+a/2;(M===0||M===1)&&(O=q),U.attr("transform",`translate(${O}, ${$+a})`)}),m>g+y+n){const D=S+g+y+n;let M;if(t.look==="neo"){const N=[[w,D],[w+x,D],[w+x,D+.001],[w,D+.001]];M=v.polygon(N,_)}else M=v.line(w,D,w+x,D,_);u.insert(()=>M).attr("class","divider")}return ot(t,B),t.intersect=function(D){return tt.rect(t,D)},i&&t.look!=="handDrawn"&&(f||d?.length)&&u.selectAll("path").attr("style",i),u}p(h0,"requirementBox");async function ze(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=kt(),a=s.htmlLabels??!0,n=await Pe(o,Yl(br(t)),{width:Ue(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const c=n.children[0],h=yt(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=n.getBBox(),l.height+=6}return o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}p(ze,"addText");var RB=p(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 c0(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i||"";const s=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 g,m;f?{label:g,bbox:m}=await hn(f,"ticket"in t&&t.ticket||"",u):{label:g,bbox:m}=await hn(n,"ticket"in t&&t.ticket||"",u);const{label:y,bbox:x}=await hn(n,"assigned"in t&&t.assigned||"",u);t.width=a;const C=10,w=t?.width||0,S=Math.max(m.height,x.height)/2,v=Math.max(l.height+C*2,t?.height||0)+S,_=-w/2,E=-v/2;c.attr("transform","translate("+(h-w/2)+", "+(-S-l.height/2)+")"),g.attr("transform","translate("+(h-w/2)+", "+(-S+l.height/2)+")"),y.attr("transform","translate("+(h+w/2-x.width-2*s)+", "+(-S+l.height/2)+")");let B;const{rx:D,ry:M}=t,{cssStyles:P}=t;if(t.look==="handDrawn"){const U=rt.svg(n),N=et(t,{}),q=D||M?U.path(Sr(_,E,w,v,D||0),N):U.rectangle(_,E,w,v,N);B=n.insert(()=>q,":first-child"),B.attr("class","basic label-container").attr("style",P||null)}else{B=n.insert("rect",":first-child"),B.attr("class","basic label-container __APA__").attr("style",o).attr("rx",D??5).attr("ry",M??5).attr("x",_).attr("y",E).attr("width",w).attr("height",v);const U="priority"in t&&t.priority;if(U){const N=n.append("line"),q=_+2,A=E+Math.floor((D??0)/2),$=E+v-Math.floor((D??0)/2);N.attr("x1",q).attr("y1",A).attr("x2",q).attr("y2",$).attr("stroke-width","4").attr("stroke",RB(U))}}return ot(t,B),t.height=v,t.intersect=function(U){return tt.rect(t,U)},n}p(c0,"kanbanItem");async function d0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:d}=t,f=s.width+20,u=s.height+20,g=Math.max(l,f),m=Math.max(c,u);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const x=`M0 0
241
+ M${u},${g-Dt} L${u},${g+f}`;t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=y.path(w,x),v=a.insert(()=>S,":first-child");return v.attr("transform",`translate(${Dt/2}, ${Dt/2})`),v.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",m),i&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",i),l.attr("transform",`translate(${-(n.width/2)+Dt/2-(n.x-(n.left??0))}, ${-(n.height/2)+Dt/2-(n.y-(n.top??0))})`),ot(t,v),t.intersect=function(_){return tt.polygon(t,C,_)},a}p(s0,"windowPane");var vd=new Set(["redux-color","redux-dark-color"]),OB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function Dh(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Rt(),{rowEven:s,rowOdd:a,nodeBorder:n,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:K}=Rt(),{background:Z}=K,at={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${Z}`]};await Dh(e,at)}const c=Rt();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:f}=t,{labelStyles:u,nodeStyles:g}=it(t);if(r.attributes.length===0&&t.label){const K={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Ue(t.label,c)+K.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const Z=await Vi(e,t,K);if(i!=null&&vd.has(i)){const at=r.colorIndex??0;Z.attr("data-color-id",`color-${at%l.length}`)}if(!Ve(c.htmlLabels)){const at=Z.select("text"),mt=at.node()?.getBBox();at.attr("transform",`translate(${-mt.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 hi(y,t.label??"",c,0,0,["name"],u);x.height+=d;let C=0;const w=[],S=[];let v=0,_=0,E=0,B=0,D=!0,M=!0;for(const K of r.attributes){const Z=await hi(y,K.type,c,0,C,["attribute-type"],u);v=Math.max(v,Z.width+h);const at=await hi(y,K.name,c,0,C,["attribute-name"],u);_=Math.max(_,at.width+h);const mt=await hi(y,K.keys.join(),c,0,C,["attribute-keys"],u);E=Math.max(E,mt.width+h);const ht=await hi(y,K.comment,c,0,C,["attribute-comment"],u);B=Math.max(B,ht.width+h);const ct=Math.max(Z.height,at.height,mt.height,ht.height)+d;S.push({yOffset:C,rowHeight:ct}),C+=ct}let P=4;E<=h&&(D=!1,E=0,P--),B<=h&&(M=!1,B=0,P--);const U=y.node().getBBox();if(x.width+h*2-(v+_+E+B)>0){const K=x.width+h*2-(v+_+E+B);v+=K/P,_+=K/P,E>0&&(E+=K/P),B>0&&(B+=K/P)}const N=v+_+E+B,q=rt.svg(y),A=et(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");let $=0;S.length>0&&($=S.reduce((K,Z)=>K+(Z?.rowHeight??0),0));const O=Math.max(U.width+h*2,t?.width||0,N),F=Math.max(($??0)+x.height,t?.height||0),R=-O/2,z=-F/2;if(y.selectAll("g:not(:first-child)").each((K,Z,at)=>{const mt=yt(at[Z]),ht=mt.attr("transform");let ct=0,_t=0;if(ht){const Et=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ht);Et&&(ct=parseFloat(Et[1]),_t=parseFloat(Et[2]),mt.attr("class").includes("attribute-name")?ct+=v:mt.attr("class").includes("attribute-keys")?ct+=v+_:mt.attr("class").includes("attribute-comment")&&(ct+=v+_+E))}mt.attr("transform",`translate(${R+h/2+ct}, ${_t+z+x.height+d/2})`)}),y.select(".name").attr("transform","translate("+-x.width/2+", "+(z+d/2)+")"),i!=null&&vd.has(i)){const K=r.colorIndex??0;y.attr("data-color-id",`color-${K%l.length}`)}const T=q.rectangle(R,z,O,F,A),W=y.insert(()=>T,":first-child").attr("class","outer-path").attr("style",f.join(""));w.push(0);for(const[K,Z]of S.entries()){const mt=(K+1)%2===0&&Z.yOffset!==0,ht=q.rectangle(R,x.height+z+Z?.yOffset,O,Z?.rowHeight,{...A,fill:mt?s:a,stroke:n});y.insert(()=>ht,"g.label").attr("style",f.join("")).attr("class",`row-rect-${mt?"even":"odd"}`)}const j=1e-4;let G=ci(R,x.height+z,O+R,x.height+z,j),X=q.polygon(G.map(K=>[K.x,K.y]),A);if(y.insert(()=>X).attr("class","divider"),G=ci(v+R,x.height+z,v+R,F+z,j),X=q.polygon(G.map(K=>[K.x,K.y]),A),y.insert(()=>X).attr("class","divider"),D){const K=v+_+R;G=ci(K,x.height+z,K,F+z,j),X=q.polygon(G.map(Z=>[Z.x,Z.y]),A),y.insert(()=>X).attr("class","divider")}if(M){const K=v+_+E+R;G=ci(K,x.height+z,K,F+z,j),X=q.polygon(G.map(Z=>[Z.x,Z.y]),A),y.insert(()=>X).attr("class","divider")}for(const K of w){const Z=x.height+z+K;G=ci(R,Z,O+R,Z,j),X=q.polygon(G.map(at=>[at.x,at.y]),A),y.insert(()=>X).attr("class","divider")}if(ot(t,W),g&&t.look!=="handDrawn")if(i!=null&&OB.has(i))y.selectAll("path").attr("style",g);else{const Z=g.split(";")?.filter(at=>at.includes("stroke"))?.map(at=>`${at}`).join("; ");y.selectAll("path").attr("style",Z??""),y.selectAll(".row-rect-even path").attr("style",g)}return t.intersect=function(K){return tt.rect(t,K)},y}p(Dh,"erBox");async function hi(e,t,r,i=0,o=0,s=[],a=""){const n=e.insert("g").attr("class",`label ${s.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==Ln(t)&&(t=Ln(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const l=n.node().appendChild(await Pe(n,t,{width:Ue(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(Ve(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=yt(l);c=h.getBoundingClientRect(),d.attr("width",c.width),d.attr("height",c.height)}return c}p(hi,"addText");function ci(e,t,r,i,o){return e===r?[{x:e-o/2,y:t},{x:e+o/2,y:t},{x:r+o/2,y:i},{x:r-o/2,y:i}]:[{x:e,y:t-o/2},{x:e,y:t+o/2},{x:r,y:i+o/2},{x:r,y:i-o/2}]}p(ci,"lineToPolygon");async function a0(e,t,r,i,o=r.class.padding??12){const s=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 mo(n,{text:`«${C}»`},0),d=n.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await mo(l,t,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,c=a.insert("g").attr("class","members-group text");let m=0;for(const C of t.members){const w=await mo(c,C,m,[C.parseClassifier()]);m+=w+s}u=c.node().getBBox().height,u<=0&&(u=o/2),h=a.insert("g").attr("class","methods-group text");let y=0;for(const C of t.methods){const w=await mo(h,C,y,[C.parseClassifier()]);y+=w+s}let x=a.node().getBBox();if(n!==null){const C=n.node().getBBox();n.attr("transform",`translate(${-C.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),x=a.node().getBBox(),c.attr("transform",`translate(0, ${d+f+o*2})`),x=a.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(u?u+o*4:o*2)})`),x=a.node().getBBox(),{shapeSvg:a,bbox:x}}p(a0,"textHelper");async function mo(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),s=Rt();let a="useHtmlLabels"in t?t.useHtmlLabels:Ve(s.htmlLabels)??!0,n="";"text"in t?n=t.text:n=t.label,!a&&n.startsWith("\\")&&(n=n.substring(1)),Ii(n)&&(a=!0);const l=await Pe(o,Yl(br(n)),{width:Ue(n,s)+50,classes:"markdown-node-label",useHtmlLabels:a},s);let c,h=1;if(a){const d=l.children[0],f=yt(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 g=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",g){const C=s.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,S=parseInt(C,10)*5+"px";m.style.minWidth=S,m.style.maxWidth=S}else m.style.width="100%";y(m)}p(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")&&yt(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 o.attr("transform","translate(0,"+(-c.height/(2*h)+r)+")"),c.height}p(mo,"addText");async function n0(e,t){const r=kt(),{themeVariables:i}=r,{useGradient:o}=i,s=r.class.padding??12,a=s,n=t.useHtmlLabels??Ve(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await a0(e,t,r,n,a),{labelStyles:d,nodeStyles:f}=it(t);t.labelStyle=d,t.cssStyles=l.styles||"";const u=l.styles?.join(";")||f||"";t.cssStyles||(t.cssStyles=u.replaceAll("!important","").split(";"));const g=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,m=rt.svg(c),y=et(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=Math.max(t.width??0,h.width);let C=Math.max(t.height??0,h.height);const w=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?C+=a:l.members.length>0&&l.methods.length===0&&(C+=a*2);const S=-x/2,v=-C/2;let _=g?s*2:l.members.length===0&&l.methods.length===0?-s:0;w&&(_=s*2);const E=m.rectangle(S-s,v-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0),x+2*s,C+2*s+_,y),B=c.insert(()=>E,":first-child");B.attr("class","basic label-container outer-path");const D=B.node().getBBox(),M=c.select(".annotation-group").node().getBBox().height-(g?s/2:0)||0,P=c.select(".label-group").node().getBBox().height-(g?s/2:0)||0,U=c.select(".members-group").node().getBBox().height-(g?s/2:0)||0,N=(M+P+v+s-(v-s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0)))/2;if(c.selectAll(".text").each((q,A,$)=>{const O=yt($[A]),F=O.attr("transform");let R=0;if(F){const j=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(F);j&&(R=parseFloat(j[2]))}let z=R+v+s-(g?s:l.members.length===0&&l.methods.length===0?-s/2:0);if(O.attr("class").includes("methods-group")){const W=Math.max(U,a/2);w?z=Math.max(N,M+P+W+v+a*2+s)+a*2:z=M+P+W+v+a*4+s}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?z=R-a:z=R),n||(z-=4);let T=S;(O.attr("class").includes("label-group")||O.attr("class").includes("annotation-group"))&&(T=-O.node()?.getBBox().width/2||0,c.selectAll("text").each(function(W,j,G){window.getComputedStyle(G[j]).textAnchor==="middle"&&(T=0)})),O.attr("transform",`translate(${T}, ${z})`)}),l.members.length>0||l.methods.length>0||g){const q=M+P+v+s,A=m.line(D.x,q,D.x+D.width,q+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(g||l.members.length>0||l.methods.length>0){const q=M+P+U+v+a*2+s,A=m.line(D.x,w?Math.max(N,q):q,D.x+D.width,(w?Math.max(N,q):q)+.001,y);c.insert(()=>A).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",u)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",u),B.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 q=RegExp(/color\s*:\s*([^;]*)/),A=q.exec(u);if(A){const $=A[0].replace("color","fill");c.selectAll("tspan").attr("style",$)}else if(d){const $=q.exec(d);if($){const O=$[0].replace("color","fill");c.selectAll("tspan").attr("style",O)}}}return ot(t,B),t.intersect=function(q){return tt.rect(t,q)},c}p(n0,"classBox");async function l0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const o=t,s=t,a=20,n=20,l="verifyMethod"in t,c=nt(t),{themeVariables:h}=kt(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,u=e.insert("g").attr("class",c).attr("id",t.domId??t.id);let g;l?g=await ze(u,`&lt;&lt;${o.type}&gt;&gt;`,0,t.labelStyle):g=await ze(u,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let m=g;const y=await ze(u,o.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+n,l){const D=await ze(u,`${o.requirementId?`ID: ${o.requirementId}`:""}`,m,t.labelStyle);m+=D;const M=await ze(u,`${o.text?`Text: ${o.text}`:""}`,m,t.labelStyle);m+=M;const P=await ze(u,`${o.risk?`Risk: ${o.risk}`:""}`,m,t.labelStyle);m+=P,await ze(u,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,m,t.labelStyle)}else{const D=await ze(u,`${s.type?`Type: ${s.type}`:""}`,m,t.labelStyle);m+=D,await ze(u,`${s.docRef?`Doc Ref: ${s.docRef}`:""}`,m,t.labelStyle)}const x=(u.node()?.getBBox().width??200)+a,C=(u.node()?.getBBox().height??200)+a,w=-x/2,S=-C/2,v=rt.svg(u),_=et(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const E=v.rectangle(w,S,x,C,_),B=u.insert(()=>E,":first-child");if(B.attr("class","basic label-container outer-path").attr("style",i),d?.length){const D=t.colorIndex??0;u.attr("data-color-id",`color-${D%d.length}`)}if(u.selectAll(".label").each((D,M,P)=>{const U=yt(P[M]),N=U.attr("transform");let q=0,A=0;if(N){const R=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(N);R&&(q=parseFloat(R[1]),A=parseFloat(R[2]))}const $=A-C/2;let O=w+a/2;(M===0||M===1)&&(O=q),U.attr("transform",`translate(${O}, ${$+a})`)}),m>g+y+n){const D=S+g+y+n;let M;if(t.look==="neo"){const N=[[w,D],[w+x,D],[w+x,D+.001],[w,D+.001]];M=v.polygon(N,_)}else M=v.line(w,D,w+x,D,_);u.insert(()=>M).attr("class","divider")}return ot(t,B),t.intersect=function(D){return tt.rect(t,D)},i&&t.look!=="handDrawn"&&(f||d?.length)&&u.selectAll("path").attr("style",i),u}p(l0,"requirementBox");async function ze(e,t,r,i=""){if(t==="")return 0;const o=e.insert("g").attr("class","label").attr("style",i),s=kt(),a=s.htmlLabels??!0,n=await Pe(o,Yl(br(t)),{width:Ue(t,s)+50,classes:"markdown-node-label",useHtmlLabels:a,style:i},s);let l;if(a){const c=n.children[0],h=yt(n);l=c.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const c=n.children[0];for(const h of c.children)i&&h.setAttribute("style",i);l=n.getBBox(),l.height+=6}return o.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}p(ze,"addText");var RB=p(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 h0(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=it(t);t.labelStyle=i||"";const s=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 g,m;f?{label:g,bbox:m}=await hn(f,"ticket"in t&&t.ticket||"",u):{label:g,bbox:m}=await hn(n,"ticket"in t&&t.ticket||"",u);const{label:y,bbox:x}=await hn(n,"assigned"in t&&t.assigned||"",u);t.width=a;const C=10,w=t?.width||0,S=Math.max(m.height,x.height)/2,v=Math.max(l.height+C*2,t?.height||0)+S,_=-w/2,E=-v/2;c.attr("transform","translate("+(h-w/2)+", "+(-S-l.height/2)+")"),g.attr("transform","translate("+(h-w/2)+", "+(-S+l.height/2)+")"),y.attr("transform","translate("+(h+w/2-x.width-2*s)+", "+(-S+l.height/2)+")");let B;const{rx:D,ry:M}=t,{cssStyles:P}=t;if(t.look==="handDrawn"){const U=rt.svg(n),N=et(t,{}),q=D||M?U.path(Sr(_,E,w,v,D||0),N):U.rectangle(_,E,w,v,N);B=n.insert(()=>q,":first-child"),B.attr("class","basic label-container").attr("style",P||null)}else{B=n.insert("rect",":first-child"),B.attr("class","basic label-container __APA__").attr("style",o).attr("rx",D??5).attr("ry",M??5).attr("x",_).attr("y",E).attr("width",w).attr("height",v);const U="priority"in t&&t.priority;if(U){const N=n.append("line"),q=_+2,A=E+Math.floor((D??0)/2),$=E+v-Math.floor((D??0)/2);N.attr("x1",q).attr("y1",A).attr("x2",q).attr("y2",$).attr("stroke-width","4").attr("stroke",RB(U))}}return ot(t,B),t.height=v,t.intersect=function(U){return tt.rect(t,U)},n}p(h0,"kanbanItem");async function c0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=s.width+10*a,c=s.height+8*a,h=.15*l,{cssStyles:d}=t,f=s.width+20,u=s.height+20,g=Math.max(l,f),m=Math.max(c,u);n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`);let y;const x=`M0 0
242
242
  a${h},${h} 1 0,0 ${g*.25},${-1*m*.1}
243
243
  a${h},${h} 1 0,0 ${g*.25},0
244
244
  a${h},${h} 1 0,0 ${g*.25},0
@@ -256,7 +256,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error
256
256
  a${h},${h} 1 0,0 ${-1*g*.1},${-1*m*.33}
257
257
  a${h*.8},${h*.8} 1 0,0 0,${-1*m*.34}
258
258
  a${h},${h} 1 0,0 ${g*.1},${-1*m*.33}
259
- H0 V0 Z`;if(t.look==="handDrawn"){const C=rt.svg(o),w=et(t,{}),S=C.path(x,w);y=o.insert(()=>S,":first-child"),y.attr("class","basic label-container").attr("style",Vt(d))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),ot(t,y),t.calcIntersect=function(C,w){return tt.rect(C,w)},t.intersect=function(C){return V.info("Bang intersect",t,C),tt.rect(t,C)},o}p(d0,"bang");async function u0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=s.width+2*a,c=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,u=.2*l,{cssStyles:g}=t;let m;const y=`M0 0
259
+ H0 V0 Z`;if(t.look==="handDrawn"){const C=rt.svg(o),w=et(t,{}),S=C.path(x,w);y=o.insert(()=>S,":first-child"),y.attr("class","basic label-container").attr("style",Vt(d))}else y=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",x);return y.attr("transform",`translate(${-g/2}, ${-m/2})`),ot(t,y),t.calcIntersect=function(C,w){return tt.rect(C,w)},t.intersect=function(C){return V.info("Bang intersect",t,C),tt.rect(t,C)},o}p(c0,"bang");async function d0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=s.width+2*a,c=s.height+2*a,h=.15*l,d=.25*l,f=.35*l,u=.2*l,{cssStyles:g}=t;let m;const y=`M0 0
260
260
  a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
261
261
  a${f},${f} 1 0,1 ${l*.4},${-1*l*.1}
262
262
  a${d},${d} 1 0,1 ${l*.35},${l*.2}
@@ -270,7 +270,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error
270
270
 
271
271
  a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
272
272
  a${u},${u} 1 0,1 ${l*.1},${-1*c*.65}
273
- H0 V0 Z`;if(t.look==="handDrawn"){const x=rt.svg(o),C=et(t,{}),w=x.path(y,C);m=o.insert(()=>w,":first-child"),m.attr("class","basic label-container").attr("style",Vt(g))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),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)},o}p(u0,"cloud");async function f0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=s.width+8*a,c=s.height+2*a,h=5,d=t.look==="neo"?`
273
+ H0 V0 Z`;if(t.look==="handDrawn"){const x=rt.svg(o),C=et(t,{}),w=x.path(y,C);m=o.insert(()=>w,":first-child"),m.attr("class","basic label-container").attr("style",Vt(g))}else m=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",y);return n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),m.attr("transform",`translate(${-l/2}, ${-c/2})`),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)},o}p(d0,"cloud");async function u0(e,t){const{labelStyles:r,nodeStyles:i}=it(t);t.labelStyle=r;const{shapeSvg:o,bbox:s,halfPadding:a,label:n}=await lt(e,t,nt(t)),l=s.width+8*a,c=s.height+2*a,h=5,d=t.look==="neo"?`
274
274
  M${-l/2} ${c/2-h}
275
275
  v${-c+2*h}
276
276
  q0,-${h} ${h},-${h}
@@ -290,26 +290,26 @@ Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error
290
290
  h${-(l-2*h)}
291
291
  q${-h},0 ${-h},${-h}
292
292
  Z
293
- `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),ot(t,f),t.calcIntersect=function(u,g){return tt.rect(u,g)},t.intersect=function(u){return tt.rect(t,u)},o}p(f0,"defaultMindmapNode");async function g0(e,t){const r={padding:t.padding??0};return Ph(e,t,r)}p(g0,"mindmapCircle");var IB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Yy},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:jy},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Uy},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Ky},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:gy},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:py},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Ph},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:d0},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:u0},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Ny},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:wy},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:My},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Ay},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:e0},{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:Ey},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:yy},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Jy},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:ay},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Wy},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Vy},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Xy},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:by},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Sy},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:cy},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:dy},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:uy},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:$y},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:o0},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:ky},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:t0},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:Oy},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:fy},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:my},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:i0},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:a0},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:xy},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:r0},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Cy},{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:Py},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Iy},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:sy},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:hy},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Qy},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Zy},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:s0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:qy},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Ry}],PB=p(()=>{const t=[...Object.entries({state:Gy,choice:ny,note:Dy,rectWithTitle:zy,labelRect:Fy,iconSquare:By,iconCircle:Ty,icon:vy,iconRounded:_y,imageSquare:Ly,anchor:iy,kanbanItem:c0,mindmapCircle:g0,defaultMindmapNode:f0,classBox:l0,erBox:Dh,requirementBox:h0}),...IB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),p0=PB();function m0(e){return e in p0}p(m0,"isValidShape");var Aa=new Map;async function Nh(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?p0[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",Vt(t.look)),t.tooltip&&o.attr("title",t.tooltip),Aa.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}p(Nh,"insertNode");var DB=p((e,t)=>{Aa.set(t.id,e)},"setNodeElem"),NB=p(()=>{Aa.clear()},"clear"),qB=p(e=>{const t=Aa.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"),di=p((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"),Jt={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},Td={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function yo(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Ot(e),t=Ot(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}p(yo,"calculateDeltaAndAngle");var Ot=p(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),y0=p(e=>({x:p(function(t,r,i){let o=0;const s=Ot(i[0]).x<Ot(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Jt,e.arrowTypeStart)){const{angle:u,deltaX:g}=yo(i[0],i[1]);o=Jt[e.arrowTypeStart]*Math.cos(u)*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Jt,e.arrowTypeEnd)){const{angle:u,deltaX:g}=yo(i[i.length-1],i[i.length-2]);o=Jt[e.arrowTypeEnd]*Math.cos(u)*(g>=0?1:-1)}const a=Math.abs(Ot(t).x-Ot(i[i.length-1]).x),n=Math.abs(Ot(t).y-Ot(i[i.length-1]).y),l=Math.abs(Ot(t).x-Ot(i[0]).x),c=Math.abs(Ot(t).y-Ot(i[0]).y),h=Jt[e.arrowTypeStart],d=Jt[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=s==="right"?-1:1,o-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=s==="right"?-1:1,o+=u}return Ot(t).x+o},"x"),y:p(function(t,r,i){let o=0;const s=Ot(i[0]).y<Ot(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Jt,e.arrowTypeStart)){const{angle:u,deltaY:g}=yo(i[0],i[1]);o=Jt[e.arrowTypeStart]*Math.abs(Math.sin(u))*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Jt,e.arrowTypeEnd)){const{angle:u,deltaY:g}=yo(i[i.length-1],i[i.length-2]);o=Jt[e.arrowTypeEnd]*Math.abs(Math.sin(u))*(g>=0?1:-1)}const a=Math.abs(Ot(t).y-Ot(i[i.length-1]).y),n=Math.abs(Ot(t).x-Ot(i[i.length-1]).x),l=Math.abs(Ot(t).y-Ot(i[0]).y),c=Math.abs(Ot(t).x-Ot(i[0]).x),h=Jt[e.arrowTypeStart],d=Jt[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=s==="up"?-1:1,o-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=s==="up"?-1:1,o+=u}return Ot(t).y+o},"y")}),"getLineFunctionsWithOffset"),zB=p((e,t,r,i,o,s=!1,a)=>{t.arrowTypeStart&&_d(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&_d(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),jB={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}},WB=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],_d=p((e,t,r,i,o,s,a=!1,n)=>{const l=jB[r],c=l&&WB.includes(l.type);if(!l){V.warn(`Unknown arrow type: ${r}`);return}const h=l.type,u=`${o}_${s}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const g=n.replace(/[^\dA-Za-z]/g,"_"),m=`${u}_${g}`;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(w=>{w.setAttribute("stroke",n),l.fill&&w.setAttribute("fill",n)}),y.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${u})`)},"addEdgeMarker"),HB=p(e=>typeof e=="string"?e:kt()?.flowchart?.curve,"resolveEdgeCurveType"),Io=new Map,Xt=new Map,YB=p(()=>{Io.clear(),Xt.clear()},"clear"),no=p(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),x0=p(async(e,t)=>{const r=kt();let i=ae(r);const{labelStyles:o}=it(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Pe(e,t.label,{style:no(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],g=yt(c);h=u.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const u=yt(c).select("text").node();u&&typeof u.getBBox=="function"&&(d=u.getBBox())}a.attr("transform",di(d,i)),Io.set(t.id,s),t.width=h.width,t.height=h.height;let f;if(t.startLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await gr(g,t.startLabelLeft,no(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",di(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).startLeft=u,xo(f,t.startLabelLeft)}if(t.startLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await gr(g,t.startLabelRight,no(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",di(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).startRight=u,xo(f,t.startLabelRight)}if(t.endLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await gr(u,t.endLabelLeft,no(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",di(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).endLeft=u,xo(f,t.endLabelLeft)}if(t.endLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await gr(u,t.endLabelRight,no(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",di(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).endRight=u,xo(f,t.endLabelRight)}return c},"insertEdgeLabel");function xo(e,t){ae(kt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}p(xo,"setTerminalWidth");var C0=p((e,t)=>{V.debug("Moving label abc88 ",e.id,e.label,Io.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=kt(),{subGraphTitleTotalMargin:o}=Ta(i);if(e.label){const s=Io.get(e.id);let a=e.x,n=e.y;if(r){const l=we.calcLabelPosition(r);V.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Xt.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Xt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Xt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Xt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),UB=p((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),s=Math.abs(i.y-r.y);return o<.001||s<.001?t:s>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),GB=p((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),XB=p((e,t,r)=>{V.debug(`intersection calc abc89:
293
+ `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const f=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-s.width/2}, ${-s.height/2})`),o.append(()=>n.node()),ot(t,f),t.calcIntersect=function(u,g){return tt.rect(u,g)},t.intersect=function(u){return tt.rect(t,u)},o}p(u0,"defaultMindmapNode");async function f0(e,t){const r={padding:t.padding??0};return Ph(e,t,r)}p(f0,"mindmapCircle");var IB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Hy},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:zy},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:Yy},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Vy},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:fy},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:gy},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Ph},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:c0},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:d0},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:Dy},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:ky},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Ay},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Fy},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:t0},{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:Ly},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:my},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Qy},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:sy},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:jy},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Xy},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Gy},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:Cy},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:wy},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:hy},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:cy},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:dy},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:My},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:i0},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:by},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Jy},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:$y},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:uy},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:py},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:r0},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:s0},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:yy},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:e0},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:xy},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Wy},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:Iy},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:Ry},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:oy},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:ly},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Zy},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Ky},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:o0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:Ny},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:Oy}],PB=p(()=>{const t=[...Object.entries({state:Uy,choice:ay,note:Py,rectWithTitle:qy,labelRect:Ey,iconSquare:_y,iconCircle:vy,icon:Sy,iconRounded:Ty,imageSquare:By,anchor:ry,kanbanItem:h0,mindmapCircle:f0,defaultMindmapNode:u0,classBox:n0,erBox:Dh,requirementBox:l0}),...IB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),g0=PB();function p0(e){return e in g0}p(p0,"isValidShape");var Aa=new Map;async function Nh(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const s=t.shape?g0[t.shape]:void 0;if(!s)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await s(i,t,r)}else o=await s(e,t,r),i=o;return i.attr("data-look",Vt(t.look)),t.tooltip&&o.attr("title",t.tooltip),Aa.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}p(Nh,"insertNode");var DB=p((e,t)=>{Aa.set(t.id,e)},"setNodeElem"),NB=p(()=>{Aa.clear()},"clear"),qB=p(e=>{const t=Aa.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"),di=p((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"),Jt={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},Td={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function yo(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Ot(e),t=Ot(t);const[r,i]=[e.x,e.y],[o,s]=[t.x,t.y],a=o-r,n=s-i;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}p(yo,"calculateDeltaAndAngle");var Ot=p(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),m0=p(e=>({x:p(function(t,r,i){let o=0;const s=Ot(i[0]).x<Ot(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Jt,e.arrowTypeStart)){const{angle:u,deltaX:g}=yo(i[0],i[1]);o=Jt[e.arrowTypeStart]*Math.cos(u)*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Jt,e.arrowTypeEnd)){const{angle:u,deltaX:g}=yo(i[i.length-1],i[i.length-2]);o=Jt[e.arrowTypeEnd]*Math.cos(u)*(g>=0?1:-1)}const a=Math.abs(Ot(t).x-Ot(i[i.length-1]).x),n=Math.abs(Ot(t).y-Ot(i[i.length-1]).y),l=Math.abs(Ot(t).x-Ot(i[0]).x),c=Math.abs(Ot(t).y-Ot(i[0]).y),h=Jt[e.arrowTypeStart],d=Jt[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=s==="right"?-1:1,o-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=s==="right"?-1:1,o+=u}return Ot(t).x+o},"x"),y:p(function(t,r,i){let o=0;const s=Ot(i[0]).y<Ot(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Jt,e.arrowTypeStart)){const{angle:u,deltaY:g}=yo(i[0],i[1]);o=Jt[e.arrowTypeStart]*Math.abs(Math.sin(u))*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Jt,e.arrowTypeEnd)){const{angle:u,deltaY:g}=yo(i[i.length-1],i[i.length-2]);o=Jt[e.arrowTypeEnd]*Math.abs(Math.sin(u))*(g>=0?1:-1)}const a=Math.abs(Ot(t).y-Ot(i[i.length-1]).y),n=Math.abs(Ot(t).x-Ot(i[i.length-1]).x),l=Math.abs(Ot(t).y-Ot(i[0]).y),c=Math.abs(Ot(t).x-Ot(i[0]).x),h=Jt[e.arrowTypeStart],d=Jt[e.arrowTypeEnd],f=1;if(a<d&&a>0&&n<d){let u=d+f-a;u*=s==="up"?-1:1,o-=u}if(l<h&&l>0&&c<h){let u=h+f-l;u*=s==="up"?-1:1,o+=u}return Ot(t).y+o},"y")}),"getLineFunctionsWithOffset"),zB=p((e,t,r,i,o,s=!1,a)=>{t.arrowTypeStart&&_d(e,"start",t.arrowTypeStart,r,i,o,s,a),t.arrowTypeEnd&&_d(e,"end",t.arrowTypeEnd,r,i,o,s,a)},"addEdgeMarkers"),jB={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}},WB=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],_d=p((e,t,r,i,o,s,a=!1,n)=>{const l=jB[r],c=l&&WB.includes(l.type);if(!l){V.warn(`Unknown arrow type: ${r}`);return}const h=l.type,u=`${o}_${s}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const g=n.replace(/[^\dA-Za-z]/g,"_"),m=`${u}_${g}`;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(w=>{w.setAttribute("stroke",n),l.fill&&w.setAttribute("fill",n)}),y.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${i}#${m})`)}else e.attr(`marker-${t}`,`url(${i}#${u})`)},"addEdgeMarker"),HB=p(e=>typeof e=="string"?e:kt()?.flowchart?.curve,"resolveEdgeCurveType"),Io=new Map,Xt=new Map,YB=p(()=>{Io.clear(),Xt.clear()},"clear"),no=p(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),y0=p(async(e,t)=>{const r=kt();let i=ae(r);const{labelStyles:o}=it(t);t.labelStyle=o;const s=e.insert("g").attr("class","edgeLabel"),a=s.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await Pe(e,t.label,{style:no(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],g=yt(c);h=u.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const u=yt(c).select("text").node();u&&typeof u.getBBox=="function"&&(d=u.getBBox())}a.attr("transform",di(d,i)),Io.set(t.id,s),t.width=h.width,t.height=h.height;let f;if(t.startLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await gr(g,t.startLabelLeft,no(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",di(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).startLeft=u,xo(f,t.startLabelLeft)}if(t.startLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await gr(g,t.startLabelRight,no(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",di(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).startRight=u,xo(f,t.startLabelRight)}if(t.endLabelLeft){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await gr(u,t.endLabelLeft,no(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",di(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).endLeft=u,xo(f,t.endLabelLeft)}if(t.endLabelRight){const u=e.insert("g").attr("class","edgeTerminals"),g=u.insert("g").attr("class","inner"),m=await gr(u,t.endLabelRight,no(t.labelStyle)||"",!1,!1);f=m;let y=m.getBBox();if(i){const x=m.children[0],C=yt(m);y=x.getBoundingClientRect(),C.attr("width",y.width),C.attr("height",y.height)}g.attr("transform",di(y,i)),Xt.get(t.id)||Xt.set(t.id,{}),Xt.get(t.id).endRight=u,xo(f,t.endLabelRight)}return c},"insertEdgeLabel");function xo(e,t){ae(kt())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}p(xo,"setTerminalWidth");var x0=p((e,t)=>{V.debug("Moving label abc88 ",e.id,e.label,Io.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=kt(),{subGraphTitleTotalMargin:o}=Ta(i);if(e.label){const s=Io.get(e.id);let a=e.x,n=e.y;if(r){const l=we.calcLabelPosition(r);V.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}s.attr("transform",`translate(${a}, ${n+o/2})`)}if(e.startLabelLeft){const s=Xt.get(e.id).startLeft;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const s=Xt.get(e.id).startRight;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const s=Xt.get(e.id).endLeft;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const s=Xt.get(e.id).endRight;let a=e.x,n=e.y;if(r){const l=we.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,n=l.y}s.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),UB=p((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),s=Math.abs(i.y-r.y);return o<.001||s<.001?t:s>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),GB=p((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),s=Math.abs(t.y-i),a=e.width/2,n=e.height/2;return o>=a||s>=n},"outsideNode"),XB=p((e,t,r)=>{V.debug(`intersection calc abc89:
294
294
  outsidePoint: ${JSON.stringify(t)}
295
295
  insidePoint : ${JSON.stringify(r)}
296
- node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-s:a+s;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(o-t.y)*a>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-o:o-l-t.y;n=h*d/c;const 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"),Bd=p((e,t)=>{V.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(V.info("abc88 checking point",s,t),!GB(t,s)&&!o){const a=XB(t,i,s);V.debug("abc88 inside",s,i,a),V.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?V.warn("abc88 no intersect",a,r):r.push(a),o=!0}else V.warn("abc88 outside",s,i),i=s,o||r.push(s)}),V.debug("returning points",r),r},"cutPathAtIntersect");function b0(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],s=e[i],a=e[i+1];(o.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(b0,"extractCornerPoints");var Ld=p(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),VB=p(function(e){const{cornerPointPositions:t}=b0(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],s=e[i+1],a=e[i],n=Ld(o,a,5),l=Ld(s,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(s.x-o.x)>10&&Math.abs(s.y-o.y)>=10){V.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const 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(s.x-o.x),Math.abs(s.y-o.y));r.push(f,l)}else r.push(e[i]);return r},"fixCorners"),KB=p((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),l=Array(n).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),k0=p(function(e,t,r,i,o,s,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=kt();let h=t.points,d=!1;const f=o;var u=s;const g=[];for(const F in t.cssCompiledStyles)dh(F)||g.push(t.cssCompiledStyles[F]);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 F=h.slice(1,-1),R=F[0],z=F[F.length-1],T=.5,W=Math.abs(h[h.length-1].x-z.x)<T&&Math.abs(h[h.length-1].y-z.y)<T,j=f.intersect(R),G=W?z:u.intersect(z),X=Math.abs(G.x-z.x)<T&&Math.abs(G.y-z.y)<T,Z=Math.abs(j.x-R.x)<T&&Math.abs(j.y-R.y)<T?[]:[j],at=X?[]:[G];h=[...Z,...F,...at]}h=UB(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=Bd(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=Bd(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(F=>!Number.isNaN(F.y));const x=HB(t.curve);x!=="rounded"&&(y=VB(y));let C=wo;switch(x){case"linear":C=wo;break;case"basis":C=Ns;break;case"cardinal":C=Rf;break;case"bumpX":C=Ff;break;case"bumpY":C=Af;break;case"catmullRom":C=Pf;break;case"monotoneX":C=Wf;break;case"monotoneY":C=Hf;break;case"natural":C=Uf;break;case"step":C=Gf;break;case"stepAfter":C=Vf;break;case"stepBefore":C=Xf;break;case"rounded":C=wo;break;default:C=Ns}const{x:w,y:S}=y0(t),v=Lf().x(w).y(S).curve(C);let _;switch(t.thickness){case"normal":_="edge-thickness-normal";break;case"thick":_="edge-thickness-thick";break;case"invisible":_="edge-thickness-invisible";break;default:_="edge-thickness-normal"}switch(t.pattern){case"solid":_+=" edge-pattern-solid";break;case"dotted":_+=" edge-pattern-dotted";break;case"dashed":_+=" edge-pattern-dashed";break;default:_+=" edge-pattern-solid"}let E,B=x==="rounded"?w0(S0(y,t),5):v(y);const D=Array.isArray(t.style)?t.style:[t.style];let M=D.find(F=>F?.startsWith("stroke:")),P="";t.animate&&(P="edge-animation-fast"),t.animation&&(P="edge-animation-"+t.animation);let U=!1;if(t.look==="handDrawn"){const F=rt.svg(e);Object.assign([],y);const R=F.path(B,{roughness:.3,seed:l});_+=" transition",E=yt(R).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(P?" "+P:"")).attr("style",D?D.reduce((T,W)=>T+";"+W,""):"");let z=E.attr("d");E.attr("d",z),e.node().appendChild(E.node())}else{const F=g.join(";"),R=D?D.reduce((X,K)=>X+K+";",""):"",z=(F?F+";"+R+";":R)+";"+(D?D.reduce((X,K)=>X+";"+K,""):"");E=e.append("path").attr("d",B).attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(P?" "+P:"")).attr("style",z),M=z.match(/stroke:([^;]+)/)?.[1],U=t.animate===!0||!!t.animation||F.includes("animation");const T=E.node(),W=typeof T.getTotalLength=="function"?T.getTotalLength():0,j=Td[t.arrowTypeStart]||0,G=Td[t.arrowTypeEnd]||0;if(t.look==="neo"&&!U){const K=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?KB(W,j,G):`0 ${j} ${W-j-G} ${G}`}; stroke-dashoffset: 0;`;E.attr("style",K+E.attr("style"))}}E.attr("data-edge",!0),E.attr("data-et","edge"),E.attr("data-id",t.id),E.attr("data-points",m),E.attr("data-look",Vt(t.look)),t.showPoints&&y.forEach(F=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",F.x).attr("cy",F.y)});let N="";(kt().flowchart.arrowMarkerAbsolute||kt().state.arrowMarkerAbsolute)&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",t.arrowTypeStart),V.info("arrowTypeEnd",t.arrowTypeEnd);const q=!U&&t?.look==="neo";zB(E,t,N,a,i,q,M);const A=Math.floor(h.length/2),$=h[A];we.isLabelCoordinateInPath($,E.attr("d"))||(d=!0);let O={};return d&&(O.updatedPath=h),O.originalPath=t.points,O},"insertEdge");function w0(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s<i;s++){const a=e[s],n=e[s-1],l=e[s+1];if(s===0)r+=`M${a.x},${a.y}`;else if(s===i-1)r+=`L${a.x},${a.y}`;else{const c=a.x-n.x,h=a.y-n.y,d=l.x-a.x,f=l.y-a.y,u=Math.hypot(c,h),g=Math.hypot(d,f);if(u<o||g<o){r+=`L${a.x},${a.y}`;continue}const m=c/u,y=h/u,x=d/g,C=f/g,w=m*x+y*C,S=Math.max(-1,Math.min(1,w)),v=Math.acos(S);if(v<o||Math.abs(Math.PI-v)<o){r+=`L${a.x},${a.y}`;continue}const _=Math.min(t/Math.sin(v/2),u/2,g/2),E=a.x-m*_,B=a.y-y*_,D=a.x+x*_,M=a.y+C*_;r+=`L${E},${B}`,r+=`Q${a.x},${a.y} ${D},${M}`}}return r}p(w0,"generateRoundedPath");function bl(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}}p(bl,"calculateDeltaAndAngle");function S0(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&Jt[t.arrowTypeStart]){const o=Jt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=bl(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&Jt[t.arrowTypeEnd]){const o=Jt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=bl(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}p(S0,"applyMarkerOffsetsToPoints");var ZB=p((e,t,r,i)=>{t.forEach(o=>{bL[o](e,r,i)})},"insertMarkers"),QB=p((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"),JB=p((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"),tL=p((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"),eL=p((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"),rL=p((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"),iL=p((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"),oL=p((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"),sL=p((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"),aL=p((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"),nL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{transitionColor:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),lL=p((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"),hL=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),cL=p((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"),dL=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),uL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),fL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),gL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),pL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),mL=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
296
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,s=Math.abs(i-r.x),a=e.width/2;let n=r.x<t.x?a-s:a+s;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(o-t.y)*a>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-o:o-l-t.y;n=h*d/c;const 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"),Bd=p((e,t)=>{V.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(s=>{if(V.info("abc88 checking point",s,t),!GB(t,s)&&!o){const a=XB(t,i,s);V.debug("abc88 inside",s,i,a),V.debug("abc88 intersection",a,t);let n=!1;r.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?V.warn("abc88 no intersect",a,r):r.push(a),o=!0}else V.warn("abc88 outside",s,i),i=s,o||r.push(s)}),V.debug("returning points",r),r},"cutPathAtIntersect");function C0(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],s=e[i],a=e[i+1];(o.x===s.x&&s.y===a.y&&Math.abs(s.x-a.x)>5&&Math.abs(s.y-o.y)>5||o.y===s.y&&s.x===a.x&&Math.abs(s.x-o.x)>5&&Math.abs(s.y-a.y)>5)&&(t.push(s),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}p(C0,"extractCornerPoints");var Ld=p(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,s=Math.sqrt(i*i+o*o),a=r/s;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),VB=p(function(e){const{cornerPointPositions:t}=C0(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],s=e[i+1],a=e[i],n=Ld(o,a,5),l=Ld(s,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(s.x-o.x)>10&&Math.abs(s.y-o.y)>=10){V.debug("Corner point fixing",Math.abs(s.x-o.x),Math.abs(s.y-o.y));const 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(s.x-o.x),Math.abs(s.y-o.y));r.push(f,l)}else r.push(e[i]);return r},"fixCorners"),KB=p((e,t,r)=>{const i=e-t-r,o=2,s=2,a=o+s,n=Math.floor(i/a),l=Array(n).fill(`${o} ${s}`).join(" ");return`0 ${t} ${l} ${r}`},"generateDashArray"),b0=p(function(e,t,r,i,o,s,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=kt();let h=t.points,d=!1;const f=o;var u=s;const g=[];for(const F in t.cssCompiledStyles)dh(F)||g.push(t.cssCompiledStyles[F]);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 F=h.slice(1,-1),R=F[0],z=F[F.length-1],T=.5,W=Math.abs(h[h.length-1].x-z.x)<T&&Math.abs(h[h.length-1].y-z.y)<T,j=f.intersect(R),G=W?z:u.intersect(z),X=Math.abs(G.x-z.x)<T&&Math.abs(G.y-z.y)<T,Z=Math.abs(j.x-R.x)<T&&Math.abs(j.y-R.y)<T?[]:[j],at=X?[]:[G];h=[...Z,...F,...at]}h=UB(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=Bd(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=Bd(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let y=h.filter(F=>!Number.isNaN(F.y));const x=HB(t.curve);x!=="rounded"&&(y=VB(y));let C=wo;switch(x){case"linear":C=wo;break;case"basis":C=Ns;break;case"cardinal":C=Of;break;case"bumpX":C=Ef;break;case"bumpY":C=Ff;break;case"catmullRom":C=If;break;case"monotoneX":C=jf;break;case"monotoneY":C=Wf;break;case"natural":C=Yf;break;case"step":C=Uf;break;case"stepAfter":C=Xf;break;case"stepBefore":C=Gf;break;case"rounded":C=wo;break;default:C=Ns}const{x:w,y:S}=m0(t),v=Bf().x(w).y(S).curve(C);let _;switch(t.thickness){case"normal":_="edge-thickness-normal";break;case"thick":_="edge-thickness-thick";break;case"invisible":_="edge-thickness-invisible";break;default:_="edge-thickness-normal"}switch(t.pattern){case"solid":_+=" edge-pattern-solid";break;case"dotted":_+=" edge-pattern-dotted";break;case"dashed":_+=" edge-pattern-dashed";break;default:_+=" edge-pattern-solid"}let E,B=x==="rounded"?k0(w0(y,t),5):v(y);const D=Array.isArray(t.style)?t.style:[t.style];let M=D.find(F=>F?.startsWith("stroke:")),P="";t.animate&&(P="edge-animation-fast"),t.animation&&(P="edge-animation-"+t.animation);let U=!1;if(t.look==="handDrawn"){const F=rt.svg(e);Object.assign([],y);const R=F.path(B,{roughness:.3,seed:l});_+=" transition",E=yt(R).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(P?" "+P:"")).attr("style",D?D.reduce((T,W)=>T+";"+W,""):"");let z=E.attr("d");E.attr("d",z),e.node().appendChild(E.node())}else{const F=g.join(";"),R=D?D.reduce((X,K)=>X+K+";",""):"",z=(F?F+";"+R+";":R)+";"+(D?D.reduce((X,K)=>X+";"+K,""):"");E=e.append("path").attr("d",B).attr("id",`${a}-${t.id}`).attr("class"," "+_+(t.classes?" "+t.classes:"")+(P?" "+P:"")).attr("style",z),M=z.match(/stroke:([^;]+)/)?.[1],U=t.animate===!0||!!t.animation||F.includes("animation");const T=E.node(),W=typeof T.getTotalLength=="function"?T.getTotalLength():0,j=Td[t.arrowTypeStart]||0,G=Td[t.arrowTypeEnd]||0;if(t.look==="neo"&&!U){const K=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?KB(W,j,G):`0 ${j} ${W-j-G} ${G}`}; stroke-dashoffset: 0;`;E.attr("style",K+E.attr("style"))}}E.attr("data-edge",!0),E.attr("data-et","edge"),E.attr("data-id",t.id),E.attr("data-points",m),E.attr("data-look",Vt(t.look)),t.showPoints&&y.forEach(F=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",F.x).attr("cy",F.y)});let N="";(kt().flowchart.arrowMarkerAbsolute||kt().state.arrowMarkerAbsolute)&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),V.info("arrowTypeStart",t.arrowTypeStart),V.info("arrowTypeEnd",t.arrowTypeEnd);const q=!U&&t?.look==="neo";zB(E,t,N,a,i,q,M);const A=Math.floor(h.length/2),$=h[A];we.isLabelCoordinateInPath($,E.attr("d"))||(d=!0);let O={};return d&&(O.updatedPath=h),O.originalPath=t.points,O},"insertEdge");function k0(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let s=0;s<i;s++){const a=e[s],n=e[s-1],l=e[s+1];if(s===0)r+=`M${a.x},${a.y}`;else if(s===i-1)r+=`L${a.x},${a.y}`;else{const c=a.x-n.x,h=a.y-n.y,d=l.x-a.x,f=l.y-a.y,u=Math.hypot(c,h),g=Math.hypot(d,f);if(u<o||g<o){r+=`L${a.x},${a.y}`;continue}const m=c/u,y=h/u,x=d/g,C=f/g,w=m*x+y*C,S=Math.max(-1,Math.min(1,w)),v=Math.acos(S);if(v<o||Math.abs(Math.PI-v)<o){r+=`L${a.x},${a.y}`;continue}const _=Math.min(t/Math.sin(v/2),u/2,g/2),E=a.x-m*_,B=a.y-y*_,D=a.x+x*_,M=a.y+C*_;r+=`L${E},${B}`,r+=`Q${a.x},${a.y} ${D},${M}`}}return r}p(k0,"generateRoundedPath");function bl(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}}p(bl,"calculateDeltaAndAngle");function w0(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&Jt[t.arrowTypeStart]){const o=Jt[t.arrowTypeStart],s=e[0],a=e[1],{angle:n}=bl(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=s.x+l,r[0].y=s.y+c}const i=e.length;if(i>=2&&Jt[t.arrowTypeEnd]){const o=Jt[t.arrowTypeEnd],s=e[i-1],a=e[i-2],{angle:n}=bl(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=s.x-l,r[i-1].y=s.y-c}return r}p(w0,"applyMarkerOffsetsToPoints");var ZB=p((e,t,r,i)=>{t.forEach(o=>{bL[o](e,r,i)})},"insertMarkers"),QB=p((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"),JB=p((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"),tL=p((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"),eL=p((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"),rL=p((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"),iL=p((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"),oL=p((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"),sL=p((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"),aL=p((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"),nL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{transitionColor:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${s}`)},"barbNeo"),lL=p((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"),hL=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),cL=p((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"),dL=p((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),uL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${s}`)},"only_one_neo"),fL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${s}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${s}`)},"zero_or_one_neo"),gL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${s}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${s}`)},"one_or_more_neo"),pL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s,mainBkg:a}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${s}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${s}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${s}`)},"zero_or_more_neo"),mL=p((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
297
297
  L20,10
298
298
  M20,10
299
299
  L0,20`)},"requirement_arrow"),yL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${s}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
300
300
  L20,10
301
301
  M20,10
302
- L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),xL=p((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"),CL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),bL={extension:QB,composition:JB,aggregation:tL,dependency:eL,lollipop:rL,point:iL,circle:oL,cross:sL,barb:aL,barbNeo:nL,only_one:lL,zero_or_one:hL,one_or_more:cL,zero_or_more:dL,only_one_neo:uL,zero_or_one_neo:fL,one_or_more_neo:gL,zero_or_more_neo:pL,requirement_arrow:mL,requirement_contains:xL,requirement_arrow_neo:yL,requirement_contains_neo:CL},v0=ZB,kL={common:Yi,getConfig:Rt,insertCluster:Km,insertEdge:k0,insertEdgeLabel:x0,insertMarkers:v0,insertNode:Nh,interpolateToCurve:xh,labelHelper:lt,log:V,positionEdgeLabel:C0},Po={},T0=p(e=>{for(const t of e)Po[t.name]=t},"registerLayoutLoaders"),wL=p(()=>{T0([{name:"dagre",loader:p(async()=>await Promise.resolve().then(()=>require("./dagre-VKFMJZFB-CgElKLzH.cjs")),"loader")},{name:"swimlane",loader:p(async()=>await Promise.resolve().then(()=>require("./swimlanes-5IMT3BWC-DnJUaQXb.cjs")),"loader")},{name:"cose-bilkent",loader:p(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-JH36ORCC-Oumpy_6v.cjs")),"loader")}])},"registerDefaultLayoutLoaders");wL();var SL=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Po))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=Po[e.layoutAlgorithm],o=await i.loader(),{theme:s,themeVariables:a}=e.config,{useGradient:n,gradientStart:l,gradientStop:c}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),n){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return o.render(e,t,kL,{algorithm:i.algorithm},r)},"render"),vL=p((e="",{fallback:t="dagre"}={})=>{if(e in Po)return e;if(t in Po)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"),qh="comm",_0="rule",B0="decl",TL="@media",_L="@import",BL="@supports",LL="@namespace",kl="@keyframes",L0="@layer",EL="@scope",FL=Math.abs,To=String.fromCharCode;function E0(e){return e.trim()}function wl(e,t,r){return e.replace(t,r)}function yi(e,t){return e.charCodeAt(t)|0}function ji(e,t,r){return e.slice(t,r)}function je(e){return e.length}function F0(e){return e.length}function ls(e,t){return t.push(e),e}var Ma=1,Wi=1,A0=0,ve=0,zt=0,Ki="";function zh(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:Ma,column:Wi,length:a,return:"",siblings:n}}function AL(){return zt}function ML(){return zt=ve>0?yi(Ki,--ve):0,Wi--,zt===10&&(Wi=1,Ma--),zt}function Oe(){return zt=ve<A0?yi(Ki,ve++):0,Wi++,zt===10&&(Wi=1,Ma++),zt}function pr(){return yi(Ki,ve)}function ws(){return ve}function $a(e,t){return ji(Ki,e,t)}function Do(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 $L(e){return Ma=Wi=1,A0=je(Ki=e),ve=0,[]}function OL(e){return Ki="",e}function dn(e){return E0($a(ve-1,Sl(e===91?e+2:e===40?e+1:e)))}function RL(e){for(;(zt=pr())&&zt<33;)Oe();return Do(e)>2||Do(zt)>3?"":" "}function IL(e,t){for(;--t&&Oe()&&!(zt<48||zt>102||zt>57&&zt<65||zt>70&&zt<97););return $a(e,ws()+(t<6&&pr()==32&&Oe()==32))}function Sl(e){for(;Oe();)switch(zt){case e:return ve;case 34:case 39:e!==34&&e!==39&&Sl(zt);break;case 40:e===41&&Sl(e);break;case 92:Oe();break}return ve}function PL(e,t){for(;Oe()&&e+zt!==57;)if(e+zt===84&&pr()===47)break;return"/*"+$a(t,ve-1)+"*"+To(e===47?e:Oe())}function DL(e){for(;!Do(pr());)Oe();return $a(e,ve)}function NL(e){return OL(Ss("",null,null,null,[""],e=$L(e),0,[0],e))}function Ss(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,g=0,m=1,y=1,x=1,C=0,w=0,S="",v=o,_=s,E=i,B=S;y;)switch(g=w,w=Oe()){case 40:g!=108&&yi(B,d-1)==58?(C++,B+="("):B+=dn(w);break;case 41:C--,B+=")";break;case 34:case 39:case 91:B+=dn(w);break;case 9:case 10:case 13:case 32:if(C>0){B+=To(w);break}B+=RL(g);break;case 92:B+=IL(ws()-1,7);continue;case 47:switch(pr()){case 42:case 47:ls(qL(PL(Oe(),ws()),t,r,l),l),(Do(g||1)==5||Do(pr()||1)==5)&&je(B)&&ji(B,-1,void 0)!==" "&&(B+=" ");break;default:B+="/"}break;case 123*m:n[c++]=je(B)*x;case 125*m:case 59:case 0:if(C>0&&w){B+=To(w);break}switch(w){case 0:case 125:y=0;case 59+h:x==-1&&(B=wl(B,/\f/g,"")),u>0&&(je(B)-d||m===0)&&ls(u>32?Fd(B+";",i,r,d-1,l):Fd(wl(B," ","")+";",i,r,d-2,l),l);break;case 59:B+=";";default:if(ls(E=Ed(B,t,r,c,h,o,n,S,v=[],_=[],d,s),s),w===123)if(h===0)Ss(B,t,E,E,v,s,d,n,_);else{switch(f){case 99:if(yi(B,3)===110)break;case 108:if(yi(B,2)===97)break;default:h=0;case 100:case 109:case 115:}h?Ss(e,E,E,i&&ls(Ed(e,E,E,0,0,o,n,S,o,v=[],d,_),_),o,_,d,n,i?v:_):Ss(B,E,E,E,[""],_,0,n,_)}}c=h=u=0,m=x=1,S=B="",d=a;break;case 58:d=1+je(B),u=g;default:if(m<1){if(w==123)--m;else if(w==125&&m++==0&&ML()==125)continue}switch(B+=To(w),w*m){case 38:x=h>0?1:(B+="\f",-1);break;case 44:if(C>0)break;n[c++]=(je(B)-1)*x,x=1;break;case 64:pr()===45&&(B+=dn(Oe())),f=pr(),h=d=je(S=B+=DL(ws())),w++;break;case 45:g===45&&je(B)==2&&(m=0)}}return s}function Ed(e,t,r,i,o,s,a,n,l,c,h,d){for(var f=o-1,u=o===0?s:[""],g=F0(u),m=0,y=0,x=0;m<i;++m)for(var C=0,w=ji(e,f+1,f=FL(y=a[m])),S=e;C<g;++C)(S=E0(y>0?u[C]+" "+w:wl(w,/&\f/g,u[C])))&&(l[x++]=S);return zh(e,t,r,o===0?_0:n,l,c,h,d)}function qL(e,t,r,i){return zh(e,t,r,qh,To(AL()),ji(e,2,-2),0,i)}function Fd(e,t,r,i,o){return zh(e,t,r,B0,ji(e,0,i),ji(e,i+1,-1),i,o)}function vl(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function zL(e,t,r,i){switch(e.type){case L0:if(e.children.length)break;case _L:case LL:case B0:return e.return=e.return||e.value;case qh:return"";case kl:return e.return=e.value+"{"+vl(e.children,i)+"}";case _0:if(!je(e.value=e.props.join(",")))return""}return je(r=vl(e.children,i))?e.return=e.value+"{"+r+"}":""}function jL(e){var t=F0(e);return function(r,i,o,s){for(var a="",n=0;n<t;n++)a+=e[n](r,i,o,s)||"";return a}}var M0="c4",WL=p(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),HL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./c4Diagram-LMCZKHZV-B1aKWPmK.cjs"));return{id:M0,diagram:e}},"loader"),YL={id:M0,detector:WL,loader:HL},UL=YL,$0="flowchart",GL=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),XL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-65_ty-RL.cjs"));return{id:$0,diagram:e}},"loader"),VL={id:$0,detector:GL,loader:XL},KL=VL,O0="flowchart-v2",ZL=p((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"),QL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-65_ty-RL.cjs"));return{id:O0,diagram:e}},"loader"),JL={id:O0,detector:ZL,loader:QL},tE=JL,R0="swimlane",eE=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),rE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./swimlanesDiagram-G3AALYLV-CkaRKbTf.cjs"));return{id:R0,diagram:e}},"loader"),iE={id:R0,detector:eE,loader:rE},oE=iE,I0="er",sE=p(e=>/^\s*erDiagram/.test(e),"detector"),aE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./erDiagram-Q63AITRT-JQ8mB_gP.cjs"));return{id:I0,diagram:e}},"loader"),nE={id:I0,detector:sE,loader:aE},lE=nE,P0="gitGraph",hE=p(e=>/^\s*gitGraph/.test(e),"detector"),cE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./gitGraphDiagram-IHSO6WYX-DgU3_Ajk.cjs"));return{id:P0,diagram:e}},"loader"),dE={id:P0,detector:hE,loader:cE},uE=dE,D0="gantt",fE=p(e=>/^\s*gantt/.test(e),"detector"),gE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ganttDiagram-NO4QXBWP-NCQuQN5D.cjs"));return{id:D0,diagram:e}},"loader"),pE={id:D0,detector:fE,loader:gE},mE=pE,N0="info",yE=p(e=>/^\s*info/.test(e),"detector"),xE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./infoDiagram-FWYZ7A6U-CuBWdwjx.cjs"));return{id:N0,diagram:e}},"loader"),CE={id:N0,detector:yE,loader:xE},q0="pie",bE=p(e=>/^\s*pie/.test(e),"detector"),kE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pieDiagram-ENE6RG2P-DWodV_iM.cjs"));return{id:q0,diagram:e}},"loader"),wE={id:q0,detector:bE,loader:kE},z0="quadrantChart",SE=p(e=>/^\s*quadrantChart/.test(e),"detector"),vE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./quadrantDiagram-ABIIQ3AL-DgGHlHJM.cjs"));return{id:z0,diagram:e}},"loader"),TE={id:z0,detector:SE,loader:vE},_E=TE,j0="xychart",BE=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),LE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./xychartDiagram-FW5EYKEG-dNt0UBQC.cjs"));return{id:j0,diagram:e}},"loader"),EE={id:j0,detector:BE,loader:LE},FE=EE,W0="requirement",AE=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),ME=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./requirementDiagram-TGXJPOKE-TQYdLBAs.cjs"));return{id:W0,diagram:e}},"loader"),$E={id:W0,detector:AE,loader:ME},OE=$E,H0="sequence",RE=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),IE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sequenceDiagram-DBY2YBRQ-Jk8ZVpEA.cjs"));return{id:H0,diagram:e}},"loader"),PE={id:H0,detector:RE,loader:IE},DE=PE,Y0="class",NE=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),qE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-OUVF2IWQ-Ddcj3Uwq.cjs"));return{id:Y0,diagram:e}},"loader"),zE={id:Y0,detector:NE,loader:qE},jE=zE,U0="classDiagram",WE=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),HE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-v2-EOCWNBFH-Ddcj3Uwq.cjs"));return{id:U0,diagram:e}},"loader"),YE={id:U0,detector:WE,loader:HE},UE=YE,G0="state",GE=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),XE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-2N3HPSRC-DTzhZM4u.cjs"));return{id:G0,diagram:e}},"loader"),VE={id:G0,detector:GE,loader:XE},KE=VE,X0="stateDiagram",ZE=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),QE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-v2-6OUMAXLB-DB994Mq0.cjs"));return{id:X0,diagram:e}},"loader"),JE={id:X0,detector:ZE,loader:QE},tF=JE,V0="journey",eF=p(e=>/^\s*journey/.test(e),"detector"),rF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./journeyDiagram-5HDEW3XC-mv3tRB15.cjs"));return{id:V0,diagram:e}},"loader"),iF={id:V0,detector:eF,loader:rF},oF=iF,sF=p((e,t,r)=>{V.debug(`rendering svg for syntax error
303
- `);const i=Kf(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Nl(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),K0={draw:sF},aF=K0,nF={db:{},renderer:K0,parser:{parse:p(()=>{},"parse")}},lF=nF,Z0="flowchart-elk",hF=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),cF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-65_ty-RL.cjs"));return{id:Z0,diagram:e}},"loader"),dF={id:Z0,detector:hF,loader:cF},uF=dF,Q0="timeline",fF=p(e=>/^\s*timeline/.test(e),"detector"),gF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./timeline-definition-FHXFAJF6-BAUQCcsb.cjs"));return{id:Q0,diagram:e}},"loader"),pF={id:Q0,detector:fF,loader:gF},mF=pF,J0="mindmap",yF=p(e=>/^\s*mindmap/.test(e),"detector"),xF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./mindmap-definition-LN4V7U3C-i_zSfuBJ.cjs"));return{id:J0,diagram:e}},"loader"),CF={id:J0,detector:yF,loader:xF},bF=CF,tx="kanban",kF=p(e=>/^\s*kanban/.test(e),"detector"),wF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./kanban-definition-HUTT4EX6-2CVqb3WV.cjs"));return{id:tx,diagram:e}},"loader"),SF={id:tx,detector:kF,loader:wF},vF=SF,ex="sankey",TF=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),_F=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sankeyDiagram-HTMAVEWB-CO5wc4-P.cjs"));return{id:ex,diagram:e}},"loader"),BF={id:ex,detector:TF,loader:_F},LF=BF,rx="packet",EF=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),FF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-NH7WQ7WH-C2N9NHLR.cjs"));return{id:rx,diagram:e}},"loader"),AF={id:rx,detector:EF,loader:FF},ix="radar",MF=p(e=>/^\s*radar-beta/.test(e),"detector"),$F=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-WEI45ONY-0KDl_dOI.cjs"));return{id:ix,diagram:e}},"loader"),OF={id:ix,detector:MF,loader:$F},ox="block",RF=p(e=>/^\s*block(-beta)?/.test(e),"detector"),IF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./blockDiagram-677ZJIJ3-D3S0NzDN.cjs"));return{id:ox,diagram:e}},"loader"),PF={id:ox,detector:RF,loader:IF},DF=PF,sx="treeView",NF=p(e=>/^\s*treeView-beta/.test(e),"detector"),qF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-OA4YK3LP-nSppDsyY.cjs"));return{id:sx,diagram:e}},"loader"),zF={id:sx,detector:NF,loader:qF},jF=zF,ax="architecture",WF=p(e=>/^\s*architecture/.test(e),"detector"),HF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./architectureDiagram-ZJ3FMSHR-DSxM5fz-.cjs"));return{id:ax,diagram:e}},"loader"),YF={id:ax,detector:WF,loader:HF},UF=YF,nx="eventmodeling",GF=p(e=>/^\s*eventmodeling/.test(e),"detector"),XF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-FQU43EPY-DDiF9qdI.cjs"));return{id:nx,diagram:e}},"loader"),VF={id:nx,detector:GF,loader:XF},KF=VF,lx="ishikawa",ZF=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),QF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ishikawaDiagram-FXEZZL3T-D4RXTdAU.cjs"));return{id:lx,diagram:e}},"loader"),JF={id:lx,detector:ZF,loader:QF},hx="venn",tA=p(e=>/^\s*venn-beta/.test(e),"detector"),eA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./vennDiagram-L72KCM5P-C4mwLTzX.cjs"));return{id:hx,diagram:e}},"loader"),rA={id:hx,detector:tA,loader:eA},iA=rA,cx="treemap",oA=p(e=>/^\s*treemap/.test(e),"detector"),sA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-G47NLZAW-xzoC80ba.cjs"));return{id:cx,diagram:e}},"loader"),aA={id:cx,detector:oA,loader:sA},dx="wardley",nA=p(e=>/^\s*wardley-beta/i.test(e),"detector"),lA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./wardleyDiagram-EHGQE667-7ABE1tnR.cjs"));return{id:dx,diagram:e}},"loader"),hA={id:dx,detector:nA,loader:lA},cA=hA,ux="cynefin",dA=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),uA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./cynefinDiagram-TSTJHNR4-LQJGk5ym.cjs"));return{id:ux,diagram:e}},"loader"),fA={id:ux,detector:dA,loader:uA},fx="railroad",gA=p(e=>/^\s*railroad-beta/i.test(e),"detector"),pA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./railroadDiagram-RFXS5EU6-vVH9AAWc.cjs"));return{id:fx,diagram:e}},"loader"),mA={id:fx,detector:gA,loader:pA},gx="railroadEbnf",yA=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),xA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ebnfDiagram-CCIWWBDH-BwNmJMnC.cjs"));return{id:gx,diagram:e}},"loader"),CA={id:gx,detector:yA,loader:xA},px="railroadAbnf",bA=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),kA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./abnfDiagram-VRR7QNED-DxRZdLos.cjs"));return{id:px,diagram:e}},"loader"),wA={id:px,detector:bA,loader:kA},mx="railroadPeg",SA=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),vA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pegDiagram-2B236MQR-B1P34Gkv.cjs"));return{id:mx,diagram:e}},"loader"),TA={id:mx,detector:SA,loader:vA},Ad=!1,Oa=p(()=>{Ad||(Ad=!0,As("error",lF,e=>e.toLowerCase().trim()==="error"),As("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{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:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Bn(uF,bF,UF),Bn(UL,vF,UE,jE,lE,mE,CE,wE,OE,DE,oE,tE,KL,mF,uE,tF,KE,oF,_E,LF,AF,FE,DF,KF,jF,OF,JF,aA,mA,CA,wA,TA,iA,cA,fA))},"addDiagrams"),_A=p(async()=>{V.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Hr).map(async([r,{detector:i,loader:o}])=>{if(o)try{Mn(r)}catch{try{const{diagram:s,id:a}=await o();As(a,s,i)}catch(s){throw V.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Hr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){V.error(`Failed to load ${t.length} external diagrams`);for(const r of t)V.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),BA="graphics-document document";function yx(e,t){e.attr("role",BA),t!==""&&e.attr("aria-roledescription",t)}p(yx,"setA11yDiagramInfo");function xx(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}p(xx,"addSVGa11yTitleDescription");var zr,Tl=(zr=class{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static async fromText(t,r={}){const i=Rt(),o=Pl(t,i);t=jT(t)+`
304
- `;try{Mn(o)}catch{const c=ik(o);if(!c)throw new Iu(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();As(h,d)}const{db:s,parser:a,renderer:n,init:l}=Mn(o);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new zr(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},p(zr,"Diagram"),zr),Md=[],LA=p(()=>{Md.forEach(e=>{e()}),Md=[]},"attachFunctions"),EA=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Cx(e){const t=e.match(Ru);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
302
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),xL=p((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"),CL=p((e,t,r)=>{const i=Rt(),{themeVariables:o}=i,{strokeWidth:s}=o,a=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${s}`)},"requirement_contains_neo"),bL={extension:QB,composition:JB,aggregation:tL,dependency:eL,lollipop:rL,point:iL,circle:oL,cross:sL,barb:aL,barbNeo:nL,only_one:lL,zero_or_one:hL,one_or_more:cL,zero_or_more:dL,only_one_neo:uL,zero_or_one_neo:fL,one_or_more_neo:gL,zero_or_more_neo:pL,requirement_arrow:mL,requirement_contains:xL,requirement_arrow_neo:yL,requirement_contains_neo:CL},S0=ZB,kL={common:Yi,getConfig:Rt,insertCluster:Vm,insertEdge:b0,insertEdgeLabel:y0,insertMarkers:S0,insertNode:Nh,interpolateToCurve:xh,labelHelper:lt,log:V,positionEdgeLabel:x0},Po={},v0=p(e=>{for(const t of e)Po[t.name]=t},"registerLayoutLoaders"),wL=p(()=>{v0([{name:"dagre",loader:p(async()=>await Promise.resolve().then(()=>require("./dagre-VKFMJZFB-YrvW_orC.cjs")),"loader")},{name:"swimlane",loader:p(async()=>await Promise.resolve().then(()=>require("./swimlanes-5IMT3BWC-CvZps5q1.cjs")),"loader")},{name:"cose-bilkent",loader:p(async()=>await Promise.resolve().then(()=>require("./cose-bilkent-JH36ORCC-BI7gm8G_.cjs")),"loader")}])},"registerDefaultLayoutLoaders");wL();var SL=p(async(e,t,r)=>{if(!(e.layoutAlgorithm in Po))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=Po[e.layoutAlgorithm],o=await i.loader(),{theme:s,themeVariables:a}=e.config,{useGradient:n,gradientStart:l,gradientStop:c}=a,h=t.attr("id");if(t.append("defs").append("filter").attr("id",`${h}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${h}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s?.includes("dark")?"#FFFFFF":"#000000"}`),n){const d=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");d.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),d.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return o.render(e,t,kL,{algorithm:i.algorithm},r)},"render"),vL=p((e="",{fallback:t="dagre"}={})=>{if(e in Po)return e;if(t in Po)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"),qh="comm",T0="rule",_0="decl",TL="@media",_L="@import",BL="@supports",LL="@namespace",kl="@keyframes",B0="@layer",EL="@scope",FL=Math.abs,To=String.fromCharCode;function L0(e){return e.trim()}function wl(e,t,r){return e.replace(t,r)}function yi(e,t){return e.charCodeAt(t)|0}function ji(e,t,r){return e.slice(t,r)}function je(e){return e.length}function E0(e){return e.length}function ls(e,t){return t.push(e),e}var Ma=1,Wi=1,F0=0,ve=0,zt=0,Ki="";function zh(e,t,r,i,o,s,a,n){return{value:e,root:t,parent:r,type:i,props:o,children:s,line:Ma,column:Wi,length:a,return:"",siblings:n}}function AL(){return zt}function ML(){return zt=ve>0?yi(Ki,--ve):0,Wi--,zt===10&&(Wi=1,Ma--),zt}function Oe(){return zt=ve<F0?yi(Ki,ve++):0,Wi++,zt===10&&(Wi=1,Ma++),zt}function pr(){return yi(Ki,ve)}function ws(){return ve}function $a(e,t){return ji(Ki,e,t)}function Do(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 $L(e){return Ma=Wi=1,F0=je(Ki=e),ve=0,[]}function OL(e){return Ki="",e}function dn(e){return L0($a(ve-1,Sl(e===91?e+2:e===40?e+1:e)))}function RL(e){for(;(zt=pr())&&zt<33;)Oe();return Do(e)>2||Do(zt)>3?"":" "}function IL(e,t){for(;--t&&Oe()&&!(zt<48||zt>102||zt>57&&zt<65||zt>70&&zt<97););return $a(e,ws()+(t<6&&pr()==32&&Oe()==32))}function Sl(e){for(;Oe();)switch(zt){case e:return ve;case 34:case 39:e!==34&&e!==39&&Sl(zt);break;case 40:e===41&&Sl(e);break;case 92:Oe();break}return ve}function PL(e,t){for(;Oe()&&e+zt!==57;)if(e+zt===84&&pr()===47)break;return"/*"+$a(t,ve-1)+"*"+To(e===47?e:Oe())}function DL(e){for(;!Do(pr());)Oe();return $a(e,ve)}function NL(e){return OL(Ss("",null,null,null,[""],e=$L(e),0,[0],e))}function Ss(e,t,r,i,o,s,a,n,l){for(var c=0,h=0,d=a,f=0,u=0,g=0,m=1,y=1,x=1,C=0,w=0,S="",v=o,_=s,E=i,B=S;y;)switch(g=w,w=Oe()){case 40:g!=108&&yi(B,d-1)==58?(C++,B+="("):B+=dn(w);break;case 41:C--,B+=")";break;case 34:case 39:case 91:B+=dn(w);break;case 9:case 10:case 13:case 32:if(C>0){B+=To(w);break}B+=RL(g);break;case 92:B+=IL(ws()-1,7);continue;case 47:switch(pr()){case 42:case 47:ls(qL(PL(Oe(),ws()),t,r,l),l),(Do(g||1)==5||Do(pr()||1)==5)&&je(B)&&ji(B,-1,void 0)!==" "&&(B+=" ");break;default:B+="/"}break;case 123*m:n[c++]=je(B)*x;case 125*m:case 59:case 0:if(C>0&&w){B+=To(w);break}switch(w){case 0:case 125:y=0;case 59+h:x==-1&&(B=wl(B,/\f/g,"")),u>0&&(je(B)-d||m===0)&&ls(u>32?Fd(B+";",i,r,d-1,l):Fd(wl(B," ","")+";",i,r,d-2,l),l);break;case 59:B+=";";default:if(ls(E=Ed(B,t,r,c,h,o,n,S,v=[],_=[],d,s),s),w===123)if(h===0)Ss(B,t,E,E,v,s,d,n,_);else{switch(f){case 99:if(yi(B,3)===110)break;case 108:if(yi(B,2)===97)break;default:h=0;case 100:case 109:case 115:}h?Ss(e,E,E,i&&ls(Ed(e,E,E,0,0,o,n,S,o,v=[],d,_),_),o,_,d,n,i?v:_):Ss(B,E,E,E,[""],_,0,n,_)}}c=h=u=0,m=x=1,S=B="",d=a;break;case 58:d=1+je(B),u=g;default:if(m<1){if(w==123)--m;else if(w==125&&m++==0&&ML()==125)continue}switch(B+=To(w),w*m){case 38:x=h>0?1:(B+="\f",-1);break;case 44:if(C>0)break;n[c++]=(je(B)-1)*x,x=1;break;case 64:pr()===45&&(B+=dn(Oe())),f=pr(),h=d=je(S=B+=DL(ws())),w++;break;case 45:g===45&&je(B)==2&&(m=0)}}return s}function Ed(e,t,r,i,o,s,a,n,l,c,h,d){for(var f=o-1,u=o===0?s:[""],g=E0(u),m=0,y=0,x=0;m<i;++m)for(var C=0,w=ji(e,f+1,f=FL(y=a[m])),S=e;C<g;++C)(S=L0(y>0?u[C]+" "+w:wl(w,/&\f/g,u[C])))&&(l[x++]=S);return zh(e,t,r,o===0?T0:n,l,c,h,d)}function qL(e,t,r,i){return zh(e,t,r,qh,To(AL()),ji(e,2,-2),0,i)}function Fd(e,t,r,i,o){return zh(e,t,r,_0,ji(e,0,i),ji(e,i+1,-1),i,o)}function vl(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function zL(e,t,r,i){switch(e.type){case B0:if(e.children.length)break;case _L:case LL:case _0:return e.return=e.return||e.value;case qh:return"";case kl:return e.return=e.value+"{"+vl(e.children,i)+"}";case T0:if(!je(e.value=e.props.join(",")))return""}return je(r=vl(e.children,i))?e.return=e.value+"{"+r+"}":""}function jL(e){var t=E0(e);return function(r,i,o,s){for(var a="",n=0;n<t;n++)a+=e[n](r,i,o,s)||"";return a}}var A0="c4",WL=p(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),HL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./c4Diagram-LMCZKHZV-BLsyyMwv.cjs"));return{id:A0,diagram:e}},"loader"),YL={id:A0,detector:WL,loader:HL},UL=YL,M0="flowchart",GL=p((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),XL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-BG5-LciC.cjs"));return{id:M0,diagram:e}},"loader"),VL={id:M0,detector:GL,loader:XL},KL=VL,$0="flowchart-v2",ZL=p((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"),QL=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-BG5-LciC.cjs"));return{id:$0,diagram:e}},"loader"),JL={id:$0,detector:ZL,loader:QL},tE=JL,O0="swimlane",eE=p(e=>/^\s*swimlane-beta\b/.test(e),"detector"),rE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./swimlanesDiagram-G3AALYLV-C3BdWijK.cjs"));return{id:O0,diagram:e}},"loader"),iE={id:O0,detector:eE,loader:rE},oE=iE,R0="er",sE=p(e=>/^\s*erDiagram/.test(e),"detector"),aE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./erDiagram-Q63AITRT-C0ZPB7kS.cjs"));return{id:R0,diagram:e}},"loader"),nE={id:R0,detector:sE,loader:aE},lE=nE,I0="gitGraph",hE=p(e=>/^\s*gitGraph/.test(e),"detector"),cE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./gitGraphDiagram-IHSO6WYX-7JPlb-y9.cjs"));return{id:I0,diagram:e}},"loader"),dE={id:I0,detector:hE,loader:cE},uE=dE,P0="gantt",fE=p(e=>/^\s*gantt/.test(e),"detector"),gE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ganttDiagram-NO4QXBWP-CzxFCHSR.cjs"));return{id:P0,diagram:e}},"loader"),pE={id:P0,detector:fE,loader:gE},mE=pE,D0="info",yE=p(e=>/^\s*info/.test(e),"detector"),xE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./infoDiagram-FWYZ7A6U-DMqDp--E.cjs"));return{id:D0,diagram:e}},"loader"),CE={id:D0,detector:yE,loader:xE},N0="pie",bE=p(e=>/^\s*pie/.test(e),"detector"),kE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pieDiagram-ENE6RG2P-BcogMjb6.cjs"));return{id:N0,diagram:e}},"loader"),wE={id:N0,detector:bE,loader:kE},q0="quadrantChart",SE=p(e=>/^\s*quadrantChart/.test(e),"detector"),vE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./quadrantDiagram-ABIIQ3AL-C5WeORzB.cjs"));return{id:q0,diagram:e}},"loader"),TE={id:q0,detector:SE,loader:vE},_E=TE,z0="xychart",BE=p(e=>/^\s*xychart(-beta)?/.test(e),"detector"),LE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./xychartDiagram-FW5EYKEG-CSOCykH7.cjs"));return{id:z0,diagram:e}},"loader"),EE={id:z0,detector:BE,loader:LE},FE=EE,j0="requirement",AE=p(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),ME=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./requirementDiagram-TGXJPOKE-BRgQQrNj.cjs"));return{id:j0,diagram:e}},"loader"),$E={id:j0,detector:AE,loader:ME},OE=$E,W0="sequence",RE=p(e=>/^\s*sequenceDiagram/.test(e),"detector"),IE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sequenceDiagram-DBY2YBRQ-8jQOuElB.cjs"));return{id:W0,diagram:e}},"loader"),PE={id:W0,detector:RE,loader:IE},DE=PE,H0="class",NE=p((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),qE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-OUVF2IWQ-Bo6t0BIX.cjs"));return{id:H0,diagram:e}},"loader"),zE={id:H0,detector:NE,loader:qE},jE=zE,Y0="classDiagram",WE=p((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),HE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./classDiagram-v2-EOCWNBFH-Bo6t0BIX.cjs"));return{id:Y0,diagram:e}},"loader"),YE={id:Y0,detector:WE,loader:HE},UE=YE,U0="state",GE=p((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),XE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-2N3HPSRC-BspFNfXx.cjs"));return{id:U0,diagram:e}},"loader"),VE={id:U0,detector:GE,loader:XE},KE=VE,G0="stateDiagram",ZE=p((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),QE=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./stateDiagram-v2-6OUMAXLB-DI1f-TG_.cjs"));return{id:G0,diagram:e}},"loader"),JE={id:G0,detector:ZE,loader:QE},tF=JE,X0="journey",eF=p(e=>/^\s*journey/.test(e),"detector"),rF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./journeyDiagram-5HDEW3XC-D3_iIUiI.cjs"));return{id:X0,diagram:e}},"loader"),iF={id:X0,detector:eF,loader:rF},oF=iF,sF=p((e,t,r)=>{V.debug(`rendering svg for syntax error
303
+ `);const i=Vf(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Nl(i,100,512,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),V0={draw:sF},aF=V0,nF={db:{},renderer:V0,parser:{parse:p(()=>{},"parse")}},lF=nF,K0="flowchart-elk",hF=p((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),cF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./flowDiagram-23GEKE2U-BG5-LciC.cjs"));return{id:K0,diagram:e}},"loader"),dF={id:K0,detector:hF,loader:cF},uF=dF,Z0="timeline",fF=p(e=>/^\s*timeline/.test(e),"detector"),gF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./timeline-definition-FHXFAJF6-CzL3lw9x.cjs"));return{id:Z0,diagram:e}},"loader"),pF={id:Z0,detector:fF,loader:gF},mF=pF,Q0="mindmap",yF=p(e=>/^\s*mindmap/.test(e),"detector"),xF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./mindmap-definition-LN4V7U3C-CEr0yKcG.cjs"));return{id:Q0,diagram:e}},"loader"),CF={id:Q0,detector:yF,loader:xF},bF=CF,J0="kanban",kF=p(e=>/^\s*kanban/.test(e),"detector"),wF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./kanban-definition-HUTT4EX6-C9b9Hl4U.cjs"));return{id:J0,diagram:e}},"loader"),SF={id:J0,detector:kF,loader:wF},vF=SF,tx="sankey",TF=p(e=>/^\s*sankey(-beta)?/.test(e),"detector"),_F=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./sankeyDiagram-HTMAVEWB-D6Es1Wm7.cjs"));return{id:tx,diagram:e}},"loader"),BF={id:tx,detector:TF,loader:_F},LF=BF,ex="packet",EF=p(e=>/^\s*packet(-beta)?/.test(e),"detector"),FF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-NH7WQ7WH-BckXpDNE.cjs"));return{id:ex,diagram:e}},"loader"),AF={id:ex,detector:EF,loader:FF},rx="radar",MF=p(e=>/^\s*radar-beta/.test(e),"detector"),$F=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-WEI45ONY-DMGUqioc.cjs"));return{id:rx,diagram:e}},"loader"),OF={id:rx,detector:MF,loader:$F},ix="block",RF=p(e=>/^\s*block(-beta)?/.test(e),"detector"),IF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./blockDiagram-677ZJIJ3-d__rtf-H.cjs"));return{id:ix,diagram:e}},"loader"),PF={id:ix,detector:RF,loader:IF},DF=PF,ox="treeView",NF=p(e=>/^\s*treeView-beta/.test(e),"detector"),qF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-OA4YK3LP-BtOG48sk.cjs"));return{id:ox,diagram:e}},"loader"),zF={id:ox,detector:NF,loader:qF},jF=zF,sx="architecture",WF=p(e=>/^\s*architecture/.test(e),"detector"),HF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./architectureDiagram-ZJ3FMSHR-BpazTxWP.cjs"));return{id:sx,diagram:e}},"loader"),YF={id:sx,detector:WF,loader:HF},UF=YF,ax="eventmodeling",GF=p(e=>/^\s*eventmodeling/.test(e),"detector"),XF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-FQU43EPY-ClHbrdQi.cjs"));return{id:ax,diagram:e}},"loader"),VF={id:ax,detector:GF,loader:XF},KF=VF,nx="ishikawa",ZF=p(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),QF=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ishikawaDiagram-FXEZZL3T-CwIryjOh.cjs"));return{id:nx,diagram:e}},"loader"),JF={id:nx,detector:ZF,loader:QF},lx="venn",tA=p(e=>/^\s*venn-beta/.test(e),"detector"),eA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./vennDiagram-L72KCM5P-C13bOAyh.cjs"));return{id:lx,diagram:e}},"loader"),rA={id:lx,detector:tA,loader:eA},iA=rA,hx="treemap",oA=p(e=>/^\s*treemap/.test(e),"detector"),sA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./diagram-G47NLZAW-CEb1NBAf.cjs"));return{id:hx,diagram:e}},"loader"),aA={id:hx,detector:oA,loader:sA},cx="wardley",nA=p(e=>/^\s*wardley-beta/i.test(e),"detector"),lA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./wardleyDiagram-EHGQE667-GK1emTpZ.cjs"));return{id:cx,diagram:e}},"loader"),hA={id:cx,detector:nA,loader:lA},cA=hA,dx="cynefin",dA=p(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),uA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./cynefinDiagram-TSTJHNR4-DVVqTKf1.cjs"));return{id:dx,diagram:e}},"loader"),fA={id:dx,detector:dA,loader:uA},ux="railroad",gA=p(e=>/^\s*railroad-beta/i.test(e),"detector"),pA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./railroadDiagram-RFXS5EU6-QuwtKvjh.cjs"));return{id:ux,diagram:e}},"loader"),mA={id:ux,detector:gA,loader:pA},fx="railroadEbnf",yA=p(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),xA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./ebnfDiagram-CCIWWBDH-Bqb2uRyt.cjs"));return{id:fx,diagram:e}},"loader"),CA={id:fx,detector:yA,loader:xA},gx="railroadAbnf",bA=p(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),kA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./abnfDiagram-VRR7QNED-CrFrQUYr.cjs"));return{id:gx,diagram:e}},"loader"),wA={id:gx,detector:bA,loader:kA},px="railroadPeg",SA=p(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),vA=p(async()=>{const{diagram:e}=await Promise.resolve().then(()=>require("./pegDiagram-2B236MQR-C2GMsOeZ.cjs"));return{id:px,diagram:e}},"loader"),TA={id:px,detector:SA,loader:vA},Ad=!1,Oa=p(()=>{Ad||(Ad=!0,As("error",lF,e=>e.toLowerCase().trim()==="error"),As("---",{db:{clear:p(()=>{},"clear")},styles:{},renderer:{draw:p(()=>{},"draw")},parser:{parse:p(()=>{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:p(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Bn(uF,bF,UF),Bn(UL,vF,UE,jE,lE,mE,CE,wE,OE,DE,oE,tE,KL,mF,uE,tF,KE,oF,_E,LF,AF,FE,DF,KF,jF,OF,JF,aA,mA,CA,wA,TA,iA,cA,fA))},"addDiagrams"),_A=p(async()=>{V.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Hr).map(async([r,{detector:i,loader:o}])=>{if(o)try{Mn(r)}catch{try{const{diagram:s,id:a}=await o();As(a,s,i)}catch(s){throw V.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Hr[r],s}}}))).filter(r=>r.status==="rejected");if(t.length>0){V.error(`Failed to load ${t.length} external diagrams`);for(const r of t)V.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),BA="graphics-document document";function mx(e,t){e.attr("role",BA),t!==""&&e.attr("aria-roledescription",t)}p(mx,"setA11yDiagramInfo");function yx(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}p(yx,"addSVGa11yTitleDescription");var zr,Tl=(zr=class{constructor(t,r,i,o,s){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=s}static async fromText(t,r={}){const i=Rt(),o=Pl(t,i);t=jT(t)+`
304
+ `;try{Mn(o)}catch{const c=ik(o);if(!c)throw new Ru(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();As(h,d)}const{db:s,parser:a,renderer:n,init:l}=Mn(o);return a.parser&&(a.parser.yy=s),s.clear?.(),l?.(i),r.title&&s.setDiagramTitle?.(r.title),await a.parse(t),new zr(o,t,s,a,n)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},p(zr,"Diagram"),zr),Md=[],LA=p(()=>{Md.forEach(e=>{e()}),Md=[]},"attachFunctions"),EA=p(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function xx(e){const t=e.match(Ou);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
305
305
  `).map(a=>a.startsWith(r)?a.slice(r.length):a).join(`
306
- `):t[2];let o=$p(i,{schema:Mp})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const s={};return o.displayMode&&(s.displayMode=o.displayMode.toString()),o.title&&(s.title=o.title.toString()),o.config&&(s.config=o.config),{text:e.slice(t[0].length),metadata:s}}p(Cx,"extractFrontMatter");var FA=p(e=>e.replace(/\r\n?/g,`
307
- `).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),AA=p(e=>{const{text:t,metadata:r}=Cx(e),{displayMode:i,title:o,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:o,config:s,text:t}},"processFrontmatter"),MA=p(e=>{const t=we.detectInit(e)??{},r=we.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:MT(e),directive:t}},"processDirectives");function jh(e){const t=FA(e),r=AA(t),i=MA(r.text),o=va(r.config,i.directive);return e=EA(i.text),{code:e,title:r.title,config:o}}p(jh,"preprocessDiagram");function bx(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(bx,"toBase64");var $A=5e4,OA="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",RA="sandbox",IA="loose",PA="http://www.w3.org/2000/svg",DA="http://www.w3.org/1999/xlink",NA="http://www.w3.org/1999/xhtml",qA="100%",zA="100%",jA="border:0;margin:0;",WA="margin:0",HA="allow-top-navigation-by-user-activation allow-popups",YA='The "iframe" tag is not supported by your browser.',UA=["foreignobject"],GA=["dominant-baseline"];function Wh(e){const t=jh(e);return Es(),J1(t.config??{}),t}p(Wh,"processAndSetConfigs");async function kx(e,t){Oa();try{const{code:r,config:i}=Wh(e);return{diagramType:(await Sx(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(kx,"parse");var $d=p((e,t,r=[])=>{const i=Eu(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),XA=p((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=ae(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Uc(l.styles)||n.forEach(c=>{r.insertRule($d(l.id,c,l.styles),r.cssRules.length)}),Uc(l.textStyles)||r.insertRule($d(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=An(o)+`
306
+ `):t[2];let o=Mp(i,{schema:Ap})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const s={};return o.displayMode&&(s.displayMode=o.displayMode.toString()),o.title&&(s.title=o.title.toString()),o.config&&(s.config=o.config),{text:e.slice(t[0].length),metadata:s}}p(xx,"extractFrontMatter");var FA=p(e=>e.replace(/\r\n?/g,`
307
+ `).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),AA=p(e=>{const{text:t,metadata:r}=xx(e),{displayMode:i,title:o,config:s={}}=r;return i&&(s.gantt||(s.gantt={}),s.gantt.displayMode=i),{title:o,config:s,text:t}},"processFrontmatter"),MA=p(e=>{const t=we.detectInit(e)??{},r=we.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:MT(e),directive:t}},"processDirectives");function jh(e){const t=FA(e),r=AA(t),i=MA(r.text),o=va(r.config,i.directive);return e=EA(i.text),{code:e,title:r.title,config:o}}p(jh,"preprocessDiagram");function Cx(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}p(Cx,"toBase64");var $A=5e4,OA="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",RA="sandbox",IA="loose",PA="http://www.w3.org/2000/svg",DA="http://www.w3.org/1999/xlink",NA="http://www.w3.org/1999/xhtml",qA="100%",zA="100%",jA="border:0;margin:0;",WA="margin:0",HA="allow-top-navigation-by-user-activation allow-popups",YA='The "iframe" tag is not supported by your browser.',UA=["foreignobject"],GA=["dominant-baseline"];function Wh(e){const t=jh(e);return Es(),J1(t.config??{}),t}p(Wh,"processAndSetConfigs");async function bx(e,t){Oa();try{const{code:r,config:i}=Wh(e);return{diagramType:(await wx(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}p(bx,"parse");var $d=p((e,t,r=[])=>{const i=Lu(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),XA=p((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=ae(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Uc(l.styles)||n.forEach(c=>{r.insertRule($d(l.id,c,l.styles),r.cssRules.length)}),Uc(l.textStyles)||r.insertRule($d(l.id,"tspan",(l?.textStyles||[]).map(c=>c.replace("color","fill"))),r.cssRules.length)})}let i="";if(e.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(e.themeCSS),i=An(o)+`
308
308
  `}else i+=`${e.themeCSS}
309
- `;return i+An(r)},"createCssStyles"),VA=p((e,t)=>vl(NL(`${e}{${t}}`),jL([p(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===kl)return;i.props=i.props.map(n=>n.startsWith(e)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[TL,BL,L0,EL,"@container","@starting-style"],kl].includes(i.type)||(V.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=qh))},"addNamespace"),zL])),"compileCSS"),KA=p((e,t,r,i)=>{const o=XA(e,r),s=bk(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return VA(i,s)},"createUserStyles"),ZA=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=br(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),QA=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":zA,i=bx(`<body style="${WA}">${e}</body>`);return`<iframe style="width:${qA};height:${r};${jA}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${HA}">
309
+ `;return i+An(r)},"createCssStyles"),VA=p((e,t)=>vl(NL(`${e}{${t}}`),jL([p(function(i,o,s,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===kl)return;i.props=i.props.map(n=>n.startsWith(e)?n:`${e} ${n}`)}else i.type.startsWith("@")&&([...[TL,BL,B0,EL,"@container","@starting-style"],kl].includes(i.type)||(V.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=qh))},"addNamespace"),zL])),"compileCSS"),KA=p((e,t,r,i)=>{const o=XA(e,r),s=bk(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return VA(i,s)},"createUserStyles"),ZA=p((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=br(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),QA=p((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":zA,i=Cx(`<body style="${WA}">${e}</body>`);return`<iframe style="width:${qA};height:${r};${jA}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${HA}">
310
310
  ${YA}
311
- </iframe>`},"putIntoIFrame"),Od=p((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",PA);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function _l(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(_l,"sandboxedIframe");var JA=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),tM=p(async function(e,t,r){Oa();const i=Wh(t);t=i.code;const o=Rt();V.debug(o),t.length>(o?.maxTextSize??$A)&&(t=OA);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=p(()=>{const N=yt(f?n:c).node();N&&"remove"in N&&N.remove()},"removeTempElements");let d=yt(document.body);const f=o.securityLevel===RA,u=o.securityLevel===IA,g=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const U=_l(yt(r),a);d=yt(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt(r);Od(d,e,l,`font-family: ${g}`,DA)}else{if(JA(document,e,l,a),f){const U=_l(yt(document.body),a);d=yt(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt("body");Od(d,e,l)}let m,y;try{m=await Tl.fromText(t,{title:i.title})}catch(U){if(o.suppressErrorRendering)throw h(),U;m=await Tl.fromText("error"),y=U}const x=d.select(c).node(),C=m.type,w=x.firstChild,S=w.firstChild,v=m.renderer.getClasses?.(t,m),_=KA(o,C,v,s),E=document.createElement("style");E.innerHTML=_,w.insertBefore(E,S);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(U){throw o.suppressErrorRendering?h():aF.draw(t,e,"11.16.0"),U}const B=d.select(`${c} svg`),D=m.db.getAccTitle?.(),M=m.db.getAccDescription?.();vx(C,B,D,M),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",NA);let P=d.select(c).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),P=ZA(P,f,Ve(o.arrowMarkerAbsolute)),f){const U=d.select(c+" svg").node();P=QA(P,U)}else u||(P=$i.sanitize(P,{ADD_TAGS:UA,ADD_ATTR:GA,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(LA(),y)throw y;return h(),{diagramType:C,svg:P,bindFunctions:m.db.bindFunctions}},"render");function wx(e={}){const t=jt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),Z1(t),t?.theme&&t.theme in or?t.themeVariables=or[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=or.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?K1(t):Fu();Ol(r.logLevel),Oa()}p(wx,"initialize");var Sx=p((e,t={})=>{const{code:r}=jh(e);return Tl.fromText(r,t)},"getDiagramFromText");function vx(e,t,r,i){yx(t,e),xx(t,r,i,t.attr("id"))}p(vx,"addA11yInfo");var Xr=Object.freeze({render:tM,parse:kx,getDiagramFromText:Sx,initialize:wx,getConfig:Rt,setConfig:Au,getSiteConfig:Fu,updateSiteConfig:Q1,reset:p(()=>{Es()},"reset"),globalReset:p(()=>{Es(Ri)},"globalReset"),defaultConfig:Ri});Ol(Rt().logLevel);Es(Rt());var eM=p((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"),Tx=p(async function(e={querySelector:".mermaid"}){try{await rM(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"),rM=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=Xr.getConfig();V.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");V.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(V.debug("Start On Load: "+i?.startOnLoad),Xr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new we.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(o)){if(V.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=Lm(we.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=we.detectInit(a);h&&V.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await Ex(c,a,l);l.innerHTML=d,e&&await e(c),f&&f(l)}catch(d){eM(d,n,nr.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),_x=p(function(e){Xr.initialize(e)},"initialize"),iM=p(async function(e,t,r){V.warn("mermaid.init is deprecated. Please use run instead."),e&&_x(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await Tx(i)},"init"),oM=p(async(e,{lazyLoad:t=!0}={})=>{Oa(),Bn(...e),t===!1&&await _A()},"registerExternalDiagrams"),Bx=p(function(){if(nr.startOnLoad){const{startOnLoad:e}=Xr.getConfig();e&&nr.run().catch(t=>V.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",Bx,!1);var sM=p(function(e){nr.parseError=e},"setParseErrorHandler"),ia=[],un=!1,Lx=p(async()=>{if(!un){for(un=!0;ia.length>0;){const e=ia.shift();if(e)try{await e()}catch(t){V.error("Error executing queue",t)}}un=!1}},"executeQueue"),aM=p(async(e,t)=>new Promise((r,i)=>{const o=p(()=>new Promise((s,a)=>{Xr.parse(e,t).then(n=>{s(n),r(n)},n=>{V.error("Error parsing",n),nr.parseError?.(n),a(n),i(n)})}),"performCall");ia.push(o),Lx().catch(i)}),"parse"),Ex=p((e,t,r)=>new Promise((i,o)=>{const s=p(()=>new Promise((a,n)=>{Xr.render(e,t,r).then(l=>{a(l),i(l)},l=>{V.error("Error parsing",l),nr.parseError?.(l),n(l),o(l)})}),"performCall");ia.push(s),Lx().catch(o)}),"render"),nM=p(()=>Object.keys(Hr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),nr={startOnLoad:!0,mermaidAPI:Xr,parse:aM,render:Ex,init:iM,run:Tx,registerExternalDiagrams:oM,registerLayoutLoaders:T0,initialize:_x,parseError:void 0,contentLoaded:Bx,setParseErrorHandler:sM,detectType:Pl,registerIconPacks:pm,getRegisteredDiagramsMetadata:nM},Bl=nr;const Vr="flex size-11 items-center justify-center rounded border p-1 shadow",lM="flex h-11 min-w-11 items-center justify-center rounded border px-2 text-sm shadow",hM="absolute top-full z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg",Rd="flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start",Fx="both-shift",Id=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})}),cM=Object.freeze(["none","zoom","pan","pan-shift","both","both-shift"]),dM=Object.freeze(["none","zoom","pan","both"]),uM=Object.freeze({none:"none",zoom:"zoom",pan:"pan","pan-shift":"pan",both:"both","both-shift":"both"}),vs=.3,fM=3,gM=2,Rr=.5,pM=1;function Pd(e,t){return e.panTrigger!==null&&t?e.zoom?"none":"pinch-zoom":e.zoom?"pan-x pan-y":"auto"}const mM=0;function fn(e,t,r){return e.panTrigger===null||t.button!==mM?!1:t.pointerType==="touch"||t.pointerType==="pen"?r:e.panTrigger==="drag"||t.shiftKey}function yM(e,t){return e.zoom&&t.shiftKey}function xM(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 CM(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 bM(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:gM/e}}function gn(e,t){return Math.min(t.maxScale,Math.max(t.minScale,e))}function lo(e,t,r,i,o){return{scale:t,x:e.x+(i.x-o.origin.x)/t-(r.x-o.origin.x)/e.scale,y:e.y+(i.y-o.origin.y)/t-(r.y-o.origin.y)/e.scale}}function kM(e,t,r){const i=(o,s,a,n)=>{const l=(0-s)/e.scale,c=(n-s-e.scale*a)/e.scale;return Math.min(Math.max(l,c),Math.max(Math.min(l,c),o))};return{scale:e.scale,x:i(e.x,t.origin.x,t.inline,r.inline),y:i(e.y,t.origin.y,t.block,r.block)}}function wM(e,t,r){return e*t.inline-r.inline>Rr||e*t.block-r.block>Rr}function SM(e,t){const r=s=>Math.hypot(s[1].x-s[0].x,s[1].y-s[0].y),i=s=>({x:(s[0].x+s[1].x)/2,y:(s[0].y+s[1].y)/2}),o=r(e);return o<pM?null:{ratio:r(t)/o,from:i(e),to:i(t)}}function Dd(e){return e*(1-Math.exp(-vs))}function Nd(e,t,r){const i=e<-Rr||e>Rr;return t-e>r+Rr?i?0-e:0:e<-Rr?0-e:t>r+Rr?r-t:0}const Ra=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"}}),vM=aa(Ra),TM=Object.freeze({none:"modeNone",zoom:"modeZoom",pan:"modePan","pan-shift":"modePanShift",both:"modeBoth","both-shift":"modeBothShift"}),_M=Object.freeze({none:"modeNoneTouch",zoom:"modeZoomTouch",pan:"modePanTouch",both:"modeBothTouch"}),Ax="(pointer: coarse)",BM=e=>{const t=window.matchMedia(Ax);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},LM=()=>window.matchMedia(Ax).matches,EM=()=>!1,FM=()=>L.useSyncExternalStore(BM,LM,EM),Hh=(e,t)=>{const[r,i]=L.useState(null),o=r!==null&&e.includes(r)?r:e[0],s=l=>l instanceof Element?l.getAttribute(t):null;return{onKeyDown:l=>{const c=s(l.target);if(c===null||l.altKey||l.ctrlKey||l.metaKey||l.shiftKey)return;const h=e.indexOf(c);if(h===-1)return;const d=l.currentTarget.ownerDocument.defaultView?.getComputedStyle(l.currentTarget).direction==="rtl",f=d?"ArrowLeft":"ArrowRight",u=d?"ArrowRight":"ArrowLeft";let g;switch(l.key){case f:g=(h+1)%e.length;break;case u:g=(h-1+e.length)%e.length;break;case"Home":g=0;break;case"End":g=e.length-1;break;default:return}l.preventDefault(),l.currentTarget.querySelector(`[${t}="${e[g]}"]`)?.focus()},onFocus:l=>{const c=s(l.target);c!==null&&e.includes(c)&&i(c)},tabIndexOf:l=>l===o?0:-1}},_o={side:"start",offset:0,maxWidth:null},AM=(e,t,r,i)=>{const o=l=>l>=r.low&&l+t<=r.high;if(o(i?e.right-t:e.left))return _o;if(o(i?e.left:e.right-t))return{side:"end",offset:e.right-e.left-t,maxWidth:null};const s=r.high-r.low;if(s<=0)return _o;const a=Math.min(t,s),n=Math.min(Math.max(i?e.right-a:e.left,r.low),r.high-a);return{side:"inside",offset:i?e.right-n-a:n-e.left,maxWidth:a<t?a:null}},Mx=({buttonHook:e,menuHook:t,label:r,icon:i,tabIndex:o,items:s})=>{const[a,n]=L.useState(null),[l,c]=L.useState(_o),h=a!==null,d=L.useId(),f=L.useId(),u=L.useRef(null),g=L.useRef(null),m=L.useRef(null),y=()=>Array.from(m.current?.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')??[]),x=S=>{n(null),c(_o),S&&g.current?.focus()};L.useLayoutEffect(()=>{const S=u.current,v=m.current;if(a===null||S===null||v===null)return;const _=v.ownerDocument.documentElement.clientWidth,E=S.closest('[role="toolbar"]')?.getBoundingClientRect(),B=E===void 0?{low:0,high:_}:{low:Math.max(0,E.left),high:Math.min(_,E.right)},D=v.ownerDocument.defaultView?.getComputedStyle(v).direction==="rtl";c(AM(S.getBoundingClientRect(),v.getBoundingClientRect().width,B,D));const M=y(),P=M.findIndex(N=>N.getAttribute("aria-checked")==="true"),U=a==="last"?M.length-1:Math.max(P,0);M[U]?.focus()},[a]),L.useEffect(()=>{const S=u.current?.ownerDocument;if(!h||S===void 0)return;const v=_=>{_.target instanceof Node&&u.current?.contains(_.target)===!0||(n(null),c(_o))};return S.addEventListener("pointerdown",v,!0),S.addEventListener("focusin",v,!0),()=>{S.removeEventListener("pointerdown",v,!0),S.removeEventListener("focusin",v,!0)}},[h]);const C=S=>{if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),n(S.key==="ArrowUp"?"last":"chosen");return}S.key==="Escape"&&h&&(S.preventDefault(),S.stopPropagation(),x(!1))},w=S=>{const v=y(),_=v.indexOf(S.target);let E;switch(S.key){case"ArrowDown":E=(_+1)%v.length;break;case"ArrowUp":E=(_-1+v.length)%v.length;break;case"Home":E=0;break;case"End":E=v.length-1;break;case"Escape":S.preventDefault(),S.stopPropagation(),x(!0);return;default:return}S.preventDefault(),S.stopPropagation(),v[E]?.focus()};return k.jsxs("div",{ref:u,className:"relative",children:[k.jsx("button",{ref:g,id:d,type:"button",...e,tabIndex:o,onClick:()=>h?x(!1):n("chosen"),onKeyDown:C,className:Vr,"aria-label":r.text,lang:r.lang,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?f:void 0,children:i}),h&&k.jsx("div",{ref:m,id:f,role:"menu","aria-labelledby":d,...t,"data-aqmd-control-menu":l.side,style:l.maxWidth===null?{insetInlineStart:l.offset}:{insetInlineStart:l.offset,maxInlineSize:l.maxWidth},onKeyDown:w,className:hM,children:s.map(S=>{const v=()=>{x(!0),S.onSelect()};return S.checked===void 0?k.jsx("button",{type:"button",role:"menuitem",tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Rd,children:k.jsx("span",{children:S.label.text})},S.key):k.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":S.checked,tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Rd,children:[k.jsx("span",{className:"w-3 shrink-0","aria-hidden":"true",children:S.checked?"✓":""}),k.jsx("span",{children:S.label.text})]},S.key)})})]})},qd=new Set(["gantt"]),MM=200,$M=300,OM=Object.freeze({height:0,overflow:"hidden",visibility:"hidden",contain:"strict"}),RM="data-aqmd-mermaid-host",IM=e=>{const t=document.createElement("div");return t.setAttribute(RM,""),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 zd=Promise.resolve();const PM=e=>{const t=e instanceof Error?e.message:String(e);return t.includes("dynamically imported module")||t.includes("Importing a module script failed")},jd=e=>{e.resetStyle(),e.destroy()},pn=(e,t)=>t?"grabbing":e.panTrigger==="drag"?"move":"",DM=Object.freeze({visibility:"hidden"});let $x=!1,Ll=null;if(Bl?.initialize)try{Bl.initialize({startOnLoad:!1}),$x=!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 Ox=({chartContent:e,interaction:t,hideInteractionMenu:r=!1,labels:i,sourceLines:o})=>{const s=L.useMemo(()=>Oi(Ra,i),[i]),a=L.useId(),n=L.useRef(`mermaid-chart-${Math.random().toString(36).substring(2,15)}`),l=L.useRef(0),c=L.useRef(null),h=L.useRef(null),d=L.useRef(null),f=L.useRef(null),[u,g]=L.useState(!0),[m,y]=L.useState(null),[x,C]=L.useState(null),[w,S]=L.useState(0),v=L.useRef(!1),_=FM(),[E,B]=L.useState(t??Fx),D=L.useRef(Id[E]),M=L.useRef(!1),[P,U]=L.useState(!1);L.useEffect(()=>{t&&B(t)},[t]),L.useEffect(()=>{D.current=Id[E],f.current?.refresh()},[E]),L.useEffect(()=>{if(g(!0),y(null),C(null),!$x){y(Ll?.message||"Mermaid failed to initialize globally."),g(!1);return}const T=e.trim();if(T===""){g(!1);return}const W=c.current;if(!W)throw new Error("[@aiquants/markdown] MermaidDiagram: the measuring element is not mounted");let j=!1,G=0,X=null,K=W.offsetWidth,Z=null,at,mt;const ht=()=>{Nt.disconnect(),clearTimeout(at)},ct=Gt=>{Z=null,ht(),y(Gt),C(null),g(!1)},_t=Gt=>{l.current+=1;const te=l.current;G=te,X=Gt;const xe=()=>!j&&te===G,_e=async()=>{const Ft=IM(Gt);try{return await Bl.render(`${n.current}-${te}`,T,Ft)}finally{Ft.remove()}};zd=zd.then(()=>xe()?_e().then(Ft=>{if(xe()){if(typeof Ft.svg!="string"||Ft.svg.length===0){ct("Failed to render Mermaid diagram: SVG content is empty or invalid.");return}Z=Ft.diagramType,C({svg:Ft.svg,bindFunctions:typeof Ft.bindFunctions=="function"?Ft.bindFunctions:null}),g(!1),qd.has(Ft.diagramType)?K!==Gt&&Ct():Nt.disconnect()}}).catch(Ft=>{if(xe()){if(console.error(`[MermaidDiagram ${n.current}] Error rendering Mermaid diagram:`,Ft),PM(Ft)&&!v.current){v.current=!0,mt=setTimeout(()=>S(wt=>wt+1),$M);return}ct(Ft instanceof Error?Ft.message:"An unknown error occurred while rendering the diagram.")}}):Promise.resolve())},Ct=()=>{clearTimeout(at),at=setTimeout(()=>{K>0&&K!==X&&_t(K)},MM)},Et=()=>{const Gt=W.offsetWidth;if(Gt!==K){if(K=Gt,X===null){Gt>0&&_t(Gt);return}Z!==null&&qd.has(Z)&&Ct()}},Nt=new ResizeObserver(Et);return Nt.observe(W),K>0&&_t(K),()=>{j=!0,ht(),clearTimeout(mt)}},[e,w]),L.useEffect(()=>{const T=h.current;if(!T)return;const W=()=>{f.current=null,d.current&&(jd(d.current),d.current=null),M.current=!1,U(!1)};if(!x){T.innerHTML="",W();return}T.innerHTML=x.svg;const j=T.querySelector("svg");let G=!1,X;const K=[];if(j){let Z;try{Z=xM(j.getAttribute("viewBox"))}catch(ht){console.error(`[MermaidDiagram ${n.current}] Cannot size the drawing:`,ht),y(ht instanceof Error?ht.message:String(ht)),C(null);return}const at=Z,mt=()=>{if(G)return;const ht=j.getBBox();if(!ht||ht.width===0||ht.height===0){X=setTimeout(mt,100);return}d.current&&jd(d.current);const ct=Cu(j,{startScale:1,startX:0,startY:0,minScale:1,maxScale:1,origin:"0 0",step:vs,animate:!1,noBind:!0,cursor:"",overflow:"",touchAction:Pd(D.current,!1)});d.current=ct;let _t={minScale:1,maxScale:1};const Ct=()=>{const J=ct.getPan();return{scale:ct.getScale(),x:J.x,y:J.y}},Et=()=>{const J=T.getBoundingClientRect(),ft=j.getBoundingClientRect(),{scale:xt,x:Pt,y:At}=Ct();return{frameRect:J,frame:{inline:J.width,block:J.height},drawing:{origin:{x:ft.left-J.left-xt*Pt,y:ft.top-J.top-xt*At},inline:ft.width/xt,block:ft.height/xt}}},Nt=()=>{if(G)return;const{frame:J,drawing:ft}=Et(),xt=wM(ct.getScale(),ft,J);M.current=xt,U(xt),Ze(xt),ct.setOptions({touchAction:Pd(D.current,xt)}),T.style.cursor=pn(D.current,wt?.kind==="pan"&&wt.mouse)},Gt=()=>{const J=T.getBoundingClientRect().width;J<=0||(_t=bM(CM(J,at)),ct.setOptions({minScale:_t.minScale,maxScale:_t.maxScale}))},te=J=>{const ft=Ct(),{frame:xt,drawing:Pt}=Et(),At=kM({...J,scale:gn(J.scale,_t)},Pt,xt);return At.scale===ft.scale&&At.x===ft.x&&At.y===ft.y?!1:(ct.zoom(At.scale,{animate:!1,force:!0,silent:!0}),ct.pan(At.x,At.y,{animate:!1,force:!0}),Nt(),!0)},xe=(J,ft)=>{const{drawing:xt}=Et();return te(lo(Ct(),gn(J,_t),ft,ft,xt))},_e=J=>{const ft=T.getBoundingClientRect();return{x:J.x-ft.left,y:J.y-ft.top}};f.current={zoomBy:J=>{const{frame:ft}=Et();xe(ct.getScale()*Math.exp(J*vs),{x:ft.inline/2,y:ft.block/2})},panBy:(J,ft)=>{const{drawing:xt}=Et(),Pt=Ct();return te(lo(Pt,Pt.scale,{x:0,y:0},{x:J,y:ft},xt))},reset:()=>{te({scale:1,x:0,y:0})},panSteps:()=>{const{frame:J}=Et();return{x:Dd(J.inline),y:Dd(J.block)}},refresh:Nt};const Ft=new Map;let wt=null;const Be=J=>({x:J.clientX,y:J.clientY}),Qr=()=>{const J=[...Ft.values()];return J.length===2?[J[0],J[1]]:null},hr=J=>{if(Ft.has(J.pointerId)&&Ft.set(J.pointerId,Be(J)),wt?.kind==="pinch"){const ft=Qr();if(ft===null)return;const xt=SM(wt.last,ft);if(wt={kind:"pinch",last:ft},xt===null)return;const{drawing:Pt}=Et(),At=Ct();te(lo(At,gn(At.scale*xt.ratio,_t),_e(xt.from),_e(xt.to),Pt));return}if(wt?.kind==="pan"&&wt.pointerId===J.pointerId){const ft=Be(J),{drawing:xt}=Et(),Pt=Ct();te(lo(Pt,Pt.scale,_e(wt.last),_e(ft),xt)),wt={...wt,last:ft}}},vr=()=>{window.removeEventListener("pointermove",hr),window.removeEventListener("pointerup",Le),window.removeEventListener("pointercancel",Le)},De=()=>{vr(),window.addEventListener("pointermove",hr),window.addEventListener("pointerup",Le),window.addEventListener("pointercancel",Le)},Le=J=>{if(Ft.delete(J.pointerId),wt?.kind==="pinch"){const[ft]=[...Ft.entries()];wt=ft!==void 0&&fn(D.current,{button:0,shiftKey:!1,pointerType:J.pointerType},M.current)?{kind:"pan",pointerId:ft[0],last:ft[1],mouse:!1}:null}else wt?.kind==="pan"&&wt.pointerId===J.pointerId&&(wt=null);wt===null&&Ft.size===0&&vr(),T.style.cursor=pn(D.current,wt?.kind==="pan"&&wt.mouse)},Tr=J=>{const ft=D.current;if(J.pointerType==="touch"||J.pointerType==="pen"){Ft.set(J.pointerId,Be(J)),De();const xt=Qr();xt!==null&&ft.zoom?wt={kind:"pinch",last:xt}:Ft.size>1?wt?.kind==="pan"&&!wt.mouse&&(wt=null):fn(ft,J,M.current)&&(wt={kind:"pan",pointerId:J.pointerId,last:Be(J),mouse:!1});return}fn(ft,J,M.current)&&(wt={kind:"pan",pointerId:J.pointerId,last:Be(J),mouse:!0},T.style.cursor=pn(ft,!0),De(),J.preventDefault())},Jr=J=>{wt!==null&&!(wt.kind==="pan"&&wt.mouse)&&J.cancelable&&J.preventDefault()};let Ce=!1;const Ze=J=>{J!==Ce&&(Ce=J,J?T.addEventListener("touchmove",Jr,{passive:!1}):T.removeEventListener("touchmove",Jr))},cr=J=>{const ft=J.target;if(!(ft instanceof Element)||ft===j||!j.contains(ft))return;const xt=T.getBoundingClientRect(),Pt=ft.getBoundingClientRect(),At={x:Nd(Pt.left-xt.left,Pt.right-xt.left,xt.width),y:Nd(Pt.top-xt.top,Pt.bottom-xt.top,xt.height)};if(At.x===0&&At.y===0)return;const{drawing:Zi}=Et(),ei=Ct();te(lo(ei,ei.scale,{x:0,y:0},At,Zi))},ti=J=>{if(!yM(D.current,J))return;const ft=J.deltaY===0?J.deltaX:J.deltaY;ft!==0&&(J.preventDefault(),xe(ct.getScale()*Math.exp(Math.sign(-ft)*vs/fM),_e(Be(J))))},_r=new ResizeObserver(()=>{Gt(),te(Ct()),Nt()});T.addEventListener("pointerdown",Tr),T.addEventListener("focusin",cr),T.addEventListener("wheel",ti,{passive:!1}),j.addEventListener("panzoomchange",Nt),_r.observe(T),K.push(()=>{T.removeEventListener("pointerdown",Tr),T.removeEventListener("focusin",cr),Ze(!1),T.removeEventListener("wheel",ti),j.removeEventListener("panzoomchange",Nt),_r.disconnect(),vr()}),Gt(),Nt()};mt()}return x.bindFunctions&&x.bindFunctions(T),()=>{G=!0,clearTimeout(X);for(const Z of K)Z();W()}},[x]);const N=L.useCallback(T=>{const W=f.current;if(W===null||T.target!==T.currentTarget||T.altKey||T.ctrlKey||T.metaKey)return;const j=W.panSteps();let G;switch(T.key){case"ArrowLeft":G=W.panBy(j.x,0);break;case"ArrowRight":G=W.panBy(-j.x,0);break;case"ArrowUp":G=W.panBy(0,j.y);break;case"ArrowDown":G=W.panBy(0,-j.y);break;case"+":case"=":W.zoomBy(1),G=!0;break;case"-":W.zoomBy(-1),G=!0;break;case"0":W.reset(),G=!0;break;default:G=!1}G&&T.preventDefault()},[]),q=L.useMemo(()=>[...P?["pan-left","pan-up","pan-down","pan-right"]:[],...r?[]:["mode"],"zoom-in","zoom-out","reset"],[r,P]),{onKeyDown:A,onFocus:$,tabIndexOf:O}=Hh(q,"data-aqmd-mermaid-control"),F=(T,W,j,G,X=!1)=>k.jsx("button",{type:"button","data-aqmd-mermaid-control":T,tabIndex:O(T),onClick:j,style:X?DM:void 0,className:Vr,"aria-label":s[W].text,lang:s[W].lang,children:G},T),R=T=>{const W=f.current;if(W===null)return;const j=W.panSteps();W.panBy(T.x*j.x,T.y*j.y)};let z;if(u)z=k.jsx("div",{className:"flex h-32 items-center justify-center bg-white dark:bg-gray-800 dark:text-white",children:"🌀 Loading diagram..."});else if(m)z=k.jsxs("div",{"data-aqmd-mermaid-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[k.jsxs("div",{children:["Error: ",m]}),k.jsxs("button",{type:"button","data-aqmd-mermaid-retry":"",onClick:()=>{v.current=!1,y(null),S(T=>T+1)},lang:s.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[k.jsx(Tn,{className:"h-4 w-4"}),s.retry.text]})]});else{const T=s[_?"interactionModeTouch":"interactionMode"],W=_?dM.map(j=>({value:j,label:s[_M[j]],checked:uM[E]===j})):cM.map(j=>({value:j,label:s[TM[j]],checked:E===j}));z=k.jsxs(k.Fragment,{children:[k.jsxs("div",{"data-aqmd-mermaid-toolbar":"",role:"toolbar","aria-labelledby":a,onKeyDown:A,onFocus:$,className:"mb-1 flex flex-wrap items-start justify-end gap-1",children:[k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[F("pan-left","panLeft",()=>R({x:1,y:0}),k.jsx(a1,{size:18}),!P),F("pan-up","panUp",()=>R({x:0,y:1}),k.jsx(c1,{size:18}),!P),F("pan-down","panDown",()=>R({x:0,y:-1}),k.jsx(o1,{size:18}),!P),F("pan-right","panRight",()=>R({x:-1,y:0}),k.jsx(l1,{size:18}),!P)]}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[!r&&k.jsx(Mx,{buttonHook:{"data-aqmd-mermaid-control":"mode"},menuHook:{"data-aqmd-mermaid-menu":""},label:T,icon:k.jsx(f1,{size:18}),tabIndex:O("mode"),items:W.map(({value:j,label:G,checked:X})=>({key:j,label:G,checked:X,onSelect:()=>B(j)}))}),F("zoom-in","zoomIn",()=>f.current?.zoomBy(1),k.jsx(bu,{size:20})),F("zoom-out","zoomOut",()=>f.current?.zoomBy(-1),k.jsx(ku,{size:20})),F("reset","resetView",()=>f.current?.reset(),k.jsx(Tn,{size:18}))]})]}),k.jsx("span",{id:a,hidden:!0,lang:s.diagram.lang,children:s.diagram.text}),k.jsx("div",{ref:h,"data-testid":"mermaid-diagram","data-aqmd-mermaid-frame":"","data-aqmd-mermaid-overflowing":P?"true":"false",role:"group",tabIndex:0,"aria-labelledby":a,onKeyDown:N,className:"mermaid mermaid-diagram-container bg-white dark:bg-gray-400"})]})}return k.jsxs("div",{className:"relative","data-aqmd-mermaid":"","data-source-lines":o,children:[k.jsx("div",{ref:c,"data-aqmd-mermaid-measure":!0,"aria-hidden":"true",style:OM}),z]})};Ox.displayName="MermaidDiagramInternal";const Yh=L.memo(Ox),NM="unicodeTextInMathMode",qM="noCharacterMetrics",zM=/^No character metrics for '.+' in style '.+' and mode '.+'$/su,jM="consoleCommand",WM=e=>{const t=(r,i)=>o=>(i(o),e(jM,`${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())}},Rx=(e,t)=>{const r=`${t?"display":"inline"}:${e}`,i=Ar.get(r);if(i!==void 0)return Ar.delete(r),Ar.set(r,i),i;const o=YM(e,t);return Ar.set(r,o),Ar.size>HM&&Ar.delete(Ar.keys().next().value),o},HM=610,Ar=new Map,YM=(e,t)=>{const r=[],i=(s,a)=>{r.push({code:s,message:a,formula:e,displayMode:t})},o=console.warn;console.warn=(...s)=>{const[a]=s;if(s.length===1&&typeof a=="string"&&zM.test(a)){i(qM,a);return}o.apply(console,s)};try{const s=AC.renderToString(e,{displayMode:t,throwOnError:!1,macros:WM(i),strict:(a,n)=>(a!==NM&&i(a,n),"ignore")});return Object.freeze({html:s,diagnostics:Object.freeze(r.map(a=>Object.freeze(a)))})}finally{console.warn=o}};const UM=[["rect",{width:"6",height:"10",x:"9",y:"7",rx:"2",key:"yn7j0q"}],["path",{d:"M4 22V2",key:"tsjzd3"}],["path",{d:"M20 22V2",key:"1bnhr8"}]],GM=Tt("align-horizontal-space-around",UM);const XM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],VM=Tt("chevron-down",XM);const KM=[["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"}]],Ix=Tt("copy",KM);const ZM=[["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"}]],QM=Tt("download",ZM);const JM=[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]],t5=Tt("fold-horizontal",JM);const e5=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]],r5=Tt("fold-vertical",e5);const i5=[["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"}]],o5=Tt("highlighter",i5);const s5=[["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"}]],a5=Tt("maximize-2",s5);const n5=[["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"}]],l5=Tt("minimize-2",n5);const h5=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],c5=Tt("ruler",h5);const d5=[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]],u5=Tt("unfold-horizontal",d5);const f5=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],g5=Tt("unfold-vertical",f5),Px=24,p5=1,m5=1,y5=Object.freeze({}),mn=e=>{const{rows:t,cols:r}=sa.measureTsv(e);return t*r},x5=26,C5=(e,t,r)=>{const i=e.length>t?Math.min(r,t):0,o=e.slice(0,t-i).map((a,n)=>({index:n,cells:a})),s=e.slice(e.length-i).map((a,n)=>({index:e.length-i+n,cells:a}));return[...o,...s]},b5=(e,t)=>Math.max(1,Math.min(e.visibleRows,t)),k5=3,w5=e=>Math.max(1,Math.min(k5,e)),yn=(e,t,r)=>((r?oe.SPREADSHEET_COLUMN_HEADER_HEIGHT_PX:0)+e*Px+oe.SPREADSHEET_SCROLLBAR_SIZE_PX)*t,S5=1,Wd=e=>Math.ceil(e)+S5,v5=(e,t)=>e>=t,oa=e=>Math.round(e*100),Hd=e=>{const t=oe.SPREADSHEET_ZOOM_STEPS.find(r=>oa(r)===e);if(t===void 0)throw new RangeError(`[@aiquants/markdown] no spreadsheet zoom step shows as ${String(e)} %`);return t},T5=(e,t,r)=>{if(t===0&&r===0)return e;const i=(e[0]?.length??0)+r,o=r===0?[...e]:e.map(s=>[...s,...Array(r).fill("")]);for(let s=0;s<t;s+=1)o.push(Array(i).fill(""));return o},Uh=e=>{let t=e.length;for(;t>1&&e[t-1].every(s=>s==="");)t-=1;const r=e[0]?.length??0;let i=r;const o=s=>{for(let a=0;a<t;a+=1)if(e[a][s]!=="")return!1;return!0};for(;i>1&&o(i-1);)i-=1;return t===0||i===0?[[""]]:t===e.length&&i===r?e:e.slice(0,t).map(s=>i===r?s:s.slice(0,i))},hs=e=>Uh(sa.parseTsv(e)),_5=["format","hyperlink","note","comments","validation"],B5=(e,t)=>{const r=new Map;let i=!1,o=!1;for(const s of t){if(!(Number.isInteger(s.row)&&Number.isInteger(s.col))||s.row<0||s.row>=e.length||s.col<0||s.col>=e[s.row].length)throw new RangeError(`[@aiquants/markdown] spreadsheet edit outside the table: row ${s.row}, column ${s.col}`);if(_5.some(l=>s[l]!==void 0&&s[l]!==null)&&(i=!0),s.text===void 0)continue;o=!0;const a=s.text.replace(/\r\n?/gu,`
311
+ </iframe>`},"putIntoIFrame"),Od=p((e,t,r,i,o)=>{const s=e.append("div");s.attr("id",r),i&&s.attr("style",i);const a=s.append("svg").attr("id",t).attr("width","100%").attr("xmlns",PA);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function _l(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}p(_l,"sandboxedIframe");var JA=p((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),tM=p(async function(e,t,r){Oa();const i=Wh(t);t=i.code;const o=Rt();V.debug(o),t.length>(o?.maxTextSize??$A)&&(t=OA);const s=`#${e}`,a="i"+e,n="#"+a,l="d"+e,c="#"+l,h=p(()=>{const N=yt(f?n:c).node();N&&"remove"in N&&N.remove()},"removeTempElements");let d=yt(document.body);const f=o.securityLevel===RA,u=o.securityLevel===IA,g=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const U=_l(yt(r),a);d=yt(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt(r);Od(d,e,l,`font-family: ${g}`,DA)}else{if(JA(document,e,l,a),f){const U=_l(yt(document.body),a);d=yt(U.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=yt("body");Od(d,e,l)}let m,y;try{m=await Tl.fromText(t,{title:i.title})}catch(U){if(o.suppressErrorRendering)throw h(),U;m=await Tl.fromText("error"),y=U}const x=d.select(c).node(),C=m.type,w=x.firstChild,S=w.firstChild,v=m.renderer.getClasses?.(t,m),_=KA(o,C,v,s),E=document.createElement("style");E.innerHTML=_,w.insertBefore(E,S);try{await m.renderer.draw(t,e,"11.16.0",m)}catch(U){throw o.suppressErrorRendering?h():aF.draw(t,e,"11.16.0"),U}const B=d.select(`${c} svg`),D=m.db.getAccTitle?.(),M=m.db.getAccDescription?.();Sx(C,B,D,M),d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",NA);let P=d.select(c).node().innerHTML;if(V.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),P=ZA(P,f,Ve(o.arrowMarkerAbsolute)),f){const U=d.select(c+" svg").node();P=QA(P,U)}else u||(P=$i.sanitize(P,{ADD_TAGS:UA,ADD_ATTR:GA,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(LA(),y)throw y;return h(),{diagramType:C,svg:P,bindFunctions:m.db.bindFunctions}},"render");function kx(e={}){const t=jt({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),Z1(t),t?.theme&&t.theme in or?t.themeVariables=or[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=or.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?K1(t):Eu();Ol(r.logLevel),Oa()}p(kx,"initialize");var wx=p((e,t={})=>{const{code:r}=jh(e);return Tl.fromText(r,t)},"getDiagramFromText");function Sx(e,t,r,i){mx(t,e),yx(t,r,i,t.attr("id"))}p(Sx,"addA11yInfo");var Xr=Object.freeze({render:tM,parse:bx,getDiagramFromText:wx,initialize:kx,getConfig:Rt,setConfig:Fu,getSiteConfig:Eu,updateSiteConfig:Q1,reset:p(()=>{Es()},"reset"),globalReset:p(()=>{Es(Ri)},"globalReset"),defaultConfig:Ri});Ol(Rt().logLevel);Es(Rt());var eM=p((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"),vx=p(async function(e={querySelector:".mermaid"}){try{await rM(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"),rM=p(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=Xr.getConfig();V.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");V.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(V.debug("Start On Load: "+i?.startOnLoad),Xr.updateSiteConfig({startOnLoad:i?.startOnLoad}));const s=new we.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const n=[];for(const l of Array.from(o)){if(V.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${s.next()}`;a=l.innerHTML,a=Bm(we.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=we.detectInit(a);h&&V.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await Lx(c,a,l);l.innerHTML=d,e&&await e(c),f&&f(l)}catch(d){eM(d,n,nr.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),Tx=p(function(e){Xr.initialize(e)},"initialize"),iM=p(async function(e,t,r){V.warn("mermaid.init is deprecated. Please use run instead."),e&&Tx(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await vx(i)},"init"),oM=p(async(e,{lazyLoad:t=!0}={})=>{Oa(),Bn(...e),t===!1&&await _A()},"registerExternalDiagrams"),_x=p(function(){if(nr.startOnLoad){const{startOnLoad:e}=Xr.getConfig();e&&nr.run().catch(t=>V.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",_x,!1);var sM=p(function(e){nr.parseError=e},"setParseErrorHandler"),ia=[],un=!1,Bx=p(async()=>{if(!un){for(un=!0;ia.length>0;){const e=ia.shift();if(e)try{await e()}catch(t){V.error("Error executing queue",t)}}un=!1}},"executeQueue"),aM=p(async(e,t)=>new Promise((r,i)=>{const o=p(()=>new Promise((s,a)=>{Xr.parse(e,t).then(n=>{s(n),r(n)},n=>{V.error("Error parsing",n),nr.parseError?.(n),a(n),i(n)})}),"performCall");ia.push(o),Bx().catch(i)}),"parse"),Lx=p((e,t,r)=>new Promise((i,o)=>{const s=p(()=>new Promise((a,n)=>{Xr.render(e,t,r).then(l=>{a(l),i(l)},l=>{V.error("Error parsing",l),nr.parseError?.(l),n(l),o(l)})}),"performCall");ia.push(s),Bx().catch(o)}),"render"),nM=p(()=>Object.keys(Hr).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),nr={startOnLoad:!0,mermaidAPI:Xr,parse:aM,render:Lx,init:iM,run:vx,registerExternalDiagrams:oM,registerLayoutLoaders:v0,initialize:Tx,parseError:void 0,contentLoaded:_x,setParseErrorHandler:sM,detectType:Pl,registerIconPacks:gm,getRegisteredDiagramsMetadata:nM},Bl=nr;const Vr="flex size-11 items-center justify-center rounded border p-1 shadow",lM="flex h-11 min-w-11 items-center justify-center rounded border px-2 text-sm shadow",hM="absolute top-full z-20 mt-1 w-60 overflow-hidden rounded border py-1 text-sm shadow-lg",Rd="flex min-h-11 w-full items-center gap-2 px-3 py-1.5 text-start",Ex="both-shift",Id=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})}),cM=Object.freeze(["none","zoom","pan","pan-shift","both","both-shift"]),dM=Object.freeze(["none","zoom","pan","both"]),uM=Object.freeze({none:"none",zoom:"zoom",pan:"pan","pan-shift":"pan",both:"both","both-shift":"both"}),vs=.3,fM=3,gM=2,Rr=.5,pM=1;function Pd(e,t){return e.panTrigger!==null&&t?e.zoom?"none":"pinch-zoom":e.zoom?"pan-x pan-y":"auto"}const mM=0;function fn(e,t,r){return e.panTrigger===null||t.button!==mM?!1:t.pointerType==="touch"||t.pointerType==="pen"?r:e.panTrigger==="drag"||t.shiftKey}function yM(e,t){return e.zoom&&t.shiftKey}function xM(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 CM(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 bM(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:gM/e}}function gn(e,t){return Math.min(t.maxScale,Math.max(t.minScale,e))}function lo(e,t,r,i,o){return{scale:t,x:e.x+(i.x-o.origin.x)/t-(r.x-o.origin.x)/e.scale,y:e.y+(i.y-o.origin.y)/t-(r.y-o.origin.y)/e.scale}}function kM(e,t,r){const i=(o,s,a,n)=>{const l=(0-s)/e.scale,c=(n-s-e.scale*a)/e.scale;return Math.min(Math.max(l,c),Math.max(Math.min(l,c),o))};return{scale:e.scale,x:i(e.x,t.origin.x,t.inline,r.inline),y:i(e.y,t.origin.y,t.block,r.block)}}function wM(e,t,r){return e*t.inline-r.inline>Rr||e*t.block-r.block>Rr}function SM(e,t){const r=s=>Math.hypot(s[1].x-s[0].x,s[1].y-s[0].y),i=s=>({x:(s[0].x+s[1].x)/2,y:(s[0].y+s[1].y)/2}),o=r(e);return o<pM?null:{ratio:r(t)/o,from:i(e),to:i(t)}}function Dd(e){return e*(1-Math.exp(-vs))}function Nd(e,t,r){const i=e<-Rr||e>Rr;return t-e>r+Rr?i?0-e:0:e<-Rr?0-e:t>r+Rr?r-t:0}const Ra=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"}}),vM=aa(Ra),TM=Object.freeze({none:"modeNone",zoom:"modeZoom",pan:"modePan","pan-shift":"modePanShift",both:"modeBoth","both-shift":"modeBothShift"}),_M=Object.freeze({none:"modeNoneTouch",zoom:"modeZoomTouch",pan:"modePanTouch",both:"modeBothTouch"}),Fx="(pointer: coarse)",BM=e=>{const t=window.matchMedia(Fx);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},LM=()=>window.matchMedia(Fx).matches,EM=()=>!1,FM=()=>L.useSyncExternalStore(BM,LM,EM),Hh=(e,t)=>{const[r,i]=L.useState(null),o=r!==null&&e.includes(r)?r:e[0],s=l=>l instanceof Element?l.getAttribute(t):null;return{onKeyDown:l=>{const c=s(l.target);if(c===null||l.altKey||l.ctrlKey||l.metaKey||l.shiftKey)return;const h=e.indexOf(c);if(h===-1)return;const d=l.currentTarget.ownerDocument.defaultView?.getComputedStyle(l.currentTarget).direction==="rtl",f=d?"ArrowLeft":"ArrowRight",u=d?"ArrowRight":"ArrowLeft";let g;switch(l.key){case f:g=(h+1)%e.length;break;case u:g=(h-1+e.length)%e.length;break;case"Home":g=0;break;case"End":g=e.length-1;break;default:return}l.preventDefault(),l.currentTarget.querySelector(`[${t}="${e[g]}"]`)?.focus()},onFocus:l=>{const c=s(l.target);c!==null&&e.includes(c)&&i(c)},tabIndexOf:l=>l===o?0:-1}},_o={side:"start",offset:0,maxWidth:null},AM=(e,t,r,i)=>{const o=l=>l>=r.low&&l+t<=r.high;if(o(i?e.right-t:e.left))return _o;if(o(i?e.left:e.right-t))return{side:"end",offset:e.right-e.left-t,maxWidth:null};const s=r.high-r.low;if(s<=0)return _o;const a=Math.min(t,s),n=Math.min(Math.max(i?e.right-a:e.left,r.low),r.high-a);return{side:"inside",offset:i?e.right-n-a:n-e.left,maxWidth:a<t?a:null}},Ax=({buttonHook:e,menuHook:t,label:r,icon:i,tabIndex:o,items:s})=>{const[a,n]=L.useState(null),[l,c]=L.useState(_o),h=a!==null,d=L.useId(),f=L.useId(),u=L.useRef(null),g=L.useRef(null),m=L.useRef(null),y=()=>Array.from(m.current?.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')??[]),x=S=>{n(null),c(_o),S&&g.current?.focus()};L.useLayoutEffect(()=>{const S=u.current,v=m.current;if(a===null||S===null||v===null)return;const _=v.ownerDocument.documentElement.clientWidth,E=S.closest('[role="toolbar"]')?.getBoundingClientRect(),B=E===void 0?{low:0,high:_}:{low:Math.max(0,E.left),high:Math.min(_,E.right)},D=v.ownerDocument.defaultView?.getComputedStyle(v).direction==="rtl";c(AM(S.getBoundingClientRect(),v.getBoundingClientRect().width,B,D));const M=y(),P=M.findIndex(N=>N.getAttribute("aria-checked")==="true"),U=a==="last"?M.length-1:Math.max(P,0);M[U]?.focus()},[a]),L.useEffect(()=>{const S=u.current?.ownerDocument;if(!h||S===void 0)return;const v=_=>{_.target instanceof Node&&u.current?.contains(_.target)===!0||(n(null),c(_o))};return S.addEventListener("pointerdown",v,!0),S.addEventListener("focusin",v,!0),()=>{S.removeEventListener("pointerdown",v,!0),S.removeEventListener("focusin",v,!0)}},[h]);const C=S=>{if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),n(S.key==="ArrowUp"?"last":"chosen");return}S.key==="Escape"&&h&&(S.preventDefault(),S.stopPropagation(),x(!1))},w=S=>{const v=y(),_=v.indexOf(S.target);let E;switch(S.key){case"ArrowDown":E=(_+1)%v.length;break;case"ArrowUp":E=(_-1+v.length)%v.length;break;case"Home":E=0;break;case"End":E=v.length-1;break;case"Escape":S.preventDefault(),S.stopPropagation(),x(!0);return;default:return}S.preventDefault(),S.stopPropagation(),v[E]?.focus()};return k.jsxs("div",{ref:u,className:"relative",children:[k.jsx("button",{ref:g,id:d,type:"button",...e,tabIndex:o,onClick:()=>h?x(!1):n("chosen"),onKeyDown:C,className:Vr,"aria-label":r.text,lang:r.lang,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?f:void 0,children:i}),h&&k.jsx("div",{ref:m,id:f,role:"menu","aria-labelledby":d,...t,"data-aqmd-control-menu":l.side,style:l.maxWidth===null?{insetInlineStart:l.offset}:{insetInlineStart:l.offset,maxInlineSize:l.maxWidth},onKeyDown:w,className:hM,children:s.map(S=>{const v=()=>{x(!0),S.onSelect()};return S.checked===void 0?k.jsx("button",{type:"button",role:"menuitem",tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Rd,children:k.jsx("span",{children:S.label.text})},S.key):k.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":S.checked,tabIndex:-1,lang:S.label.lang,...S.hook,onClick:v,className:Rd,children:[k.jsx("span",{className:"w-3 shrink-0","aria-hidden":"true",children:S.checked?"✓":""}),k.jsx("span",{children:S.label.text})]},S.key)})})]})},qd=new Set(["gantt"]),MM=200,$M=300,OM=Object.freeze({height:0,overflow:"hidden",visibility:"hidden",contain:"strict"}),RM="data-aqmd-mermaid-host",IM=e=>{const t=document.createElement("div");return t.setAttribute(RM,""),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 zd=Promise.resolve();const PM=e=>{const t=e instanceof Error?e.message:String(e);return t.includes("dynamically imported module")||t.includes("Importing a module script failed")},jd=e=>{e.resetStyle(),e.destroy()},pn=(e,t)=>t?"grabbing":e.panTrigger==="drag"?"move":"",DM=Object.freeze({visibility:"hidden"});let Mx=!1,Ll=null;if(Bl?.initialize)try{Bl.initialize({startOnLoad:!1}),Mx=!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 $x=({chartContent:e,interaction:t,hideInteractionMenu:r=!1,labels:i,sourceLines:o})=>{const s=L.useMemo(()=>Oi(Ra,i),[i]),a=L.useId(),n=L.useRef(`mermaid-chart-${Math.random().toString(36).substring(2,15)}`),l=L.useRef(0),c=L.useRef(null),h=L.useRef(null),d=L.useRef(null),f=L.useRef(null),[u,g]=L.useState(!0),[m,y]=L.useState(null),[x,C]=L.useState(null),[w,S]=L.useState(0),v=L.useRef(!1),_=FM(),[E,B]=L.useState(t??Ex),D=L.useRef(Id[E]),M=L.useRef(!1),[P,U]=L.useState(!1);L.useEffect(()=>{t&&B(t)},[t]),L.useEffect(()=>{D.current=Id[E],f.current?.refresh()},[E]),L.useEffect(()=>{if(g(!0),y(null),C(null),!Mx){y(Ll?.message||"Mermaid failed to initialize globally."),g(!1);return}const T=e.trim();if(T===""){g(!1);return}const W=c.current;if(!W)throw new Error("[@aiquants/markdown] MermaidDiagram: the measuring element is not mounted");let j=!1,G=0,X=null,K=W.offsetWidth,Z=null,at,mt;const ht=()=>{Nt.disconnect(),clearTimeout(at)},ct=Gt=>{Z=null,ht(),y(Gt),C(null),g(!1)},_t=Gt=>{l.current+=1;const te=l.current;G=te,X=Gt;const xe=()=>!j&&te===G,_e=async()=>{const Ft=IM(Gt);try{return await Bl.render(`${n.current}-${te}`,T,Ft)}finally{Ft.remove()}};zd=zd.then(()=>xe()?_e().then(Ft=>{if(xe()){if(typeof Ft.svg!="string"||Ft.svg.length===0){ct("Failed to render Mermaid diagram: SVG content is empty or invalid.");return}Z=Ft.diagramType,C({svg:Ft.svg,bindFunctions:typeof Ft.bindFunctions=="function"?Ft.bindFunctions:null}),g(!1),qd.has(Ft.diagramType)?K!==Gt&&Ct():Nt.disconnect()}}).catch(Ft=>{if(xe()){if(console.error(`[MermaidDiagram ${n.current}] Error rendering Mermaid diagram:`,Ft),PM(Ft)&&!v.current){v.current=!0,mt=setTimeout(()=>S(wt=>wt+1),$M);return}ct(Ft instanceof Error?Ft.message:"An unknown error occurred while rendering the diagram.")}}):Promise.resolve())},Ct=()=>{clearTimeout(at),at=setTimeout(()=>{K>0&&K!==X&&_t(K)},MM)},Et=()=>{const Gt=W.offsetWidth;if(Gt!==K){if(K=Gt,X===null){Gt>0&&_t(Gt);return}Z!==null&&qd.has(Z)&&Ct()}},Nt=new ResizeObserver(Et);return Nt.observe(W),K>0&&_t(K),()=>{j=!0,ht(),clearTimeout(mt)}},[e,w]),L.useEffect(()=>{const T=h.current;if(!T)return;const W=()=>{f.current=null,d.current&&(jd(d.current),d.current=null),M.current=!1,U(!1)};if(!x){T.innerHTML="",W();return}T.innerHTML=x.svg;const j=T.querySelector("svg");let G=!1,X;const K=[];if(j){let Z;try{Z=xM(j.getAttribute("viewBox"))}catch(ht){console.error(`[MermaidDiagram ${n.current}] Cannot size the drawing:`,ht),y(ht instanceof Error?ht.message:String(ht)),C(null);return}const at=Z,mt=()=>{if(G)return;const ht=j.getBBox();if(!ht||ht.width===0||ht.height===0){X=setTimeout(mt,100);return}d.current&&jd(d.current);const ct=xu(j,{startScale:1,startX:0,startY:0,minScale:1,maxScale:1,origin:"0 0",step:vs,animate:!1,noBind:!0,cursor:"",overflow:"",touchAction:Pd(D.current,!1)});d.current=ct;let _t={minScale:1,maxScale:1};const Ct=()=>{const J=ct.getPan();return{scale:ct.getScale(),x:J.x,y:J.y}},Et=()=>{const J=T.getBoundingClientRect(),ft=j.getBoundingClientRect(),{scale:xt,x:Pt,y:At}=Ct();return{frameRect:J,frame:{inline:J.width,block:J.height},drawing:{origin:{x:ft.left-J.left-xt*Pt,y:ft.top-J.top-xt*At},inline:ft.width/xt,block:ft.height/xt}}},Nt=()=>{if(G)return;const{frame:J,drawing:ft}=Et(),xt=wM(ct.getScale(),ft,J);M.current=xt,U(xt),Ze(xt),ct.setOptions({touchAction:Pd(D.current,xt)}),T.style.cursor=pn(D.current,wt?.kind==="pan"&&wt.mouse)},Gt=()=>{const J=T.getBoundingClientRect().width;J<=0||(_t=bM(CM(J,at)),ct.setOptions({minScale:_t.minScale,maxScale:_t.maxScale}))},te=J=>{const ft=Ct(),{frame:xt,drawing:Pt}=Et(),At=kM({...J,scale:gn(J.scale,_t)},Pt,xt);return At.scale===ft.scale&&At.x===ft.x&&At.y===ft.y?!1:(ct.zoom(At.scale,{animate:!1,force:!0,silent:!0}),ct.pan(At.x,At.y,{animate:!1,force:!0}),Nt(),!0)},xe=(J,ft)=>{const{drawing:xt}=Et();return te(lo(Ct(),gn(J,_t),ft,ft,xt))},_e=J=>{const ft=T.getBoundingClientRect();return{x:J.x-ft.left,y:J.y-ft.top}};f.current={zoomBy:J=>{const{frame:ft}=Et();xe(ct.getScale()*Math.exp(J*vs),{x:ft.inline/2,y:ft.block/2})},panBy:(J,ft)=>{const{drawing:xt}=Et(),Pt=Ct();return te(lo(Pt,Pt.scale,{x:0,y:0},{x:J,y:ft},xt))},reset:()=>{te({scale:1,x:0,y:0})},panSteps:()=>{const{frame:J}=Et();return{x:Dd(J.inline),y:Dd(J.block)}},refresh:Nt};const Ft=new Map;let wt=null;const Be=J=>({x:J.clientX,y:J.clientY}),Qr=()=>{const J=[...Ft.values()];return J.length===2?[J[0],J[1]]:null},hr=J=>{if(Ft.has(J.pointerId)&&Ft.set(J.pointerId,Be(J)),wt?.kind==="pinch"){const ft=Qr();if(ft===null)return;const xt=SM(wt.last,ft);if(wt={kind:"pinch",last:ft},xt===null)return;const{drawing:Pt}=Et(),At=Ct();te(lo(At,gn(At.scale*xt.ratio,_t),_e(xt.from),_e(xt.to),Pt));return}if(wt?.kind==="pan"&&wt.pointerId===J.pointerId){const ft=Be(J),{drawing:xt}=Et(),Pt=Ct();te(lo(Pt,Pt.scale,_e(wt.last),_e(ft),xt)),wt={...wt,last:ft}}},vr=()=>{window.removeEventListener("pointermove",hr),window.removeEventListener("pointerup",Le),window.removeEventListener("pointercancel",Le)},De=()=>{vr(),window.addEventListener("pointermove",hr),window.addEventListener("pointerup",Le),window.addEventListener("pointercancel",Le)},Le=J=>{if(Ft.delete(J.pointerId),wt?.kind==="pinch"){const[ft]=[...Ft.entries()];wt=ft!==void 0&&fn(D.current,{button:0,shiftKey:!1,pointerType:J.pointerType},M.current)?{kind:"pan",pointerId:ft[0],last:ft[1],mouse:!1}:null}else wt?.kind==="pan"&&wt.pointerId===J.pointerId&&(wt=null);wt===null&&Ft.size===0&&vr(),T.style.cursor=pn(D.current,wt?.kind==="pan"&&wt.mouse)},Tr=J=>{const ft=D.current;if(J.pointerType==="touch"||J.pointerType==="pen"){Ft.set(J.pointerId,Be(J)),De();const xt=Qr();xt!==null&&ft.zoom?wt={kind:"pinch",last:xt}:Ft.size>1?wt?.kind==="pan"&&!wt.mouse&&(wt=null):fn(ft,J,M.current)&&(wt={kind:"pan",pointerId:J.pointerId,last:Be(J),mouse:!1});return}fn(ft,J,M.current)&&(wt={kind:"pan",pointerId:J.pointerId,last:Be(J),mouse:!0},T.style.cursor=pn(ft,!0),De(),J.preventDefault())},Jr=J=>{wt!==null&&!(wt.kind==="pan"&&wt.mouse)&&J.cancelable&&J.preventDefault()};let Ce=!1;const Ze=J=>{J!==Ce&&(Ce=J,J?T.addEventListener("touchmove",Jr,{passive:!1}):T.removeEventListener("touchmove",Jr))},cr=J=>{const ft=J.target;if(!(ft instanceof Element)||ft===j||!j.contains(ft))return;const xt=T.getBoundingClientRect(),Pt=ft.getBoundingClientRect(),At={x:Nd(Pt.left-xt.left,Pt.right-xt.left,xt.width),y:Nd(Pt.top-xt.top,Pt.bottom-xt.top,xt.height)};if(At.x===0&&At.y===0)return;const{drawing:Zi}=Et(),ei=Ct();te(lo(ei,ei.scale,{x:0,y:0},At,Zi))},ti=J=>{if(!yM(D.current,J))return;const ft=J.deltaY===0?J.deltaX:J.deltaY;ft!==0&&(J.preventDefault(),xe(ct.getScale()*Math.exp(Math.sign(-ft)*vs/fM),_e(Be(J))))},_r=new ResizeObserver(()=>{Gt(),te(Ct()),Nt()});T.addEventListener("pointerdown",Tr),T.addEventListener("focusin",cr),T.addEventListener("wheel",ti,{passive:!1}),j.addEventListener("panzoomchange",Nt),_r.observe(T),K.push(()=>{T.removeEventListener("pointerdown",Tr),T.removeEventListener("focusin",cr),Ze(!1),T.removeEventListener("wheel",ti),j.removeEventListener("panzoomchange",Nt),_r.disconnect(),vr()}),Gt(),Nt()};mt()}return x.bindFunctions&&x.bindFunctions(T),()=>{G=!0,clearTimeout(X);for(const Z of K)Z();W()}},[x]);const N=L.useCallback(T=>{const W=f.current;if(W===null||T.target!==T.currentTarget||T.altKey||T.ctrlKey||T.metaKey)return;const j=W.panSteps();let G;switch(T.key){case"ArrowLeft":G=W.panBy(j.x,0);break;case"ArrowRight":G=W.panBy(-j.x,0);break;case"ArrowUp":G=W.panBy(0,j.y);break;case"ArrowDown":G=W.panBy(0,-j.y);break;case"+":case"=":W.zoomBy(1),G=!0;break;case"-":W.zoomBy(-1),G=!0;break;case"0":W.reset(),G=!0;break;default:G=!1}G&&T.preventDefault()},[]),q=L.useMemo(()=>[...P?["pan-left","pan-up","pan-down","pan-right"]:[],...r?[]:["mode"],"zoom-in","zoom-out","reset"],[r,P]),{onKeyDown:A,onFocus:$,tabIndexOf:O}=Hh(q,"data-aqmd-mermaid-control"),F=(T,W,j,G,X=!1)=>k.jsx("button",{type:"button","data-aqmd-mermaid-control":T,tabIndex:O(T),onClick:j,style:X?DM:void 0,className:Vr,"aria-label":s[W].text,lang:s[W].lang,children:G},T),R=T=>{const W=f.current;if(W===null)return;const j=W.panSteps();W.panBy(T.x*j.x,T.y*j.y)};let z;if(u)z=k.jsx("div",{className:"flex h-32 items-center justify-center bg-white dark:bg-gray-800 dark:text-white",children:"🌀 Loading diagram..."});else if(m)z=k.jsxs("div",{"data-aqmd-mermaid-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[k.jsxs("div",{children:["Error: ",m]}),k.jsxs("button",{type:"button","data-aqmd-mermaid-retry":"",onClick:()=>{v.current=!1,y(null),S(T=>T+1)},lang:s.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[k.jsx(Tn,{className:"h-4 w-4"}),s.retry.text]})]});else{const T=s[_?"interactionModeTouch":"interactionMode"],W=_?dM.map(j=>({value:j,label:s[_M[j]],checked:uM[E]===j})):cM.map(j=>({value:j,label:s[TM[j]],checked:E===j}));z=k.jsxs(k.Fragment,{children:[k.jsxs("div",{"data-aqmd-mermaid-toolbar":"",role:"toolbar","aria-labelledby":a,onKeyDown:A,onFocus:$,className:"mb-1 flex flex-wrap items-start justify-end gap-1",children:[k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[F("pan-left","panLeft",()=>R({x:1,y:0}),k.jsx(a1,{size:18}),!P),F("pan-up","panUp",()=>R({x:0,y:1}),k.jsx(c1,{size:18}),!P),F("pan-down","panDown",()=>R({x:0,y:-1}),k.jsx(o1,{size:18}),!P),F("pan-right","panRight",()=>R({x:-1,y:0}),k.jsx(l1,{size:18}),!P)]}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[!r&&k.jsx(Ax,{buttonHook:{"data-aqmd-mermaid-control":"mode"},menuHook:{"data-aqmd-mermaid-menu":""},label:T,icon:k.jsx(f1,{size:18}),tabIndex:O("mode"),items:W.map(({value:j,label:G,checked:X})=>({key:j,label:G,checked:X,onSelect:()=>B(j)}))}),F("zoom-in","zoomIn",()=>f.current?.zoomBy(1),k.jsx(Cu,{size:20})),F("zoom-out","zoomOut",()=>f.current?.zoomBy(-1),k.jsx(bu,{size:20})),F("reset","resetView",()=>f.current?.reset(),k.jsx(Tn,{size:18}))]})]}),k.jsx("span",{id:a,hidden:!0,lang:s.diagram.lang,children:s.diagram.text}),k.jsx("div",{ref:h,"data-testid":"mermaid-diagram","data-aqmd-mermaid-frame":"","data-aqmd-mermaid-overflowing":P?"true":"false",role:"group",tabIndex:0,"aria-labelledby":a,onKeyDown:N,className:"mermaid mermaid-diagram-container bg-white dark:bg-gray-400"})]})}return k.jsxs("div",{className:"relative","data-aqmd-mermaid":"","data-source-lines":o,children:[k.jsx("div",{ref:c,"data-aqmd-mermaid-measure":!0,"aria-hidden":"true",style:OM}),z]})};$x.displayName="MermaidDiagramInternal";const Yh=L.memo($x),NM="unicodeTextInMathMode",qM="noCharacterMetrics",zM=/^No character metrics for '.+' in style '.+' and mode '.+'$/su,jM="consoleCommand",WM=e=>{const t=(r,i)=>o=>(i(o),e(jM,`${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())}},Ox=(e,t)=>{const r=`${t?"display":"inline"}:${e}`,i=Ar.get(r);if(i!==void 0)return Ar.delete(r),Ar.set(r,i),i;const o=YM(e,t);return Ar.set(r,o),Ar.size>HM&&Ar.delete(Ar.keys().next().value),o},HM=610,Ar=new Map,YM=(e,t)=>{const r=[],i=(s,a)=>{r.push({code:s,message:a,formula:e,displayMode:t})},o=console.warn;console.warn=(...s)=>{const[a]=s;if(s.length===1&&typeof a=="string"&&zM.test(a)){i(qM,a);return}o.apply(console,s)};try{const s=AC.renderToString(e,{displayMode:t,throwOnError:!1,macros:WM(i),strict:(a,n)=>(a!==NM&&i(a,n),"ignore")});return Object.freeze({html:s,diagnostics:Object.freeze(r.map(a=>Object.freeze(a)))})}finally{console.warn=o}};const UM=[["rect",{width:"6",height:"10",x:"9",y:"7",rx:"2",key:"yn7j0q"}],["path",{d:"M4 22V2",key:"tsjzd3"}],["path",{d:"M20 22V2",key:"1bnhr8"}]],GM=Tt("align-horizontal-space-around",UM);const XM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],VM=Tt("chevron-down",XM);const KM=[["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"}]],Rx=Tt("copy",KM);const ZM=[["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"}]],QM=Tt("download",ZM);const JM=[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]],t5=Tt("fold-horizontal",JM);const e5=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3-3-3 3",key:"e37ymu"}],["path",{d:"m15 5-3 3-3-3",key:"19d6lf"}]],r5=Tt("fold-vertical",e5);const i5=[["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"}]],o5=Tt("highlighter",i5);const s5=[["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"}]],a5=Tt("maximize-2",s5);const n5=[["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"}]],l5=Tt("minimize-2",n5);const h5=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],c5=Tt("ruler",h5);const d5=[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]],u5=Tt("unfold-horizontal",d5);const f5=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],g5=Tt("unfold-vertical",f5),Ix=24,p5=1,m5=1,y5=Object.freeze({}),mn=e=>{const{rows:t,cols:r}=sa.measureTsv(e);return t*r},x5=26,C5=(e,t,r)=>{const i=e.length>t?Math.min(r,t):0,o=e.slice(0,t-i).map((a,n)=>({index:n,cells:a})),s=e.slice(e.length-i).map((a,n)=>({index:e.length-i+n,cells:a}));return[...o,...s]},b5=(e,t)=>Math.max(1,Math.min(e.visibleRows,t)),k5=3,w5=e=>Math.max(1,Math.min(k5,e)),yn=(e,t,r)=>((r?oe.SPREADSHEET_COLUMN_HEADER_HEIGHT_PX:0)+e*Ix+oe.SPREADSHEET_SCROLLBAR_SIZE_PX)*t,S5=1,Wd=e=>Math.ceil(e)+S5,v5=(e,t)=>e>=t,oa=e=>Math.round(e*100),Hd=e=>{const t=oe.SPREADSHEET_ZOOM_STEPS.find(r=>oa(r)===e);if(t===void 0)throw new RangeError(`[@aiquants/markdown] no spreadsheet zoom step shows as ${String(e)} %`);return t},T5=(e,t,r)=>{if(t===0&&r===0)return e;const i=(e[0]?.length??0)+r,o=r===0?[...e]:e.map(s=>[...s,...Array(r).fill("")]);for(let s=0;s<t;s+=1)o.push(Array(i).fill(""));return o},Uh=e=>{let t=e.length;for(;t>1&&e[t-1].every(s=>s==="");)t-=1;const r=e[0]?.length??0;let i=r;const o=s=>{for(let a=0;a<t;a+=1)if(e[a][s]!=="")return!1;return!0};for(;i>1&&o(i-1);)i-=1;return t===0||i===0?[[""]]:t===e.length&&i===r?e:e.slice(0,t).map(s=>i===r?s:s.slice(0,i))},hs=e=>Uh(sa.parseTsv(e)),_5=["format","hyperlink","note","comments","validation"],B5=(e,t)=>{const r=new Map;let i=!1,o=!1;for(const s of t){if(!(Number.isInteger(s.row)&&Number.isInteger(s.col))||s.row<0||s.row>=e.length||s.col<0||s.col>=e[s.row].length)throw new RangeError(`[@aiquants/markdown] spreadsheet edit outside the table: row ${s.row}, column ${s.col}`);if(_5.some(l=>s[l]!==void 0&&s[l]!==null)&&(i=!0),s.text===void 0)continue;o=!0;const a=s.text.replace(/\r\n?/gu,`
312
312
  `),n=r.get(s.row);if(n!==void 0)n[s.col]=a;else if(e[s.row][s.col]!==a){const l=[...e[s.row]];l[s.col]=a,r.set(s.row,l)}}if(r.size>0){const s=[...e];for(const[a,n]of r)s[a]=n;return{kind:"applied",matrix:s}}return i&&!o?{kind:"format-only"}:{kind:"unchanged"}},L5=e=>{const t=Uh(e).map(r=>{let i=r.length;for(;i>0&&r[i-1]==="";)i-=1;return i===r.length?r:r.slice(0,i)});return sa.serializeTsv(t).replaceAll(`\r
313
313
  `,`
314
- `)},E5=(e,t)=>{const r=e.indexOf(t);return r===-1?{echo:!1,pending:[]}:{echo:!0,pending:e.slice(r+1)}},F5=(e,t,r,i,o)=>{const s=o==="down"?1:o==="up"?-1:0,a=o==="right"?1:o==="left"?-1:0,n=(d,f)=>d>=0&&d<t&&f>=0&&f<r,l=(d,f)=>e(d,f)!=="";let c=i.row+s,h=i.col+a;if(!n(c,h))return{row:i.row,col:i.col};if(l(i.row,i.col)&&l(c,h)){for(;n(c+s,h+a)&&l(c+s,h+a);)c+=s,h+=a;return{row:c,col:h}}for(;n(c,h);){if(l(c,h))return{row:c,col:h};c+=s,h+=a}return{row:c-s,col:h-a}},A5=/^(?:https?:\/\/|mailto:|tel:)\S+$/iu,M5=e=>A5.test(e)?e:void 0,$5=(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}`},O5=Object.freeze(["decreaseColumnWidth","increaseColumnWidth","autoFitColumnWidth","decreaseRowHeight","increaseRowHeight"]),R5=()=>{let e=Object.freeze({row:0,col:0});const t=new Set;return{get:()=>e,set:r=>{if(!(r.row===e.row&&r.col===e.col)){e=Object.freeze({row:r.row,col:r.col});for(const i of[...t])i()}},subscribe:r=>(t.add(r),()=>{t.delete(r)})}},cs="data-aqmd-spreadsheet-control",I5=Object.freeze(["zoom-in","zoom-out","reset-zoom","highlight","track-size","copy","save","save-menu","fullscreen"]),P5=({labels:e,labelledBy:t,rows:r,cols:i,canZoomIn:o,canZoomOut:s,zoom:a,onZoom:n,onResetZoom:l,highlighted:c,onToggleHighlight:h,onCopy:d,onSave:f,fullscreen:u,onToggleFullscreen:g,gridReady:m,activeCell:y,onTrackSize:x})=>{const{onKeyDown:C,onFocus:w,tabIndexOf:S}=Hh(I5,cs),[v,_]=L.useState(!1),E=L.useId(),B=L.useRef(null),D=v&&m,M=(N,q,A,$,O,F,R=Vr)=>k.jsx("button",{type:"button",[cs]:N,tabIndex:S(N),onClick:O?A:void 0,"aria-disabled":O?void 0:"true","aria-pressed":F,className:R,"aria-label":q.text,lang:q.lang,children:$}),P=oa(a),U={text:It.fillLabel(e.resetZoom.text,{percent:P}),lang:e.resetZoom.lang};return k.jsxs(k.Fragment,{children:[k.jsxs("div",{"data-aqmd-spreadsheet-toolbar":"",role:"toolbar","aria-labelledby":t,onKeyDown:C,onFocus:w,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:[k.jsx("span",{"data-aqmd-spreadsheet-size":"",lang:e.size.lang,className:"me-auto text-sm",children:It.fillLabel(e.size.text,{rows:r,cols:i})}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[M("zoom-in",e.zoomIn,()=>n(1),k.jsx(bu,{size:20}),m&&o),M("zoom-out",e.zoomOut,()=>n(-1),k.jsx(ku,{size:20}),m&&s),M("reset-zoom",U,l,k.jsxs("span",{"data-aqmd-spreadsheet-zoom":"",children:[k.jsxs("span",{"data-aqmd-spreadsheet-zoom-widest":"","aria-hidden":"true",children:[oa(oe.SPREADSHEET_ZOOM_MAX)," %"]}),k.jsxs("span",{children:[P," %"]})]}),m&&a!==1,void 0,lM)]}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[M("highlight",e.highlight,h,k.jsx(o5,{size:18}),m,c),k.jsx("button",{type:"button",ref:B,[cs]:"track-size",tabIndex:S("track-size"),onClick:m?()=>_(N=>!N):void 0,"aria-disabled":m?void 0:"true","aria-expanded":D,"aria-controls":D?E:void 0,className:Vr,"aria-label":e.trackSize.text,lang:e.trackSize.lang,children:k.jsx(c5,{size:18})})]}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[M("copy",e.copyAll,d,k.jsx(Ix,{size:18}),m),M("save",e.saveTsv,()=>f(!1),k.jsx(QM,{size:18}),!0),k.jsx(Mx,{buttonHook:{[cs]:"save-menu"},menuHook:{"data-aqmd-spreadsheet-menu":""},label:e.saveMenu,icon:k.jsx(VM,{size:18}),tabIndex:S("save-menu"),items:[{key:"save-with-bom",label:e.saveTsvWithBom,onSelect:()=>f(!0),hook:{"data-aqmd-spreadsheet-menu-item":"save-with-bom"}}]})]}),M("fullscreen",u?e.exitFullscreen:e.fullscreen,g,u?k.jsx(l5,{size:18}):k.jsx(a5,{size:18}),!0)]}),D&&k.jsx(N5,{id:E,labels:e,activeCell:y,onTrackSize:x,onClose:()=>{_(!1),B.current?.focus()}})]})},D5=Object.freeze({decreaseColumnWidth:k.jsx(t5,{size:18}),increaseColumnWidth:k.jsx(u5,{size:18}),autoFitColumnWidth:k.jsx(GM,{size:18}),decreaseRowHeight:k.jsx(r5,{size:18}),increaseRowHeight:k.jsx(g5,{size:18})}),N5=({id:e,labels:t,activeCell:r,onTrackSize:i,onClose:o})=>{const s=L.useSyncExternalStore(r.subscribe,r.get,r.get),a={column:oe.columnIndexToName(s.col),row:s.row+1},n=l=>{l.key!=="Escape"||l.defaultPrevented||(l.preventDefault(),l.stopPropagation(),o())};return k.jsx("div",{id:e,"data-aqmd-spreadsheet-track-size":"",role:"group","aria-label":t.trackSize.text,lang:t.trackSize.lang,onKeyDown:n,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:O5.map(l=>k.jsx("button",{type:"button","data-aqmd-spreadsheet-track-size-control":l,onClick:()=>i(l),className:Vr,"aria-label":It.fillLabel(t[l].text,a),lang:t[l].lang,children:D5[l]},l))})},q5=(e,t,r)=>{const i={v:1,rows:e.length,cols:e[0]?.length??0,clipId:r,formats:[],validations:[],cells:e.map(s=>s.map(a=>({t:a}))),wholeRows:!1,wholeCols:!1,conditionalFormats:[]},o=t.serializeClipPayload(i);return{plain:t.serializeClipboardTsv(e),html:t.serializeHtmlTable(i,o)}},z5=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"})})])},j5="\uFEFF",W5="text/tab-separated-values;charset=utf-8",H5=(e,t)=>`${t?j5:""}${sa.serializeTsv(e)}`,Y5=(e,t,r)=>{const i=r.defaultView;if(i===null)throw new Error("[@aiquants/markdown] saving a file needs a document with a window");const o=i.URL.createObjectURL(new Blob([e],{type:W5})),s=r.createElement("a");s.href=o,s.download=t,s.hidden=!0,r.body.append(s);try{s.click()}finally{s.remove(),i.setTimeout(()=>i.URL.revokeObjectURL(o),0)}},Dx=e=>{const t=L.useRef(e);L.useLayoutEffect(()=>{t.current=e});const r=e!==void 0,[i]=L.useState(()=>new Set);return L.useEffect(()=>e?.subscribe(()=>{for(const o of[...i])o()}),[e,i]),L.useMemo(()=>{if(!r)return;const o=()=>{const s=t.current;if(s===void 0)throw new Error("[@aiquants/markdown] the spreadsheet editor stand-in was called after its editor was removed");return s};return{write:s=>o().write(s),read:s=>o().read(s),undo:()=>o().undo(),redo:()=>o().redo(),subscribe:s=>(i.add(s),()=>{i.delete(s)})}},[r,i])};let Ts=null,xn=null;const El=new Set,U5=e=>(El.add(e),()=>{El.delete(e)}),Yd=()=>Ts!==null?Promise.resolve(Ts):(xn??=import("@aiquants/spreadsheet").then(e=>{Ts=e;for(const t of El)t();return e},e=>{throw xn=null,e}),xn);class ai extends Error{reason;constructor(t){super(`[@aiquants/markdown] spreadsheet edit refused: ${t}`),this.name="SpreadsheetEditRefusal",this.reason=t}}const Ud=e=>{console.error("[@aiquants/markdown] could not load @aiquants/spreadsheet",e)},Gd=Object.freeze({row:!0,column:!0,intersection:!1}),Xd=Object.freeze({row:!1,column:!1,intersection:!1}),Vd=Object.freeze([Object.freeze([""])]),G5=Object.freeze({link:!1}),X5=229,Kd=e=>e.trim().replace(/^(["'])(.*)\1$/,"$2").toLowerCase(),V5=(e,t)=>{const r=new Set(t.split(",").map(Kd));return e.fontfaces.some(i=>r.has(Kd(i.family)))},K5=({matrix:e,headerRows:t,footerRows:r,visibleRows:i,headings:o,autofit:s})=>{const a=Math.min(e[0].length,x5),n=C5(e,i,r),l=Array.from({length:a},(h,d)=>d),c=h=>o?k.jsx("td",{"aria-hidden":"true","data-aqmd-spreadsheet-static-number":"",children:h+1}):null;return k.jsxs("table",{"data-aqmd-spreadsheet-static":"","data-aqmd-spreadsheet-static-autofit":s?"":void 0,children:[s&&k.jsxs("colgroup",{children:[o&&k.jsx("col",{"data-aqmd-spreadsheet-static-band":""}),l.map(h=>k.jsx("col",{"data-aqmd-spreadsheet-static-empty":n.every(({cells:d})=>d[h]==="")?"":void 0},h))]}),k.jsxs("thead",{children:[o&&k.jsxs("tr",{"aria-hidden":"true","data-aqmd-spreadsheet-static-letters":"",children:[k.jsx("td",{}),l.map(h=>k.jsx("td",{children:oe.columnIndexToName(h)},h))]}),n.filter(({index:h})=>h<t).map(({index:h,cells:d})=>k.jsxs("tr",{children:[c(h),d.slice(0,a).map((f,u)=>k.jsx("th",{scope:"col",children:f},u))]},h))]}),k.jsx("tbody",{children:n.filter(({index:h})=>h>=t).map(({index:h,cells:d})=>k.jsxs("tr",{children:[c(h),d.slice(0,a).map((f,u)=>k.jsx("td",{children:f},u))]},h))})]})},Z5=e=>{try{return{options:It.parseSpreadsheetOptions(e),unreadWord:null}}catch(t){if(t instanceof It.SpreadsheetOptionsError)return{options:null,unreadWord:t.word};throw t}},Nx=({tsv:e,meta:t,sourceLines:r,editor:i,locale:o="en",labels:s,layout:a="inline"})=>{if(!Object.hasOwn(It.SPREADSHEET_BLOCK_LABEL_CATALOGS,o))throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet locale "${String(o)}" (en and ja are supported)`);if(a!=="inline"&&a!=="fill")throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet layout "${String(a)}" (inline and fill are supported)`);const n=L.useMemo(()=>Oi(It.SPREADSHEET_BLOCK_LABEL_CATALOGS[o],s),[o,s]),{options:l,unreadWord:c}=L.useMemo(()=>Z5(t),[t]),h=L.useMemo(()=>mn(e),[e]),d=h>oe.SPREADSHEET_MAX_OPERATION_CELLS,f=L.useMemo(()=>Mi.parseSourceLines(r)?.first??null,[r]),[u,g]=L.useState(null),m=`${r??""}
315
- ${e}`,y=u===m,x=i!==void 0&&f!==null&&!y?i:void 0,C=x!==void 0,w=C&&l!==null&&l.footerRows===0?p5:0,S=C?m5:0,[v,_]=L.useState(()=>d?Vd:hs(e)),[E,B]=L.useState(0),D=L.useRef(e),M=L.useRef([]),P=L.useMemo(()=>T5(v,w,S),[v,w,S]),U=L.useRef(P);U.current=P;const N=L.useSyncExternalStore(U5,()=>Ts,()=>null),[q,A]=L.useState(!1),$=q&&N===null,O=l===null?null:l.zoomPercent,[F,R]=L.useState(()=>O===null?1:Hd(O)),[z,T]=L.useState(O);O!==z&&(T(O),O!==null&&R(Hd(O)));const W=l!==null&&l.toolbar===0?Xd:Gd,[j,G]=L.useState(W),[X,K]=L.useState(W);W!==X&&(K(W),G(W));const[Z,at]=L.useState(!1),[mt,ht]=L.useState(null),ct=L.useRef(null),_t=L.useId(),Ct=L.useCallback((Q,pt={})=>{ht($t=>({text:It.fillLabel(n[Q].text,pt),lang:n[Q].lang,serial:($t?.serial??0)+1}))},[n]);L.useEffect(()=>{if(N!==null||l===null||d)return;let Q=!0;return Yd().catch(pt=>{Q&&(Ud(pt),A(!0))}),()=>{Q=!1}},[N,l,d]),L.useEffect(()=>{const Q=E5(M.current,e);if(Q.echo){M.current=Q.pending;return}const pt=x===void 0||f===null?null:x.read(f),$t=pt!==null&&mn(pt)<=oe.SPREADSHEET_MAX_OPERATION_CELLS?pt:null;if($t!==null&&$t===M.current.at(-1))return;M.current=[];const re=$t===null?e:$t;re!==D.current&&(D.current=re,_($t===null&&d?Vd:hs(re)),B(Lr=>Lr+1))},[e,d,x,f]);const Et=L.useCallback(()=>{if(x===void 0||f===null)return;const Q=x.read(f);Q===null||Q===D.current||mn(Q)>oe.SPREADSHEET_MAX_OPERATION_CELLS||(M.current=[],D.current=Q,_(hs(Q)),B(pt=>pt+1))},[x,f]);L.useEffect(()=>x?.subscribe(()=>{M.current.length>0&&Et()}),[x,Et]);const Nt=L.useCallback(Q=>{Q(),Et()},[Et]),Gt=L.useMemo(()=>x===void 0?void 0:()=>Nt(()=>x.undo()),[x,Nt]),te=L.useMemo(()=>x===void 0?void 0:()=>Nt(()=>x.redo()),[x,Nt]),xe=L.useRef(()=>{});xe.current=Q=>{if(x===void 0||f===null)throw new ai("readOnly");const pt=B5(U.current,Q);if(pt.kind==="format-only")throw new ai("formatRefused");if(pt.kind==="unchanged")return;const $t=Uh(pt.matrix),re=L5($t),Lr=x.write({fenceLine:f,expected:D.current,text:re});switch(Lr){case"written":{const ur=x.read(f);if(ur===null)throw new TypeError("[@aiquants/markdown] SpreadsheetEditor.write answered written, but read finds no block on its fence line");D.current=ur,M.current=[...M.current,ur],_(ur===re?$t:hs(ur)),B(ii=>ii+1),ht(null);return}case"changed":throw Et(),new ai("editConflict");case"closesFence":throw new ai("fenceRefused");case"unwritable":throw g(m),new ai("unwritable");default:throw new TypeError(`[@aiquants/markdown] SpreadsheetEditor.write answered ${JSON.stringify(Lr)} (written, changed, closesFence or unwritable)`)}};const[_e]=L.useState(()=>({get rowCount(){return U.current.length},get colCount(){return U.current[0].length},getCellText:(Q,pt)=>U.current[Q][pt],applyEdits:(Q,pt)=>xe.current(Q),getCellFormat:()=>y5,getCellHyperlink:(Q,pt)=>M5(U.current[Q][pt]),findDataEdge:(Q,pt)=>F5(($t,re)=>U.current[$t][re],U.current.length,U.current[0].length,Q,pt)})),Ft=L.useCallback(Q=>{if(!(Q instanceof ai))throw Q;Ct(Q.reason)},[Ct]),wt=L.useCallback(Q=>Ct(y?"unwritable":"readOnly"),[Ct,y]),Be=L.useCallback(Q=>{ct.current?.ownerDocument.defaultView?.open(Q,"_blank","noopener,noreferrer")},[]),Qr=L.useCallback(({row:Q,displayText:pt,columnName:$t,readOnly:re})=>It.fillLabel((re===!0?n.readOnlyCellAnnouncement:n.cellAnnouncement).text,{cell:`${$t}${Q+1}`,value:pt===""?n.emptyCell.text:pt}),[n]),hr=L.useCallback(({range:Q})=>It.fillLabel(n.selectionAnnouncement.text,{range:$5(Q,oe.columnIndexToName)}),[n]),vr=L.useCallback(({axis:Q,index:pt,size:$t})=>Q==="column"?It.fillLabel(n.columnResized.text,{column:oe.columnIndexToName(pt),size:$t}):It.fillLabel(n.rowResized.text,{row:pt+1,size:$t}),[n]),De=L.useRef(null),[Le]=L.useState(R5),Tr=L.useCallback(Q=>Le.set(Q.active),[Le]),Jr=L.useCallback(Q=>{De.current?.executeCommand(Q)},[]),Ce=oa(F),Ze=L.useRef(Ce);L.useLayoutEffect(()=>{z!==null&&(Ze.current=z)},[z]),L.useEffect(()=>{Ze.current!==Ce&&(Ze.current=Ce,Ct("zoomed",{percent:Ce}))},[Ct,Ce]);const cr=L.useCallback(Q=>R(pt=>oe.clampSpreadsheetZoom(oe.stepSpreadsheetZoom(pt,Q))),[]),ti=L.useCallback(()=>R(1),[]),_r=j.row||j.column,J=L.useCallback(()=>G(Q=>Q.row||Q.column?Xd:Gd),[]),ft=L.useCallback(()=>{if(N===null)return;const Q=ct.current?.ownerDocument.defaultView;(async()=>{if(Q==null)throw new Error("no window");const $t=q5(v,N,Q.crypto.randomUUID());await z5($t,Q.navigator.clipboard,re=>new Q.ClipboardItem(re))})().then(()=>Ct("copied"),$t=>{console.error("[@aiquants/markdown] could not copy the spreadsheet",$t),Ct("copyFailed")})},[Ct,v,N]),xt=L.useCallback(Q=>{const pt=ct.current?.ownerDocument;pt!==void 0&&Y5(H5(v,Q),n.fileName.text,pt)},[v,n]),Pt=L.useRef(!1);L.useEffect(()=>{Pt.current&&(Pt.current=!1,ct.current?.querySelector('[data-aqmd-spreadsheet-control="fullscreen"]')?.focus())},[Z]);const At=L.useCallback(Q=>{const pt=ct.current;pt!==null&&(pt.close(),Q?pt.showModal():pt.show(),Pt.current=!0,at(Q))},[]),Zi=L.useCallback(()=>At(!Z),[Z,At]),ei=L.useCallback(Q=>{!Z||Q.key!=="Escape"||Q.defaultPrevented||Q.nativeEvent.isComposing||Q.keyCode===X5||(Q.preventDefault(),Q.stopPropagation(),At(!1))},[Z,At]),Pa=L.useCallback(Q=>{Q.preventDefault(),At(!1)},[At]),Da=v.length,Mt=v[0].length,Bt=l===null?0:b5(l,P.length),le=P.length,Ht=l!==null&&a==="inline"&&v5(l.visibleRows,le),[ee,Ne]=L.useState(null),ri=L.useMemo(()=>{if(l===null)return;const Q=l.headings===1,pt={"--aqmd-spreadsheet-zoom":String(F)};return a==="fill"?pt["--aqmd-spreadsheet-box-min-height"]=`${yn(w5(le),F,Q)}px`:Ht?pt["--aqmd-spreadsheet-box-height"]=`${Wd(ee===null?yn(le,F,Q):ee.height)}px`:pt["--aqmd-spreadsheet-box-height"]=`${yn(Bt,F,Q)}px`,ee!==null&&(pt["--aqmd-spreadsheet-box-width"]=`${Wd(ee.width)}px`),pt},[l,a,Ht,le,Bt,F,ee]),dr=Z?n.fullscreenDialog:n.table,Br=N?.Spreadsheet;return L.useLayoutEffect(()=>{const Q=De.current,pt=ct.current;if(l===null||l.autofit!==1||N===null||Q===null||pt===null)return;const $t=Array.from({length:P[0].length},(ur,ii)=>ii);Q.autoFitColumns($t);const re=pt.ownerDocument.fonts;if(re===void 0)return;const Lr=ur=>{const ii=De.current;ii!==null&&V5(ur,getComputedStyle(pt).fontFamily)&&ii.autoFitColumns($t)};return re.addEventListener("loadingdone",Lr),()=>re.removeEventListener("loadingdone",Lr)},[l,N,P]),k.jsxs("div",{"data-aqmd-spreadsheet":"","data-aqmd-spreadsheet-layout":a,"data-source-lines":r,"data-aqmd-spreadsheet-editable":C?"":void 0,"data-aqmd-spreadsheet-fullscreen":Z?"":void 0,"data-aqmd-spreadsheet-whole":Ht?"":void 0,children:[k.jsx("span",{id:_t,hidden:!0,lang:dr.lang,children:dr.text}),k.jsxs("dialog",{ref:ct,open:!0,"data-aqmd-spreadsheet-dialog":"",role:Z?void 0:"group","aria-labelledby":_t,onKeyDown:ei,onCancel:Pa,children:[l===null?k.jsx("div",{"data-aqmd-spreadsheet-error":"options",role:"alert",lang:n.optionsError.lang,children:It.fillLabel(n.optionsError.text,{word:c,frozenMax:It.SPREADSHEET_OPTION_RULES.header.max,heightMax:It.SPREADSHEET_OPTION_RULES.height.max,zoomSteps:It.SPREADSHEET_ZOOM_STEP_PERCENTS.join(", ")})}):d?k.jsx("div",{"data-aqmd-spreadsheet-error":"size",role:"alert",lang:n.tooLarge.lang,children:It.fillLabel(n.tooLarge.text,{cells:new Intl.NumberFormat(o).format(h),max:new Intl.NumberFormat(o).format(oe.SPREADSHEET_MAX_OPERATION_CELLS)})}):k.jsxs(k.Fragment,{children:[l.toolbar===1&&k.jsx(P5,{labels:n,labelledBy:_t,rows:Da,cols:Mt,canZoomIn:F<oe.SPREADSHEET_ZOOM_MAX,canZoomOut:F>oe.SPREADSHEET_ZOOM_MIN,zoom:F,onZoom:cr,onResetZoom:ti,highlighted:_r,onToggleHighlight:J,onCopy:ft,onSave:xt,fullscreen:Z,onToggleFullscreen:Zi,gridReady:Br!==void 0,activeCell:Le,onTrackSize:Jr}),k.jsx("div",{"data-aqmd-spreadsheet-box":"",style:ri,children:Br===void 0?k.jsx(K5,{matrix:v,headerRows:l.headerRows,footerRows:l.footerRows,visibleRows:Bt,headings:l.headings===1,autofit:l.autofit===1}):k.jsx(Br,{ref:De,adapter:_e,dataVersion:E,defaultRowHeight:Px,frozenRows:l.headerRows,headerRows:l.headerRows,frozenTrailingRows:l.footerRows,frozenColumns:l.frozenColumns,enableFillHandle:C,readOnly:!C,labelledBy:_t,enableResizeUI:!0,headings:l.headings===1,onContentSizeChange:Ne,zoom:F,onZoomChange:R,highlight:j,onHighlightChange:G,popovers:G5,onHyperlinkOpen:Be,onEditRejected:Ft,onReadOnlyRejected:wt,onUndoRequest:Gt,onRedoRequest:te,formatCellAnnouncement:Qr,formatSelectionAnnouncement:hr,formatResizeAnnouncement:vr,onSelectionChange:Tr,locale:o})})]}),$&&k.jsxs("div",{"data-aqmd-spreadsheet-error":"load",role:"alert",children:[k.jsx("span",{lang:n.loadFailed.lang,children:n.loadFailed.text}),k.jsx("button",{type:"button","data-aqmd-spreadsheet-retry":"",lang:n.retry.lang,className:"ms-2 inline-flex min-h-11 min-w-11 items-center justify-center rounded border px-3 py-1 text-sm",onClick:()=>{A(!1),Yd().catch(Q=>{Ud(Q),A(!0)})},children:n.retry.text})]}),k.jsx("p",{"data-aqmd-spreadsheet-notice":"",role:"status",children:mt!==null&&k.jsx("span",{lang:mt.lang,children:mt.text},mt.serial)})]})]})};Nx.displayName="SpreadsheetBlock";const Gh=L.memo(Nx),Q5=Object.freeze({light:"solarized-light",dark:"github-dark-high-contrast"}),J5=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 t3(e){const t={};for(const r in e){const i=e[r];switch(r){case"class":t.className=i;break;case"style":{const o={};for(const s of i.split(";")){const a=s.indexOf(":");if(a<=0)continue;const n=s.slice(0,a).trim(),l=s.slice(a+1).trim();n===""||l===""||(o[n.startsWith("--")?n:n.replace(/-(\w)/g,(c,h)=>h.toUpperCase())]=l)}t.style=o;break}case"tabindex":t.tabIndex=Number(i);break;default:t[r]=i}}return t}const e3=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};return k.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"})},r3=({htmlPromise:e,filename:t,code:r,sourceLines:i})=>{const o=L.use(e),s={replace:a=>{if(a instanceof St.Element&&a.name==="pre"){const n=t3(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"},k.jsxs("div",{className:"relative",style:{margin:l},"data-aqmd-code-block":"","data-source-lines":i,children:[t&&k.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}),k.jsx(e3,{code:r}),k.jsx("pre",{...n,children:St.domToReact(a.children,s)})]})}},htmlparser2:{lowerCaseTags:!0}};return k.jsx(k.Fragment,{children:St(o,s)})},i3=/^(diff)?:?(\w+):?([\w.-]*)?/,o3=new Map([["svg","xml"]]),s3="text",a3=e=>{const t=o3.get(e),r=t===void 0?e:t;return Sn.isSpecialLang(r)||Object.hasOwn(Sn.bundledLanguages,r)?r:s3},n3=()=>({code(e){for(const t of e.children){if(t.type!=="element")continue;const r=t.children[0];if(r?.type!=="element")continue;const i=r.children[0];if(i?.type!=="text")continue;const o=i.value;let s,a,n="";if(o.startsWith("+")?(s="+",a="add",n="bg-green-200 dark:bg-green-400/90 text-green-700"):o.startsWith("-")&&(s="-",a="remove",n="bg-red-200 dark:bg-red-400/90 text-red-700"),s&&a){t.properties.dataAqmdDiff=a,i.value=o.substring(1).trimStart();const l={type:"element",tagName:"span",properties:{className:`inline-flex items-center justify-center w-4 h-4 rounded-full select-none font-bold text-[0.5rem] mr-2 ${n}`},children:[{type:"text",value:s==="+"?"➕":"➖"}]};t.children.unshift(l)}}}}),l3=e=>{const t=i3.exec(e??"");return{isDiff:t?.[1]==="diff",lang:t?.[2]||"text",filename:t?.[3]||void 0}},Xh=({lang:e,code:t,node:r,sourceLines:i})=>{const o=e??r?.lang??void 0,s=t??r?.value??"",{isDiff:a,lang:n,filename:l}=l3(o);return n===It.SPREADSHEETS_LANGUAGE?k.jsx(Gh,{tsv:s,meta:r?.meta??void 0,sourceLines:i}):n==="mermaid"?k.jsx(Yh,{chartContent:s,sourceLines:i}):k.jsx(h3,{code:s,lang:n,isDiff:a,filename:l,sourceLines:i})},h3=({code:e,lang:t,isDiff:r,filename:i,sourceLines:o})=>{const s=L.useMemo(async()=>{const a=[];return r&&a.push(n3()),await Sn.codeToHtml(e,{lang:a3(t),themes:Q5,defaultColor:!1,colorReplacements:J5,transformers:a})},[e,t,r]);return k.jsx(L.Suspense,{fallback:k.jsx("div",{className:"dark:text-white","data-source-lines":o,children:"🌀 Loading code..."}),children:k.jsx(r3,{htmlPromise:s,filename:i,code:e,sourceLines:o})})},qx=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};return k.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"})},zx=(e,t)=>{const r=L.useMemo(()=>{try{return{kind:"rendered",html:Rx(e,t).html}}catch(i){return{kind:"failed",error:i,message:`Math rendering error: ${i instanceof Error?i.message:String(i)}`}}},[e,t]);return L.useEffect(()=>{r.kind==="failed"&&console.error("An error occurred while rendering KaTeX:",r.error)},[r]),r},c3=({node:e})=>{const t=zx(e.value,!0),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return k.jsxs("div",{className:"relative",children:[k.jsx(qx,{code:e.value}),t.kind==="rendered"?k.jsx("article",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):k.jsx("article",{className:r,children:t.message})]})},d3=/^[a-z][a-z0-9+.-]*:/i,u3=/^[/\\]{2}/,f3=/[\t\n\r]/g,Zd=32,g3=e=>{let t=0,r=e.length;for(;t<r&&e.charCodeAt(t)<=Zd;)t+=1;for(;r>t&&e.charCodeAt(r-1)<=Zd;)r-=1;return e.slice(t,r)},jx=e=>{const t=g3(e).replace(f3,"");return d3.test(t)||u3.test(t)},p3="text-link underline visited:text-link-visited",m3="inline-block w-fit",Vh=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"]);[...Vh].join(",");const Wx=(e,t)=>[e,t?m3:void 0,p3].filter(r=>r!==void 0&&r.trim()!=="").join(" "),y3=new Set(["id","title","lang","dir","role"]),x3=["aria-","data-footnote-"],C3=e=>{const t={};for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();(y3.has(o)||x3.some(s=>o.startsWith(s)&&o.length>s.length))&&(t[o]=i)}return Object.freeze(t)},ke=new wn.Logger(wn.LogLevel.INFO,"[DifyIFramePlugin]"),b3="100%",k3="600px",w3="0",S3=e=>typeof e!="object"||e===null||!("type"in e)?null:typeof e.type=="string"?e.type:null,v3=({embed:e,iFrameAllowedDomains:t})=>{const[r,i]=L.useState(!0),[o,s]=L.useState(!1),a=L.useRef(null),n=L.useRef(null),l=L.useRef(null),{src:c}=e,h=L.useCallback(x=>{x.source===null||x.source!==a.current?.contentWindow||!Lb(x.origin,t)||S3(x.data)==="dify-chatbot-iframe-ready"&&(ke.info("Dify chatbot iframe is ready"),i(C=>C&&(s(!1),n.current&&(clearTimeout(n.current),n.current=null),l.current&&(clearTimeout(l.current),l.current=null),!1)))},[t]),d=L.useCallback(()=>{const x=a.current;if(x)try{if(!x.contentDocument)throw new Error("Cannot access iframe content");i(w=>w&&(s(!1),!1))}catch{ke.info("Crossorigin error detected, showing auth prompt"),s(w=>w||(i(!1),!0))}},[]),f=L.useCallback(()=>{const x=window.open(c,"dify-oauth","width=500,height=600,scrollbars=yes,resizable=yes");if(!x){ke.error("ポップアップがブロックされました");return}const C=setInterval(()=>{if(x.closed){clearInterval(C),ke.info("ポップアップが閉じられました");try{ke.info("ポップアップURL:",x.location.href)}catch(S){ke.info("クロスオリジンのためURLにアクセスできません:",S)}const w=a.current;if(w?.src){const S=w.src;i(v=>v||!0),s(v=>v&&!1),w.src="",setTimeout(()=>{w.src=S,n.current=setTimeout(()=>{ke.warn("認証後タイムアウト: dify-chatbot-iframe-ready not received after auth"),d()},5e3)},100)}}},1e3);ke.info("ポップアップを開きました:"),ke.info("- 初期URL:",c),ke.info("- ウィンドウ名:","dify-oauth"),ke.info("- ウィンドウサイズ: 500x600")},[d,c]);L.useEffect(()=>(window.addEventListener("message",h),()=>{window.removeEventListener("message",h)}),[h]),L.useEffect(()=>{const x=setTimeout(()=>{ke.warn("Timeout: dify-chatbot-iframe-ready not received, checking iframe access"),d()},5e3);return l.current=x,()=>{l.current&&(clearTimeout(l.current),l.current=null)}},[d]),L.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);const{width:u=b3,height:g=k3,frameborder:m=w3,...y}=e.attributes;return k.jsxs("div",{className:"dify-iframe-container",children:[r&&!o&&k.jsxs("div",{className:"flex items-center justify-center rounded-lg bg-gray-50 p-8",children:[k.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-blue-600 border-b-2"}),k.jsx("span",{className:"ml-3 text-gray-600",children:"Dify チャットボットを読み込み中..."})]}),o&&k.jsxs("div",{className:"mb-4 rounded-lg border border-blue-200 bg-blue-50 p-6",children:[k.jsx("div",{className:"flex items-center",children:k.jsxs("div",{className:"text-blue-800",children:[k.jsx("h3",{className:"font-medium",children:"認証が必要です"}),k.jsx("p",{className:"mt-1 text-sm",children:"Dify チャットボットにアクセスするには OAuth 認証が必要です。 ポップアップウィンドウで認証を完了してください。"})]})}),k.jsx("div",{className:"mt-4",children:k.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 認証を開始"})})]}),k.jsx("div",{className:`${r||o?"hidden":"block"}`,children:k.jsx("iframe",{ref:a,...St.attributesToProps({...y,width:u,height:g,frameborder:m},"iframe"),src:c,"data-plugin-type":"dify"})})]})},Qd=Object.freeze({dify:v3}),T3=e=>Object.hasOwn(Qd,e)?Qd[e]:null,_3=k.jsx(L.Fragment,{}),B3=(e,t,r,i,o)=>{const s=t===null?null:T3(t),a=e.attributes.title===void 0?{title:`${i.text}: ${new URL(e.src).hostname}`,lang:i.lang}:{};return k.jsx(ub,{embed:e,label:i,insideAnchor:o,children:s!==null?k.jsx(s,{embed:e,iFrameAllowedDomains:r}):k.jsx("iframe",{...St.attributesToProps(e.attributes,"iframe"),...a,src:e.src})})},Hx=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof St.Element&&t.name.toLowerCase()==="a")return!0;return!1},Yx=e=>e.some(t=>t instanceof St.Element&&(Vh.has(t.name)||Yx(t.children))),L3=(e,t,r)=>{const{class:i,"data-link-kind":o,"data-doc-path":s,"data-doc-exists":a,...n}=e.attribs,l=Wx(i,Yx(e.children)),c=n.href??"",h=o,d=h==="external"||jx(c),f=St.domToReact(e.children,t);if(r&&c&&!d)return k.jsx(r,{href:c,kind:h,docPath:s,docExists:a===void 0?void 0:a==="true",className:l,attributes:C3(n),children:f});d&&(n.target="_blank",n.rel="noreferrer");const u={};return o!==void 0&&(u["data-link-kind"]=o),s!==void 0&&(u["data-doc-path"]=s),a!==void 0&&(u["data-doc-exists"]=a),k.jsx("a",{...St.attributesToProps(n,"a"),className:l,...u,children:f})},Ux=({iFrameAllowedDomains:e,embedLabels:t,linkComponent:r,renderPlaceholder:i,renderKept:o})=>{const s={replace:a=>{if(!(a instanceof St.Element))return;const n=a.parent instanceof St.Element?a.parent.name:null,l=la(a.name,a.attribs,{parentName:n,iFrameAllowedDomains:e});switch(l.action){case"remove":return _3;case"unwrap":return k.jsx(L.Fragment,{children:St.domToReact(a.children,s)});case"embed":return B3(l.embed,l.pluginType,e,t.embeddedFrame,Hx(a))}if(a.attribs={...l.attributes},l.action==="placeholder"){const h=i?.(a,l.link,s);if(h!==void 0)return h}const c=o?.(a,s);if(c!==void 0)return c;if(a.name==="a")return L3(a,s,r)}};return s};const E3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],F3=Tt("code-xml",E3),A3=4096*4096,Jd=32767,tu=e=>Number.isFinite(e.width)&&Number.isFinite(e.height)&&e.width>0&&e.height>0,M3=(e,t)=>{const r=tu(e)?e:tu(t)?t:null;if(r===null)return null;const i=Math.min(1,Math.sqrt(A3/(r.width*r.height)),Jd/r.width,Jd/r.height);return{width:Math.max(1,Math.floor(r.width*i)),height:Math.max(1,Math.floor(r.height*i))}},$3=async(e,t,r)=>{const i=r.URL.createObjectURL(new r.Blob([e],{type:"image/svg+xml;charset=utf-8"}));try{const o=new r.Image;o.src=i,await o.decode();const s=M3({width:o.naturalWidth,height:o.naturalHeight},t);if(s===null)throw new Error("[@aiquants/markdown] the SVG image has no size to draw at");const a=r.document.createElement("canvas");a.width=s.width,a.height=s.height;const n=a.getContext("2d");if(n===null)throw new Error("[@aiquants/markdown] the browser gave no 2D canvas to draw the SVG image on");return n.drawImage(o,0,0,s.width,s.height),await new Promise((l,c)=>{a.toBlob(h=>h===null?c(new Error("[@aiquants/markdown] the canvas could not encode the SVG image as a PNG")):l(h),"image/png")})}finally{r.URL.revokeObjectURL(i)}},O3=e=>/\.[Ss][Vv][Gg]$/u.test(e),Gx=e=>{const t=L.useRef(e);L.useLayoutEffect(()=>{t.current=e});const r=e!==void 0;return L.useMemo(()=>{if(r)return{read:(i,o)=>{const s=t.current;return s===void 0?Promise.reject(new Error("[@aiquants/markdown] the image source stand-in was called after its reader was removed")):s.read(i,o)}}},[r])},Cn="data-aqmd-svg-image-control",R3=Object.freeze(["copy","source"]),I3=Object.freeze(["source"]),P3=Object.freeze({kind:"failure",retryable:!0}),eu=(e,t,r)=>new Promise(i=>i(e.read(t,r))),D3=({paragraph:e,image:t,path:r,name:i,reader:o,labels:s})=>{const{[Mi.SOURCE_LINES_ATTRIBUTE]:a,...n}=e,[l,c]=L.useState(!1),[h,d]=L.useState(0),[f,u]=L.useState(null),[g,m]=L.useState(null),y=L.useId(),x=L.useId(),C=L.useRef(null),w=L.useRef(null),S=L.useRef(null);L.useEffect(()=>()=>w.current?.abort(),[]),L.useEffect(()=>{if(!l)return;const O=new AbortController;return eu(o,r,O.signal).then(F=>{O.signal.aborted||u({read:h,answer:F})},F=>{O.signal.aborted||(console.error("[@aiquants/markdown] the image source reader failed without an abort",F),u({read:h,answer:P3}))}),()=>O.abort()},[l,h,r,o]);const v=l&&f!==null&&f.read===h?f.answer:null,_=v!==null&&v.kind==="text"&&!v.truncated?v.text:null,E=!l||_!==null,{onKeyDown:B,onFocus:D,tabIndexOf:M}=Hh(E?R3:I3,Cn),P=O=>{m(F=>({text:s[O].text,lang:s[O].lang,serial:F===null?1:F.serial+1}))},U=()=>{if(m(null),l){c(!1);return}d(O=>O+1),c(!0)},N=()=>{C.current?.focus(),d(O=>O+1)},q=(O,F)=>{const R=O.currentTarget.ownerDocument.defaultView?.navigator.clipboard;if(R===void 0){P("copyFailed");return}R.writeText(F).then(()=>P("copied"),z=>{console.error("[@aiquants/markdown] could not copy the image source",z),P("copyFailed")})},A=O=>{const F=O.currentTarget.ownerDocument.defaultView,R=F?.navigator.clipboard;if(F===null||R===void 0||typeof F.ClipboardItem!="function"||typeof R.write!="function"){P("copyImageFailed");return}const z=S.current,T=z===null?null:z.querySelector("img"),W=T===null?null:T.getBoundingClientRect(),j=W===null?{width:0,height:0}:{width:W.width,height:W.height};w.current?.abort();const G=new AbortController;w.current=G;let X=!1;const K=eu(o,r,G.signal).then(Z=>{if(Z.kind!=="text"||Z.truncated)throw X=!0,new Error("[@aiquants/markdown] the SVG image cannot be copied whole");return $3(Z.text,j,F).catch(at=>{throw X=!0,console.error("[@aiquants/markdown] could not draw the SVG image as a PNG",at),at})},Z=>{throw X=!0,G.signal.aborted||console.error("[@aiquants/markdown] the image source reader failed without an abort",Z),Z});K.catch(()=>{}),R.write([new F.ClipboardItem({"image/png":K})]).then(()=>{G.signal.aborted||P("copiedImage")},Z=>{G.signal.aborted||(X||console.error("[@aiquants/markdown] could not copy the SVG image",Z),P("copyImageFailed"))})};let $;return l?v===null?$=k.jsx("p",{"data-aqmd-svg-image-loading":"",lang:s.loading.lang,children:s.loading.text}):v.kind==="failure"?$=k.jsxs("div",{"data-aqmd-svg-image-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[k.jsx("p",{lang:s.failed.lang,children:s.failed.text}),v.retryable&&k.jsxs("button",{type:"button","data-aqmd-svg-image-retry":"",onClick:N,lang:s.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[k.jsx(Tn,{className:"h-4 w-4"}),s.retry.text]})]}):$=k.jsxs(k.Fragment,{children:[k.jsx("span",{id:x,hidden:!0,lang:s.sourceRegion.lang,children:It.fillLabel(s.sourceRegion.text,{name:i})}),k.jsx("pre",{"data-aqmd-svg-image-source":"",tabIndex:0,role:"region","aria-labelledby":x,children:k.jsx("code",{children:v.text})}),v.truncated&&k.jsx("p",{"data-aqmd-svg-image-truncated":"",lang:s.truncated.lang,children:s.truncated.text})]}):$=k.jsx("p",{ref:S,...St.attributesToProps(n,"p"),children:t}),k.jsxs("div",{"data-aqmd-svg-image":"","data-aqmd-svg-image-view":l?"source":"image","data-source-lines":a,children:[k.jsx("span",{id:y,hidden:!0,lang:s.toolbar.lang,children:s.toolbar.text}),k.jsxs("div",{"data-aqmd-svg-image-toolbar":"",role:"toolbar","aria-labelledby":y,onKeyDown:B,onFocus:D,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:[E&&k.jsx("button",{type:"button",[Cn]:"copy",tabIndex:M("copy"),onClick:O=>_===null?A(O):q(O,_),className:Vr,"aria-label":_===null?s.copyImage.text:s.copy.text,lang:_===null?s.copyImage.lang:s.copy.lang,children:k.jsx(Ix,{size:18})}),k.jsx("button",{ref:C,type:"button",[Cn]:"source",tabIndex:M("source"),"aria-pressed":l,onClick:U,className:Vr,"aria-label":s.source.text,lang:s.source.lang,children:k.jsx(F3,{size:20})})]}),$,k.jsx("p",{"data-aqmd-svg-image-notice":"",role:"status",children:g!==null&&k.jsx("span",{lang:g.lang,children:g.text},g.serial)})]})},Ia=Object.freeze({toolbar:{text:"SVG image",lang:"en"},source:{text:"Source",lang:"en"},sourceRegion:{text:"Source of {name}",lang:"en"},loading:{text:"Loading the source…",lang:"en"},failed:{text:"The source could not be read.",lang:"en"},retry:{text:"Try again",lang:"en"},truncated:{text:"Only the beginning of this file is shown.",lang:"en"},copy:{text:"Copy the source",lang:"en"},copied:{text:"Copied the source.",lang:"en"},copyFailed:{text:"Could not copy the source.",lang:"en"},copyImage:{text:"Copy the image",lang:"en"},copiedImage:{text:"Copied the image.",lang:"en"},copyImageFailed:{text:"Could not copy the image.",lang:"en"}}),N3=aa(Ia),q3=({alt:e,target:t,label:r})=>k.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:[k.jsx(ZC,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),k.jsxs("span",{className:"min-w-0",children:[k.jsx("span",{className:"font-medium",children:e?`${r} (${e})`:r}),t&&k.jsx("span",{className:"ml-2 break-all font-mono text-xs dark:text-gray-300",children:t})]})]}),z3=(e,t,r)=>{const{src:i,alt:o,"data-asset-exists":s,"data-asset-src":a}=e.attribs;if(!i||i.trim()===""||s==="false")return k.jsx(q3,{alt:o,target:a,label:t});const n=r.rendered===0;return r.rendered+=1,k.jsx("img",{alt:"",...St.attributesToProps({loading:n?"eager":"lazy",decoding:"async",...e.attribs})})},No=e=>e.map(t=>t instanceof St.Text?t.data:t instanceof St.Element?No(t.children):"").join(""),j3=(e,t)=>e.map(r=>{if(r instanceof St.Text)return{kind:"text",text:r.data};if(!(r instanceof St.Element))return{kind:"ignored"};if(r.name.toLowerCase()!=="a")return{kind:"element"};const i=la(r.name,r.attribs,{parentName:"p",iFrameAllowedDomains:t});return{kind:"link",href:i.action==="keep"?i.attributes.href??null:null}}),W3=(e,t,r,i)=>{const o=e.children,s=mr.placeholderLinkOf(t,j3(o,i.iFrameAllowedDomains));if(s===null)return;const a=St.domToReact(o,r),n=k.jsx("p",{...St.attributesToProps(e.attribs,"p"),children:a}),l=o.find(f=>f instanceof St.Element),c=i.embeds.linkCardEndpoint,h=c!==null&&l!==void 0&&mr.isBareLink(No(l.children),s)?k.jsx(yb,{href:t,endpoint:c,size:We.linkCardSizeOf(i.embeds),fallback:n}):n,d=jr.resolveEmbed(s,i.embeds.providers);return d===null?h:k.jsx(_b,{resolution:d,caption:a,fallback:h,theme:i.theme,labels:i.embedLabels})},H3=(e,t)=>{if(Hx(e))return null;const r=e.children.filter(c=>!(c instanceof St.Text&&Fl.test(c.data))),[i]=r;if(r.length!==1||!(i instanceof St.Element)||i.name.toLowerCase()!=="img")return null;const o=la(i.name,i.attribs,{parentName:"p",iFrameAllowedDomains:t});if(o.action!=="keep")return null;const{src:s,alt:a,"data-asset-src":n,"data-asset-exists":l}=o.attributes;return n===void 0||!O3(n)||s===void 0||s.trim()===""||l==="false"?null:{node:i,path:n,name:a!==void 0&&a.trim()!==""?a:n.slice(n.lastIndexOf("/")+1)}},Y3={lowerCaseAttributeNames:!1},ru=2166136261,iu=16777619,Fl=/^[\t\n\f\r ]*$/u,U3=`language-${It.SPREADSHEETS_LANGUAGE}`,Xx=e=>e.name==="code"&&(e.attribs.class??"").split(/[\t\n\f\r ]+/u).includes(U3),G3=e=>{let t=ru,r=ru;const i=(s,a)=>{for(let n=0;n<s.length;n+=1){const l=s.charCodeAt(n);r=Math.imul(r^l,iu),a&&(t=Math.imul(t^l,iu))}},o=(s,a)=>{if(s instanceof St.Text)i("",a),i(s.data,a);else if(s instanceof St.Element){i("",a),i(s.name,a);for(const[l,c]of Object.entries(s.attribs))l!==Mi.SOURCE_LINES_ATTRIBUTE&&(i("",a),i(l,a),i("",a),i(c,a));i("",a);const n=a&&!Xx(s);for(const l of s.children)o(l,n);i("",a)}else i("\x07",a),i(s.data,a)};return o(e,!0),{fingerprint:(t>>>0).toString(36),content:(r>>>0).toString(36)}},X3=(e,t,r,i)=>{if(e==="")return{nodes:[],keys:[]};const o=St.htmlToDOM(e,Y3),s=o.filter(l=>!(l instanceof St.Text&&Fl.test(l.data))),a=rb(s.map(G3),r);let n=0;return{nodes:o.map(l=>{if(l instanceof St.Text&&Fl.test(l.data))return l.data;const{key:c,content:h}=a[n];return n+=1,k.jsx(QC,{content:h,label:i,text:()=>No([l]),children:St.domToReact([l],t)},c)}),keys:a}},Vx=({htmlContent:e,theme:t="light",iFrameAllowedDomains:r=[],embeds:i=We.NO_EMBEDS,embedLabels:o,mermaidInteraction:s,mermaidLabels:a,spreadsheetEditor:n,spreadsheetLocale:l,spreadsheetLabels:c,linkComponent:h,missingImageLabel:d="Image not found",blockFailedLabel:f,imageSource:u,svgImageLabels:g,onMathDiagnostics:m})=>{mu(i);const y=cu(o),x=Dx(n),C=Gx(u),w=L.useMemo(()=>Oi(Ia,g),[g]),{blockFailed:S}=Oi(gu,{blockFailed:f}),v={rendered:0},_=[],E=L.useRef(null),B=L.useEffectEvent(N=>{m?.(N)}),D=Ux({iFrameAllowedDomains:r,embedLabels:y,linkComponent:h,renderPlaceholder:(N,q,A)=>W3(N,q,A,{embeds:i,theme:t,embedLabels:y,iFrameAllowedDomains:r}),renderKept:(N,q)=>{if(N.name==="p"&&C!==void 0){const A=H3(N,r);if(A!==null)return k.jsx(D3,{paragraph:N.attribs,image:St.domToReact([A.node],q),path:A.path,name:A.name,reader:C,labels:w})}if(N.name==="pre"&&N.children.length===1){const A=N.children[0];if(A instanceof St.Element&&A.name==="code"){const $=A.attribs.class??"",O=No(A.children),F=N.attribs[Mi.SOURCE_LINES_ATTRIBUTE];return Xx(A)?k.jsx(Gh,{tsv:O,meta:A.attribs[It.CODE_META_ATTRIBUTE],sourceLines:F,editor:x,locale:l,labels:c}):$.includes("language-mermaid")?k.jsx(Yh,{chartContent:O,interaction:s,labels:a,sourceLines:F}):k.jsx(Xh,{lang:$.replace("language-",""),code:O,theme:t,sourceLines:F})}}if(N.name==="img")return z3(N,d,v);if(N.name==="span"&&N.attribs.class?.includes("math")){const A=N.attribs.class.includes("display");let $=No(N.children).trim();A?$=$.replace(/^\\\[/,"").replace(/\\\]$/,""):$=$.replace(/^\\\(/,"").replace(/\\\)$/,"");try{const{html:O,diagnostics:F}=Rx($,A);return _.push(...F),A?k.jsxs("span",{className:"group relative block",children:[k.jsx(qx,{code:$}),k.jsx("span",{dangerouslySetInnerHTML:{__html:O}})]}):k.jsx("span",{dangerouslySetInnerHTML:{__html:O}})}catch(O){console.error("Failed to render math:",O);return}}}}),M=L.useRef([]),{nodes:P,keys:U}=X3(e,D,M.current,S);return L.useEffect(()=>{M.current=U},[U]),L.useEffect(()=>{E.current!==e&&(E.current=e,_.length>0&&B(_))},[e,_]),k.jsx("div",{className:"markdown-body","data-theme":t,children:P})};const V3=[["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"}]],K3=Tt("triangle-alert",V3);const Z3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],Q3=Tt("text-align-center",Z3);const J3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],t$=Tt("text-align-start",J3);const e$=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],r$=Tt("text-align-end",e$);const i$=[["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"}]],o$=Tt("list",i$);const s$=[["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"}]],a$=Tt("palette",s$);const n$=[["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"}]],l$=Tt("pin",n$);const h$=[["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"}]],c$=Tt("pin-off",h$),d$=e=>`#${e.id}`,u$=e=>{let t=Number.POSITIVE_INFINITY;for(const r of e)r.depth<t&&(t=r.depth);return t},ou="block truncate py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Kx=({headings:e,className:t="",onHeadingSelect:r,headingHref:i=d$,label:o,labelledBy:s})=>{if(e.length===0)return null;const a=u$(e);return k.jsx("nav",{className:`toc ${t}`,"aria-label":o,"aria-labelledby":s,children:k.jsx("ul",{className:"m-0 list-none p-0",children:e.map((n,l)=>{const c=n.id===""?null:i(n);return k.jsx("li",{style:{paddingLeft:`${(n.depth-a)*1}rem`},children:c===null?k.jsx("span",{className:`${ou} text-gray-600 dark:text-gray-300`,title:n.text,children:n.text}):k.jsx("a",{href:qo(c)?c:void 0,className:`${ou} 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)})})})},bn="--aqmd-toolbar-block-overlap",f$=({toolbar:e,content:t,scrollportTop:r,scrollportBottom:i})=>{if(e.width<=0||e.height<=0)return 0;const o=e.left<t.right&&e.right>t.left,s=e.top<r+e.height&&e.top<i,a=e.bottom-r;return o&&s&&a>0?Math.ceil(a):0},Zx=e=>`mermaid${e.charAt(0).toUpperCase()}${e.slice(1)}`,Qx=Object.keys(Ra),g$=e=>`spreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`,p$=Object.keys(It.SPREADSHEET_BLOCK_LABEL_CATALOGS.en),Jx=e=>`svgImage${e.charAt(0).toUpperCase()}${e.slice(1)}`,tC=Object.keys(Ia),eC=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"},...gu,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(Qx.map(e=>[Zx(e),Ra[e]])),...Object.fromEntries(tC.map(e=>[Jx(e),Ia[e]])),...na}),m$=aa(eC),y$=e=>Oi(eC,e),x$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of Qx){const i=e[Zx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},C$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of p$){const i=e[g$(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},b$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of tC){const i=e[Jx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},k$=Object.keys(na),w$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of k$){const i=e[r];i!==void 0&&(t[r]=i)}return Object.freeze(t)},su=Object.freeze({left:{labelKey:"alignLeft",Icon:t$},center:{labelKey:"alignCenter",Icon:Q3},right:{labelKey:"alignRight",Icon:r$}}),S$=Object.freeze({text:"ファイルを選択してください。",lang:"ja"}),v$="100%",T$=e=>e==="center"?"auto":e==="right"?"auto 0":"0 auto",Al="24px",rC=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"}),_$=rC(Al),B$=Object.freeze({position:"absolute",insetBlockStart:0,insetInlineStart:0,blockSize:"var(--aqmd-toolbar-inset-block-start, 0px)",inlineSize:"var(--aqmd-toolbar-inset-inline-end, 0px)",visibility:"hidden",pointerEvents:"none"}),L$=e=>`calc(100cqi - var(--aqmd-toolbar-inset-inline-end, 0px) - ${e})`,E$=8,au=800,F$=16,A$=(e,t)=>{const r=e.defaultView;let i;const o=()=>{e.removeEventListener("click",s,!0),e.removeEventListener("pointercancel",a,!0),i!==void 0&&r?.clearTimeout(i)};function s(n){o(),!(n.timeStamp-t.timeStamp>au||Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY)>F$)&&(n.preventDefault(),n.stopPropagation())}function a(n){n.pointerId===t.pointerId&&o()}e.addEventListener("click",s,!0),e.addEventListener("pointercancel",a,!0),i=r?.setTimeout(o,au)},M$=(e,t,r)=>{const[i,o]=L.useState(null);return L.useLayoutEffect(()=>{const s=t.current;if(!e||s===null||r===null){o(null);return}const a=s.ownerDocument.defaultView;let n=0;const l=()=>{n=0;const d=s.getBoundingClientRect(),f=s.offsetHeight>0?d.height/s.offsetHeight:1,u=a?.visualViewport??null,g=u===null?Number.POSITIVE_INFINITY:u.offsetTop+u.height,m=Math.min(r.getBoundingClientRect().bottom,g);o(Math.max(0,Math.floor((m-d.top)/f-E$)))},c=()=>{a!==null&&n===0&&(n=a.requestAnimationFrame(l))};l();const h=new ResizeObserver(c);return h.observe(r),a?.addEventListener("resize",c),a?.visualViewport?.addEventListener("resize",c),a?.visualViewport?.addEventListener("scroll",c),s.ownerDocument.addEventListener("scroll",c,!0),()=>{a!==null&&n!==0&&a.cancelAnimationFrame(n),h.disconnect(),a?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("scroll",c),s.ownerDocument.removeEventListener("scroll",c,!0)}},[e,t,r]),i};function kn({menu:e,Icon:t,buttonLabel:r,titleLabel:i,titleId:o,pinLabel:s,unpinLabel:a,isOpen:n,isPinned:l,isFront:c,onActivate:h,onToggle:d,onClose:f,onPinToggle:u,popoverClassName:g,scrollBarClearance:m,boundary:y,renderBody:x}){const C=L.useRef(null),w=L.useRef(null),S=L.useRef(null),v=M$(n,S,y),_=L.useCallback(()=>{d(),h()},[h,d]),E=L.useCallback(()=>{if(l)return;const D=C.current?.contains(document.activeElement)===!0;f(),D&&w.current?.focus()},[l,f]);L.useEffect(()=>{if(!n||l)return;const D=C.current;if(D===null)return;const M=U=>{D.contains(U.target)||(f(),U.pointerType==="touch"&&!(U.target instanceof Element&&U.target.closest("[data-aqmd-toolbar]")!==null)&&A$(D.ownerDocument,U))},P=U=>{U.key!=="Escape"||U.defaultPrevented||U.isComposing||(U.preventDefault(),f(),w.current?.focus())};return document.addEventListener("pointerdown",M),D.addEventListener("keydown",P),()=>{document.removeEventListener("pointerdown",M),D.removeEventListener("keydown",P)}},[n,l,f]);const B=l?a:s;return k.jsxs("div",{ref:C,"data-aqmd-toolbar-menu":e,children:[k.jsx("button",{ref:w,type:"button",className:"pointer-events-auto rounded-full border border-gray-200 bg-white p-3 shadow-lg transition-colors hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700",onClick:_,"aria-label":r.text,lang:r.lang,"aria-expanded":n,children:k.jsx(t,{className:"h-5 w-5 text-gray-600 dark:text-gray-300"})}),n&&k.jsxs("div",{ref:S,"data-aqmd-toolbar-popover":e,className:`pointer-events-auto absolute end-0 top-full mt-2 box-border overflow-y-auto overscroll-contain rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-700 dark:bg-gray-800 ${g}`,style:{zIndex:c?2:1,maxInlineSize:L$(m),maxBlockSize:v??void 0},children:[k.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[k.jsx("h3",{id:o,lang:i.lang,className:"px-2 font-bold text-gray-600 text-sm uppercase tracking-wider dark:text-gray-300",children:i.text}),k.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":B.text,lang:B.lang,children:l?k.jsx(l$,{className:"h-4 w-4"}):k.jsx(c$,{className:"h-4 w-4"})})]}),x(E)]})]})}const $$=(e,t,r,i)=>{const[o,s]=L.useState(0),a=L.useRef(null);return L.useLayoutEffect(()=>{const n=e.current,l=t.current;if(r===null||n===null||l===null){a.current=null,s(0);return}const c=()=>{const g=n.getBoundingClientRect();s(f$({toolbar:r.getBoundingClientRect(),content:l.getBoundingClientRect(),scrollportTop:g.top+n.clientTop,scrollportBottom:g.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]),L.useLayoutEffect(()=>{a.current?.()},[i]),o},O$=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,R$=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},I$=L.memo(function({parseResult:t,theme:r,styleClassName:i,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:f,spreadsheetLabels:u,imageSource:g,svgImageLabels:m,onMathDiagnostics:y}){return k.jsx("div",{className:"w-full min-w-0",children:k.jsx("div",{className:i,"data-theme":r,children:k.jsx(Vx,{htmlContent:t.htmlContent,theme:r,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:f,spreadsheetLabels:u,imageSource:g,svgImageLabels:m,onMathDiagnostics:y})})})});function iC(){const[e,t]=L.useState("toc"),[r,i]=L.useState(!1),[o,s]=L.useState(!1),[a,n]=L.useState(!1),[l,c]=L.useState(!1),[h,d]=L.useState(!1),[f,u]=L.useState(!1),g=L.useCallback(()=>t("toc"),[]),m=L.useCallback(()=>i(M=>!M),[]),y=L.useCallback(()=>i(!1),[]),x=L.useCallback(()=>c(M=>!M),[]),C=L.useCallback(()=>t("style"),[]),w=L.useCallback(()=>s(M=>!M),[]),S=L.useCallback(()=>s(!1),[]),v=L.useCallback(()=>d(M=>!M),[]),_=L.useCallback(()=>t("align"),[]),E=L.useCallback(()=>n(M=>!M),[]),B=L.useCallback(()=>n(!1),[]),D=L.useCallback(()=>u(M=>!M),[]);return{lastActiveMenu:e,isTocOpen:r,isStyleOpen:o,isAlignOpen:a,isTocPinned:l,isStylePinned:h,isAlignPinned:f,activateToc:g,toggleToc:m,closeToc:y,togglePinToc:x,activateStyle:C,toggleStyle:w,closeStyle:S,togglePinStyle:v,activateAlign:_,toggleAlign:E,closeAlign:B,togglePinAlign:D}}const P$=({error:e,labels:t})=>{if(L.isValidElement(e))return k.jsx("div",{className:"p-4",children:e});if(typeof e=="object"&&e!==null&&"message"in e){const i=e,o=i.title!==void 0&&i.title!=="";return k.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:k.jsxs("div",{className:"flex items-start gap-3",children:[k.jsx("div",{className:"rounded-lg bg-red-100 p-2 text-red-600 dark:bg-red-900/50 dark:text-red-400",children:k.jsx(K3,{className:"h-5 w-5"})}),k.jsxs("div",{className:"min-w-0 flex-1",children:[k.jsxs("div",{className:"flex items-center justify-between gap-2",children:[k.jsx("h3",{lang:o?void 0:t.defaultErrorTitle.lang,className:"font-semibold text-base text-red-900 dark:text-red-200",children:o?i.title:t.defaultErrorTitle.text}),i.status&&k.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})]}),k.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 k.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:k.jsxs("p",{className:"font-medium text-red-700 text-sm dark:text-red-300",children:[k.jsx("span",{lang:t.errorPrefix.lang,children:t.errorPrefix.text}),r]})})};function D$({parseResult:e,content:t,error:r=null,isLoading:i=!1,labels:o,theme:s,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:g,maxWidth:m,padding:y=16,iFrameAllowedDomains:x,embeds:C=We.NO_EMBEDS,emptyMessage:w,toolbar:S,linkComponent:v,onHeadingSelect:_,headingHref:E,onMathDiagnostics:B,spreadsheetEditor:D,spreadsheetLocale:M,imageSource:P,renderScrollBar:U}){const N=L.useRef(null),[q,A]=L.useState(null),$=L.useCallback(Mt=>{N.current=Mt,A(Mt)},[]),[O,F]=L.useState(0),R=L.useRef(null),[z,T]=L.useState(null),W=L.useRef(null),j=L.useId(),G=iC(),X=S??G,K=L.useMemo(()=>y$(o),[o]),Z=L.useMemo(()=>x$(o),[o]),at=L.useMemo(()=>C$(o),[o]),mt=L.useMemo(()=>b$(o),[o]),ht=Gx(P),ct=Dx(D);mu(C);const _t=jr.EMBED_PROVIDER_IDS.filter(Mt=>C.providers.includes(Mt)).join(" "),Ct=C.linkCardEndpoint,Et=C.linkCardSize,Nt=L.useMemo(()=>{const Mt=_t.split(" "),Bt=Object.freeze(jr.EMBED_PROVIDER_IDS.filter(le=>Mt.includes(le)));return Object.freeze(Et===void 0?{providers:Bt,linkCardEndpoint:Ct}:{providers:Bt,linkCardEndpoint:Ct,linkCardSize:Et})},[_t,Ct,Et]),Gt=o?.embeddedVideo,te=o?.embeddedPost,xe=o?.embeddedFrame,_e=L.useMemo(()=>w$({embeddedVideo:Gt,embeddedPost:te,embeddedFrame:xe}),[Gt,te,xe]),Ft=L.useRef(B);L.useLayoutEffect(()=>{Ft.current=B},[B]);const wt=L.useCallback(Mt=>{Ft.current?.(Mt)},[]),Be=w===void 0?S$:{text:w,lang:void 0},Qr=$$(N,R,z,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 hr=Number.isFinite(y)&&y>=0?y:16,vr=L.useCallback(Mt=>{const Bt=N.current;if(Bt){const le=Bt.querySelector("[data-theme]"),Ht=Bt.getBoundingClientRect(),ee=le?.children;let Ne=-1,ri=Number.POSITIVE_INFINITY;if(ee)for(let dr=0;dr<ee.length;dr+=1){const Br=ee[dr],Q=Math.abs(Br.getBoundingClientRect().top-Ht.top);Q<ri&&(ri=Q,Ne=dr)}if(ee&&Ne>=0){const Br=ee[Ne].getBoundingClientRect();W.current={childIndex:Ne,offset:Br.top-Ht.top}}else W.current=null}n(Mt)},[n]);L.useLayoutEffect(()=>{const Mt=W.current;if(!Mt)return;W.current=null;const Bt=N.current;if(!Bt)return;const Ht=Bt.querySelector("[data-theme]")?.children[Mt.childIndex];if(!Ht)return;const ee=Bt.getBoundingClientRect(),ri=Ht.getBoundingClientRect().top-ee.top;Bt.scrollTop+=ri-Mt.offset});const{isTocPinned:De,closeToc:Le}=X,Tr=L.useCallback((Mt,Bt)=>{if(De||Le(),_?.(Mt,Bt)===!0)return;Bt.preventDefault();const Ht=N.current?.querySelector(`#${CSS.escape(Mt.id)}`)??document.getElementById(Mt.id);Ht&&(R$(Ht),Ht.tabIndex<0&&!Ht.hasAttribute("tabindex")&&Ht.setAttribute("tabindex","-1"),Ht.scrollIntoView({behavior:O$()?"instant":"smooth",block:"start"}),Ht.focus({preventScroll:!0}))},[Le,De,_]),Jr=L.useMemo(()=>l.find(Bt=>Bt.name===a)?.className??"markdown-body",[l,a]),Ce=e?.headings??[],Ze=!(i||r),cr=Ze&&e!==null,ti=Ze&&e===null&&t!==null,_r=cr&&d&&Ce.length>0,J=cr&&f,xt=(cr||ti)&&u&&typeof h=="function"&&(g!==void 0||m!==void 0),Pt=L.useMemo(()=>k.jsx(Kx,{headings:Ce,className:"text-sm",labelledBy:j,onHeadingSelect:Tr,headingHref:E}),[Ce,j,Tr,E]),At=U===void 0?Al:`${O}px`,Zi=L.useMemo(()=>At===Al?_$:rC(At),[At]),ei=_r||J||xt?k.jsxs("div",{ref:T,"data-aqmd-toolbar":!0,style:Zi,children:[k.jsx("span",{"data-aqmd-toolbar-inset-probe":!0,"aria-hidden":"true",style:B$}),xt&&h&&k.jsx(kn,{menu:"align",Icon:su[c].Icon,buttonLabel:K.selectAlignAria,titleLabel:K.alignTitle,pinLabel:K.pinAlignAria,unpinLabel:K.unpinAlignAria,isOpen:X.isAlignOpen,isPinned:X.isAlignPinned,isFront:X.lastActiveMenu==="align",onActivate:X.activateAlign,onToggle:X.toggleAlign,onClose:X.closeAlign,onPinToggle:X.togglePinAlign,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:q,renderBody:Mt=>k.jsx("div",{className:"space-y-1",children:Qi.CONTENT_ALIGNS.map(Bt=>{const{labelKey:le,Icon:Ht}=su[Bt],ee=K[le],Ne=c===Bt;return k.jsxs("button",{type:"button","aria-pressed":Ne,lang:ee.lang,className:`flex min-h-11 w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors ${Ne?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{h(Bt),Mt()},children:[k.jsx(Ht,{className:"h-4 w-4"}),ee.text]},Bt)})})}),J&&k.jsx(kn,{menu:"style",Icon:a$,buttonLabel:K.selectStyleAria,titleLabel:K.styleTitle,pinLabel:K.pinStyleAria,unpinLabel:K.unpinStyleAria,isOpen:X.isStyleOpen,isPinned:X.isStylePinned,isFront:X.lastActiveMenu==="style",onActivate:X.activateStyle,onToggle:X.toggleStyle,onClose:X.closeStyle,onPinToggle:X.togglePinStyle,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:q,renderBody:Mt=>k.jsx("div",{className:"space-y-1",children:l.map(Bt=>{const le=a===Bt.name;return k.jsx("button",{type:"button","aria-pressed":le,className:`min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${le?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{vr(Bt.name),Mt()},children:Bt.name},Bt.name)})})}),_r&&k.jsx(kn,{menu:"toc",Icon:o$,buttonLabel:K.openTocAria,titleLabel:K.tocTitle,titleId:j,pinLabel:K.pinTocAria,unpinLabel:K.unpinTocAria,isOpen:X.isTocOpen,isPinned:X.isTocPinned,isFront:X.lastActiveMenu==="toc",onActivate:X.activateToc,onToggle:X.toggleToc,onClose:X.closeToc,onPinToggle:X.togglePinToc,popoverClassName:"markdown-viewer-scrollbar-thin w-64 p-4",scrollBarClearance:At,boundary:q,renderBody:()=>Pt})]}):null,Pa=()=>i?k.jsxs("p",{children:[k.jsx("span",{"aria-hidden":"true",children:"🌀"})," ",k.jsx("span",{lang:K.loading.lang,children:K.loading.text})]}):r?k.jsx(P$,{error:r,labels:K}):e?k.jsx("div",{className:"relative w-full min-w-0",children:k.jsx(I$,{parseResult:e,theme:s,styleClassName:Jr,iFrameAllowedDomains:x,embeds:Nt,embedLabels:_e,linkComponent:v,missingImageLabel:K.missingImage.text,blockFailedLabel:o?.blockFailed,mermaidLabels:Z,spreadsheetEditor:ct,spreadsheetLocale:M,spreadsheetLabels:at,imageSource:ht,svgImageLabels:mt,onMathDiagnostics:wt})}):t!==null?k.jsx("pre",{className:"whitespace-pre-wrap break-all",children:t}):k.jsx("p",{lang:Be.lang,children:Be.text}),Da={containerType:"inline-size",paddingInline:`${hr}px`,paddingBlockEnd:`${hr}px`,paddingBlockStart:`calc(${hr}px + var(${bn}))`,scrollPaddingBlockStart:`var(${bn})`,[bn]:`${Qr}px`};return k.jsxs(uu,{scrollerRef:$,scrollerProps:{"data-testid":"viewer","data-aqmd-scroll-container":!0,className:"grid h-full w-full overflow-x-auto overflow-y-auto *:min-w-0",style:Da},renderScrollBar:U,onBarInlineSizeChange:F,children:[ei,k.jsx("div",{ref:R,"data-aqmd-content":!0,style:{width:g??v$,maxWidth:m,marginInline:T$(c)},children:Pa()})]})}const oC=({node:e})=>k.jsx("del",{children:k.jsx(Wt,{nodes:e.children})}),sC=({node:e})=>k.jsx("em",{children:k.jsx(Wt,{nodes:e.children})}),aC=({node:e})=>k.jsx("sup",{children:k.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,"]"]})}),N$=({nodes:e,theme:t="light"})=>e.length===0?null:k.jsx("section",{className:"border-[#171717] border-t pt-4 dark:border-[#464646]",children:k.jsx("ol",{className:"pl-6 text-[#686868] text-sm dark:text-[#a4a5a9]",children:e.map((r,i)=>k.jsx("li",{id:`fn-${r.identifier}`,className:i===0?"":"mt-4",children:k.jsx(Wt,{nodes:r.children,theme:t})},`mdast-node-fn-${r.identifier}-${i}`))})}),nC=({node:e})=>k.jsx("a",{href:e.url,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",children:"↩"}),q$=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,(o,s)=>{const a=Number(s);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/&#x([0-9a-f]+);/gi,(o,s)=>{const a=Number.parseInt(s,16);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/\s+/g," ").trim(),lC=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"?q$(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()},z$=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"}},hC=({node:e})=>{const t=new FC,r=`h${e.depth}`,i=e.data?.hProperties?.id,o=t.slug(lC(e.children));return k.jsx(r,{id:i||o,className:z$(e.depth),children:k.jsx(Wt,{nodes:e.children})})},j$=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==!1).map(([t,r])=>[t,r===!0?"":String(r)])),W$=({node:e,theme:t,iFrameAllowedDomains:r=[]})=>{const i=k.jsx(Wt,{nodes:e.children,theme:t,iFrameAllowedDomains:r}),o=la(e.data.tagName,j$(e.data.properties),{parentName:null,iFrameAllowedDomains:r});if(o.action==="unwrap")return i;if(o.action!=="keep"&&o.action!=="placeholder")return null;const s=e.data.tagName.toLowerCase();return k.jsx(s,{...St.attributesToProps(o.attributes,e.data.tagName.toLowerCase()),children:i})},H$=/^\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,Y$=({node:e,iFrameAllowedDomains:t=[]})=>{const r=St(e.value,Ux({iFrameAllowedDomains:t,embedLabels:$C}));return Array.isArray(r)&&r.length===0?null:H$.test(e.value)?k.jsx("div",{children:r}):k.jsx("span",{children:r})},cC=({node:e})=>{if(!e.url||e.url.trim()===""||!qo(e.url))return null;const t=e.title??"",r=e.data?.hProperties?.width,i=e.data?.hProperties?.height;return k.jsxs("span",{style:{width:r,height:i},className:"mt-4 mb-4 inline-block w-fit max-w-full",children:[k.jsx("img",{src:e.url,alt:e.alt??"",className:"mx-auto h-full w-full",width:r,height:i}),t&&k.jsx("em",{className:"block text-center text-gray-400 text-xs",children:t})]})},dC=({node:e})=>k.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}),U$=({node:e})=>{const t=zx(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"?k.jsx("span",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):k.jsx("span",{className:r,children:t.message})},G$=new RegExp(`<(?:${[...Vh].join("|")})(?=[\\s/>])`,"i"),uC=e=>e.some(t=>t.type==="image"||t.type==="imageReference"||t.type==="html"&&typeof t.value=="string"&&G$.test(t.value)||t.children!==void 0&&uC(t.children)),fC=({node:e})=>{const t=qo(e.url)?e.url:void 0,r=t!==void 0&&jx(t);return k.jsx("a",{className:Wx(void 0,uC(e.children)),href:t,target:r?"_blank":void 0,rel:r?"noreferrer":void 0,children:k.jsx(Wt,{nodes:e.children})})},gC=({node:e})=>e.children.length===1&&e.children[0].type==="paragraph"?k.jsx("li",{children:k.jsx(Wt,{nodes:e.children[0].children})}):k.jsx("li",{children:k.jsx(Wt,{nodes:e.children})}),pC=({node:e})=>{const t=e.ordered?"ol":"ul";return k.jsx(t,{children:k.jsx(Wt,{nodes:e.children})})},X$=({node:e})=>k.jsx("mark",{children:k.jsx(Wt,{nodes:e.children})}),mC=({node:e})=>k.jsx("p",{children:k.jsx(Wt,{nodes:e.children})}),yC=({node:e})=>k.jsx("strong",{children:k.jsx(Wt,{nodes:e.children})}),V$=({node:e})=>k.jsx("sub",{children:k.jsx(Wt,{nodes:e.children})}),K$=({node:e})=>k.jsx("sup",{children:k.jsx(Wt,{nodes:e.children})}),nu=e=>{const t=e.data?.hProperties;return{merged:t?.merged??!1,colSpan:t?.colSpan,rowSpan:t?.rowSpan,textAlign:t?.textAlign}},xC=({node:e})=>{const[t,...r]=e.children;return k.jsx("div",{className:"overflow-x-auto",children:k.jsxs("table",{className:"w-full border-collapse border-none",children:[k.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:k.jsx("tr",{children:t.children.map((i,o)=>{const{merged:s,colSpan:a,rowSpan:n,textAlign:l}=nu(i);return s?null:k.jsx("th",{colSpan:a,rowSpan:n,style:{textAlign:l??e.align?.[o]??void 0},className:"border border-gray-300 px-4 py-2 text-left font-semibold dark:border-gray-600 dark:text-gray-200",children:k.jsx(Wt,{nodes:i.children})},`mdast-table-node-${e.type}-${o}`)})})}),k.jsx("tbody",{children:r.map((i,o)=>k.jsx("tr",{className:"border-gray-200 border-t bg-white dark:border-gray-700 dark:bg-gray-900",children:i.children.map((s,a)=>{const{merged:n,colSpan:l,rowSpan:c,textAlign:h}=nu(s);return n?null:k.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:k.jsx(Wt,{nodes:s.children})},`mdast-table-node-${e.type}-${a}`)})},`mdast-table-node-${e.type}-${o}`))})]})})},CC=({node:e})=>k.jsx(k.Fragment,{children:e.value}),bC=()=>k.jsx("hr",{className:"border-gray-300 dark:border-gray-600"}),kC=({node:e})=>{const t=e.data?.title||"";return k.jsxs("details",{className:"markdown-details",children:[k.jsx("summary",{children:t}),k.jsx("div",{className:"markdown-details-content",children:k.jsx(Wt,{nodes:e.children})})]})},wC=({node:e})=>{const r=["message",e.data?.messageType||"message"].filter(Boolean).join(" ");return k.jsxs("aside",{className:r,children:[k.jsx("span",{className:"message-symbol",style:{userSelect:"none"},children:"!"}),k.jsx("div",{className:"message-content",children:k.jsx(Wt,{nodes:e.children})})]})},Wt=({nodes:e,theme:t="light",iFrameAllowedDomains:r=[]})=>e.map((i,o)=>{switch(i.type){case"blockquote":return k.jsx(SC,{node:i},`mdast-node-${i.type}-${o}`);case"break":return k.jsx("br",{},`mdast-node-${i.type}-${o}`);case"code":return k.jsx(Xh,{node:i,theme:t},`mdast-node-${i.type}-${o}`);case"delete":return k.jsx(oC,{node:i},`mdast-node-${i.type}-${o}`);case"details":return k.jsx(kC,{node:i},`mdast-node-${i.type}-${o}`);case"emphasis":return k.jsx(sC,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteReference":return k.jsx(aC,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteDefinition":return null;case"footnote-back-link":return k.jsx(nC,{node:i},`mdast-node-${i.type}-${o}`);case"heading":return k.jsx(hC,{node:i},`mdast-node-${i.type}-${o}`);case"html":return k.jsx(Y$,{node:i,iFrameAllowedDomains:r},`mdast-node-${i.type}-${o}`);case"html-block-container":{const s=i,a=`mdast-node-${s.type}-${s.position?.start?.offset??"na"}-${s.position?.end?.offset??"na"}`;return k.jsx(W$,{node:s,theme:t,iFrameAllowedDomains:r},a)}case"image":return k.jsx(cC,{node:i},`mdast-node-${i.type}-${o}`);case"inlineCode":return k.jsx(dC,{node:i},`mdast-node-${i.type}-${o}`);case"inlineMath":return k.jsx(U$,{node:i},`mdast-node-${i.type}-${o}`);case"link":return k.jsx(fC,{node:i},`mdast-node-${i.type}-${o}`);case"listItem":return k.jsx(gC,{node:i},`mdast-node-${i.type}-${o}`);case"list":return k.jsx(pC,{node:i},`mdast-node-${i.type}-${o}`);case"mark":return k.jsx(X$,{node:i},`mdast-node-${i.type}-${o}`);case"math":return k.jsx(c3,{node:i},`mdast-node-${i.type}-${o}`);case"message":return k.jsx(wC,{node:i},`mdast-node-${i.type}-${o}`);case"paragraph":return k.jsx(mC,{node:i},`mdast-node-${i.type}-${o}`);case"strong":return k.jsx(yC,{node:i},`mdast-node-${i.type}-${o}`);case"subscript":return k.jsx(V$,{node:i},`mdast-node-${i.type}-${o}`);case"superscript":return k.jsx(K$,{node:i},`mdast-node-${i.type}-${o}`);case"table":return k.jsx(xC,{node:i},`mdast-node-${i.type}-${o}`);case"text":return k.jsx(CC,{node:i},`mdast-node-${i.type}-${o}`);case"thematicBreak":return k.jsx(bC,{},`mdast-node-${i.type}-${o}`);case"yaml":return null;default:{if(process.env.NODE_ENV==="development")return k.jsxs("div",{children:[k.jsxs("p",{style:{color:"red"},children:["Unknown node type: ",i.type]}),k.jsx("pre",{children:JSON.stringify(i,null,2)})]},`mdast-node-${i.type}-${o}`);throw new Error(`Unknown node type: ${i.type}`)}}}),SC=({node:e})=>k.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:k.jsx(Wt,{nodes:e.children})}),Z$=/\s*\{#(.+?)\}\s*$/,Q$=()=>e=>{me.visit(e,"heading",t=>{if(t.children.length===0)return;const r=t.children[t.children.length-1];if(r?.type!=="text")return;const i=r,o=i.value.match(Z$);if(o){const s=o[1];t.data||(t.data={});const a=t.data,n=a.hProperties||{};n.id=s,a.hProperties=n,i.value=i.value.substring(0,o.index).trimEnd(),i.value===""&&t.children.pop()}})},J$=()=>e=>{me.visit(e,"footnoteDefinition",t=>{me.visit(t,"paragraph",r=>{r.children.push({type:"footnote-back-link",url:`#fnref-${t.identifier}`})})})},tO=()=>e=>{me.visit(e,"html",(t,r,i)=>{if(typeof r!="number"||!i)return;const s=t.value.trim().match(/^<a\s+href="([^"]+)"[^>]*>(.*?)<\/a>$/i);if(s){const[,a,n]=s,l={type:"link",url:a,children:[{type:"text",value:n}]};i.children.splice(r,1,l)}})},eO=()=>e=>{const t=r=>{const i=r.children;if(!i)return;let o=0;for(;o<i.length;){const s=i[o];if(s.type==="html"&&s.value.startsWith("<")&&!s.value.startsWith("</")&&s.value.match(/<([a-zA-Z0-9]+)/)){let n="",l=0;const c=[];let h=!1;for(let d=o;d<i.length;d++){const f=i[d];if(f.type==="html"){n+=f.value;const u=f.value.match(/<\/?([a-zA-Z0-9]+)/g)||[];for(const g of u){const m=g.match(/<\/?([a-zA-Z0-9]+)/);if(!m)continue;const y=m[1];g.startsWith("</")?c.length>0&&c[c.length-1]===y&&c.pop():g.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(o,l,{type:"html",value:n})}o++}};me.visit(e,"paragraph",t),me.visit(e,"tableCell",t),me.visit(e,"heading",t),me.visit(e,"emphasis",t),me.visit(e,"strong",t),me.visit(e,"delete",t)},lu=/\s*=\s*(\d+)(w|h|x|y)\s*/g,rO=()=>e=>{me.visit(e,"image",t=>{const r=l=>{if(!l)return{updatedText:l,matches:[]};const c=[...l.matchAll(lu)];return{updatedText:l.replaceAll(lu,"").trim(),matches:c}},{updatedText:i,matches:o}=r(t.alt);t.alt=i;const{updatedText:s,matches:a}=r(t.title);t.title=s||null;const n=[...o,...a];if(n.length>0){t.data||(t.data={}),t.data.hProperties||(t.data.hProperties={});for(const l of n){const c=Number.parseInt(l[1],10),h=l[2];h==="w"||h==="x"?t.data.hProperties.width=c:(h==="h"||h==="y")&&(t.data.hProperties.height=c)}}})},iO=()=>e=>{me.visit(e,(t,r,i)=>{i&&Object.defineProperty(t,"parent",{value:i,writable:!0,configurable:!0,enumerable:!1})})},hu=/^:::(message|details)\s*(.*)/,oO=()=>e=>{function t(r){const i=[];let o=0;for(;o<r.length;){const s=r[o];if(s.type==="paragraph"&&s.children[0]?.type==="text"&&s.children[0].value.trim().startsWith(":::")){const l=s.children[0].value.trim().match(hu);if(l){const c=o;let h=-1,d=1;const f=s.children.at(-1);if(s.children.length>1&&f?.type==="text"&&f.value.trim()===":::")h=c;else for(let u=c+1;u<r.length;u++){const g=r[u];if(g.type==="paragraph"&&g.children[0]?.type==="text"){const m=g.children[0].value.trim();hu.test(m)?d++:m===":::"&&d--}if(d===0){h=u;break}}if(h!==-1){const u=l[1],g=l[2];let m;if(h===c){const C=s.children.slice(1,-1);C[0]?.type==="break"&&C.shift(),C.at(-1)?.type==="break"&&C.pop(),m=C.length>0?[{type:"paragraph",children:C}]:[]}else{const C=s.children.slice(1);C[0]?.type==="break"&&C.shift();const w={type:"paragraph",children:C},v=r[h].children.slice(0,-1);v.at(-1)?.type==="break"&&v.pop();const _={type:"paragraph",children:v},E=r.slice(c+1,h);m=[w,...E,_].filter(B=>!(B.type==="paragraph"&&B.children.length===0))}const y=t(m);let x;if(u==="message"?x={type:"message",data:{messageType:g.trim()},children:y}:u==="details"&&(x={type:"details",data:{title:g.trim()},children:y}),x){i.push(x),o=h+1;continue}}}}const a={...s};"children"in a&&Array.isArray(a.children)&&(a.type==="blockquote"||a.type==="footnoteDefinition"||a.type==="message"||a.type==="details"?a.children=t(a.children):a.type==="list"&&(a.children=a.children.map(n=>({...n,children:t(n.children)})))),i.push(a),o++}return i}e.children=t(e.children)},sO=e=>{const t=[];return me.visit(e,"heading",r=>{const i=lC(r.children),o=r.data?.hProperties?.id;o&&i&&t.push({depth:r.depth,text:i,id:o})}),t};exports.BlockquoteNode=SC;exports.CodeNode=Xh;exports.Color=Re;exports.Color$1=Ui;exports.DEFAULT_MARKDOWN_EMBED_LABELS=MC;exports.DEFAULT_MARKDOWN_VIEWER_LABELS=m$;exports.DEFAULT_MERMAID_DIAGRAM_LABELS=vM;exports.DEFAULT_MERMAID_INTERACTION=Fx;exports.DEFAULT_SVG_IMAGE_LABELS=N3;exports.DeleteNode=oC;exports.EmphasisNode=sC;exports.FootnoteBackLinkNode=nC;exports.FootnoteReferenceNode=aC;exports.FootnotesSection=N$;exports.HeadingNode=hC;exports.HostedScrollArea=uu;exports.ImageNode=cC;exports.InlineCodeNode=dC;exports.JSON_SCHEMA=Mp;exports.LinkNode=fC;exports.ListItemNode=gC;exports.ListNode=pC;exports.MarkdownRenderer=Vx;exports.MarkdownViewer=D$;exports.MermaidDiagram=Yh;exports.NodesRenderer=Wt;exports.ParagraphNode=mC;exports.Rgb=he;exports.SpreadsheetBlock=Gh;exports.StrongNode=yC;exports.TableNode=xC;exports.TableOfContents=Kx;exports.TextNode=CC;exports.ThematicBreakNode=bC;exports.Utils=gt;exports.ZERO_WIDTH_SPACE=em;exports.ZennDetailsNode=kC;exports.ZennMessageNode=wC;exports.__export=Su;exports.__name=p;exports.abs=jS;exports.acos=KS;exports.adjustChannel=Rl;exports.argumentsTag=ph;exports.array=_f;exports.arrayBufferTag=jp;exports.arrayTag=zp;exports.asin=ZS;exports.assignWithDepth_default=jt;exports.at=rt;exports.atan2=WS;exports.booleanTag=gh;exports.calculateMathMLDimensions=gk;exports.calculateTextDimensions=Sa;exports.calculateTextHeight=wh;exports.calculateTextWidth=Ue;exports.cleanAndMerge=va;exports.clear=Wu;exports.clear$1=YB;exports.clear$2=xB;exports.clear2=NB;exports.color=Di;exports.commonDb_exports=ql;exports.common_default=Yi;exports.computeDimensionOfText=Nm;exports.computeLabelTransform=di;exports.configureLabelImages=vh;exports.configureSvgSize=Nl;exports.constant=$r;exports.constant$1=fa;exports.cos=HS;exports.createText=Pe;exports.curveBasis=Ns;exports.darken=Y;exports.dataViewTag=Hp;exports.dateTag=Dp;exports.dayjs2=vu;exports.decodeEntities=br;exports.defaultConfig2=Sk;exports.defaultConfig_default=Il;exports.define=ua;exports.distExports=Op;exports.edgeLabels=Io;exports.epsilon=Wn;exports.extend=Xl;exports.extractHeadings=sO;exports.float32ArrayTag=Qp;exports.float64ArrayTag=Jp;exports.generateId=nm;exports.getAccDescription=Gu;exports.getAccTitle=Yu;exports.getConfig=Rt;exports.getConfig2=kt;exports.getDefaultExportFromCjs=du;exports.getDiagramTitle=Vu;exports.getEdgeId=WT;exports.getEffectiveHtmlLabels=ae;exports.getIconSVG=Xi;exports.getLineFunctionsWithOffset=y0;exports.getRegisteredLayoutAlgorithm=vL;exports.getStylesFromArray=kh;exports.getSubGraphTitleMargins=Ta;exports.getTag=ka;exports.getThemeVariables3=_u;exports.getUrl=zu;exports.getUserDefinedConfig=ek;exports.halfPi=Hn;exports.hasKatex=Ii;exports.hue=Cw;exports.insertCluster=Km;exports.insertEdge=k0;exports.insertEdgeLabel=x0;exports.insertNode=Nh;exports.int16ArrayTag=Kp;exports.int32ArrayTag=Zp;exports.int8ArrayTag=Vp;exports.interpolateNumber=rr;exports.interpolateRgb=Rn;exports.interpolateString=gf;exports.isDark=Te;exports.isLabelStyle=dh;exports.isPrimitive=wa;exports.isTypedArray=So;exports.isValidShape=m0;exports.lighten=H;exports.line=Lf;exports.lineBreakRegex=Hi;exports.load=$p;exports.log=V;exports.mapTag=Np;exports.markerOffsets=Jt;exports.markers_default=v0;exports.max=YS;exports.min=US;exports.nogamma=Vl;exports.numberTag=fh;exports.objectTag=Wp;exports.parseFontSize=Ho;exports.parseGenericTypes=Ln;exports.pi=ma;exports.positionEdgeLabel=C0;exports.positionNode=qB;exports.random=hm;exports.regexpTag=Ip;exports.registerIconPacks=pm;exports.remarkCustomHeadingId=Q$;exports.remarkFootnoteBackLink=J$;exports.remarkHtmlAnchorToLink=tO;exports.remarkHtmlInHtml=eO;exports.remarkImageSize=rO;exports.remarkParentNode=iO;exports.remarkZennMessage=oO;exports.render=SL;exports.renderKatexSanitized=Dl;exports.rgbConvert=df;exports.rgba=ir;exports.sanitizeText=Se;exports.select=yt;exports.selectSvgElement=Kf;exports.setAccDescription=Uu;exports.setAccTitle=Hu;exports.setConfig2=wk;exports.setDiagramTitle=Xu;exports.setNodeElem=DB;exports.setTag=qp;exports.setupGraphViewbox=ju;exports.setupGraphViewbox2=Ku;exports.sin=GS;exports.sqrt=XS;exports.stringTag=uh;exports.styles2String=it;exports.symbolTag=Pp;exports.tau=VS;exports.terminalLabels=Xt;exports.uint16ArrayTag=Gp;exports.uint32ArrayTag=Xp;exports.uint8ArrayTag=Yp;exports.uint8ClampedArrayTag=Up;exports.unknownIcon=fm;exports.updateNodeBounds=ot;exports.useMarkdownToolbarState=iC;exports.utils_default=we;exports.withPath=Tf;exports.wrapLabel=cm;
314
+ `)},E5=(e,t)=>{const r=e.indexOf(t);return r===-1?{echo:!1,pending:[]}:{echo:!0,pending:e.slice(r+1)}},F5=(e,t,r,i,o)=>{const s=o==="down"?1:o==="up"?-1:0,a=o==="right"?1:o==="left"?-1:0,n=(d,f)=>d>=0&&d<t&&f>=0&&f<r,l=(d,f)=>e(d,f)!=="";let c=i.row+s,h=i.col+a;if(!n(c,h))return{row:i.row,col:i.col};if(l(i.row,i.col)&&l(c,h)){for(;n(c+s,h+a)&&l(c+s,h+a);)c+=s,h+=a;return{row:c,col:h}}for(;n(c,h);){if(l(c,h))return{row:c,col:h};c+=s,h+=a}return{row:c-s,col:h-a}},A5=/^(?:https?:\/\/|mailto:|tel:)\S+$/iu,M5=e=>A5.test(e)?e:void 0,$5=(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}`},O5=Object.freeze(["decreaseColumnWidth","increaseColumnWidth","autoFitColumnWidth","decreaseRowHeight","increaseRowHeight"]),R5=()=>{let e=Object.freeze({row:0,col:0});const t=new Set;return{get:()=>e,set:r=>{if(!(r.row===e.row&&r.col===e.col)){e=Object.freeze({row:r.row,col:r.col});for(const i of[...t])i()}},subscribe:r=>(t.add(r),()=>{t.delete(r)})}},cs="data-aqmd-spreadsheet-control",I5=Object.freeze(["zoom-in","zoom-out","reset-zoom","highlight","track-size","copy","save","save-menu","fullscreen"]),P5=({labels:e,labelledBy:t,rows:r,cols:i,canZoomIn:o,canZoomOut:s,zoom:a,onZoom:n,onResetZoom:l,highlighted:c,onToggleHighlight:h,onCopy:d,onSave:f,fullscreen:u,onToggleFullscreen:g,gridReady:m,activeCell:y,onTrackSize:x})=>{const{onKeyDown:C,onFocus:w,tabIndexOf:S}=Hh(I5,cs),[v,_]=L.useState(!1),E=L.useId(),B=L.useRef(null),D=v&&m,M=(N,q,A,$,O,F,R=Vr)=>k.jsx("button",{type:"button",[cs]:N,tabIndex:S(N),onClick:O?A:void 0,"aria-disabled":O?void 0:"true","aria-pressed":F,className:R,"aria-label":q.text,lang:q.lang,children:$}),P=oa(a),U={text:It.fillLabel(e.resetZoom.text,{percent:P}),lang:e.resetZoom.lang};return k.jsxs(k.Fragment,{children:[k.jsxs("div",{"data-aqmd-spreadsheet-toolbar":"",role:"toolbar","aria-labelledby":t,onKeyDown:C,onFocus:w,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:[k.jsx("span",{"data-aqmd-spreadsheet-size":"",lang:e.size.lang,className:"me-auto text-sm",children:It.fillLabel(e.size.text,{rows:r,cols:i})}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[M("zoom-in",e.zoomIn,()=>n(1),k.jsx(Cu,{size:20}),m&&o),M("zoom-out",e.zoomOut,()=>n(-1),k.jsx(bu,{size:20}),m&&s),M("reset-zoom",U,l,k.jsxs("span",{"data-aqmd-spreadsheet-zoom":"",children:[k.jsxs("span",{"data-aqmd-spreadsheet-zoom-widest":"","aria-hidden":"true",children:[oa(oe.SPREADSHEET_ZOOM_MAX)," %"]}),k.jsxs("span",{children:[P," %"]})]}),m&&a!==1,void 0,lM)]}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[M("highlight",e.highlight,h,k.jsx(o5,{size:18}),m,c),k.jsx("button",{type:"button",ref:B,[cs]:"track-size",tabIndex:S("track-size"),onClick:m?()=>_(N=>!N):void 0,"aria-disabled":m?void 0:"true","aria-expanded":D,"aria-controls":D?E:void 0,className:Vr,"aria-label":e.trackSize.text,lang:e.trackSize.lang,children:k.jsx(c5,{size:18})})]}),k.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[M("copy",e.copyAll,d,k.jsx(Rx,{size:18}),m),M("save",e.saveTsv,()=>f(!1),k.jsx(QM,{size:18}),!0),k.jsx(Ax,{buttonHook:{[cs]:"save-menu"},menuHook:{"data-aqmd-spreadsheet-menu":""},label:e.saveMenu,icon:k.jsx(VM,{size:18}),tabIndex:S("save-menu"),items:[{key:"save-with-bom",label:e.saveTsvWithBom,onSelect:()=>f(!0),hook:{"data-aqmd-spreadsheet-menu-item":"save-with-bom"}}]})]}),M("fullscreen",u?e.exitFullscreen:e.fullscreen,g,u?k.jsx(l5,{size:18}):k.jsx(a5,{size:18}),!0)]}),D&&k.jsx(N5,{id:E,labels:e,activeCell:y,onTrackSize:x,onClose:()=>{_(!1),B.current?.focus()}})]})},D5=Object.freeze({decreaseColumnWidth:k.jsx(t5,{size:18}),increaseColumnWidth:k.jsx(u5,{size:18}),autoFitColumnWidth:k.jsx(GM,{size:18}),decreaseRowHeight:k.jsx(r5,{size:18}),increaseRowHeight:k.jsx(g5,{size:18})}),N5=({id:e,labels:t,activeCell:r,onTrackSize:i,onClose:o})=>{const s=L.useSyncExternalStore(r.subscribe,r.get,r.get),a={column:oe.columnIndexToName(s.col),row:s.row+1},n=l=>{l.key!=="Escape"||l.defaultPrevented||(l.preventDefault(),l.stopPropagation(),o())};return k.jsx("div",{id:e,"data-aqmd-spreadsheet-track-size":"",role:"group","aria-label":t.trackSize.text,lang:t.trackSize.lang,onKeyDown:n,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:O5.map(l=>k.jsx("button",{type:"button","data-aqmd-spreadsheet-track-size-control":l,onClick:()=>i(l),className:Vr,"aria-label":It.fillLabel(t[l].text,a),lang:t[l].lang,children:D5[l]},l))})},q5=(e,t,r)=>{const i={v:1,rows:e.length,cols:e[0]?.length??0,clipId:r,formats:[],validations:[],cells:e.map(s=>s.map(a=>({t:a}))),wholeRows:!1,wholeCols:!1,conditionalFormats:[]},o=t.serializeClipPayload(i);return{plain:t.serializeClipboardTsv(e),html:t.serializeHtmlTable(i,o)}},z5=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"})})])},j5="\uFEFF",W5="text/tab-separated-values;charset=utf-8",H5=(e,t)=>`${t?j5:""}${sa.serializeTsv(e)}`,Y5=(e,t,r)=>{const i=r.defaultView;if(i===null)throw new Error("[@aiquants/markdown] saving a file needs a document with a window");const o=i.URL.createObjectURL(new Blob([e],{type:W5})),s=r.createElement("a");s.href=o,s.download=t,s.hidden=!0,r.body.append(s);try{s.click()}finally{s.remove(),i.setTimeout(()=>i.URL.revokeObjectURL(o),0)}},Px=e=>{const t=L.useRef(e);L.useLayoutEffect(()=>{t.current=e});const r=e!==void 0,[i]=L.useState(()=>new Set);return L.useEffect(()=>e?.subscribe(()=>{for(const o of[...i])o()}),[e,i]),L.useMemo(()=>{if(!r)return;const o=()=>{const s=t.current;if(s===void 0)throw new Error("[@aiquants/markdown] the spreadsheet editor stand-in was called after its editor was removed");return s};return{write:s=>o().write(s),read:s=>o().read(s),undo:()=>o().undo(),redo:()=>o().redo(),subscribe:s=>(i.add(s),()=>{i.delete(s)})}},[r,i])};let Ts=null,xn=null;const El=new Set,U5=e=>(El.add(e),()=>{El.delete(e)}),Yd=()=>Ts!==null?Promise.resolve(Ts):(xn??=import("@aiquants/spreadsheet").then(e=>{Ts=e;for(const t of El)t();return e},e=>{throw xn=null,e}),xn);class ai extends Error{reason;constructor(t){super(`[@aiquants/markdown] spreadsheet edit refused: ${t}`),this.name="SpreadsheetEditRefusal",this.reason=t}}const Ud=e=>{console.error("[@aiquants/markdown] could not load @aiquants/spreadsheet",e)},Gd=Object.freeze({row:!0,column:!0,intersection:!1}),Xd=Object.freeze({row:!1,column:!1,intersection:!1}),Vd=Object.freeze([Object.freeze([""])]),G5=Object.freeze({link:!1}),X5=229,Dx=e=>e.trim().replace(/\s+/g," ").toLowerCase(),V5=e=>{const t=[];let r="",i=null;for(let o=0;o<e.length;o++){const s=e[o];s==="\\"&&o+1<e.length?(o++,r+=e[o]):i!==null?s===i?i=null:r+=s:s==='"'||s==="'"?i=s:s===","?(t.push(r),r=""):r+=s}return t.push(r),new Set(t.map(Dx))},K5=e=>{const t=e.trim(),r=t.length>=2&&(t[0]==='"'||t[0]==="'")&&t[t.length-1]===t[0];return Dx((r?t.slice(1,-1):t).replace(/\\(.)/g,"$1"))},Z5=(e,t)=>{const r=V5(t);return e.fontfaces.some(i=>r.has(K5(i.family)))},Q5=({matrix:e,headerRows:t,footerRows:r,visibleRows:i,headings:o,autofit:s})=>{const a=Math.min(e[0].length,x5),n=C5(e,i,r),l=Array.from({length:a},(h,d)=>d),c=h=>o?k.jsx("td",{"aria-hidden":"true","data-aqmd-spreadsheet-static-number":"",children:h+1}):null;return k.jsxs("table",{"data-aqmd-spreadsheet-static":"","data-aqmd-spreadsheet-static-autofit":s?"":void 0,children:[s&&k.jsxs("colgroup",{children:[o&&k.jsx("col",{"data-aqmd-spreadsheet-static-band":""}),l.map(h=>k.jsx("col",{"data-aqmd-spreadsheet-static-empty":n.every(({cells:d})=>d[h]==="")?"":void 0},h))]}),k.jsxs("thead",{children:[o&&k.jsxs("tr",{"aria-hidden":"true","data-aqmd-spreadsheet-static-letters":"",children:[k.jsx("td",{}),l.map(h=>k.jsx("td",{children:oe.columnIndexToName(h)},h))]}),n.filter(({index:h})=>h<t).map(({index:h,cells:d})=>k.jsxs("tr",{children:[c(h),d.slice(0,a).map((f,u)=>k.jsx("th",{scope:"col",children:f},u))]},h))]}),k.jsx("tbody",{children:n.filter(({index:h})=>h>=t).map(({index:h,cells:d})=>k.jsxs("tr",{children:[c(h),d.slice(0,a).map((f,u)=>k.jsx("td",{children:f},u))]},h))})]})},J5=e=>{try{return{options:It.parseSpreadsheetOptions(e),unreadWord:null}}catch(t){if(t instanceof It.SpreadsheetOptionsError)return{options:null,unreadWord:t.word};throw t}},Nx=({tsv:e,meta:t,sourceLines:r,editor:i,locale:o="en",labels:s,layout:a="inline"})=>{if(!Object.hasOwn(It.SPREADSHEET_BLOCK_LABEL_CATALOGS,o))throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet locale "${String(o)}" (en and ja are supported)`);if(a!=="inline"&&a!=="fill")throw new RangeError(`[@aiquants/markdown] unsupported spreadsheet layout "${String(a)}" (inline and fill are supported)`);const n=L.useMemo(()=>Oi(It.SPREADSHEET_BLOCK_LABEL_CATALOGS[o],s),[o,s]),{options:l,unreadWord:c}=L.useMemo(()=>J5(t),[t]),h=L.useMemo(()=>mn(e),[e]),d=h>oe.SPREADSHEET_MAX_OPERATION_CELLS,f=L.useMemo(()=>Mi.parseSourceLines(r)?.first??null,[r]),[u,g]=L.useState(null),m=`${r??""}
315
+ ${e}`,y=u===m,x=i!==void 0&&f!==null&&!y?i:void 0,C=x!==void 0,w=C&&l!==null&&l.footerRows===0?p5:0,S=C?m5:0,[v,_]=L.useState(()=>d?Vd:hs(e)),[E,B]=L.useState(0),D=L.useRef(e),M=L.useRef([]),P=L.useMemo(()=>T5(v,w,S),[v,w,S]),U=L.useRef(P);U.current=P;const N=L.useSyncExternalStore(U5,()=>Ts,()=>null),[q,A]=L.useState(!1),$=q&&N===null,O=l===null?null:l.zoomPercent,[F,R]=L.useState(()=>O===null?1:Hd(O)),[z,T]=L.useState(O);O!==z&&(T(O),O!==null&&R(Hd(O)));const W=l!==null&&l.toolbar===0?Xd:Gd,[j,G]=L.useState(W),[X,K]=L.useState(W);W!==X&&(K(W),G(W));const[Z,at]=L.useState(!1),[mt,ht]=L.useState(null),ct=L.useRef(null),_t=L.useId(),Ct=L.useCallback((Q,pt={})=>{ht($t=>({text:It.fillLabel(n[Q].text,pt),lang:n[Q].lang,serial:($t?.serial??0)+1}))},[n]);L.useEffect(()=>{if(N!==null||l===null||d)return;let Q=!0;return Yd().catch(pt=>{Q&&(Ud(pt),A(!0))}),()=>{Q=!1}},[N,l,d]),L.useEffect(()=>{const Q=E5(M.current,e);if(Q.echo){M.current=Q.pending;return}const pt=x===void 0||f===null?null:x.read(f),$t=pt!==null&&mn(pt)<=oe.SPREADSHEET_MAX_OPERATION_CELLS?pt:null;if($t!==null&&$t===M.current.at(-1))return;M.current=[];const re=$t===null?e:$t;re!==D.current&&(D.current=re,_($t===null&&d?Vd:hs(re)),B(Lr=>Lr+1))},[e,d,x,f]);const Et=L.useCallback(()=>{if(x===void 0||f===null)return;const Q=x.read(f);Q===null||Q===D.current||mn(Q)>oe.SPREADSHEET_MAX_OPERATION_CELLS||(M.current=[],D.current=Q,_(hs(Q)),B(pt=>pt+1))},[x,f]);L.useEffect(()=>x?.subscribe(()=>{M.current.length>0&&Et()}),[x,Et]);const Nt=L.useCallback(Q=>{Q(),Et()},[Et]),Gt=L.useMemo(()=>x===void 0?void 0:()=>Nt(()=>x.undo()),[x,Nt]),te=L.useMemo(()=>x===void 0?void 0:()=>Nt(()=>x.redo()),[x,Nt]),xe=L.useRef(()=>{});xe.current=Q=>{if(x===void 0||f===null)throw new ai("readOnly");const pt=B5(U.current,Q);if(pt.kind==="format-only")throw new ai("formatRefused");if(pt.kind==="unchanged")return;const $t=Uh(pt.matrix),re=L5($t),Lr=x.write({fenceLine:f,expected:D.current,text:re});switch(Lr){case"written":{const ur=x.read(f);if(ur===null)throw new TypeError("[@aiquants/markdown] SpreadsheetEditor.write answered written, but read finds no block on its fence line");D.current=ur,M.current=[...M.current,ur],_(ur===re?$t:hs(ur)),B(ii=>ii+1),ht(null);return}case"changed":throw Et(),new ai("editConflict");case"closesFence":throw new ai("fenceRefused");case"unwritable":throw g(m),new ai("unwritable");default:throw new TypeError(`[@aiquants/markdown] SpreadsheetEditor.write answered ${JSON.stringify(Lr)} (written, changed, closesFence or unwritable)`)}};const[_e]=L.useState(()=>({get rowCount(){return U.current.length},get colCount(){return U.current[0].length},getCellText:(Q,pt)=>U.current[Q][pt],applyEdits:(Q,pt)=>xe.current(Q),getCellFormat:()=>y5,getCellHyperlink:(Q,pt)=>M5(U.current[Q][pt]),findDataEdge:(Q,pt)=>F5(($t,re)=>U.current[$t][re],U.current.length,U.current[0].length,Q,pt)})),Ft=L.useCallback(Q=>{if(!(Q instanceof ai))throw Q;Ct(Q.reason)},[Ct]),wt=L.useCallback(Q=>Ct(y?"unwritable":"readOnly"),[Ct,y]),Be=L.useCallback(Q=>{ct.current?.ownerDocument.defaultView?.open(Q,"_blank","noopener,noreferrer")},[]),Qr=L.useCallback(({row:Q,displayText:pt,columnName:$t,readOnly:re})=>It.fillLabel((re===!0?n.readOnlyCellAnnouncement:n.cellAnnouncement).text,{cell:`${$t}${Q+1}`,value:pt===""?n.emptyCell.text:pt}),[n]),hr=L.useCallback(({range:Q})=>It.fillLabel(n.selectionAnnouncement.text,{range:$5(Q,oe.columnIndexToName)}),[n]),vr=L.useCallback(({axis:Q,index:pt,size:$t})=>Q==="column"?It.fillLabel(n.columnResized.text,{column:oe.columnIndexToName(pt),size:$t}):It.fillLabel(n.rowResized.text,{row:pt+1,size:$t}),[n]),De=L.useRef(null),[Le]=L.useState(R5),Tr=L.useCallback(Q=>Le.set(Q.active),[Le]),Jr=L.useCallback(Q=>{De.current?.executeCommand(Q)},[]),Ce=oa(F),Ze=L.useRef(Ce);L.useLayoutEffect(()=>{z!==null&&(Ze.current=z)},[z]),L.useEffect(()=>{Ze.current!==Ce&&(Ze.current=Ce,Ct("zoomed",{percent:Ce}))},[Ct,Ce]);const cr=L.useCallback(Q=>R(pt=>oe.clampSpreadsheetZoom(oe.stepSpreadsheetZoom(pt,Q))),[]),ti=L.useCallback(()=>R(1),[]),_r=j.row||j.column,J=L.useCallback(()=>G(Q=>Q.row||Q.column?Xd:Gd),[]),ft=L.useCallback(()=>{if(N===null)return;const Q=ct.current?.ownerDocument.defaultView;(async()=>{if(Q==null)throw new Error("no window");const $t=q5(v,N,Q.crypto.randomUUID());await z5($t,Q.navigator.clipboard,re=>new Q.ClipboardItem(re))})().then(()=>Ct("copied"),$t=>{console.error("[@aiquants/markdown] could not copy the spreadsheet",$t),Ct("copyFailed")})},[Ct,v,N]),xt=L.useCallback(Q=>{const pt=ct.current?.ownerDocument;pt!==void 0&&Y5(H5(v,Q),n.fileName.text,pt)},[v,n]),Pt=L.useRef(!1);L.useEffect(()=>{Pt.current&&(Pt.current=!1,ct.current?.querySelector('[data-aqmd-spreadsheet-control="fullscreen"]')?.focus())},[Z]);const At=L.useCallback(Q=>{const pt=ct.current;pt!==null&&(pt.close(),Q?pt.showModal():pt.show(),Pt.current=!0,at(Q))},[]),Zi=L.useCallback(()=>At(!Z),[Z,At]),ei=L.useCallback(Q=>{!Z||Q.key!=="Escape"||Q.defaultPrevented||Q.nativeEvent.isComposing||Q.keyCode===X5||(Q.preventDefault(),Q.stopPropagation(),At(!1))},[Z,At]),Pa=L.useCallback(Q=>{Q.preventDefault(),At(!1)},[At]),Da=v.length,Mt=v[0].length,Bt=l===null?0:b5(l,P.length),le=P.length,Ht=l!==null&&a==="inline"&&v5(l.visibleRows,le),[ee,Ne]=L.useState(null),ri=L.useMemo(()=>{if(l===null)return;const Q=l.headings===1,pt={"--aqmd-spreadsheet-zoom":String(F)};return a==="fill"?pt["--aqmd-spreadsheet-box-min-height"]=`${yn(w5(le),F,Q)}px`:Ht?pt["--aqmd-spreadsheet-box-height"]=`${Wd(ee===null?yn(le,F,Q):ee.height)}px`:pt["--aqmd-spreadsheet-box-height"]=`${yn(Bt,F,Q)}px`,ee!==null&&(pt["--aqmd-spreadsheet-box-width"]=`${Wd(ee.width)}px`),pt},[l,a,Ht,le,Bt,F,ee]),dr=Z?n.fullscreenDialog:n.table,Br=N?.Spreadsheet;return L.useLayoutEffect(()=>{const Q=De.current,pt=ct.current;if(l===null||l.autofit!==1||N===null||Q===null||pt===null)return;const $t=Array.from({length:P[0].length},(ur,ii)=>ii);Q.autoFitColumns($t);const re=pt.ownerDocument.fonts;if(re===void 0)return;const Lr=ur=>{const ii=De.current;ii!==null&&Z5(ur,getComputedStyle(pt).fontFamily)&&ii.autoFitColumns($t)};return re.addEventListener("loadingdone",Lr),()=>re.removeEventListener("loadingdone",Lr)},[l,N,P]),k.jsxs("div",{"data-aqmd-spreadsheet":"","data-aqmd-spreadsheet-layout":a,"data-source-lines":r,"data-aqmd-spreadsheet-editable":C?"":void 0,"data-aqmd-spreadsheet-fullscreen":Z?"":void 0,"data-aqmd-spreadsheet-whole":Ht?"":void 0,children:[k.jsx("span",{id:_t,hidden:!0,lang:dr.lang,children:dr.text}),k.jsxs("dialog",{ref:ct,open:!0,"data-aqmd-spreadsheet-dialog":"",role:Z?void 0:"group","aria-labelledby":_t,onKeyDown:ei,onCancel:Pa,children:[l===null?k.jsx("div",{"data-aqmd-spreadsheet-error":"options",role:"alert",lang:n.optionsError.lang,children:It.fillLabel(n.optionsError.text,{word:c,frozenMax:It.SPREADSHEET_OPTION_RULES.header.max,heightMax:It.SPREADSHEET_OPTION_RULES.height.max,zoomSteps:It.SPREADSHEET_ZOOM_STEP_PERCENTS.join(", ")})}):d?k.jsx("div",{"data-aqmd-spreadsheet-error":"size",role:"alert",lang:n.tooLarge.lang,children:It.fillLabel(n.tooLarge.text,{cells:new Intl.NumberFormat(o).format(h),max:new Intl.NumberFormat(o).format(oe.SPREADSHEET_MAX_OPERATION_CELLS)})}):k.jsxs(k.Fragment,{children:[l.toolbar===1&&k.jsx(P5,{labels:n,labelledBy:_t,rows:Da,cols:Mt,canZoomIn:F<oe.SPREADSHEET_ZOOM_MAX,canZoomOut:F>oe.SPREADSHEET_ZOOM_MIN,zoom:F,onZoom:cr,onResetZoom:ti,highlighted:_r,onToggleHighlight:J,onCopy:ft,onSave:xt,fullscreen:Z,onToggleFullscreen:Zi,gridReady:Br!==void 0,activeCell:Le,onTrackSize:Jr}),k.jsx("div",{"data-aqmd-spreadsheet-box":"",style:ri,children:Br===void 0?k.jsx(Q5,{matrix:v,headerRows:l.headerRows,footerRows:l.footerRows,visibleRows:Bt,headings:l.headings===1,autofit:l.autofit===1}):k.jsx(Br,{ref:De,adapter:_e,dataVersion:E,defaultRowHeight:Ix,frozenRows:l.headerRows,headerRows:l.headerRows,frozenTrailingRows:l.footerRows,frozenColumns:l.frozenColumns,enableFillHandle:C,readOnly:!C,labelledBy:_t,enableResizeUI:!0,headings:l.headings===1,onContentSizeChange:Ne,zoom:F,onZoomChange:R,highlight:j,onHighlightChange:G,popovers:G5,onHyperlinkOpen:Be,onEditRejected:Ft,onReadOnlyRejected:wt,onUndoRequest:Gt,onRedoRequest:te,formatCellAnnouncement:Qr,formatSelectionAnnouncement:hr,formatResizeAnnouncement:vr,onSelectionChange:Tr,locale:o})})]}),$&&k.jsxs("div",{"data-aqmd-spreadsheet-error":"load",role:"alert",children:[k.jsx("span",{lang:n.loadFailed.lang,children:n.loadFailed.text}),k.jsx("button",{type:"button","data-aqmd-spreadsheet-retry":"",lang:n.retry.lang,className:"ms-2 inline-flex min-h-11 min-w-11 items-center justify-center rounded border px-3 py-1 text-sm",onClick:()=>{A(!1),Yd().catch(Q=>{Ud(Q),A(!0)})},children:n.retry.text})]}),k.jsx("p",{"data-aqmd-spreadsheet-notice":"",role:"status",children:mt!==null&&k.jsx("span",{lang:mt.lang,children:mt.text},mt.serial)})]})]})};Nx.displayName="SpreadsheetBlock";const Gh=L.memo(Nx),t3=Object.freeze({light:"solarized-light",dark:"github-dark-high-contrast"}),e3=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 r3(e){const t={};for(const r in e){const i=e[r];switch(r){case"class":t.className=i;break;case"style":{const o={};for(const s of i.split(";")){const a=s.indexOf(":");if(a<=0)continue;const n=s.slice(0,a).trim(),l=s.slice(a+1).trim();n===""||l===""||(o[n.startsWith("--")?n:n.replace(/-(\w)/g,(c,h)=>h.toUpperCase())]=l)}t.style=o;break}case"tabindex":t.tabIndex=Number(i);break;default:t[r]=i}}return t}const i3=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};return k.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"})},o3=({htmlPromise:e,filename:t,code:r,sourceLines:i})=>{const o=L.use(e),s={replace:a=>{if(a instanceof St.Element&&a.name==="pre"){const n=r3(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"},k.jsxs("div",{className:"relative",style:{margin:l},"data-aqmd-code-block":"","data-source-lines":i,children:[t&&k.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}),k.jsx(i3,{code:r}),k.jsx("pre",{...n,children:St.domToReact(a.children,s)})]})}},htmlparser2:{lowerCaseTags:!0}};return k.jsx(k.Fragment,{children:St(o,s)})},s3=/^(diff)?:?(\w+):?([\w.-]*)?/,a3=new Map([["svg","xml"]]),n3="text",l3=e=>{const t=a3.get(e),r=t===void 0?e:t;return Sn.isSpecialLang(r)||Object.hasOwn(Sn.bundledLanguages,r)?r:n3},h3=()=>({code(e){for(const t of e.children){if(t.type!=="element")continue;const r=t.children[0];if(r?.type!=="element")continue;const i=r.children[0];if(i?.type!=="text")continue;const o=i.value;let s,a,n="";if(o.startsWith("+")?(s="+",a="add",n="bg-green-200 dark:bg-green-400/90 text-green-700"):o.startsWith("-")&&(s="-",a="remove",n="bg-red-200 dark:bg-red-400/90 text-red-700"),s&&a){t.properties.dataAqmdDiff=a,i.value=o.substring(1).trimStart();const l={type:"element",tagName:"span",properties:{className:`inline-flex items-center justify-center w-4 h-4 rounded-full select-none font-bold text-[0.5rem] mr-2 ${n}`},children:[{type:"text",value:s==="+"?"➕":"➖"}]};t.children.unshift(l)}}}}),c3=e=>{const t=s3.exec(e??"");return{isDiff:t?.[1]==="diff",lang:t?.[2]||"text",filename:t?.[3]||void 0}},Xh=({lang:e,code:t,node:r,sourceLines:i})=>{const o=e??r?.lang??void 0,s=t??r?.value??"",{isDiff:a,lang:n,filename:l}=c3(o);return n===It.SPREADSHEETS_LANGUAGE?k.jsx(Gh,{tsv:s,meta:r?.meta??void 0,sourceLines:i}):n==="mermaid"?k.jsx(Yh,{chartContent:s,sourceLines:i}):k.jsx(d3,{code:s,lang:n,isDiff:a,filename:l,sourceLines:i})},d3=({code:e,lang:t,isDiff:r,filename:i,sourceLines:o})=>{const s=L.useMemo(async()=>{const a=[];return r&&a.push(h3()),await Sn.codeToHtml(e,{lang:l3(t),themes:t3,defaultColor:!1,colorReplacements:e3,transformers:a})},[e,t,r]);return k.jsx(L.Suspense,{fallback:k.jsx("div",{className:"dark:text-white","data-source-lines":o,children:"🌀 Loading code..."}),children:k.jsx(o3,{htmlPromise:s,filename:i,code:e,sourceLines:o})})},qx=({code:e})=>{const[t,r]=L.useState(!1),i=()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},o=>{console.error("Failed to copy: ",o)})};return k.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"})},zx=(e,t)=>{const r=L.useMemo(()=>{try{return{kind:"rendered",html:Ox(e,t).html}}catch(i){return{kind:"failed",error:i,message:`Math rendering error: ${i instanceof Error?i.message:String(i)}`}}},[e,t]);return L.useEffect(()=>{r.kind==="failed"&&console.error("An error occurred while rendering KaTeX:",r.error)},[r]),r},u3=({node:e})=>{const t=zx(e.value,!0),r="rounded-md px-1.5 py-1 font-mono text-gray-800 text-sm dark:text-gray-200";return k.jsxs("div",{className:"relative",children:[k.jsx(qx,{code:e.value}),t.kind==="rendered"?k.jsx("article",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):k.jsx("article",{className:r,children:t.message})]})},f3=/^[a-z][a-z0-9+.-]*:/i,g3=/^[/\\]{2}/,p3=/[\t\n\r]/g,Kd=32,m3=e=>{let t=0,r=e.length;for(;t<r&&e.charCodeAt(t)<=Kd;)t+=1;for(;r>t&&e.charCodeAt(r-1)<=Kd;)r-=1;return e.slice(t,r)},jx=e=>{const t=m3(e).replace(p3,"");return f3.test(t)||g3.test(t)},y3="text-link underline visited:text-link-visited",x3="inline-block w-fit",Vh=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"]);[...Vh].join(",");const Wx=(e,t)=>[e,t?x3:void 0,y3].filter(r=>r!==void 0&&r.trim()!=="").join(" "),C3=new Set(["id","title","lang","dir","role"]),b3=["aria-","data-footnote-"],k3=e=>{const t={};for(const[r,i]of Object.entries(e)){const o=r.toLowerCase();(C3.has(o)||b3.some(s=>o.startsWith(s)&&o.length>s.length))&&(t[o]=i)}return Object.freeze(t)},ke=new wn.Logger(wn.LogLevel.INFO,"[DifyIFramePlugin]"),w3="100%",S3="600px",v3="0",T3=e=>typeof e!="object"||e===null||!("type"in e)?null:typeof e.type=="string"?e.type:null,_3=({embed:e,iFrameAllowedDomains:t})=>{const[r,i]=L.useState(!0),[o,s]=L.useState(!1),a=L.useRef(null),n=L.useRef(null),l=L.useRef(null),{src:c}=e,h=L.useCallback(x=>{x.source===null||x.source!==a.current?.contentWindow||!Lb(x.origin,t)||T3(x.data)==="dify-chatbot-iframe-ready"&&(ke.info("Dify chatbot iframe is ready"),i(C=>C&&(s(!1),n.current&&(clearTimeout(n.current),n.current=null),l.current&&(clearTimeout(l.current),l.current=null),!1)))},[t]),d=L.useCallback(()=>{const x=a.current;if(x)try{if(!x.contentDocument)throw new Error("Cannot access iframe content");i(w=>w&&(s(!1),!1))}catch{ke.info("Crossorigin error detected, showing auth prompt"),s(w=>w||(i(!1),!0))}},[]),f=L.useCallback(()=>{const x=window.open(c,"dify-oauth","width=500,height=600,scrollbars=yes,resizable=yes");if(!x){ke.error("ポップアップがブロックされました");return}const C=setInterval(()=>{if(x.closed){clearInterval(C),ke.info("ポップアップが閉じられました");try{ke.info("ポップアップURL:",x.location.href)}catch(S){ke.info("クロスオリジンのためURLにアクセスできません:",S)}const w=a.current;if(w?.src){const S=w.src;i(v=>v||!0),s(v=>v&&!1),w.src="",setTimeout(()=>{w.src=S,n.current=setTimeout(()=>{ke.warn("認証後タイムアウト: dify-chatbot-iframe-ready not received after auth"),d()},5e3)},100)}}},1e3);ke.info("ポップアップを開きました:"),ke.info("- 初期URL:",c),ke.info("- ウィンドウ名:","dify-oauth"),ke.info("- ウィンドウサイズ: 500x600")},[d,c]);L.useEffect(()=>(window.addEventListener("message",h),()=>{window.removeEventListener("message",h)}),[h]),L.useEffect(()=>{const x=setTimeout(()=>{ke.warn("Timeout: dify-chatbot-iframe-ready not received, checking iframe access"),d()},5e3);return l.current=x,()=>{l.current&&(clearTimeout(l.current),l.current=null)}},[d]),L.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);const{width:u=w3,height:g=S3,frameborder:m=v3,...y}=e.attributes;return k.jsxs("div",{className:"dify-iframe-container",children:[r&&!o&&k.jsxs("div",{className:"flex items-center justify-center rounded-lg bg-gray-50 p-8",children:[k.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-blue-600 border-b-2"}),k.jsx("span",{className:"ml-3 text-gray-600",children:"Dify チャットボットを読み込み中..."})]}),o&&k.jsxs("div",{className:"mb-4 rounded-lg border border-blue-200 bg-blue-50 p-6",children:[k.jsx("div",{className:"flex items-center",children:k.jsxs("div",{className:"text-blue-800",children:[k.jsx("h3",{className:"font-medium",children:"認証が必要です"}),k.jsx("p",{className:"mt-1 text-sm",children:"Dify チャットボットにアクセスするには OAuth 認証が必要です。 ポップアップウィンドウで認証を完了してください。"})]})}),k.jsx("div",{className:"mt-4",children:k.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 認証を開始"})})]}),k.jsx("div",{className:`${r||o?"hidden":"block"}`,children:k.jsx("iframe",{ref:a,...St.attributesToProps({...y,width:u,height:g,frameborder:m},"iframe"),src:c,"data-plugin-type":"dify"})})]})},Zd=Object.freeze({dify:_3}),B3=e=>Object.hasOwn(Zd,e)?Zd[e]:null,L3=k.jsx(L.Fragment,{}),E3=(e,t,r,i,o)=>{const s=t===null?null:B3(t),a=e.attributes.title===void 0?{title:`${i.text}: ${new URL(e.src).hostname}`,lang:i.lang}:{};return k.jsx(ub,{embed:e,label:i,insideAnchor:o,children:s!==null?k.jsx(s,{embed:e,iFrameAllowedDomains:r}):k.jsx("iframe",{...St.attributesToProps(e.attributes,"iframe"),...a,src:e.src})})},Hx=e=>{for(let t=e.parent;t!==null;t=t.parent)if(t instanceof St.Element&&t.name.toLowerCase()==="a")return!0;return!1},Yx=e=>e.some(t=>t instanceof St.Element&&(Vh.has(t.name)||Yx(t.children))),F3=(e,t,r)=>{const{class:i,"data-link-kind":o,"data-doc-path":s,"data-doc-exists":a,...n}=e.attribs,l=Wx(i,Yx(e.children)),c=n.href??"",h=o,d=h==="external"||jx(c),f=St.domToReact(e.children,t);if(r&&c&&!d)return k.jsx(r,{href:c,kind:h,docPath:s,docExists:a===void 0?void 0:a==="true",className:l,attributes:k3(n),children:f});d&&(n.target="_blank",n.rel="noreferrer");const u={};return o!==void 0&&(u["data-link-kind"]=o),s!==void 0&&(u["data-doc-path"]=s),a!==void 0&&(u["data-doc-exists"]=a),k.jsx("a",{...St.attributesToProps(n,"a"),className:l,...u,children:f})},Ux=({iFrameAllowedDomains:e,embedLabels:t,linkComponent:r,renderPlaceholder:i,renderKept:o})=>{const s={replace:a=>{if(!(a instanceof St.Element))return;const n=a.parent instanceof St.Element?a.parent.name:null,l=la(a.name,a.attribs,{parentName:n,iFrameAllowedDomains:e});switch(l.action){case"remove":return L3;case"unwrap":return k.jsx(L.Fragment,{children:St.domToReact(a.children,s)});case"embed":return E3(l.embed,l.pluginType,e,t.embeddedFrame,Hx(a))}if(a.attribs={...l.attributes},l.action==="placeholder"){const h=i?.(a,l.link,s);if(h!==void 0)return h}const c=o?.(a,s);if(c!==void 0)return c;if(a.name==="a")return F3(a,s,r)}};return s};const A3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],M3=Tt("code-xml",A3),$3=4096*4096,Qd=32767,Jd=e=>Number.isFinite(e.width)&&Number.isFinite(e.height)&&e.width>0&&e.height>0,O3=(e,t)=>{const r=Jd(e)?e:Jd(t)?t:null;if(r===null)return null;const i=Math.min(1,Math.sqrt($3/(r.width*r.height)),Qd/r.width,Qd/r.height);return{width:Math.max(1,Math.floor(r.width*i)),height:Math.max(1,Math.floor(r.height*i))}},R3=async(e,t,r)=>{const i=r.URL.createObjectURL(new r.Blob([e],{type:"image/svg+xml;charset=utf-8"}));try{const o=new r.Image;o.src=i,await o.decode();const s=O3({width:o.naturalWidth,height:o.naturalHeight},t);if(s===null)throw new Error("[@aiquants/markdown] the SVG image has no size to draw at");const a=r.document.createElement("canvas");a.width=s.width,a.height=s.height;const n=a.getContext("2d");if(n===null)throw new Error("[@aiquants/markdown] the browser gave no 2D canvas to draw the SVG image on");return n.drawImage(o,0,0,s.width,s.height),await new Promise((l,c)=>{a.toBlob(h=>h===null?c(new Error("[@aiquants/markdown] the canvas could not encode the SVG image as a PNG")):l(h),"image/png")})}finally{r.URL.revokeObjectURL(i)}},I3=e=>/\.[Ss][Vv][Gg]$/u.test(e),Gx=e=>{const t=L.useRef(e);L.useLayoutEffect(()=>{t.current=e});const r=e!==void 0;return L.useMemo(()=>{if(r)return{read:(i,o)=>{const s=t.current;return s===void 0?Promise.reject(new Error("[@aiquants/markdown] the image source stand-in was called after its reader was removed")):s.read(i,o)}}},[r])},Cn="data-aqmd-svg-image-control",P3=Object.freeze(["copy","source"]),D3=Object.freeze(["source"]),N3=Object.freeze({kind:"failure",retryable:!0}),tu=(e,t,r)=>new Promise(i=>i(e.read(t,r))),q3=({paragraph:e,image:t,path:r,name:i,reader:o,labels:s})=>{const{[Mi.SOURCE_LINES_ATTRIBUTE]:a,...n}=e,[l,c]=L.useState(!1),[h,d]=L.useState(0),[f,u]=L.useState(null),[g,m]=L.useState(null),y=L.useId(),x=L.useId(),C=L.useRef(null),w=L.useRef(null),S=L.useRef(null);L.useEffect(()=>()=>w.current?.abort(),[]),L.useEffect(()=>{if(!l)return;const O=new AbortController;return tu(o,r,O.signal).then(F=>{O.signal.aborted||u({read:h,answer:F})},F=>{O.signal.aborted||(console.error("[@aiquants/markdown] the image source reader failed without an abort",F),u({read:h,answer:N3}))}),()=>O.abort()},[l,h,r,o]);const v=l&&f!==null&&f.read===h?f.answer:null,_=v!==null&&v.kind==="text"&&!v.truncated?v.text:null,E=!l||_!==null,{onKeyDown:B,onFocus:D,tabIndexOf:M}=Hh(E?P3:D3,Cn),P=O=>{m(F=>({text:s[O].text,lang:s[O].lang,serial:F===null?1:F.serial+1}))},U=()=>{if(m(null),l){c(!1);return}d(O=>O+1),c(!0)},N=()=>{C.current?.focus(),d(O=>O+1)},q=(O,F)=>{const R=O.currentTarget.ownerDocument.defaultView?.navigator.clipboard;if(R===void 0){P("copyFailed");return}R.writeText(F).then(()=>P("copied"),z=>{console.error("[@aiquants/markdown] could not copy the image source",z),P("copyFailed")})},A=O=>{const F=O.currentTarget.ownerDocument.defaultView,R=F?.navigator.clipboard;if(F===null||R===void 0||typeof F.ClipboardItem!="function"||typeof R.write!="function"){P("copyImageFailed");return}const z=S.current,T=z===null?null:z.querySelector("img"),W=T===null?null:T.getBoundingClientRect(),j=W===null?{width:0,height:0}:{width:W.width,height:W.height};w.current?.abort();const G=new AbortController;w.current=G;let X=!1;const K=tu(o,r,G.signal).then(Z=>{if(Z.kind!=="text"||Z.truncated)throw X=!0,new Error("[@aiquants/markdown] the SVG image cannot be copied whole");return R3(Z.text,j,F).catch(at=>{throw X=!0,console.error("[@aiquants/markdown] could not draw the SVG image as a PNG",at),at})},Z=>{throw X=!0,G.signal.aborted||console.error("[@aiquants/markdown] the image source reader failed without an abort",Z),Z});K.catch(()=>{}),R.write([new F.ClipboardItem({"image/png":K})]).then(()=>{G.signal.aborted||P("copiedImage")},Z=>{G.signal.aborted||(X||console.error("[@aiquants/markdown] could not copy the SVG image",Z),P("copyImageFailed"))})};let $;return l?v===null?$=k.jsx("p",{"data-aqmd-svg-image-loading":"",lang:s.loading.lang,children:s.loading.text}):v.kind==="failure"?$=k.jsxs("div",{"data-aqmd-svg-image-error":"",className:"flex flex-col items-start gap-2 rounded border p-4",children:[k.jsx("p",{lang:s.failed.lang,children:s.failed.text}),v.retryable&&k.jsxs("button",{type:"button","data-aqmd-svg-image-retry":"",onClick:N,lang:s.retry.lang,className:"inline-flex min-h-11 cursor-pointer items-center gap-1.5 rounded px-3 py-1 font-medium text-sm",children:[k.jsx(Tn,{className:"h-4 w-4"}),s.retry.text]})]}):$=k.jsxs(k.Fragment,{children:[k.jsx("span",{id:x,hidden:!0,lang:s.sourceRegion.lang,children:It.fillLabel(s.sourceRegion.text,{name:i})}),k.jsx("pre",{"data-aqmd-svg-image-source":"",tabIndex:0,role:"region","aria-labelledby":x,children:k.jsx("code",{children:v.text})}),v.truncated&&k.jsx("p",{"data-aqmd-svg-image-truncated":"",lang:s.truncated.lang,children:s.truncated.text})]}):$=k.jsx("p",{ref:S,...St.attributesToProps(n,"p"),children:t}),k.jsxs("div",{"data-aqmd-svg-image":"","data-aqmd-svg-image-view":l?"source":"image","data-source-lines":a,children:[k.jsx("span",{id:y,hidden:!0,lang:s.toolbar.lang,children:s.toolbar.text}),k.jsxs("div",{"data-aqmd-svg-image-toolbar":"",role:"toolbar","aria-labelledby":y,onKeyDown:B,onFocus:D,className:"mb-1 flex flex-wrap items-center justify-end gap-1",children:[E&&k.jsx("button",{type:"button",[Cn]:"copy",tabIndex:M("copy"),onClick:O=>_===null?A(O):q(O,_),className:Vr,"aria-label":_===null?s.copyImage.text:s.copy.text,lang:_===null?s.copyImage.lang:s.copy.lang,children:k.jsx(Rx,{size:18})}),k.jsx("button",{ref:C,type:"button",[Cn]:"source",tabIndex:M("source"),"aria-pressed":l,onClick:U,className:Vr,"aria-label":s.source.text,lang:s.source.lang,children:k.jsx(M3,{size:20})})]}),$,k.jsx("p",{"data-aqmd-svg-image-notice":"",role:"status",children:g!==null&&k.jsx("span",{lang:g.lang,children:g.text},g.serial)})]})},Ia=Object.freeze({toolbar:{text:"SVG image",lang:"en"},source:{text:"Source",lang:"en"},sourceRegion:{text:"Source of {name}",lang:"en"},loading:{text:"Loading the source…",lang:"en"},failed:{text:"The source could not be read.",lang:"en"},retry:{text:"Try again",lang:"en"},truncated:{text:"Only the beginning of this file is shown.",lang:"en"},copy:{text:"Copy the source",lang:"en"},copied:{text:"Copied the source.",lang:"en"},copyFailed:{text:"Could not copy the source.",lang:"en"},copyImage:{text:"Copy the image",lang:"en"},copiedImage:{text:"Copied the image.",lang:"en"},copyImageFailed:{text:"Could not copy the image.",lang:"en"}}),z3=aa(Ia),j3=({alt:e,target:t,label:r})=>k.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:[k.jsx(ZC,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),k.jsxs("span",{className:"min-w-0",children:[k.jsx("span",{className:"font-medium",children:e?`${r} (${e})`:r}),t&&k.jsx("span",{className:"ml-2 break-all font-mono text-xs dark:text-gray-300",children:t})]})]}),W3=(e,t,r)=>{const{src:i,alt:o,"data-asset-exists":s,"data-asset-src":a}=e.attribs;if(!i||i.trim()===""||s==="false")return k.jsx(j3,{alt:o,target:a,label:t});const n=r.rendered===0;return r.rendered+=1,k.jsx("img",{alt:"",...St.attributesToProps({loading:n?"eager":"lazy",decoding:"async",...e.attribs})})},No=e=>e.map(t=>t instanceof St.Text?t.data:t instanceof St.Element?No(t.children):"").join(""),H3=(e,t)=>e.map(r=>{if(r instanceof St.Text)return{kind:"text",text:r.data};if(!(r instanceof St.Element))return{kind:"ignored"};if(r.name.toLowerCase()!=="a")return{kind:"element"};const i=la(r.name,r.attribs,{parentName:"p",iFrameAllowedDomains:t});return{kind:"link",href:i.action==="keep"?i.attributes.href??null:null}}),Y3=(e,t,r,i)=>{const o=e.children,s=mr.placeholderLinkOf(t,H3(o,i.iFrameAllowedDomains));if(s===null)return;const a=St.domToReact(o,r),n=k.jsx("p",{...St.attributesToProps(e.attribs,"p"),children:a}),l=o.find(f=>f instanceof St.Element),c=i.embeds.linkCardEndpoint,h=c!==null&&l!==void 0&&mr.isBareLink(No(l.children),s)?k.jsx(yb,{href:t,endpoint:c,size:We.linkCardSizeOf(i.embeds),fallback:n}):n,d=jr.resolveEmbed(s,i.embeds.providers);return d===null?h:k.jsx(_b,{resolution:d,caption:a,fallback:h,theme:i.theme,labels:i.embedLabels})},U3=(e,t)=>{if(Hx(e))return null;const r=e.children.filter(c=>!(c instanceof St.Text&&Fl.test(c.data))),[i]=r;if(r.length!==1||!(i instanceof St.Element)||i.name.toLowerCase()!=="img")return null;const o=la(i.name,i.attribs,{parentName:"p",iFrameAllowedDomains:t});if(o.action!=="keep")return null;const{src:s,alt:a,"data-asset-src":n,"data-asset-exists":l}=o.attributes;return n===void 0||!I3(n)||s===void 0||s.trim()===""||l==="false"?null:{node:i,path:n,name:a!==void 0&&a.trim()!==""?a:n.slice(n.lastIndexOf("/")+1)}},G3={lowerCaseAttributeNames:!1},eu=2166136261,ru=16777619,Fl=/^[\t\n\f\r ]*$/u,X3=`language-${It.SPREADSHEETS_LANGUAGE}`,Xx=e=>e.name==="code"&&(e.attribs.class??"").split(/[\t\n\f\r ]+/u).includes(X3),V3=e=>{let t=eu,r=eu;const i=(s,a)=>{for(let n=0;n<s.length;n+=1){const l=s.charCodeAt(n);r=Math.imul(r^l,ru),a&&(t=Math.imul(t^l,ru))}},o=(s,a)=>{if(s instanceof St.Text)i("",a),i(s.data,a);else if(s instanceof St.Element){i("",a),i(s.name,a);for(const[l,c]of Object.entries(s.attribs))l!==Mi.SOURCE_LINES_ATTRIBUTE&&(i("",a),i(l,a),i("",a),i(c,a));i("",a);const n=a&&!Xx(s);for(const l of s.children)o(l,n);i("",a)}else i("\x07",a),i(s.data,a)};return o(e,!0),{fingerprint:(t>>>0).toString(36),content:(r>>>0).toString(36)}},K3=(e,t,r,i)=>{if(e==="")return{nodes:[],keys:[]};const o=St.htmlToDOM(e,G3),s=o.filter(l=>!(l instanceof St.Text&&Fl.test(l.data))),a=rb(s.map(V3),r);let n=0;return{nodes:o.map(l=>{if(l instanceof St.Text&&Fl.test(l.data))return l.data;const{key:c,content:h}=a[n];return n+=1,k.jsx(QC,{content:h,label:i,text:()=>No([l]),children:St.domToReact([l],t)},c)}),keys:a}},Vx=({htmlContent:e,theme:t="light",iFrameAllowedDomains:r=[],embeds:i=We.NO_EMBEDS,embedLabels:o,mermaidInteraction:s,mermaidLabels:a,spreadsheetEditor:n,spreadsheetLocale:l,spreadsheetLabels:c,linkComponent:h,missingImageLabel:d="Image not found",blockFailedLabel:f,imageSource:u,svgImageLabels:g,onMathDiagnostics:m})=>{pu(i);const y=hu(o),x=Px(n),C=Gx(u),w=L.useMemo(()=>Oi(Ia,g),[g]),{blockFailed:S}=Oi(fu,{blockFailed:f}),v={rendered:0},_=[],E=L.useRef(null),B=L.useEffectEvent(N=>{m?.(N)}),D=Ux({iFrameAllowedDomains:r,embedLabels:y,linkComponent:h,renderPlaceholder:(N,q,A)=>Y3(N,q,A,{embeds:i,theme:t,embedLabels:y,iFrameAllowedDomains:r}),renderKept:(N,q)=>{if(N.name==="p"&&C!==void 0){const A=U3(N,r);if(A!==null)return k.jsx(q3,{paragraph:N.attribs,image:St.domToReact([A.node],q),path:A.path,name:A.name,reader:C,labels:w})}if(N.name==="pre"&&N.children.length===1){const A=N.children[0];if(A instanceof St.Element&&A.name==="code"){const $=A.attribs.class??"",O=No(A.children),F=N.attribs[Mi.SOURCE_LINES_ATTRIBUTE];return Xx(A)?k.jsx(Gh,{tsv:O,meta:A.attribs[It.CODE_META_ATTRIBUTE],sourceLines:F,editor:x,locale:l,labels:c}):$.includes("language-mermaid")?k.jsx(Yh,{chartContent:O,interaction:s,labels:a,sourceLines:F}):k.jsx(Xh,{lang:$.replace("language-",""),code:O,theme:t,sourceLines:F})}}if(N.name==="img")return W3(N,d,v);if(N.name==="span"&&N.attribs.class?.includes("math")){const A=N.attribs.class.includes("display");let $=No(N.children).trim();A?$=$.replace(/^\\\[/,"").replace(/\\\]$/,""):$=$.replace(/^\\\(/,"").replace(/\\\)$/,"");try{const{html:O,diagnostics:F}=Ox($,A);return _.push(...F),A?k.jsxs("span",{className:"group relative block",children:[k.jsx(qx,{code:$}),k.jsx("span",{dangerouslySetInnerHTML:{__html:O}})]}):k.jsx("span",{dangerouslySetInnerHTML:{__html:O}})}catch(O){console.error("Failed to render math:",O);return}}}}),M=L.useRef([]),{nodes:P,keys:U}=K3(e,D,M.current,S);return L.useEffect(()=>{M.current=U},[U]),L.useEffect(()=>{E.current!==e&&(E.current=e,_.length>0&&B(_))},[e,_]),k.jsx("div",{className:"markdown-body","data-theme":t,children:P})};const Z3=[["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"}]],Q3=Tt("triangle-alert",Z3);const J3=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],t$=Tt("text-align-center",J3);const e$=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],r$=Tt("text-align-start",e$);const i$=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],o$=Tt("text-align-end",i$);const s$=[["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"}]],a$=Tt("list",s$);const n$=[["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"}]],l$=Tt("palette",n$);const h$=[["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"}]],c$=Tt("pin",h$);const d$=[["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"}]],u$=Tt("pin-off",d$),f$=e=>`#${e.id}`,g$=e=>{let t=Number.POSITIVE_INFINITY;for(const r of e)r.depth<t&&(t=r.depth);return t},iu="block truncate py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Kx=({headings:e,className:t="",onHeadingSelect:r,headingHref:i=f$,label:o,labelledBy:s})=>{if(e.length===0)return null;const a=g$(e);return k.jsx("nav",{className:`toc ${t}`,"aria-label":o,"aria-labelledby":s,children:k.jsx("ul",{className:"m-0 list-none p-0",children:e.map((n,l)=>{const c=n.id===""?null:i(n);return k.jsx("li",{style:{paddingLeft:`${(n.depth-a)*1}rem`},children:c===null?k.jsx("span",{className:`${iu} text-gray-600 dark:text-gray-300`,title:n.text,children:n.text}):k.jsx("a",{href:qo(c)?c:void 0,className:`${iu} 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)})})})},bn="--aqmd-toolbar-block-overlap",p$=({toolbar:e,content:t,scrollportTop:r,scrollportBottom:i})=>{if(e.width<=0||e.height<=0)return 0;const o=e.left<t.right&&e.right>t.left,s=e.top<r+e.height&&e.top<i,a=e.bottom-r;return o&&s&&a>0?Math.ceil(a):0},Zx=e=>`mermaid${e.charAt(0).toUpperCase()}${e.slice(1)}`,Qx=Object.keys(Ra),m$=e=>`spreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`,y$=Object.keys(It.SPREADSHEET_BLOCK_LABEL_CATALOGS.en),Jx=e=>`svgImage${e.charAt(0).toUpperCase()}${e.slice(1)}`,tC=Object.keys(Ia),eC=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"},...fu,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(Qx.map(e=>[Zx(e),Ra[e]])),...Object.fromEntries(tC.map(e=>[Jx(e),Ia[e]])),...na}),x$=aa(eC),C$=e=>Oi(eC,e),b$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of Qx){const i=e[Zx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},k$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of y$){const i=e[m$(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},w$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of tC){const i=e[Jx(r)];i!==void 0&&(t[r]=i)}return Object.freeze(t)},S$=Object.keys(na),v$=e=>{const t={};if(e===void 0)return Object.freeze(t);for(const r of S$){const i=e[r];i!==void 0&&(t[r]=i)}return Object.freeze(t)},ou=Object.freeze({left:{labelKey:"alignLeft",Icon:r$},center:{labelKey:"alignCenter",Icon:t$},right:{labelKey:"alignRight",Icon:o$}}),T$=Object.freeze({text:"ファイルを選択してください。",lang:"ja"}),_$="100%",B$=e=>e==="center"?"auto":e==="right"?"auto 0":"0 auto",Al="24px",rC=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"}),L$=rC(Al),E$=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"}),F$=e=>`calc(100cqi - var(--aqmd-toolbar-inset-inline-end, 0px) - ${e})`,A$=8,su=800,M$=16,$$=(e,t)=>{const r=e.defaultView;let i;const o=()=>{e.removeEventListener("click",s,!0),e.removeEventListener("pointercancel",a,!0),i!==void 0&&r?.clearTimeout(i)};function s(n){o(),!(n.timeStamp-t.timeStamp>su||Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY)>M$)&&(n.preventDefault(),n.stopPropagation())}function a(n){n.pointerId===t.pointerId&&o()}e.addEventListener("click",s,!0),e.addEventListener("pointercancel",a,!0),i=r?.setTimeout(o,su)},O$=(e,t,r)=>{const[i,o]=L.useState(null);return L.useLayoutEffect(()=>{const s=t.current;if(!e||s===null||r===null){o(null);return}const a=s.ownerDocument.defaultView;let n=0;const l=()=>{n=0;const d=s.getBoundingClientRect(),f=s.offsetHeight>0?d.height/s.offsetHeight:1,u=a?.visualViewport??null,g=u===null?Number.POSITIVE_INFINITY:u.offsetTop+u.height,m=Math.min(r.getBoundingClientRect().bottom,g);o(Math.max(0,Math.floor((m-d.top)/f-A$)))},c=()=>{a!==null&&n===0&&(n=a.requestAnimationFrame(l))};l();const h=new ResizeObserver(c);return h.observe(r),a?.addEventListener("resize",c),a?.visualViewport?.addEventListener("resize",c),a?.visualViewport?.addEventListener("scroll",c),s.ownerDocument.addEventListener("scroll",c,!0),()=>{a!==null&&n!==0&&a.cancelAnimationFrame(n),h.disconnect(),a?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("resize",c),a?.visualViewport?.removeEventListener("scroll",c),s.ownerDocument.removeEventListener("scroll",c,!0)}},[e,t,r]),i};function kn({menu:e,Icon:t,buttonLabel:r,titleLabel:i,titleId:o,pinLabel:s,unpinLabel:a,isOpen:n,isPinned:l,isFront:c,onActivate:h,onToggle:d,onClose:f,onPinToggle:u,popoverClassName:g,scrollBarClearance:m,boundary:y,renderBody:x}){const C=L.useRef(null),w=L.useRef(null),S=L.useRef(null),v=O$(n,S,y),_=L.useCallback(()=>{d(),h()},[h,d]),E=L.useCallback(()=>{if(l)return;const D=C.current?.contains(document.activeElement)===!0;f(),D&&w.current?.focus()},[l,f]);L.useEffect(()=>{if(!n||l)return;const D=C.current;if(D===null)return;const M=U=>{D.contains(U.target)||(f(),U.pointerType==="touch"&&!(U.target instanceof Element&&U.target.closest("[data-aqmd-toolbar]")!==null)&&$$(D.ownerDocument,U))},P=U=>{U.key!=="Escape"||U.defaultPrevented||U.isComposing||(U.preventDefault(),f(),w.current?.focus())};return document.addEventListener("pointerdown",M),D.addEventListener("keydown",P),()=>{document.removeEventListener("pointerdown",M),D.removeEventListener("keydown",P)}},[n,l,f]);const B=l?a:s;return k.jsxs("div",{ref:C,"data-aqmd-toolbar-menu":e,children:[k.jsx("button",{ref:w,type:"button",className:"pointer-events-auto rounded-full border border-gray-200 bg-white p-3 shadow-lg transition-colors hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700",onClick:_,"aria-label":r.text,lang:r.lang,"aria-expanded":n,children:k.jsx(t,{className:"h-5 w-5 text-gray-600 dark:text-gray-300"})}),n&&k.jsxs("div",{ref:S,"data-aqmd-toolbar-popover":e,className:`pointer-events-auto absolute end-0 top-full mt-2 box-border overflow-y-auto overscroll-contain rounded-lg border border-gray-200 bg-white shadow-xl dark:border-gray-700 dark:bg-gray-800 ${g}`,style:{zIndex:c?2:1,maxInlineSize:F$(m),maxBlockSize:v??void 0},children:[k.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[k.jsx("h3",{id:o,lang:i.lang,className:"px-2 font-bold text-gray-600 text-sm uppercase tracking-wider dark:text-gray-300",children:i.text}),k.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":B.text,lang:B.lang,children:l?k.jsx(c$,{className:"h-4 w-4"}):k.jsx(u$,{className:"h-4 w-4"})})]}),x(E)]})]})}const R$=(e,t,r,i)=>{const[o,s]=L.useState(0),a=L.useRef(null);return L.useLayoutEffect(()=>{const n=e.current,l=t.current;if(r===null||n===null||l===null){a.current=null,s(0);return}const c=()=>{const g=n.getBoundingClientRect();s(p$({toolbar:r.getBoundingClientRect(),content:l.getBoundingClientRect(),scrollportTop:g.top+n.clientTop,scrollportBottom:g.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]),L.useLayoutEffect(()=>{a.current?.()},[i]),o},I$=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,P$=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},D$=L.memo(function({parseResult:t,theme:r,styleClassName:i,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:f,spreadsheetLabels:u,imageSource:g,svgImageLabels:m,onMathDiagnostics:y}){return k.jsx("div",{className:"w-full min-w-0",children:k.jsx("div",{className:i,"data-theme":r,children:k.jsx(Vx,{htmlContent:t.htmlContent,theme:r,iFrameAllowedDomains:o,embeds:s,embedLabels:a,linkComponent:n,missingImageLabel:l,blockFailedLabel:c,mermaidLabels:h,spreadsheetEditor:d,spreadsheetLocale:f,spreadsheetLabels:u,imageSource:g,svgImageLabels:m,onMathDiagnostics:y})})})});function iC(){const[e,t]=L.useState("toc"),[r,i]=L.useState(!1),[o,s]=L.useState(!1),[a,n]=L.useState(!1),[l,c]=L.useState(!1),[h,d]=L.useState(!1),[f,u]=L.useState(!1),g=L.useCallback(()=>t("toc"),[]),m=L.useCallback(()=>i(M=>!M),[]),y=L.useCallback(()=>i(!1),[]),x=L.useCallback(()=>c(M=>!M),[]),C=L.useCallback(()=>t("style"),[]),w=L.useCallback(()=>s(M=>!M),[]),S=L.useCallback(()=>s(!1),[]),v=L.useCallback(()=>d(M=>!M),[]),_=L.useCallback(()=>t("align"),[]),E=L.useCallback(()=>n(M=>!M),[]),B=L.useCallback(()=>n(!1),[]),D=L.useCallback(()=>u(M=>!M),[]);return{lastActiveMenu:e,isTocOpen:r,isStyleOpen:o,isAlignOpen:a,isTocPinned:l,isStylePinned:h,isAlignPinned:f,activateToc:g,toggleToc:m,closeToc:y,togglePinToc:x,activateStyle:C,toggleStyle:w,closeStyle:S,togglePinStyle:v,activateAlign:_,toggleAlign:E,closeAlign:B,togglePinAlign:D}}const N$=({error:e,labels:t})=>{if(L.isValidElement(e))return k.jsx("div",{className:"p-4",children:e});if(typeof e=="object"&&e!==null&&"message"in e){const i=e,o=i.title!==void 0&&i.title!=="";return k.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:k.jsxs("div",{className:"flex items-start gap-3",children:[k.jsx("div",{className:"rounded-lg bg-red-100 p-2 text-red-600 dark:bg-red-900/50 dark:text-red-400",children:k.jsx(Q3,{className:"h-5 w-5"})}),k.jsxs("div",{className:"min-w-0 flex-1",children:[k.jsxs("div",{className:"flex items-center justify-between gap-2",children:[k.jsx("h3",{lang:o?void 0:t.defaultErrorTitle.lang,className:"font-semibold text-base text-red-900 dark:text-red-200",children:o?i.title:t.defaultErrorTitle.text}),i.status&&k.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})]}),k.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 k.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:k.jsxs("p",{className:"font-medium text-red-700 text-sm dark:text-red-300",children:[k.jsx("span",{lang:t.errorPrefix.lang,children:t.errorPrefix.text}),r]})})};function q$({parseResult:e,content:t,error:r=null,isLoading:i=!1,labels:o,theme:s,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:g,maxWidth:m,padding:y=16,iFrameAllowedDomains:x,embeds:C=We.NO_EMBEDS,emptyMessage:w,toolbar:S,linkComponent:v,onHeadingSelect:_,headingHref:E,onMathDiagnostics:B,spreadsheetEditor:D,spreadsheetLocale:M,imageSource:P,renderScrollBar:U}){const N=L.useRef(null),[q,A]=L.useState(null),$=L.useCallback(Mt=>{N.current=Mt,A(Mt)},[]),[O,F]=L.useState(0),R=L.useRef(null),[z,T]=L.useState(null),W=L.useRef(null),j=L.useId(),G=iC(),X=S??G,K=L.useMemo(()=>C$(o),[o]),Z=L.useMemo(()=>b$(o),[o]),at=L.useMemo(()=>k$(o),[o]),mt=L.useMemo(()=>w$(o),[o]),ht=Gx(P),ct=Px(D);pu(C);const _t=jr.EMBED_PROVIDER_IDS.filter(Mt=>C.providers.includes(Mt)).join(" "),Ct=C.linkCardEndpoint,Et=C.linkCardSize,Nt=L.useMemo(()=>{const Mt=_t.split(" "),Bt=Object.freeze(jr.EMBED_PROVIDER_IDS.filter(le=>Mt.includes(le)));return Object.freeze(Et===void 0?{providers:Bt,linkCardEndpoint:Ct}:{providers:Bt,linkCardEndpoint:Ct,linkCardSize:Et})},[_t,Ct,Et]),Gt=o?.embeddedVideo,te=o?.embeddedPost,xe=o?.embeddedFrame,_e=L.useMemo(()=>v$({embeddedVideo:Gt,embeddedPost:te,embeddedFrame:xe}),[Gt,te,xe]),Ft=L.useRef(B);L.useLayoutEffect(()=>{Ft.current=B},[B]);const wt=L.useCallback(Mt=>{Ft.current?.(Mt)},[]),Be=w===void 0?T$:{text:w,lang:void 0},Qr=R$(N,R,z,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 hr=Number.isFinite(y)&&y>=0?y:16,vr=L.useCallback(Mt=>{const Bt=N.current;if(Bt){const le=Bt.querySelector("[data-theme]"),Ht=Bt.getBoundingClientRect(),ee=le?.children;let Ne=-1,ri=Number.POSITIVE_INFINITY;if(ee)for(let dr=0;dr<ee.length;dr+=1){const Br=ee[dr],Q=Math.abs(Br.getBoundingClientRect().top-Ht.top);Q<ri&&(ri=Q,Ne=dr)}if(ee&&Ne>=0){const Br=ee[Ne].getBoundingClientRect();W.current={childIndex:Ne,offset:Br.top-Ht.top}}else W.current=null}n(Mt)},[n]);L.useLayoutEffect(()=>{const Mt=W.current;if(!Mt)return;W.current=null;const Bt=N.current;if(!Bt)return;const Ht=Bt.querySelector("[data-theme]")?.children[Mt.childIndex];if(!Ht)return;const ee=Bt.getBoundingClientRect(),ri=Ht.getBoundingClientRect().top-ee.top;Bt.scrollTop+=ri-Mt.offset});const{isTocPinned:De,closeToc:Le}=X,Tr=L.useCallback((Mt,Bt)=>{if(De||Le(),_?.(Mt,Bt)===!0)return;Bt.preventDefault();const Ht=N.current?.querySelector(`#${CSS.escape(Mt.id)}`)??document.getElementById(Mt.id);Ht&&(P$(Ht),Ht.tabIndex<0&&!Ht.hasAttribute("tabindex")&&Ht.setAttribute("tabindex","-1"),Ht.scrollIntoView({behavior:I$()?"instant":"smooth",block:"start"}),Ht.focus({preventScroll:!0}))},[Le,De,_]),Jr=L.useMemo(()=>l.find(Bt=>Bt.name===a)?.className??"markdown-body",[l,a]),Ce=e?.headings??[],Ze=!(i||r),cr=Ze&&e!==null,ti=Ze&&e===null&&t!==null,_r=cr&&d&&Ce.length>0,J=cr&&f,xt=(cr||ti)&&u&&typeof h=="function"&&(g!==void 0||m!==void 0),Pt=L.useMemo(()=>k.jsx(Kx,{headings:Ce,className:"text-sm",labelledBy:j,onHeadingSelect:Tr,headingHref:E}),[Ce,j,Tr,E]),At=U===void 0?Al:`${O}px`,Zi=L.useMemo(()=>At===Al?L$:rC(At),[At]),ei=_r||J||xt?k.jsxs("div",{ref:T,"data-aqmd-toolbar":!0,style:Zi,children:[k.jsx("span",{"data-aqmd-toolbar-inset-probe":!0,"aria-hidden":"true",style:E$}),xt&&h&&k.jsx(kn,{menu:"align",Icon:ou[c].Icon,buttonLabel:K.selectAlignAria,titleLabel:K.alignTitle,pinLabel:K.pinAlignAria,unpinLabel:K.unpinAlignAria,isOpen:X.isAlignOpen,isPinned:X.isAlignPinned,isFront:X.lastActiveMenu==="align",onActivate:X.activateAlign,onToggle:X.toggleAlign,onClose:X.closeAlign,onPinToggle:X.togglePinAlign,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:q,renderBody:Mt=>k.jsx("div",{className:"space-y-1",children:Qi.CONTENT_ALIGNS.map(Bt=>{const{labelKey:le,Icon:Ht}=ou[Bt],ee=K[le],Ne=c===Bt;return k.jsxs("button",{type:"button","aria-pressed":Ne,lang:ee.lang,className:`flex min-h-11 w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors ${Ne?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{h(Bt),Mt()},children:[k.jsx(Ht,{className:"h-4 w-4"}),ee.text]},Bt)})})}),J&&k.jsx(kn,{menu:"style",Icon:l$,buttonLabel:K.selectStyleAria,titleLabel:K.styleTitle,pinLabel:K.pinStyleAria,unpinLabel:K.unpinStyleAria,isOpen:X.isStyleOpen,isPinned:X.isStylePinned,isFront:X.lastActiveMenu==="style",onActivate:X.activateStyle,onToggle:X.toggleStyle,onClose:X.closeStyle,onPinToggle:X.togglePinStyle,popoverClassName:"w-48 p-2",scrollBarClearance:At,boundary:q,renderBody:Mt=>k.jsx("div",{className:"space-y-1",children:l.map(Bt=>{const le=a===Bt.name;return k.jsx("button",{type:"button","aria-pressed":le,className:`min-h-11 w-full rounded px-2 py-1 text-left text-sm transition-colors ${le?"bg-blue-100 font-medium text-blue-800 dark:bg-blue-900 dark:text-blue-200":"text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700"}`,onClick:()=>{vr(Bt.name),Mt()},children:Bt.name},Bt.name)})})}),_r&&k.jsx(kn,{menu:"toc",Icon:a$,buttonLabel:K.openTocAria,titleLabel:K.tocTitle,titleId:j,pinLabel:K.pinTocAria,unpinLabel:K.unpinTocAria,isOpen:X.isTocOpen,isPinned:X.isTocPinned,isFront:X.lastActiveMenu==="toc",onActivate:X.activateToc,onToggle:X.toggleToc,onClose:X.closeToc,onPinToggle:X.togglePinToc,popoverClassName:"markdown-viewer-scrollbar-thin w-64 p-4",scrollBarClearance:At,boundary:q,renderBody:()=>Pt})]}):null,Pa=()=>i?k.jsxs("p",{children:[k.jsx("span",{"aria-hidden":"true",children:"🌀"})," ",k.jsx("span",{lang:K.loading.lang,children:K.loading.text})]}):r?k.jsx(N$,{error:r,labels:K}):e?k.jsx("div",{className:"relative w-full min-w-0",children:k.jsx(D$,{parseResult:e,theme:s,styleClassName:Jr,iFrameAllowedDomains:x,embeds:Nt,embedLabels:_e,linkComponent:v,missingImageLabel:K.missingImage.text,blockFailedLabel:o?.blockFailed,mermaidLabels:Z,spreadsheetEditor:ct,spreadsheetLocale:M,spreadsheetLabels:at,imageSource:ht,svgImageLabels:mt,onMathDiagnostics:wt})}):t!==null?k.jsx("pre",{className:"whitespace-pre-wrap break-all",children:t}):k.jsx("p",{lang:Be.lang,children:Be.text}),Da={containerType:"inline-size",paddingInline:`${hr}px`,paddingBlockEnd:`${hr}px`,paddingBlockStart:`calc(${hr}px + var(${bn}))`,scrollPaddingBlockStart:`var(${bn})`,[bn]:`${Qr}px`};return k.jsxs(du,{scrollerRef:$,scrollerProps:{"data-testid":"viewer","data-aqmd-scroll-container":!0,className:"grid h-full w-full overflow-x-auto overflow-y-auto *:min-w-0",style:Da},renderScrollBar:U,onBarInlineSizeChange:F,children:[ei,k.jsx("div",{ref:R,"data-aqmd-content":!0,style:{width:g??_$,maxWidth:m,marginInline:B$(c)},children:Pa()})]})}const oC=({node:e})=>k.jsx("del",{children:k.jsx(Wt,{nodes:e.children})}),sC=({node:e})=>k.jsx("em",{children:k.jsx(Wt,{nodes:e.children})}),aC=({node:e})=>k.jsx("sup",{children:k.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,"]"]})}),z$=({nodes:e,theme:t="light"})=>e.length===0?null:k.jsx("section",{className:"border-[#171717] border-t pt-4 dark:border-[#464646]",children:k.jsx("ol",{className:"pl-6 text-[#686868] text-sm dark:text-[#a4a5a9]",children:e.map((r,i)=>k.jsx("li",{id:`fn-${r.identifier}`,className:i===0?"":"mt-4",children:k.jsx(Wt,{nodes:r.children,theme:t})},`mdast-node-fn-${r.identifier}-${i}`))})}),nC=({node:e})=>k.jsx("a",{href:e.url,className:"text-[#316dce] underline visited:text-[#6b46c1] dark:text-[#3182ce] dark:visited:text-[#805ad5]",children:"↩"}),j$=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,(o,s)=>{const a=Number(s);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/&#x([0-9a-f]+);/gi,(o,s)=>{const a=Number.parseInt(s,16);return Number.isFinite(a)?String.fromCodePoint(a):""}).replace(/\s+/g," ").trim(),lC=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"?j$(i):""}if("value"in r){const i=r.value;if(typeof i=="string")return i}return"children"in r&&Array.isArray(r.children)?r.children.map(i=>t(i)).join(""):""};return e.map(r=>t(r)).join("").replace(/\s+/g," ").trim()},W$=e=>{switch(e){case 1:return"border-b-2 border-gray-300 pb-2 text-3xl font-bold dark:border-gray-600 dark:text-gray-100";case 2:return"border-b border-gray-300 pb-2 text-2xl font-semibold dark:border-gray-600 dark:text-gray-200";case 3:return"text-xl font-semibold dark:text-gray-300";default:return"text-lg font-medium dark:text-gray-400"}},hC=({node:e})=>{const t=new FC,r=`h${e.depth}`,i=e.data?.hProperties?.id,o=t.slug(lC(e.children));return k.jsx(r,{id:i||o,className:W$(e.depth),children:k.jsx(Wt,{nodes:e.children})})},H$=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==!1).map(([t,r])=>[t,r===!0?"":String(r)])),Y$=({node:e,theme:t,iFrameAllowedDomains:r=[]})=>{const i=k.jsx(Wt,{nodes:e.children,theme:t,iFrameAllowedDomains:r}),o=la(e.data.tagName,H$(e.data.properties),{parentName:null,iFrameAllowedDomains:r});if(o.action==="unwrap")return i;if(o.action!=="keep"&&o.action!=="placeholder")return null;const s=e.data.tagName.toLowerCase();return k.jsx(s,{...St.attributesToProps(o.attributes,e.data.tagName.toLowerCase()),children:i})},U$=/^\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,G$=({node:e,iFrameAllowedDomains:t=[]})=>{const r=St(e.value,Ux({iFrameAllowedDomains:t,embedLabels:$C}));return Array.isArray(r)&&r.length===0?null:U$.test(e.value)?k.jsx("div",{children:r}):k.jsx("span",{children:r})},cC=({node:e})=>{if(!e.url||e.url.trim()===""||!qo(e.url))return null;const t=e.title??"",r=e.data?.hProperties?.width,i=e.data?.hProperties?.height;return k.jsxs("span",{style:{width:r,height:i},className:"mt-4 mb-4 inline-block w-fit max-w-full",children:[k.jsx("img",{src:e.url,alt:e.alt??"",className:"mx-auto h-full w-full",width:r,height:i}),t&&k.jsx("em",{className:"block text-center text-gray-400 text-xs",children:t})]})},dC=({node:e})=>k.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}),X$=({node:e})=>{const t=zx(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"?k.jsx("span",{className:r,dangerouslySetInnerHTML:{__html:t.html}}):k.jsx("span",{className:r,children:t.message})},V$=new RegExp(`<(?:${[...Vh].join("|")})(?=[\\s/>])`,"i"),uC=e=>e.some(t=>t.type==="image"||t.type==="imageReference"||t.type==="html"&&typeof t.value=="string"&&V$.test(t.value)||t.children!==void 0&&uC(t.children)),fC=({node:e})=>{const t=qo(e.url)?e.url:void 0,r=t!==void 0&&jx(t);return k.jsx("a",{className:Wx(void 0,uC(e.children)),href:t,target:r?"_blank":void 0,rel:r?"noreferrer":void 0,children:k.jsx(Wt,{nodes:e.children})})},gC=({node:e})=>e.children.length===1&&e.children[0].type==="paragraph"?k.jsx("li",{children:k.jsx(Wt,{nodes:e.children[0].children})}):k.jsx("li",{children:k.jsx(Wt,{nodes:e.children})}),pC=({node:e})=>{const t=e.ordered?"ol":"ul";return k.jsx(t,{children:k.jsx(Wt,{nodes:e.children})})},K$=({node:e})=>k.jsx("mark",{children:k.jsx(Wt,{nodes:e.children})}),mC=({node:e})=>k.jsx("p",{children:k.jsx(Wt,{nodes:e.children})}),yC=({node:e})=>k.jsx("strong",{children:k.jsx(Wt,{nodes:e.children})}),Z$=({node:e})=>k.jsx("sub",{children:k.jsx(Wt,{nodes:e.children})}),Q$=({node:e})=>k.jsx("sup",{children:k.jsx(Wt,{nodes:e.children})}),au=e=>{const t=e.data?.hProperties;return{merged:t?.merged??!1,colSpan:t?.colSpan,rowSpan:t?.rowSpan,textAlign:t?.textAlign}},xC=({node:e})=>{const[t,...r]=e.children;return k.jsx("div",{className:"overflow-x-auto",children:k.jsxs("table",{className:"w-full border-collapse border-none",children:[k.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:k.jsx("tr",{children:t.children.map((i,o)=>{const{merged:s,colSpan:a,rowSpan:n,textAlign:l}=au(i);return s?null:k.jsx("th",{colSpan:a,rowSpan:n,style:{textAlign:l??e.align?.[o]??void 0},className:"border border-gray-300 px-4 py-2 text-left font-semibold dark:border-gray-600 dark:text-gray-200",children:k.jsx(Wt,{nodes:i.children})},`mdast-table-node-${e.type}-${o}`)})})}),k.jsx("tbody",{children:r.map((i,o)=>k.jsx("tr",{className:"border-gray-200 border-t bg-white dark:border-gray-700 dark:bg-gray-900",children:i.children.map((s,a)=>{const{merged:n,colSpan:l,rowSpan:c,textAlign:h}=au(s);return n?null:k.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:k.jsx(Wt,{nodes:s.children})},`mdast-table-node-${e.type}-${a}`)})},`mdast-table-node-${e.type}-${o}`))})]})})},CC=({node:e})=>k.jsx(k.Fragment,{children:e.value}),bC=()=>k.jsx("hr",{className:"border-gray-300 dark:border-gray-600"}),kC=({node:e})=>{const t=e.data?.title||"";return k.jsxs("details",{className:"markdown-details",children:[k.jsx("summary",{children:t}),k.jsx("div",{className:"markdown-details-content",children:k.jsx(Wt,{nodes:e.children})})]})},wC=({node:e})=>{const r=["message",e.data?.messageType||"message"].filter(Boolean).join(" ");return k.jsxs("aside",{className:r,children:[k.jsx("span",{className:"message-symbol",style:{userSelect:"none"},children:"!"}),k.jsx("div",{className:"message-content",children:k.jsx(Wt,{nodes:e.children})})]})},Wt=({nodes:e,theme:t="light",iFrameAllowedDomains:r=[]})=>e.map((i,o)=>{switch(i.type){case"blockquote":return k.jsx(SC,{node:i},`mdast-node-${i.type}-${o}`);case"break":return k.jsx("br",{},`mdast-node-${i.type}-${o}`);case"code":return k.jsx(Xh,{node:i,theme:t},`mdast-node-${i.type}-${o}`);case"delete":return k.jsx(oC,{node:i},`mdast-node-${i.type}-${o}`);case"details":return k.jsx(kC,{node:i},`mdast-node-${i.type}-${o}`);case"emphasis":return k.jsx(sC,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteReference":return k.jsx(aC,{node:i},`mdast-node-${i.type}-${o}`);case"footnoteDefinition":return null;case"footnote-back-link":return k.jsx(nC,{node:i},`mdast-node-${i.type}-${o}`);case"heading":return k.jsx(hC,{node:i},`mdast-node-${i.type}-${o}`);case"html":return k.jsx(G$,{node:i,iFrameAllowedDomains:r},`mdast-node-${i.type}-${o}`);case"html-block-container":{const s=i,a=`mdast-node-${s.type}-${s.position?.start?.offset??"na"}-${s.position?.end?.offset??"na"}`;return k.jsx(Y$,{node:s,theme:t,iFrameAllowedDomains:r},a)}case"image":return k.jsx(cC,{node:i},`mdast-node-${i.type}-${o}`);case"inlineCode":return k.jsx(dC,{node:i},`mdast-node-${i.type}-${o}`);case"inlineMath":return k.jsx(X$,{node:i},`mdast-node-${i.type}-${o}`);case"link":return k.jsx(fC,{node:i},`mdast-node-${i.type}-${o}`);case"listItem":return k.jsx(gC,{node:i},`mdast-node-${i.type}-${o}`);case"list":return k.jsx(pC,{node:i},`mdast-node-${i.type}-${o}`);case"mark":return k.jsx(K$,{node:i},`mdast-node-${i.type}-${o}`);case"math":return k.jsx(u3,{node:i},`mdast-node-${i.type}-${o}`);case"message":return k.jsx(wC,{node:i},`mdast-node-${i.type}-${o}`);case"paragraph":return k.jsx(mC,{node:i},`mdast-node-${i.type}-${o}`);case"strong":return k.jsx(yC,{node:i},`mdast-node-${i.type}-${o}`);case"subscript":return k.jsx(Z$,{node:i},`mdast-node-${i.type}-${o}`);case"superscript":return k.jsx(Q$,{node:i},`mdast-node-${i.type}-${o}`);case"table":return k.jsx(xC,{node:i},`mdast-node-${i.type}-${o}`);case"text":return k.jsx(CC,{node:i},`mdast-node-${i.type}-${o}`);case"thematicBreak":return k.jsx(bC,{},`mdast-node-${i.type}-${o}`);case"yaml":return null;default:{if(process.env.NODE_ENV==="development")return k.jsxs("div",{children:[k.jsxs("p",{style:{color:"red"},children:["Unknown node type: ",i.type]}),k.jsx("pre",{children:JSON.stringify(i,null,2)})]},`mdast-node-${i.type}-${o}`);throw new Error(`Unknown node type: ${i.type}`)}}}),SC=({node:e})=>k.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:k.jsx(Wt,{nodes:e.children})}),J$=/\s*\{#(.+?)\}\s*$/,tO=()=>e=>{me.visit(e,"heading",t=>{if(t.children.length===0)return;const r=t.children[t.children.length-1];if(r?.type!=="text")return;const i=r,o=i.value.match(J$);if(o){const s=o[1];t.data||(t.data={});const a=t.data,n=a.hProperties||{};n.id=s,a.hProperties=n,i.value=i.value.substring(0,o.index).trimEnd(),i.value===""&&t.children.pop()}})},eO=()=>e=>{me.visit(e,"footnoteDefinition",t=>{me.visit(t,"paragraph",r=>{r.children.push({type:"footnote-back-link",url:`#fnref-${t.identifier}`})})})},rO=()=>e=>{me.visit(e,"html",(t,r,i)=>{if(typeof r!="number"||!i)return;const s=t.value.trim().match(/^<a\s+href="([^"]+)"[^>]*>(.*?)<\/a>$/i);if(s){const[,a,n]=s,l={type:"link",url:a,children:[{type:"text",value:n}]};i.children.splice(r,1,l)}})},iO=()=>e=>{const t=r=>{const i=r.children;if(!i)return;let o=0;for(;o<i.length;){const s=i[o];if(s.type==="html"&&s.value.startsWith("<")&&!s.value.startsWith("</")&&s.value.match(/<([a-zA-Z0-9]+)/)){let n="",l=0;const c=[];let h=!1;for(let d=o;d<i.length;d++){const f=i[d];if(f.type==="html"){n+=f.value;const u=f.value.match(/<\/?([a-zA-Z0-9]+)/g)||[];for(const g of u){const m=g.match(/<\/?([a-zA-Z0-9]+)/);if(!m)continue;const y=m[1];g.startsWith("</")?c.length>0&&c[c.length-1]===y&&c.pop():g.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(o,l,{type:"html",value:n})}o++}};me.visit(e,"paragraph",t),me.visit(e,"tableCell",t),me.visit(e,"heading",t),me.visit(e,"emphasis",t),me.visit(e,"strong",t),me.visit(e,"delete",t)},nu=/\s*=\s*(\d+)(w|h|x|y)\s*/g,oO=()=>e=>{me.visit(e,"image",t=>{const r=l=>{if(!l)return{updatedText:l,matches:[]};const c=[...l.matchAll(nu)];return{updatedText:l.replaceAll(nu,"").trim(),matches:c}},{updatedText:i,matches:o}=r(t.alt);t.alt=i;const{updatedText:s,matches:a}=r(t.title);t.title=s||null;const n=[...o,...a];if(n.length>0){t.data||(t.data={}),t.data.hProperties||(t.data.hProperties={});for(const l of n){const c=Number.parseInt(l[1],10),h=l[2];h==="w"||h==="x"?t.data.hProperties.width=c:(h==="h"||h==="y")&&(t.data.hProperties.height=c)}}})},sO=()=>e=>{me.visit(e,(t,r,i)=>{i&&Object.defineProperty(t,"parent",{value:i,writable:!0,configurable:!0,enumerable:!1})})},lu=/^:::(message|details)\s*(.*)/,aO=()=>e=>{function t(r){const i=[];let o=0;for(;o<r.length;){const s=r[o];if(s.type==="paragraph"&&s.children[0]?.type==="text"&&s.children[0].value.trim().startsWith(":::")){const l=s.children[0].value.trim().match(lu);if(l){const c=o;let h=-1,d=1;const f=s.children.at(-1);if(s.children.length>1&&f?.type==="text"&&f.value.trim()===":::")h=c;else for(let u=c+1;u<r.length;u++){const g=r[u];if(g.type==="paragraph"&&g.children[0]?.type==="text"){const m=g.children[0].value.trim();lu.test(m)?d++:m===":::"&&d--}if(d===0){h=u;break}}if(h!==-1){const u=l[1],g=l[2];let m;if(h===c){const C=s.children.slice(1,-1);C[0]?.type==="break"&&C.shift(),C.at(-1)?.type==="break"&&C.pop(),m=C.length>0?[{type:"paragraph",children:C}]:[]}else{const C=s.children.slice(1);C[0]?.type==="break"&&C.shift();const w={type:"paragraph",children:C},v=r[h].children.slice(0,-1);v.at(-1)?.type==="break"&&v.pop();const _={type:"paragraph",children:v},E=r.slice(c+1,h);m=[w,...E,_].filter(B=>!(B.type==="paragraph"&&B.children.length===0))}const y=t(m);let x;if(u==="message"?x={type:"message",data:{messageType:g.trim()},children:y}:u==="details"&&(x={type:"details",data:{title:g.trim()},children:y}),x){i.push(x),o=h+1;continue}}}}const a={...s};"children"in a&&Array.isArray(a.children)&&(a.type==="blockquote"||a.type==="footnoteDefinition"||a.type==="message"||a.type==="details"?a.children=t(a.children):a.type==="list"&&(a.children=a.children.map(n=>({...n,children:t(n.children)})))),i.push(a),o++}return i}e.children=t(e.children)},nO=e=>{const t=[];return me.visit(e,"heading",r=>{const i=lC(r.children),o=r.data?.hProperties?.id;o&&i&&t.push({depth:r.depth,text:i,id:o})}),t};exports.BlockquoteNode=SC;exports.CodeNode=Xh;exports.Color=Re;exports.Color$1=Ui;exports.DEFAULT_MARKDOWN_EMBED_LABELS=MC;exports.DEFAULT_MARKDOWN_VIEWER_LABELS=x$;exports.DEFAULT_MERMAID_DIAGRAM_LABELS=vM;exports.DEFAULT_MERMAID_INTERACTION=Ex;exports.DEFAULT_SVG_IMAGE_LABELS=z3;exports.DeleteNode=oC;exports.EmphasisNode=sC;exports.FootnoteBackLinkNode=nC;exports.FootnoteReferenceNode=aC;exports.FootnotesSection=z$;exports.HeadingNode=hC;exports.HostedScrollArea=du;exports.ImageNode=cC;exports.InlineCodeNode=dC;exports.JSON_SCHEMA=Ap;exports.LinkNode=fC;exports.ListItemNode=gC;exports.ListNode=pC;exports.MarkdownRenderer=Vx;exports.MarkdownViewer=q$;exports.MermaidDiagram=Yh;exports.NodesRenderer=Wt;exports.ParagraphNode=mC;exports.Rgb=he;exports.SpreadsheetBlock=Gh;exports.StrongNode=yC;exports.TableNode=xC;exports.TableOfContents=Kx;exports.TextNode=CC;exports.ThematicBreakNode=bC;exports.Utils=gt;exports.ZERO_WIDTH_SPACE=tm;exports.ZennDetailsNode=kC;exports.ZennMessageNode=wC;exports.__export=wu;exports.__name=p;exports.abs=jS;exports.acos=KS;exports.adjustChannel=Rl;exports.argumentsTag=ph;exports.array=Tf;exports.arrayBufferTag=zp;exports.arrayTag=qp;exports.asin=ZS;exports.assignWithDepth_default=jt;exports.at=rt;exports.atan2=WS;exports.booleanTag=gh;exports.calculateMathMLDimensions=gk;exports.calculateTextDimensions=Sa;exports.calculateTextHeight=wh;exports.calculateTextWidth=Ue;exports.cleanAndMerge=va;exports.clear=ju;exports.clear$1=YB;exports.clear$2=xB;exports.clear2=NB;exports.color=Di;exports.commonDb_exports=ql;exports.common_default=Yi;exports.computeDimensionOfText=Dm;exports.computeLabelTransform=di;exports.configureLabelImages=vh;exports.configureSvgSize=Nl;exports.constant=$r;exports.constant$1=fa;exports.cos=HS;exports.createText=Pe;exports.curveBasis=Ns;exports.darken=Y;exports.dataViewTag=Wp;exports.dateTag=Pp;exports.dayjs2=Su;exports.decodeEntities=br;exports.defaultConfig2=Sk;exports.defaultConfig_default=Il;exports.define=ua;exports.distExports=$p;exports.edgeLabels=Io;exports.epsilon=Wn;exports.extend=Xl;exports.extractHeadings=nO;exports.float32ArrayTag=Zp;exports.float64ArrayTag=Qp;exports.generateId=am;exports.getAccDescription=Uu;exports.getAccTitle=Hu;exports.getConfig=Rt;exports.getConfig2=kt;exports.getDefaultExportFromCjs=cu;exports.getDiagramTitle=Xu;exports.getEdgeId=WT;exports.getEffectiveHtmlLabels=ae;exports.getIconSVG=Xi;exports.getLineFunctionsWithOffset=m0;exports.getRegisteredLayoutAlgorithm=vL;exports.getStylesFromArray=kh;exports.getSubGraphTitleMargins=Ta;exports.getTag=ka;exports.getThemeVariables3=Tu;exports.getUrl=qu;exports.getUserDefinedConfig=ek;exports.halfPi=Hn;exports.hasKatex=Ii;exports.hue=Cw;exports.insertCluster=Vm;exports.insertEdge=b0;exports.insertEdgeLabel=y0;exports.insertNode=Nh;exports.int16ArrayTag=Vp;exports.int32ArrayTag=Kp;exports.int8ArrayTag=Xp;exports.interpolateNumber=rr;exports.interpolateRgb=Rn;exports.interpolateString=ff;exports.isDark=Te;exports.isLabelStyle=dh;exports.isPrimitive=wa;exports.isTypedArray=So;exports.isValidShape=p0;exports.lighten=H;exports.line=Bf;exports.lineBreakRegex=Hi;exports.load=Mp;exports.log=V;exports.mapTag=Dp;exports.markerOffsets=Jt;exports.markers_default=S0;exports.max=YS;exports.min=US;exports.nogamma=Vl;exports.numberTag=fh;exports.objectTag=jp;exports.parseFontSize=Ho;exports.parseGenericTypes=Ln;exports.pi=ma;exports.positionEdgeLabel=x0;exports.positionNode=qB;exports.random=lm;exports.regexpTag=Rp;exports.registerIconPacks=gm;exports.remarkCustomHeadingId=tO;exports.remarkFootnoteBackLink=eO;exports.remarkHtmlAnchorToLink=rO;exports.remarkHtmlInHtml=iO;exports.remarkImageSize=oO;exports.remarkParentNode=sO;exports.remarkZennMessage=aO;exports.render=SL;exports.renderKatexSanitized=Dl;exports.rgbConvert=cf;exports.rgba=ir;exports.sanitizeText=Se;exports.select=yt;exports.selectSvgElement=Vf;exports.setAccDescription=Yu;exports.setAccTitle=Wu;exports.setConfig2=wk;exports.setDiagramTitle=Gu;exports.setNodeElem=DB;exports.setTag=Np;exports.setupGraphViewbox=zu;exports.setupGraphViewbox2=Vu;exports.sin=GS;exports.sqrt=XS;exports.stringTag=uh;exports.styles2String=it;exports.symbolTag=Ip;exports.tau=VS;exports.terminalLabels=Xt;exports.uint16ArrayTag=Up;exports.uint32ArrayTag=Gp;exports.uint8ArrayTag=Hp;exports.uint8ClampedArrayTag=Yp;exports.unknownIcon=um;exports.updateNodeBounds=ot;exports.useMarkdownToolbarState=iC;exports.utils_default=we;exports.withPath=vf;exports.wrapLabel=hm;