@theruansilva/omp-web 2.3.0 → 2.3.2

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 (71) hide show
  1. package/dist/client/assets/{CodeViewer-DHlYSlFA.js → CodeViewer-CCLKHm96.js} +1 -1
  2. package/dist/client/assets/{TerminalPanel-B7ErBads.js → TerminalPanel-Cz-DYrx6.js} +1 -1
  3. package/dist/client/assets/{UnifiedDiffViewer-Bsxe8vEO.js → UnifiedDiffViewer-DNmO4uBQ.js} +1 -1
  4. package/dist/client/assets/{abnfDiagram-O67JEVCF-Bd6-T6CG.js → abnfDiagram-O67JEVCF-XZ1qQ8z4.js} +1 -1
  5. package/dist/client/assets/{arc-Cx4UzFEe.js → arc-oozMt-rC.js} +1 -1
  6. package/dist/client/assets/{architectureDiagram-NJMV4G6O-DNZZOJHJ.js → architectureDiagram-NJMV4G6O-DtWgCy1z.js} +1 -1
  7. package/dist/client/assets/{blockDiagram-BEXU5L5S-DLGMX1ky.js → blockDiagram-BEXU5L5S-BBoE7P9Y.js} +1 -1
  8. package/dist/client/assets/{c4Diagram-YGBWAQC7-ZicrYBFE.js → c4Diagram-YGBWAQC7-DvjNg-67.js} +1 -1
  9. package/dist/client/assets/channel-B849ahM4.js +1 -0
  10. package/dist/client/assets/{chunk-2Q5K7J3B-BTdneniS.js → chunk-2Q5K7J3B-yf0a7mN4.js} +1 -1
  11. package/dist/client/assets/{chunk-3FUC2YCW-DClqbl7t.js → chunk-3FUC2YCW-1VltF9kB.js} +2 -2
  12. package/dist/client/assets/{chunk-5VM5RSS4-xVtxN_Sa.js → chunk-5VM5RSS4-BanBytP-.js} +1 -1
  13. package/dist/client/assets/{chunk-GTNCS2PH-Da56Sthk.js → chunk-GTNCS2PH-DEE2gCa9.js} +1 -1
  14. package/dist/client/assets/{chunk-GWA4HPMP-D40kcLEo.js → chunk-GWA4HPMP-DWBspe_I.js} +1 -1
  15. package/dist/client/assets/{chunk-JWPE2WC7-CVgZV6Wp.js → chunk-JWPE2WC7-Be3sOMxP.js} +1 -1
  16. package/dist/client/assets/{chunk-NETBCI7D-DNI4Nu1k.js → chunk-NETBCI7D-DUiv7lTo.js} +1 -1
  17. package/dist/client/assets/{chunk-WEXAMYUT-IVsvOCJJ.js → chunk-WEXAMYUT-8OgC9IZ9.js} +1 -1
  18. package/dist/client/assets/{chunk-XXDRQBXY-ByZI65OQ.js → chunk-XXDRQBXY-Bcwqpw0e.js} +1 -1
  19. package/dist/client/assets/{classDiagram-v2-NBCMYWYE-CT9N6_lF.js → classDiagram-v2-NBCMYWYE-CIkJY9Ou.js} +1 -1
  20. package/dist/client/assets/{cose-bilkent-JH36ORCC-CBJJYOd5.js → cose-bilkent-JH36ORCC-CyHRIgUx.js} +1 -1
  21. package/dist/client/assets/{cynefin-OW5HDTMX-BUpMG_46.js → cynefin-OW5HDTMX-BnXIWj_c.js} +1 -1
  22. package/dist/client/assets/{cynefinDiagram-VND7K2PF-otEJqM7K.js → cynefinDiagram-VND7K2PF-BWnjhGsJ.js} +1 -1
  23. package/dist/client/assets/{dagre-6A5THRUB-qquzH4Ev.js → dagre-6A5THRUB-DWT5RQye.js} +1 -1
  24. package/dist/client/assets/{diagram-22UHCM2B-HDLtgJRK.js → diagram-22UHCM2B-DP58QDft.js} +1 -1
  25. package/dist/client/assets/{diagram-3UASUU5V-Bc2_UO5k.js → diagram-3UASUU5V-DbO0luGb.js} +1 -1
  26. package/dist/client/assets/{diagram-ATOU4E4O-DR72H135.js → diagram-ATOU4E4O-DujESIkQ.js} +1 -1
  27. package/dist/client/assets/{diagram-CDSNMT55-hNm66Cr9.js → diagram-CDSNMT55-4dwnMZ-w.js} +1 -1
  28. package/dist/client/assets/{diagram-MLGK6HIB-ChaEhVd4.js → diagram-MLGK6HIB-B9wJ9DgU.js} +1 -1
  29. package/dist/client/assets/{diagram-MPIPVDR6-gYxYar4V.js → diagram-MPIPVDR6-B7VqKNt7.js} +1 -1
  30. package/dist/client/assets/{ebnfDiagram-ZINNZB2B-CRQjE5YW.js → ebnfDiagram-ZINNZB2B-DeWm3AYC.js} +1 -1
  31. package/dist/client/assets/{elk-276RUBZZ-OZ3Zw5zt.js → elk-276RUBZZ-CoNCqJcP.js} +1 -1
  32. package/dist/client/assets/{erDiagram-OPXOYQCR-CB71jEyA.js → erDiagram-OPXOYQCR-D9OB6b4G.js} +1 -1
  33. package/dist/client/assets/{flowDiagram-KWPJA3E3-CYfjFu_3.js → flowDiagram-KWPJA3E3-B0w84_XU.js} +1 -1
  34. package/dist/client/assets/{ganttDiagram-FUAMR5RP-BE7B_UzV.js → ganttDiagram-FUAMR5RP-DuTuwJBe.js} +1 -1
  35. package/dist/client/assets/{gitGraphDiagram-X574FWY7-HBid3FDo.js → gitGraphDiagram-X574FWY7-BUuBUocx.js} +1 -1
  36. package/dist/client/assets/{index-C-cQEbCY.js → index-BW6XEiuj.js} +90 -82
  37. package/dist/client/assets/{infoDiagram-VRGFBTTK-4JprhzHA.js → infoDiagram-VRGFBTTK-CGKca5hP.js} +1 -1
  38. package/dist/client/assets/{ishikawaDiagram-OU5B5YK6-UAP9bqUn.js → ishikawaDiagram-OU5B5YK6-DHRV6yYl.js} +1 -1
  39. package/dist/client/assets/{journeyDiagram-ZHPQQLJL-j9c9R8jU.js → journeyDiagram-ZHPQQLJL-CvVcj_qr.js} +1 -1
  40. package/dist/client/assets/{kanban-definition-PNTS6WVX-DWQBxist.js → kanban-definition-PNTS6WVX-CFVMh7as.js} +1 -1
  41. package/dist/client/assets/{linear-T6d_7ZeJ.js → linear-DasKveCN.js} +1 -1
  42. package/dist/client/assets/{mindmap-definition-NLK3R4M7-CvMFAKuS.js → mindmap-definition-NLK3R4M7-CwZQvHXR.js} +1 -1
  43. package/dist/client/assets/{pegDiagram-GJSIUBJH-hvF632kF.js → pegDiagram-GJSIUBJH-BNXgc7-g.js} +1 -1
  44. package/dist/client/assets/{pieDiagram-5QR66LMP-BXICkLn_.js → pieDiagram-5QR66LMP-BJ2L-dQa.js} +1 -1
  45. package/dist/client/assets/{quadrantDiagram-O4NWA36T-CnFY0fxq.js → quadrantDiagram-O4NWA36T-zlLKeeUR.js} +1 -1
  46. package/dist/client/assets/{railroadDiagram-XR7U4H2S-BeRVo7yu.js → railroadDiagram-XR7U4H2S-ChQ2Bzn8.js} +1 -1
  47. package/dist/client/assets/{requirementDiagram-PLB6GJNP-DmnKxfFp.js → requirementDiagram-PLB6GJNP-Cnj6GBT0.js} +1 -1
  48. package/dist/client/assets/{sankeyDiagram-IPEJSGJF-Bz1YIaMr.js → sankeyDiagram-IPEJSGJF-D7QbwNbF.js} +1 -1
  49. package/dist/client/assets/{sequenceDiagram-PO4LG4MO-4cmBIYSV.js → sequenceDiagram-PO4LG4MO-DTCmIrg-.js} +1 -1
  50. package/dist/client/assets/{sizeCapture-INFHLROL-B6mTYfgL.js → sizeCapture-INFHLROL-ibwuZV0j.js} +1 -1
  51. package/dist/client/assets/{stateDiagram-v2-GCMORJYK-BKkiHc4R.js → stateDiagram-v2-GCMORJYK-LRnQ_KvI.js} +1 -1
  52. package/dist/client/assets/{swimlanes-2SLR337P-CBONvDhF.js → swimlanes-2SLR337P-Bf3UNf_T.js} +1 -1
  53. package/dist/client/assets/swimlanesDiagram-TC7HE7FX-CAjvJtrv.js +8 -0
  54. package/dist/client/assets/{timeline-definition-EJHVYXUP-BG9z7YWj.js → timeline-definition-EJHVYXUP-C-hFa0Xg.js} +1 -1
  55. package/dist/client/assets/{usecaseDiagram-POWQR4AR--yXc6tgF.js → usecaseDiagram-POWQR4AR-CeJlL3Iz.js} +1 -1
  56. package/dist/client/assets/{vennDiagram-UO4OBE2U-DYr42cwJ.js → vennDiagram-UO4OBE2U-JRvs9XFy.js} +1 -1
  57. package/dist/client/assets/{wardleyDiagram-VNRHLVJA-DksCy2aR.js → wardleyDiagram-VNRHLVJA-BrFqMbb0.js} +1 -1
  58. package/dist/client/assets/{xychartDiagram-PMCCYNJV-DPxnNxcI.js → xychartDiagram-PMCCYNJV-Bxzt39ml.js} +1 -1
  59. package/dist/client/index.html +1 -1
  60. package/dist/config.js +10 -0
  61. package/dist/config.js.map +1 -1
  62. package/dist/server/app.js +1 -0
  63. package/dist/server/app.js.map +1 -1
  64. package/dist/server/machines/machineService.js +14 -5
  65. package/dist/server/machines/machineService.js.map +1 -1
  66. package/dist/server/security.js +6 -6
  67. package/dist/server/security.js.map +1 -1
  68. package/dist/shared/apiTypes.d.ts +1 -0
  69. package/package.json +1 -1
  70. package/dist/client/assets/channel-Cy0oVDAk.js +0 -1
  71. package/dist/client/assets/swimlanesDiagram-TC7HE7FX-DUA_t92u.js +0 -8
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/elk-276RUBZZ-OZ3Zw5zt.js","assets/chunk-NETBCI7D-DNI4Nu1k.js","assets/chunk-3FUC2YCW-DClqbl7t.js","assets/graph-D8UmR1vK.js","assets/vendor-editor-core-DbsheCh1.js","assets/vendor-editor-languages-B1l-thbw.js","assets/dagre-6A5THRUB-qquzH4Ev.js","assets/swimlanes-2SLR337P-CBONvDhF.js","assets/cose-bilkent-JH36ORCC-CBJJYOd5.js","assets/cytoscape.esm-BB4DxJjf.js","assets/c4Diagram-YGBWAQC7-ZicrYBFE.js","assets/chunk-GWA4HPMP-D40kcLEo.js","assets/flowDiagram-KWPJA3E3-CYfjFu_3.js","assets/chunk-5VM5RSS4-xVtxN_Sa.js","assets/chunk-XXDRQBXY-ByZI65OQ.js","assets/chunk-WEXAMYUT-IVsvOCJJ.js","assets/channel-Cy0oVDAk.js","assets/diagram-22UHCM2B-HDLtgJRK.js","assets/swimlanesDiagram-TC7HE7FX-DUA_t92u.js","assets/erDiagram-OPXOYQCR-CB71jEyA.js","assets/gitGraphDiagram-X574FWY7-HBid3FDo.js","assets/chunk-2Q5K7J3B-BTdneniS.js","assets/chunk-JWPE2WC7-CVgZV6Wp.js","assets/cynefin-OW5HDTMX-BUpMG_46.js","assets/ganttDiagram-FUAMR5RP-BE7B_UzV.js","assets/linear-T6d_7ZeJ.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-VRGFBTTK-4JprhzHA.js","assets/pieDiagram-5QR66LMP-BXICkLn_.js","assets/arc-Cx4UzFEe.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-O4NWA36T-CnFY0fxq.js","assets/xychartDiagram-PMCCYNJV-DPxnNxcI.js","assets/requirementDiagram-PLB6GJNP-DmnKxfFp.js","assets/sequenceDiagram-PO4LG4MO-4cmBIYSV.js","assets/classDiagram-v2-NBCMYWYE-CT9N6_lF.js","assets/stateDiagram-v2-GCMORJYK-BKkiHc4R.js","assets/journeyDiagram-ZHPQQLJL-j9c9R8jU.js","assets/timeline-definition-EJHVYXUP-BG9z7YWj.js","assets/mindmap-definition-NLK3R4M7-CvMFAKuS.js","assets/kanban-definition-PNTS6WVX-DWQBxist.js","assets/sankeyDiagram-IPEJSGJF-Bz1YIaMr.js","assets/diagram-MLGK6HIB-ChaEhVd4.js","assets/diagram-MPIPVDR6-gYxYar4V.js","assets/blockDiagram-BEXU5L5S-DLGMX1ky.js","assets/diagram-CDSNMT55-hNm66Cr9.js","assets/architectureDiagram-NJMV4G6O-DNZZOJHJ.js","assets/diagram-ATOU4E4O-DR72H135.js","assets/ishikawaDiagram-OU5B5YK6-UAP9bqUn.js","assets/vennDiagram-UO4OBE2U-DYr42cwJ.js","assets/diagram-3UASUU5V-Bc2_UO5k.js","assets/usecaseDiagram-POWQR4AR--yXc6tgF.js","assets/wardleyDiagram-VNRHLVJA-DksCy2aR.js","assets/cynefinDiagram-VND7K2PF-otEJqM7K.js","assets/railroadDiagram-XR7U4H2S-BeRVo7yu.js","assets/chunk-GTNCS2PH-Da56Sthk.js","assets/ebnfDiagram-ZINNZB2B-CRQjE5YW.js","assets/abnfDiagram-O67JEVCF-Bd6-T6CG.js","assets/pegDiagram-GJSIUBJH-hvF632kF.js","assets/CodeViewer-DHlYSlFA.js","assets/UnifiedDiffViewer-Bsxe8vEO.js","assets/TerminalPanel-B7ErBads.js","assets/vendor-terminal-DjQ08hXu.js","assets/vendor-terminal-DDGTF8rc.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/elk-276RUBZZ-CoNCqJcP.js","assets/chunk-NETBCI7D-DUiv7lTo.js","assets/chunk-3FUC2YCW-1VltF9kB.js","assets/graph-D8UmR1vK.js","assets/vendor-editor-core-DbsheCh1.js","assets/vendor-editor-languages-B1l-thbw.js","assets/dagre-6A5THRUB-DWT5RQye.js","assets/swimlanes-2SLR337P-Bf3UNf_T.js","assets/cose-bilkent-JH36ORCC-CyHRIgUx.js","assets/cytoscape.esm-BB4DxJjf.js","assets/c4Diagram-YGBWAQC7-DvjNg-67.js","assets/chunk-GWA4HPMP-DWBspe_I.js","assets/flowDiagram-KWPJA3E3-B0w84_XU.js","assets/chunk-5VM5RSS4-BanBytP-.js","assets/chunk-XXDRQBXY-Bcwqpw0e.js","assets/chunk-WEXAMYUT-8OgC9IZ9.js","assets/channel-B849ahM4.js","assets/diagram-22UHCM2B-DP58QDft.js","assets/swimlanesDiagram-TC7HE7FX-CAjvJtrv.js","assets/erDiagram-OPXOYQCR-D9OB6b4G.js","assets/gitGraphDiagram-X574FWY7-BUuBUocx.js","assets/chunk-2Q5K7J3B-yf0a7mN4.js","assets/chunk-JWPE2WC7-Be3sOMxP.js","assets/cynefin-OW5HDTMX-BnXIWj_c.js","assets/ganttDiagram-FUAMR5RP-DuTuwJBe.js","assets/linear-DasKveCN.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-VRGFBTTK-CGKca5hP.js","assets/pieDiagram-5QR66LMP-BJ2L-dQa.js","assets/arc-oozMt-rC.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-O4NWA36T-zlLKeeUR.js","assets/xychartDiagram-PMCCYNJV-Bxzt39ml.js","assets/requirementDiagram-PLB6GJNP-Cnj6GBT0.js","assets/sequenceDiagram-PO4LG4MO-DTCmIrg-.js","assets/classDiagram-v2-NBCMYWYE-CIkJY9Ou.js","assets/stateDiagram-v2-GCMORJYK-LRnQ_KvI.js","assets/journeyDiagram-ZHPQQLJL-CvVcj_qr.js","assets/timeline-definition-EJHVYXUP-C-hFa0Xg.js","assets/mindmap-definition-NLK3R4M7-CwZQvHXR.js","assets/kanban-definition-PNTS6WVX-CFVMh7as.js","assets/sankeyDiagram-IPEJSGJF-D7QbwNbF.js","assets/diagram-MLGK6HIB-B9wJ9DgU.js","assets/diagram-MPIPVDR6-B7VqKNt7.js","assets/blockDiagram-BEXU5L5S-BBoE7P9Y.js","assets/diagram-CDSNMT55-4dwnMZ-w.js","assets/architectureDiagram-NJMV4G6O-DtWgCy1z.js","assets/diagram-ATOU4E4O-DujESIkQ.js","assets/ishikawaDiagram-OU5B5YK6-DHRV6yYl.js","assets/vennDiagram-UO4OBE2U-JRvs9XFy.js","assets/diagram-3UASUU5V-DbO0luGb.js","assets/usecaseDiagram-POWQR4AR-CeJlL3Iz.js","assets/wardleyDiagram-VNRHLVJA-BrFqMbb0.js","assets/cynefinDiagram-VND7K2PF-BWnjhGsJ.js","assets/railroadDiagram-XR7U4H2S-ChQ2Bzn8.js","assets/chunk-GTNCS2PH-DEE2gCa9.js","assets/ebnfDiagram-ZINNZB2B-DeWm3AYC.js","assets/abnfDiagram-O67JEVCF-XZ1qQ8z4.js","assets/pegDiagram-GJSIUBJH-BNXgc7-g.js","assets/CodeViewer-CCLKHm96.js","assets/UnifiedDiffViewer-DNmO4uBQ.js","assets/TerminalPanel-Cz-DYrx6.js","assets/vendor-terminal-DjQ08hXu.js","assets/vendor-terminal-DDGTF8rc.css"])))=>i.map(i=>d[i]);
2
2
  import{V as _7,W as L7,X as Cp,n as Ho,J as Tp,Y as wb,Z as kb,_ as P7,$ as E7,G as R7,S as I7,a0 as z7,A as D7,a1 as F7,R as O7,p as Sb,a2 as Cb,a3 as N7,U as W7}from"./vendor-editor-core-DbsheCh1.js";import{a as xu,j as q7,c as H7,h as j7,p as U7,r as Y7,g as G7,m as Jw,d as X7,i as V7}from"./vendor-editor-languages-B1l-thbw.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function i(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=i(s);fetch(s.href,o)}})();const Xh=globalThis,Dg=Xh.ShadowRoot&&(Xh.ShadyCSS===void 0||Xh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fg=Symbol(),Tb=new WeakMap;let tk=class{constructor(t,i,r){if(this._$cssResult$=!0,r!==Fg)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o;const i=this.t;if(Dg&&t===void 0){const r=i!==void 0&&i.length===1;r&&(t=Tb.get(i)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&Tb.set(i,t))}return t}toString(){return this.cssText}};const ek=e=>new tk(typeof e=="string"?e:e+"",void 0,Fg),_e=(e,...t)=>{const i=e.length===1?e[0]:t.reduce((r,s,o)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+e[o+1],e[0]);return new tk(i,e,Fg)},K7=(e,t)=>{if(Dg)e.adoptedStyleSheets=t.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(const i of t){const r=document.createElement("style"),s=Xh.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=i.cssText,e.appendChild(r)}},$b=Dg?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(const r of t.cssRules)i+=r.cssText;return ek(i)})(e):e;const{is:Z7,defineProperty:Q7,getOwnPropertyDescriptor:J7,getOwnPropertyNames:tT,getOwnPropertySymbols:eT,getPrototypeOf:iT}=Object,vu=globalThis,Mb=vu.trustedTypes,rT=Mb?Mb.emptyScript:"",sT=vu.reactiveElementPolyfillSupport,lc=(e,t)=>e,yd={toAttribute(e,t){switch(t){case Boolean:e=e?rT:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},Og=(e,t)=>!Z7(e,t),Ab={attribute:!0,type:String,converter:yd,reflect:!1,useDefault:!1,hasChanged:Og};Symbol.metadata??=Symbol("metadata"),vu.litPropertyMetadata??=new WeakMap;let wn=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=Ab){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(t,i),!i.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(t,r,i);s!==void 0&&Q7(this.prototype,t,s)}}static getPropertyDescriptor(t,i,r){const{get:s,set:o}=J7(this.prototype,t)??{get(){return this[i]},set(a){this[i]=a}};return{get:s,set(a){const n=s?.call(this);o?.call(this,a),this.requestUpdate(t,n,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ab}static _$Ei(){if(this.hasOwnProperty(lc("elementProperties")))return;const t=iT(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(lc("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(lc("properties"))){const i=this.properties,r=[...tT(i),...eT(i)];for(const s of r)this.createProperty(s,i[s])}const t=this[Symbol.metadata];if(t!==null){const i=litPropertyMetadata.get(t);if(i!==void 0)for(const[r,s]of i)this.elementProperties.set(r,s)}this._$Eh=new Map;for(const[i,r]of this.elementProperties){const s=this._$Eu(i,r);s!==void 0&&this._$Eh.set(s,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const s of r)i.unshift($b(s))}else t!==void 0&&i.push($b(t));return i}static _$Eu(t,i){const r=i.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,i=this.constructor.elementProperties;for(const r of i.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return K7(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,i,r){this._$AK(t,r)}_$ET(t,i){const r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){const o=(r.converter?.toAttribute!==void 0?r.converter:yd).toAttribute(i,r.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,i){const r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const o=r.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:yd;this._$Em=s;const n=a.fromAttribute(i,o.type);this[s]=n??this._$Ej?.get(s)??n,this._$Em=null}}requestUpdate(t,i,r,s=!1,o){if(t!==void 0){const a=this.constructor;if(s===!1&&(o=this[t]),r??=a.getPropertyOptions(t),!((r.hasChanged??Og)(o,i)||r.useDefault&&r.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(a._$Eu(t,r))))return;this.C(t,i,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,i,{useDefault:r,reflect:s,wrapped:o},a){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??i??this[t]),o!==!0||a!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(i=void 0),this._$AL.set(t,i)),s===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[s,o]of r){const{wrapped:a}=o,n=this[s];a!==!0||this._$AL.has(s)||n===void 0||this.C(s,void 0,o,n)}}let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(i)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(i)}willUpdate(t){}_$AE(t){this._$EO?.forEach(i=>i.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(i=>this._$ET(i,this[i])),this._$EM()}updated(t){}firstUpdated(t){}};wn.elementStyles=[],wn.shadowRootOptions={mode:"open"},wn[lc("elementProperties")]=new Map,wn[lc("finalized")]=new Map,sT?.({ReactiveElement:wn}),(vu.reactiveElementVersions??=[]).push("2.1.2");const Ng=globalThis,Bb=e=>e,xd=Ng.trustedTypes,_b=xd?xd.createPolicy("lit-html",{createHTML:e=>e}):void 0,ik="$lit$",ta=`lit$${Math.random().toFixed(9).slice(2)}$`,rk="?"+ta,oT=`<${rk}>`,Ya=document,xc=()=>Ya.createComment(""),vc=e=>e===null||typeof e!="object"&&typeof e!="function",Wg=Array.isArray,aT=e=>Wg(e)||typeof e?.[Symbol.iterator]=="function",$p=`[
3
3
  \f\r]`,Ml=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lb=/-->/g,Pb=/>/g,Ca=RegExp(`>|${$p}(?:([^\\s"'>=/]+)(${$p}*=${$p}*(?:[^
4
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Eb=/'/g,Rb=/"/g,sk=/^(?:script|style|textarea|title)$/i,ok=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),T=ok(1),Dr=ok(2),aa=Symbol.for("lit-noChange"),Qe=Symbol.for("lit-nothing"),Ib=new WeakMap,Da=Ya.createTreeWalker(Ya,129);function ak(e,t){if(!Wg(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return _b!==void 0?_b.createHTML(t):t}const nT=(e,t)=>{const i=e.length-1,r=[];let s,o=t===2?"<svg>":t===3?"<math>":"",a=Ml;for(let n=0;n<i;n++){const l=e[n];let c,h,d=-1,u=0;for(;u<l.length&&(a.lastIndex=u,h=a.exec(l),h!==null);)u=a.lastIndex,a===Ml?h[1]==="!--"?a=Lb:h[1]!==void 0?a=Pb:h[2]!==void 0?(sk.test(h[2])&&(s=RegExp("</"+h[2],"g")),a=Ca):h[3]!==void 0&&(a=Ca):a===Ca?h[0]===">"?(a=s??Ml,d=-1):h[1]===void 0?d=-2:(d=a.lastIndex-h[2].length,c=h[1],a=h[3]===void 0?Ca:h[3]==='"'?Rb:Eb):a===Rb||a===Eb?a=Ca:a===Lb||a===Pb?a=Ml:(a=Ca,s=void 0);const p=a===Ca&&e[n+1].startsWith("/>")?" ":"";o+=a===Ml?l+oT:d>=0?(r.push(c),l.slice(0,d)+ik+l.slice(d)+ta+p):l+ta+(d===-2?n:p)}return[ak(e,o+(e[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};let hf=class nk{constructor({strings:t,_$litType$:i},r){let s;this.parts=[];let o=0,a=0;const n=t.length-1,l=this.parts,[c,h]=nT(t,i);if(this.el=nk.createElement(c,r),Da.currentNode=this.el.content,i===2||i===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=Da.nextNode())!==null&&l.length<n;){if(s.nodeType===1){if(s.hasAttributes())for(const d of s.getAttributeNames())if(d.endsWith(ik)){const u=h[a++],p=s.getAttribute(d).split(ta),f=/([.?@])?(.*)/.exec(u);l.push({type:1,index:o,name:f[2],strings:p,ctor:f[1]==="."?cT:f[1]==="?"?hT:f[1]==="@"?dT:ku}),s.removeAttribute(d)}else d.startsWith(ta)&&(l.push({type:6,index:o}),s.removeAttribute(d));if(sk.test(s.tagName)){const d=s.textContent.split(ta),u=d.length-1;if(u>0){s.textContent=xd?xd.emptyScript:"";for(let p=0;p<u;p++)s.append(d[p],xc()),Da.nextNode(),l.push({type:2,index:++o});s.append(d[u],xc())}}}else if(s.nodeType===8)if(s.data===rk)l.push({type:2,index:o});else{let d=-1;for(;(d=s.data.indexOf(ta,d+1))!==-1;)l.push({type:7,index:o}),d+=ta.length-1}o++}}static createElement(t,i){const r=Ya.createElement("template");return r.innerHTML=t,r}};function Qn(e,t,i=e,r){if(t===aa)return t;let s=r!==void 0?i._$Co?.[r]:i._$Cl;const o=vc(t)?void 0:t._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),o===void 0?s=void 0:(s=new o(e),s._$AT(e,i,r)),r!==void 0?(i._$Co??=[])[r]=s:i._$Cl=s),s!==void 0&&(t=Qn(e,s._$AS(e,t.values),s,r)),t}let lT=class{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:r}=this._$AD,s=(t?.creationScope??Ya).importNode(i,!0);Da.currentNode=s;let o=Da.nextNode(),a=0,n=0,l=r[0];for(;l!==void 0;){if(a===l.index){let c;l.type===2?c=new wu(o,o.nextSibling,this,t):l.type===1?c=new l.ctor(o,l.name,l.strings,this,t):l.type===6&&(c=new uT(o,this,t)),this._$AV.push(c),l=r[++n]}a!==l?.index&&(o=Da.nextNode(),a++)}return Da.currentNode=Ya,s}p(t){let i=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,i),i+=r.strings.length-2):r._$AI(t[i])),i++}},wu=class lk{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,r,s){this.type=2,this._$AH=Qe,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Qn(this,t,i),vc(t)?t===Qe||t==null||t===""?(this._$AH!==Qe&&this._$AR(),this._$AH=Qe):t!==this._$AH&&t!==aa&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):aT(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==Qe&&vc(this._$AH)?this._$AA.nextSibling.data=t:this.T(Ya.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=hf.createElement(ak(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(i);else{const o=new lT(s,this),a=o.u(this.options);o.p(i),this.T(a),this._$AH=o}}_$AC(t){let i=Ib.get(t.strings);return i===void 0&&Ib.set(t.strings,i=new hf(t)),i}k(t){Wg(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let r,s=0;for(const o of t)s===i.length?i.push(r=new lk(this.O(xc()),this.O(xc()),this,this.options)):r=i[s],r._$AI(o),s++;s<i.length&&(this._$AR(r&&r._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){const r=Bb(t).nextSibling;Bb(t).remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},ku=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,r,s,o){this.type=1,this._$AH=Qe,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Qe}_$AI(t,i=this,r,s){const o=this.strings;let a=!1;if(o===void 0)t=Qn(this,t,i,0),a=!vc(t)||t!==this._$AH&&t!==aa,a&&(this._$AH=t);else{const n=t;let l,c;for(t=o[0],l=0;l<o.length-1;l++)c=Qn(this,n[r+l],i,l),c===aa&&(c=this._$AH[l]),a||=!vc(c)||c!==this._$AH[l],c===Qe?t=Qe:t!==Qe&&(t+=(c??"")+o[l+1]),this._$AH[l]=c}a&&!s&&this.j(t)}j(t){t===Qe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},cT=class extends ku{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Qe?void 0:t}},hT=class extends ku{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Qe)}},dT=class extends ku{constructor(t,i,r,s,o){super(t,i,r,s,o),this.type=5}_$AI(t,i=this){if((t=Qn(this,t,i,0)??Qe)===aa)return;const r=this._$AH,s=t===Qe&&r!==Qe||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==Qe&&(r===Qe||s);s&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},uT=class{constructor(t,i,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){Qn(this,t)}};const pT={I:wu},fT=Ng.litHtmlPolyfillSupport;fT?.(hf,wu),(Ng.litHtmlVersions??=[]).push("3.3.3");const gT=(e,t,i)=>{const r=i?.renderBefore??t;let s=r._$litPart$;if(s===void 0){const o=i?.renderBefore??null;r._$litPart$=s=new wu(t.insertBefore(xc(),o),o,void 0,i??{})}return s._$AI(e),s};const qg=globalThis;let we=class extends wn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=gT(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return aa}};we._$litElement$=!0,we.finalized=!0,qg.litElementHydrateSupport?.({LitElement:we});const mT=qg.litElementPolyfillSupport;mT?.({LitElement:we});(qg.litElementVersions??=[]).push("4.2.2");function ki(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Je(e){return e instanceof Error?e.message:String(e)}const Ae=e=>(t,i)=>{i!==void 0?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};const bT={attribute:!0,type:String,converter:yd,reflect:!1,hasChanged:Og},yT=(e=bT,t,i)=>{const{kind:r,metadata:s}=i;let o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),r==="setter"&&((e=Object.create(e)).wrapped=!0),o.set(i.name,e),r==="accessor"){const{name:a}=i;return{set(n){const l=t.get.call(this);t.set.call(this,n),this.requestUpdate(a,l,e,!0,n)},init(n){return n!==void 0&&this.C(a,void 0,e,n),n}}}if(r==="setter"){const{name:a}=i;return function(n){const l=this[a];t.call(this,n),this.requestUpdate(a,l,e,!0,n)}}throw Error("Unsupported decorator location: "+r)};function P(e){return(t,i)=>typeof i=="object"?yT(e,t,i):((r,s,o)=>{const a=s.hasOwnProperty(o);return s.constructor.createProperty(o,r),a?Object.getOwnPropertyDescriptor(s,o):void 0})(e,t,i)}function Ct(e){return P({...e,state:!0,attribute:!1})}const xT=(e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(e,t,i),i);function ui(e,t){return(i,r,s)=>{const o=a=>a.renderRoot?.querySelector(e)??null;return xT(i,r,{get(){return o(this)}})}}async function Ut(e,t){const i=new Headers(t?.headers);t?.body!==void 0&&!i.has("content-type")&&i.set("content-type","application/json");const r=await fetch(e,{...t,headers:i});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(vT(s)??r.statusText)}return await r.json()}function vT(e){if(ki(e))return typeof e.error=="string"?e.error:void 0}function wT(e){return typeof e=="string"?e:e.id}function kT(e){return typeof e=="string"?void 0:e.cwd}function ST(e,t,i,r){const s=new URLSearchParams;r?.path!==void 0&&s.set("path",r.path),r?.staged===!0&&s.set("staged","true");const o=s.toString();return`/api/machines/${encodeURIComponent(e)}/projects/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(i)}/git/diff${o?`?${o}`:""}`}function CT(e,t,i="local"){const r=new URLSearchParams,s=kT(e);s!==void 0&&s!==""&&r.set("cwd",s),t?.limit!==void 0&&r.set("limit",String(t.limit)),t?.before!==void 0&&r.set("before",String(t.before));const o=r.toString();return`/api/machines/${encodeURIComponent(i)}/sessions/${encodeURIComponent(wT(e))}/messages${o===""?"":`?${o}`}`}function TT(e,t,i,r){const s=new URLSearchParams({path:i});return r?.createDirs===!1&&s.set("createDirs","false"),r?.overwrite===!1&&s.set("overwrite","false"),`${`/api/machines/${encodeURIComponent(r?.machineId??"local")}`}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file?${s.toString()}`}function zb(e,t,i,r){const s=new URLSearchParams;return s.set("path",i),r?.modifiedAt!==void 0&&s.set("v",r.modifiedAt),`${`/api/machines/${encodeURIComponent(r?.machineId??"local")}`}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file/preview?${s.toString()}`}function Db(e,t,i,r){const s=new URLSearchParams({path:i});return`${`/api/machines/${encodeURIComponent(r?.machineId??"local")}`}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file/raw?${s.toString()}`}const ve=(e="local")=>`/api/machines/${encodeURIComponent(e)}`;function ck(e){return typeof e=="string"?e:e.id}function Hg(e){return typeof e=="string"?void 0:e.cwd}function hk(e,t="local"){return`${ve(t)}/sessions/${encodeURIComponent(ck(e))}`}function Ri(e,t,i="local"){return`${hk(e,i)}/${t}`}function hh(e,t,i="local"){return`${Ri(e,t,i)}${dk(e)}`}function $T(e,t="local"){return`${hk(e,t)}${dk(e)}`}function dk(e){const t=Hg(e);return t===void 0||t===""?"":`?${new URLSearchParams({cwd:t}).toString()}`}function qi(e,t={}){const i=Hg(e);return JSON.stringify(i===void 0||i===""?t:{cwd:i,...t})}function Fb(e){return JSON.stringify({sessions:e.map(MT)})}function MT(e){const t=ck(e),i=Hg(e);return i===void 0||i===""?{id:t}:{id:t,cwd:i}}const uk={ompWebStatus:(e="local")=>Ut(e==="local"?"/api/omp-web/status":`${ve(e)}/omp-web/status`),ompWebRuntime:()=>Ut("/api/omp-web/runtime")},AT={machines:async()=>{const e=await Ut("/api/machines");return Array.isArray(e)?e:e.machines??[]},addMachine:e=>Ut("/api/machines",{method:"POST",body:JSON.stringify(e)}),deleteMachine:e=>Ut(`/api/machines/${encodeURIComponent(e)}`,{method:"DELETE"}),health:e=>Ut(`/api/machines/${encodeURIComponent(e)}/health`),runtime:e=>Ut(`/api/machines/${encodeURIComponent(e)}/runtime`)};function Ob(e){return e===void 0?"/api/config":`${ve(e)}/config`}function BT(e){return e===void 0?"/api/plugins":`${ve(e)}/plugins`}const zs={config:e=>Ut(Ob(e)),saveConfig:(e,t)=>Ut(Ob(t),{method:"PUT",body:JSON.stringify({config:e})})},Ul={plugins:e=>Ut(BT(e))};function dh(e="",t){const i=t===void 0?"/api/pi-packages":`${ve(t)}/pi-packages`;return e===""?i:`${i}/${e}`}const Yl={packages:e=>Ut(dh("",e)),install:(e,t)=>{const i={source:e};return Ut(dh("install",t),{method:"POST",body:JSON.stringify(i)})},remove:(e,t,i)=>{const r=t===void 0?{source:e}:{source:e,scope:t};return Ut(dh("remove",i),{method:"POST",body:JSON.stringify(r)})},update:(e,t)=>{const i=e===void 0?void 0:{source:e};return Ut(dh("update",t),{method:"POST",...i===void 0?{}:{body:JSON.stringify(i)}})}},pk={workspaceActivity:(e="local")=>Ut(`${ve(e)}/activity`)},_T={projects:(e="local")=>Ut(`${ve(e)}/projects`),addProject:(e,t,i,r="local")=>Ut(`${ve(r)}/projects`,{method:"POST",body:JSON.stringify({path:e,name:t,create:i})}),closeProject:(e,t="local")=>Ut(`${ve(t)}/projects/${encodeURIComponent(e)}`,{method:"DELETE"}),projectDirectories:(e,t="local")=>Ut(`${ve(t)}/project-directories?q=${encodeURIComponent(e)}`)},kn={workspaces:(e,t="local")=>Ut(`${ve(t)}/projects/${e}/workspaces`),deleteWorkspace:(e,t,i="local")=>Ut(`${ve(i)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"}),workspaceTree:(e,t,i="",r="local")=>Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/tree?path=${encodeURIComponent(i)}`),workspaceFile:(e,t,i,r="local")=>Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file?path=${encodeURIComponent(i)}`),writeWorkspaceFile:(e,t,i,r,s,o="local")=>{const a=new URLSearchParams({path:i});s?.createDirs===!1&&a.set("createDirs","false"),s?.overwrite===!1&&a.set("overwrite","false");const n=r instanceof Uint8Array,l=n?new Uint8Array(r):new TextEncoder().encode(r);return Ut(`${ve(o)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file?${a.toString()}`,{method:"PUT",body:l,headers:{"Content-Type":n?"application/octet-stream":"text/plain"}})},deleteWorkspaceFile:(e,t,i,r="local")=>{const s=new URLSearchParams({path:i});return Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file?${s.toString()}`,{method:"DELETE"})},moveWorkspaceFile:(e,t,i,r,s,o="local")=>{const a=new URLSearchParams({fromPath:i,toPath:r});return s?.createDirs===!1&&a.set("createDirs","false"),s?.overwrite===!0&&a.set("overwrite","true"),Ut(`${ve(o)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file/move?${a.toString()}`,{method:"POST"})}},df={sessions:(e,t="local")=>Ut(`${ve(t)}/sessions?cwd=${encodeURIComponent(e)}`),startSession:(e,t="local")=>Ut(`${ve(t)}/sessions`,{method:"POST",body:JSON.stringify({cwd:e})}),cleanupPreview:(e,t="local")=>Ut(`${ve(t)}/sessions/cleanup/preview`,{method:"POST",body:JSON.stringify(e)}),cleanup:(e,t="local")=>Ut(`${ve(t)}/sessions/cleanup`,{method:"POST",body:JSON.stringify(e)}),archiveMany:(e,t="local")=>Ut(`${ve(t)}/sessions/bulk/archive`,{method:"POST",body:Fb(e)}),deleteArchivedMany:(e,t="local")=>Ut(`${ve(t)}/sessions/bulk/delete-archived`,{method:"POST",body:Fb(e)}),messages:(e,t,i="local")=>Ut(CT(e,t,i)),status:(e,t="local")=>Ut(hh(e,"status",t)),models:(e,t="local")=>Ut(hh(e,"models",t)),setModel:(e,t,i,r,s)=>{const o=typeof r=="boolean"?r:void 0;return Ut(Ri(e,"model",typeof r=="string"?r:s??"local"),{method:"POST",body:qi(e,{provider:t,modelId:i,...o===!0?{persist:!0}:{}})})},cycleModel:(e,t,i="local")=>Ut(Ri(e,"model/cycle",i),{method:"POST",body:qi(e,{direction:t})}),thinkingLevels:(e,t="local")=>Ut(hh(e,"thinking-levels",t)),setThinkingLevel:(e,t,i="local")=>Ut(Ri(e,"thinking-level",i),{method:"POST",body:qi(e,{level:t})}),cycleThinkingLevel:(e,t="local")=>Ut(Ri(e,"thinking-level/cycle",t),{method:"POST",body:qi(e)}),commands:(e,t="local")=>Ut(hh(e,"commands",t)),prompt:(e,t,i,r="local",s)=>Ut(Ri(e,"prompt",r),{method:"POST",body:qi(e,{text:t,...i===void 0?{}:{streamingBehavior:i},...s!==void 0&&s.length>0?{attachments:s}:{}})}),saveAttachments:(e,t,i="local",r)=>Ut(Ri(e,"attachments",i),{method:"POST",body:qi(e,{attachments:t,...r===void 0?{}:{folder:r}})}),shell:(e,t,i="local")=>Ut(Ri(e,"shell",i),{method:"POST",body:qi(e,{text:t})}),runCommand:(e,t,i="local")=>Ut(Ri(e,"commands/run",i),{method:"POST",body:qi(e,{text:t})}),respondToCommand:(e,t,i,r="local")=>Ut(Ri(e,"commands/respond",r),{method:"POST",body:qi(e,{requestId:t,value:i})}),respondToAsk:(e,t,i,r="local")=>Ut(Ri(e,"ask/respond",r),{method:"POST",body:qi(e,{requestId:t,result:i})}),abort:(e,t="local")=>Ut(Ri(e,"abort",t),{method:"POST",body:qi(e)}),stop:(e,t="local")=>Ut(Ri(e,"stop",t),{method:"POST",body:qi(e)}),archive:(e,t="local")=>Ut(Ri(e,"archive",t),{method:"POST",body:qi(e)}),archiveWithDescendants:(e,t="local")=>Ut(Ri(e,"archive-tree",t),{method:"POST",body:qi(e)}),restore:(e,t="local")=>Ut(Ri(e,"restore",t),{method:"POST",body:qi(e)}),deleteArchived:(e,t="local")=>Ut($T(e,t),{method:"DELETE"}),detachParent:(e,t="local")=>Ut(Ri(e,"detach-parent",t),{method:"POST",body:qi(e)}),reloadSession:(e,t="local")=>Ut(Ri(e,"reload",t),{method:"POST",body:qi(e)}),authProviders:e=>{const t=new URLSearchParams;e?.mode!==void 0&&t.set("mode",e.mode),e?.authType!==void 0&&t.set("authType",e.authType);const i=t.toString();return Ut(`${ve(e?.machineId)}/auth/providers${i===""?"":`?${i}`}`)},saveApiKey:(e,t,i="local")=>Ut(`${ve(i)}/auth/api-key`,{method:"POST",body:JSON.stringify({providerId:e,key:t})}),logoutProvider:(e,t="local")=>Ut(`${ve(t)}/auth/logout`,{method:"POST",body:JSON.stringify({providerId:e})}),startOAuthLogin:(e,t="local")=>Ut(`${ve(t)}/auth/oauth`,{method:"POST",body:JSON.stringify({providerId:e})}),oauthFlow:(e,t="local")=>Ut(`${ve(t)}/auth/oauth/${encodeURIComponent(e)}`),respondOAuthFlow:(e,t,i,r="local")=>Ut(`${ve(r)}/auth/oauth/${encodeURIComponent(e)}/respond`,{method:"POST",body:JSON.stringify({requestId:t,value:i})}),cancelOAuthFlow:(e,t="local")=>Ut(`${ve(t)}/auth/oauth/${encodeURIComponent(e)}/cancel`,{method:"POST"})},An={terminals:(e,t,i="local")=>Ut(`${ve(i)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals`),startTerminal:(e,t,i,r="local")=>Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals`,{method:"POST",body:JSON.stringify(i??{})}),closeWorkspaceTerminals:(e,t,i="local")=>Ut(`${ve(i)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals`,{method:"DELETE"}),closeTerminal:(e,t,i,r="local")=>Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals/${encodeURIComponent(i)}`,{method:"DELETE"}),continueTerminal:(e,t,i,r="local")=>Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals/${encodeURIComponent(i)}/continue`,{method:"POST"}),runTerminalCommand:(e,t,i="local")=>Ut(`${ve(i)}/projects/${encodeURIComponent(t.workspace.projectId)}/workspaces/${encodeURIComponent(t.workspace.id)}/terminal-command-runs`,{method:"POST",body:JSON.stringify({origin:e,title:t.title,command:t.command,metadata:t.metadata??{}})}),listCommandRuns:(e,t="local")=>Ut(`${ve(t)}/terminal-command-runs${PT(e)}`),getCommandRun:(e,t="local")=>LT(e,t),cancelCommandRun:(e,t="local")=>Ut(`${ve(t)}/terminal-command-runs/${encodeURIComponent(e)}/cancel`,{method:"POST"})};async function LT(e,t){const i=await fetch(`${ve(t)}/terminal-command-runs/${encodeURIComponent(e)}`);if(i.status!==404){if(!i.ok){const r=await i.json().catch(()=>({}));throw new Error(ET(r)??i.statusText)}return await i.json()}}function PT(e){if(e===void 0)return"";const t=new URLSearchParams;e.projectId!==void 0&&t.set("projectId",e.projectId),e.workspaceId!==void 0&&t.set("workspaceId",e.workspaceId),e.terminalId!==void 0&&t.set("terminalId",e.terminalId),e.statuses!==void 0&&e.statuses.length>0&&t.set("statuses",e.statuses.join(",")),e.metadata!==void 0&&Object.keys(e.metadata).length>0&&t.set("metadata",JSON.stringify(e.metadata));const i=t.toString();return i===""?"":`?${i}`}function ET(e){if(!ki(e))return;const t=e.error;return typeof t=="string"?t:void 0}const RT={files:(e,t,i={})=>{const r=new URLSearchParams({q:t});return i.kind!==void 0&&r.set("kind",i.kind),i.mode!==void 0&&r.set("mode",i.mode),i.scope!==void 0&&r.set("scope",i.scope),i.workspaceScoped===!0&&i.projectId!==void 0&&i.workspaceId!==void 0?Ut(`${ve(i.machineId)}/projects/${encodeURIComponent(i.projectId)}/workspaces/${encodeURIComponent(i.workspaceId)}/files?${r.toString()}`):(r.set("cwd",e),Ut(`${ve(i.machineId)}/files?${r.toString()}`))}},IT={gitStatus:(e,t,i="local")=>Ut(`${ve(i)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/git/status`),gitDiff:(e,t,i,r="local")=>Ut(ST(r,e,t,i))},gi={...uk,...AT,...zs,...Ul,...Yl,...pk,..._T,...kn,...df,...An,...RT,...IT};function zT(e,t="local"){const i=typeof e=="string"?void 0:e.cwd,r=i===void 0||i===""?"":`?${new URLSearchParams({cwd:i}).toString()}`,s=typeof e=="string"?e:e.id;return new WebSocket(`${Ug()}${jg(t)}/sessions/${encodeURIComponent(s)}/events${r}`)}function eet(e,t,i,r,s="local"){const o=r===void 0?"":`?cols=${encodeURIComponent(String(r.cols))}&rows=${encodeURIComponent(String(r.rows))}`;return new WebSocket(`${Ug()}${jg(s)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals/${encodeURIComponent(i)}/socket${o}`)}function DT(e="local"){return new WebSocket(`${Ug()}${jg(e)}/events`)}function jg(e){return`/api/machines/${encodeURIComponent(e)}`}function Ug(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}`}const cc=".omp-web/uploads";class Su extends Error{constructor(t="Workspace upload cancelled"){super(t),this.name="WorkspaceUploadCancelledError"}}class fk extends Error{constructor(t,i){super(UT(t)),this.name="WorkspaceUploadBatchError",this.failures=t.map(r=>({...r})),this.responses=i.map(r=>({...r}))}}function Nb(e){return e?.uploads?.defaultFolder??cc}function FT(e,t){return e?.uploads?.defaultFolder??t}function Yg(e,t){const i=Wb(e,"upload destination",{allowEmpty:!0}),r=Wb(t,"upload file name",{allowEmpty:!1});return i===""?r:`${i}/${r}`}function OT(e,t,i,r={}){const s=r.xhrFactory?.()??new XMLHttpRequest;let o=!1,a=!1;return{promise:new Promise((l,c)=>{const h=u=>{o||(o=!0,c(u))},d=u=>{o||(o=!0,l(u))};s.open("PUT",TT(e,t,i.path,qT(r)),!0),s.responseType="json",s.setRequestHeader("Content-Type",(i.contentType??i.file.type)||"application/octet-stream"),s.upload.onprogress=u=>{r.onProgress?.(HT(u,i.file.size))},s.onload=()=>{if(s.status>=200&&s.status<300){try{r.onProgress?.({loaded:i.file.size,total:i.file.size,percent:1,lengthComputable:!0}),d(gk(s))}catch(u){h(u instanceof Error?u:new Error(String(u)))}return}h(new Error(XT(s)))},s.onerror=()=>{h(new Error("Workspace upload failed"))},s.onabort=()=>{h(new Su(a?void 0:"Workspace upload aborted"))},s.send(i.file)}),cancel:()=>{o||(a=!0,s.abort())}}}function NT(e,t,i,r={}){const s=r.destinationFolder??cc,o=i.map((d,u)=>({index:u,name:d.name,path:Yg(s,d.name),loaded:0,total:d.size,percent:Gg(0,d.size),lengthComputable:!0,done:!1}));let a,n=0;const l={requested:!1},c=()=>{r.onProgress?.(jT(o,n,o.every(d=>d.done)))};return{promise:(async()=>{const d=[],u=[];for(let p=0;p<i.length;p+=1){if(l.requested)throw new Su;n=p;const f=i[p],g=o[p];if(!(f===void 0||g===void 0)){a=OT(e,t,{path:g.path,file:f},{...WT(r),onProgress:m=>{g.total=m.total,g.loaded=Math.min(m.loaded,g.total),g.percent=m.percent,g.lengthComputable=m.lengthComputable,c()}});try{const m=await a.promise;g.loaded=g.total,g.percent=1,g.lengthComputable=!0,g.done=!0,d.push(m),c()}catch(m){if(YT(m,l))throw m;const x=Je(m);g.loaded=g.total,g.percent=1,g.lengthComputable=!0,g.done=!0,g.error=x,u.push({index:p,name:f.name,path:g.path,error:x}),c()}finally{a=void 0}}}if(u.length>0)throw new fk(u,d);return d})(),cancel:()=>{l.requested=!0,a?.cancel()}}}function WT(e){return{...e.createDirs===void 0?{}:{createDirs:e.createDirs},...e.overwrite===void 0?{}:{overwrite:e.overwrite},...e.machineId===void 0?{}:{machineId:e.machineId},...e.xhrFactory===void 0?{}:{xhrFactory:e.xhrFactory}}}function qT(e){return{...e.createDirs===void 0?{}:{createDirs:e.createDirs},...e.overwrite===void 0?{}:{overwrite:e.overwrite},...e.machineId===void 0?{}:{machineId:e.machineId}}}function HT(e,t){const i=e.lengthComputable?e.total:t;return{loaded:e.loaded,total:i,percent:Gg(e.loaded,i),lengthComputable:e.lengthComputable}}function jT(e,t,i){const r=e.reduce((o,a)=>o+a.total,0),s=e.reduce((o,a)=>o+a.loaded,0);return{currentFileIndex:t,files:e.map(o=>({...o})),loaded:s,total:r,percent:Gg(s,r),done:i}}function Gg(e,t){return t<=0?e<=0?0:1:Math.max(0,Math.min(1,e/t))}function UT(e){return e.length===1?e[0]?.error??"Workspace upload failed":`${String(e.length)} files failed to upload`}function YT(e,t){return t.requested||e instanceof Su}function Wb(e,t,i){const r=e.trim();if(r===""){if(i.allowEmpty)return"";throw new Error(`${t} must not be empty`)}if(GT(r))throw new Error(`${t} must be workspace-relative`);const s=r.split(/[\\/]+/u).filter(o=>o!==""&&o!==".");if(s.length===0){if(i.allowEmpty)return"";throw new Error(`${t} must not be empty`)}if(s.some(o=>o===".."))throw new Error(`${t} must not contain path traversal`);return s.join("/")}function GT(e){const t=e.replace(/\\/g,"/");return t.startsWith("/")||/^[A-Za-z]:\//u.test(t)}function gk(e){return e.response!==void 0&&e.response!==null&&e.response!==""?e.response:e.responseText===""?{}:JSON.parse(e.responseText)}function XT(e){const t=VT(e);return ki(t)&&typeof t.error=="string"?t.error:e.statusText||`HTTP ${String(e.status)}`}function VT(e){try{return gk(e)}catch{return}}function Vh(){return{sessions:[],clientQueuedSessionMessages:{},startingSessionCount:0,fileTree:[],expandedDirs:{},selectedFilePath:void 0,selectedFileContent:void 0,fileTreeStale:!1,gitStatus:void 0,selectedDiffPath:void 0,selectedDiff:void 0,selectedStagedDiff:void 0,gitStale:!1,selectedTerminalId:void 0,error:""}}function KT(){return{machines:[],selectedMachine:void 0,isLoadingMachines:!1,machineStatuses:{},machineRuntimes:{},projects:[],workspaces:[],sessions:[],messages:[],messagePageStart:0,messagePageEnd:0,messagePageTotal:0,isLoadingEarlierMessages:!1,sendingPrompts:{},clientQueuedSessionMessages:{},startingSessionCount:0,isLoadingProjects:!1,isLoadingWorkspaces:!1,selectedProject:void 0,selectedWorkspace:void 0,selectedSession:void 0,status:void 0,activity:void 0,availableThinkingLevels:[],sessionStatuses:{},sessionActivities:{},workspaceActivities:{},machineActivities:{},workspacesByProjectId:{},workspaceDeletionRuns:{},commandDialog:void 0,planReviewDialog:void 0,askDialog:void 0,btwState:void 0,modelDialog:void 0,modelActionDialog:void 0,thinkingDialog:void 0,themeDialog:void 0,authDialog:void 0,actionPaletteOpen:!1,projectDialogOpen:!1,machineDialogOpen:!1,workspaceTool:"core:workspace.files",mainView:"chat",fileTree:[],expandedDirs:{},selectedFilePath:void 0,selectedFileContent:void 0,fileTreeStale:!1,workspaceUploadBatches:{},gitStatus:void 0,selectedDiffPath:void 0,selectedDiff:void 0,selectedStagedDiff:void 0,gitStale:!1,activeTerminalCount:0,selectedTerminalId:void 0,ompWebStatus:void 0,error:""}}const Kr={sessionsDeleteArchived:"sessions.deleteArchived",sessionsBulkMutations:"sessions.bulkMutations",sessionsCleanup:"sessions.cleanup",sessionsReload:"sessions.reload",promptAttachments:"prompt.attachments",workspaceFileSuggestions:"workspace.fileSuggestions",piPackagesManage:"piPackages.manage",selectedMachineSettings:"settings.selectedMachine"},ZT=Object.values(Kr);new Set(ZT);function vs(e,t){return e?.capabilities?.includes(t)===!0}function na(e,t){return t?.phase==="active"||e?.isStreaming===!0||e?.isBashRunning===!0||e?.isCompacting===!0||(e?.pendingMessageCount??0)>0}function mk(e){return e!==void 0&&(e.hasSessionActivity||e.hasTerminalActivity)}const bk="local";function Mp(e,t){return`${e}:${t}`}function yk(e,t){return`${e}:${t}`}function wt(e){return e.selectedMachine?.id??bk}class QT{constructor(t,i,r={}){this.getState=t,this.setState=i,this.api=r.api??pk}async refresh(t=wt(this.getState())){this.applyMachineActivitySnapshot(t,JT(await this.api.workspaceActivity(t)))}applyWorkspaceActivity(t,i=wt(this.getState())){const r=this.getState(),s=wt(r)===i,o=r.machineActivities[i]??(s?r.workspaceActivities:{}),a=t$(o,t);this.setState({machineActivities:{...r.machineActivities,[i]:a},...s?{workspaceActivities:a}:{}})}applyMachineActivitySnapshot(t,i){const r=this.getState();this.setState({machineActivities:{...r.machineActivities,[t]:i},...wt(r)===t?{workspaceActivities:i}:{}})}}function JT(e){const t={};for(const i of e.workspaces)mk(i)&&(t[i.cwd]=i);return t}function t$(e,t){const i={...e};return mk(t)?(i[t.cwd]=t,i):Object.fromEntries(Object.entries(i).filter(([r])=>r!==t.cwd))}class e${constructor(t,i,r,s={}){this.getState=t,this.setState=i,this.applyStatus=r,this.api=s.api??gi,this.pollIntervalMs=s.pollIntervalMs??1e3}dispose(){this.stopPolling()}handleSlashCommand(t){const i=i$(t);return i===void 0?!1:(i.command==="login"?this.openLogin(i.providerId):this.openLogout(i.providerId),!0)}async openLogin(t){if(t!==void 0&&t!==""){await this.openLoginProvider(t);return}this.setState({authDialog:{step:"method"}})}async chooseLoginMethod(t){try{const{providers:i}=await this.api.authProviders({mode:"login",authType:t,machineId:wt(this.getState())});this.setState({authDialog:{step:"providers",mode:"login",authType:t,providers:i}})}catch(i){this.setState({error:String(i)})}}async selectLoginProvider(t,i){const r=this.getState().authDialog;if(r?.step!=="providers")return;const s=r.providers.find(o=>o.id===t&&(i===void 0||o.authType===i));s!==void 0&&(s.authType==="oauth"?await this.startOAuth(s):this.setState({authDialog:{step:"apiKey",provider:s,value:""}}))}updateApiKey(t){const i=this.getState().authDialog;if(i?.step!=="apiKey")return;const r={...i};delete r.error,this.setState({authDialog:{...r,value:t}})}async saveApiKey(){const t=this.getState().authDialog;if(t?.step!=="apiKey")return;const i=t.value.trim();if(i===""){this.setState({authDialog:{...t,error:"API key is required"}});return}const r={...t};delete r.error,this.setState({authDialog:{...r,saving:!0}});try{await this.api.saveApiKey(t.provider.id,i,wt(this.getState())),this.closeDialog(),this.refreshStatus()}catch(s){this.setState({authDialog:{...t,saving:!1,error:String(s)}})}}async openLogout(t){try{const{providers:i}=await this.api.authProviders({mode:"logout",machineId:wt(this.getState())});if(t!==void 0&&t!==""){const r=i.find(s=>s.id===t);r!==void 0&&!this.rejectRemoteOAuth("logout",r)?await this.logoutProvider(r.id):r===void 0&&this.setState({error:`No stored credentials for ${t}`});return}this.setState({authDialog:{step:"logout",providers:i}})}catch(i){this.setState({error:String(i)})}}async logoutProvider(t){const i=this.getState().authDialog,r=i?.step==="logout"?i.providers.find(s=>s.id===t):void 0;if(!(r!==void 0&&this.rejectRemoteOAuth("logout",r)))try{await this.api.logoutProvider(t,wt(this.getState())),this.closeDialog(),this.refreshStatus()}catch(s){this.setState({error:String(s)})}}updateOAuthInput(t){const i=this.getState().authDialog;if(i?.step!=="oauth")return;const r={...i};delete r.error,this.setState({authDialog:{...r,inputValue:t}})}async respondOAuth(t){const i=this.getState().authDialog;if(i?.step!=="oauth")return;const r=i.flow.prompt??i.flow.select;if(r===void 0)return;const s=t??i.inputValue??"",o={...i};delete o.error,this.setState({authDialog:{...o,responding:!0}});try{const a=await this.api.respondOAuthFlow(i.flow.flowId,r.requestId,s,wt(this.getState()));this.updateOAuthFlow(a)}catch(a){this.setState({authDialog:{...i,responding:!1,error:String(a)}})}}async cancelOAuth(){const t=this.getState().authDialog;if(t?.step!=="oauth"){this.closeDialog();return}this.stopPolling();try{await this.api.cancelOAuthFlow(t.flow.flowId,wt(this.getState()))}catch{}this.closeDialog()}closeDialog(){this.stopPolling(),this.setState({authDialog:void 0})}async openLoginProvider(t){try{const{providers:i}=await this.api.authProviders({mode:"login",machineId:wt(this.getState())}),r=i.filter(o=>o.id===t);if(r.length===0){this.setState({error:`Auth provider not found: ${t}`});return}if(r.length>1){this.setState({authDialog:{step:"providers",mode:"login",providers:r}});return}const s=r[0];if(s===void 0)return;s.authType==="oauth"?await this.startOAuth(s):this.setState({authDialog:{step:"apiKey",provider:s,value:""}})}catch(i){this.setState({error:String(i)})}}async startOAuth(t){if(!this.rejectRemoteOAuth("login",t))try{const i=await this.api.startOAuthLogin(t.id,wt(this.getState()));this.updateOAuthFlow(i),this.startPolling(i.flowId)}catch(i){this.setState({error:String(i)})}}rejectRemoteOAuth(t,i){const r=this.getState().selectedMachine;if(i.authType!=="oauth"||r?.kind!=="remote")return!1;const s=r.baseUrl??"that remote PI WEB instance";return this.setState({error:`OAuth ${t} for remote machines must be configured directly on ${s}.`}),!0}updateOAuthFlow(t){if(t.status==="complete"){this.stopPolling(),this.closeDialog(),this.refreshStatus();return}(t.status==="error"||t.status==="cancelled")&&this.stopPolling();const i=this.getState().authDialog,r=i?.step==="oauth"&&i.flow.flowId===t.flowId?i.inputValue??"":"",s=i?.step==="oauth"?i.flow.prompt?.requestId??i.flow.select?.requestId:void 0,o=t.prompt?.requestId??t.select?.requestId,a=s!==void 0&&s===o,n=a?r:"",l=a&&i?.step==="oauth"?i.responding===!0:!1;this.setState({authDialog:{step:"oauth",flow:t,inputValue:n,responding:l}})}startPolling(t){this.stopPolling(),this.pollTimer=window.setInterval(()=>{this.poll(t)},this.pollIntervalMs)}stopPolling(){this.pollTimer!==void 0&&(window.clearInterval(this.pollTimer),this.pollTimer=void 0)}async poll(t){const i=this.getState().authDialog;if(i?.step!=="oauth"||i.flow.flowId!==t){this.stopPolling();return}try{this.updateOAuthFlow(await this.api.oauthFlow(t,wt(this.getState())))}catch(r){this.stopPolling(),this.setState({authDialog:{...i,error:String(r)}})}}async refreshStatus(){const t=this.session();if(t!==void 0)try{this.applyStatus(await this.api.status(t,wt(this.getState())))}catch{}}session(){const t=this.getState().selectedSession;if(!(t===void 0||t.archived===!0))return t}}function i$(e){const t=e.trim(),i=/^\/(login|logout)(?:\s+(\S+))?\s*$/u.exec(t);if(i===null)return;const r=i[1];if(r!=="login"&&r!=="logout")return;const s=i[2];return s===void 0||s===""?{command:r}:{command:r,providerId:s}}function zc(e){return e.replaceAll(":",".")}function r$(e){const t=new URLSearchParams(window.location.search),i=`${e}--`,r={};for(const[s,o]of t.entries()){if(!s.startsWith(i))continue;const a=s.slice(i.length),n=r[a];n===void 0?r[a]=o:Array.isArray(n)?n.push(o):r[a]=[n,o]}return r}function Ap(e,t){const i=r$(e)[t];return Array.isArray(i)?i[0]:i===""?void 0:i}function ps(e,t,i,r){const s=new URL(window.location.href),o=`${e}--${t}`;if(s.searchParams.delete(o),i!=null&&i!=="")if(Array.isArray(i))for(const a of i)s.searchParams.append(o,String(a));else s.searchParams.set(o,String(i));s$(s,r)}function s$(e,t){const i=`${e.pathname}${e.search}${e.hash}`,r=`${window.location.pathname}${window.location.search}${window.location.hash}`;i!==r&&(t?.replace===!0?window.history.replaceState({},"",e):window.history.pushState({},"",e))}function o$(e){const t=e.files.map((r,s)=>{const o=r.size;return{index:s,name:r.name,path:Yg(e.destinationFolder,r.name),size:r.size,loaded:0,total:o,percent:Hb(0,o),lengthComputable:!0,status:s===0?"uploading":"pending"}}),i=t.reduce((r,s)=>r+s.total,0);return{id:e.id,projectId:e.projectId,workspaceId:e.workspaceId,machineId:e.machineId,destinationFolder:e.destinationFolder,overwrite:e.overwrite,createDirs:e.createDirs,files:t,currentFileIndex:t.length===0?-1:0,loaded:0,total:i,percent:Hb(0,i),status:"uploading",startedAt:e.startedAt}}function a$(e,t){const i=new Map(t.files.map(s=>[s.index,s])),r=e.files.map(s=>{const o=i.get(s.index);if(o===void 0)return s;const a={...s,path:o.path,loaded:o.loaded,total:o.total,percent:o.percent,lengthComputable:o.lengthComputable,status:o.error!==void 0?"error":o.done?"completed":t.currentFileIndex===s.index?"uploading":s.status};return o.error===void 0?delete a.error:a.error=o.error,a});return{...e,files:r,currentFileIndex:t.currentFileIndex,loaded:t.loaded,total:t.total,percent:t.percent}}function n$(e,t,i){const r=e.files.map((o,a)=>{const n=t[a];return{...o,...n===void 0?{}:{path:n.path,response:n},loaded:o.total,percent:1,lengthComputable:!0,status:"completed"}}),s=Xg(r);return{...e,files:r,currentFileIndex:r.length===0?-1:r.length-1,...s,status:"completed",completedAt:i}}function l$(e,t,i){const r=e.files.map(s=>s.status==="completed"||s.status==="error"?s:s.status==="uploading"||s.index===e.currentFileIndex?{...s,status:"error",error:t}:{...s,status:"cancelled",error:"Not uploaded because an earlier file failed."});return{...e,files:r,...Xg(r),status:"error",error:t,completedAt:i}}function qb(e,t){const i="Upload cancelled",r=e.files.map(s=>s.status==="completed"||s.status==="error"?s:{...s,status:"cancelled",error:i});return{...e,files:r,...Xg(r),status:"cancelled",error:i,completedAt:t}}function Xg(e){const t=e.reduce((i,r)=>i+r.total,0);return{loaded:t,total:t,percent:e.length===0?0:1}}function Hb(e,t){return t<=0?e<=0?0:1:Math.max(0,Math.min(1,e/t))}const jb=zc("core:workspace.files");class c${constructor(t,i,r,s={}){this.getState=t,this.setState=i,this.updateUrl=r,this.uploadTasks=new Map,this.uploadBatchSequence=0,this.api=s.api??gi,this.uploadWorkspaceFiles=s.uploadWorkspaceFiles??NT,this.createUploadBatchId=s.createUploadBatchId??(()=>(this.uploadBatchSequence+=1,`workspace-upload-${String(this.uploadBatchSequence)}`)),this.now=s.now??(()=>new Date().toISOString())}async refreshFiles(){const t=this.getState().selectedProject,i=this.getState().selectedWorkspace;if(!(t===void 0||i===void 0))try{const r=wt(this.getState()),s=await this.api.workspaceTree(t.id,i.id,"",r),o={...this.getState().expandedDirs};await Promise.all(Object.keys(o).map(async a=>{o[a]=(await this.api.workspaceTree(t.id,i.id,a,r)).entries})),this.setState({fileTree:s.entries,expandedDirs:o,fileTreeStale:!1,error:""})}catch(r){this.setState({error:String(r)})}}async expandDir(t){const i=this.getState().selectedProject,r=this.getState().selectedWorkspace;if(!(i===void 0||r===void 0)){if(this.getState().expandedDirs[t]!==void 0){this.setState({expandedDirs:Ub(this.getState().expandedDirs,t)});return}try{const s=await this.api.workspaceTree(i.id,r.id,t,wt(this.getState()));this.setState({expandedDirs:{...this.getState().expandedDirs,[t]:s.entries},error:""})}catch(s){this.setState({error:String(s)})}}}async selectFile(t){this.setState({selectedFilePath:t,selectedFileContent:void 0,workspaceTool:"core:workspace.files",mainView:this.getState().mainView==="chat"?"chat":"core:workspace.files"}),ps(jb,"file",t),this.updateUrl({replace:!0}),await this.restoreFile(t)}async restoreFile(t){const i=this.getState().selectedProject,r=this.getState().selectedWorkspace;if(!(i===void 0||r===void 0)){this.setState({selectedFilePath:t,selectedFileContent:void 0});try{const s=await this.api.workspaceFile(i.id,r.id,t,wt(this.getState()));this.getState().selectedFilePath===t&&this.setState({selectedFileContent:s,error:""})}catch(s){if(this.getState().selectedFilePath!==t)return;if(h$(s)){this.setState({selectedFilePath:void 0,selectedFileContent:void 0,error:""}),ps(jb,"file",void 0,{replace:!0}),this.updateUrl({replace:!0});return}this.setState({error:String(s)})}}}startWorkspaceUpload(t,i){const r=this.getState().selectedProject,s=this.getState().selectedWorkspace;if(r===void 0||s===void 0){this.setState({error:"Select a workspace before uploading files."});return}if(t.length===0)return;const o=wt(this.getState()),a=i.overwrite??!1,n=i.createDirs??!0;let l;try{l=o$({id:this.createUploadBatchId(),projectId:r.id,workspaceId:s.id,machineId:o,destinationFolder:i.destinationFolder,overwrite:a,createDirs:n,files:t,startedAt:this.now()})}catch(d){this.setState({error:String(d)});return}this.setUploadBatch(l);let c;try{c=this.uploadWorkspaceFiles(r.id,s.id,t,{destinationFolder:i.destinationFolder,machineId:o,overwrite:a,createDirs:n,onProgress:d=>{this.updateUploadProgress(l.id,d)}})}catch(d){return this.failUploadBatch(l.id,d),{batchId:l.id,done:Promise.resolve()}}this.uploadTasks.set(l.id,c);const h=c.promise.then(async d=>{await this.completeUploadBatch(l.id,d,i)}).catch(async d=>{await this.handleUploadFailure(l.id,d,i)}).finally(()=>{this.uploadTasks.delete(l.id)});return{batchId:l.id,done:h}}cancelWorkspaceUpload(t){const i=this.getUploadBatch(t);i?.status==="uploading"&&(this.setUploadBatch(qb(i,this.now())),this.uploadTasks.get(t)?.cancel())}clearWorkspaceUpload(t){this.uploadTasks.get(t)?.cancel(),this.uploadTasks.delete(t),this.setState({workspaceUploadBatches:Ub(this.getState().workspaceUploadBatches,t)})}updateUploadProgress(t,i){const r=this.getUploadBatch(t);r?.status==="uploading"&&this.setUploadBatch(a$(r,i))}async completeUploadBatch(t,i,r){const s=this.getUploadBatch(t);if(s?.status!=="uploading"||(this.setUploadBatch(n$(s,i,this.now()),{error:""}),!this.isCurrentWorkspaceBatch(s)))return;await this.refreshFiles();const o=i[0]?.path;r.selectUploadedFile!==!1&&o!==void 0&&this.isCurrentWorkspaceBatch(s)&&await this.selectFile(o)}async handleUploadFailure(t,i,r){const s=this.failUploadBatch(t,i);if(!(i instanceof fk)||i.responses.length===0||s===void 0||!this.isCurrentWorkspaceBatch(s))return;await this.refreshFiles();const o=i.responses[0]?.path;r.selectUploadedFile!==!1&&o!==void 0&&this.isCurrentWorkspaceBatch(s)&&await this.selectFile(o)}failUploadBatch(t,i){const r=this.getUploadBatch(t);if(r?.status!=="uploading")return;if(d$(i)){const a=qb(r,this.now());return this.setUploadBatch(a),a}const s=Je(i),o=l$(r,s,this.now());return this.setUploadBatch(o,{error:s}),o}getUploadBatch(t){return this.getState().workspaceUploadBatches[t]}setUploadBatch(t,i={}){this.setState({workspaceUploadBatches:{...this.getState().workspaceUploadBatches,[t.id]:t},...i})}isCurrentWorkspaceBatch(t){const i=this.getState();return i.selectedProject?.id===t.projectId&&i.selectedWorkspace?.id===t.workspaceId&&wt(i)===t.machineId}}function h$(e){const t=String(e);return t.includes("Path does not exist")||t.includes("ENOENT")||t.includes("no such file or directory")}function d$(e){return e instanceof Su}function Ub(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>i!==t))}const Yb=zc("core:workspace.git");class u${constructor(t,i,r){this.getState=t,this.setState=i,this.updateUrl=r}dispose(){this.pollTimer!==void 0&&window.clearInterval(this.pollTimer),this.pollTimer=void 0}async refreshGit(){const t=this.getState().selectedProject,i=this.getState().selectedWorkspace;if(!(t===void 0||i===void 0))try{const r=await gi.gitStatus(t.id,i.id,wt(this.getState()));this.setState({gitStatus:r,gitStale:!1,error:""});const s=this.getState().selectedDiffPath;s!==void 0&&(r.files.some(o=>o.path===s)?await this.refreshDiff(s):(this.setState({selectedDiffPath:void 0,selectedDiff:void 0,selectedStagedDiff:void 0}),ps(Yb,"diff",void 0,{replace:!0})))}catch(r){this.setState({error:String(r)})}}async selectDiff(t){this.setState({selectedDiffPath:t,selectedDiff:void 0,selectedStagedDiff:void 0,workspaceTool:"core:workspace.git",mainView:this.getState().mainView==="chat"?"chat":"core:workspace.git"}),ps(Yb,"diff",t),this.updateUrl({replace:!0}),await this.refreshDiff(t)}async restoreDiff(t){this.setState({selectedDiffPath:t,selectedDiff:void 0,selectedStagedDiff:void 0}),await this.refreshDiff(t)}async refreshDiff(t){const i=this.getState().selectedProject,r=this.getState().selectedWorkspace;if(!(i===void 0||r===void 0))try{const[s,o]=await Promise.all([gi.gitDiff(i.id,r.id,{path:t},wt(this.getState())),gi.gitDiff(i.id,r.id,{path:t,staged:!0},wt(this.getState()))]);this.setState({selectedDiff:s,selectedStagedDiff:o,error:""})}catch(s){this.setState({error:String(s)})}}updatePolling(){this.dispose();const t=this.getState();(t.workspaceTool==="core:workspace.git"||t.mainView==="core:workspace.git")&&(this.pollTimer=window.setInterval(()=>{this.refreshGit()},8e3))}}class p${constructor(t,i,r,s){this.getState=t,this.setState=i,this.updateUrl=r,this.projects=s}async loadMachines(t){this.setState({error:"",isLoadingMachines:!0});try{const i=await gi.machines(),r=await this.selectInitialMachine(i,t),s=new Set(i.map(o=>o.id));this.setState({machines:i,selectedMachine:r,machineActivities:Gb(this.getState().machineActivities,s),machineRuntimes:Gb(this.getState().machineRuntimes,s)}),this.refreshMachineHealthFor(i),this.refreshMachineRuntimeFor(i)}catch(i){this.setState({error:String(i)})}finally{this.setState({isLoadingMachines:!1})}}async selectMachine(t,i={}){this.getState().selectedMachine?.id!==t.id&&(this.setState({selectedMachine:t,projects:[],workspaces:[],isLoadingWorkspaces:!1,selectedProject:void 0,selectedWorkspace:void 0,selectedSession:void 0,messages:[],messagePageStart:0,messagePageTotal:0,status:void 0,activity:void 0,sessionStatuses:{},sessionActivities:{},sendingPrompts:{},workspaceActivities:{},workspacesByProjectId:{},workspaceDeletionRuns:{},activeTerminalCount:0,...Vh()}),i.updateUrl!==!1&&this.updateUrl(),await this.projects.loadProjects(),this.refreshMachineHealth(t.id),this.refreshMachineRuntime(t.id))}async addMachine(t){this.setState({error:""});try{const i=await gi.addMachine(t);return this.setState({machines:[...this.getState().machines.filter(r=>r.id!==i.id),i]}),await this.selectMachine(i),i}catch(i){this.setState({error:String(i)});return}}async deleteMachine(t=this.getState().selectedMachine,i={}){if(t!==void 0){if(t.kind==="local"){this.setState({error:"The local machine cannot be removed."});return}try{const r=this.getState().selectedMachine?.id===t.id;await gi.deleteMachine(t.id);const s=this.getState().machines.filter(a=>a.id!==t.id),o=s.find(a=>a.id==="local")??s[0];return this.setState({machines:s,machineStatuses:Bp(this.getState().machineStatuses,t.id),machineRuntimes:Bp(this.getState().machineRuntimes,t.id),machineActivities:Bp(this.getState().machineActivities,t.id)}),r&&o!==void 0?(i.selectFallback===!1||await this.selectMachine(o),o):void 0}catch(r){this.setState({error:String(r)});return}}}async refreshMachineHealth(t=this.getState().selectedMachine?.id??"local"){try{const i=await gi.health(t);return this.setState({machineStatuses:{...this.getState().machineStatuses,[i.machineId]:i}}),i}catch(i){this.setState({error:String(i)});return}}async refreshMachineRuntime(t=this.getState().selectedMachine?.id??"local"){try{const i=await gi.runtime(t);this.setState({machineRuntimes:{...this.getState().machineRuntimes,[i.machineId]:i}})}catch(i){this.setState({error:String(i)})}}async selectInitialMachine(t,i){const r=t.find(o=>o.id===(i??"local"));if(r===void 0)return this.localMachine(t);if(r.kind!=="remote")return r;const s=await this.safeRemoteHealth(r);return this.setState({machineStatuses:{...this.getState().machineStatuses,[s.machineId]:s},...s.ok?{}:{error:`${r.name} is unavailable; reconnecting…`}}),r}async safeRemoteHealth(t){try{return await gi.health(t.id)}catch(i){return{machineId:t.id,ok:!1,checkedAt:new Date().toISOString(),status:"offline",error:i instanceof Error?i.message:String(i)}}}localMachine(t){return t.find(i=>i.id==="local")??t[0]}async refreshMachineHealthFor(t){const i=await Promise.allSettled(t.map(s=>gi.health(s.id))),r=Object.fromEntries(i.flatMap(s=>s.status==="fulfilled"?[[s.value.machineId,s.value]]:[]));Object.keys(r).length>0&&this.setState({machineStatuses:{...this.getState().machineStatuses,...r}})}async refreshMachineRuntimeFor(t){const i=await Promise.allSettled(t.map(s=>gi.runtime(s.id))),r=Object.fromEntries(i.flatMap(s=>s.status==="fulfilled"?[[s.value.machineId,s.value]]:[]));Object.keys(r).length>0&&this.setState({machineRuntimes:{...this.getState().machineRuntimes,...r}})}}function Bp(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>i!==t))}function Gb(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>t.has(i)))}class f${constructor(t,i,r){this.getState=t,this.setState=i,this.workspaces=r}async loadProjects(){const t=wt(this.getState());this.setState({error:"",isLoadingProjects:!0});try{const i=await gi.projects(t);if(wt(this.getState())!==t)return;const r=new Set(i.map(o=>o.id)),s=Object.fromEntries(Object.entries(this.getState().workspacesByProjectId).filter(([o])=>r.has(o)));this.setState({projects:i,workspacesByProjectId:s})}catch(i){wt(this.getState())===t&&this.setState({error:String(i)})}finally{wt(this.getState())===t&&this.setState({isLoadingProjects:!1})}}async addProject(t,i){if(t.trim()!=="")try{const r=await gi.addProject(t.trim(),void 0,i,wt(this.getState())),s=this.getState().projects;this.setState({projects:[...s.filter(o=>o.id!==r.id),r],projectDialogOpen:!1}),await this.workspaces.selectProject(r)}catch(r){this.setState({error:String(r)})}}async closeProject(t){try{await gi.closeProject(t,wt(this.getState())),this.workspaces.forgetProject(t);const i=this.getState();this.setState({projects:i.projects.filter(r=>r.id!==t)}),i.selectedProject?.id===t&&this.workspaces.clearSelection()}catch(i){this.setState({error:String(i)})}}}const uf="omp-web:cached-new-sessions:v1",g$="browserCachedNew",ul="local";function Dc(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}function Xb(e,t=ul,i=Dc()){if(e.messageCount!==0||e.archived===!0)return;const r=Vg(i).filter(s=>s.id!==e.id||s.machineId!==t);Kg([pf(e,t),...r],i)}function pf(e,t=ul){return{...e,browserCachedNew:!0,machineId:t}}function Vb(e,t=ul,i=Dc()){const r=Vg(i).filter(s=>s.id!==e||s.machineId!==t);Kg(r,i)}function xk(e,t,i=ul,r=Dc()){const s=new Set(t.map(l=>l.id)),o=Vg(r),a=o.filter(l=>l.machineId!==i||!s.has(l.id));return a.length!==o.length&&Kg(a,r),[...a.filter(l=>l.machineId===i&&l.cwd===e),...t]}function vd(e){return e===void 0?!1:y$(e)&&e.browserCachedNew===!0}function m$(e){return{id:e.id,path:e.path,cwd:e.cwd,...e.persisted===void 0?{}:{persisted:e.persisted},...e.name===void 0?{}:{name:e.name},created:e.created,modified:e.modified,messageCount:e.messageCount,firstMessage:e.firstMessage,...e.parentSessionPath===void 0?{}:{parentSessionPath:e.parentSessionPath},..."machineId"in e&&typeof e.machineId=="string"?{machineId:e.machineId}:{machineId:ul},...e.archived===!0?{archived:!0}:{},...e.archivedAt===void 0?{}:{archivedAt:e.archivedAt}}}function Vg(e=Dc()){try{const t=e?.getItem(uf);if(t==null||t==="")return[];const i=JSON.parse(t);return Array.isArray(i)?i.flatMap(r=>b$(r)):[]}catch{return[]}}function Kg(e,t=Dc()){try{e.length===0?t?.removeItem(uf):t?.setItem(uf,JSON.stringify(e))}catch{}}function b$(e){if(!ki(e))return[];const t=ln(e,"id"),i=ln(e,"path"),r=ln(e,"cwd"),s=ln(e,"created"),o=ln(e,"modified"),a=ln(e,"firstMessage"),n=x$(e,"messageCount");if(t===void 0||i===void 0||r===void 0||s===void 0||o===void 0||a===void 0||n!==0)return[];const l=_p(e,"name"),c=_p(e,"parentSessionPath"),h=_p(e,"machineId")??ul;return[{id:t,path:i,cwd:r,...l===void 0?{}:{name:l},created:s,modified:o,messageCount:n,firstMessage:a,...c===void 0?{}:{parentSessionPath:c},machineId:h,browserCachedNew:!0}]}function y$(e){return g$ in e}function ln(e,t){const i=e[t];return typeof i=="string"?i:void 0}function _p(e,t){const i=e[t];return i===void 0||typeof i!="string"?void 0:i}function x$(e,t){const i=e[t];return typeof i=="number"?i:void 0}function v$(e){return D$(e.flatMap(Zg)).filter(t=>t.parts.length>0)}function Ns(e,t){return{role:e,parts:[{type:"text",text:t}]}}function cn(e,t){const i=B$(t);return i===void 0?e:{...e,meta:i}}function w$(e,t,i,r){if(i===""&&r===void 0)return e;const s=e.at(-1),o=s?.parts.at(-1);if(s?.role===t&&o?.type==="text"){const n=r!==void 0?r.length>=o.text.length?r:o.text:o.text+i;return n===o.text?e:[...e.slice(0,-1),{...s,parts:[...s.parts.slice(0,-1),{...o,text:n}]}]}const a=r!==void 0?r:i;return s?.role===t?[...e.slice(0,-1),{...s,parts:[...s.parts,{type:"text",text:a}]}]:[...e,Ns(t,a)]}function k$(e,t,i){if(t===""&&i===void 0)return e;const r=e.at(-1),s=r?.parts.at(-1);if(r?.role==="assistant"&&s?.type==="thinking"){const a=i!==void 0?i.length>=s.text.length?i:s.text:s.text+t;return a===s.text?e:[...e.slice(0,-1),{...r,parts:[...r.parts.slice(0,-1),{...s,text:a}]}]}const o=i!==void 0?i:t;return r?.role==="assistant"?[...e.slice(0,-1),{...r,parts:[...r.parts,{type:"thinking",text:o}]}]:[...e,{role:"assistant",parts:[{type:"thinking",text:o}]}]}function Zg(e){if(C$(e))return[e];if(Ie(e,"role")==="bashExecution")return[cn(P$(e),e)];const t=$$(e);if(t!==void 0)return t.map(h=>cn(h,e));const i=E$(Ie(e,"role")),r=R$(ts(e,"content"),e),s=i==="user"?T$(r):void 0;if(s!==void 0)return s.map(h=>cn(h,e));const o=A$(e);if(i==="tool")return[cn({role:i,parts:r,...o===void 0?{}:{source:o}},e)];const a=r.filter(h=>h.type!=="empty"),n=i==="assistant"&&a.length>0&&a.every(h=>h.type==="skillRead")?"skill":i,l=a.length>0?[cn({role:n,parts:a,...o===void 0?{}:{source:o}},e)]:[],c=S$(e);return c===void 0?l:[...l,cn(c,e)]}function S$(e){if(Ie(e,"role")!=="assistant"||Ie(e,"stopReason")!=="error")return;const t=Ie(e,"errorMessage")?.trim();return Ns("system",`Model response failed: ${t===void 0||t===""?"The model returned an error.":t}`)}function C$(e){const t=Ie(e,"role");return(t==="user"||t==="assistant"||t==="tool"||t==="system"||t==="bash"||t==="skill")&&Array.isArray(ts(e,"parts"))}function T$(e){if(e.length!==1||e[0]?.type!=="text")return;const t=M$(e[0].text);if(t!==void 0)return[{role:"user",parts:[{type:"skillInvocation",name:t.name,location:t.location,content:t.content}]},...t.userMessage===void 0?[]:[{role:"user",parts:[{type:"text",text:t.userMessage}]}]]}function $$(e){if(!ki(e)||e.customType!=="skill-prompt")return;const t=ki(e.details)?e.details:void 0,i=typeof t?.name=="string"?t.name:"skill",r=typeof t?.path=="string"?t.path:"",s=typeof e.content=="string"?e.content:"",o=typeof t?.args=="string"&&t.args.trim()!==""?t.args.trim():void 0;return[{role:"user",parts:[{type:"skillInvocation",name:i,location:r,content:s},...o!==void 0?[{type:"text",text:o}]:[]]}]}function M$(e){const t=/^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/.exec(e);if(t!==null){const r=t[4]?.trim();return{name:t[1]??"skill",location:t[2]??"",content:t[3]??"",...r===void 0||r===""?{}:{userMessage:r}}}const i=/^\[IMPORTANT: User invoked the "([^"]+)" skill; follow its instructions\. Full skill below\.\]\n\n([\s\S]*?)(?:\n\n---\n\n\[Skill directory: ([^\]]+)\][\s\S]*?(?:\nUser: ([\s\S]+))?)?$/.exec(e);if(i!==null){const r=i[4]?.trim();return{name:i[1]??"skill",location:i[3]??"",content:i[2]??"",...r===void 0||r===""?{}:{userMessage:r}}}}function A$(e){const t=Ie(e,"source");if(t==="compaction"||t==="branch_summary")return t}function B$(e){const t=_$(ts(e,"timestamp")),i=L$(e);if(!(t===void 0&&i===void 0))return{...t===void 0?{}:{timestamp:t},...i===void 0?{}:{model:i}}}function _$(e){if(typeof e=="number"&&Number.isFinite(e))return new Date(e).toISOString();if(typeof e!="string"||e==="")return;const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():void 0}function L$(e){if(Ie(e,"role")!=="assistant")return;const t=Ie(e,"provider"),i=Ie(e,"model"),r=Ie(e,"responseModel");if(!((t===void 0||t==="")&&(i===void 0||i==="")&&(r===void 0||r==="")))return{...t===void 0||t===""?{}:{provider:t},...i===void 0||i===""?{}:{id:i},...r===void 0||r===""?{}:{responseId:r}}}function P$(e){const t=Ie(e,"command")??"",i=Kh(e,"excludeFromContext")===!0?["excluded from context","",`$ ${t}`]:[`$ ${t}`],r=ts(e,"output");r!=null&&i.push("",kd(r));const s=ts(e,"exitCode");s!=null&&i.push("",`exit ${kd(s)}`),Kh(e,"cancelled")===!0&&i.push("","cancelled"),Kh(e,"truncated")===!0&&i.push("","output truncated");const o=Ie(e,"fullOutputPath");return o!==void 0&&o!==""&&i.push("",`full output: ${o}`),{role:"bash",parts:[{type:"text",text:i.join(`
4
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Eb=/'/g,Rb=/"/g,sk=/^(?:script|style|textarea|title)$/i,ok=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),T=ok(1),Dr=ok(2),aa=Symbol.for("lit-noChange"),Qe=Symbol.for("lit-nothing"),Ib=new WeakMap,Da=Ya.createTreeWalker(Ya,129);function ak(e,t){if(!Wg(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return _b!==void 0?_b.createHTML(t):t}const nT=(e,t)=>{const i=e.length-1,r=[];let s,o=t===2?"<svg>":t===3?"<math>":"",a=Ml;for(let n=0;n<i;n++){const l=e[n];let c,h,d=-1,u=0;for(;u<l.length&&(a.lastIndex=u,h=a.exec(l),h!==null);)u=a.lastIndex,a===Ml?h[1]==="!--"?a=Lb:h[1]!==void 0?a=Pb:h[2]!==void 0?(sk.test(h[2])&&(s=RegExp("</"+h[2],"g")),a=Ca):h[3]!==void 0&&(a=Ca):a===Ca?h[0]===">"?(a=s??Ml,d=-1):h[1]===void 0?d=-2:(d=a.lastIndex-h[2].length,c=h[1],a=h[3]===void 0?Ca:h[3]==='"'?Rb:Eb):a===Rb||a===Eb?a=Ca:a===Lb||a===Pb?a=Ml:(a=Ca,s=void 0);const p=a===Ca&&e[n+1].startsWith("/>")?" ":"";o+=a===Ml?l+oT:d>=0?(r.push(c),l.slice(0,d)+ik+l.slice(d)+ta+p):l+ta+(d===-2?n:p)}return[ak(e,o+(e[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};let hf=class nk{constructor({strings:t,_$litType$:i},r){let s;this.parts=[];let o=0,a=0;const n=t.length-1,l=this.parts,[c,h]=nT(t,i);if(this.el=nk.createElement(c,r),Da.currentNode=this.el.content,i===2||i===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=Da.nextNode())!==null&&l.length<n;){if(s.nodeType===1){if(s.hasAttributes())for(const d of s.getAttributeNames())if(d.endsWith(ik)){const u=h[a++],p=s.getAttribute(d).split(ta),f=/([.?@])?(.*)/.exec(u);l.push({type:1,index:o,name:f[2],strings:p,ctor:f[1]==="."?cT:f[1]==="?"?hT:f[1]==="@"?dT:ku}),s.removeAttribute(d)}else d.startsWith(ta)&&(l.push({type:6,index:o}),s.removeAttribute(d));if(sk.test(s.tagName)){const d=s.textContent.split(ta),u=d.length-1;if(u>0){s.textContent=xd?xd.emptyScript:"";for(let p=0;p<u;p++)s.append(d[p],xc()),Da.nextNode(),l.push({type:2,index:++o});s.append(d[u],xc())}}}else if(s.nodeType===8)if(s.data===rk)l.push({type:2,index:o});else{let d=-1;for(;(d=s.data.indexOf(ta,d+1))!==-1;)l.push({type:7,index:o}),d+=ta.length-1}o++}}static createElement(t,i){const r=Ya.createElement("template");return r.innerHTML=t,r}};function Qn(e,t,i=e,r){if(t===aa)return t;let s=r!==void 0?i._$Co?.[r]:i._$Cl;const o=vc(t)?void 0:t._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),o===void 0?s=void 0:(s=new o(e),s._$AT(e,i,r)),r!==void 0?(i._$Co??=[])[r]=s:i._$Cl=s),s!==void 0&&(t=Qn(e,s._$AS(e,t.values),s,r)),t}let lT=class{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:r}=this._$AD,s=(t?.creationScope??Ya).importNode(i,!0);Da.currentNode=s;let o=Da.nextNode(),a=0,n=0,l=r[0];for(;l!==void 0;){if(a===l.index){let c;l.type===2?c=new wu(o,o.nextSibling,this,t):l.type===1?c=new l.ctor(o,l.name,l.strings,this,t):l.type===6&&(c=new uT(o,this,t)),this._$AV.push(c),l=r[++n]}a!==l?.index&&(o=Da.nextNode(),a++)}return Da.currentNode=Ya,s}p(t){let i=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,i),i+=r.strings.length-2):r._$AI(t[i])),i++}},wu=class lk{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,r,s){this.type=2,this._$AH=Qe,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=Qn(this,t,i),vc(t)?t===Qe||t==null||t===""?(this._$AH!==Qe&&this._$AR(),this._$AH=Qe):t!==this._$AH&&t!==aa&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):aT(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==Qe&&vc(this._$AH)?this._$AA.nextSibling.data=t:this.T(Ya.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:r}=t,s=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=hf.createElement(ak(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(i);else{const o=new lT(s,this),a=o.u(this.options);o.p(i),this.T(a),this._$AH=o}}_$AC(t){let i=Ib.get(t.strings);return i===void 0&&Ib.set(t.strings,i=new hf(t)),i}k(t){Wg(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let r,s=0;for(const o of t)s===i.length?i.push(r=new lk(this.O(xc()),this.O(xc()),this,this.options)):r=i[s],r._$AI(o),s++;s<i.length&&(this._$AR(r&&r._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){const r=Bb(t).nextSibling;Bb(t).remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},ku=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,r,s,o){this.type=1,this._$AH=Qe,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Qe}_$AI(t,i=this,r,s){const o=this.strings;let a=!1;if(o===void 0)t=Qn(this,t,i,0),a=!vc(t)||t!==this._$AH&&t!==aa,a&&(this._$AH=t);else{const n=t;let l,c;for(t=o[0],l=0;l<o.length-1;l++)c=Qn(this,n[r+l],i,l),c===aa&&(c=this._$AH[l]),a||=!vc(c)||c!==this._$AH[l],c===Qe?t=Qe:t!==Qe&&(t+=(c??"")+o[l+1]),this._$AH[l]=c}a&&!s&&this.j(t)}j(t){t===Qe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},cT=class extends ku{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Qe?void 0:t}},hT=class extends ku{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Qe)}},dT=class extends ku{constructor(t,i,r,s,o){super(t,i,r,s,o),this.type=5}_$AI(t,i=this){if((t=Qn(this,t,i,0)??Qe)===aa)return;const r=this._$AH,s=t===Qe&&r!==Qe||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==Qe&&(r===Qe||s);s&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},uT=class{constructor(t,i,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){Qn(this,t)}};const pT={I:wu},fT=Ng.litHtmlPolyfillSupport;fT?.(hf,wu),(Ng.litHtmlVersions??=[]).push("3.3.3");const gT=(e,t,i)=>{const r=i?.renderBefore??t;let s=r._$litPart$;if(s===void 0){const o=i?.renderBefore??null;r._$litPart$=s=new wu(t.insertBefore(xc(),o),o,void 0,i??{})}return s._$AI(e),s};const qg=globalThis;let we=class extends wn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=gT(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return aa}};we._$litElement$=!0,we.finalized=!0,qg.litElementHydrateSupport?.({LitElement:we});const mT=qg.litElementPolyfillSupport;mT?.({LitElement:we});(qg.litElementVersions??=[]).push("4.2.2");function ki(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Je(e){return e instanceof Error?e.message:String(e)}const Ae=e=>(t,i)=>{i!==void 0?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};const bT={attribute:!0,type:String,converter:yd,reflect:!1,hasChanged:Og},yT=(e=bT,t,i)=>{const{kind:r,metadata:s}=i;let o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),r==="setter"&&((e=Object.create(e)).wrapped=!0),o.set(i.name,e),r==="accessor"){const{name:a}=i;return{set(n){const l=t.get.call(this);t.set.call(this,n),this.requestUpdate(a,l,e,!0,n)},init(n){return n!==void 0&&this.C(a,void 0,e,n),n}}}if(r==="setter"){const{name:a}=i;return function(n){const l=this[a];t.call(this,n),this.requestUpdate(a,l,e,!0,n)}}throw Error("Unsupported decorator location: "+r)};function P(e){return(t,i)=>typeof i=="object"?yT(e,t,i):((r,s,o)=>{const a=s.hasOwnProperty(o);return s.constructor.createProperty(o,r),a?Object.getOwnPropertyDescriptor(s,o):void 0})(e,t,i)}function Ct(e){return P({...e,state:!0,attribute:!1})}const xT=(e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(e,t,i),i);function ui(e,t){return(i,r,s)=>{const o=a=>a.renderRoot?.querySelector(e)??null;return xT(i,r,{get(){return o(this)}})}}async function Ut(e,t){const i=new Headers(t?.headers);t?.body!==void 0&&!i.has("content-type")&&i.set("content-type","application/json");const r=await fetch(e,{...t,headers:i});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(vT(s)??r.statusText)}return await r.json()}function vT(e){if(ki(e))return typeof e.error=="string"?e.error:void 0}function wT(e){return typeof e=="string"?e:e.id}function kT(e){return typeof e=="string"?void 0:e.cwd}function ST(e,t,i,r){const s=new URLSearchParams;r?.path!==void 0&&s.set("path",r.path),r?.staged===!0&&s.set("staged","true");const o=s.toString();return`/api/machines/${encodeURIComponent(e)}/projects/${encodeURIComponent(t)}/workspaces/${encodeURIComponent(i)}/git/diff${o?`?${o}`:""}`}function CT(e,t,i="local"){const r=new URLSearchParams,s=kT(e);s!==void 0&&s!==""&&r.set("cwd",s),t?.limit!==void 0&&r.set("limit",String(t.limit)),t?.before!==void 0&&r.set("before",String(t.before));const o=r.toString();return`/api/machines/${encodeURIComponent(i)}/sessions/${encodeURIComponent(wT(e))}/messages${o===""?"":`?${o}`}`}function TT(e,t,i,r){const s=new URLSearchParams({path:i});return r?.createDirs===!1&&s.set("createDirs","false"),r?.overwrite===!1&&s.set("overwrite","false"),`${`/api/machines/${encodeURIComponent(r?.machineId??"local")}`}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file?${s.toString()}`}function zb(e,t,i,r){const s=new URLSearchParams;return s.set("path",i),r?.modifiedAt!==void 0&&s.set("v",r.modifiedAt),`${`/api/machines/${encodeURIComponent(r?.machineId??"local")}`}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file/preview?${s.toString()}`}function Db(e,t,i,r){const s=new URLSearchParams({path:i});return`${`/api/machines/${encodeURIComponent(r?.machineId??"local")}`}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file/raw?${s.toString()}`}const ve=(e="local")=>`/api/machines/${encodeURIComponent(e)}`;function ck(e){return typeof e=="string"?e:e.id}function Hg(e){return typeof e=="string"?void 0:e.cwd}function hk(e,t="local"){return`${ve(t)}/sessions/${encodeURIComponent(ck(e))}`}function Ri(e,t,i="local"){return`${hk(e,i)}/${t}`}function hh(e,t,i="local"){return`${Ri(e,t,i)}${dk(e)}`}function $T(e,t="local"){return`${hk(e,t)}${dk(e)}`}function dk(e){const t=Hg(e);return t===void 0||t===""?"":`?${new URLSearchParams({cwd:t}).toString()}`}function qi(e,t={}){const i=Hg(e);return JSON.stringify(i===void 0||i===""?t:{cwd:i,...t})}function Fb(e){return JSON.stringify({sessions:e.map(MT)})}function MT(e){const t=ck(e),i=Hg(e);return i===void 0||i===""?{id:t}:{id:t,cwd:i}}const uk={ompWebStatus:(e="local")=>Ut(e==="local"?"/api/omp-web/status":`${ve(e)}/omp-web/status`),ompWebRuntime:()=>Ut("/api/omp-web/runtime")},AT={machines:async()=>{const e=await Ut("/api/machines");return Array.isArray(e)?e:e.machines??[]},addMachine:e=>Ut("/api/machines",{method:"POST",body:JSON.stringify(e)}),deleteMachine:e=>Ut(`/api/machines/${encodeURIComponent(e)}`,{method:"DELETE"}),health:e=>Ut(`/api/machines/${encodeURIComponent(e)}/health`),runtime:e=>Ut(`/api/machines/${encodeURIComponent(e)}/runtime`)};function Ob(e){return e===void 0?"/api/config":`${ve(e)}/config`}function BT(e){return e===void 0?"/api/plugins":`${ve(e)}/plugins`}const zs={config:e=>Ut(Ob(e)),saveConfig:(e,t)=>Ut(Ob(t),{method:"PUT",body:JSON.stringify({config:e})})},Ul={plugins:e=>Ut(BT(e))};function dh(e="",t){const i=t===void 0?"/api/pi-packages":`${ve(t)}/pi-packages`;return e===""?i:`${i}/${e}`}const Yl={packages:e=>Ut(dh("",e)),install:(e,t)=>{const i={source:e};return Ut(dh("install",t),{method:"POST",body:JSON.stringify(i)})},remove:(e,t,i)=>{const r=t===void 0?{source:e}:{source:e,scope:t};return Ut(dh("remove",i),{method:"POST",body:JSON.stringify(r)})},update:(e,t)=>{const i=e===void 0?void 0:{source:e};return Ut(dh("update",t),{method:"POST",...i===void 0?{}:{body:JSON.stringify(i)}})}},pk={workspaceActivity:(e="local")=>Ut(`${ve(e)}/activity`)},_T={projects:(e="local")=>Ut(`${ve(e)}/projects`),addProject:(e,t,i,r="local")=>Ut(`${ve(r)}/projects`,{method:"POST",body:JSON.stringify({path:e,name:t,create:i})}),closeProject:(e,t="local")=>Ut(`${ve(t)}/projects/${encodeURIComponent(e)}`,{method:"DELETE"}),projectDirectories:(e,t="local")=>Ut(`${ve(t)}/project-directories?q=${encodeURIComponent(e)}`)},kn={workspaces:(e,t="local")=>Ut(`${ve(t)}/projects/${e}/workspaces`),deleteWorkspace:(e,t,i="local")=>Ut(`${ve(i)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"}),workspaceTree:(e,t,i="",r="local")=>Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/tree?path=${encodeURIComponent(i)}`),workspaceFile:(e,t,i,r="local")=>Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file?path=${encodeURIComponent(i)}`),writeWorkspaceFile:(e,t,i,r,s,o="local")=>{const a=new URLSearchParams({path:i});s?.createDirs===!1&&a.set("createDirs","false"),s?.overwrite===!1&&a.set("overwrite","false");const n=r instanceof Uint8Array,l=n?new Uint8Array(r):new TextEncoder().encode(r);return Ut(`${ve(o)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file?${a.toString()}`,{method:"PUT",body:l,headers:{"Content-Type":n?"application/octet-stream":"text/plain"}})},deleteWorkspaceFile:(e,t,i,r="local")=>{const s=new URLSearchParams({path:i});return Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file?${s.toString()}`,{method:"DELETE"})},moveWorkspaceFile:(e,t,i,r,s,o="local")=>{const a=new URLSearchParams({fromPath:i,toPath:r});return s?.createDirs===!1&&a.set("createDirs","false"),s?.overwrite===!0&&a.set("overwrite","true"),Ut(`${ve(o)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/file/move?${a.toString()}`,{method:"POST"})}},df={sessions:(e,t="local")=>Ut(`${ve(t)}/sessions?cwd=${encodeURIComponent(e)}`),startSession:(e,t="local")=>Ut(`${ve(t)}/sessions`,{method:"POST",body:JSON.stringify({cwd:e})}),cleanupPreview:(e,t="local")=>Ut(`${ve(t)}/sessions/cleanup/preview`,{method:"POST",body:JSON.stringify(e)}),cleanup:(e,t="local")=>Ut(`${ve(t)}/sessions/cleanup`,{method:"POST",body:JSON.stringify(e)}),archiveMany:(e,t="local")=>Ut(`${ve(t)}/sessions/bulk/archive`,{method:"POST",body:Fb(e)}),deleteArchivedMany:(e,t="local")=>Ut(`${ve(t)}/sessions/bulk/delete-archived`,{method:"POST",body:Fb(e)}),messages:(e,t,i="local")=>Ut(CT(e,t,i)),status:(e,t="local")=>Ut(hh(e,"status",t)),models:(e,t="local")=>Ut(hh(e,"models",t)),setModel:(e,t,i,r,s)=>{const o=typeof r=="boolean"?r:void 0;return Ut(Ri(e,"model",typeof r=="string"?r:s??"local"),{method:"POST",body:qi(e,{provider:t,modelId:i,...o===!0?{persist:!0}:{}})})},cycleModel:(e,t,i="local")=>Ut(Ri(e,"model/cycle",i),{method:"POST",body:qi(e,{direction:t})}),thinkingLevels:(e,t="local")=>Ut(hh(e,"thinking-levels",t)),setThinkingLevel:(e,t,i="local")=>Ut(Ri(e,"thinking-level",i),{method:"POST",body:qi(e,{level:t})}),cycleThinkingLevel:(e,t="local")=>Ut(Ri(e,"thinking-level/cycle",t),{method:"POST",body:qi(e)}),commands:(e,t="local")=>Ut(hh(e,"commands",t)),prompt:(e,t,i,r="local",s)=>Ut(Ri(e,"prompt",r),{method:"POST",body:qi(e,{text:t,...i===void 0?{}:{streamingBehavior:i},...s!==void 0&&s.length>0?{attachments:s}:{}})}),saveAttachments:(e,t,i="local",r)=>Ut(Ri(e,"attachments",i),{method:"POST",body:qi(e,{attachments:t,...r===void 0?{}:{folder:r}})}),shell:(e,t,i="local")=>Ut(Ri(e,"shell",i),{method:"POST",body:qi(e,{text:t})}),runCommand:(e,t,i="local")=>Ut(Ri(e,"commands/run",i),{method:"POST",body:qi(e,{text:t})}),respondToCommand:(e,t,i,r="local")=>Ut(Ri(e,"commands/respond",r),{method:"POST",body:qi(e,{requestId:t,value:i})}),respondToAsk:(e,t,i,r="local")=>Ut(Ri(e,"ask/respond",r),{method:"POST",body:qi(e,{requestId:t,result:i})}),abort:(e,t="local")=>Ut(Ri(e,"abort",t),{method:"POST",body:qi(e)}),stop:(e,t="local")=>Ut(Ri(e,"stop",t),{method:"POST",body:qi(e)}),archive:(e,t="local")=>Ut(Ri(e,"archive",t),{method:"POST",body:qi(e)}),archiveWithDescendants:(e,t="local")=>Ut(Ri(e,"archive-tree",t),{method:"POST",body:qi(e)}),restore:(e,t="local")=>Ut(Ri(e,"restore",t),{method:"POST",body:qi(e)}),deleteArchived:(e,t="local")=>Ut($T(e,t),{method:"DELETE"}),detachParent:(e,t="local")=>Ut(Ri(e,"detach-parent",t),{method:"POST",body:qi(e)}),reloadSession:(e,t="local")=>Ut(Ri(e,"reload",t),{method:"POST",body:qi(e)}),authProviders:e=>{const t=new URLSearchParams;e?.mode!==void 0&&t.set("mode",e.mode),e?.authType!==void 0&&t.set("authType",e.authType);const i=t.toString();return Ut(`${ve(e?.machineId)}/auth/providers${i===""?"":`?${i}`}`)},saveApiKey:(e,t,i="local")=>Ut(`${ve(i)}/auth/api-key`,{method:"POST",body:JSON.stringify({providerId:e,key:t})}),logoutProvider:(e,t="local")=>Ut(`${ve(t)}/auth/logout`,{method:"POST",body:JSON.stringify({providerId:e})}),startOAuthLogin:(e,t="local")=>Ut(`${ve(t)}/auth/oauth`,{method:"POST",body:JSON.stringify({providerId:e})}),oauthFlow:(e,t="local")=>Ut(`${ve(t)}/auth/oauth/${encodeURIComponent(e)}`),respondOAuthFlow:(e,t,i,r="local")=>Ut(`${ve(r)}/auth/oauth/${encodeURIComponent(e)}/respond`,{method:"POST",body:JSON.stringify({requestId:t,value:i})}),cancelOAuthFlow:(e,t="local")=>Ut(`${ve(t)}/auth/oauth/${encodeURIComponent(e)}/cancel`,{method:"POST"})},An={terminals:(e,t,i="local")=>Ut(`${ve(i)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals`),startTerminal:(e,t,i,r="local")=>Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals`,{method:"POST",body:JSON.stringify(i??{})}),closeWorkspaceTerminals:(e,t,i="local")=>Ut(`${ve(i)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals`,{method:"DELETE"}),closeTerminal:(e,t,i,r="local")=>Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals/${encodeURIComponent(i)}`,{method:"DELETE"}),continueTerminal:(e,t,i,r="local")=>Ut(`${ve(r)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals/${encodeURIComponent(i)}/continue`,{method:"POST"}),runTerminalCommand:(e,t,i="local")=>Ut(`${ve(i)}/projects/${encodeURIComponent(t.workspace.projectId)}/workspaces/${encodeURIComponent(t.workspace.id)}/terminal-command-runs`,{method:"POST",body:JSON.stringify({origin:e,title:t.title,command:t.command,metadata:t.metadata??{}})}),listCommandRuns:(e,t="local")=>Ut(`${ve(t)}/terminal-command-runs${PT(e)}`),getCommandRun:(e,t="local")=>LT(e,t),cancelCommandRun:(e,t="local")=>Ut(`${ve(t)}/terminal-command-runs/${encodeURIComponent(e)}/cancel`,{method:"POST"})};async function LT(e,t){const i=await fetch(`${ve(t)}/terminal-command-runs/${encodeURIComponent(e)}`);if(i.status!==404){if(!i.ok){const r=await i.json().catch(()=>({}));throw new Error(ET(r)??i.statusText)}return await i.json()}}function PT(e){if(e===void 0)return"";const t=new URLSearchParams;e.projectId!==void 0&&t.set("projectId",e.projectId),e.workspaceId!==void 0&&t.set("workspaceId",e.workspaceId),e.terminalId!==void 0&&t.set("terminalId",e.terminalId),e.statuses!==void 0&&e.statuses.length>0&&t.set("statuses",e.statuses.join(",")),e.metadata!==void 0&&Object.keys(e.metadata).length>0&&t.set("metadata",JSON.stringify(e.metadata));const i=t.toString();return i===""?"":`?${i}`}function ET(e){if(!ki(e))return;const t=e.error;return typeof t=="string"?t:void 0}const RT={files:(e,t,i={})=>{const r=new URLSearchParams({q:t});return i.kind!==void 0&&r.set("kind",i.kind),i.mode!==void 0&&r.set("mode",i.mode),i.scope!==void 0&&r.set("scope",i.scope),i.workspaceScoped===!0&&i.projectId!==void 0&&i.workspaceId!==void 0?Ut(`${ve(i.machineId)}/projects/${encodeURIComponent(i.projectId)}/workspaces/${encodeURIComponent(i.workspaceId)}/files?${r.toString()}`):(r.set("cwd",e),Ut(`${ve(i.machineId)}/files?${r.toString()}`))}},IT={gitStatus:(e,t,i="local")=>Ut(`${ve(i)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/git/status`),gitDiff:(e,t,i,r="local")=>Ut(ST(r,e,t,i))},gi={...uk,...AT,...zs,...Ul,...Yl,...pk,..._T,...kn,...df,...An,...RT,...IT};function zT(e,t="local"){const i=typeof e=="string"?void 0:e.cwd,r=i===void 0||i===""?"":`?${new URLSearchParams({cwd:i}).toString()}`,s=typeof e=="string"?e:e.id;return new WebSocket(`${Ug()}${jg(t)}/sessions/${encodeURIComponent(s)}/events${r}`)}function iet(e,t,i,r,s="local"){const o=r===void 0?"":`?cols=${encodeURIComponent(String(r.cols))}&rows=${encodeURIComponent(String(r.rows))}`;return new WebSocket(`${Ug()}${jg(s)}/projects/${encodeURIComponent(e)}/workspaces/${encodeURIComponent(t)}/terminals/${encodeURIComponent(i)}/socket${o}`)}function DT(e="local"){return new WebSocket(`${Ug()}${jg(e)}/events`)}function jg(e){return`/api/machines/${encodeURIComponent(e)}`}function Ug(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}`}const cc=".omp-web/uploads";class Su extends Error{constructor(t="Workspace upload cancelled"){super(t),this.name="WorkspaceUploadCancelledError"}}class fk extends Error{constructor(t,i){super(UT(t)),this.name="WorkspaceUploadBatchError",this.failures=t.map(r=>({...r})),this.responses=i.map(r=>({...r}))}}function Nb(e){return e?.uploads?.defaultFolder??cc}function FT(e,t){return e?.uploads?.defaultFolder??t}function Yg(e,t){const i=Wb(e,"upload destination",{allowEmpty:!0}),r=Wb(t,"upload file name",{allowEmpty:!1});return i===""?r:`${i}/${r}`}function OT(e,t,i,r={}){const s=r.xhrFactory?.()??new XMLHttpRequest;let o=!1,a=!1;return{promise:new Promise((l,c)=>{const h=u=>{o||(o=!0,c(u))},d=u=>{o||(o=!0,l(u))};s.open("PUT",TT(e,t,i.path,qT(r)),!0),s.responseType="json",s.setRequestHeader("Content-Type",(i.contentType??i.file.type)||"application/octet-stream"),s.upload.onprogress=u=>{r.onProgress?.(HT(u,i.file.size))},s.onload=()=>{if(s.status>=200&&s.status<300){try{r.onProgress?.({loaded:i.file.size,total:i.file.size,percent:1,lengthComputable:!0}),d(gk(s))}catch(u){h(u instanceof Error?u:new Error(String(u)))}return}h(new Error(XT(s)))},s.onerror=()=>{h(new Error("Workspace upload failed"))},s.onabort=()=>{h(new Su(a?void 0:"Workspace upload aborted"))},s.send(i.file)}),cancel:()=>{o||(a=!0,s.abort())}}}function NT(e,t,i,r={}){const s=r.destinationFolder??cc,o=i.map((d,u)=>({index:u,name:d.name,path:Yg(s,d.name),loaded:0,total:d.size,percent:Gg(0,d.size),lengthComputable:!0,done:!1}));let a,n=0;const l={requested:!1},c=()=>{r.onProgress?.(jT(o,n,o.every(d=>d.done)))};return{promise:(async()=>{const d=[],u=[];for(let p=0;p<i.length;p+=1){if(l.requested)throw new Su;n=p;const f=i[p],g=o[p];if(!(f===void 0||g===void 0)){a=OT(e,t,{path:g.path,file:f},{...WT(r),onProgress:m=>{g.total=m.total,g.loaded=Math.min(m.loaded,g.total),g.percent=m.percent,g.lengthComputable=m.lengthComputable,c()}});try{const m=await a.promise;g.loaded=g.total,g.percent=1,g.lengthComputable=!0,g.done=!0,d.push(m),c()}catch(m){if(YT(m,l))throw m;const x=Je(m);g.loaded=g.total,g.percent=1,g.lengthComputable=!0,g.done=!0,g.error=x,u.push({index:p,name:f.name,path:g.path,error:x}),c()}finally{a=void 0}}}if(u.length>0)throw new fk(u,d);return d})(),cancel:()=>{l.requested=!0,a?.cancel()}}}function WT(e){return{...e.createDirs===void 0?{}:{createDirs:e.createDirs},...e.overwrite===void 0?{}:{overwrite:e.overwrite},...e.machineId===void 0?{}:{machineId:e.machineId},...e.xhrFactory===void 0?{}:{xhrFactory:e.xhrFactory}}}function qT(e){return{...e.createDirs===void 0?{}:{createDirs:e.createDirs},...e.overwrite===void 0?{}:{overwrite:e.overwrite},...e.machineId===void 0?{}:{machineId:e.machineId}}}function HT(e,t){const i=e.lengthComputable?e.total:t;return{loaded:e.loaded,total:i,percent:Gg(e.loaded,i),lengthComputable:e.lengthComputable}}function jT(e,t,i){const r=e.reduce((o,a)=>o+a.total,0),s=e.reduce((o,a)=>o+a.loaded,0);return{currentFileIndex:t,files:e.map(o=>({...o})),loaded:s,total:r,percent:Gg(s,r),done:i}}function Gg(e,t){return t<=0?e<=0?0:1:Math.max(0,Math.min(1,e/t))}function UT(e){return e.length===1?e[0]?.error??"Workspace upload failed":`${String(e.length)} files failed to upload`}function YT(e,t){return t.requested||e instanceof Su}function Wb(e,t,i){const r=e.trim();if(r===""){if(i.allowEmpty)return"";throw new Error(`${t} must not be empty`)}if(GT(r))throw new Error(`${t} must be workspace-relative`);const s=r.split(/[\\/]+/u).filter(o=>o!==""&&o!==".");if(s.length===0){if(i.allowEmpty)return"";throw new Error(`${t} must not be empty`)}if(s.some(o=>o===".."))throw new Error(`${t} must not contain path traversal`);return s.join("/")}function GT(e){const t=e.replace(/\\/g,"/");return t.startsWith("/")||/^[A-Za-z]:\//u.test(t)}function gk(e){return e.response!==void 0&&e.response!==null&&e.response!==""?e.response:e.responseText===""?{}:JSON.parse(e.responseText)}function XT(e){const t=VT(e);return ki(t)&&typeof t.error=="string"?t.error:e.statusText||`HTTP ${String(e.status)}`}function VT(e){try{return gk(e)}catch{return}}function Vh(){return{sessions:[],clientQueuedSessionMessages:{},startingSessionCount:0,fileTree:[],expandedDirs:{},selectedFilePath:void 0,selectedFileContent:void 0,fileTreeStale:!1,gitStatus:void 0,selectedDiffPath:void 0,selectedDiff:void 0,selectedStagedDiff:void 0,gitStale:!1,selectedTerminalId:void 0,error:""}}function KT(){return{machines:[],selectedMachine:void 0,isLoadingMachines:!1,machineStatuses:{},machineRuntimes:{},projects:[],workspaces:[],sessions:[],messages:[],messagePageStart:0,messagePageEnd:0,messagePageTotal:0,isLoadingEarlierMessages:!1,sendingPrompts:{},clientQueuedSessionMessages:{},startingSessionCount:0,isLoadingProjects:!1,isLoadingWorkspaces:!1,selectedProject:void 0,selectedWorkspace:void 0,selectedSession:void 0,status:void 0,activity:void 0,availableThinkingLevels:[],sessionStatuses:{},sessionActivities:{},workspaceActivities:{},machineActivities:{},workspacesByProjectId:{},workspaceDeletionRuns:{},commandDialog:void 0,planReviewDialog:void 0,askDialog:void 0,btwState:void 0,modelDialog:void 0,modelActionDialog:void 0,thinkingDialog:void 0,themeDialog:void 0,authDialog:void 0,actionPaletteOpen:!1,projectDialogOpen:!1,machineDialogOpen:!1,workspaceTool:"core:workspace.files",mainView:"chat",fileTree:[],expandedDirs:{},selectedFilePath:void 0,selectedFileContent:void 0,fileTreeStale:!1,workspaceUploadBatches:{},gitStatus:void 0,selectedDiffPath:void 0,selectedDiff:void 0,selectedStagedDiff:void 0,gitStale:!1,activeTerminalCount:0,selectedTerminalId:void 0,ompWebStatus:void 0,error:""}}const Kr={sessionsDeleteArchived:"sessions.deleteArchived",sessionsBulkMutations:"sessions.bulkMutations",sessionsCleanup:"sessions.cleanup",sessionsReload:"sessions.reload",promptAttachments:"prompt.attachments",workspaceFileSuggestions:"workspace.fileSuggestions",piPackagesManage:"piPackages.manage",selectedMachineSettings:"settings.selectedMachine"},ZT=Object.values(Kr);new Set(ZT);function vs(e,t){return e?.capabilities?.includes(t)===!0}function na(e,t){return t?.phase==="active"||e?.isStreaming===!0||e?.isBashRunning===!0||e?.isCompacting===!0||(e?.pendingMessageCount??0)>0}function mk(e){return e!==void 0&&(e.hasSessionActivity||e.hasTerminalActivity)}const bk="local";function Mp(e,t){return`${e}:${t}`}function yk(e,t){return`${e}:${t}`}function wt(e){return e.selectedMachine?.id??bk}class QT{constructor(t,i,r={}){this.getState=t,this.setState=i,this.api=r.api??pk}async refresh(t=wt(this.getState())){this.applyMachineActivitySnapshot(t,JT(await this.api.workspaceActivity(t)))}applyWorkspaceActivity(t,i=wt(this.getState())){const r=this.getState(),s=wt(r)===i,o=r.machineActivities[i]??(s?r.workspaceActivities:{}),a=t$(o,t);this.setState({machineActivities:{...r.machineActivities,[i]:a},...s?{workspaceActivities:a}:{}})}applyMachineActivitySnapshot(t,i){const r=this.getState();this.setState({machineActivities:{...r.machineActivities,[t]:i},...wt(r)===t?{workspaceActivities:i}:{}})}}function JT(e){const t={};for(const i of e.workspaces)mk(i)&&(t[i.cwd]=i);return t}function t$(e,t){const i={...e};return mk(t)?(i[t.cwd]=t,i):Object.fromEntries(Object.entries(i).filter(([r])=>r!==t.cwd))}class e${constructor(t,i,r,s={}){this.getState=t,this.setState=i,this.applyStatus=r,this.api=s.api??gi,this.pollIntervalMs=s.pollIntervalMs??1e3}dispose(){this.stopPolling()}handleSlashCommand(t){const i=i$(t);return i===void 0?!1:(i.command==="login"?this.openLogin(i.providerId):this.openLogout(i.providerId),!0)}async openLogin(t){if(t!==void 0&&t!==""){await this.openLoginProvider(t);return}this.setState({authDialog:{step:"method"}})}async chooseLoginMethod(t){try{const{providers:i}=await this.api.authProviders({mode:"login",authType:t,machineId:wt(this.getState())});this.setState({authDialog:{step:"providers",mode:"login",authType:t,providers:i}})}catch(i){this.setState({error:String(i)})}}async selectLoginProvider(t,i){const r=this.getState().authDialog;if(r?.step!=="providers")return;const s=r.providers.find(o=>o.id===t&&(i===void 0||o.authType===i));s!==void 0&&(s.authType==="oauth"?await this.startOAuth(s):this.setState({authDialog:{step:"apiKey",provider:s,value:""}}))}updateApiKey(t){const i=this.getState().authDialog;if(i?.step!=="apiKey")return;const r={...i};delete r.error,this.setState({authDialog:{...r,value:t}})}async saveApiKey(){const t=this.getState().authDialog;if(t?.step!=="apiKey")return;const i=t.value.trim();if(i===""){this.setState({authDialog:{...t,error:"API key is required"}});return}const r={...t};delete r.error,this.setState({authDialog:{...r,saving:!0}});try{await this.api.saveApiKey(t.provider.id,i,wt(this.getState())),this.closeDialog(),this.refreshStatus()}catch(s){this.setState({authDialog:{...t,saving:!1,error:String(s)}})}}async openLogout(t){try{const{providers:i}=await this.api.authProviders({mode:"logout",machineId:wt(this.getState())});if(t!==void 0&&t!==""){const r=i.find(s=>s.id===t);r!==void 0&&!this.rejectRemoteOAuth("logout",r)?await this.logoutProvider(r.id):r===void 0&&this.setState({error:`No stored credentials for ${t}`});return}this.setState({authDialog:{step:"logout",providers:i}})}catch(i){this.setState({error:String(i)})}}async logoutProvider(t){const i=this.getState().authDialog,r=i?.step==="logout"?i.providers.find(s=>s.id===t):void 0;if(!(r!==void 0&&this.rejectRemoteOAuth("logout",r)))try{await this.api.logoutProvider(t,wt(this.getState())),this.closeDialog(),this.refreshStatus()}catch(s){this.setState({error:String(s)})}}updateOAuthInput(t){const i=this.getState().authDialog;if(i?.step!=="oauth")return;const r={...i};delete r.error,this.setState({authDialog:{...r,inputValue:t}})}async respondOAuth(t){const i=this.getState().authDialog;if(i?.step!=="oauth")return;const r=i.flow.prompt??i.flow.select;if(r===void 0)return;const s=t??i.inputValue??"",o={...i};delete o.error,this.setState({authDialog:{...o,responding:!0}});try{const a=await this.api.respondOAuthFlow(i.flow.flowId,r.requestId,s,wt(this.getState()));this.updateOAuthFlow(a)}catch(a){this.setState({authDialog:{...i,responding:!1,error:String(a)}})}}async cancelOAuth(){const t=this.getState().authDialog;if(t?.step!=="oauth"){this.closeDialog();return}this.stopPolling();try{await this.api.cancelOAuthFlow(t.flow.flowId,wt(this.getState()))}catch{}this.closeDialog()}closeDialog(){this.stopPolling(),this.setState({authDialog:void 0})}async openLoginProvider(t){try{const{providers:i}=await this.api.authProviders({mode:"login",machineId:wt(this.getState())}),r=i.filter(o=>o.id===t);if(r.length===0){this.setState({error:`Auth provider not found: ${t}`});return}if(r.length>1){this.setState({authDialog:{step:"providers",mode:"login",providers:r}});return}const s=r[0];if(s===void 0)return;s.authType==="oauth"?await this.startOAuth(s):this.setState({authDialog:{step:"apiKey",provider:s,value:""}})}catch(i){this.setState({error:String(i)})}}async startOAuth(t){if(!this.rejectRemoteOAuth("login",t))try{const i=await this.api.startOAuthLogin(t.id,wt(this.getState()));this.updateOAuthFlow(i),this.startPolling(i.flowId)}catch(i){this.setState({error:String(i)})}}rejectRemoteOAuth(t,i){const r=this.getState().selectedMachine;if(i.authType!=="oauth"||r?.kind!=="remote")return!1;const s=r.baseUrl??"that remote PI WEB instance";return this.setState({error:`OAuth ${t} for remote machines must be configured directly on ${s}.`}),!0}updateOAuthFlow(t){if(t.status==="complete"){this.stopPolling(),this.closeDialog(),this.refreshStatus();return}(t.status==="error"||t.status==="cancelled")&&this.stopPolling();const i=this.getState().authDialog,r=i?.step==="oauth"&&i.flow.flowId===t.flowId?i.inputValue??"":"",s=i?.step==="oauth"?i.flow.prompt?.requestId??i.flow.select?.requestId:void 0,o=t.prompt?.requestId??t.select?.requestId,a=s!==void 0&&s===o,n=a?r:"",l=a&&i?.step==="oauth"?i.responding===!0:!1;this.setState({authDialog:{step:"oauth",flow:t,inputValue:n,responding:l}})}startPolling(t){this.stopPolling(),this.pollTimer=window.setInterval(()=>{this.poll(t)},this.pollIntervalMs)}stopPolling(){this.pollTimer!==void 0&&(window.clearInterval(this.pollTimer),this.pollTimer=void 0)}async poll(t){const i=this.getState().authDialog;if(i?.step!=="oauth"||i.flow.flowId!==t){this.stopPolling();return}try{this.updateOAuthFlow(await this.api.oauthFlow(t,wt(this.getState())))}catch(r){this.stopPolling(),this.setState({authDialog:{...i,error:String(r)}})}}async refreshStatus(){const t=this.session();if(t!==void 0)try{this.applyStatus(await this.api.status(t,wt(this.getState())))}catch{}}session(){const t=this.getState().selectedSession;if(!(t===void 0||t.archived===!0))return t}}function i$(e){const t=e.trim(),i=/^\/(login|logout)(?:\s+(\S+))?\s*$/u.exec(t);if(i===null)return;const r=i[1];if(r!=="login"&&r!=="logout")return;const s=i[2];return s===void 0||s===""?{command:r}:{command:r,providerId:s}}function zc(e){return e.replaceAll(":",".")}function r$(e){const t=new URLSearchParams(window.location.search),i=`${e}--`,r={};for(const[s,o]of t.entries()){if(!s.startsWith(i))continue;const a=s.slice(i.length),n=r[a];n===void 0?r[a]=o:Array.isArray(n)?n.push(o):r[a]=[n,o]}return r}function Ap(e,t){const i=r$(e)[t];return Array.isArray(i)?i[0]:i===""?void 0:i}function ps(e,t,i,r){const s=new URL(window.location.href),o=`${e}--${t}`;if(s.searchParams.delete(o),i!=null&&i!=="")if(Array.isArray(i))for(const a of i)s.searchParams.append(o,String(a));else s.searchParams.set(o,String(i));s$(s,r)}function s$(e,t){const i=`${e.pathname}${e.search}${e.hash}`,r=`${window.location.pathname}${window.location.search}${window.location.hash}`;i!==r&&(t?.replace===!0?window.history.replaceState({},"",e):window.history.pushState({},"",e))}function o$(e){const t=e.files.map((r,s)=>{const o=r.size;return{index:s,name:r.name,path:Yg(e.destinationFolder,r.name),size:r.size,loaded:0,total:o,percent:Hb(0,o),lengthComputable:!0,status:s===0?"uploading":"pending"}}),i=t.reduce((r,s)=>r+s.total,0);return{id:e.id,projectId:e.projectId,workspaceId:e.workspaceId,machineId:e.machineId,destinationFolder:e.destinationFolder,overwrite:e.overwrite,createDirs:e.createDirs,files:t,currentFileIndex:t.length===0?-1:0,loaded:0,total:i,percent:Hb(0,i),status:"uploading",startedAt:e.startedAt}}function a$(e,t){const i=new Map(t.files.map(s=>[s.index,s])),r=e.files.map(s=>{const o=i.get(s.index);if(o===void 0)return s;const a={...s,path:o.path,loaded:o.loaded,total:o.total,percent:o.percent,lengthComputable:o.lengthComputable,status:o.error!==void 0?"error":o.done?"completed":t.currentFileIndex===s.index?"uploading":s.status};return o.error===void 0?delete a.error:a.error=o.error,a});return{...e,files:r,currentFileIndex:t.currentFileIndex,loaded:t.loaded,total:t.total,percent:t.percent}}function n$(e,t,i){const r=e.files.map((o,a)=>{const n=t[a];return{...o,...n===void 0?{}:{path:n.path,response:n},loaded:o.total,percent:1,lengthComputable:!0,status:"completed"}}),s=Xg(r);return{...e,files:r,currentFileIndex:r.length===0?-1:r.length-1,...s,status:"completed",completedAt:i}}function l$(e,t,i){const r=e.files.map(s=>s.status==="completed"||s.status==="error"?s:s.status==="uploading"||s.index===e.currentFileIndex?{...s,status:"error",error:t}:{...s,status:"cancelled",error:"Not uploaded because an earlier file failed."});return{...e,files:r,...Xg(r),status:"error",error:t,completedAt:i}}function qb(e,t){const i="Upload cancelled",r=e.files.map(s=>s.status==="completed"||s.status==="error"?s:{...s,status:"cancelled",error:i});return{...e,files:r,...Xg(r),status:"cancelled",error:i,completedAt:t}}function Xg(e){const t=e.reduce((i,r)=>i+r.total,0);return{loaded:t,total:t,percent:e.length===0?0:1}}function Hb(e,t){return t<=0?e<=0?0:1:Math.max(0,Math.min(1,e/t))}const jb=zc("core:workspace.files");class c${constructor(t,i,r,s={}){this.getState=t,this.setState=i,this.updateUrl=r,this.uploadTasks=new Map,this.uploadBatchSequence=0,this.api=s.api??gi,this.uploadWorkspaceFiles=s.uploadWorkspaceFiles??NT,this.createUploadBatchId=s.createUploadBatchId??(()=>(this.uploadBatchSequence+=1,`workspace-upload-${String(this.uploadBatchSequence)}`)),this.now=s.now??(()=>new Date().toISOString())}async refreshFiles(){const t=this.getState().selectedProject,i=this.getState().selectedWorkspace;if(!(t===void 0||i===void 0))try{const r=wt(this.getState()),s=await this.api.workspaceTree(t.id,i.id,"",r),o={...this.getState().expandedDirs};await Promise.all(Object.keys(o).map(async a=>{o[a]=(await this.api.workspaceTree(t.id,i.id,a,r)).entries})),this.setState({fileTree:s.entries,expandedDirs:o,fileTreeStale:!1,error:""})}catch(r){this.setState({error:String(r)})}}async expandDir(t){const i=this.getState().selectedProject,r=this.getState().selectedWorkspace;if(!(i===void 0||r===void 0)){if(this.getState().expandedDirs[t]!==void 0){this.setState({expandedDirs:Ub(this.getState().expandedDirs,t)});return}try{const s=await this.api.workspaceTree(i.id,r.id,t,wt(this.getState()));this.setState({expandedDirs:{...this.getState().expandedDirs,[t]:s.entries},error:""})}catch(s){this.setState({error:String(s)})}}}async selectFile(t){this.setState({selectedFilePath:t,selectedFileContent:void 0,workspaceTool:"core:workspace.files",mainView:this.getState().mainView==="chat"?"chat":"core:workspace.files"}),ps(jb,"file",t),this.updateUrl({replace:!0}),await this.restoreFile(t)}async restoreFile(t){const i=this.getState().selectedProject,r=this.getState().selectedWorkspace;if(!(i===void 0||r===void 0)){this.setState({selectedFilePath:t,selectedFileContent:void 0});try{const s=await this.api.workspaceFile(i.id,r.id,t,wt(this.getState()));this.getState().selectedFilePath===t&&this.setState({selectedFileContent:s,error:""})}catch(s){if(this.getState().selectedFilePath!==t)return;if(h$(s)){this.setState({selectedFilePath:void 0,selectedFileContent:void 0,error:""}),ps(jb,"file",void 0,{replace:!0}),this.updateUrl({replace:!0});return}this.setState({error:String(s)})}}}startWorkspaceUpload(t,i){const r=this.getState().selectedProject,s=this.getState().selectedWorkspace;if(r===void 0||s===void 0){this.setState({error:"Select a workspace before uploading files."});return}if(t.length===0)return;const o=wt(this.getState()),a=i.overwrite??!1,n=i.createDirs??!0;let l;try{l=o$({id:this.createUploadBatchId(),projectId:r.id,workspaceId:s.id,machineId:o,destinationFolder:i.destinationFolder,overwrite:a,createDirs:n,files:t,startedAt:this.now()})}catch(d){this.setState({error:String(d)});return}this.setUploadBatch(l);let c;try{c=this.uploadWorkspaceFiles(r.id,s.id,t,{destinationFolder:i.destinationFolder,machineId:o,overwrite:a,createDirs:n,onProgress:d=>{this.updateUploadProgress(l.id,d)}})}catch(d){return this.failUploadBatch(l.id,d),{batchId:l.id,done:Promise.resolve()}}this.uploadTasks.set(l.id,c);const h=c.promise.then(async d=>{await this.completeUploadBatch(l.id,d,i)}).catch(async d=>{await this.handleUploadFailure(l.id,d,i)}).finally(()=>{this.uploadTasks.delete(l.id)});return{batchId:l.id,done:h}}cancelWorkspaceUpload(t){const i=this.getUploadBatch(t);i?.status==="uploading"&&(this.setUploadBatch(qb(i,this.now())),this.uploadTasks.get(t)?.cancel())}clearWorkspaceUpload(t){this.uploadTasks.get(t)?.cancel(),this.uploadTasks.delete(t),this.setState({workspaceUploadBatches:Ub(this.getState().workspaceUploadBatches,t)})}updateUploadProgress(t,i){const r=this.getUploadBatch(t);r?.status==="uploading"&&this.setUploadBatch(a$(r,i))}async completeUploadBatch(t,i,r){const s=this.getUploadBatch(t);if(s?.status!=="uploading"||(this.setUploadBatch(n$(s,i,this.now()),{error:""}),!this.isCurrentWorkspaceBatch(s)))return;await this.refreshFiles();const o=i[0]?.path;r.selectUploadedFile!==!1&&o!==void 0&&this.isCurrentWorkspaceBatch(s)&&await this.selectFile(o)}async handleUploadFailure(t,i,r){const s=this.failUploadBatch(t,i);if(!(i instanceof fk)||i.responses.length===0||s===void 0||!this.isCurrentWorkspaceBatch(s))return;await this.refreshFiles();const o=i.responses[0]?.path;r.selectUploadedFile!==!1&&o!==void 0&&this.isCurrentWorkspaceBatch(s)&&await this.selectFile(o)}failUploadBatch(t,i){const r=this.getUploadBatch(t);if(r?.status!=="uploading")return;if(d$(i)){const a=qb(r,this.now());return this.setUploadBatch(a),a}const s=Je(i),o=l$(r,s,this.now());return this.setUploadBatch(o,{error:s}),o}getUploadBatch(t){return this.getState().workspaceUploadBatches[t]}setUploadBatch(t,i={}){this.setState({workspaceUploadBatches:{...this.getState().workspaceUploadBatches,[t.id]:t},...i})}isCurrentWorkspaceBatch(t){const i=this.getState();return i.selectedProject?.id===t.projectId&&i.selectedWorkspace?.id===t.workspaceId&&wt(i)===t.machineId}}function h$(e){const t=String(e);return t.includes("Path does not exist")||t.includes("ENOENT")||t.includes("no such file or directory")}function d$(e){return e instanceof Su}function Ub(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>i!==t))}const Yb=zc("core:workspace.git");class u${constructor(t,i,r){this.getState=t,this.setState=i,this.updateUrl=r}dispose(){this.pollTimer!==void 0&&window.clearInterval(this.pollTimer),this.pollTimer=void 0}async refreshGit(){const t=this.getState().selectedProject,i=this.getState().selectedWorkspace;if(!(t===void 0||i===void 0))try{const r=await gi.gitStatus(t.id,i.id,wt(this.getState()));this.setState({gitStatus:r,gitStale:!1,error:""});const s=this.getState().selectedDiffPath;s!==void 0&&(r.files.some(o=>o.path===s)?await this.refreshDiff(s):(this.setState({selectedDiffPath:void 0,selectedDiff:void 0,selectedStagedDiff:void 0}),ps(Yb,"diff",void 0,{replace:!0})))}catch(r){this.setState({error:String(r)})}}async selectDiff(t){this.setState({selectedDiffPath:t,selectedDiff:void 0,selectedStagedDiff:void 0,workspaceTool:"core:workspace.git",mainView:this.getState().mainView==="chat"?"chat":"core:workspace.git"}),ps(Yb,"diff",t),this.updateUrl({replace:!0}),await this.refreshDiff(t)}async restoreDiff(t){this.setState({selectedDiffPath:t,selectedDiff:void 0,selectedStagedDiff:void 0}),await this.refreshDiff(t)}async refreshDiff(t){const i=this.getState().selectedProject,r=this.getState().selectedWorkspace;if(!(i===void 0||r===void 0))try{const[s,o]=await Promise.all([gi.gitDiff(i.id,r.id,{path:t},wt(this.getState())),gi.gitDiff(i.id,r.id,{path:t,staged:!0},wt(this.getState()))]);this.setState({selectedDiff:s,selectedStagedDiff:o,error:""})}catch(s){this.setState({error:String(s)})}}updatePolling(){this.dispose();const t=this.getState();(t.workspaceTool==="core:workspace.git"||t.mainView==="core:workspace.git")&&(this.pollTimer=window.setInterval(()=>{this.refreshGit()},8e3))}}class p${constructor(t,i,r,s){this.getState=t,this.setState=i,this.updateUrl=r,this.projects=s}async loadMachines(t){this.setState({error:"",isLoadingMachines:!0});try{const i=await gi.machines(),r=await this.selectInitialMachine(i,t),s=new Set(i.map(o=>o.id));this.setState({machines:i,selectedMachine:r,machineActivities:Gb(this.getState().machineActivities,s),machineRuntimes:Gb(this.getState().machineRuntimes,s)}),this.refreshMachineHealthFor(i),this.refreshMachineRuntimeFor(i)}catch(i){this.setState({error:String(i)})}finally{this.setState({isLoadingMachines:!1})}}async selectMachine(t,i={}){this.getState().selectedMachine?.id!==t.id&&(this.setState({selectedMachine:t,projects:[],workspaces:[],isLoadingWorkspaces:!1,selectedProject:void 0,selectedWorkspace:void 0,selectedSession:void 0,messages:[],messagePageStart:0,messagePageTotal:0,status:void 0,activity:void 0,sessionStatuses:{},sessionActivities:{},sendingPrompts:{},workspaceActivities:{},workspacesByProjectId:{},workspaceDeletionRuns:{},activeTerminalCount:0,...Vh()}),i.updateUrl!==!1&&this.updateUrl(),await this.projects.loadProjects(),this.refreshMachineHealth(t.id),this.refreshMachineRuntime(t.id))}async addMachine(t){this.setState({error:""});try{const i=await gi.addMachine(t);return this.setState({machines:[...this.getState().machines.filter(r=>r.id!==i.id),i]}),await this.selectMachine(i),i}catch(i){this.setState({error:String(i)});return}}async deleteMachine(t=this.getState().selectedMachine,i={}){if(t!==void 0){if(t.kind==="local"){this.setState({error:"The local machine cannot be removed."});return}try{const r=this.getState().selectedMachine?.id===t.id;await gi.deleteMachine(t.id);const s=this.getState().machines.filter(a=>a.id!==t.id),o=s.find(a=>a.id==="local")??s[0];return this.setState({machines:s,machineStatuses:Bp(this.getState().machineStatuses,t.id),machineRuntimes:Bp(this.getState().machineRuntimes,t.id),machineActivities:Bp(this.getState().machineActivities,t.id)}),r&&o!==void 0?(i.selectFallback===!1||await this.selectMachine(o),o):void 0}catch(r){this.setState({error:String(r)});return}}}async refreshMachineHealth(t=this.getState().selectedMachine?.id??"local"){try{const i=await gi.health(t);return this.setState({machineStatuses:{...this.getState().machineStatuses,[i.machineId]:i}}),i}catch(i){this.setState({error:String(i)});return}}async refreshMachineRuntime(t=this.getState().selectedMachine?.id??"local"){try{const i=await gi.runtime(t);this.setState({machineRuntimes:{...this.getState().machineRuntimes,[i.machineId]:i}})}catch(i){this.setState({error:String(i)})}}async selectInitialMachine(t,i){const r=t.find(o=>o.id===(i??"local"));if(r===void 0)return this.localMachine(t);if(r.kind!=="remote")return r;const s=await this.safeRemoteHealth(r);return this.setState({machineStatuses:{...this.getState().machineStatuses,[s.machineId]:s},...s.ok?{}:{error:`${r.name} is unavailable; reconnecting…`}}),r}async safeRemoteHealth(t){try{return await gi.health(t.id)}catch(i){return{machineId:t.id,ok:!1,checkedAt:new Date().toISOString(),status:"offline",error:i instanceof Error?i.message:String(i)}}}localMachine(t){return t.find(i=>i.id==="local")??t[0]}async refreshMachineHealthFor(t){const i=await Promise.allSettled(t.map(s=>gi.health(s.id))),r=Object.fromEntries(i.flatMap(s=>s.status==="fulfilled"?[[s.value.machineId,s.value]]:[]));Object.keys(r).length>0&&this.setState({machineStatuses:{...this.getState().machineStatuses,...r}})}async refreshMachineRuntimeFor(t){const i=await Promise.allSettled(t.map(s=>gi.runtime(s.id))),r=Object.fromEntries(i.flatMap(s=>s.status==="fulfilled"?[[s.value.machineId,s.value]]:[]));Object.keys(r).length>0&&this.setState({machineRuntimes:{...this.getState().machineRuntimes,...r}})}}function Bp(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>i!==t))}function Gb(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>t.has(i)))}class f${constructor(t,i,r){this.getState=t,this.setState=i,this.workspaces=r}async loadProjects(){const t=wt(this.getState());this.setState({error:"",isLoadingProjects:!0});try{const i=await gi.projects(t);if(wt(this.getState())!==t)return;const r=new Set(i.map(o=>o.id)),s=Object.fromEntries(Object.entries(this.getState().workspacesByProjectId).filter(([o])=>r.has(o)));this.setState({projects:i,workspacesByProjectId:s})}catch(i){wt(this.getState())===t&&this.setState({error:String(i)})}finally{wt(this.getState())===t&&this.setState({isLoadingProjects:!1})}}async addProject(t,i){if(t.trim()!=="")try{const r=await gi.addProject(t.trim(),void 0,i,wt(this.getState())),s=this.getState().projects;this.setState({projects:[...s.filter(o=>o.id!==r.id),r],projectDialogOpen:!1}),await this.workspaces.selectProject(r)}catch(r){this.setState({error:String(r)})}}async closeProject(t){try{await gi.closeProject(t,wt(this.getState())),this.workspaces.forgetProject(t);const i=this.getState();this.setState({projects:i.projects.filter(r=>r.id!==t)}),i.selectedProject?.id===t&&this.workspaces.clearSelection()}catch(i){this.setState({error:String(i)})}}}const uf="omp-web:cached-new-sessions:v1",g$="browserCachedNew",ul="local";function Dc(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}function Xb(e,t=ul,i=Dc()){if(e.messageCount!==0||e.archived===!0)return;const r=Vg(i).filter(s=>s.id!==e.id||s.machineId!==t);Kg([pf(e,t),...r],i)}function pf(e,t=ul){return{...e,browserCachedNew:!0,machineId:t}}function Vb(e,t=ul,i=Dc()){const r=Vg(i).filter(s=>s.id!==e||s.machineId!==t);Kg(r,i)}function xk(e,t,i=ul,r=Dc()){const s=new Set(t.map(l=>l.id)),o=Vg(r),a=o.filter(l=>l.machineId!==i||!s.has(l.id));return a.length!==o.length&&Kg(a,r),[...a.filter(l=>l.machineId===i&&l.cwd===e),...t]}function vd(e){return e===void 0?!1:y$(e)&&e.browserCachedNew===!0}function m$(e){return{id:e.id,path:e.path,cwd:e.cwd,...e.persisted===void 0?{}:{persisted:e.persisted},...e.name===void 0?{}:{name:e.name},created:e.created,modified:e.modified,messageCount:e.messageCount,firstMessage:e.firstMessage,...e.parentSessionPath===void 0?{}:{parentSessionPath:e.parentSessionPath},..."machineId"in e&&typeof e.machineId=="string"?{machineId:e.machineId}:{machineId:ul},...e.archived===!0?{archived:!0}:{},...e.archivedAt===void 0?{}:{archivedAt:e.archivedAt}}}function Vg(e=Dc()){try{const t=e?.getItem(uf);if(t==null||t==="")return[];const i=JSON.parse(t);return Array.isArray(i)?i.flatMap(r=>b$(r)):[]}catch{return[]}}function Kg(e,t=Dc()){try{e.length===0?t?.removeItem(uf):t?.setItem(uf,JSON.stringify(e))}catch{}}function b$(e){if(!ki(e))return[];const t=ln(e,"id"),i=ln(e,"path"),r=ln(e,"cwd"),s=ln(e,"created"),o=ln(e,"modified"),a=ln(e,"firstMessage"),n=x$(e,"messageCount");if(t===void 0||i===void 0||r===void 0||s===void 0||o===void 0||a===void 0||n!==0)return[];const l=_p(e,"name"),c=_p(e,"parentSessionPath"),h=_p(e,"machineId")??ul;return[{id:t,path:i,cwd:r,...l===void 0?{}:{name:l},created:s,modified:o,messageCount:n,firstMessage:a,...c===void 0?{}:{parentSessionPath:c},machineId:h,browserCachedNew:!0}]}function y$(e){return g$ in e}function ln(e,t){const i=e[t];return typeof i=="string"?i:void 0}function _p(e,t){const i=e[t];return i===void 0||typeof i!="string"?void 0:i}function x$(e,t){const i=e[t];return typeof i=="number"?i:void 0}function v$(e){return D$(e.flatMap(Zg)).filter(t=>t.parts.length>0)}function Ns(e,t){return{role:e,parts:[{type:"text",text:t}]}}function cn(e,t){const i=B$(t);return i===void 0?e:{...e,meta:i}}function w$(e,t,i,r){if(i===""&&r===void 0)return e;const s=e.at(-1),o=s?.parts.at(-1);if(s?.role===t&&o?.type==="text"){const n=r!==void 0?r.length>=o.text.length?r:o.text:o.text+i;return n===o.text?e:[...e.slice(0,-1),{...s,parts:[...s.parts.slice(0,-1),{...o,text:n}]}]}const a=r!==void 0?r:i;return s?.role===t?[...e.slice(0,-1),{...s,parts:[...s.parts,{type:"text",text:a}]}]:[...e,Ns(t,a)]}function k$(e,t,i){if(t===""&&i===void 0)return e;const r=e.at(-1),s=r?.parts.at(-1);if(r?.role==="assistant"&&s?.type==="thinking"){const a=i!==void 0?i.length>=s.text.length?i:s.text:s.text+t;return a===s.text?e:[...e.slice(0,-1),{...r,parts:[...r.parts.slice(0,-1),{...s,text:a}]}]}const o=i!==void 0?i:t;return r?.role==="assistant"?[...e.slice(0,-1),{...r,parts:[...r.parts,{type:"thinking",text:o}]}]:[...e,{role:"assistant",parts:[{type:"thinking",text:o}]}]}function Zg(e){if(C$(e))return[e];if(Ie(e,"role")==="bashExecution")return[cn(P$(e),e)];const t=$$(e);if(t!==void 0)return t.map(h=>cn(h,e));const i=E$(Ie(e,"role")),r=R$(ts(e,"content"),e),s=i==="user"?T$(r):void 0;if(s!==void 0)return s.map(h=>cn(h,e));const o=A$(e);if(i==="tool")return[cn({role:i,parts:r,...o===void 0?{}:{source:o}},e)];const a=r.filter(h=>h.type!=="empty"),n=i==="assistant"&&a.length>0&&a.every(h=>h.type==="skillRead")?"skill":i,l=a.length>0?[cn({role:n,parts:a,...o===void 0?{}:{source:o}},e)]:[],c=S$(e);return c===void 0?l:[...l,cn(c,e)]}function S$(e){if(Ie(e,"role")!=="assistant"||Ie(e,"stopReason")!=="error")return;const t=Ie(e,"errorMessage")?.trim();return Ns("system",`Model response failed: ${t===void 0||t===""?"The model returned an error.":t}`)}function C$(e){const t=Ie(e,"role");return(t==="user"||t==="assistant"||t==="tool"||t==="system"||t==="bash"||t==="skill")&&Array.isArray(ts(e,"parts"))}function T$(e){if(e.length!==1||e[0]?.type!=="text")return;const t=M$(e[0].text);if(t!==void 0)return[{role:"user",parts:[{type:"skillInvocation",name:t.name,location:t.location,content:t.content}]},...t.userMessage===void 0?[]:[{role:"user",parts:[{type:"text",text:t.userMessage}]}]]}function $$(e){if(!ki(e)||e.customType!=="skill-prompt")return;const t=ki(e.details)?e.details:void 0,i=typeof t?.name=="string"?t.name:"skill",r=typeof t?.path=="string"?t.path:"",s=typeof e.content=="string"?e.content:"",o=typeof t?.args=="string"&&t.args.trim()!==""?t.args.trim():void 0;return[{role:"user",parts:[{type:"skillInvocation",name:i,location:r,content:s},...o!==void 0?[{type:"text",text:o}]:[]]}]}function M$(e){const t=/^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/.exec(e);if(t!==null){const r=t[4]?.trim();return{name:t[1]??"skill",location:t[2]??"",content:t[3]??"",...r===void 0||r===""?{}:{userMessage:r}}}const i=/^\[IMPORTANT: User invoked the "([^"]+)" skill; follow its instructions\. Full skill below\.\]\n\n([\s\S]*?)(?:\n\n---\n\n\[Skill directory: ([^\]]+)\][\s\S]*?(?:\nUser: ([\s\S]+))?)?$/.exec(e);if(i!==null){const r=i[4]?.trim();return{name:i[1]??"skill",location:i[3]??"",content:i[2]??"",...r===void 0||r===""?{}:{userMessage:r}}}}function A$(e){const t=Ie(e,"source");if(t==="compaction"||t==="branch_summary")return t}function B$(e){const t=_$(ts(e,"timestamp")),i=L$(e);if(!(t===void 0&&i===void 0))return{...t===void 0?{}:{timestamp:t},...i===void 0?{}:{model:i}}}function _$(e){if(typeof e=="number"&&Number.isFinite(e))return new Date(e).toISOString();if(typeof e!="string"||e==="")return;const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():void 0}function L$(e){if(Ie(e,"role")!=="assistant")return;const t=Ie(e,"provider"),i=Ie(e,"model"),r=Ie(e,"responseModel");if(!((t===void 0||t==="")&&(i===void 0||i==="")&&(r===void 0||r==="")))return{...t===void 0||t===""?{}:{provider:t},...i===void 0||i===""?{}:{id:i},...r===void 0||r===""?{}:{responseId:r}}}function P$(e){const t=Ie(e,"command")??"",i=Kh(e,"excludeFromContext")===!0?["excluded from context","",`$ ${t}`]:[`$ ${t}`],r=ts(e,"output");r!=null&&i.push("",kd(r));const s=ts(e,"exitCode");s!=null&&i.push("",`exit ${kd(s)}`),Kh(e,"cancelled")===!0&&i.push("","cancelled"),Kh(e,"truncated")===!0&&i.push("","output truncated");const o=Ie(e,"fullOutputPath");return o!==void 0&&o!==""&&i.push("",`full output: ${o}`),{role:"bash",parts:[{type:"text",text:i.join(`
5
5
  `)}]}}function E$(e){return e==="assistant"?"assistant":e==="user"?"user":e==="toolResult"?"tool":"system"}function R$(e,t){return typeof e=="string"?e!==""?[{type:"text",text:e}]:[]:Array.isArray(e)?e.flatMap(i=>{const r=Ie(i,"type"),s=Ie(i,"text");if(r==="text")return s!==void 0&&s!==""?[{type:"text",text:s}]:[];if(r==="thinking"){const o=Ie(i,"thinking")??s;return o!==void 0&&o!==""?[{type:"thinking",text:o}]:[]}if(r==="toolCall"){const o=Ie(i,"name")??"tool",a=ts(i,"arguments"),n=Ie(i,"id"),l=o==="read"?z$(Ie(a,"path")):void 0;return l!==void 0?[{type:"skillRead",...l,...n===void 0?{}:{toolCallId:n}}]:[{type:"toolCall",...n===void 0?{}:{toolCallId:n},toolName:o,summary:Fc(a),...a===void 0?{}:{args:a}}]}if(r==="image"){const o=Ie(i,"data"),a=Ie(i,"mimeType");return o!==void 0&&o!==""&&a!==void 0&&a!==""?[{type:"image",mimeType:a,data:o}]:[{type:"text",text:"[image]"}]}return Kb(i)}).map(i=>i.type==="text"&&Ie(t,"role")==="toolResult"?I$(i.text,t):i):Kb(e)}function I$(e,t){const i=Ie(t,"toolCallId"),r=ts(t,"content"),s=ts(t,"details");return{type:"toolResult",...i===void 0?{}:{toolCallId:i},toolName:Ie(t,"toolName")??"tool",text:e,...r===void 0?{}:{content:r},...s===void 0?{}:{details:s},isError:Kh(t,"isError")===!0}}function z$(e){if(e===void 0||e==="")return;const t=e.replace(/\\/g,"/");if(!t.endsWith("/SKILL.md")&&t!=="SKILL.md")return;const i=t.split("/").at(-2);if(!(i===void 0||i===""))return{name:i,path:e}}function D$(e){const t=[],i=new Map;for(const r of e){let s=[];const o={...r.source===void 0?{}:{source:r.source},...r.meta===void 0?{}:{meta:r.meta}},a=()=>{s.length!==0&&(t.push({role:r.role,parts:s,...o}),s=[])};for(const n of r.parts){if(n.type==="toolCall"){a();const l=F$(n),c=t.length;t.push({role:"tool",parts:[l],...o}),l.toolCallId!==void 0&&i.set(l.toolCallId,{lineIndex:c,partIndex:0});continue}if(n.type==="toolResult"){const l=n.toolCallId===void 0?void 0:i.get(n.toolCallId);if(l!==void 0&&O$(t,l,n)){i.delete(n.toolCallId??"");continue}}s.push(n)}a()}return t}function F$(e){return{type:"toolExecution",...e.toolCallId===void 0?{}:{toolCallId:e.toolCallId},toolName:e.toolName,summary:e.summary,...e.args===void 0?{}:{args:e.args},status:"pending"}}function O$(e,t,i){const r=e[t.lineIndex],s=r?.parts[t.partIndex];if(r===void 0||s?.type!=="toolExecution")return!1;const o=wd(i.details)??s.preview,a={...s,status:i.isError?"error":"success",resultText:i.text,...i.content===void 0?{}:{content:i.content},...i.details===void 0?{}:{details:i.details},...o===void 0?{}:{preview:o}};return e[t.lineIndex]={...r,parts:[...r.parts.slice(0,t.partIndex),a,...r.parts.slice(t.partIndex+1)]},!0}function wd(e){const t=ts(e,"preview");if(!ki(t))return;const i=Ie(t,"diff"),r=Ie(t,"error"),s=W$(t,"firstChangedLine");if(!(i===void 0&&r===void 0&&s===void 0))return{...i===void 0?{}:{diff:i},...r===void 0?{}:{error:r},...s===void 0?{}:{firstChangedLine:s}}}function Kb(e){return e==null?[]:typeof e=="object"?[{type:"text",text:Fc(e)}]:[{type:"text",text:kd(e)}]}function Fc(e){if(!ki(e))return kd(e);const t=Ie(e,"command");if(t!==void 0)return t;const i=Ie(e,"path");if(i!==void 0)return i;const r=Ie(e,"action");if(r!==void 0){const a=Ie(e,"prompt"),n=Ie(e,"schedule");if(a!==void 0&&n!==void 0){const c=a.length>35?`${a.slice(0,32)}…`:a;return`${r}: "${c}" (${n})`}const l=Ie(e,"jobId");return l!==void 0?`${r}: ${l}`:r}if(typeof e.oldText=="string"&&typeof e.newText=="string")return"edit text replacement";const s=e.edits;return Array.isArray(s)?`${String(s.length)} edit${s.length===1?"":"s"}`:Object.entries(e).filter(([,a])=>a!=null).slice(0,3).map(([a,n])=>`${a}: ${N$(n)}`).join(" · ")}function N$(e){return typeof e=="string"?e.length>80?`${e.slice(0,77)}…`:e:typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?`${String(e.length)} item${e.length===1?"":"s"}`:typeof e=="object"&&e!==null?"object":""}function ts(e,t){return ki(e)?e[t]:void 0}function Ie(e,t){const i=ts(e,t);return typeof i=="string"?i:void 0}function Kh(e,t){const i=ts(e,t);return typeof i=="boolean"?i:void 0}function W$(e,t){const i=ts(e,t);return typeof i=="number"&&Number.isFinite(i)?i:void 0}function kd(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):""}const q$="omp-web:prompt-draft:";function Sd(e){return`${q$}${e}`}function Cu(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}function vk(e,t=Cu()){try{return t?.getItem(Sd(e))??""}catch{return""}}function Cd(e,t,i=Cu()){try{t?i?.setItem(Sd(e),t):i?.removeItem(Sd(e))}catch{}}function Qg(e,t=Cu()){try{t?.removeItem(Sd(e))}catch{}}function H$(e,t,i=Cu()){const r=vk(e,i);r!==""&&(Cd(t,r,i),Qg(e,i))}function j$(e,t){return Ns("bash",`${t===!0?`excluded from context
6
6
 
7
7
  `:""}$ ${e}`)}function U$(e,t){const i=e.at(-1),r=i?.parts.at(-1);if(i?.role!=="bash"||r?.type!=="text")return[...e,Ns("bash",t)];const s=G$(r.text)?"":`
@@ -21,7 +21,7 @@ ${s.join(`
21
21
  `)+1,r=e.slice(i),s=ey(r,"@ "),o=ey(r,"!@"),a=Math.max(s,o);if(a===-1)return;const n=a===o?"!@":"@ ",l=i+a,c=l+n.length;return{kind:"file",query:e.slice(c),from:l,to:t,fileScope:"all",allPrefix:n}}function ey(e,t){for(let i=e.lastIndexOf(t);i>=0;i=e.lastIndexOf(t,i-1))if(i===0||M9(e[i-1]))return i;return-1}function M9(e){return e===" "||e===" "}function Ad(e){const t=e.trimStart();return t.startsWith("!@")?{kind:"file"}:t.startsWith("!")?{kind:"shell",excludeFromContext:t.startsWith("!!")}:_9(e).startsWith("/")?{kind:"command"}:$k(e)?.kind==="file"?{kind:"file"}:{kind:"normal"}}function A9(e){return Ad(e).kind==="shell"}function B9(e,t){return e.kind!==t.kind?!1:e.kind==="shell"&&t.kind==="shell"?e.excludeFromContext===t.excludeFromContext:!0}function _9(e){const t=Math.max(e.lastIndexOf(" "),e.lastIndexOf(`
22
22
  `))+1;return e.slice(t)}class L9{constructor(){this.reconnectDelay=500,this.shouldReconnect=!1,this.hasOpened=!1,this.machineId="local"}connect(t,i,r,s="local"){this.close(),this.machineId=s,this.session=t,this.onEvent=i,this.onReconnect=r,this.shouldReconnect=!0,this.open()}setHandler(t){this.onEvent=t}close(){this.shouldReconnect=!1,window.clearTimeout(this.reconnectTimer),Bk(this.socket),this.socket=void 0,this.session=void 0,this.onEvent=void 0,this.onReconnect=void 0,this.hasOpened=!1,this.machineId="local"}open(){if(this.session===void 0||this.session.id===""||this.session.cwd===""||!this.shouldReconnect)return;const t=zT(this.session,this.machineId);this.socket=t,t.onopen=()=>{this.reconnectDelay=500,this.hasOpened&&this.onReconnect?.(),this.hasOpened=!0},t.onmessage=i=>{this.handleMessage(i.data)},t.onerror=()=>{t.close()},t.onclose=()=>{this.socket===t&&(this.socket=void 0),this.scheduleReconnect()}}scheduleReconnect(){if(!this.shouldReconnect)return;window.clearTimeout(this.reconnectTimer);const t=this.reconnectDelay;this.reconnectDelay=Math.min(this.reconnectDelay*1.6,5e3),this.reconnectTimer=window.setTimeout(()=>{this.open()},t)}async handleMessage(t){const i=await Ak(t);P9(i)&&this.onEvent?.(i)}}class iy{constructor(){this.reconnectDelay=500,this.shouldReconnect=!1,this.machineId="local"}connect(t,i,r="local"){this.close(),this.machineId=r,this.onEvent=t,this.onOpen=i,this.shouldReconnect=!0,this.open()}close(){this.shouldReconnect=!1,window.clearTimeout(this.reconnectTimer),Bk(this.socket),this.socket=void 0,this.onEvent=void 0,this.onOpen=void 0,this.machineId="local"}open(){if(!this.shouldReconnect)return;const t=DT(this.machineId);this.socket=t,t.onopen=()=>{this.reconnectDelay=500,this.onOpen?.()},t.onmessage=i=>{this.handleMessage(i.data)},t.onerror=()=>{t.close()},t.onclose=()=>{this.socket===t&&(this.socket=void 0),this.scheduleReconnect()}}scheduleReconnect(){if(!this.shouldReconnect)return;window.clearTimeout(this.reconnectTimer);const t=this.reconnectDelay;this.reconnectDelay=Math.min(this.reconnectDelay*1.6,5e3),this.reconnectTimer=window.setTimeout(()=>{this.open()},t)}async handleMessage(t){const i=await Ak(t);R9(i)&&this.onEvent?.(i)}}function P9(e){const t=Jg(e);return["message.append","assistant.delta","assistant.thinking.delta","tool.start","tool.update","tool.end","shell.start","shell.chunk","shell.end","agent.start","agent.end","message.end","status.update","activity.update","command.output","session.error","session.name","session.created","pi.event","plan.proposed","plan.cleared","btw.start","btw.delta","btw.end","btw.error","btw.cleared","ask.requested","ask.cleared"].includes(t)}function E9(e){const t=Jg(e);return t==="status.update"||t==="activity.update"||t==="session.name"||t==="session.created"}function R9(e){const t=Jg(e);return E9(e)||t==="terminal.created"||t==="terminal.exited"||t==="terminal.closed"||t==="workspace.activity"}function Jg(e){if(typeof e!="object"||e===null||!("type"in e))return"";const t=e.type;return typeof t=="string"?t:""}async function Ak(e){try{return typeof e=="string"?JSON.parse(e):e instanceof Blob?JSON.parse(await e.text()):e instanceof ArrayBuffer?JSON.parse(new TextDecoder().decode(e)):void 0}catch{return}}function Bk(e){if(e!==void 0){if(e.onmessage=null,e.onerror=null,e.onclose=null,e.readyState===WebSocket.CONNECTING){e.onopen=()=>{e.close()};return}e.close()}}function _k(e,t){if(e===void 0)return"unknown";const r=(t?.sessionId===e.id?t.persisted:void 0)??e.persisted;return r===!0?"persisted":r===!1||vd(e)?"transient":"unknown"}function Ws(e,t){return e!==void 0&&e.archived!==!0&&_k(e,t)==="persisted"}function wc(e,t){return e!==void 0&&e.archived!==!0&&_k(e,t)==="transient"}function Oc(){try{return typeof sessionStorage>"u"?void 0:sessionStorage}catch{return}}class Tu{constructor(t,i,r=Oc()){this.storageKey=t,this.storage=r,this.values=new Map;for(const[s,o]of I9(t,i,r))this.values.set(s,o)}get(t){return this.values.get(t)}set(t,i){this.values.set(t,i),this.save()}delete(t){this.values.delete(t),this.save()}entries(){return[...this.values.entries()]}save(){try{if(this.values.size===0){this.storage?.removeItem(this.storageKey);return}const t={version:1,entries:[...this.values.entries()]};this.storage?.setItem(this.storageKey,JSON.stringify(t))}catch{}}}function tm(e){return typeof e=="string"&&e!==""?e:void 0}function I9(e,t,i){try{const r=i?.getItem(e);if(r==null||r==="")return[];const s=JSON.parse(r);if(!z9(s))return[];const o=[];for(const a of s.entries){const n=a[0],l=t(a[1]);l!==void 0&&o.push([n,l])}return o}catch{return[]}}function z9(e){return!ki(e)||e.version!==1||!Array.isArray(e.entries)?!1:e.entries.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&t[0]!=="")}class D9{constructor(){this.sessionIdsByCwd=new Map}latestSessionId(t){return this.sessionIdsByCwd.get(t)}rememberSession(t){this.sessionIdsByCwd.set(t.cwd,t.id)}forgetWorkspace(t){this.sessionIdsByCwd.delete(t)}}const F9="omp-web:session-selection:v1";class O9{constructor(t=Oc()){this.sessionIdsByCwd=new Tu(F9,tm,t)}latestSessionId(t){return this.sessionIdsByCwd.get(t)}rememberSession(t){this.sessionIdsByCwd.set(t.cwd,t.id)}forgetWorkspace(t){this.sessionIdsByCwd.delete(t)}}function N9(e,t){const i=t?.targetSessionId;if(i!==void 0&&i!=="")return q9(e,i);const r=t?.latestSessionId;return r!==void 0&&r!==""?e.find(s=>s.id===r)??e.find(s=>s.archived!==!0):e.find(s=>s.archived!==!0)}function W9(e,t){return t?.archived!==!0?!1:!e.some(i=>i.archived!==!0)}function q9(e,t){return e.find(i=>i.id===t||i.id.startsWith(t))}function H9(e,t,i){return Gl(e,[t],i)}function Gl(e,t,i){const r=new Set(t);return e.map(s=>r.has(s.id)?{...s,archived:!0,archivedAt:i}:s)}function j9(e,t,i){return Zh(e,t,[i])}function Zh(e,t,i){if(t===void 0||!i.includes(t))return{type:"unchanged"};const r=new Set(i),s=e.find(o=>!r.has(o.id)&&o.archived!==!0);return s===void 0?{type:"clear"}:{type:"select",session:s}}const uh=100,ry=4;class U9{constructor(t,i,r,s=new D9,o={}){this.getState=t,this.setState=i,this.updateUrl=r,this.sessionSelection=s,this.selectionSeq=0,this.pendingTranscriptEvents=[],this.pendingStatusBySession=new Map,this.pendingActivityBySession=new Map,this.socket=o.socket??new L9,this.api=o.api??gi,this.transcripts=o.transcripts??new C9}applyGlobalEvent(t){t.type==="status.update"?this.queueStatusUpdate(t.status):t.type==="activity.update"?this.queueActivityUpdate(t.activity):t.type==="session.created"?this.applyCreatedSession(t.session):this.applySessionName(t.sessionId,t.name)}dispose(){this.socket.close(),this.clearPendingUpdates()}clearActiveSession(){this.selectionSeq+=1,this.socket.close(),this.clearPendingUpdates(),this.setState({selectedSession:void 0,messages:[],messagePageStart:0,messagePageEnd:0,messagePageTotal:0,isLoadingEarlierMessages:!1,status:void 0,activity:void 0,availableThinkingLevels:[],btwState:void 0})}deselectSession(t){const i=this.getState(),r=i.selectedSession?.cwd??i.selectedWorkspace?.path;t?.forgetRememberedSelection===!0&&r!==void 0&&this.sessionSelection.forgetWorkspace(this.workspaceSelectionKey(r)),this.clearActiveSession(),t?.updateUrl!==!1&&this.updateUrl()}clearSelectionAfterArchivedCollapse(){const t=this.getState();W9(t.sessions,t.selectedSession)&&this.deselectSession({forgetRememberedSelection:!0})}async startSession(){const t=this.getState().selectedWorkspace;if(!t)return;const i=wt(this.getState());this.setState({startingSessionCount:this.getState().startingSessionCount+1,error:""});try{const r=await this.api.startSession(t.path,i);Xb(r,i);const s=pf(r,i),o=this.getState(),a=[s,...o.sessions.filter(n=>n.id!==s.id)];this.setState({sessions:a,startingSessionCount:Math.max(0,this.getState().startingSessionCount-1)}),await this.selectSession(s)}catch(r){this.setState({startingSessionCount:Math.max(0,this.getState().startingSessionCount-1),error:`Failed to start session: ${Je(r)}`})}}preferredSession(t,i,r){return N9(i,{targetSessionId:r,latestSessionId:this.sessionSelection.latestSessionId(this.workspaceSelectionKey(t))})}async selectSession(t,i){this.sessionSelection.rememberSession({...t,cwd:this.workspaceSelectionKey(t.cwd)});const r=++this.selectionSeq;this.socket.close(),this.clearPendingUpdates();const s=this.sessionCacheKey(t.id),o=this.transcripts.cachedView(s);this.setState({selectedSession:t,...o,isLoadingEarlierMessages:!1,status:t.archived===!0?void 0:this.getState().sessionStatuses[t.id],activity:t.archived===!0?void 0:this.getState().sessionActivities[t.id],btwState:void 0});try{if(t.archived===!0){const h=await this.api.messages(t,{limit:uh},wt(this.getState()));if(r!==this.selectionSeq||this.getState().selectedSession?.id!==t.id)return;const d=this.transcripts.mergeHistory(s,h);this.setState({...d,isLoadingEarlierMessages:!1,status:void 0,activity:void 0}),i?.updateUrl!==!1&&this.updateUrl();return}const a=[];this.socket.connect(t,h=>a.push(h),()=>{this.refreshSelectedSession(t.id)},wt(this.getState()));const[n,l]=await Promise.all([this.api.messages(t,{limit:uh},wt(this.getState())),this.api.status(t,wt(this.getState()))]);if(r!==this.selectionSeq||this.getState().selectedSession?.id!==t.id)return;const c=this.transcripts.mergeHistory(s,n);this.setState({...c,isLoadingEarlierMessages:!1,status:l,activity:this.getState().sessionActivities[t.id],availableThinkingLevels:[]}),this.applyStatus(l),this.refreshAvailableThinkingLevels();for(const h of a)this.applyEvent(h);this.socket.setHandler(h=>{this.applyEvent(h)}),i?.updateUrl!==!1&&this.updateUrl()}catch(a){if(r!==this.selectionSeq||this.getState().selectedSession?.id!==t.id)return;if(vd(t)&&K9(a)){await this.recreateCachedNewSession(t,i);return}this.setState({error:String(a)})}}async loadEarlierMessages(){const t=this.getState(),i=t.selectedSession;if(!(!i||t.isLoadingEarlierMessages||t.messagePageStart<=0)){this.setState({isLoadingEarlierMessages:!0});try{const r=await this.api.messages(i,{before:t.messagePageStart,limit:uh},wt(this.getState()));if(this.getState().selectedSession?.id!==i.id)return;const s=this.transcripts.mergeHistory(this.sessionCacheKey(i.id),r);this.setState(s)}catch(r){this.setState({error:String(r)})}finally{this.getState().selectedSession?.id===i.id&&this.setState({isLoadingEarlierMessages:!1})}}}async send(t,i,r,s="inline"){const o=this.getState().selectedSession;if(!o||o.archived===!0)return;const a=t.trim(),n=r!==void 0&&r.length>0;if(!n&&a.startsWith("/"))return this.runCommand(t);if(!n&&A9(t))return this.runShell(t);await this.deliverPromptToSession(o,t,i,r,s,wt(this.getState()),{markSending:n})}markSendingPrompt(t,i){const r=this.getState().sendingPrompts;i?r[t]!==!0&&this.setState({sendingPrompts:{...r,[t]:!0}}):t in r&&this.setState({sendingPrompts:Sn(r,t)})}async runShell(t){const i=this.getState().selectedSession;!i||i.archived===!0||await this.deliverShellToSession(i,t,wt(this.getState()),{optimisticLine:!0})}async runCommand(t){const i=this.getState().selectedSession;!i||i.archived===!0||await this.deliverCommandToSession(i,t,wt(this.getState()),{applyResult:!0})}async approvePlan(){await this.runCommand("/plan approve")}async rejectPlan(t){const i=t!==void 0&&t.trim()!==""?`/plan reject ${t.trim()}`:"/plan reject";await this.runCommand(i)}closePlanReview(){this.setState({planReviewDialog:void 0})}openPlanReview(){const t=this.getState().status?.planMode?.proposedPlan;t!==void 0?this.setState({planReviewDialog:t}):this.runCommand("/plan-review")}togglePlanMode(){this.runCommand("/plan")}closeBtw(){this.setState({btwState:void 0})}async submitAsk(t,i){const r=this.getState().selectedSession;if(this.setState({askDialog:void 0}),!!r)try{await this.api.respondToAsk(r,t,i,wt(this.getState()))}catch(s){this.setState({error:String(s)})}}async cancelAsk(t){const i=this.getState().selectedSession;if(this.setState({askDialog:void 0}),!!i)try{await this.api.respondToAsk(i,t,void 0,wt(this.getState()))}catch(r){this.setState({error:String(r)})}}async branchBtw(){await this.runCommand("/btw branch")}async deliverPromptToSession(t,i,r,s,o,a,n){const l=s!==void 0&&s.length>0;n.markSending&&this.markSendingPrompt(t.id,!0);try{if(l&&o==="folder"){const h=(await this.api.saveAttachments(t,s,a)).map(u=>Mk(u.path,!1)).join(" "),d=i===""?h:`${i}
23
23
 
24
- ${h}`;await this.api.prompt(t,d,r,a)}else await this.api.prompt(t,i,r,a,s);return this.markCachedNewSessionPersisted(t),!0}catch(c){return this.setState({error:String(c)}),!1}finally{n.markSending&&this.markSendingPrompt(t.id,!1)}}async deliverShellToSession(t,i,r,s){s.optimisticLine&&this.getState().selectedSession?.id===t.id&&this.setState({messages:[...this.getState().messages,Ns("user",i)]});try{return await this.api.shell(t,i,r),this.markCachedNewSessionPersisted(t),!0}catch(o){return this.getState().selectedSession?.id===t.id&&this.setState({messages:[...this.getState().messages,Ns("system",String(o))]}),this.setState({error:String(o)}),!1}}async deliverCommandToSession(t,i,r,s){this.markSendingPrompt(t.id,!0);try{const o=await this.api.runCommand(t,i,r);return s.applyResult&&this.getState().selectedSession?.id===t.id?this.applyCommandResult(o):o.type==="select"&&this.setState({error:`Queued command “${i}” needs input; open the session and run it again.`}),this.markCachedNewSessionPersisted(t),!0}catch(o){return this.getState().selectedSession?.id===t.id&&this.setState({messages:[...this.getState().messages,Ns("system",String(o))]}),this.setState({error:String(o)}),!1}finally{this.markSendingPrompt(t.id,!1)}}dropNextQueuedSessionMessage(t){const i=this.getState(),r=i.clientQueuedSessionMessages[t]??[];if(r.length===0)return;const s=r.slice(1);this.setState({clientQueuedSessionMessages:s.length===0?Sn(i.clientQueuedSessionMessages,t):{...i.clientQueuedSessionMessages,[t]:s}})}async respondToCommand(t,i){const r=this.getState().selectedSession;if(r){this.setState({commandDialog:void 0});try{this.applyCommandResult(await this.api.respondToCommand(r,t,i,wt(this.getState())))}catch(s){this.setState({error:String(s)})}}}cancelCommand(){this.setState({commandDialog:void 0})}applySessionStatus(t){this.applyStatus(t)}async archiveSession(t=this.getState().selectedSession){if(!t)return;const i=this.statusForSession(t);if(wc(t,i)){await this.deleteCachedNewSession(t);return}if(Ws(t,i))try{await this.api.archive(t,wt(this.getState()));const r=this.getState(),s=H9(r.sessions,t.id,new Date().toISOString()),o=j9(s,r.selectedSession?.id,t.id);this.setState({sessions:s}),o.type==="select"?await this.selectSession(o.session):o.type==="clear"&&this.deselectSession({forgetRememberedSelection:!0})}catch(r){this.setState({error:String(r)})}}async archiveSessionWithDescendants(t=this.getState().selectedSession){if(!(t===void 0||!Ws(t,this.statusForSession(t))))try{const i=await this.api.archiveWithDescendants(t,wt(this.getState())),r=i.sessionIds!==void 0&&i.sessionIds.length>0?i.sessionIds:[t.id],s=this.getState(),o=Gl(s.sessions,r,new Date().toISOString()),a=Zh(o,s.selectedSession?.id,r);this.setState({sessions:o}),a.type==="select"?await this.selectSession(a.session):a.type==="clear"&&this.deselectSession({forgetRememberedSelection:!0})}catch(i){this.setState({error:String(i)})}}async archiveSessions(t){const i=ay(t).filter(r=>Ws(r,this.statusForSession(r)));if(i.length!==0)try{const r=wt(this.getState()),{succeededIds:s,failures:o,generatedAt:a}=await this.archiveSessionBatch(i,r);if(s.length>0){const n=this.getState(),l=Gl(n.sessions,s,a??new Date().toISOString()),c=Zh(l,n.selectedSession?.id,s);this.setState({sessions:l}),c.type==="select"?await this.selectSession(c.session):c.type==="clear"&&this.deselectSession({forgetRememberedSelection:!0})}this.applyBulkSessionFailures("Archive",o)}catch(r){this.setState({error:`Archive failed: ${Je(r)}`})}}async deleteArchivedSessions(t){const i=ay(t).filter(o=>o.archived===!0);if(i.length===0)return;const r=wt(this.getState()),s=this.getState().machineRuntimes[r];if(s?.ok!==!0||!vs(s,Kr.sessionsDeleteArchived)){this.setState({error:"Deleting archived sessions requires an updated Omp-Web runtime on this machine."});return}try{const{succeededIds:o,failures:a}=await this.deleteArchivedSessionBatch(i,r);if(o.length>0){const n=new Set(o),l=this.getState(),c=l.sessions.filter(h=>!n.has(h.id));if(this.setState({sessions:c}),l.selectedSession!==void 0&&n.has(l.selectedSession.id)){const h=c.find(d=>d.archived!==!0)??c[0];h!==void 0?await this.selectSession(h):this.deselectSession({forgetRememberedSelection:!0})}}this.applyBulkSessionFailures("Delete",a)}catch(o){this.setState({error:`Delete failed: ${Je(o)}`})}}async archiveSessionBatch(t,i){const r=this.getState().machineRuntimes[i];if(r?.ok===!0&&vs(r,Kr.sessionsBulkMutations)){const o=await this.api.archiveMany(t,i);return{succeededIds:o.archivedSessionIds,failures:ly(o.failures),generatedAt:o.generatedAt}}const s=await hy(t,ry,async o=>(await this.api.archive(o,i),o.id));return{succeededIds:ny(s),failures:cy(t,s)}}async deleteArchivedSessionBatch(t,i){const r=this.getState().machineRuntimes[i];if(r?.ok===!0&&vs(r,Kr.sessionsBulkMutations)){const o=await this.api.deleteArchivedMany(t,i);return{succeededIds:o.deletedSessionIds,failures:ly(o.failures)}}const s=await hy(t,ry,async o=>(await this.api.deleteArchived(o,i),o.id));return{succeededIds:ny(s),failures:cy(t,s)}}async applySessionCleanupResult(t,i=wt(this.getState())){if(wt(this.getState())!==i)return;const r=t.archivedSessionIds,s=t.deletedSessionIds;if(r.length>0||s.length>0){const o=this.getState(),a=new Set(s),n=[...r,...s],l=Gl(o.sessions,r,t.generatedAt).filter(h=>!a.has(h.id)),c=o.selectedSession!==void 0&&n.includes(o.selectedSession.id);if(this.setState({sessions:l,sessionStatuses:oy(o.sessionStatuses,n),sessionActivities:oy(o.sessionActivities,n),...c?{status:void 0,activity:void 0}:{}}),o.selectedSession!==void 0&&a.has(o.selectedSession.id)){const h=l.find(d=>d.archived!==!0)??l[0];h!==void 0?await this.selectSession(h):this.deselectSession({forgetRememberedSelection:!0})}else{const h=Zh(l,o.selectedSession?.id,r);h.type==="select"?await this.selectSession(h.session):h.type==="clear"&&this.deselectSession({forgetRememberedSelection:!0})}}await this.refreshCurrentWorkspaceSessions(i)}async refreshCurrentWorkspaceSessions(t=wt(this.getState())){const i=this.getState().selectedWorkspace;if(i!==void 0)try{const r=xk(i.path,await this.api.sessions(i.path,t),t);if(wt(this.getState())!==t||this.getState().selectedWorkspace?.id!==i.id)return;const s=r,o=this.getState().selectedSession;if(this.setState({sessions:s}),o===void 0)return;const a=s.find(l=>l.id===o.id);if(a!==void 0){a!==o&&this.setState({selectedSession:a});return}const n=s.find(l=>l.archived!==!0)??s[0];n!==void 0?await this.selectSession(n):this.deselectSession({forgetRememberedSelection:!0})}catch(r){wt(this.getState())===t&&this.getState().selectedWorkspace?.id===i.id&&this.setState({error:String(r)})}}async deleteCachedNewSession(t=this.getState().selectedSession){if(t===void 0||!wc(t,this.statusForSession(t)))return;this.api.stop(t,wt(this.getState())).catch(()=>{}),Vb(t.id,wt(this.getState())),Qg(this.sessionCacheKey(t.id));const i=this.getState(),r=i.sessions.filter(o=>o.id!==t.id);if(this.setState({sessions:r,sessionStatuses:Sn(i.sessionStatuses,t.id),sessionActivities:sy(i.sessionActivities,t.id),sendingPrompts:Sn(i.sendingPrompts,t.id),clientQueuedSessionMessages:Sn(i.clientQueuedSessionMessages,t.id)}),this.getState().selectedSession?.id!==t.id)return;const s=r.find(o=>o.archived!==!0)??r[0];s!==void 0?await this.selectSession(s):(this.clearActiveSession(),this.updateUrl())}async restoreSession(t=this.getState().selectedSession){if(t)try{await this.api.restore(t,wt(this.getState()));const i={...t};delete i.archived,delete i.archivedAt,this.replaceSession(i),this.getState().selectedSession?.id===i.id&&await this.selectSession(i)}catch(i){this.setState({error:String(i)})}}async reloadSession(t=this.getState().selectedSession){if(t===void 0||!Ws(t,this.statusForSession(t)))return;const i=wt(this.getState()),r=this.getState().machineRuntimes[i];if(r?.ok!==!0||!vs(r,Kr.sessionsReload)){this.setState({error:"Reloading sessions from disk requires an updated Omp-Web runtime on this machine."});return}try{await this.api.reloadSession(t.id,i),this.transcripts.discard(this.sessionCacheKey(t.id)),this.getState().selectedSession?.id===t.id&&await this.selectSession(t,{updateUrl:!1})}catch(s){this.setState({error:String(s)})}}async detachParent(t=this.getState().selectedSession){if(t?.parentSessionPath!==void 0)try{await this.api.detachParent(t,wt(this.getState()));const i={...t};delete i.parentSessionPath,this.replaceSession(i)}catch(i){this.setState({error:String(i)})}}async listModels(){const t=this.getState().selectedSession;if(!t||t.archived===!0)return[];try{return(await this.api.models(t,wt(this.getState()))).models}catch(i){return this.setState({error:String(i)}),[]}}async setModel(t,i,r){const s=this.getState().selectedSession;if(!(!s||s.archived===!0))try{this.applyStatus(await this.api.setModel(s,t,i,r,wt(this.getState()))),await this.refreshAvailableThinkingLevels()}catch(o){this.setState({error:String(o)})}}async cycleModel(t){const i=this.getState().selectedSession;if(!(!i||i.archived===!0))try{this.applyStatus(await this.api.cycleModel(i,t,wt(this.getState()))),await this.refreshAvailableThinkingLevels()}catch(r){this.setState({error:String(r)})}}async listThinkingLevels(){const t=this.getState().selectedSession;if(!t||t.archived===!0)return[];try{return(await this.api.thinkingLevels(t,wt(this.getState()))).levels}catch(i){return this.setState({error:String(i)}),[]}}async refreshAvailableThinkingLevels(){const t=this.getState().selectedSession;if(!t||t.archived===!0){this.getState().availableThinkingLevels.length>0&&this.setState({availableThinkingLevels:[]});return}const i=await this.listThinkingLevels();this.getState().selectedSession?.id===t.id&&this.setState({availableThinkingLevels:i})}async setThinkingLevel(t){const i=this.getState().selectedSession;if(!(!i||i.archived===!0))try{this.applyStatus(await this.api.setThinkingLevel(i,t,wt(this.getState())))}catch(r){this.setState({error:String(r)})}}async cycleThinkingLevel(){const t=this.getState().selectedSession;if(!(!t||t.archived===!0))try{this.applyStatus(await this.api.cycleThinkingLevel(t,wt(this.getState())))}catch(i){this.setState({error:String(i)})}}async stopActiveWork(){const t=this.getState().selectedSession;if(t)try{await this.api.abort(t,wt(this.getState()))}catch(i){this.setState({error:String(i)})}}async refreshSelectedSession(t=this.getState().selectedSession?.id){const i=this.getState().selectedSession;if(!(t===void 0||i?.id!==t||i.archived===!0))try{this.flushPendingUpdates();const[r,s]=await Promise.all([this.api.messages(i,{limit:uh},wt(this.getState())),this.api.status(i,wt(this.getState()))]);if(this.getState().selectedSession?.id!==t)return;const o=this.transcripts.mergeHistory(this.sessionCacheKey(t),r);this.setState({...o,status:s,activity:this.getState().sessionActivities[t]}),this.applyStatus(s)}catch(r){this.getState().selectedSession?.id===t&&this.setState({error:String(r)})}}applyBulkSessionFailures(t,i){i.length!==0&&this.setState({error:`${t} failed for ${String(i.length)} session${i.length===1?"":"s"}: ${i.join("; ")}`})}sessionCacheKey(t){return yk(wt(this.getState()),t)}statusForSession(t){if(t===void 0)return;const i=this.getState();return i.status?.sessionId===t.id&&i.selectedSession?.id===t.id?i.status:i.sessionStatuses[t.id]}workspaceSelectionKey(t){return`${wt(this.getState())}:${t}`}replaceSession(t){const i=this.getState().selectedSession;this.setState({sessions:this.getState().sessions.map(r=>r.id===t.id?t:r),selectedSession:i?.id===t.id?t:i})}async recreateCachedNewSession(t,i){try{const r=wt(this.getState()),s=await this.api.startSession(t.cwd,r);Xb(s,r),H$(this.sessionCacheKey(t.id),this.sessionCacheKey(s.id)),Vb(t.id,r);const o=pf(s,r);this.setState({sessions:[o,...this.getState().sessions.filter(a=>a.id!==t.id)],error:""}),await this.selectSession(o,{updateUrl:!1}),this.updateUrl(i?.updateUrl===!1?{replace:!0}:void 0)}catch(r){this.setState({error:String(r)})}}markCachedNewSessionPersisted(t){if(!vd(t))return;const i=this.getState().sessions.find(r=>r.id===t.id)??t;this.replaceSession(m$(i))}applyCommandResult(t){if(t.type==="select"){this.setState({commandDialog:t});return}const i=(t.type==="unsupported",t.message);if(i!==void 0&&i!==""&&this.setState({messages:[...this.getState().messages,Ns(t.type==="unsupported"?"system":"tool",i)]}),t.type==="done"&&t.session){t.promptDraft!==void 0&&Cd(this.sessionCacheKey(t.session.id),t.promptDraft);const r=this.getState().selectedSession,s=[t.session,...this.getState().sessions.filter(o=>o.id!==t.session?.id)];this.setState({sessions:s,selectedSession:r?.id===t.session.id?t.session:r}),r?.id!==t.session.id&&this.selectSession(t.session)}}applyCreatedSession(t){const i=this.getState();i.selectedWorkspace?.path===t.cwd&&(i.sessions.some(r=>r.id===t.id)||this.setState({sessions:[t,...i.sessions]}))}applyActivity(t){this.setState({sessionActivities:{...this.getState().sessionActivities,[t.sessionId]:t},activity:this.getState().selectedSession?.id===t.sessionId?t:this.getState().activity})}applyStatus(t){const i=this.getState(),r=i.sessionActivities[t.sessionId]?.phase==="active"&&!na(t);let s=i.sessions;t.archived===!0?s=Gl(s,[t.sessionId],new Date().toISOString()):t.dormant!==void 0&&(s=s.map(o=>o.id===t.sessionId?{...o,dormant:t.dormant}:o)),this.setState({sessions:s,selectedSession:i.selectedSession?.id===t.sessionId?s.find(o=>o.id===t.sessionId)??i.selectedSession:i.selectedSession,sessionStatuses:{...i.sessionStatuses,[t.sessionId]:t},...X9(i,t.sessionId,t.messageCount),...r?{sessionActivities:sy(i.sessionActivities,t.sessionId)}:{},status:i.selectedSession?.id===t.sessionId?t:i.status,activity:i.selectedSession?.id===t.sessionId&&r?void 0:i.activity,...i.selectedSession?.id===t.sessionId&&t.pendingAsk?{askDialog:t.pendingAsk}:{},...i.selectedSession?.id===t.sessionId&&!t.isStreaming&&!t.pendingAsk&&i.askDialog?{askDialog:void 0}:{},...i.selectedSession?.id===t.sessionId&&t.planMode?.proposedPlan&&!i.planReviewDialog?{planReviewDialog:t.planMode.proposedPlan}:{},...i.selectedSession?.id===t.sessionId&&!t.planMode?.proposedPlan&&i.planReviewDialog?{planReviewDialog:void 0}:{}})}applySessionName(t,i){const r=o=>{if(o.id!==t)return o;const a={...o};return i===void 0||i===""?delete a.name:a.name=i,a},s=this.getState().selectedSession;this.setState({sessions:this.getState().sessions.map(r),selectedSession:s===void 0?void 0:r(s)})}applyEvent(t){if(t.type==="status.update"){this.queueStatusUpdate(t.status);return}if(t.type==="activity.update"){this.queueActivityUpdate(t.activity);return}if(V9(t)){this.queueTranscriptEvent(t);return}if(t.type==="plan.proposed"){this.setState({planReviewDialog:t.plan});return}if(t.type==="plan.cleared"){this.setState({planReviewDialog:void 0});return}if(t.type==="ask.requested"){this.setState({askDialog:{requestId:t.requestId,questions:t.questions}});return}if(t.type==="ask.cleared"){this.getState().askDialog?.requestId===t.requestId&&this.setState({askDialog:void 0});return}if(t.type==="btw.start"){this.setState({btwState:{status:"running",question:t.question,answer:""}});return}if(t.type==="btw.delta"){const r=this.getState().btwState;r?.status==="running"&&this.setState({btwState:{...r,answer:r.answer+t.delta}});return}if(t.type==="btw.end"){this.setState({btwState:{status:"complete",question:t.question,answer:t.answer,canBranch:t.canBranch}});return}if(t.type==="btw.error"){this.setState({btwState:{status:"error",question:this.getState().btwState?.question??"",answer:"",error:t.error}});return}if(t.type==="btw.cleared"){this.setState({btwState:void 0});return}this.flushPendingUpdates();const i=this.transcripts.applyLiveEvent(this.getState().messages,t);i?this.setState({messages:i}):t.type==="session.name"&&this.applySessionName(t.sessionId,t.name)}queueTranscriptEvent(t){this.pendingTranscriptEvents.push(t),this.schedulePendingFlush()}queueStatusUpdate(t){this.pendingStatusBySession.set(t.sessionId,t),this.schedulePendingFlush()}queueActivityUpdate(t){this.pendingActivityBySession.set(t.sessionId,t),this.schedulePendingFlush()}schedulePendingFlush(){this.pendingFrame===void 0&&(this.pendingFrame=requestAnimationFrame(()=>{this.pendingFrame=void 0,this.flushPendingUpdates()}))}flushPendingUpdates(){if(this.pendingTranscriptEvents.length>0){const t=this.pendingTranscriptEvents;this.pendingTranscriptEvents=[];let i=this.getState().messages;for(const r of t)i=this.transcripts.applyLiveEvent(i,r)??i;i!==this.getState().messages&&this.setState({messages:i})}if(this.pendingActivityBySession.size>0){const t=Array.from(this.pendingActivityBySession.values());this.pendingActivityBySession.clear();for(const i of t)this.applyActivity(i)}if(this.pendingStatusBySession.size>0){const t=Array.from(this.pendingStatusBySession.values());this.pendingStatusBySession.clear();for(const i of t)this.applyStatus(i)}}clearPendingUpdates(){this.pendingTranscriptEvents=[],this.pendingStatusBySession.clear(),this.pendingActivityBySession.clear(),this.pendingFrame!==void 0&&(cancelAnimationFrame(this.pendingFrame),this.pendingFrame=void 0)}}function sy(e,t){return Sn(e,t)}function Sn(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>i!==t))}function oy(e,t){if(t.length===0)return e;const i=new Set(t);return Object.fromEntries(Object.entries(e).filter(([r])=>!i.has(r)))}function ay(e){const t=new Set,i=[];for(const r of e)t.has(r.id)||(t.add(r.id),i.push(r));return i}function ny(e){return e.filter(Y9).map(t=>t.value)}function ly(e){return e.map(t=>`${t.sessionId}: ${t.error}`)}function cy(e,t){return t.flatMap((i,r)=>G9(i)?[`${e[r]?.id??"unknown"}: ${Je(i.reason)}`]:[])}async function hy(e,t,i){const r=e.map((l,c)=>({item:l,index:c})),s=[];let o=0;async function a(){for(;o<r.length;){const l=r[o];if(l===void 0)return;o+=1;try{s[l.index]={status:"fulfilled",value:await i(l.item)}}catch(c){s[l.index]={status:"rejected",reason:c}}}}const n=Math.min(Math.max(1,t),r.length);return await Promise.all(Array.from({length:n},()=>a())),s}function Y9(e){return e.status==="fulfilled"}function G9(e){return e.status==="rejected"}function X9(e,t,i){if(i===void 0)return{};const s=e.sessions.some(a=>a.id===t&&a.messageCount!==i)?e.sessions.map(a=>a.id===t?{...a,messageCount:i}:a):void 0,o=e.selectedSession?.id===t&&e.selectedSession.messageCount!==i?{...e.selectedSession,messageCount:i}:e.selectedSession;return{...s===void 0?{}:{sessions:s},...o!==e.selectedSession?{selectedSession:o}:{}}}function V9(e){return e.type==="assistant.delta"||e.type==="assistant.thinking.delta"||e.type==="shell.chunk"}function K9(e){return e instanceof Error&&e.message.toLowerCase().includes("session not found")}class Z9{constructor(){this.workspaceIdsByProject=new Map}latestWorkspaceId(t){return this.workspaceIdsByProject.get(t)}rememberWorkspace(t){this.workspaceIdsByProject.set(t.projectId,t.id)}forgetProject(t){this.workspaceIdsByProject.delete(t)}}const Q9="omp-web:workspace-selection:v1";class J9{constructor(t=Oc()){this.workspaceIdsByProject=new Tu(Q9,tm,t)}latestWorkspaceId(t){return this.workspaceIdsByProject.get(t)}rememberWorkspace(t){this.workspaceIdsByProject.set(t.projectId,t.id)}forgetProject(t){this.workspaceIdsByProject.delete(t)}}function tM(e,t){const i=t?.targetWorkspaceId;if(i!==void 0&&i!=="")return e.find(s=>s.id===i);const r=t?.latestWorkspaceId;return r!==void 0&&r!==""?e.find(s=>s.id===r)??e[0]:e[0]}const eM={showThinking:!0,showEvents:!0,showToolExecutions:!0,showAgentStatus:!0,vimMode:!1,showStatusBar:!1,hideWorkspaces:!1,bottomMobileNav:!0,hideBreadcrumbs:!0},js="omp-web-chat-preferences-changed",gf="omp-web:chat-preferences";let Lk={};function Us(){if(typeof window<"u")return window}function iM(e){Lk={...e};const t=Us();t!==void 0&&t.dispatchEvent(new CustomEvent(js,{detail:$r()}))}function $u(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t={...e};return typeof t.showThinking=="boolean"&&typeof t.showEvents=="boolean"&&typeof t.showToolExecutions=="boolean"&&typeof t.showAgentStatus=="boolean"&&typeof t.vimMode=="boolean"&&typeof t.showStatusBar=="boolean"&&typeof t.hideWorkspaces=="boolean"&&typeof t.bottomMobileNav=="boolean"&&typeof t.hideBreadcrumbs=="boolean"}function $r(){const e={...eM,...Lk};try{if(typeof localStorage>"u")return e;const t=localStorage.getItem(gf);if(t===null||t==="")return e;const i=JSON.parse(t);if(typeof i!="object"||i===null||Array.isArray(i))return e;const r={...i};return{showThinking:typeof r.showThinking=="boolean"?r.showThinking:e.showThinking,showEvents:typeof r.showEvents=="boolean"?r.showEvents:e.showEvents,showToolExecutions:typeof r.showToolExecutions=="boolean"?r.showToolExecutions:e.showToolExecutions,showAgentStatus:typeof r.showAgentStatus=="boolean"?r.showAgentStatus:e.showAgentStatus,vimMode:typeof r.vimMode=="boolean"?r.vimMode:e.vimMode,showStatusBar:typeof r.showStatusBar=="boolean"?r.showStatusBar:e.showStatusBar,hideWorkspaces:typeof r.hideWorkspaces=="boolean"?r.hideWorkspaces:e.hideWorkspaces,bottomMobileNav:typeof r.bottomMobileNav=="boolean"?r.bottomMobileNav:e.bottomMobileNav,hideBreadcrumbs:typeof r.hideBreadcrumbs=="boolean"?r.hideBreadcrumbs:e.hideBreadcrumbs}}catch{return e}}function rM(e){try{if(typeof localStorage<"u"){const r=localStorage.getItem(gf);let s={};try{const o=r===null||r===""?{}:JSON.parse(r);typeof o=="object"&&o!==null&&!Array.isArray(o)&&(s={...o})}catch{}localStorage.setItem(gf,JSON.stringify({...s,...e}))}}catch{}const t=$r(),i=Us();i!==void 0&&i.dispatchEvent(new CustomEvent(js,{detail:t}))}class sM{constructor(t,i,r,s,o=new Z9,a={}){this.getState=t,this.setState=i,this.updateUrl=r,this.sessions=s,this.workspaceSelection=o,this.api=a.api??gi}clearSelection(t){this.sessions.clearActiveSession(),this.setState({selectedProject:void 0,selectedWorkspace:void 0,workspaces:[],isLoadingWorkspaces:!1,...Vh()}),t?.updateUrl!==!1&&this.updateUrl()}forgetProject(t){this.workspaceSelection.forgetProject(Mp(wt(this.getState()),t));const i=Object.fromEntries(Object.entries(this.getState().workspacesByProjectId).filter(([r])=>r!==t));this.setState({workspacesByProjectId:i})}async selectProject(t,i){const r=wt(this.getState());this.sessions.clearActiveSession(),this.setState({selectedProject:t,selectedWorkspace:void 0,workspaces:[],isLoadingWorkspaces:!0,...Vh()});try{const s=await this.api.workspaces(t.id,r);if(wt(this.getState())!==r||this.getState().selectedProject?.id!==t.id)return;this.setState({workspaces:s,workspacesByProjectId:{...this.getState().workspacesByProjectId,[t.id]:s},isLoadingWorkspaces:!1});const o=tM(s,{targetWorkspaceId:i?.workspaceId,latestWorkspaceId:this.workspaceSelection.latestWorkspaceId(Mp(r,t.id))}),a=$r().hideWorkspaces?s[0]??o:o;a?await this.selectWorkspace(a,{sessionId:i?.sessionId,updateUrl:i?.updateUrl}):i?.updateUrl!==!1&&this.updateUrl()}catch(s){wt(this.getState())===r&&this.getState().selectedProject?.id===t.id&&this.setState({error:String(s),isLoadingWorkspaces:!1})}}async selectWorkspace(t,i){const r=wt(this.getState());this.workspaceSelection.rememberWorkspace({...t,projectId:Mp(r,t.projectId)}),this.sessions.clearActiveSession(),this.setState({selectedWorkspace:t,isLoadingWorkspaces:!1,...Vh()});try{const s=xk(t.path,await this.api.sessions(t.path,r),r);if(wt(this.getState())!==r||this.getState().selectedWorkspace?.id!==t.id||this.getState().selectedProject?.id!==t.projectId)return;this.setState({sessions:s});const o=this.sessions.preferredSession(t.path,s,i?.sessionId);o?await this.sessions.selectSession(o,{updateUrl:i?.updateUrl}):i?.updateUrl!==!1&&this.updateUrl()}catch(s){wt(this.getState())===r&&this.getState().selectedWorkspace?.id===t.id&&this.setState({error:String(s)})}}async refreshProjectWorkspaces(t){const i=this.getState().projects.find(s=>s.id===t);if(i===void 0)throw new Error("Project not found");const r=await this.api.workspaces(i.id,wt(this.getState()));return this.applyProjectWorkspaces(i.id,r),r}async refreshAfterWorkspaceDeleted(t,i){const r=await this.refreshProjectWorkspaces(t),s=this.getState();if(s.selectedProject?.id!==t||s.selectedWorkspace?.id!==i)return;const o=aM(r);o!==void 0?await this.selectWorkspace(o):this.clearSelection()}applyProjectWorkspaces(t,i){const r=this.getState(),s={...r.workspacesByProjectId,[t]:i};r.selectedProject?.id===t?this.setState({workspaces:i,workspacesByProjectId:s}):this.setState({workspacesByProjectId:s})}}function oM(e){return e!==void 0&&e.isGitWorktree&&!e.isMain}function aM(e){return e.find(t=>t.isMain)??e[0]}const nM="omp-web:machine-navigation:v1";class lM{constructor(t=Oc()){this.snapshotsByMachine=new Tu(nM,hM,t)}latest(t){const i=this.snapshotsByMachine.get(t);return i?.machineId===t?py(i):void 0}remember(t){this.snapshotsByMachine.set(t.machineId,py(t))}forget(t){this.snapshotsByMachine.delete(t)}}function cM(e){return{machineId:e,surface:{}}}function dy(e){const t=e.selectedWorkspace!==void 0;return{machineId:e.selectedMachine?.id??bk,projectId:e.selectedProject?.id,workspaceId:e.selectedWorkspace?.id,sessionId:e.selectedSession?.id,tool:e.workspaceTool,view:e.mainView,surface:{selectedFilePath:t?e.selectedFilePath:void 0,selectedDiffPath:t?e.selectedDiffPath:void 0,selectedTerminalId:t?e.selectedTerminalId:void 0}}}function uy(e){return{machineId:e.machineId,projectId:e.projectId,workspaceId:e.workspaceId,sessionId:e.sessionId,tool:e.tool,view:e.view==="navigation"?void 0:e.view}}function py(e){return{...e,surface:{...e.surface}}}function hM(e){if(!ki(e))return;const t=go(e,"machineId");if(t===void 0)return;const i=Pk(go(e,"tool")),r=uM(go(e,"view"));return{machineId:t,projectId:go(e,"projectId"),workspaceId:go(e,"workspaceId"),sessionId:go(e,"sessionId"),...i===void 0?{}:{tool:i},...r===void 0?{}:{view:r},surface:dM(e.surface)}}function dM(e){return ki(e)?{selectedFilePath:go(e,"selectedFilePath"),selectedDiffPath:go(e,"selectedDiffPath"),selectedTerminalId:go(e,"selectedTerminalId")}:{}}function uM(e){return e==="navigation"||e==="chat"?e:Pk(e)}function Pk(e){return pM(e)?e:void 0}function pM(e){return e!==void 0&&/^[a-z][a-z0-9.-]*:[a-z][a-z0-9.-]*$/u.test(e)}function go(e,t){const i=e[t];return typeof i=="string"&&i!==""?i:void 0}const fM="omp-web:terminal-selection:v1";class gM{constructor(t=Oc()){this.terminalIdsByCwd=new Tu(fM,tm,t)}latestTerminalId(t){return this.terminalIdsByCwd.get(t)}rememberTerminal(t,i){this.terminalIdsByCwd.set(t,i)}forgetWorkspace(t){this.terminalIdsByCwd.delete(t)}forgetTerminal(t){for(const[i,r]of this.terminalIdsByCwd.entries())r===t&&this.terminalIdsByCwd.delete(i)}}function iet(e,t){const i=t?.targetTerminalId;if(i!==void 0&&i!=="")return e.find(s=>s.id===i);const r=t?.latestTerminalId;return r!==void 0&&r!==""?e.find(s=>s.id===r)??e.find(s=>!s.exited)??e[0]:e.find(s=>!s.exited)??e[0]}function ret(e){return e.find(t=>!t.exited)??e[0]}const Ek=1200,mM=["mod","alt","shift"];class bM{constructor(){this.pendingTokens=[]}handle(t,i,r={}){const s=Ik(t);if(s===void 0)return!1;const o=em(i,r.shortcuts,{enabledOnly:!0}).filter(a=>a.active).map(a=>({action:a.action,tokens:a.tokens}));if(this.pendingTokens.length>0){if(this.handleSequence([...this.pendingTokens,s],o))return!0;if(this.clearPending(),!kc(s))return!1}else if(!kc(s))return!1;return this.handleSequence([s],o)}reset(){this.clearPending()}handleSequence(t,i){const r=i.find(o=>MM(o.tokens,t));return r!==void 0?(this.clearPending(),r.action.run(),!0):i.some(o=>im(o.tokens,t))?(this.setPending(t),!0):!1}setPending(t){this.clearPending(),this.pendingTokens=t,this.pendingTimer=globalThis.setTimeout(()=>{this.pendingTokens=[],this.pendingTimer=void 0},Ek)}clearPending(){this.pendingTokens=[],this.pendingTimer!==void 0&&(globalThis.clearTimeout(this.pendingTimer),this.pendingTimer=void 0)}}function em(e,t,i={}){const r=e.flatMap((c,h)=>{if(i.enabledOnly===!0&&c.enabled===!1)return[];const d=yM(c,t,h);return d===void 0?[]:[d]}),s=new Map;for(const c of r)s.set(c.key,[...s.get(c.key)??[],c]);const o=new Map;for(const c of s.values()){const h=[...c].sort(mf)[0];h!==void 0&&o.set(h.key,h)}const a=[...o.values()].sort(wM),n=new Map,l=new Map;for(const c of r){const h=o.get(c.key);if(h===void 0)continue;const d=kM(h,a)??h;l.set(c,d),c!==d&&n.set(d,[...n.get(d)??[],c])}return r.map(c=>{const h=l.get(c),d=h===c,u=h===void 0||d?void 0:fy(h),p=d?[...n.get(c)??[]].sort(mf).map(fy):[];return{...c,active:d,shadows:p,...u===void 0?{}:{shadowedBy:u}}}).sort((c,h)=>c.order-h.order)}function Lp(e){return zk(e,{requireFirstChordActivator:!0})}function Rk(e){const t=zk(e,{requireFirstChordActivator:!1});return t.ok?t.tokens:[]}function Qh(e){return Rk(e).map(t=>t.split("+").map(Fk).join("+")).join(" ")}function Ik(e){if(e.isComposing)return;const t=TM(e.key);if(t===void 0)return;const i=[];return(e.metaKey||e.ctrlKey)&&i.push("mod"),e.altKey&&i.push("alt"),e.shiftKey&&i.push("shift"),i.push(t),i.join("+")}function kc(e){return e.split("+").includes("mod")||e.split("+").includes("alt")}function yM(e,t,i){const r=xM(e.id,t);if(r===null)return;const s=r??e.shortcut;if(s===void 0||s==="")return;const o=Rk(s),a=o[0];if(!(a===void 0||!kc(a)))return{action:e,shortcut:o.join(" "),source:r===void 0?"default":"custom",tokens:o,key:vM(o),order:i}}function xM(e,t){if(!(t===void 0||!Object.hasOwn(t,e)))return t[e]}function vM(e){return e.join("\0")}function fy(e){return{action:e.action,shortcut:e.shortcut,source:e.source}}function mf(e,t){return gy(e.source)-gy(t.source)||my(e.action.id,t.action.id)||my(e.action.title,t.action.title)||e.order-t.order}function wM(e,t){return e.tokens.length-t.tokens.length||mf(e,t)}function kM(e,t){return t.find(i=>i!==e&&i.tokens.length<e.tokens.length&&im(e.tokens,i.tokens))}function gy(e){switch(e){case"custom":return 0;case"default":return 1}}function my(e,t){return e<t?-1:e>t?1:0}function zk(e,t){const i=e.trim().toLowerCase().replace(/\s*\+\s*/gu,"+");if(i==="")return{ok:!1,message:"Enter a shortcut, choose None, or reset to the default."};const r=[],s=i.split(/\s+/u).filter(o=>o!=="");for(const[o,a]of s.entries()){const n=SM(a);if(!n.ok)return n;if(o===0&&t.requireFirstChordActivator&&!kc(n.token))return{ok:!1,message:"Shortcuts must start with Ctrl/⌘ or Alt so normal typing is not captured."};r.push(n.token)}return{ok:!0,shortcut:r.join(" "),tokens:r}}function SM(e){const t=e.split("+").filter(o=>o!=="");if(t.length===0)return{ok:!1,message:"Shortcut chords must include a key."};const i=new Set;let r;for(const o of t){const a=CM(o);if(a!==void 0){if(i.has(a))return{ok:!1,message:`Shortcut has duplicate ${Fk(a)} modifiers.`};i.add(a);continue}const n=Dk(o);if(n===void 0)return{ok:!1,message:`Unsupported shortcut key: ${o}`};if(r!==void 0)return{ok:!1,message:"Each shortcut chord can include only one non-modifier key."};r=n}return r===void 0?{ok:!1,message:"Shortcut chords must include a key."}:{ok:!0,token:[...mM.filter(o=>i.has(o)),r].join("+")}}function CM(e){switch(e){case"mod":case"meta":case"cmd":case"command":case"ctrl":case"control":case"primary":return"mod";case"alt":case"option":case"opt":return"alt";case"shift":return"shift";default:return}}function Dk(e){const t=$M(e);if(t!==void 0)return t;if(/^f(?:[1-9]|1[0-9]|2[0-4])$/u.test(e)||e.length===1)return e}function TM(e){if(e===" ")return"space";const t=e.toLowerCase();return Dk(t)}function $M(e){switch(e){case" ":case"spacebar":case"space":return"space";case"esc":case"escape":return"escape";case"return":case"enter":return"enter";case"del":case"delete":return"delete";case"backspace":return"backspace";case"tab":return"tab";case"up":case"arrowup":return"arrowup";case"down":case"arrowdown":return"arrowdown";case"left":case"arrowleft":return"arrowleft";case"right":case"arrowright":return"arrowright";case"pageup":case"pagedown":case"home":case"end":return e;case"+":case"plus":return"plus";case"period":case"dot":return".";case"comma":return",";case"slash":return"/";case"backslash":return"\\";case"minus":return"-";default:return}}function Fk(e){return e==="mod"?by()?"⌘":"Ctrl":e==="shift"?"Shift":e==="alt"?by()?"⌥":"Alt":e==="enter"?"Enter":e==="escape"?"Esc":e==="space"?"Space":e==="tab"?"Tab":e==="backspace"?"Backspace":e==="delete"?"Delete":e==="arrowup"?"↑":e==="arrowdown"?"↓":e==="arrowleft"?"←":e==="arrowright"?"→":e==="pageup"?"PageUp":e==="pagedown"?"PageDown":e==="home"?"Home":e==="end"?"End":e==="plus"?"+":/^f(?:[1-9]|1[0-9]|2[0-4])$/u.test(e)||e.length===1?e.toUpperCase():`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function MM(e,t){return e.length===t.length&&im(e,t)}function im(e,t){return t.every((i,r)=>e[r]===i)}function by(){return typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("mac")}const AM={archiveIdleEnabled:!0,archiveIdleDays:"30",deleteArchivedEnabled:!1,deleteArchivedDays:"90"};function Xl(e){if(!e.archiveIdleEnabled&&!e.deleteArchivedEnabled)return{ok:!1,error:"Enable at least one cleanup action."};const t={archiveIdleDays:null,deleteArchivedDays:null};if(e.archiveIdleEnabled){const i=vy(e.archiveIdleDays,"Archive idle sessions after");if(typeof i=="string")return{ok:!1,error:i};t.archiveIdleDays=i}if(e.deleteArchivedEnabled){const i=vy(e.deleteArchivedDays,"Delete archived sessions after");if(typeof i=="string")return{ok:!1,error:i};t.deleteArchivedDays=i}return{ok:!0,request:t}}function Jn(e){return JSON.stringify({archiveIdleDays:e?.archiveIdleDays??null,deleteArchivedDays:e?.deleteArchivedDays??null})}function yy(e){if(!e.canCleanup||e.loading===!0||e.running===!0||e.preview===void 0)return!1;const t=Xl(e.draft);return!t.ok||Jn(t.request)!==Jn(e.previewRequest)?!1:Jh(e.preview)}function Jh(e){return e.totals.archiveCount>0||e.totals.deleteCount>0}function Ok(e,t){const i=e.projects.map(s=>s.cwd);if(t===void 0)return i;const r=new Set(t);return i.filter(s=>r.has(s))}function xy(e,t){const i=new Set(Ok(e,t)),r=e.projects.filter(s=>i.has(s.cwd));return{...e,projects:r,totals:r.reduce((s,o)=>({archiveCount:s.archiveCount+o.archiveCount,deleteCount:s.deleteCount+o.deleteCount}),{archiveCount:0,deleteCount:0})}}function BM(e,t){return t(_M(e))}function _M(e){const t=e.totals.archiveCount,i=e.totals.deleteCount,r=[];return t>0&&r.push(`archive ${String(t)} idle ${t===1?"session":"sessions"}`),i>0&&r.push(`permanently delete ${String(i)} archived ${i===1?"session":"sessions"}`),`Run cleanup and ${r.length===0?"run cleanup":r.join(" and ")}?
24
+ ${h}`;await this.api.prompt(t,d,r,a)}else await this.api.prompt(t,i,r,a,s);return this.markCachedNewSessionPersisted(t),!0}catch(c){return this.setState({error:String(c)}),!1}finally{n.markSending&&this.markSendingPrompt(t.id,!1)}}async deliverShellToSession(t,i,r,s){s.optimisticLine&&this.getState().selectedSession?.id===t.id&&this.setState({messages:[...this.getState().messages,Ns("user",i)]});try{return await this.api.shell(t,i,r),this.markCachedNewSessionPersisted(t),!0}catch(o){return this.getState().selectedSession?.id===t.id&&this.setState({messages:[...this.getState().messages,Ns("system",String(o))]}),this.setState({error:String(o)}),!1}}async deliverCommandToSession(t,i,r,s){this.markSendingPrompt(t.id,!0);try{const o=await this.api.runCommand(t,i,r);return s.applyResult&&this.getState().selectedSession?.id===t.id?this.applyCommandResult(o):o.type==="select"&&this.setState({error:`Queued command “${i}” needs input; open the session and run it again.`}),this.markCachedNewSessionPersisted(t),!0}catch(o){return this.getState().selectedSession?.id===t.id&&this.setState({messages:[...this.getState().messages,Ns("system",String(o))]}),this.setState({error:String(o)}),!1}finally{this.markSendingPrompt(t.id,!1)}}dropNextQueuedSessionMessage(t){const i=this.getState(),r=i.clientQueuedSessionMessages[t]??[];if(r.length===0)return;const s=r.slice(1);this.setState({clientQueuedSessionMessages:s.length===0?Sn(i.clientQueuedSessionMessages,t):{...i.clientQueuedSessionMessages,[t]:s}})}async respondToCommand(t,i){const r=this.getState().selectedSession;if(r){this.setState({commandDialog:void 0});try{this.applyCommandResult(await this.api.respondToCommand(r,t,i,wt(this.getState())))}catch(s){this.setState({error:String(s)})}}}cancelCommand(){this.setState({commandDialog:void 0})}applySessionStatus(t){this.applyStatus(t)}async archiveSession(t=this.getState().selectedSession){if(!t)return;const i=this.statusForSession(t);if(wc(t,i)){await this.deleteCachedNewSession(t);return}if(Ws(t,i))try{await this.api.archive(t,wt(this.getState()));const r=this.getState(),s=H9(r.sessions,t.id,new Date().toISOString()),o=j9(s,r.selectedSession?.id,t.id);this.setState({sessions:s}),o.type==="select"?await this.selectSession(o.session):o.type==="clear"&&this.deselectSession({forgetRememberedSelection:!0})}catch(r){this.setState({error:String(r)})}}async archiveSessionWithDescendants(t=this.getState().selectedSession){if(!(t===void 0||!Ws(t,this.statusForSession(t))))try{const i=await this.api.archiveWithDescendants(t,wt(this.getState())),r=i.sessionIds!==void 0&&i.sessionIds.length>0?i.sessionIds:[t.id],s=this.getState(),o=Gl(s.sessions,r,new Date().toISOString()),a=Zh(o,s.selectedSession?.id,r);this.setState({sessions:o}),a.type==="select"?await this.selectSession(a.session):a.type==="clear"&&this.deselectSession({forgetRememberedSelection:!0})}catch(i){this.setState({error:String(i)})}}async archiveSessions(t){const i=ay(t).filter(r=>Ws(r,this.statusForSession(r)));if(i.length!==0)try{const r=wt(this.getState()),{succeededIds:s,failures:o,generatedAt:a}=await this.archiveSessionBatch(i,r);if(s.length>0){const n=this.getState(),l=Gl(n.sessions,s,a??new Date().toISOString()),c=Zh(l,n.selectedSession?.id,s);this.setState({sessions:l}),c.type==="select"?await this.selectSession(c.session):c.type==="clear"&&this.deselectSession({forgetRememberedSelection:!0})}this.applyBulkSessionFailures("Archive",o)}catch(r){this.setState({error:`Archive failed: ${Je(r)}`})}}async deleteArchivedSessions(t){const i=ay(t).filter(o=>o.archived===!0);if(i.length===0)return;const r=wt(this.getState()),s=this.getState().machineRuntimes[r];if(s?.ok!==!0||!vs(s,Kr.sessionsDeleteArchived)){this.setState({error:"Deleting archived sessions requires an updated Omp-Web runtime on this machine."});return}try{const{succeededIds:o,failures:a}=await this.deleteArchivedSessionBatch(i,r);if(o.length>0){const n=new Set(o),l=this.getState(),c=l.sessions.filter(h=>!n.has(h.id));if(this.setState({sessions:c}),l.selectedSession!==void 0&&n.has(l.selectedSession.id)){const h=c.find(d=>d.archived!==!0)??c[0];h!==void 0?await this.selectSession(h):this.deselectSession({forgetRememberedSelection:!0})}}this.applyBulkSessionFailures("Delete",a)}catch(o){this.setState({error:`Delete failed: ${Je(o)}`})}}async archiveSessionBatch(t,i){const r=this.getState().machineRuntimes[i];if(r?.ok===!0&&vs(r,Kr.sessionsBulkMutations)){const o=await this.api.archiveMany(t,i);return{succeededIds:o.archivedSessionIds,failures:ly(o.failures),generatedAt:o.generatedAt}}const s=await hy(t,ry,async o=>(await this.api.archive(o,i),o.id));return{succeededIds:ny(s),failures:cy(t,s)}}async deleteArchivedSessionBatch(t,i){const r=this.getState().machineRuntimes[i];if(r?.ok===!0&&vs(r,Kr.sessionsBulkMutations)){const o=await this.api.deleteArchivedMany(t,i);return{succeededIds:o.deletedSessionIds,failures:ly(o.failures)}}const s=await hy(t,ry,async o=>(await this.api.deleteArchived(o,i),o.id));return{succeededIds:ny(s),failures:cy(t,s)}}async applySessionCleanupResult(t,i=wt(this.getState())){if(wt(this.getState())!==i)return;const r=t.archivedSessionIds,s=t.deletedSessionIds;if(r.length>0||s.length>0){const o=this.getState(),a=new Set(s),n=[...r,...s],l=Gl(o.sessions,r,t.generatedAt).filter(h=>!a.has(h.id)),c=o.selectedSession!==void 0&&n.includes(o.selectedSession.id);if(this.setState({sessions:l,sessionStatuses:oy(o.sessionStatuses,n),sessionActivities:oy(o.sessionActivities,n),...c?{status:void 0,activity:void 0}:{}}),o.selectedSession!==void 0&&a.has(o.selectedSession.id)){const h=l.find(d=>d.archived!==!0)??l[0];h!==void 0?await this.selectSession(h):this.deselectSession({forgetRememberedSelection:!0})}else{const h=Zh(l,o.selectedSession?.id,r);h.type==="select"?await this.selectSession(h.session):h.type==="clear"&&this.deselectSession({forgetRememberedSelection:!0})}}await this.refreshCurrentWorkspaceSessions(i)}async refreshCurrentWorkspaceSessions(t=wt(this.getState())){const i=this.getState().selectedWorkspace;if(i!==void 0)try{const r=xk(i.path,await this.api.sessions(i.path,t),t);if(wt(this.getState())!==t||this.getState().selectedWorkspace?.id!==i.id)return;const s=r,o=this.getState().selectedSession;if(this.setState({sessions:s}),o===void 0)return;const a=s.find(l=>l.id===o.id);if(a!==void 0){a!==o&&this.setState({selectedSession:a});return}const n=s.find(l=>l.archived!==!0)??s[0];n!==void 0?await this.selectSession(n):this.deselectSession({forgetRememberedSelection:!0})}catch(r){wt(this.getState())===t&&this.getState().selectedWorkspace?.id===i.id&&this.setState({error:String(r)})}}async deleteCachedNewSession(t=this.getState().selectedSession){if(t===void 0||!wc(t,this.statusForSession(t)))return;this.api.stop(t,wt(this.getState())).catch(()=>{}),Vb(t.id,wt(this.getState())),Qg(this.sessionCacheKey(t.id));const i=this.getState(),r=i.sessions.filter(o=>o.id!==t.id);if(this.setState({sessions:r,sessionStatuses:Sn(i.sessionStatuses,t.id),sessionActivities:sy(i.sessionActivities,t.id),sendingPrompts:Sn(i.sendingPrompts,t.id),clientQueuedSessionMessages:Sn(i.clientQueuedSessionMessages,t.id)}),this.getState().selectedSession?.id!==t.id)return;const s=r.find(o=>o.archived!==!0)??r[0];s!==void 0?await this.selectSession(s):(this.clearActiveSession(),this.updateUrl())}async restoreSession(t=this.getState().selectedSession){if(t)try{await this.api.restore(t,wt(this.getState()));const i={...t};delete i.archived,delete i.archivedAt,this.replaceSession(i),this.getState().selectedSession?.id===i.id&&await this.selectSession(i)}catch(i){this.setState({error:String(i)})}}async reloadSession(t=this.getState().selectedSession){if(t===void 0||!Ws(t,this.statusForSession(t)))return;const i=wt(this.getState()),r=this.getState().machineRuntimes[i];if(r?.ok!==!0||!vs(r,Kr.sessionsReload)){this.setState({error:"Reloading sessions from disk requires an updated Omp-Web runtime on this machine."});return}try{await this.api.reloadSession(t.id,i),this.transcripts.discard(this.sessionCacheKey(t.id)),this.getState().selectedSession?.id===t.id&&await this.selectSession(t,{updateUrl:!1})}catch(s){this.setState({error:String(s)})}}async detachParent(t=this.getState().selectedSession){if(t?.parentSessionPath!==void 0)try{await this.api.detachParent(t,wt(this.getState()));const i={...t};delete i.parentSessionPath,this.replaceSession(i)}catch(i){this.setState({error:String(i)})}}async listModels(){const t=this.getState().selectedSession;if(!t||t.archived===!0)return[];try{return(await this.api.models(t,wt(this.getState()))).models}catch(i){return this.setState({error:String(i)}),[]}}async setModel(t,i,r){const s=this.getState().selectedSession;if(!(!s||s.archived===!0))try{this.applyStatus(await this.api.setModel(s,t,i,r,wt(this.getState()))),await this.refreshAvailableThinkingLevels()}catch(o){this.setState({error:String(o)})}}async cycleModel(t){const i=this.getState().selectedSession;if(!(!i||i.archived===!0))try{this.applyStatus(await this.api.cycleModel(i,t,wt(this.getState()))),await this.refreshAvailableThinkingLevels()}catch(r){this.setState({error:String(r)})}}async listThinkingLevels(){const t=this.getState().selectedSession;if(!t||t.archived===!0)return[];try{return(await this.api.thinkingLevels(t,wt(this.getState()))).levels}catch(i){return this.setState({error:String(i)}),[]}}async refreshAvailableThinkingLevels(){const t=this.getState().selectedSession;if(!t||t.archived===!0){this.getState().availableThinkingLevels.length>0&&this.setState({availableThinkingLevels:[]});return}const i=await this.listThinkingLevels();this.getState().selectedSession?.id===t.id&&this.setState({availableThinkingLevels:i})}async setThinkingLevel(t){const i=this.getState().selectedSession;if(!(!i||i.archived===!0))try{this.applyStatus(await this.api.setThinkingLevel(i,t,wt(this.getState())))}catch(r){this.setState({error:String(r)})}}async cycleThinkingLevel(){const t=this.getState().selectedSession;if(!(!t||t.archived===!0))try{this.applyStatus(await this.api.cycleThinkingLevel(t,wt(this.getState())))}catch(i){this.setState({error:String(i)})}}async stopActiveWork(){const t=this.getState().selectedSession;if(t)try{await this.api.abort(t,wt(this.getState()))}catch(i){this.setState({error:String(i)})}}async refreshSelectedSession(t=this.getState().selectedSession?.id){const i=this.getState().selectedSession;if(!(t===void 0||i?.id!==t||i.archived===!0))try{this.flushPendingUpdates();const[r,s]=await Promise.all([this.api.messages(i,{limit:uh},wt(this.getState())),this.api.status(i,wt(this.getState()))]);if(this.getState().selectedSession?.id!==t)return;const o=this.transcripts.mergeHistory(this.sessionCacheKey(t),r);this.setState({...o,status:s,activity:this.getState().sessionActivities[t]}),this.applyStatus(s)}catch(r){this.getState().selectedSession?.id===t&&this.setState({error:String(r)})}}applyBulkSessionFailures(t,i){i.length!==0&&this.setState({error:`${t} failed for ${String(i.length)} session${i.length===1?"":"s"}: ${i.join("; ")}`})}sessionCacheKey(t){return yk(wt(this.getState()),t)}statusForSession(t){if(t===void 0)return;const i=this.getState();return i.status?.sessionId===t.id&&i.selectedSession?.id===t.id?i.status:i.sessionStatuses[t.id]}workspaceSelectionKey(t){return`${wt(this.getState())}:${t}`}replaceSession(t){const i=this.getState().selectedSession;this.setState({sessions:this.getState().sessions.map(r=>r.id===t.id?t:r),selectedSession:i?.id===t.id?t:i})}async recreateCachedNewSession(t,i){try{const r=wt(this.getState()),s=await this.api.startSession(t.cwd,r);Xb(s,r),H$(this.sessionCacheKey(t.id),this.sessionCacheKey(s.id)),Vb(t.id,r);const o=pf(s,r);this.setState({sessions:[o,...this.getState().sessions.filter(a=>a.id!==t.id)],error:""}),await this.selectSession(o,{updateUrl:!1}),this.updateUrl(i?.updateUrl===!1?{replace:!0}:void 0)}catch(r){this.setState({error:String(r)})}}markCachedNewSessionPersisted(t){if(!vd(t))return;const i=this.getState().sessions.find(r=>r.id===t.id)??t;this.replaceSession(m$(i))}applyCommandResult(t){if(t.type==="select"){this.setState({commandDialog:t});return}const i=(t.type==="unsupported",t.message);if(i!==void 0&&i!==""&&this.setState({messages:[...this.getState().messages,Ns(t.type==="unsupported"?"system":"tool",i)]}),t.type==="done"&&t.session){t.promptDraft!==void 0&&Cd(this.sessionCacheKey(t.session.id),t.promptDraft);const r=this.getState().selectedSession,s=[t.session,...this.getState().sessions.filter(o=>o.id!==t.session?.id)];this.setState({sessions:s,selectedSession:r?.id===t.session.id?t.session:r}),r?.id!==t.session.id&&this.selectSession(t.session)}}applyCreatedSession(t){const i=this.getState();i.selectedWorkspace?.path===t.cwd&&(i.sessions.some(r=>r.id===t.id)||this.setState({sessions:[t,...i.sessions]}))}applyActivity(t){this.setState({sessionActivities:{...this.getState().sessionActivities,[t.sessionId]:t},activity:this.getState().selectedSession?.id===t.sessionId?t:this.getState().activity})}applyStatus(t){const i=this.getState(),r=i.sessionActivities[t.sessionId]?.phase==="active"&&!na(t);let s=i.sessions;t.archived===!0?s=Gl(s,[t.sessionId],new Date().toISOString()):t.dormant!==void 0&&(s=s.map(o=>o.id===t.sessionId?{...o,dormant:t.dormant}:o)),this.setState({sessions:s,selectedSession:i.selectedSession?.id===t.sessionId?s.find(o=>o.id===t.sessionId)??i.selectedSession:i.selectedSession,sessionStatuses:{...i.sessionStatuses,[t.sessionId]:t},...X9(i,t.sessionId,t.messageCount),...r?{sessionActivities:sy(i.sessionActivities,t.sessionId)}:{},status:i.selectedSession?.id===t.sessionId?t:i.status,activity:i.selectedSession?.id===t.sessionId&&r?void 0:i.activity,...i.selectedSession?.id===t.sessionId&&t.pendingAsk?{askDialog:t.pendingAsk}:{},...i.selectedSession?.id===t.sessionId&&!t.isStreaming&&!t.pendingAsk&&i.askDialog?{askDialog:void 0}:{},...i.selectedSession?.id===t.sessionId&&t.planMode?.proposedPlan&&!i.planReviewDialog?{planReviewDialog:t.planMode.proposedPlan}:{},...i.selectedSession?.id===t.sessionId&&!t.planMode?.proposedPlan&&i.planReviewDialog?{planReviewDialog:void 0}:{}})}applySessionName(t,i){const r=o=>{if(o.id!==t)return o;const a={...o};return i===void 0||i===""?delete a.name:a.name=i,a},s=this.getState().selectedSession;this.setState({sessions:this.getState().sessions.map(r),selectedSession:s===void 0?void 0:r(s)})}applyEvent(t){if(t.type==="status.update"){this.queueStatusUpdate(t.status);return}if(t.type==="activity.update"){this.queueActivityUpdate(t.activity);return}if(V9(t)){this.queueTranscriptEvent(t);return}if(t.type==="plan.proposed"){this.setState({planReviewDialog:t.plan});return}if(t.type==="plan.cleared"){this.setState({planReviewDialog:void 0});return}if(t.type==="ask.requested"){this.setState({askDialog:{requestId:t.requestId,questions:t.questions}});return}if(t.type==="ask.cleared"){this.getState().askDialog?.requestId===t.requestId&&this.setState({askDialog:void 0});return}if(t.type==="btw.start"){this.setState({btwState:{status:"running",question:t.question,answer:""}});return}if(t.type==="btw.delta"){const r=this.getState().btwState;r?.status==="running"&&this.setState({btwState:{...r,answer:r.answer+t.delta}});return}if(t.type==="btw.end"){this.setState({btwState:{status:"complete",question:t.question,answer:t.answer,canBranch:t.canBranch}});return}if(t.type==="btw.error"){this.setState({btwState:{status:"error",question:this.getState().btwState?.question??"",answer:"",error:t.error}});return}if(t.type==="btw.cleared"){this.setState({btwState:void 0});return}this.flushPendingUpdates();const i=this.transcripts.applyLiveEvent(this.getState().messages,t);i?this.setState({messages:i}):t.type==="session.name"&&this.applySessionName(t.sessionId,t.name)}queueTranscriptEvent(t){this.pendingTranscriptEvents.push(t),this.schedulePendingFlush()}queueStatusUpdate(t){this.pendingStatusBySession.set(t.sessionId,t),this.schedulePendingFlush()}queueActivityUpdate(t){this.pendingActivityBySession.set(t.sessionId,t),this.schedulePendingFlush()}schedulePendingFlush(){this.pendingFrame===void 0&&(this.pendingFrame=requestAnimationFrame(()=>{this.pendingFrame=void 0,this.flushPendingUpdates()}))}flushPendingUpdates(){if(this.pendingTranscriptEvents.length>0){const t=this.pendingTranscriptEvents;this.pendingTranscriptEvents=[];let i=this.getState().messages;for(const r of t)i=this.transcripts.applyLiveEvent(i,r)??i;i!==this.getState().messages&&this.setState({messages:i})}if(this.pendingActivityBySession.size>0){const t=Array.from(this.pendingActivityBySession.values());this.pendingActivityBySession.clear();for(const i of t)this.applyActivity(i)}if(this.pendingStatusBySession.size>0){const t=Array.from(this.pendingStatusBySession.values());this.pendingStatusBySession.clear();for(const i of t)this.applyStatus(i)}}clearPendingUpdates(){this.pendingTranscriptEvents=[],this.pendingStatusBySession.clear(),this.pendingActivityBySession.clear(),this.pendingFrame!==void 0&&(cancelAnimationFrame(this.pendingFrame),this.pendingFrame=void 0)}}function sy(e,t){return Sn(e,t)}function Sn(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>i!==t))}function oy(e,t){if(t.length===0)return e;const i=new Set(t);return Object.fromEntries(Object.entries(e).filter(([r])=>!i.has(r)))}function ay(e){const t=new Set,i=[];for(const r of e)t.has(r.id)||(t.add(r.id),i.push(r));return i}function ny(e){return e.filter(Y9).map(t=>t.value)}function ly(e){return e.map(t=>`${t.sessionId}: ${t.error}`)}function cy(e,t){return t.flatMap((i,r)=>G9(i)?[`${e[r]?.id??"unknown"}: ${Je(i.reason)}`]:[])}async function hy(e,t,i){const r=e.map((l,c)=>({item:l,index:c})),s=[];let o=0;async function a(){for(;o<r.length;){const l=r[o];if(l===void 0)return;o+=1;try{s[l.index]={status:"fulfilled",value:await i(l.item)}}catch(c){s[l.index]={status:"rejected",reason:c}}}}const n=Math.min(Math.max(1,t),r.length);return await Promise.all(Array.from({length:n},()=>a())),s}function Y9(e){return e.status==="fulfilled"}function G9(e){return e.status==="rejected"}function X9(e,t,i){if(i===void 0)return{};const s=e.sessions.some(a=>a.id===t&&a.messageCount!==i)?e.sessions.map(a=>a.id===t?{...a,messageCount:i}:a):void 0,o=e.selectedSession?.id===t&&e.selectedSession.messageCount!==i?{...e.selectedSession,messageCount:i}:e.selectedSession;return{...s===void 0?{}:{sessions:s},...o!==e.selectedSession?{selectedSession:o}:{}}}function V9(e){return e.type==="assistant.delta"||e.type==="assistant.thinking.delta"||e.type==="shell.chunk"}function K9(e){return e instanceof Error&&e.message.toLowerCase().includes("session not found")}class Z9{constructor(){this.workspaceIdsByProject=new Map}latestWorkspaceId(t){return this.workspaceIdsByProject.get(t)}rememberWorkspace(t){this.workspaceIdsByProject.set(t.projectId,t.id)}forgetProject(t){this.workspaceIdsByProject.delete(t)}}const Q9="omp-web:workspace-selection:v1";class J9{constructor(t=Oc()){this.workspaceIdsByProject=new Tu(Q9,tm,t)}latestWorkspaceId(t){return this.workspaceIdsByProject.get(t)}rememberWorkspace(t){this.workspaceIdsByProject.set(t.projectId,t.id)}forgetProject(t){this.workspaceIdsByProject.delete(t)}}function tM(e,t){const i=t?.targetWorkspaceId;if(i!==void 0&&i!=="")return e.find(s=>s.id===i);const r=t?.latestWorkspaceId;return r!==void 0&&r!==""?e.find(s=>s.id===r)??e[0]:e[0]}const eM={showThinking:!0,showEvents:!0,showToolExecutions:!0,showAgentStatus:!0,vimMode:!1,showStatusBar:!1,hideWorkspaces:!1,bottomMobileNav:!0,hideBreadcrumbs:!0},js="omp-web-chat-preferences-changed",gf="omp-web:chat-preferences";let Lk={};function Us(){if(typeof window<"u")return window}function iM(e){Lk={...e};const t=Us();t!==void 0&&t.dispatchEvent(new CustomEvent(js,{detail:$r()}))}function $u(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t={...e};return typeof t.showThinking=="boolean"&&typeof t.showEvents=="boolean"&&typeof t.showToolExecutions=="boolean"&&typeof t.showAgentStatus=="boolean"&&typeof t.vimMode=="boolean"&&typeof t.showStatusBar=="boolean"&&typeof t.hideWorkspaces=="boolean"&&typeof t.bottomMobileNav=="boolean"&&typeof t.hideBreadcrumbs=="boolean"}function $r(){const e={...eM,...Lk};try{if(typeof localStorage>"u")return e;const t=localStorage.getItem(gf);if(t===null||t==="")return e;const i=JSON.parse(t);if(typeof i!="object"||i===null||Array.isArray(i))return e;const r={...i};return{showThinking:typeof r.showThinking=="boolean"?r.showThinking:e.showThinking,showEvents:typeof r.showEvents=="boolean"?r.showEvents:e.showEvents,showToolExecutions:typeof r.showToolExecutions=="boolean"?r.showToolExecutions:e.showToolExecutions,showAgentStatus:typeof r.showAgentStatus=="boolean"?r.showAgentStatus:e.showAgentStatus,vimMode:typeof r.vimMode=="boolean"?r.vimMode:e.vimMode,showStatusBar:typeof r.showStatusBar=="boolean"?r.showStatusBar:e.showStatusBar,hideWorkspaces:typeof r.hideWorkspaces=="boolean"?r.hideWorkspaces:e.hideWorkspaces,bottomMobileNav:typeof r.bottomMobileNav=="boolean"?r.bottomMobileNav:e.bottomMobileNav,hideBreadcrumbs:typeof r.hideBreadcrumbs=="boolean"?r.hideBreadcrumbs:e.hideBreadcrumbs}}catch{return e}}function rM(e){try{if(typeof localStorage<"u"){const r=localStorage.getItem(gf);let s={};try{const o=r===null||r===""?{}:JSON.parse(r);typeof o=="object"&&o!==null&&!Array.isArray(o)&&(s={...o})}catch{}localStorage.setItem(gf,JSON.stringify({...s,...e}))}}catch{}const t=$r(),i=Us();i!==void 0&&i.dispatchEvent(new CustomEvent(js,{detail:t}))}class sM{constructor(t,i,r,s,o=new Z9,a={}){this.getState=t,this.setState=i,this.updateUrl=r,this.sessions=s,this.workspaceSelection=o,this.api=a.api??gi}clearSelection(t){this.sessions.clearActiveSession(),this.setState({selectedProject:void 0,selectedWorkspace:void 0,workspaces:[],isLoadingWorkspaces:!1,...Vh()}),t?.updateUrl!==!1&&this.updateUrl()}forgetProject(t){this.workspaceSelection.forgetProject(Mp(wt(this.getState()),t));const i=Object.fromEntries(Object.entries(this.getState().workspacesByProjectId).filter(([r])=>r!==t));this.setState({workspacesByProjectId:i})}async selectProject(t,i){const r=wt(this.getState());this.sessions.clearActiveSession(),this.setState({selectedProject:t,selectedWorkspace:void 0,workspaces:[],isLoadingWorkspaces:!0,...Vh()});try{const s=await this.api.workspaces(t.id,r);if(wt(this.getState())!==r||this.getState().selectedProject?.id!==t.id)return;this.setState({workspaces:s,workspacesByProjectId:{...this.getState().workspacesByProjectId,[t.id]:s},isLoadingWorkspaces:!1});const o=tM(s,{targetWorkspaceId:i?.workspaceId,latestWorkspaceId:this.workspaceSelection.latestWorkspaceId(Mp(r,t.id))}),a=$r().hideWorkspaces?s[0]??o:o;a?await this.selectWorkspace(a,{sessionId:i?.sessionId,updateUrl:i?.updateUrl}):i?.updateUrl!==!1&&this.updateUrl()}catch(s){wt(this.getState())===r&&this.getState().selectedProject?.id===t.id&&this.setState({error:String(s),isLoadingWorkspaces:!1})}}async selectWorkspace(t,i){const r=wt(this.getState());this.workspaceSelection.rememberWorkspace({...t,projectId:Mp(r,t.projectId)}),this.sessions.clearActiveSession(),this.setState({selectedWorkspace:t,isLoadingWorkspaces:!1,...Vh()});try{const s=xk(t.path,await this.api.sessions(t.path,r),r);if(wt(this.getState())!==r||this.getState().selectedWorkspace?.id!==t.id||this.getState().selectedProject?.id!==t.projectId)return;this.setState({sessions:s});const o=this.sessions.preferredSession(t.path,s,i?.sessionId);o?await this.sessions.selectSession(o,{updateUrl:i?.updateUrl}):i?.updateUrl!==!1&&this.updateUrl()}catch(s){wt(this.getState())===r&&this.getState().selectedWorkspace?.id===t.id&&this.setState({error:String(s)})}}async refreshProjectWorkspaces(t){const i=this.getState().projects.find(s=>s.id===t);if(i===void 0)throw new Error("Project not found");const r=await this.api.workspaces(i.id,wt(this.getState()));return this.applyProjectWorkspaces(i.id,r),r}async refreshAfterWorkspaceDeleted(t,i){const r=await this.refreshProjectWorkspaces(t),s=this.getState();if(s.selectedProject?.id!==t||s.selectedWorkspace?.id!==i)return;const o=aM(r);o!==void 0?await this.selectWorkspace(o):this.clearSelection()}applyProjectWorkspaces(t,i){const r=this.getState(),s={...r.workspacesByProjectId,[t]:i};r.selectedProject?.id===t?this.setState({workspaces:i,workspacesByProjectId:s}):this.setState({workspacesByProjectId:s})}}function oM(e){return e!==void 0&&e.isGitWorktree&&!e.isMain}function aM(e){return e.find(t=>t.isMain)??e[0]}const nM="omp-web:machine-navigation:v1";class lM{constructor(t=Oc()){this.snapshotsByMachine=new Tu(nM,hM,t)}latest(t){const i=this.snapshotsByMachine.get(t);return i?.machineId===t?py(i):void 0}remember(t){this.snapshotsByMachine.set(t.machineId,py(t))}forget(t){this.snapshotsByMachine.delete(t)}}function cM(e){return{machineId:e,surface:{}}}function dy(e){const t=e.selectedWorkspace!==void 0;return{machineId:e.selectedMachine?.id??bk,projectId:e.selectedProject?.id,workspaceId:e.selectedWorkspace?.id,sessionId:e.selectedSession?.id,tool:e.workspaceTool,view:e.mainView,surface:{selectedFilePath:t?e.selectedFilePath:void 0,selectedDiffPath:t?e.selectedDiffPath:void 0,selectedTerminalId:t?e.selectedTerminalId:void 0}}}function uy(e){return{machineId:e.machineId,projectId:e.projectId,workspaceId:e.workspaceId,sessionId:e.sessionId,tool:e.tool,view:e.view==="navigation"?void 0:e.view}}function py(e){return{...e,surface:{...e.surface}}}function hM(e){if(!ki(e))return;const t=go(e,"machineId");if(t===void 0)return;const i=Pk(go(e,"tool")),r=uM(go(e,"view"));return{machineId:t,projectId:go(e,"projectId"),workspaceId:go(e,"workspaceId"),sessionId:go(e,"sessionId"),...i===void 0?{}:{tool:i},...r===void 0?{}:{view:r},surface:dM(e.surface)}}function dM(e){return ki(e)?{selectedFilePath:go(e,"selectedFilePath"),selectedDiffPath:go(e,"selectedDiffPath"),selectedTerminalId:go(e,"selectedTerminalId")}:{}}function uM(e){return e==="navigation"||e==="chat"?e:Pk(e)}function Pk(e){return pM(e)?e:void 0}function pM(e){return e!==void 0&&/^[a-z][a-z0-9.-]*:[a-z][a-z0-9.-]*$/u.test(e)}function go(e,t){const i=e[t];return typeof i=="string"&&i!==""?i:void 0}const fM="omp-web:terminal-selection:v1";class gM{constructor(t=Oc()){this.terminalIdsByCwd=new Tu(fM,tm,t)}latestTerminalId(t){return this.terminalIdsByCwd.get(t)}rememberTerminal(t,i){this.terminalIdsByCwd.set(t,i)}forgetWorkspace(t){this.terminalIdsByCwd.delete(t)}forgetTerminal(t){for(const[i,r]of this.terminalIdsByCwd.entries())r===t&&this.terminalIdsByCwd.delete(i)}}function ret(e,t){const i=t?.targetTerminalId;if(i!==void 0&&i!=="")return e.find(s=>s.id===i);const r=t?.latestTerminalId;return r!==void 0&&r!==""?e.find(s=>s.id===r)??e.find(s=>!s.exited)??e[0]:e.find(s=>!s.exited)??e[0]}function set(e){return e.find(t=>!t.exited)??e[0]}const Ek=1200,mM=["mod","alt","shift"];class bM{constructor(){this.pendingTokens=[]}handle(t,i,r={}){const s=Ik(t);if(s===void 0)return!1;const o=em(i,r.shortcuts,{enabledOnly:!0}).filter(a=>a.active).map(a=>({action:a.action,tokens:a.tokens}));if(this.pendingTokens.length>0){if(this.handleSequence([...this.pendingTokens,s],o))return!0;if(this.clearPending(),!kc(s))return!1}else if(!kc(s))return!1;return this.handleSequence([s],o)}reset(){this.clearPending()}handleSequence(t,i){const r=i.find(o=>MM(o.tokens,t));return r!==void 0?(this.clearPending(),r.action.run(),!0):i.some(o=>im(o.tokens,t))?(this.setPending(t),!0):!1}setPending(t){this.clearPending(),this.pendingTokens=t,this.pendingTimer=globalThis.setTimeout(()=>{this.pendingTokens=[],this.pendingTimer=void 0},Ek)}clearPending(){this.pendingTokens=[],this.pendingTimer!==void 0&&(globalThis.clearTimeout(this.pendingTimer),this.pendingTimer=void 0)}}function em(e,t,i={}){const r=e.flatMap((c,h)=>{if(i.enabledOnly===!0&&c.enabled===!1)return[];const d=yM(c,t,h);return d===void 0?[]:[d]}),s=new Map;for(const c of r)s.set(c.key,[...s.get(c.key)??[],c]);const o=new Map;for(const c of s.values()){const h=[...c].sort(mf)[0];h!==void 0&&o.set(h.key,h)}const a=[...o.values()].sort(wM),n=new Map,l=new Map;for(const c of r){const h=o.get(c.key);if(h===void 0)continue;const d=kM(h,a)??h;l.set(c,d),c!==d&&n.set(d,[...n.get(d)??[],c])}return r.map(c=>{const h=l.get(c),d=h===c,u=h===void 0||d?void 0:fy(h),p=d?[...n.get(c)??[]].sort(mf).map(fy):[];return{...c,active:d,shadows:p,...u===void 0?{}:{shadowedBy:u}}}).sort((c,h)=>c.order-h.order)}function Lp(e){return zk(e,{requireFirstChordActivator:!0})}function Rk(e){const t=zk(e,{requireFirstChordActivator:!1});return t.ok?t.tokens:[]}function Qh(e){return Rk(e).map(t=>t.split("+").map(Fk).join("+")).join(" ")}function Ik(e){if(e.isComposing)return;const t=TM(e.key);if(t===void 0)return;const i=[];return(e.metaKey||e.ctrlKey)&&i.push("mod"),e.altKey&&i.push("alt"),e.shiftKey&&i.push("shift"),i.push(t),i.join("+")}function kc(e){return e.split("+").includes("mod")||e.split("+").includes("alt")}function yM(e,t,i){const r=xM(e.id,t);if(r===null)return;const s=r??e.shortcut;if(s===void 0||s==="")return;const o=Rk(s),a=o[0];if(!(a===void 0||!kc(a)))return{action:e,shortcut:o.join(" "),source:r===void 0?"default":"custom",tokens:o,key:vM(o),order:i}}function xM(e,t){if(!(t===void 0||!Object.hasOwn(t,e)))return t[e]}function vM(e){return e.join("\0")}function fy(e){return{action:e.action,shortcut:e.shortcut,source:e.source}}function mf(e,t){return gy(e.source)-gy(t.source)||my(e.action.id,t.action.id)||my(e.action.title,t.action.title)||e.order-t.order}function wM(e,t){return e.tokens.length-t.tokens.length||mf(e,t)}function kM(e,t){return t.find(i=>i!==e&&i.tokens.length<e.tokens.length&&im(e.tokens,i.tokens))}function gy(e){switch(e){case"custom":return 0;case"default":return 1}}function my(e,t){return e<t?-1:e>t?1:0}function zk(e,t){const i=e.trim().toLowerCase().replace(/\s*\+\s*/gu,"+");if(i==="")return{ok:!1,message:"Enter a shortcut, choose None, or reset to the default."};const r=[],s=i.split(/\s+/u).filter(o=>o!=="");for(const[o,a]of s.entries()){const n=SM(a);if(!n.ok)return n;if(o===0&&t.requireFirstChordActivator&&!kc(n.token))return{ok:!1,message:"Shortcuts must start with Ctrl/⌘ or Alt so normal typing is not captured."};r.push(n.token)}return{ok:!0,shortcut:r.join(" "),tokens:r}}function SM(e){const t=e.split("+").filter(o=>o!=="");if(t.length===0)return{ok:!1,message:"Shortcut chords must include a key."};const i=new Set;let r;for(const o of t){const a=CM(o);if(a!==void 0){if(i.has(a))return{ok:!1,message:`Shortcut has duplicate ${Fk(a)} modifiers.`};i.add(a);continue}const n=Dk(o);if(n===void 0)return{ok:!1,message:`Unsupported shortcut key: ${o}`};if(r!==void 0)return{ok:!1,message:"Each shortcut chord can include only one non-modifier key."};r=n}return r===void 0?{ok:!1,message:"Shortcut chords must include a key."}:{ok:!0,token:[...mM.filter(o=>i.has(o)),r].join("+")}}function CM(e){switch(e){case"mod":case"meta":case"cmd":case"command":case"ctrl":case"control":case"primary":return"mod";case"alt":case"option":case"opt":return"alt";case"shift":return"shift";default:return}}function Dk(e){const t=$M(e);if(t!==void 0)return t;if(/^f(?:[1-9]|1[0-9]|2[0-4])$/u.test(e)||e.length===1)return e}function TM(e){if(e===" ")return"space";const t=e.toLowerCase();return Dk(t)}function $M(e){switch(e){case" ":case"spacebar":case"space":return"space";case"esc":case"escape":return"escape";case"return":case"enter":return"enter";case"del":case"delete":return"delete";case"backspace":return"backspace";case"tab":return"tab";case"up":case"arrowup":return"arrowup";case"down":case"arrowdown":return"arrowdown";case"left":case"arrowleft":return"arrowleft";case"right":case"arrowright":return"arrowright";case"pageup":case"pagedown":case"home":case"end":return e;case"+":case"plus":return"plus";case"period":case"dot":return".";case"comma":return",";case"slash":return"/";case"backslash":return"\\";case"minus":return"-";default:return}}function Fk(e){return e==="mod"?by()?"⌘":"Ctrl":e==="shift"?"Shift":e==="alt"?by()?"⌥":"Alt":e==="enter"?"Enter":e==="escape"?"Esc":e==="space"?"Space":e==="tab"?"Tab":e==="backspace"?"Backspace":e==="delete"?"Delete":e==="arrowup"?"↑":e==="arrowdown"?"↓":e==="arrowleft"?"←":e==="arrowright"?"→":e==="pageup"?"PageUp":e==="pagedown"?"PageDown":e==="home"?"Home":e==="end"?"End":e==="plus"?"+":/^f(?:[1-9]|1[0-9]|2[0-4])$/u.test(e)||e.length===1?e.toUpperCase():`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function MM(e,t){return e.length===t.length&&im(e,t)}function im(e,t){return t.every((i,r)=>e[r]===i)}function by(){return typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("mac")}const AM={archiveIdleEnabled:!0,archiveIdleDays:"30",deleteArchivedEnabled:!1,deleteArchivedDays:"90"};function Xl(e){if(!e.archiveIdleEnabled&&!e.deleteArchivedEnabled)return{ok:!1,error:"Enable at least one cleanup action."};const t={archiveIdleDays:null,deleteArchivedDays:null};if(e.archiveIdleEnabled){const i=vy(e.archiveIdleDays,"Archive idle sessions after");if(typeof i=="string")return{ok:!1,error:i};t.archiveIdleDays=i}if(e.deleteArchivedEnabled){const i=vy(e.deleteArchivedDays,"Delete archived sessions after");if(typeof i=="string")return{ok:!1,error:i};t.deleteArchivedDays=i}return{ok:!0,request:t}}function Jn(e){return JSON.stringify({archiveIdleDays:e?.archiveIdleDays??null,deleteArchivedDays:e?.deleteArchivedDays??null})}function yy(e){if(!e.canCleanup||e.loading===!0||e.running===!0||e.preview===void 0)return!1;const t=Xl(e.draft);return!t.ok||Jn(t.request)!==Jn(e.previewRequest)?!1:Jh(e.preview)}function Jh(e){return e.totals.archiveCount>0||e.totals.deleteCount>0}function Ok(e,t){const i=e.projects.map(s=>s.cwd);if(t===void 0)return i;const r=new Set(t);return i.filter(s=>r.has(s))}function xy(e,t){const i=new Set(Ok(e,t)),r=e.projects.filter(s=>i.has(s.cwd));return{...e,projects:r,totals:r.reduce((s,o)=>({archiveCount:s.archiveCount+o.archiveCount,deleteCount:s.deleteCount+o.deleteCount}),{archiveCount:0,deleteCount:0})}}function BM(e,t){return t(_M(e))}function _M(e){const t=e.totals.archiveCount,i=e.totals.deleteCount,r=[];return t>0&&r.push(`archive ${String(t)} idle ${t===1?"session":"sessions"}`),i>0&&r.push(`permanently delete ${String(i)} archived ${i===1?"session":"sessions"}`),`Run cleanup and ${r.length===0?"run cleanup":r.join(" and ")}?
25
25
 
26
26
  Permanent deletion only applies to archived sessions and cannot be undone.`}function LM(e){return`Update and restart Omp-Web on ${e??"this machine"} to clean up sessions.`}function vy(e,t){const i=e.trim();if(i==="")return`${t} must be set.`;const r=Number(i);return!Number.isInteger(r)||r<0?`${t} must be a non-negative whole number of days.`:r}const rm="themes:classic",PM="themes:omp-web-dark",EM={themeId:PM,auto:!0},Nk="omp-web-app-theme",RM=["--pi-bg","--pi-surface","--pi-surface-hover","--pi-terminal-bg","--pi-terminal-text","--pi-border","--pi-border-muted","--pi-text","--pi-text-secondary","--pi-text-bright","--pi-muted","--pi-dim","--pi-accent","--pi-accent-border","--pi-selection-bg","--pi-success","--pi-success-border","--pi-success-bg","--pi-success-surface","--pi-success-ring","--pi-warning","--pi-warning-border","--pi-warning-surface","--pi-danger","--pi-purple","--pi-purple-border","--pi-purple-surface","--pi-overlay","--pi-shadow-soft","--pi-shadow","--pi-shadow-strong","--pi-bg-overlay-soft","--pi-bg-overlay","--pi-success-bg-overlay","--pi-terminal-selection"],IM=/^[a-z][a-z0-9.-]*:[a-z][a-z0-9.-]*$/u;function zM(){try{const e=window.localStorage.getItem(Nk);return e===null?void 0:WM(e)}catch{return}}function DM(e){try{window.localStorage.setItem(Nk,JSON.stringify(e))}catch{}}function FM(e){const t=document.documentElement;t.dataset.ompWebTheme=e.id,t.style.colorScheme=e.colorScheme;for(const i of RM){const r=e.tokens[i];typeof r=="string"&&r!==""?t.style.setProperty(i,r):t.style.removeProperty(i)}}function OM(e){const t=NM(e.themes,e.fallbackThemeId??rm),i=e.themes.find(a=>a.id===e.preference.themeId)??t;if(i===void 0)return{selectedTheme:void 0,activeTheme:void 0,selectedThemePair:void 0,fallbackTheme:t};const r=Wk(e.themePairs,i.id);if(!e.preference.auto||r===void 0)return{selectedTheme:i,activeTheme:i,selectedThemePair:r,fallbackTheme:t};const s=e.prefersLight?r.light:r.dark,o=e.themes.find(a=>a.id===s)??i;return{selectedTheme:i,activeTheme:o,selectedThemePair:r,fallbackTheme:t}}function NM(e,t=rm){return e.find(i=>i.id===t)??e[0]}function Wk(e,t){return e.find(i=>i.light===t||i.dark===t)}function WM(e){const t=e.trim();if(t!=="")try{const i=JSON.parse(t);return qM(i)?i:void 0}catch{return}}function qM(e){if(!HM(e))return!1;const t=e.themeId,i=e.auto;return jM(t)&&typeof i=="boolean"}function HM(e){return typeof e=="object"&&e!==null}function jM(e){return typeof e=="string"&&IM.test(e)}const UM=/^[a-z][a-z0-9.-]*$/u;function YM(e){return UM.test(e)}const GM="machine.";function XM(e,t){if(e==="")throw new Error("Machine id is required");if(!YM(t))throw new Error(`Invalid PI WEB plugin id: ${t}`);return`${GM}${VM(e)}.${t}`}function VM(e){return[...new TextEncoder().encode(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function wy(e="/omp-web-plugins/manifest.json",t={}){const i=await KM(e);if(i===void 0)return[];const r=[];for(const s of i.plugins)if(t.shouldLoadPlugin?.(s)!==!1)try{const o=new URL(s.module,new URL(e,window.location.href)).toString(),a=await import(o),n=JM(a,o);r.push({id:t.machineId===void 0?s.id:XM(t.machineId,s.id),plugin:n,machineSpecific:s.machineSpecific,...t.machineId===void 0?{}:{machineId:t.machineId,sourcePluginId:s.id}})}catch(o){console.warn(`Failed to load PI WEB plugin ${s.module}`,o)}return r}async function KM(e){const t=await fetch(e,{cache:"no-store"});if(t.status!==404){if(!t.ok)throw new Error(`Failed to load plugin manifest: ${t.statusText}`);return ZM(await t.json())}}function ZM(e){if(!ki(e)||!Array.isArray(e.plugins))throw new Error("Invalid plugin manifest");return{plugins:e.plugins.map(t=>{if(!ki(t)||typeof t.id!="string"||t.id===""||typeof t.module!="string"||t.module==="")throw new Error("Invalid plugin manifest entry");return{id:t.id,module:t.module,machineSpecific:QM(t.machineSpecific)}})}}function QM(e){if(e===void 0)return!1;if(typeof e!="boolean")throw new Error("Invalid plugin manifest entry");return e}function JM(e,t){if(!ki(e))throw new Error(`Plugin module ${t} did not export an object`);const i=e.default;if(!tA(i))throw new Error(`Plugin module ${t} default export is not a OmpWebPlugin`);return i}function tA(e){return ki(e)&&e.apiVersion===1&&typeof e.name=="string"&&typeof e.activate=="function"}const ky=/^[a-z][a-z0-9.-]*$/u,qk=new WeakMap,Hk=new WeakMap;class eA{constructor(){this.actions=[],this.workspacePanels=[],this.workspaceLabels=[],this.themes=[],this.themePairs=[],this.pluginIds=new Set,this.gatewayPluginIds=new Set,this.gatewayMachineSpecificPluginIds=new Set,this.remoteMachineSpecificPluginIds=new Map,this.contributionIds=new Set}register(t){const{id:i,plugin:r}=t;this.validatePluginId(i);const s=this.parseMachineSpecific(i,t.machineSpecific);if(this.pluginIds.has(i))throw new Error(`Duplicate plugin id: ${i}`);if(this.isRemoteDuplicateHiddenByGateway(t.sourcePluginId,t.machineId,s))return;this.pluginIds.add(i);const o=r.apiVersion;if(o!==1)throw new Error(`Unsupported plugin API version for ${i}: ${String(o)}`);const n=r.activate({apiVersion:1,pluginId:i,html:T,svg:Dr}).contributions;for(const l of n.actions??[])this.actions.push(this.qualifyAction(i,l,t.machineId,t.sourcePluginId));for(const l of n.workspacePanels??[])this.workspacePanels.push(this.qualifyWorkspacePanel(i,l,t.machineId,t.sourcePluginId));for(const l of n.workspaceLabels??[])this.workspaceLabels.push(this.qualifyWorkspaceLabelContribution(i,l,t.machineId,t.sourcePluginId));if(t.machineId===void 0){for(const l of n.themes??[])this.themes.push(this.qualifyTheme(i,l));for(const l of n.themePairs??[])this.themePairs.push(this.qualifyThemePair(i,l));this.gatewayPluginIds.add(i),s&&this.gatewayMachineSpecificPluginIds.add(i)}else t.sourcePluginId!==void 0&&s&&oA(this.remoteMachineSpecificPluginIds,t.sourcePluginId,t.machineId)}shouldLoadRemotePlugin(t,i=!1){return!this.gatewayPluginIds.has(t)||this.gatewayMachineSpecificPluginIds.has(t)||i}getActions(t){const i=nA(t);return this.actions.filter(r=>this.isContributionActive(r.pluginId,r.machineId,i,r.sourcePluginId)).map(r=>{const s=iA(t,r.pluginId),o=r.enabled?.(s),a=o===!1?r.disabledReason?.(s):void 0,n={id:r.id,pluginId:r.pluginId,localId:r.localId,...r.machineId===void 0?{}:{machineId:r.machineId},title:r.title,run:()=>r.run(s)};return r.description!==void 0&&(n.description=r.description),r.shortcut!==void 0&&(n.shortcut=r.shortcut),r.group!==void 0&&(n.group=r.group),o!==void 0&&(n.enabled=o),a!==void 0&&a!==""&&(n.disabledReason=a),n})}getWorkspacePanels(){return[...this.workspacePanels].sort((t,i)=>(t.order??1e3)-(i.order??1e3)||t.title.localeCompare(i.title))}getThemes(){return[...this.themes].sort((t,i)=>(t.order??1e3)-(i.order??1e3)||t.name.localeCompare(i.name))}getThemePairs(){return[...this.themePairs].sort((t,i)=>(t.order??1e3)-(i.order??1e3)||t.name.localeCompare(i.name))}getWorkspaceLabelItems(t){return[...this.workspaceLabels].sort((i,r)=>(i.order??1e3)-(r.order??1e3)||i.id.localeCompare(r.id)).flatMap(i=>i.visible?.(t)===!1?[]:i.items(t))}qualifyAction(t,i,r,s){const o=this.qualify(t,i.id);return{...i,id:o,pluginId:t,localId:i.id,...r===void 0?{}:{machineId:r},...s===void 0?{}:{sourcePluginId:s}}}qualifyWorkspacePanel(t,i,r,s){const o=this.qualify(t,i.id),a=i.badge,n=i.visible;return{...i,id:o,pluginId:t,localId:i.id,...r===void 0?{}:{machineId:r},visible:l=>this.isContributionActive(t,r,l.machine.id,s)&&(n?.(Pp(l,t))??!0),...a===void 0?{}:{badge:l=>this.isContributionActive(t,r,l.machine.id,s)?a(Pp(l,t)):void 0},render:l=>i.render(Pp(l,t))}}qualifyWorkspaceLabelContribution(t,i,r,s){const o=this.qualify(t,i.id),a=i.visible,n=i.items;return{...i,id:o,pluginId:t,localId:i.id,...r===void 0?{}:{machineId:r},visible:l=>this.isContributionActive(t,r,l.machine.id,s)&&(a?.(l)??!0),items:l=>this.isContributionActive(t,r,l.machine.id,s)?n(l):[]}}qualifyTheme(t,i){const r=this.qualify(t,i.id);return{...i,id:r,pluginId:t,localId:i.id}}qualifyThemePair(t,i){const r=this.qualify(t,i.id);return{...i,id:r,pluginId:t,localId:i.id,light:this.qualifyReference(t,i.light),dark:this.qualifyReference(t,i.dark)}}qualify(t,i){this.validateLocalId(i);const r=`${t}:${i}`;if(this.contributionIds.has(r))throw new Error(`Duplicate contribution id: ${r}`);return this.contributionIds.add(r),r}qualifyReference(t,i){return this.validateLocalId(i),`${t}:${i}`}isContributionActive(t,i,r,s){return i===void 0?!this.isGatewayPluginHiddenForMachine(t,r):i===r&&!this.isRemotePluginHiddenByGateway(s,i)}isRemoteDuplicateHiddenByGateway(t,i,r){return t!==void 0&&i!==void 0&&this.gatewayPluginIds.has(t)&&!this.gatewayMachineSpecificPluginIds.has(t)&&!r}isRemotePluginHiddenByGateway(t,i){return t===void 0||this.gatewayMachineSpecificPluginIds.has(t)||this.remoteMachineSpecificPluginIds.get(t)?.has(i)===!0?!1:this.gatewayPluginIds.has(t)}isGatewayPluginHiddenForMachine(t,i){return i!=="local"&&(this.gatewayMachineSpecificPluginIds.has(t)||this.remoteMachineSpecificPluginIds.get(t)?.has(i)===!0)}validatePluginId(t){if(!ky.test(t))throw new Error(`Invalid plugin id: ${t}`)}validateLocalId(t){if(!ky.test(t))throw new Error(`Invalid contribution id: ${t}`)}parseMachineSpecific(t,i){if(i===void 0)return!1;if(typeof i!="boolean")throw new Error(`Invalid plugin machineSpecific value for ${t}: ${aA(i)}`);return i}}function iA(e,t){return qk.get(e)?.(t)??e}function Pp(e,t){return Hk.get(e)?.(t)??e}function rA(e,t){return qk.set(e,t),e}function sA(e,t){return Hk.set(e,t),e}function oA(e,t,i){const r=e.get(t);r===void 0?e.set(t,new Set([i])):r.add(i)}function aA(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"||typeof e=="symbol"||typeof e=="function"||e===null||e===void 0)return String(e);try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}}function nA(e){return e.state.selectedMachine?.id??"local"}const lA=["(display-mode: standalone)","(display-mode: fullscreen)","(display-mode: minimal-ui)"];function cA(){return typeof window>"u"||!("matchMedia"in window)?[]:lA.map(e=>window.matchMedia(e))}function Sy(e,t=hA()){return e.some(i=>i.matches)||dA(t)}function hA(){return typeof navigator>"u"?void 0:navigator}function dA(e){return e!==void 0&&"standalone"in e&&e.standalone===!0}const uA=250;class pA{constructor(t=fA()){this.scheduler=t}repair(t){if(!t){this.clear();return}this.resetViewportScroll(),this.repairFrame!==void 0&&this.scheduler.cancelAnimationFrame(this.repairFrame),this.repairFrame=this.scheduler.requestAnimationFrame(()=>{this.repairFrame=void 0,this.resetViewportScroll(),this.repairFrame=this.scheduler.requestAnimationFrame(()=>{this.repairFrame=void 0,this.resetViewportScroll()})}),this.repairTimer!==void 0&&this.scheduler.clearTimeout(this.repairTimer),this.repairTimer=this.scheduler.setTimeout(()=>{this.repairTimer=void 0,this.resetViewportScroll()},uA)}clear(){this.repairFrame!==void 0&&(this.scheduler.cancelAnimationFrame(this.repairFrame),this.repairFrame=void 0),this.repairTimer!==void 0&&(this.scheduler.clearTimeout(this.repairTimer),this.repairTimer=void 0)}resetViewportScroll(){this.scheduler.scrollTo(0,0);const t=this.scheduler.documentElement;t!==void 0&&(t.scrollTop=0);const i=this.scheduler.body;i!==void 0&&(i.scrollTop=0)}}function fA(){return{requestAnimationFrame(e){return window.requestAnimationFrame(e)},cancelAnimationFrame(e){window.cancelAnimationFrame(e)},setTimeout(e,t){return window.setTimeout(e,t)},clearTimeout(e){window.clearTimeout(e)},scrollTo(e,t){window.scrollTo(e,t)},get documentElement(){return typeof document>"u"?void 0:document.documentElement},get body(){return typeof document>"u"?void 0:document.body}}}const gA="(max-width: 760px)";class mA{constructor(t,i={}){this.host=t,this.onMobileNavigationMediaChange=r=>{this.isMobileNavigationLayout!==r.matches&&(this.isMobileNavigationLayout=r.matches,this.host.requestUpdate())},this.onPwaDisplayModeChange=()=>{const r=Sy(this.pwaDisplayModeMedia);this.isPwaDisplayMode!==r&&(this.isPwaDisplayMode=r,this.host.requestUpdate())},t.addController(this),this.mobileNavigationMedia=i.mobileNavigationMedia??bA(),this.pwaDisplayModeMedia=i.pwaDisplayModeMedia??cA(),this.viewportPositionRepairer=i.viewportPositionRepairer??new pA,this.isMobileNavigationLayout=this.mobileNavigationMedia?.matches??!1,this.isPwaDisplayMode=Sy(this.pwaDisplayModeMedia)}hostConnected(){this.mobileNavigationMedia?.addEventListener("change",this.onMobileNavigationMediaChange);for(const t of this.pwaDisplayModeMedia)t.addEventListener("change",this.onPwaDisplayModeChange)}hostDisconnected(){this.mobileNavigationMedia?.removeEventListener("change",this.onMobileNavigationMediaChange);for(const t of this.pwaDisplayModeMedia)t.removeEventListener("change",this.onPwaDisplayModeChange);this.viewportPositionRepairer.clear()}shouldAutoFocusPrompt(){return!this.isMobileNavigationLayout&&!this.isPwaDisplayMode}shouldShowAppRefreshInHeader(){return this.isPwaDisplayMode&&!this.isMobileNavigationLayout}shouldShowAppRefreshInContextBar(){return this.isPwaDisplayMode&&this.isMobileNavigationLayout}defaultRouteView(){return this.isMobileNavigationLayout?"navigation":"chat"}repairViewportPosition(){this.viewportPositionRepairer.repair(this.shouldRepairViewportPosition())}shouldRepairViewportPosition(){return this.isMobileNavigationLayout||this.isPwaDisplayMode}}function bA(){if(!(typeof window>"u"||!("matchMedia"in window)))return window.matchMedia(gA)}const Bd=["machines","projects","workspaces","sessions"];function yA(e){return e.selectedProject===void 0?"projects":e.selectedWorkspace===void 0?"workspaces":"sessions"}function sm(e,t){if(e!=="none")return e??yA(t)}function xA(e,t){return t.isMobileLayout?sm(t.expanded,t.state)!==e:t.collapsedSections?.includes(e)??!1}function vA(e,t,i){return sm(e,i.state)===t?"none":t}function wA(e,t,i){return i?t:e}function kA(e,t){const i=new Set(e);return i.has(t)?i.delete(t):i.add(t),TA(i)}function SA(e){return Bd[Bd.indexOf(e)+1]}class CA{constructor(t,i,r){this.host=t,this.getState=i,this.isMobileLayout=r,this.collapsedSections=[],t.addController(this)}hostConnected(){}expandedSection(){return sm(this.expanded,this.getState())}isCollapsed(t){return xA(t,{isMobileLayout:this.isMobileLayout(),expanded:this.expanded,state:this.getState(),collapsedSections:this.collapsedSections})}toggle(t){if(this.isMobileLayout()){this.setExpanded(vA(this.expanded,t,{state:this.getState()}));return}this.setCollapsedSections(kA(this.collapsedSections,t))}expand(t){if(this.isMobileLayout()){this.setExpanded(wA(this.expanded,t,!0));return}this.setCollapsedSections(this.collapsedSections.filter(i=>i!==t))}advanceAfterSelection(t){if(!this.isMobileLayout())return;const i=SA(t);i!==void 0&&this.expand(i)}open(t,i){this.isMobileLayout()&&(this.expand(t),i())}setExpanded(t){this.expanded!==t&&(this.expanded=t,this.host.requestUpdate())}setCollapsedSections(t){$A(this.collapsedSections,t)||(this.collapsedSections=t,this.host.requestUpdate())}}function TA(e){const t=new Set(e);return Bd.filter(i=>t.has(i))}function $A(e,t){return e.length===t.length&&e.every((i,r)=>i===t[r])}class MA{constructor(t){this.host=t,this.navigationPanelCollapsed=!1,this.workspacePanelCollapsed=!1,t.addController(this)}hostConnected(){}toggleNavigationPanel(){this.navigationPanelCollapsed=!this.navigationPanelCollapsed,this.host.requestUpdate()}toggleWorkspacePanel(){this.workspacePanelCollapsed=!this.workspacePanelCollapsed,this.host.requestUpdate()}expandNavigationPanel(){this.navigationPanelCollapsed&&(this.navigationPanelCollapsed=!1,this.host.requestUpdate())}expandWorkspacePanel(){this.workspacePanelCollapsed&&(this.workspacePanelCollapsed=!1,this.host.requestUpdate())}shellClass(t,i=!0,r=!0){return["shell",jk(t),...this.navigationPanelCollapsed?["navigation-panel-collapsed"]:[],...this.workspacePanelCollapsed?["workspace-panel-collapsed"]:[],...i?["bottom-mobile-nav"]:[],...r?["hide-breadcrumbs"]:[]].join(" ")}}function jk(e){return e==="navigation"?"navigation-view":e==="chat"?"chat-view":"workspace-view"}const bf="omp-web:panel-sizes:v1",AA={navigation:{minWidth:180,maxWidth:4096,defaultWidth:340,keyboardStep:24,largeKeyboardStep:72},workspace:{minWidth:240,maxWidth:4096,defaultWidth:480,keyboardStep:24,largeKeyboardStep:72}};class BA{constructor(t,i={}){this.host=t,t.addController(this),this.storage=i.storage??om(),this.panelSizes=EA(this.storage)}hostConnected(){}constraints(t){return Nc(t)}panelWidth(t,i){return Zr(t,i??this.storedPanelWidth(t)??this.constraints(t).defaultWidth)}resizePanel(t,i,r={}){const s=Zr(t,i);this.storedPanelWidth(t)!==s&&(this.panelSizes=zA(this.panelSizes,t,s),r.persist!==!1&&this.persistPanelSizes(),this.host.requestUpdate())}resetPanel(t,i={}){this.storedPanelWidth(t)!==void 0&&(this.panelSizes=DA(this.panelSizes,t),i.persist!==!1&&this.persistPanelSizes(),this.host.requestUpdate())}resetPanels(t={}){this.panelSizes.navigationPanelWidth===void 0&&this.panelSizes.workspacePanelWidth===void 0||(this.panelSizes={},t.persist!==!1&&this.persistPanelSizes(),this.host.requestUpdate())}persistPanelSizes(){RA(this.panelSizes,this.storage)}shellStyle(t={}){const i=[];return this.panelSizes.navigationPanelWidth!==void 0&&i.push(`--navigation-panel-size: ${Ty(Zr("navigation",this.panelSizes.navigationPanelWidth,t.navigation))};`),this.panelSizes.workspacePanelWidth!==void 0&&i.push(`--workspace-panel-size: ${Ty(Zr("workspace",this.panelSizes.workspacePanelWidth,t.workspace))};`),i.join(" ")}storedPanelWidth(t){return t==="navigation"?this.panelSizes.navigationPanelWidth:this.panelSizes.workspacePanelWidth}}function Nc(e){return AA[e]}function _A(e,t,i){return e==="navigation"?i-t:t-i}function LA(e,t,i,r,s=Nc(e)){return Zr(e,t+_A(e,i,r),s)}function PA(e,t,i,r={}){const s=r.constraints??Nc(e);if(i==="Home")return s.minWidth;if(i==="End")return s.maxWidth;const o=r.largeStep===!0?s.largeKeyboardStep:s.keyboardStep,a=FA(e,i,o);if(a!==void 0)return Zr(e,t+a,s)}function Zr(e,t,i=Nc(e)){return Number.isFinite(t)?Math.round(Math.min(Math.max(t,i.minWidth),i.maxWidth)):i.defaultWidth}function EA(e=om()){try{const t=e?.getItem(bf);if(t==null||t==="")return{};const i=JSON.parse(t);return IA(i)}catch{return{}}}function RA(e,t=om()){if(t!==void 0)try{if(e.navigationPanelWidth===void 0&&e.workspacePanelWidth===void 0){t.removeItem(bf);return}const i={version:1};e.navigationPanelWidth!==void 0&&(i.navigationPanelWidth=Zr("navigation",e.navigationPanelWidth)),e.workspacePanelWidth!==void 0&&(i.workspacePanelWidth=Zr("workspace",e.workspacePanelWidth)),t.setItem(bf,JSON.stringify(i))}catch{}}function IA(e){if(!ki(e)||e.version!==1)return{};const t={},i=Cy(e.navigationPanelWidth),r=Cy(e.workspacePanelWidth);return i!==void 0&&(t.navigationPanelWidth=Zr("navigation",i)),r!==void 0&&(t.workspacePanelWidth=Zr("workspace",r)),t}function Cy(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function zA(e,t,i){return t==="navigation"?{...e,navigationPanelWidth:i}:{...e,workspacePanelWidth:i}}function DA(e,t){return t==="navigation"?e.workspacePanelWidth===void 0?{}:{workspacePanelWidth:e.workspacePanelWidth}:e.navigationPanelWidth===void 0?{}:{navigationPanelWidth:e.navigationPanelWidth}}function FA(e,t,i){if(e==="navigation")return t==="ArrowRight"?i:t==="ArrowLeft"?-i:void 0;if(t==="ArrowLeft")return i;if(t==="ArrowRight")return-i}function Ty(e){return`${String(Math.round(e))}px`}function om(){try{return typeof window>"u"?void 0:window.localStorage}catch{return}}function $y(){const e=new URLSearchParams(window.location.search);return{machineId:e.get("machine")??void 0,projectId:e.get("project")??void 0,workspaceId:e.get("workspace")??void 0,sessionId:e.get("session")??void 0,tool:OA(e.get("tool")),view:NA(e.get("view"))}}function Ep(e,t){const i=new URL(window.location.href);i.searchParams.delete("machine"),i.searchParams.delete("project"),i.searchParams.delete("workspace"),i.searchParams.delete("session"),i.searchParams.delete("tool"),i.searchParams.delete("view"),e.machineId!==void 0&&e.machineId!==""&&e.machineId!=="local"&&i.searchParams.set("machine",e.machineId),e.projectId!==void 0&&e.projectId!==""&&i.searchParams.set("project",e.projectId),e.workspaceId!==void 0&&e.workspaceId!==""&&i.searchParams.set("workspace",e.workspaceId),e.sessionId!==void 0&&e.sessionId!==""&&i.searchParams.set("session",e.sessionId),e.tool!==void 0&&i.searchParams.set("tool",e.tool),e.view!==void 0&&i.searchParams.set("view",e.view);const r=`${i.pathname}${i.search}${i.hash}`,s=`${window.location.pathname}${window.location.search}${window.location.hash}`;r!==s&&(t?.replace===!0?window.history.replaceState({},"",i):window.history.pushState({},"",i))}function OA(e){return e==="files"?"core:workspace.files":e==="git"?"core:workspace.git":Uk(e)?e:void 0}function NA(e){return e==="chat"?"chat":e==="files"?"core:workspace.files":e==="git"?"core:workspace.git":Uk(e)?e:void 0}function Uk(e){return e!==null&&/^[a-z][a-z0-9.-]*:[a-z][a-z0-9.-]*$/u.test(e)}function My(){return WA(new URLSearchParams(window.location.search).get("settings"))}function Rp(e,t){const i=new URL(window.location.href);e===void 0?i.searchParams.delete("settings"):i.searchParams.set("settings",e);const r=`${i.pathname}${i.search}${i.hash}`,s=`${window.location.pathname}${window.location.search}${window.location.hash}`;r!==s&&window.history.pushState({},"",i)}function WA(e){if(e==="general")return"general";if(e==="sessiond"||e==="sessions")return"sessiond";if(e==="packages"||e==="pi-packages")return"packages";if(e==="plugins")return"plugins";if(e==="shortcuts"||e==="keyboard"||e==="keyboard-shortcuts")return"shortcuts"}function qA(e,t){return t===void 0?e:e.map(i=>jA(i,t))}function HA(e,t){const i=new Set(em(e,t,{enabledOnly:!0}).filter(r=>r.active).map(r=>r.action.id));return qA(e,t).map(r=>r.shortcut!==void 0&&!i.has(r.id)?Yk(r):r)}function jA(e,t){if(!Object.hasOwn(t,e.id))return e;const i=t[e.id];return i===void 0?e:i===null?Yk(e):{...e,shortcut:i}}function Yk(e){const t={...e};return delete t.shortcut,t}function UA(e,t){const i=t.api??An,r=t.pollIntervalMs??1e3,s=t.setTimeout??GA(),o=t.clearTimeout??XA();return{async runCommand(a){const n=await i.runTerminalCommand(e,a);return a.open===!0&&t.openTerminal(a.workspace,{terminalId:n.terminalId}),{run:n,completed:YA(n,i,r,s,o)}},listCommandRuns:a=>i.listCommandRuns(a),getCommandRun:a=>i.getCommandRun(a),open:a=>{t.openTerminal(void 0,a)}}}function YA(e,t,i,r,s){return Ay(e)?Promise.resolve(e):new Promise((o,a)=>{let n,l=!1;const c=u=>{l||(l=!0,n!==void 0&&s(n),o(u))},h=u=>{l||(l=!0,n!==void 0&&s(n),a(u instanceof Error?u:new Error(String(u))))},d=()=>{t.getCommandRun(e.id).then(u=>{if(u!==void 0&&Ay(u)){c(u);return}n=r(d,i)}).catch(h)};n=r(d,i)})}function Ay(e){return e.status==="succeeded"||e.status==="failed"}function GA(){return(e,t)=>globalThis.setTimeout(e,t)}function XA(){return e=>{globalThis.clearTimeout(e)}}const VA="workspace.delete",KA="pi.operation",ZA="target.workspaceId";function QA(e){return{...e===void 0?{}:{projectId:e},metadata:{[KA]:VA}}}function JA(e){const t={};for(const i of e){const r=yf(i);if(r===void 0)continue;const s=t[r];(s===void 0||i.createdAt.localeCompare(s.createdAt)>=0)&&(t[r]=i)}return t}function tB(e){return Object.entries(e).filter(([,t])=>_d(t)).map(([t])=>t)}function Gk(e,t){if(t===void 0)return!1;const i=e.workspaceDeletionRuns[t.id];return i!==void 0&&_d(i)}function yf(e){return e.metadata[ZA]}function _d(e){return e.status==="queued"||e.status==="running"}function eB(e,t){return t[e.path]}function iB(e){if(e?.hasSessionActivity===!0)return"session";if(e?.hasTerminalActivity===!0)return"terminal"}function rB(e,t,i){return Vk(sB(e,t,i))}function Xk(e){return Vk(Object.values(e??{}))}function Vk(e){if(e.some(t=>t.hasSessionActivity))return"session";if(e.some(t=>t.hasTerminalActivity))return"terminal"}function sB(e,t,i){const r=new Set(t.filter(o=>o.projectId===e.id).map(o=>o.path)),s=new Map;for(const o of r){const a=i[o];a!==void 0&&s.set(a.cwd,a)}for(const o of Object.values(i))(o.cwd===e.path||o.cwd.startsWith(`${e.path}/`))&&s.set(o.cwd,o);return[...s.values()]}const ph=0,oB=120;function Wc(e,t={}){if(typeof HTMLElement>"u"||typeof window>"u"||!(e instanceof HTMLElement))return"";const i=e.getBoundingClientRect(),r=t.constrainTo==="viewport"?Kk():aB(e),s=window.innerWidth,o=window.innerHeight,a=Math.max(0,r.left),n=Math.min(s,r.right),l=Math.max(0,r.top),c=Math.min(o,r.bottom),h=Math.min(i.right,n),d=c-i.bottom-ph,u=i.top-l-ph;return[...d<oB&&u>d?[`bottom: ${hn(o-i.top+ph)};`,`max-height: ${hn(Math.max(0,u))};`]:[`top: ${hn(i.bottom+ph)};`,`max-height: ${hn(Math.max(0,d))};`],`right: ${hn(Math.max(0,s-h))};`,`max-width: ${hn(Math.max(0,h-a))};`].join(" ")}function aB(e){const t=e.getRootNode();return typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&t.host instanceof HTMLElement?t.host.getBoundingClientRect():Kk()}function Kk(){return{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}}function hn(e){return`${String(Math.round(e))}px`}function Zk(e,t="Active"){if(e!==void 0)return T`<span class=${`activity-indicator ${e}`} role="img" aria-label=${t} title=${t}></span>`}function Mu(e,t="Active"){const i=Zk(e,t);if(i!==void 0)return T`<span class="action-activity">${i}</span>`}const nB=["a[href]","button","input","select","textarea","summary","[role='button']","[role='link']","[contenteditable='true']"].join(",");function am(e){return e.composedPath().some(t=>lB(t,nB))}function lB(e,t){if(typeof Element<"u"&&e instanceof Element)return e.matches(t);if(!("matches"in e))return!1;const{matches:i}=e;return typeof i=="function"&&i.call(e,t)===!0}let xf=!1,Ld,Qk=0,Jk=0;function Au(e,t){if(am(e))return;const i=e.touches[0];if(!i)return;Qk=i.clientX,Jk=i.clientY,clearTimeout(Ld);const r=e.currentTarget;if(!(typeof HTMLElement<"u"&&r instanceof HTMLElement))return;const s=r;Ld=setTimeout(()=>{xf=!0,setTimeout(()=>{xf=!1},400);try{typeof navigator<"u"&&"vibrate"in navigator&&navigator.vibrate(40)}catch{}t(s)},500)}function Bu(e){const t=e.touches[0];t&&(Math.abs(t.clientX-Qk)>10||Math.abs(t.clientY-Jk)>10)&&clearTimeout(Ld)}function la(){clearTimeout(Ld)}function _u(e,t){xf||am(e)||t()}function Lu(e,t){return am(e)?!1:e.key==="Enter"||e.key===" "?(e.preventDefault(),t.activate(),!0):e.key==="ArrowUp"?Ta(e,()=>{By(e.currentTarget,-1)}):e.key==="ArrowDown"?Ta(e,()=>{By(e.currentTarget,1)}):e.key==="Home"?Ta(e,()=>{_y(e.currentTarget,0)}):e.key==="End"?Ta(e,()=>{_y(e.currentTarget,-1)}):e.key==="ArrowLeft"&&t.previousSection!==void 0?Ta(e,t.previousSection):e.key==="ArrowRight"&&t.nextSection!==void 0?Ta(e,t.nextSection):e.key==="Escape"&&t.cancel!==void 0?Ta(e,t.cancel):!1}function Pu(e,t={}){const i=e.querySelector(".action-row.selected")??e.querySelector(".action-row")??(t.fallbackSelector===void 0?void 0:e.querySelector(t.fallbackSelector));return i==null?!1:(i.focus(),i.scrollIntoView({block:"nearest"}),!0)}function Ta(e,t){return e.preventDefault(),e.stopPropagation?.(),t(),!0}function By(e,t){const i=e4(e),r=i4(e);if(r===void 0||i.length===0)return;const s=i.indexOf(r);s<0||t4(i,s+t)}function _y(e,t){const i=e4(e);i.length!==0&&t4(i,t<0?i.length-1:t)}function t4(e,t){const i=e[Math.min(Math.max(t,0),e.length-1)];i?.focus(),i?.scrollIntoView({block:"nearest"})}function e4(e){const t=i4(e)?.getRootNode();return t===void 0||!cB(t)?[]:Array.from(t.querySelectorAll(".action-row"))}function cB(e){return typeof Document<"u"&&e instanceof Document||typeof DocumentFragment<"u"&&e instanceof DocumentFragment}function i4(e){if(!(typeof HTMLElement>"u"||!(e instanceof HTMLElement)))return e.closest(".action-row")??void 0}const hB=_e`
27
27
  /* Mobile browsers already subtract browser controls from 100dvh; reserve bottom safe area only in standalone PWA modes. */
@@ -1383,11 +1383,11 @@ This only removes it from PI WEB; it will not change the project folder.`)&&this
1383
1383
  .track { position: relative; height: 4px; margin-top: 4px; border-radius: 999px; background: color-mix(in srgb, var(--pi-border-muted) 34%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--pi-bg) 55%, transparent); }
1384
1384
  .progress { position: absolute; left: 0; width: var(--position); top: 0; bottom: 0; border-radius: 999px; background: color-mix(in srgb, var(--pi-accent) 42%, var(--pi-border-muted)); }
1385
1385
  .marker { position: absolute; left: var(--position); top: 50%; width: 10px; height: 10px; border: 2px solid var(--pi-bg); border-radius: 50%; background: var(--pi-accent); box-shadow: 0 2px 8px var(--pi-shadow); transform: translate(-50%, -50%); }
1386
- `;um([P({type:Number})],Sc.prototype,"positionPercent",2);um([P({type:Number})],Sc.prototype,"loadedPercent",2);Sc=um([Ae("conversation-meter")],Sc);function Ny(e){return Number.isFinite(e)?Math.min(100,Math.max(0,e)):0}let vf=class extends hm{constructor(t){if(super(t),this.it=Qe,t.type!==lm.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===Qe||t==null)return this._t=void 0,this.it=t;if(t===aa)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const i=[t];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}};vf.directiveName="unsafeHTML",vf.resultType=1;const y_=cm(vf),x_='@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.18.7"}.katex .katex-mathml{border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.katex-newline{display:block}.katex .katex-base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .katex-base,.katex .katex-strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .katex-vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .katex-thinbox{display:inline-flex;flex-direction:row;max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .katex-hdashline,.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-rule,.katex .katex-underline .underline-line,.katex .mfrac .frac-line{min-height:1px}.katex .mspace{display:inline-block}.katex .katex-smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.katex-inner,.katex .llap>.katex-inner,.katex .rlap>.katex-inner{position:absolute}.katex .clap>.katex-fix,.katex .llap>.katex-fix,.katex .rlap>.katex-fix{display:inline-block}.katex .llap>.katex-inner{right:0}.katex .clap>.katex-inner,.katex .rlap>.katex-inner{left:0}.katex .clap>.katex-inner>span{margin-left:-50%;margin-right:50%}.katex .katex-rule{border:0 solid;display:inline-block;position:relative}.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .katex-hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.katex-root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .katex-sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .katex-sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .katex-sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .katex-sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .katex-sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .katex-sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .katex-sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .katex-sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .katex-sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .katex-sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .katex-sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .katex-sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .katex-sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .katex-sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .katex-sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .katex-sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .katex-sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .katex-sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .katex-sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .katex-sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .katex-sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .katex-sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .katex-sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .katex-sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .katex-sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .katex-sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .katex-sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .katex-sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .katex-sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .katex-sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .katex-sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .katex-sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .katex-sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .katex-sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .katex-sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .katex-sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .katex-sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .katex-sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .katex-sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .katex-sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .katex-sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .katex-sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .katex-sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .katex-sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .katex-sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .katex-sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .katex-sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .katex-sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .katex-sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .katex-sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .katex-sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .katex-sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .katex-sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .katex-sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .katex-sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .katex-sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .katex-sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .katex-sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .katex-sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .katex-sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .katex-sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .katex-sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .katex-sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .katex-sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .katex-sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .katex-sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .katex-sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .katex-sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .katex-sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .katex-sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .katex-sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .katex-sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .katex-sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .katex-sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .katex-sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .katex-sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .katex-sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .katex-sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .katex-sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .katex-sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .katex-sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .katex-sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .katex-sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .katex-sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .katex-sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .katex-sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .katex-sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .katex-sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .katex-sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .katex-sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .katex-sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .katex-sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .katex-sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .katex-sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .katex-sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .katex-sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .katex-sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .katex-sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .katex-sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .katex-sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .katex-sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .katex-sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .katex-sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .katex-sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .katex-sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .katex-sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .katex-sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .katex-sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .katex-sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .katex-sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .katex-sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .katex-sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .katex-sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .katex-sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .katex-sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .katex-sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .katex-sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .katex-sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .katex-sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .katex-sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .katex-sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .katex-accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .katex-accent .accent-body{position:relative}.katex .katex-accent .accent-body:not(.accent-full){width:0}.katex .katex-overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .katex-stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .katex-stretchy:after,.katex .katex-stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .katex-sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .reflectbox{display:inline-block;transform:scaleX(-1)}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.katex-tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.katex-tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}',v_="modulepreload",w_=function(e){return"/"+e},Wy={},xe=function(t,i,r){let s=Promise.resolve();if(i&&i.length>0){let l=function(c){return Promise.all(c.map(h=>Promise.resolve(h).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),n=a?.nonce||a?.getAttribute("nonce");s=l(i.map(c=>{if(c=w_(c),c in Wy)return;Wy[c]=!0;const h=c.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const u=document.createElement("link");if(u.rel=h?"stylesheet":v_,h||(u.as="script"),u.crossOrigin="",u.href=c,n&&u.setAttribute("nonce",n),document.head.appendChild(u),h)return new Promise((p,f)=>{u.addEventListener("load",p),u.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(a){const n=new Event("vite:preloadError",{cancelable:!0});if(n.payload=a,window.dispatchEvent(n),!n.defaultPrevented)throw a}return s.then(a=>{for(const n of a||[])n.status==="rejected"&&o(n.reason);return t().catch(o)})};var c4=Object.defineProperty,b=(e,t)=>c4(e,"name",{value:t,configurable:!0}),k_=(e,t)=>{for(var i in t)c4(e,i,{get:t[i],enumerable:!0})},aet=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function S_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var td={exports:{}},C_=td.exports,qy;function T_(){return qy||(qy=1,(function(e,t){(function(i,r){e.exports=r()})(C_,(function(){var i=1e3,r=6e4,s=36e5,o="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",u="quarter",p="year",f="date",g="Invalid Date",m=/^(\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,w={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(D){var O=["th","st","nd","rd"],M=D%100;return"["+D+(O[(M-20)%10]||O[M]||O[0])+"]"}},S=function(D,O,M){var X=String(D);return!X||X.length>=O?D:""+Array(O+1-X.length).join(M)+D},A={s:S,z:function(D){var O=-D.utcOffset(),M=Math.abs(O),X=Math.floor(M/60),G=M%60;return(O<=0?"+":"-")+S(X,2,"0")+":"+S(G,2,"0")},m:function D(O,M){if(O.date()<M.date())return-D(M,O);var X=12*(M.year()-O.year())+(M.month()-O.month()),G=O.clone().add(X,d),nt=M-G<0,Y=O.clone().add(X+(nt?-1:1),d);return+(-(X+(M-G)/(nt?G-Y:Y-G))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:d,y:p,w:h,d:c,D:f,h:l,m:n,s:a,ms:o,Q:u}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},C="en",E={};E[C]=w;var z="$isDayjsObject",R=function(D){return D instanceof W||!(!D||!D[z])},V=function D(O,M,X){var G;if(!O)return C;if(typeof O=="string"){var nt=O.toLowerCase();E[nt]&&(G=nt),M&&(E[nt]=M,G=nt);var Y=O.split("-");if(!G&&Y.length>1)return D(Y[0])}else{var ct=O.name;E[ct]=O,G=ct}return!X&&G&&(C=G),G||!X&&C},F=function(D,O){if(R(D))return D.clone();var M=typeof O=="object"?O:{};return M.date=D,M.args=arguments,new W(M)},H=A;H.l=V,H.i=R,H.w=function(D,O){return F(D,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var W=(function(){function D(M){this.$L=V(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[z]=!0}var O=D.prototype;return O.parse=function(M){this.$d=(function(X){var G=X.date,nt=X.utc;if(G===null)return new Date(NaN);if(H.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var Y=G.match(m);if(Y){var ct=Y[2]-1||0,dt=(Y[7]||"0").substring(0,3);return nt?new Date(Date.UTC(Y[1],ct,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,dt)):new Date(Y[1],ct,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,dt)}}return new Date(G)})(M),this.init()},O.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},O.$utils=function(){return H},O.isValid=function(){return this.$d.toString()!==g},O.isSame=function(M,X){var G=F(M);return this.startOf(X)<=G&&G<=this.endOf(X)},O.isAfter=function(M,X){return F(M)<this.startOf(X)},O.isBefore=function(M,X){return this.endOf(X)<F(M)},O.$g=function(M,X,G){return H.u(M)?this[X]:this.set(G,M)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(M,X){var G=this,nt=!!H.u(X)||X,Y=H.p(M),ct=function(rt,zt){var ot=H.w(G.$u?Date.UTC(G.$y,zt,rt):new Date(G.$y,zt,rt),G);return nt?ot:ot.endOf(c)},dt=function(rt,zt){return H.w(G.toDate()[rt].apply(G.toDate("s"),(nt?[0,0,0,0]:[23,59,59,999]).slice(zt)),G)},tt=this.$W,mt=this.$M,ft=this.$D,kt="set"+(this.$u?"UTC":"");switch(Y){case p:return nt?ct(1,0):ct(31,11);case d:return nt?ct(1,mt):ct(0,mt+1);case h:var j=this.$locale().weekStart||0,ht=(tt<j?tt+7:tt)-j;return ct(nt?ft-ht:ft+(6-ht),mt);case c:case f:return dt(kt+"Hours",0);case l:return dt(kt+"Minutes",1);case n:return dt(kt+"Seconds",2);case a:return dt(kt+"Milliseconds",3);default:return this.clone()}},O.endOf=function(M){return this.startOf(M,!1)},O.$set=function(M,X){var G,nt=H.p(M),Y="set"+(this.$u?"UTC":""),ct=(G={},G[c]=Y+"Date",G[f]=Y+"Date",G[d]=Y+"Month",G[p]=Y+"FullYear",G[l]=Y+"Hours",G[n]=Y+"Minutes",G[a]=Y+"Seconds",G[o]=Y+"Milliseconds",G)[nt],dt=nt===c?this.$D+(X-this.$W):X;if(nt===d||nt===p){var tt=this.clone().set(f,1);tt.$d[ct](dt),tt.init(),this.$d=tt.set(f,Math.min(this.$D,tt.daysInMonth())).$d}else ct&&this.$d[ct](dt);return this.init(),this},O.set=function(M,X){return this.clone().$set(M,X)},O.get=function(M){return this[H.p(M)]()},O.add=function(M,X){var G,nt=this;M=Number(M);var Y=H.p(X),ct=function(mt){var ft=F(nt);return H.w(ft.date(ft.date()+Math.round(mt*M)),nt)};if(Y===d)return this.set(d,this.$M+M);if(Y===p)return this.set(p,this.$y+M);if(Y===c)return ct(1);if(Y===h)return ct(7);var dt=(G={},G[n]=r,G[l]=s,G[a]=i,G)[Y]||1,tt=this.$d.getTime()+M*dt;return H.w(tt,this)},O.subtract=function(M,X){return this.add(-1*M,X)},O.format=function(M){var X=this,G=this.$locale();if(!this.isValid())return G.invalidDate||g;var nt=M||"YYYY-MM-DDTHH:mm:ssZ",Y=H.z(this),ct=this.$H,dt=this.$m,tt=this.$M,mt=G.weekdays,ft=G.months,kt=G.meridiem,j=function(zt,ot,Ht,Rt){return zt&&(zt[ot]||zt(X,nt))||Ht[ot].slice(0,Rt)},ht=function(zt){return H.s(ct%12||12,zt,"0")},rt=kt||function(zt,ot,Ht){var Rt=zt<12?"AM":"PM";return Ht?Rt.toLowerCase():Rt};return nt.replace(x,(function(zt,ot){return ot||(function(Ht){switch(Ht){case"YY":return String(X.$y).slice(-2);case"YYYY":return H.s(X.$y,4,"0");case"M":return tt+1;case"MM":return H.s(tt+1,2,"0");case"MMM":return j(G.monthsShort,tt,ft,3);case"MMMM":return j(ft,tt);case"D":return X.$D;case"DD":return H.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return j(G.weekdaysMin,X.$W,mt,2);case"ddd":return j(G.weekdaysShort,X.$W,mt,3);case"dddd":return mt[X.$W];case"H":return String(ct);case"HH":return H.s(ct,2,"0");case"h":return ht(1);case"hh":return ht(2);case"a":return rt(ct,dt,!0);case"A":return rt(ct,dt,!1);case"m":return String(dt);case"mm":return H.s(dt,2,"0");case"s":return String(X.$s);case"ss":return H.s(X.$s,2,"0");case"SSS":return H.s(X.$ms,3,"0");case"Z":return Y}return null})(zt)||Y.replace(":","")}))},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(M,X,G){var nt,Y=this,ct=H.p(X),dt=F(M),tt=(dt.utcOffset()-this.utcOffset())*r,mt=this-dt,ft=function(){return H.m(Y,dt)};switch(ct){case p:nt=ft()/12;break;case d:nt=ft();break;case u:nt=ft()/3;break;case h:nt=(mt-tt)/6048e5;break;case c:nt=(mt-tt)/864e5;break;case l:nt=mt/s;break;case n:nt=mt/r;break;case a:nt=mt/i;break;default:nt=mt}return G?nt:H.a(nt)},O.daysInMonth=function(){return this.endOf(d).$D},O.$locale=function(){return E[this.$L]},O.locale=function(M,X){if(!M)return this.$L;var G=this.clone(),nt=V(M,X,!0);return nt&&(G.$L=nt),G},O.clone=function(){return H.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},D})(),U=W.prototype;return F.prototype=U,[["$ms",o],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",p],["$D",f]].forEach((function(D){U[D[1]]=function(O){return this.$g(O,D[0],D[1])}})),F.extend=function(D,O){return D.$i||(D(O,W,F),D.$i=!0),F},F.locale=V,F.isDayjs=R,F.unix=function(D){return F(1e3*D)},F.en=E[C],F.Ls=E,F.p={},F}))})(td)),td.exports}var $_=T_();const M_=S_($_);var co={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},vt={trace:b((...e)=>{},"trace"),debug:b((...e)=>{},"debug"),info:b((...e)=>{},"info"),warn:b((...e)=>{},"warn"),error:b((...e)=>{},"error"),fatal:b((...e)=>{},"fatal")},pm=b(function(e="fatal"){let t=co.fatal;typeof e=="string"?e.toLowerCase()in co&&(t=co[e]):typeof e=="number"&&(t=e),vt.trace=()=>{},vt.debug=()=>{},vt.info=()=>{},vt.warn=()=>{},vt.error=()=>{},vt.fatal=()=>{},t<=co.fatal&&(vt.fatal=console.error?console.error.bind(console,Xr("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Xr("FATAL"))),t<=co.error&&(vt.error=console.error?console.error.bind(console,Xr("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Xr("ERROR"))),t<=co.warn&&(vt.warn=console.warn?console.warn.bind(console,Xr("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Xr("WARN"))),t<=co.info&&(vt.info=console.info?console.info.bind(console,Xr("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Xr("INFO"))),t<=co.debug&&(vt.debug=console.debug?console.debug.bind(console,Xr("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xr("DEBUG"))),t<=co.trace&&(vt.trace=console.debug?console.debug.bind(console,Xr("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xr("TRACE")))},"setLogLevel"),Xr=b(e=>`%c${M_().format("ss.SSS")} : ${e} : `,"format");const ed={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,i)=>(i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e),hsl2rgb:({h:e,s:t,l:i},r)=>{if(!t)return i*2.55;e/=360,t/=100,i/=100;const s=i<.5?i*(1+t):i+t-i*t,o=2*i-s;switch(r){case"r":return ed.hue2rgb(o,s,e+1/3)*255;case"g":return ed.hue2rgb(o,s,e)*255;case"b":return ed.hue2rgb(o,s,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:i},r)=>{e/=255,t/=255,i/=255;const s=Math.max(e,t,i),o=Math.min(e,t,i),a=(s+o)/2;if(r==="l")return a*100;if(s===o)return 0;const n=s-o,l=a>.5?n/(2-s-o):n/(s+o);if(r==="s")return l*100;switch(s){case e:return((t-i)/n+(t<i?6:0))*60;case t:return((i-e)/n+2)*60;case i:return((e-t)/n+4)*60;default:return-1}}},A_={clamp:(e,t,i)=>t>i?Math.min(t,Math.max(i,e)):Math.min(i,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},B_={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},ge={channel:ed,lang:A_,unit:B_},Zo={};for(let e=0;e<=255;e++)Zo[e]=ge.unit.dec2hex(e);const Zi={ALL:0,RGB:1,HSL:2};let __=class{constructor(){this.type=Zi.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=Zi.ALL}is(t){return this.type===t}};class L_{constructor(t,i){this.color=i,this.changed=!1,this.data=t,this.type=new __}set(t,i){return this.color=i,this.changed=!1,this.data=t,this.type.type=Zi.ALL,this}_ensureHSL(){const t=this.data,{h:i,s:r,l:s}=t;i===void 0&&(t.h=ge.channel.rgb2hsl(t,"h")),r===void 0&&(t.s=ge.channel.rgb2hsl(t,"s")),s===void 0&&(t.l=ge.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:i,g:r,b:s}=t;i===void 0&&(t.r=ge.channel.hsl2rgb(t,"r")),r===void 0&&(t.g=ge.channel.hsl2rgb(t,"g")),s===void 0&&(t.b=ge.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,i=t.r;return!this.type.is(Zi.HSL)&&i!==void 0?i:(this._ensureHSL(),ge.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,i=t.g;return!this.type.is(Zi.HSL)&&i!==void 0?i:(this._ensureHSL(),ge.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,i=t.b;return!this.type.is(Zi.HSL)&&i!==void 0?i:(this._ensureHSL(),ge.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,i=t.h;return!this.type.is(Zi.RGB)&&i!==void 0?i:(this._ensureRGB(),ge.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,i=t.s;return!this.type.is(Zi.RGB)&&i!==void 0?i:(this._ensureRGB(),ge.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,i=t.l;return!this.type.is(Zi.RGB)&&i!==void 0?i:(this._ensureRGB(),ge.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Zi.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Zi.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Zi.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Zi.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Zi.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Zi.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Ru=new L_({r:0,g:0,b:0,a:0},"transparent"),Ln={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Ln.re);if(!t)return;const i=t[1],r=parseInt(i,16),s=i.length,o=s%4===0,a=s>4,n=a?1:17,l=a?8:4,c=o?0:-1,h=a?255:15;return Ru.set({r:(r>>l*(c+3)&h)*n,g:(r>>l*(c+2)&h)*n,b:(r>>l*(c+1)&h)*n,a:o?(r&h)*n/255:1},e)},stringify:e=>{const{r:t,g:i,b:r,a:s}=e;return s<1?`#${Zo[Math.round(t)]}${Zo[Math.round(i)]}${Zo[Math.round(r)]}${Zo[Math.round(s*255)]}`:`#${Zo[Math.round(t)]}${Zo[Math.round(i)]}${Zo[Math.round(r)]}`}},Fa={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(Fa.hueRe);if(t){const[,i,r]=t;switch(r){case"grad":return ge.channel.clamp.h(parseFloat(i)*.9);case"rad":return ge.channel.clamp.h(parseFloat(i)*180/Math.PI);case"turn":return ge.channel.clamp.h(parseFloat(i)*360)}}return ge.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const i=e.match(Fa.re);if(!i)return;const[,r,s,o,a,n]=i;return Ru.set({h:Fa._hue2deg(r),s:ge.channel.clamp.s(parseFloat(s)),l:ge.channel.clamp.l(parseFloat(o)),a:a?ge.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:i,l:r,a:s}=e;return s<1?`hsla(${ge.lang.round(t)}, ${ge.lang.round(i)}%, ${ge.lang.round(r)}%, ${s})`:`hsl(${ge.lang.round(t)}, ${ge.lang.round(i)}%, ${ge.lang.round(r)}%)`}},hc={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=hc.colors[e];if(t)return Ln.parse(t)},stringify:e=>{const t=Ln.stringify(e);for(const i in hc.colors)if(hc.colors[i]===t)return i}},Vl={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 i=e.match(Vl.re);if(!i)return;const[,r,s,o,a,n,l,c,h]=i;return Ru.set({r:ge.channel.clamp.r(s?parseFloat(r)*2.55:parseFloat(r)),g:ge.channel.clamp.g(a?parseFloat(o)*2.55:parseFloat(o)),b:ge.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?ge.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:i,b:r,a:s}=e;return s<1?`rgba(${ge.lang.round(t)}, ${ge.lang.round(i)}, ${ge.lang.round(r)}, ${ge.lang.round(s)})`:`rgb(${ge.lang.round(t)}, ${ge.lang.round(i)}, ${ge.lang.round(r)})`}},Ys={format:{keyword:hc,hex:Ln,rgb:Vl,rgba:Vl,hsl:Fa,hsla:Fa},parse:e=>{if(typeof e!="string")return e;const t=Ln.parse(e)||Vl.parse(e)||Fa.parse(e)||hc.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Zi.HSL)||e.data.r===void 0?Fa.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Vl.stringify(e):Ln.stringify(e)},h4=(e,t)=>{const i=Ys.parse(e);for(const r in t)i[r]=ge.channel.clamp[r](t[r]);return Ys.stringify(i)},oa=(e,t,i=0,r=1)=>{if(typeof e!="number")return h4(e,{a:t});const s=Ru.set({r:ge.channel.clamp.r(e),g:ge.channel.clamp.g(t),b:ge.channel.clamp.b(i),a:ge.channel.clamp.a(r)});return Ys.stringify(s)},P_=e=>{const{r:t,g:i,b:r}=Ys.parse(e),s=.2126*ge.channel.toLinear(t)+.7152*ge.channel.toLinear(i)+.0722*ge.channel.toLinear(r);return ge.lang.round(s)},E_=e=>P_(e)>=.5,Mr=e=>!E_(e),d4=(e,t,i)=>{const r=Ys.parse(e),s=r[t],o=ge.channel.clamp[t](s+i);return s!==o&&(r[t]=o),Ys.stringify(r)},st=(e,t)=>d4(e,"l",t),at=(e,t)=>d4(e,"l",-t),B=(e,t)=>{const i=Ys.parse(e),r={};for(const s in t)t[s]&&(r[s]=i[s]+t[s]);return h4(e,r)},R_=(e,t,i=50)=>{const{r,g:s,b:o,a}=Ys.parse(e),{r:n,g:l,b:c,a:h}=Ys.parse(t),d=i/100,u=d*2-1,p=a-h,g=((u*p===-1?u:(u+p)/(1+u*p))+1)/2,m=1-g,x=r*g+n*m,w=s*g+l*m,S=o*g+c*m,A=a*d+h*(1-d);return oa(x,w,S,A)},Q=(e,t=100)=>{const i=Ys.parse(e);return i.r=255-i.r,i.g=255-i.g,i.b=255-i.b,R_(i,e,t)};function Hy(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function I_(e){if(Array.isArray(e))return e}function z_(e,t){var i=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(i!=null){var r,s,o,a,n=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,t!==0)for(;!(l=(r=o.call(i)).done)&&(n.push(r.value),n.length!==t);l=!0);}catch(h){c=!0,s=h}finally{try{if(!l&&i.return!=null&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw s}}return n}}function D_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1386
+ `;um([P({type:Number})],Sc.prototype,"positionPercent",2);um([P({type:Number})],Sc.prototype,"loadedPercent",2);Sc=um([Ae("conversation-meter")],Sc);function Ny(e){return Number.isFinite(e)?Math.min(100,Math.max(0,e)):0}let vf=class extends hm{constructor(t){if(super(t),this.it=Qe,t.type!==lm.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===Qe||t==null)return this._t=void 0,this.it=t;if(t===aa)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const i=[t];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}};vf.directiveName="unsafeHTML",vf.resultType=1;const y_=cm(vf),x_='@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.18.7"}.katex .katex-mathml{border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.katex-newline{display:block}.katex .katex-base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .katex-base,.katex .katex-strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .katex-vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .katex-thinbox{display:inline-flex;flex-direction:row;max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .katex-hdashline,.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-rule,.katex .katex-underline .underline-line,.katex .mfrac .frac-line{min-height:1px}.katex .mspace{display:inline-block}.katex .katex-smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.katex-inner,.katex .llap>.katex-inner,.katex .rlap>.katex-inner{position:absolute}.katex .clap>.katex-fix,.katex .llap>.katex-fix,.katex .rlap>.katex-fix{display:inline-block}.katex .llap>.katex-inner{right:0}.katex .clap>.katex-inner,.katex .rlap>.katex-inner{left:0}.katex .clap>.katex-inner>span{margin-left:-50%;margin-right:50%}.katex .katex-rule{border:0 solid;display:inline-block;position:relative}.katex .katex-hline,.katex .katex-overline .overline-line,.katex .katex-underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .katex-hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.katex-root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .katex-sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .katex-sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .katex-sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .katex-sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .katex-sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .katex-sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .katex-sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .katex-sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .katex-sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .katex-sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .katex-sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .katex-sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .katex-sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .katex-sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .katex-sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .katex-sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .katex-sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .katex-sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .katex-sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .katex-sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .katex-sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .katex-sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .katex-sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .katex-sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .katex-sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .katex-sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .katex-sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .katex-sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .katex-sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .katex-sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .katex-sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .katex-sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .katex-sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .katex-sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .katex-sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .katex-sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .katex-sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .katex-sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .katex-sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .katex-sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .katex-sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .katex-sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .katex-sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .katex-sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .katex-sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .katex-sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .katex-sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .katex-sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .katex-sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .katex-sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .katex-sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .katex-sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .katex-sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .katex-sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .katex-sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .katex-sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .katex-sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .katex-sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .katex-sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .katex-sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .katex-sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .katex-sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .katex-sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .katex-sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .katex-sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .katex-sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .katex-sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .katex-sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .katex-sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .katex-sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .katex-sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .katex-sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .katex-sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .katex-sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .katex-sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .katex-sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .katex-sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .katex-sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .katex-sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .katex-sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .katex-sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .katex-sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .katex-sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .katex-sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .katex-sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .katex-sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .katex-sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .katex-sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .katex-sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .katex-sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .katex-sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .katex-sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .katex-sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .katex-sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .katex-sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .katex-sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .katex-sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .katex-sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .katex-sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .katex-sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .katex-sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .katex-sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .katex-sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .katex-sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .katex-sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .katex-sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .katex-sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .katex-sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .katex-sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .katex-sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .katex-sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .katex-sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .katex-sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .katex-sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .katex-sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .katex-sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .katex-sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .katex-sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .katex-sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .katex-sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .katex-sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .katex-accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .katex-accent .accent-body{position:relative}.katex .katex-accent .accent-body:not(.accent-full){width:0}.katex .katex-overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .katex-stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .katex-stretchy:after,.katex .katex-stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .katex-sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .reflectbox{display:inline-block;transform:scaleX(-1)}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.katex-tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.katex-tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}',v_="modulepreload",w_=function(e){return"/"+e},Wy={},xe=function(t,i,r){let s=Promise.resolve();if(i&&i.length>0){let l=function(c){return Promise.all(c.map(h=>Promise.resolve(h).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),n=a?.nonce||a?.getAttribute("nonce");s=l(i.map(c=>{if(c=w_(c),c in Wy)return;Wy[c]=!0;const h=c.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const u=document.createElement("link");if(u.rel=h?"stylesheet":v_,h||(u.as="script"),u.crossOrigin="",u.href=c,n&&u.setAttribute("nonce",n),document.head.appendChild(u),h)return new Promise((p,f)=>{u.addEventListener("load",p),u.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(a){const n=new Event("vite:preloadError",{cancelable:!0});if(n.payload=a,window.dispatchEvent(n),!n.defaultPrevented)throw a}return s.then(a=>{for(const n of a||[])n.status==="rejected"&&o(n.reason);return t().catch(o)})};var c4=Object.defineProperty,b=(e,t)=>c4(e,"name",{value:t,configurable:!0}),k_=(e,t)=>{for(var i in t)c4(e,i,{get:t[i],enumerable:!0})},net=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function S_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var td={exports:{}},C_=td.exports,qy;function T_(){return qy||(qy=1,(function(e,t){(function(i,r){e.exports=r()})(C_,(function(){var i=1e3,r=6e4,s=36e5,o="millisecond",a="second",n="minute",l="hour",c="day",h="week",d="month",u="quarter",p="year",f="date",g="Invalid Date",m=/^(\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,w={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(D){var O=["th","st","nd","rd"],M=D%100;return"["+D+(O[(M-20)%10]||O[M]||O[0])+"]"}},S=function(D,O,M){var X=String(D);return!X||X.length>=O?D:""+Array(O+1-X.length).join(M)+D},A={s:S,z:function(D){var O=-D.utcOffset(),M=Math.abs(O),X=Math.floor(M/60),G=M%60;return(O<=0?"+":"-")+S(X,2,"0")+":"+S(G,2,"0")},m:function D(O,M){if(O.date()<M.date())return-D(M,O);var X=12*(M.year()-O.year())+(M.month()-O.month()),G=O.clone().add(X,d),nt=M-G<0,Y=O.clone().add(X+(nt?-1:1),d);return+(-(X+(M-G)/(nt?G-Y:Y-G))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:d,y:p,w:h,d:c,D:f,h:l,m:n,s:a,ms:o,Q:u}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},C="en",E={};E[C]=w;var z="$isDayjsObject",R=function(D){return D instanceof W||!(!D||!D[z])},V=function D(O,M,X){var G;if(!O)return C;if(typeof O=="string"){var nt=O.toLowerCase();E[nt]&&(G=nt),M&&(E[nt]=M,G=nt);var Y=O.split("-");if(!G&&Y.length>1)return D(Y[0])}else{var ct=O.name;E[ct]=O,G=ct}return!X&&G&&(C=G),G||!X&&C},F=function(D,O){if(R(D))return D.clone();var M=typeof O=="object"?O:{};return M.date=D,M.args=arguments,new W(M)},H=A;H.l=V,H.i=R,H.w=function(D,O){return F(D,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var W=(function(){function D(M){this.$L=V(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[z]=!0}var O=D.prototype;return O.parse=function(M){this.$d=(function(X){var G=X.date,nt=X.utc;if(G===null)return new Date(NaN);if(H.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var Y=G.match(m);if(Y){var ct=Y[2]-1||0,dt=(Y[7]||"0").substring(0,3);return nt?new Date(Date.UTC(Y[1],ct,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,dt)):new Date(Y[1],ct,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,dt)}}return new Date(G)})(M),this.init()},O.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},O.$utils=function(){return H},O.isValid=function(){return this.$d.toString()!==g},O.isSame=function(M,X){var G=F(M);return this.startOf(X)<=G&&G<=this.endOf(X)},O.isAfter=function(M,X){return F(M)<this.startOf(X)},O.isBefore=function(M,X){return this.endOf(X)<F(M)},O.$g=function(M,X,G){return H.u(M)?this[X]:this.set(G,M)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(M,X){var G=this,nt=!!H.u(X)||X,Y=H.p(M),ct=function(rt,zt){var ot=H.w(G.$u?Date.UTC(G.$y,zt,rt):new Date(G.$y,zt,rt),G);return nt?ot:ot.endOf(c)},dt=function(rt,zt){return H.w(G.toDate()[rt].apply(G.toDate("s"),(nt?[0,0,0,0]:[23,59,59,999]).slice(zt)),G)},tt=this.$W,mt=this.$M,ft=this.$D,kt="set"+(this.$u?"UTC":"");switch(Y){case p:return nt?ct(1,0):ct(31,11);case d:return nt?ct(1,mt):ct(0,mt+1);case h:var j=this.$locale().weekStart||0,ht=(tt<j?tt+7:tt)-j;return ct(nt?ft-ht:ft+(6-ht),mt);case c:case f:return dt(kt+"Hours",0);case l:return dt(kt+"Minutes",1);case n:return dt(kt+"Seconds",2);case a:return dt(kt+"Milliseconds",3);default:return this.clone()}},O.endOf=function(M){return this.startOf(M,!1)},O.$set=function(M,X){var G,nt=H.p(M),Y="set"+(this.$u?"UTC":""),ct=(G={},G[c]=Y+"Date",G[f]=Y+"Date",G[d]=Y+"Month",G[p]=Y+"FullYear",G[l]=Y+"Hours",G[n]=Y+"Minutes",G[a]=Y+"Seconds",G[o]=Y+"Milliseconds",G)[nt],dt=nt===c?this.$D+(X-this.$W):X;if(nt===d||nt===p){var tt=this.clone().set(f,1);tt.$d[ct](dt),tt.init(),this.$d=tt.set(f,Math.min(this.$D,tt.daysInMonth())).$d}else ct&&this.$d[ct](dt);return this.init(),this},O.set=function(M,X){return this.clone().$set(M,X)},O.get=function(M){return this[H.p(M)]()},O.add=function(M,X){var G,nt=this;M=Number(M);var Y=H.p(X),ct=function(mt){var ft=F(nt);return H.w(ft.date(ft.date()+Math.round(mt*M)),nt)};if(Y===d)return this.set(d,this.$M+M);if(Y===p)return this.set(p,this.$y+M);if(Y===c)return ct(1);if(Y===h)return ct(7);var dt=(G={},G[n]=r,G[l]=s,G[a]=i,G)[Y]||1,tt=this.$d.getTime()+M*dt;return H.w(tt,this)},O.subtract=function(M,X){return this.add(-1*M,X)},O.format=function(M){var X=this,G=this.$locale();if(!this.isValid())return G.invalidDate||g;var nt=M||"YYYY-MM-DDTHH:mm:ssZ",Y=H.z(this),ct=this.$H,dt=this.$m,tt=this.$M,mt=G.weekdays,ft=G.months,kt=G.meridiem,j=function(zt,ot,Ht,Rt){return zt&&(zt[ot]||zt(X,nt))||Ht[ot].slice(0,Rt)},ht=function(zt){return H.s(ct%12||12,zt,"0")},rt=kt||function(zt,ot,Ht){var Rt=zt<12?"AM":"PM";return Ht?Rt.toLowerCase():Rt};return nt.replace(x,(function(zt,ot){return ot||(function(Ht){switch(Ht){case"YY":return String(X.$y).slice(-2);case"YYYY":return H.s(X.$y,4,"0");case"M":return tt+1;case"MM":return H.s(tt+1,2,"0");case"MMM":return j(G.monthsShort,tt,ft,3);case"MMMM":return j(ft,tt);case"D":return X.$D;case"DD":return H.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return j(G.weekdaysMin,X.$W,mt,2);case"ddd":return j(G.weekdaysShort,X.$W,mt,3);case"dddd":return mt[X.$W];case"H":return String(ct);case"HH":return H.s(ct,2,"0");case"h":return ht(1);case"hh":return ht(2);case"a":return rt(ct,dt,!0);case"A":return rt(ct,dt,!1);case"m":return String(dt);case"mm":return H.s(dt,2,"0");case"s":return String(X.$s);case"ss":return H.s(X.$s,2,"0");case"SSS":return H.s(X.$ms,3,"0");case"Z":return Y}return null})(zt)||Y.replace(":","")}))},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(M,X,G){var nt,Y=this,ct=H.p(X),dt=F(M),tt=(dt.utcOffset()-this.utcOffset())*r,mt=this-dt,ft=function(){return H.m(Y,dt)};switch(ct){case p:nt=ft()/12;break;case d:nt=ft();break;case u:nt=ft()/3;break;case h:nt=(mt-tt)/6048e5;break;case c:nt=(mt-tt)/864e5;break;case l:nt=mt/s;break;case n:nt=mt/r;break;case a:nt=mt/i;break;default:nt=mt}return G?nt:H.a(nt)},O.daysInMonth=function(){return this.endOf(d).$D},O.$locale=function(){return E[this.$L]},O.locale=function(M,X){if(!M)return this.$L;var G=this.clone(),nt=V(M,X,!0);return nt&&(G.$L=nt),G},O.clone=function(){return H.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},D})(),U=W.prototype;return F.prototype=U,[["$ms",o],["$s",a],["$m",n],["$H",l],["$W",c],["$M",d],["$y",p],["$D",f]].forEach((function(D){U[D[1]]=function(O){return this.$g(O,D[0],D[1])}})),F.extend=function(D,O){return D.$i||(D(O,W,F),D.$i=!0),F},F.locale=V,F.isDayjs=R,F.unix=function(D){return F(1e3*D)},F.en=E[C],F.Ls=E,F.p={},F}))})(td)),td.exports}var $_=T_();const M_=S_($_);var co={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},vt={trace:b((...e)=>{},"trace"),debug:b((...e)=>{},"debug"),info:b((...e)=>{},"info"),warn:b((...e)=>{},"warn"),error:b((...e)=>{},"error"),fatal:b((...e)=>{},"fatal")},pm=b(function(e="fatal"){let t=co.fatal;typeof e=="string"?e.toLowerCase()in co&&(t=co[e]):typeof e=="number"&&(t=e),vt.trace=()=>{},vt.debug=()=>{},vt.info=()=>{},vt.warn=()=>{},vt.error=()=>{},vt.fatal=()=>{},t<=co.fatal&&(vt.fatal=console.error?console.error.bind(console,Xr("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Xr("FATAL"))),t<=co.error&&(vt.error=console.error?console.error.bind(console,Xr("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Xr("ERROR"))),t<=co.warn&&(vt.warn=console.warn?console.warn.bind(console,Xr("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Xr("WARN"))),t<=co.info&&(vt.info=console.info?console.info.bind(console,Xr("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Xr("INFO"))),t<=co.debug&&(vt.debug=console.debug?console.debug.bind(console,Xr("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xr("DEBUG"))),t<=co.trace&&(vt.trace=console.debug?console.debug.bind(console,Xr("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Xr("TRACE")))},"setLogLevel"),Xr=b(e=>`%c${M_().format("ss.SSS")} : ${e} : `,"format");const ed={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,i)=>(i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e),hsl2rgb:({h:e,s:t,l:i},r)=>{if(!t)return i*2.55;e/=360,t/=100,i/=100;const s=i<.5?i*(1+t):i+t-i*t,o=2*i-s;switch(r){case"r":return ed.hue2rgb(o,s,e+1/3)*255;case"g":return ed.hue2rgb(o,s,e)*255;case"b":return ed.hue2rgb(o,s,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:i},r)=>{e/=255,t/=255,i/=255;const s=Math.max(e,t,i),o=Math.min(e,t,i),a=(s+o)/2;if(r==="l")return a*100;if(s===o)return 0;const n=s-o,l=a>.5?n/(2-s-o):n/(s+o);if(r==="s")return l*100;switch(s){case e:return((t-i)/n+(t<i?6:0))*60;case t:return((i-e)/n+2)*60;case i:return((e-t)/n+4)*60;default:return-1}}},A_={clamp:(e,t,i)=>t>i?Math.min(t,Math.max(i,e)):Math.min(i,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},B_={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},ge={channel:ed,lang:A_,unit:B_},Zo={};for(let e=0;e<=255;e++)Zo[e]=ge.unit.dec2hex(e);const Zi={ALL:0,RGB:1,HSL:2};let __=class{constructor(){this.type=Zi.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=Zi.ALL}is(t){return this.type===t}};class L_{constructor(t,i){this.color=i,this.changed=!1,this.data=t,this.type=new __}set(t,i){return this.color=i,this.changed=!1,this.data=t,this.type.type=Zi.ALL,this}_ensureHSL(){const t=this.data,{h:i,s:r,l:s}=t;i===void 0&&(t.h=ge.channel.rgb2hsl(t,"h")),r===void 0&&(t.s=ge.channel.rgb2hsl(t,"s")),s===void 0&&(t.l=ge.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r:i,g:r,b:s}=t;i===void 0&&(t.r=ge.channel.hsl2rgb(t,"r")),r===void 0&&(t.g=ge.channel.hsl2rgb(t,"g")),s===void 0&&(t.b=ge.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,i=t.r;return!this.type.is(Zi.HSL)&&i!==void 0?i:(this._ensureHSL(),ge.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,i=t.g;return!this.type.is(Zi.HSL)&&i!==void 0?i:(this._ensureHSL(),ge.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,i=t.b;return!this.type.is(Zi.HSL)&&i!==void 0?i:(this._ensureHSL(),ge.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,i=t.h;return!this.type.is(Zi.RGB)&&i!==void 0?i:(this._ensureRGB(),ge.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,i=t.s;return!this.type.is(Zi.RGB)&&i!==void 0?i:(this._ensureRGB(),ge.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,i=t.l;return!this.type.is(Zi.RGB)&&i!==void 0?i:(this._ensureRGB(),ge.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Zi.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Zi.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Zi.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Zi.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Zi.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Zi.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Ru=new L_({r:0,g:0,b:0,a:0},"transparent"),Ln={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Ln.re);if(!t)return;const i=t[1],r=parseInt(i,16),s=i.length,o=s%4===0,a=s>4,n=a?1:17,l=a?8:4,c=o?0:-1,h=a?255:15;return Ru.set({r:(r>>l*(c+3)&h)*n,g:(r>>l*(c+2)&h)*n,b:(r>>l*(c+1)&h)*n,a:o?(r&h)*n/255:1},e)},stringify:e=>{const{r:t,g:i,b:r,a:s}=e;return s<1?`#${Zo[Math.round(t)]}${Zo[Math.round(i)]}${Zo[Math.round(r)]}${Zo[Math.round(s*255)]}`:`#${Zo[Math.round(t)]}${Zo[Math.round(i)]}${Zo[Math.round(r)]}`}},Fa={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(Fa.hueRe);if(t){const[,i,r]=t;switch(r){case"grad":return ge.channel.clamp.h(parseFloat(i)*.9);case"rad":return ge.channel.clamp.h(parseFloat(i)*180/Math.PI);case"turn":return ge.channel.clamp.h(parseFloat(i)*360)}}return ge.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const i=e.match(Fa.re);if(!i)return;const[,r,s,o,a,n]=i;return Ru.set({h:Fa._hue2deg(r),s:ge.channel.clamp.s(parseFloat(s)),l:ge.channel.clamp.l(parseFloat(o)),a:a?ge.channel.clamp.a(n?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:i,l:r,a:s}=e;return s<1?`hsla(${ge.lang.round(t)}, ${ge.lang.round(i)}%, ${ge.lang.round(r)}%, ${s})`:`hsl(${ge.lang.round(t)}, ${ge.lang.round(i)}%, ${ge.lang.round(r)}%)`}},hc={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=hc.colors[e];if(t)return Ln.parse(t)},stringify:e=>{const t=Ln.stringify(e);for(const i in hc.colors)if(hc.colors[i]===t)return i}},Vl={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 i=e.match(Vl.re);if(!i)return;const[,r,s,o,a,n,l,c,h]=i;return Ru.set({r:ge.channel.clamp.r(s?parseFloat(r)*2.55:parseFloat(r)),g:ge.channel.clamp.g(a?parseFloat(o)*2.55:parseFloat(o)),b:ge.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?ge.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:i,b:r,a:s}=e;return s<1?`rgba(${ge.lang.round(t)}, ${ge.lang.round(i)}, ${ge.lang.round(r)}, ${ge.lang.round(s)})`:`rgb(${ge.lang.round(t)}, ${ge.lang.round(i)}, ${ge.lang.round(r)})`}},Ys={format:{keyword:hc,hex:Ln,rgb:Vl,rgba:Vl,hsl:Fa,hsla:Fa},parse:e=>{if(typeof e!="string")return e;const t=Ln.parse(e)||Vl.parse(e)||Fa.parse(e)||hc.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Zi.HSL)||e.data.r===void 0?Fa.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Vl.stringify(e):Ln.stringify(e)},h4=(e,t)=>{const i=Ys.parse(e);for(const r in t)i[r]=ge.channel.clamp[r](t[r]);return Ys.stringify(i)},oa=(e,t,i=0,r=1)=>{if(typeof e!="number")return h4(e,{a:t});const s=Ru.set({r:ge.channel.clamp.r(e),g:ge.channel.clamp.g(t),b:ge.channel.clamp.b(i),a:ge.channel.clamp.a(r)});return Ys.stringify(s)},P_=e=>{const{r:t,g:i,b:r}=Ys.parse(e),s=.2126*ge.channel.toLinear(t)+.7152*ge.channel.toLinear(i)+.0722*ge.channel.toLinear(r);return ge.lang.round(s)},E_=e=>P_(e)>=.5,Mr=e=>!E_(e),d4=(e,t,i)=>{const r=Ys.parse(e),s=r[t],o=ge.channel.clamp[t](s+i);return s!==o&&(r[t]=o),Ys.stringify(r)},st=(e,t)=>d4(e,"l",t),at=(e,t)=>d4(e,"l",-t),B=(e,t)=>{const i=Ys.parse(e),r={};for(const s in t)t[s]&&(r[s]=i[s]+t[s]);return h4(e,r)},R_=(e,t,i=50)=>{const{r,g:s,b:o,a}=Ys.parse(e),{r:n,g:l,b:c,a:h}=Ys.parse(t),d=i/100,u=d*2-1,p=a-h,g=((u*p===-1?u:(u+p)/(1+u*p))+1)/2,m=1-g,x=r*g+n*m,w=s*g+l*m,S=o*g+c*m,A=a*d+h*(1-d);return oa(x,w,S,A)},Q=(e,t=100)=>{const i=Ys.parse(e);return i.r=255-i.r,i.g=255-i.g,i.b=255-i.b,R_(i,e,t)};function Hy(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}function I_(e){if(Array.isArray(e))return e}function z_(e,t){var i=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(i!=null){var r,s,o,a,n=[],l=!0,c=!1;try{if(o=(i=i.call(e)).next,t!==0)for(;!(l=(r=o.call(i)).done)&&(n.push(r.value),n.length!==t);l=!0);}catch(h){c=!0,s=h}finally{try{if(!l&&i.return!=null&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw s}}return n}}function D_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1387
1387
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function F_(e,t){return I_(e)||z_(e,t)||O_(e,t)||D_()}function O_(e,t){if(e){if(typeof e=="string")return Hy(e,t);var i={}.toString.call(e).slice(8,-1);return i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set"?Array.from(e):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Hy(e,t):void 0}}const u4=Object.entries,jy=Object.setPrototypeOf,N_=Object.isFrozen,W_=Object.getPrototypeOf,q_=Object.getOwnPropertyDescriptor;let _i=Object.freeze,Oi=Object.seal,Cn=Object.create,p4=typeof Reflect<"u"&&Reflect,wf=p4.apply,kf=p4.construct;_i||(_i=function(t){return t});Oi||(Oi=function(t){return t});wf||(wf=function(t,i){for(var r=arguments.length,s=new Array(r>2?r-2:0),o=2;o<r;o++)s[o-2]=arguments[o];return t.apply(i,s)});kf||(kf=function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];return new t(...r)});const Pa=Si(Array.prototype.forEach),H_=Si(Array.prototype.lastIndexOf),Uy=Si(Array.prototype.pop),Ll=Si(Array.prototype.push),j_=Si(Array.prototype.splice),Pn=Array.isArray,Kl=Si(String.prototype.toLowerCase),Wp=Si(String.prototype.toString),Yy=Si(String.prototype.match),Pl=Si(String.prototype.replace),Gy=Si(String.prototype.indexOf),U_=Si(String.prototype.trim),Y_=Si(Number.prototype.toString),G_=Si(Boolean.prototype.toString),Xy=typeof BigInt>"u"?null:Si(BigInt.prototype.toString),Vy=typeof Symbol>"u"?null:Si(Symbol.prototype.toString),kr=Si(Object.prototype.hasOwnProperty),El=Si(Object.prototype.toString),Ki=Si(RegExp.prototype.test),Ma=X_(TypeError);function Si(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var i=arguments.length,r=new Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];return wf(e,t,r)}}function X_(e){return function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return kf(e,i)}}function Re(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Kl;if(jy&&jy(e,null),!Pn(t))return e;let r=t.length;for(;r--;){let s=t[r];if(typeof s=="string"){const o=i(s);o!==s&&(N_(t)||(t[r]=o),s=o)}e[s]=!0}return e}function V_(e){for(let t=0;t<e.length;t++)kr(e,t)||(e[t]=null);return e}function zr(e){const t=Cn(null);for(const r of u4(e)){var i=F_(r,2);const s=i[0],o=i[1];kr(e,s)&&(Pn(o)?t[s]=V_(o):o&&typeof o=="object"&&o.constructor===Object?t[s]=zr(o):t[s]=o)}return t}function K_(e){switch(typeof e){case"string":return e;case"number":return Y_(e);case"boolean":return G_(e);case"bigint":return Xy?Xy(e):"0";case"symbol":return Vy?Vy(e):"Symbol()";case"undefined":return El(e);case"function":case"object":{if(e===null)return El(e);const t=e,i=Vr(t,"toString");if(typeof i=="function"){const r=i(t);return typeof r=="string"?r:El(r)}return El(e)}default:return El(e)}}function Vr(e,t){for(;e!==null;){const r=q_(e,t);if(r){if(r.get)return Si(r.get);if(typeof r.value=="function")return Si(r.value)}e=W_(e)}function i(){return null}return i}function Z_(e){try{return Ki(e,""),!0}catch{return!1}}const Ky=_i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),qp=_i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Hp=_i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Q_=_i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),jp=_i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),J_=_i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Zy=_i(["#text"]),Qy=_i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Up=_i(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Jy=_i(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fh=_i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),tL=Oi(/{{[\w\W]*|^[\w\W]*}}/g),eL=Oi(/<%[\w\W]*|^[\w\W]*%>/g),iL=Oi(/\${[\w\W]*/g),rL=Oi(/^data-[\-\w.\u00B7-\uFFFF]+$/),sL=Oi(/^aria-[\-\w]+$/),tx=Oi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),oL=Oi(/^(?:\w+script|data):/i),aL=Oi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nL=Oi(/^html$/i),lL=Oi(/^[a-z][.\w]*(-[.\w]+)+$/i),ex=Oi(/<[/\w!]/g),ix=Oi(/<[/\w]/g),cL=Oi(/<\/no(script|embed|frames)/i),hL=Oi(/\/>/i),Er={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},f4=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],dL=_i(Re({},f4)),uL=(function(){const e={};return Pa(f4,t=>{e[t]=Oi(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),_i(e)})(),pL=function(){return typeof window>"u"?null:window},fL=function(t,i){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";i&&i.hasAttribute(s)&&(r=i.getAttribute(s));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},rx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},jo=function(t,i,r,s){return kr(t,i)&&Pn(t[i])?Re(s.base?zr(s.base):{},t[i],s.transform):r},Yp=function(t,i,r){const s=kr(t,i)?t[i]:void 0;return s&&typeof s=="object"?zr(s):r()};function g4(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pL();const t=Et=>g4(Et);if(t.version="3.4.15",t.removed=[],!e||!e.document||e.document.nodeType!==Er.document||!e.Element)return t.isSupported=!1,t;let i=e.document;const r=i,s=r.currentScript;e.DocumentFragment;const o=e.HTMLTemplateElement,a=e.Node,n=e.Element,l=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const h=e.DOMParser,d=e.trustedTypes,u=n.prototype,p=Vr(u,"cloneNode"),f=Vr(u,"remove"),g=Vr(u,"removeAttributeNode"),m=Vr(u,"nextSibling"),x=Vr(u,"childNodes"),w=Vr(u,"parentNode"),S=Vr(u,"shadowRoot"),A=Vr(u,"attributes"),C=a&&a.prototype?Vr(a.prototype,"nodeType"):null,E=a&&a.prototype?Vr(a.prototype,"nodeName"):null,z=a&&a.prototype?Vr(a.prototype,"ownerDocument"):null,R=function(I){return C?C(I):I.nodeType},V=function(I){return E?E(I):I.nodeName};if(typeof o=="function"){const Et=i.createElement("template");Et.content&&Et.content.ownerDocument&&(i=Et.content.ownerDocument)}let F,H="",W,U=!1,D=0;const O=function(){if(D>0)throw Ma('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},M=function(I){O(),D++;try{return F.createHTML(I)}finally{D--}},X=function(I){O(),D++;try{return F.createScriptURL(I)}finally{D--}},G=function(){return U||(W=fL(d,s),U=!0),W},nt=i,Y=nt.implementation,ct=nt.createNodeIterator,dt=nt.createDocumentFragment,tt=nt.getElementsByTagName,mt=r.importNode;let ft=rx();t.isSupported=typeof u4=="function"&&typeof w=="function"&&Y&&Y.createHTMLDocument!==void 0;const kt=tL,j=eL,ht=iL,rt=rL,zt=sL,ot=oL,Ht=aL,Rt=lL;let ut=tx,Wt=null;const Ft=Re({},[...Ky,...qp,...Hp,...jp,...Zy]);let gt=null;const ie=Re({},[...Qy,...Up,...Jy,...fh]);let re=Object.seal(Cn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Le=null,Ee=null;const Se=Object.seal(Cn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Te=!0,si=!0,li=!1,Xi=!0,Ti=!1,y=!0,Z=!1,pt=!1,yt=null,lt=null,_t=!1,_=!1,et=!1,Tt=!1,bt=!0,xt=!1;const At="user-content-";let St=!0,Xt=!1,qt={},Qt=null;const ae=Re({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let $e=null;const Ye=Re({},["audio","video","img","source","image","track"]);let Cl=null;const Wo=Re({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_s="http://www.w3.org/1998/Math/MathML",rh="http://www.w3.org/2000/svg",Ls="http://www.w3.org/1999/xhtml";let on=Ls,mp=!1,bp=null;const f7=Re({},[_s,rh,Ls],Wp),ob=_i(["mi","mo","mn","ms","mtext"]);let yp=Re({},ob);const ab=_i(["annotation-xml"]);let xp=Re({},ab);const g7=Re({},["title","style","font","a","script"]);let Tl=null;const m7=["application/xhtml+xml","text/html"],b7="text/html";let pi=null,an=null;const y7=i.createElement("form"),nb=function(I){return I instanceof RegExp||I instanceof Function},vp=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(an&&an===I)return;(!I||typeof I!="object")&&(I={}),I=zr(I),Tl=m7.indexOf(I.PARSER_MEDIA_TYPE)===-1?b7:I.PARSER_MEDIA_TYPE,pi=Tl==="application/xhtml+xml"?Wp:Kl,Wt=jo(I,"ALLOWED_TAGS",Ft,{transform:pi}),gt=jo(I,"ALLOWED_ATTR",ie,{transform:pi}),bp=jo(I,"ALLOWED_NAMESPACES",f7,{transform:Wp}),Cl=jo(I,"ADD_URI_SAFE_ATTR",Wo,{transform:pi,base:Wo}),$e=jo(I,"ADD_DATA_URI_TAGS",Ye,{transform:pi,base:Ye}),Qt=jo(I,"FORBID_CONTENTS",ae,{transform:pi}),Le=jo(I,"FORBID_TAGS",zr({}),{transform:pi}),Ee=jo(I,"FORBID_ATTR",zr({}),{transform:pi}),qt=kr(I,"USE_PROFILES")?I.USE_PROFILES&&typeof I.USE_PROFILES=="object"?zr(I.USE_PROFILES):I.USE_PROFILES:!1,Te=I.ALLOW_ARIA_ATTR!==!1,si=I.ALLOW_DATA_ATTR!==!1,li=I.ALLOW_UNKNOWN_PROTOCOLS||!1,Xi=I.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ti=I.SAFE_FOR_TEMPLATES||!1,y=I.SAFE_FOR_XML!==!1,Z=I.WHOLE_DOCUMENT||!1,_=I.RETURN_DOM||!1,et=I.RETURN_DOM_FRAGMENT||!1,Tt=I.RETURN_TRUSTED_TYPE||!1,_t=I.FORCE_BODY||!1,bt=I.SANITIZE_DOM!==!1,xt=I.SANITIZE_NAMED_PROPS||!1,St=I.KEEP_CONTENT!==!1,Xt=I.IN_PLACE||!1,ut=Z_(I.ALLOWED_URI_REGEXP)?I.ALLOWED_URI_REGEXP:tx,on=typeof I.NAMESPACE=="string"?I.NAMESPACE:Ls,yp=Yp(I,"MATHML_TEXT_INTEGRATION_POINTS",()=>Re({},ob)),xp=Yp(I,"HTML_INTEGRATION_POINTS",()=>Re({},ab));const J=Yp(I,"CUSTOM_ELEMENT_HANDLING",()=>Cn(null));if(re=Cn(null),kr(J,"tagNameCheck")&&nb(J.tagNameCheck)&&(re.tagNameCheck=J.tagNameCheck),kr(J,"attributeNameCheck")&&nb(J.attributeNameCheck)&&(re.attributeNameCheck=J.attributeNameCheck),kr(J,"allowCustomizedBuiltInElements")&&typeof J.allowCustomizedBuiltInElements=="boolean"&&(re.allowCustomizedBuiltInElements=J.allowCustomizedBuiltInElements),Oi(re),Ti&&(si=!1),et&&(_=!0),qt&&(Wt=Re({},Zy),gt=Cn(null),qt.html===!0&&(Re(Wt,Ky),Re(gt,Qy)),qt.svg===!0&&(Re(Wt,qp),Re(gt,Up),Re(gt,fh)),qt.svgFilters===!0&&(Re(Wt,Hp),Re(gt,Up),Re(gt,fh)),qt.mathMl===!0&&(Re(Wt,jp),Re(gt,Jy),Re(gt,fh))),Se.tagCheck=null,Se.attributeCheck=null,kr(I,"ADD_TAGS")&&(typeof I.ADD_TAGS=="function"?Se.tagCheck=I.ADD_TAGS:Pn(I.ADD_TAGS)&&(Wt===Ft&&(Wt=zr(Wt)),Re(Wt,I.ADD_TAGS,pi))),kr(I,"ADD_ATTR")&&(typeof I.ADD_ATTR=="function"?Se.attributeCheck=I.ADD_ATTR:Pn(I.ADD_ATTR)&&(gt===ie&&(gt=zr(gt)),Re(gt,I.ADD_ATTR,pi))),kr(I,"ADD_FORBID_CONTENTS")&&Pn(I.ADD_FORBID_CONTENTS)&&(Qt===ae&&(Qt=zr(Qt)),Re(Qt,I.ADD_FORBID_CONTENTS,pi)),St&&(Wt["#text"]=!0),Z&&Re(Wt,["html","head","body"]),Wt.table&&(Re(Wt,["tbody"]),delete Le.tbody),I.TRUSTED_TYPES_POLICY){if(typeof I.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ma('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof I.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ma('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const $t=F;F=I.TRUSTED_TYPES_POLICY;try{H=M("")}catch(Vt){throw F=$t,Vt}}else I.TRUSTED_TYPES_POLICY===null?(F=void 0,H=""):(F===void 0&&(F=G()),F&&typeof H=="string"&&(H=M("")));_i&&_i(I),an=I},lb=Re({},[...qp,...Hp,...Q_]),cb=Re({},[...jp,...J_]),x7=function(I,J,$t){return J.namespaceURI===Ls?I==="svg":J.namespaceURI===_s?I==="svg"&&($t==="annotation-xml"||yp[$t]):!!lb[I]},v7=function(I,J,$t){return J.namespaceURI===Ls?I==="math":J.namespaceURI===rh?I==="math"&&xp[$t]:!!cb[I]},w7=function(I,J,$t){return J.namespaceURI===rh&&!xp[$t]||J.namespaceURI===_s&&!yp[$t]?!1:!cb[I]&&(g7[I]||!lb[I])},k7=function(I){let J=w(I);(!J||!J.tagName)&&(J={namespaceURI:on,tagName:"template"});const $t=Kl(I.tagName),Vt=Kl(J.tagName);return bp[I.namespaceURI]?I.namespaceURI===rh?x7($t,J,Vt):I.namespaceURI===_s?v7($t,J,Vt):I.namespaceURI===Ls?w7($t,J,Vt):!!(Tl==="application/xhtml+xml"&&bp[I.namespaceURI]):!1},qo=function(I){Ll(t.removed,{element:I});try{w(I).removeChild(I)}catch{if(f(I),!w(I))throw Ma("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},hb=function(I,J,$t){try{g(I,J)}catch{try{I.removeAttribute($t)}catch{}}},sh=function(I){oh(I);const J=x(I);if(J){const Vt=[];Pa(J,se=>{Ll(Vt,se)}),Pa(Vt,se=>{try{f(se)}catch{}})}const $t=A(I);if($t)for(let Vt=$t.length-1;Vt>=0;--Vt){const se=$t[Vt],fe=se&&se.name;typeof fe=="string"&&hb(I,se,fe)}},Sa=function(I,J,$t){if(!$t)try{$t=J.getAttributeNode(I)}catch{$t=null}Ll(t.removed,{attribute:$t||null,from:J});try{$t?g(J,$t):J.removeAttribute(I)}catch{try{J.removeAttribute(I)}catch{}}if(I==="is")if(_||et)try{qo(J)}catch{}else try{J.setAttribute(I,"")}catch{}},S7=function(I){const J=A(I);if(J)for(let $t=J.length-1;$t>=0;--$t){const Vt=J[$t],se=Vt&&Vt.name;typeof se!="string"||gt[pi(se)]||hb(I,Vt,se)}},oh=function(I){const J=[I];for(;J.length>0;){const $t=J.pop();R($t)===Er.element&&S7($t);const se=x($t);if(se)for(let fe=se.length-1;fe>=0;--fe)J.push(se[fe])}},db=function(I,J){return y?I==="patchsrc"?!0:I==="for"&&J!=="label"&&J!=="output":!1},C7=function(I){if(!y)return;const J=[I];for(;J.length>0;){const $t=J.pop(),Vt=R($t);if(Vt===Er.processingInstruction||Vt===Er.comment&&Ki(ix,$t.data)){try{f($t)}catch{}continue}if(Vt===Er.element){const fe=$t,Ze=pi(V($t));try{fe.hasAttribute&&fe.hasAttribute("patchsrc")&&fe.removeAttribute("patchsrc"),fe.hasAttribute&&fe.hasAttribute("for")&&db("for",Ze)&&fe.removeAttribute("for")}catch{}}const se=x($t);if(se)for(let fe=se.length-1;fe>=0;--fe)J.push(se[fe])}},ub=function(I){let J=null,$t=null;if(_t)I="<remove></remove>"+I;else{const fe=Yy(I,/^[\r\n\t ]+/);$t=fe&&fe[0]}Tl==="application/xhtml+xml"&&on===Ls&&(I='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+I+"</body></html>");const Vt=F?M(I):I;if(on===Ls)try{J=new h().parseFromString(Vt,Tl)}catch{}if(!J||!J.documentElement){J=Y.createDocument(on,"template",null);try{J.documentElement.innerHTML=mp?H:Vt}catch{}}const se=J.body||J.documentElement;return I&&$t&&se.insertBefore(i.createTextNode($t),se.childNodes[0]||null),on===Ls?tt.call(J,Z?"html":"body")[0]:Z?J.documentElement:se},pb=function(I){const J=z?z(I):I.ownerDocument;return ct.call(J||I,I,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ah=function(I){return I=Pl(I,kt," "),I=Pl(I,j," "),I=Pl(I,ht," "),I},wp=function(I){var J;I.normalize();const $t=z?z(I):I.ownerDocument,Vt=ct.call($t||I,I,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let se=Vt.nextNode();for(;se;)se.data=ah(se.data),se=Vt.nextNode();const fe=(J=I.querySelectorAll)===null||J===void 0?void 0:J.call(I,"template");fe&&Pa(fe,Ze=>{nn(Ze.content)&&wp(Ze.content)})},nh=function(I){const J=E?E(I):null;return typeof J!="string"||pi(J)!=="form"?!1:typeof I.nodeName!="string"||typeof I.textContent!="string"||typeof I.removeChild!="function"||I.attributes!==A(I)||typeof I.removeAttribute!="function"||typeof I.removeAttributeNode!="function"||typeof I.getAttributeNode!="function"||typeof I.setAttribute!="function"||typeof I.namespaceURI!="string"||typeof I.insertBefore!="function"||typeof I.hasChildNodes!="function"||I.nodeType!==C(I)||I.childNodes!==x(I)},nn=function(I){if(!C||typeof I!="object"||I===null)return!1;try{return C(I)===Er.documentFragment}catch{return!1}},$l=function(I){if(!C||typeof I!="object"||I===null)return!1;try{return typeof C(I)=="number"}catch{return!1}};function Ps(Et,I,J){Et.length!==0&&Pa(Et,$t=>{$t.call(t,I,J,an)})}const T7=function(I,J){return!!(y&&I.hasChildNodes()&&!$l(I.firstElementChild)&&Ki(ex,I.textContent)&&Ki(ex,I.innerHTML)||y&&I.namespaceURI===Ls&&dL[J]&&($l(I.firstElementChild)||typeof I.textContent=="string"&&Ki(uL[J],I.textContent))||I.nodeType===Er.processingInstruction||y&&I.nodeType===Er.comment&&Ki(ix,I.data))},lh=function(I,J){if(I instanceof RegExp)return Ki(I,J);if(I instanceof Function){for(var $t=arguments.length,Vt=new Array($t>2?$t-2:0),se=2;se<$t;se++)Vt[se-2]=arguments[se];return!!I(J,...Vt)}return!1},$7=function(I,J,$t){if(!Le[J]&&yb(J)&&lh(re.tagNameCheck,J))return!1;if(St&&!Qt[J]){const Vt=w(I),se=x(I);if(se&&Vt){const fe=se.length;for(let Ze=fe-1;Ze>=0;--Ze){const oi=I===$t?p(se[Ze],!0):se[Ze];Vt.insertBefore(oi,m(I))}}}return qo(I),!0},fb=function(I,J,$t,Vt){return I.length===0?J:J===$t||J===Vt?zr(J):J},gb=function(I,J){return I===J||w(I)!==null?!1:(Xt&&oh(I),!0)},mb=function(I,J){if(Ps(ft.beforeSanitizeElements,I,null),gb(I,J))return!0;if(nh(I))return qo(I),!0;const $t=pi(V(I));if(Wt=fb(ft.uponSanitizeElement,Wt,Ft,yt),Ps(ft.uponSanitizeElement,I,{tagName:$t,allowedTags:Wt}),gb(I,J))return!0;if(T7(I,$t))return qo(I),!0;if(Le[$t]||!(Se.tagCheck instanceof Function&&Se.tagCheck($t))&&!Wt[$t]){const se=$7(I,$t,J);return se===!1&&Ps(ft.afterSanitizeElements,I,null),se}if(R(I)===Er.element&&!k7(I)||($t==="noscript"||$t==="noembed"||$t==="noframes")&&Ki(cL,I.innerHTML))return qo(I),!0;if(Ti&&I.nodeType===Er.text){const se=ah(I.textContent);I.textContent!==se&&(Ll(t.removed,{element:I.cloneNode()}),I.textContent=se)}return Ps(ft.afterSanitizeElements,I,null),!1},bb=function(I,J,$t){if(Ee[J]||db(J,I)||bt&&(J==="id"||J==="name")&&($t in i||$t in y7))return!1;const Vt=gt[J]||Se.attributeCheck instanceof Function&&Se.attributeCheck(J,I);return si&&Ki(rt,J)||Te&&Ki(zt,J)?!0:Vt?Cl[J]||Ki(ut,Pl($t,Ht,""))||(J==="src"||J==="xlink:href"||J==="href")&&I!=="script"&&Gy($t,"data:")===0&&$e[I]||li&&!Ki(ot,Pl($t,Ht,""))?!0:!$t:yb(I)&&lh(re.tagNameCheck,I)&&lh(re.attributeNameCheck,J,I)||J==="is"&&re.allowCustomizedBuiltInElements&&lh(re.tagNameCheck,$t)},M7=Re({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),yb=function(I){return!M7[Kl(I)]&&Ki(Rt,I)},A7=function(I,J,$t,Vt){if(F&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!$t)switch(d.getAttributeType(I,J)){case"TrustedHTML":return M(Vt);case"TrustedScriptURL":return X(Vt)}return Vt},B7=function(I,J,$t,Vt){try{return $t?I.setAttributeNS($t,J,Vt):I.setAttribute(J,Vt),nh(I)?(qo(I),!1):!0}catch{return Sa(J,I),!1}},xb=function(I){Ps(ft.beforeSanitizeAttributes,I,null);const J=I.attributes;if(!J||nh(I))return;gt=fb(ft.uponSanitizeAttribute,gt,ie,lt);const $t={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:gt,forceKeepAttr:void 0};let Vt=J.length;const se=pi(I.nodeName);for(;Vt--;){const fe=J[Vt],Ze=fe.name,oi=fe.namespaceURI,xr=fe.value,vr=pi(Ze),Sp=xr;let lr=Ze==="value"?Sp:U_(Sp),vb=!1;if($t.attrName=vr,$t.attrValue=lr,$t.keepAttr=!0,$t.forceKeepAttr=void 0,Ps(ft.uponSanitizeAttribute,I,$t),lr=$t.attrValue,xt&&(vr==="id"||vr==="name")&&Gy(lr,At)!==0&&(Sa(Ze,I,fe),lr=At+lr,vb=!0),y&&Ki(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,lr)){Sa(Ze,I,fe);continue}if(vr==="attributename"&&Yy(lr,"href")){Sa(Ze,I,fe);continue}if(!$t.forceKeepAttr){if(!$t.keepAttr){Sa(Ze,I,fe);continue}if(!Xi&&Ki(hL,lr)){Sa(Ze,I,fe);continue}if(Ti&&(lr=ah(lr)),!bb(se,vr,lr)){Sa(Ze,I,fe);continue}lr=A7(se,vr,oi,lr),lr!==Sp&&B7(I,Ze,oi,lr)&&vb&&Uy(t.removed)}}Ps(ft.afterSanitizeAttributes,I,null)},ch=function(I){let J=null;const $t=pb(I);for(Ps(ft.beforeSanitizeShadowDOM,I,null);J=$t.nextNode();)if(Ps(ft.uponSanitizeShadowNode,J,null),mb(J,I),xb(J),nn(J.content)&&ch(J.content),R(J)===Er.element){const Vt=S(J);nn(Vt)&&(kp(Vt),ch(Vt))}Ps(ft.afterSanitizeShadowDOM,I,null)},kp=function(I){const J=[{node:I,shadow:null}];for(;J.length>0;){const $t=J.pop();if($t.shadow){ch($t.shadow);continue}const Vt=$t.node,fe=R(Vt)===Er.element,Ze=x(Vt);if(Ze)for(let oi=Ze.length-1;oi>=0;--oi)J.push({node:Ze[oi],shadow:null});if(fe){const oi=E?E(Vt):null;if(typeof oi=="string"&&pi(oi)==="template"){const xr=Vt.content;nn(xr)&&J.push({node:xr,shadow:null})}}if(fe){const oi=S(Vt);nn(oi)&&J.push({node:null,shadow:oi},{node:oi,shadow:null})}}};return t.sanitize=function(Et){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=null,$t=null,Vt=null,se=null;if(mp=!Et,mp&&(Et="<!-->"),typeof Et!="string"&&!$l(Et)&&(Et=K_(Et),typeof Et!="string"))throw Ma("dirty is not a string, aborting");if(!t.isSupported)return Et;pt?(Wt=yt,gt=lt):vp(I),(ft.uponSanitizeElement.length>0||ft.uponSanitizeAttribute.length>0)&&(Wt=zr(Wt)),ft.uponSanitizeAttribute.length>0&&(gt=zr(gt)),t.removed=[];const fe=Xt&&typeof Et!="string"&&$l(Et);if(fe){C7(Et);const xr=V(Et);if(typeof xr=="string"){const vr=pi(xr);if(!Wt[vr]||Le[vr])throw sh(Et),Ma("root node is forbidden and cannot be sanitized in-place")}if(nh(Et))throw sh(Et),Ma("root node is clobbered and cannot be sanitized in-place");try{kp(Et)}catch(vr){throw sh(Et),vr}}else if($l(Et))J=ub("<!---->"),$t=J.ownerDocument.importNode(Et,!0),$t.nodeType===Er.element&&$t.nodeName==="BODY"||$t.nodeName==="HTML"?J=$t:J.appendChild($t),kp(J);else{if(!_&&!Ti&&!Z&&Et.indexOf("<")===-1)return F&&Tt?M(Et):Et;if(J=ub(Et),!J)return _?null:Tt?H:""}J&&_t&&qo(J.firstChild);const Ze=fe?Et:J;try{const xr=pb(Ze);for(;Vt=xr.nextNode();)mb(Vt,Ze),xb(Vt),nn(Vt.content)&&ch(Vt.content)}catch(xr){throw fe&&(sh(Et),Pa(t.removed,vr=>{vr.element&&oh(vr.element)})),xr}if(fe)return Pa(t.removed,xr=>{xr.element&&oh(xr.element)}),Ti&&wp(Et),Et;if(_){if(Ti&&wp(J),et)for(se=dt.call(J.ownerDocument);J.firstChild;)se.appendChild(J.firstChild);else se=J;return(gt.shadowroot||gt.shadowrootmode)&&(se=mt.call(r,se,!0)),se}let oi=Z?J.outerHTML:J.innerHTML;return Z&&Wt["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&Ki(nL,J.ownerDocument.doctype.name)&&(oi="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
1388
1388
  `+oi),Ti&&(oi=ah(oi)),F&&Tt?M(oi):oi},t.setConfig=function(){let Et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vp(Et),pt=!0,yt=Wt,lt=gt},t.clearConfig=function(){an=null,pt=!1,yt=null,lt=null,F=W,H=""},t.isValidAttribute=function(Et,I,J){an||vp({});const $t=pi(Et),Vt=pi(I);return bb($t,Vt,J)},t.addHook=function(Et,I){typeof I=="function"&&kr(ft,Et)&&Ll(ft[Et],I)},t.removeHook=function(Et,I){if(kr(ft,Et)){if(I!==void 0){const J=H_(ft[Et],I);return J===-1?void 0:j_(ft[Et],J,1)[0]}return Uy(ft[Et])}},t.removeHooks=function(Et){kr(ft,Et)&&(ft[Et]=[])},t.removeAllHooks=function(){ft=rx()},t}var tl=g4(),m4=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,dc=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,gL=/\s/,mL=b(e=>{let t="",i=0,r=0;for(;r<e.length;){const s=e.indexOf("%%",r);if(s===-1)break;const o=e.indexOf(`
1389
1389
  `,s);if(o===-1)break;let a=s;for(;a>i&&gL.test(e[a-1]);)a--;t+=e.slice(i,a)+`
1390
- `,i=o+1,r=i}return t+e.slice(i)},"stripAnyComments"),Dn,b4=(Dn=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},b(Dn,"UnknownDiagramError"),Dn),Ga={},Iu=b(function(e,t){e=mL(e.replace(m4,"").replace(dc,""));for(const[i,{detector:r}]of Object.entries(Ga))if(r(e,t))return i;throw new b4(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Sf=b((...e)=>{for(const{id:t,detector:i,loader:r}of e)y4(t,i,r)},"registerLazyLoadedDiagrams"),y4=b((e,t,i)=>{Ga[e]&&vt.warn(`Detector with key ${e} already exists. Overwriting.`),Ga[e]={detector:t,loader:i},vt.debug(`Detector with key ${e} added${i?" with loader":""}`)},"addDetector"),bL=b(e=>Ga[e].loader,"getDiagramLoader"),Cf=b((e,t,{depth:i=2}={})=>{const r={depth:i};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(s=>Cf(e,s,r)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(s=>{e.includes(s)||e.push(s)}),e;if(e==null||i<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const s=e;Object.entries(t).forEach(([o,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(e,o)||Object.defineProperty(e,o,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),s[o]===void 0&&(s[o]=Array.isArray(a)?[]:{}),typeof s[o]=="object"&&(s[o]=Cf(s[o],a,{depth:i-1}))}else typeof s[o]!="object"&&(Object.hasOwn(e,o)?s[o]=a:Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),yi=Cf,Ks="#ffffff",Zs="#f2f2f2",ue=b((e,t)=>t?B(e,{s:-40,l:10}):B(e,{s:-40,l:-10}),"mkBorder"),Fn,yL=(Fn=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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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?at(this.secondaryColor,30):this.secondaryColor),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(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||st(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||at(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||at(this.mainBkg,10)):(this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||st(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 i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],75);else for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],25);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleInv"+i]=this["cScaleInv"+i]||Q(this["cScale"+i]);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this.darkMode?this["cScalePeer"+i]=this["cScalePeer"+i]||st(this["cScale"+i],10):this["cScalePeer"+i]=this["cScalePeer"+i]||at(this["cScale"+i],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleLabel"+i]=this["cScaleLabel"+i]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let i=0;i<5;i++)this["surface"+i]=this["surface"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(5+i*3)}),this["surfacePeer"+i]=this["surfacePeer"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(8+i*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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]}),Object.hasOwn(t,"nodeBorder")&&!Object.hasOwn(t,"useGradient")&&(this.useGradient=!1)}},b(Fn,"Theme"),Fn),xL=b(e=>{const t=new yL;return t.calculate(e),t},"getThemeVariables"),On,vL=(On=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=B(this.primaryColor,{h:-160}),this.primaryBorderColor=Q(this.background),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.lineColor=Q(this.background),this.textColor=Q(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(Q("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=oa(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=at("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=at(this.sectionBkgColor,10),this.taskBorderColor=oa(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=oa(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||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||at(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=st(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=st(this.labelBackground,25),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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=st(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=Q(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]||Q(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||st(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)]??st(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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=st(this.secondaryColor,20),this.git1=st(this.pie2||this.secondaryColor,20),this.git2=st(this.pie3||this.tertiaryColor,20),this.git3=st(this.pie4||B(this.primaryColor,{h:-30}),20),this.git4=st(this.pie5||B(this.primaryColor,{h:-60}),20),this.git5=st(this.pie6||B(this.primaryColor,{h:-90}),10),this.git6=st(this.pie7||B(this.primaryColor,{h:60}),10),this.git7=st(this.pie8||B(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Q(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Q(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||st("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||st("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||st("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||st("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||st(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||st(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||st(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||st(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(On,"Theme"),On),wL=b(e=>{const t=new vL;return t.calculate(e),t},"getThemeVariables"),Nn,kL=(Nn=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=ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.lineColor=Q(this.background),this.textColor=Q(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ue(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=oa(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||at(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||at(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=at(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||at(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||Q(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||Q(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.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||st(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||st(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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||at(Q(this.git0),25),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Q(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(Object.keys(this).forEach(r=>{this[r]==="calculated"&&(this[r]=void 0)}),typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Nn,"Theme"),Nn),SL=b(e=>{const t=new kL;return t.calculate(e),t},"getThemeVariables"),Wn,CL=(Wn=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=st("#cde498",10),this.primaryBorderColor=ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.primaryColor),this.lineColor=Q(this.background),this.textColor=Q(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=at(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||at(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||at(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=at(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||at(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.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||st(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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Q(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Wn,"Theme"),Wn),TL=b(e=>{const t=new CL;return t.calculate(e),t},"getThemeVariables"),qn,$L=(qn=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=st(this.contrast,55),this.background="#ffffff",this.tertiaryColor=B(this.primaryColor,{h:-160}),this.primaryBorderColor=ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.lineColor=Q(this.background),this.textColor=Q(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||st(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=st(this.contrast,55),this.border2=this.contrast,this.actorBorder=st(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]||Q(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||st(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||at(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.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.sectionBkgColor=st(this.contrast,30),this.sectionBkgColor2=st(this.contrast,30),this.taskBorderColor=at(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=st(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=at(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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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=at(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||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(qn,"Theme"),qn),ML=b(e=>{const t=new $L;return t.calculate(e),t},"getThemeVariables"),Hn,AL=(Hn=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=ue(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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(this.lineColor),this.rectBkgColor=this.rectBkgColor||(Mr(this.background)?st(this.background,4):at(this.background,4));const t="#ECECFE",i="#E9E9F1",r=B(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||i,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||st(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||i,this.cScale2=this.cScale2||r,this.cScale3=this.cScale3||B(t,{h:30}),this.cScale4=this.cScale4||B(t,{h:60}),this.cScale5=this.cScale5||B(t,{h:90}),this.cScale6=this.cScale6||B(t,{h:120}),this.cScale7=this.cScale7||B(t,{h:150}),this.cScale8=this.cScale8||B(t,{h:210,l:150}),this.cScale9=this.cScale9||B(t,{h:270}),this.cScale10=this.cScale10||B(t,{h:300}),this.cScale11=this.cScale11||B(t,{h:330}),this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=at(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=at(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||Q(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||st(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||at(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||i,this.fillType2=this.fillType2||B(t,{h:64}),this.fillType3=this.fillType3||B(i,{h:64}),this.fillType4=this.fillType4||B(t,{h:-64}),this.fillType5=this.fillType5||B(i,{h:-64}),this.fillType6=this.fillType6||B(t,{h:128}),this.fillType7=this.fillType7||B(i,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||i,this.pie3=this.pie3||r,this.pie4=this.pie4||B(t,{l:-10}),this.pie5=this.pie5||B(i,{l:-10}),this.pie6=this.pie6||B(r,{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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||i,this.git2=this.git2||r,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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Hn,"Theme"),Hn),BL=b(e=>{const t=new AL;return t.calculate(e),t},"getThemeVariables"),jn,_L=(jn=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=B(this.primaryColor,{h:-160}),this.primaryBorderColor=Q(this.background),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(Q("#323D47"),10),this.border1="#ccc",this.border2=oa(255,255,255,.25),this.arrowheadColor=Q(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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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.secondBkg=this.secondBkg==="calculated"?st(this.mainBkg,16):this.secondBkg,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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(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||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,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 i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],75);else for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],25);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleInv"+i]=this["cScaleInv"+i]||Q(this["cScale"+i]);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this.darkMode?this["cScalePeer"+i]=this["cScalePeer"+i]||st(this["cScale"+i],10):this["cScalePeer"+i]=this["cScalePeer"+i]||at(this["cScale"+i],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleLabel"+i]=this["cScaleLabel"+i]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let i=0;i<5;i++)this["surface"+i]=this["surface"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(5+i*3)}),this["surfacePeer"+i]=this["surfacePeer"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(8+i*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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(jn,"Theme"),jn),LL=b(e=>{const t=new _L;return t.calculate(e),t},"getThemeVariables"),Un,PL=(Un=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=ue("#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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(this.lineColor),this.rectBkgColor=this.rectBkgColor||(Mr(this.background)?st(this.background,4):at(this.background,4));const t="#ECECFE",i="#E9E9F1",r=B(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||i,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||st(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=this.mainBkg;if(this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=at(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=at(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||Q(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||st(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||at(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||i,this.fillType2=this.fillType2||B(t,{h:64}),this.fillType3=this.fillType3||B(i,{h:64}),this.fillType4=this.fillType4||B(t,{h:-64}),this.fillType5=this.fillType5||B(i,{h:-64}),this.fillType6=this.fillType6||B(t,{h:128}),this.fillType7=this.fillType7||B(i,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||i,this.pie3=this.pie3||r,this.pie4=this.pie4||B(t,{l:-10}),this.pie5=this.pie5||B(i,{l:-10}),this.pie6=this.pie6||B(r,{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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||i,this.git2=this.git2||r,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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Un,"Theme"),Un),EL=b(e=>{const t=new PL;return t.calculate(e),t},"getThemeVariables"),Yn,RL=(Yn=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=B(this.primaryColor,{h:-160}),this.primaryBorderColor=Q(this.background),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(Q("#323D47"),10),this.border1="#ccc",this.border2=oa(255,255,255,.25),this.arrowheadColor=Q(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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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.secondBkg=this.secondBkg==="calculated"?st(this.mainBkg,16):this.secondBkg,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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(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||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,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 i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],75);else for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],25);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleInv"+i]=this["cScaleInv"+i]||Q(this["cScale"+i]);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this.darkMode?this["cScalePeer"+i]=this["cScalePeer"+i]||st(this["cScale"+i],10):this["cScalePeer"+i]=this["cScalePeer"+i]||at(this["cScale"+i],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleLabel"+i]=this["cScaleLabel"+i]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let i=0;i<5;i++)this["surface"+i]=this["surface"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(5+i*3)}),this["surfacePeer"+i]=this["surfacePeer"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(8+i*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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Yn,"Theme"),Yn),IL=b(e=>{const t=new RL;return t.calculate(e),t},"getThemeVariables"),Gn,zL=(Gn=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=ue("#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.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.usecaseActorBorder="#A78BFA",this.usecaseActorBkg="#F5F3FF",this.usecaseBorder="#2DD4BF",this.usecaseBkg="#F0FDFA",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseBoundaryBkg="#FAFAFC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(this.lineColor),this.rectBkgColor=this.rectBkgColor||(Mr(this.background)?st(this.background,4):at(this.background,4));const t="#ECECFE",i="#E9E9F1",r=B(t,{h:180,l:5});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||st(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.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#FFFFFF",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#F9F9FB",this.compositeTitleBackground=this.compositeTitleBackground||"#F9F9FB",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",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||"white";for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||Q(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||st(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||at(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor;for(let o=0;o<8;o++)this["fillType"+o]=this["fillType"+o]||this.bkgColorArray[o];for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["pie"+(o+1)]=this["pie"+(o+1)]||this["cScale"+o];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 o=0;o<8;o++)this["venn"+(o+1)]=this["venn"+(o+1)]??this.borderColorArray[o%this.borderColorArray.length];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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||i,this.git2=this.git2||r,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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Gn,"Theme"),Gn),DL=b(e=>{const t=new zL;return t.calculate(e),t},"getThemeVariables"),Xn,FL=(Xn=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=B(this.primaryColor,{h:-160}),this.primaryBorderColor=Q(this.background),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(Q("#323D47"),10),this.border1="#ccc",this.border2=oa(255,255,255,.25),this.arrowheadColor=Q(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.usecaseActorBorder="#A78BFA",this.usecaseBorder="#2DD4BF",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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.secondBkg=this.secondBkg==="calculated"?st(this.mainBkg,16):this.secondBkg,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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",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||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,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.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#16141F",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||"#16141F",this.altBackground=this.altBackground||"#16141F",this.compositeTitleBackground=this.compositeTitleBackground||"#16141F",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",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||this.background;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||Q(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||st(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||at(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=at(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,["#701a75","#134e4a","#7c2d12","#581c87","#14532d","#4c1d95","#7f1d1d","#713f12"].forEach((r,s)=>{this["fillType"+s]=this["fillType"+s]||r});for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["pie"+(r+1)]=this["pie"+(r+1)]||this["cScale"+r];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||"#28253D",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 r=0;r<8;r++)this["venn"+(r+1)]=this["venn"+(r+1)]??this.borderColorArray[r%this.borderColorArray.length];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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Xn,"Theme"),Xn),OL=b(e=>{const t=new FL;return t.calculate(e),t},"getThemeVariables"),xo={base:{getThemeVariables:xL},dark:{getThemeVariables:wL},default:{getThemeVariables:SL},forest:{getThemeVariables:TL},neutral:{getThemeVariables:ML},neo:{getThemeVariables:BL},"neo-dark":{getThemeVariables:LL},redux:{getThemeVariables:EL},"redux-dark":{getThemeVariables:IL},"redux-color":{getThemeVariables:DL},"redux-dark-color":{getThemeVariables:OL}},fi={flowchart:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,wrappingWidth:120,minNodeWidth:120,inheritDir:!1},swimlane:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"swimlane",lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},agentflow:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,diagramPadding:8,nodeSpacing:50,rankSpacing:50,wrappingWidth:120,minNodeWidth:120},sequence:{useMaxWidth:!0,theme:"redux-color",look:"neo",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,theme:"redux-color",look:"neo",titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"elk",wrappingWidth:120,minNodeWidth:120,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},er:{useMaxWidth:!0,theme:"redux-color",look:"neo",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,showLegend:!0,legendFontSize:14,legendPadding:10,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,theme:"redux-color",look:"neo",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},usecase:{useMaxWidth:!0,theme:"redux-color",look:"neo",wrappingWidth:120,minNodeWidth:120,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:"normal",usecaseFontSize:12,usecaseFontFamily:'"Open Sans", sans-serif',usecaseFontWeight:"normal",nodeSpacing:50,rankSpacing:50,diagramPadding:20,colorScheme:"role"},venn:{useMaxWidth:!0,theme:"redux-color",look:"neo",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:"elk",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},x4={...fi,deterministicIDSeed:void 0,elk:{mergeEdges:!1,straightenEdges:!0,lineHops:!0,preset:"default",nodePlacementStrategy:void 0,layeringStrategy:void 0,cycleBreakingStrategy:void 0,layeringLayerBound:4,nodePlacementAlignment:void 0,forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1},themeCSS:void 0,themeVariables:xo.default.getThemeVariables(),sequence:{...fi.sequence,messageFont:b(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:b(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:b(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{theme:fi.class?.theme,look:fi.class?.look,layout:fi.class?.layout,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...fi.gantt,tickInterval:void 0,useWidth:void 0},c4:{...fi.c4,useWidth:void 0,personFont:b(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...fi.flowchart,inheritDir:!1},external_personFont:b(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:b(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:b(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:b(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:b(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:b(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:b(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:b(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:b(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:b(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:b(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:b(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:b(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:b(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:b(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:b(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:b(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:b(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:b(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:b(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:b(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...fi.pie,useWidth:984},xyChart:{...fi.xyChart,useWidth:void 0},requirement:{...fi.requirement,useWidth:void 0},packet:{...fi.packet},eventmodeling:{...fi.eventmodeling},treeView:{...fi.treeView,useWidth:void 0},radar:{...fi.radar},usecase:{...fi.usecase},railroad:{...fi.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:{...fi.ishikawa},sankey:{...fi.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:{...fi.venn},cynefin:{...fi.cynefin}},v4=b((e,t="")=>Object.keys(e).reduce((i,r)=>Array.isArray(e[r])?i:typeof e[r]=="object"&&e[r]!==null?[...i,t+r,...v4(e[r],"")]:[...i,t+r],[]),"keyify"),NL=new Set(v4(x4,"")),fm=x4,WL={"flowchart-v2":"flowchart","flowchart-elk":"flowchart",classDiagram:"class",stateDiagram:"state",xychart:"xyChart",railroadAbnf:"railroad",railroadEbnf:"railroad",railroadPeg:"railroad"},qL=b(e=>WL[e]??e,"getDiagramConfigKey"),HL={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},jL=b((e,t)=>{for(const i of Object.keys(e)){const r=e[i];(i.startsWith("__")||i.includes("proto")||i.includes("constr")||typeof r!="string"||!t.test(r))&&(vt.debug("sanitize deleting dictionary entry:",i,r),delete e[i])}},"sanitizeDictionaryConfig"),Pd=b(e=>{if(vt.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Pd(t));return}for(const t of Object.keys(e)){if(vt.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!NL.has(t)||e[t]==null){vt.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const r=HL[t];r?jL(e[t],r):(vt.debug("sanitizing object",t),Pd(e[t]));continue}const i=["themeCSS","fontFamily","altFontFamily"];for(const r of i)t.includes(r)&&(vt.debug("sanitizing css option",t),e[t]=w4(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const i=e.themeVariables[t];i?.match&&!i.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}vt.debug("After sanitization",e)}},"sanitizeDirective"),w4=b(e=>{let t=0,i=0;for(const r of e){if(t<i)return"{ /* ERROR: Unbalanced CSS */ }";r==="{"?t++:r==="}"&&i++}return t!==i?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),ca=Object.freeze(fm),UL=["theme","look","layout"],YL=new Set(["classic","handDrawn","neo"]),GL=b((e,t)=>e==="theme"?t==="null"||Object.hasOwn(xo,t):e!=="look"||YL.has(t),"isUsableAppearance"),XL=b((e,t,i)=>e?[e[t]?.[i],e[i]].find(s=>s!==void 0&&GL(i,s)):void 0,"readAppearance"),Qs=b(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),dr=yi({},ca),Ed,Rd={},So=[],uc=yi({},ca),pc,VL=b((e,t)=>{if(!pc)return;const i=[t,...[...So].reverse(),Rd,ca],r=e[pc];for(const s of UL)for(const o of i){const a=XL(o,pc,s);if(a!==void 0){e[s]=a,r?.[s]!==void 0&&(r[s]=a);break}}},"resolveAppearance"),pl=b((e,t)=>{let i=yi({},e),r={};for(const o of t)C4(o),r=yi(r,o);if(i=yi(i,r),VL(i,r),(!!r.theme||i.theme!==e.theme)&&i.theme&&Object.hasOwn(xo,i.theme)){const o=yi({},Ed),a=yi(o.themeVariables||{},r.themeVariables);i.themeVariables=xo[i.theme].getThemeVariables(a)}return uc=i,eP(uc),uc},"updateCurrentConfig"),gm=b(e=>{pc=e===void 0?void 0:qL(e),pl(dr,So)},"setDiagramConfigScope"),KL=b(e=>(dr=yi({},ca),dr=yi(dr,e),Rd=yi({},e),e.theme&&Object.hasOwn(xo,e.theme)&&(dr.themeVariables=xo[e.theme].getThemeVariables(e.themeVariables)),pl(dr,So),dr),"setSiteConfig"),ZL=b(e=>{Ed=yi({},e)},"saveConfigFromInitialize"),QL=b(e=>(dr=yi(dr,e),Rd=yi(Rd,e),pl(dr,So),dr),"updateSiteConfig"),k4=b(()=>yi({},dr),"getSiteConfig"),S4=b(e=>(pl(uc,[e]),ei()),"setConfig"),ei=b(()=>yi({},uc),"getConfig"),C4=b(e=>{e&&(["secure",...dr.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(vt.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"&&C4(e[t])}))},"sanitize"),JL=b(e=>{Pd(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),So.push(e),pl(dr,So)},"addDirective"),Id=b((e=dr)=>{So=[],pc=void 0,pl(e,So)},"reset"),tP={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."},sx={},T4=b(e=>{sx[e]||(vt.warn(tP[e]),sx[e]=!0)},"issueWarning"),eP=b(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&T4("LAZY_LOAD_DEPRECATED")},"checkConfig"),cet=b(()=>{let e={};Ed&&(e=yi(e,Ed));for(const t of So)e=yi(e,t);return e},"getUserDefinedConfig"),Ni=b(e=>(e.flowchart?.htmlLabels!=null&&T4("FLOWCHART_HTML_LABELS_DEPRECATED"),Qs(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),qc=/<\/?br\s*\/?>/gi,iP=new RegExp(qc.source,"i"),rP=b(e=>e?A4(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),sP=(()=>{let e=!1;return()=>{e||($4(),e=!0)}})();function $4(){const e="data-temp-href-target";tl.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),tl.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"))})}b($4,"setupDompurifyHooks");var M4=b(e=>(sP(),tl.sanitize(e)),"removeScript"),ox=b((e,t)=>{if(Ni(t)){const i=t.securityLevel;i==="antiscript"||i==="strict"||i==="sandbox"?e=M4(e):i!=="loose"&&(e=A4(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=lP(e))}return e},"sanitizeMore"),es=b((e,t)=>e&&(t.dompurifyConfig?e=tl.sanitize(ox(e,t),t.dompurifyConfig).toString():e=tl.sanitize(ox(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),oP=b((e,t)=>typeof e=="string"?es(e,t):e.flat().map(i=>es(i,t)),"sanitizeTextOrArray"),aP=b(e=>iP.test(e),"hasBreaks"),nP=b(e=>e.split(qc),"splitBreaks"),lP=b(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),A4=b(e=>e.replace(qc,"#br#"),"breakToPlaceholder"),cP=b(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),hP=b(function(...e){const t=e.filter(i=>!isNaN(i));return Math.max(...t)},"getMax"),dP=b(function(...e){const t=e.filter(i=>!isNaN(i));return Math.min(...t)},"getMin"),ax=b(function(e){const t=e.split(/(,)/),i=[];for(let r=0;r<t.length;r++){let s=t[r];if(s===","&&r>0&&r+1<t.length){const o=t[r-1],a=t[r+1];uP(o,a)&&(s=o+","+a,r++,i.pop())}i.push(pP(s))}return i.join("")},"parseGenericTypes"),Tf=b((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),uP=b((e,t)=>{const i=Tf(e,"~"),r=Tf(t,"~");return i===1&&r===1},"shouldCombineSets"),pP=b(e=>{const t=Tf(e,"~");let i=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),i=!0);const r=[...e];let s=r.indexOf("~"),o=r.lastIndexOf("~");for(;s!==-1&&o!==-1&&s!==o;)r[s]="<",r[o]=">",s=r.indexOf("~"),o=r.lastIndexOf("~");return i&&r.unshift("~"),r.join("")},"processSet"),nx=b(()=>window.MathMLElement!==void 0,"isMathMLSupported"),$f=/\$\$(.*?)\$\$/g,Cc=b(e=>(e.match($f)?.length??0)>0,"hasKatex"),het=b(async(e,t)=>{const i=document.createElement("div");i.innerHTML=await B4(e,t),i.id="katex-temp",i.style.visibility="hidden",i.style.position="absolute",i.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",i);const s={width:i.clientWidth,height:i.clientHeight};return i.remove(),s},"calculateMathMLDimensions"),fP=b(async(e,t)=>{if(!Cc(e))return e;if(!(nx()||t.legacyMathML||t.forceLegacyMathML))return e.replace($f,"MathML is unsupported in this environment.");{const{default:i}=await xe(async()=>{const{default:s}=await import("./katex-HP8lGamR.js");return{default:s}},[]),r=t.forceLegacyMathML||!nx()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(qc).map(s=>Cc(s)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${s}</div>`:`<div>${s}</div>`).join("").replace($f,(s,o)=>i.renderToString(o,{throwOnError:!0,displayMode:!0,output:r}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),B4=b(async(e,t)=>es(await fP(e,t),t),"renderKatexSanitized"),Hc={getRows:rP,sanitizeText:es,sanitizeTextOrArray:oP,hasBreaks:aP,splitBreaks:nP,lineBreakRegex:qc,removeScript:M4,getUrl:cP,evaluate:Qs,getMax:hP,getMin:dP},gP=b(function(e,t){for(let i of t)e.attr(i[0],i[1])},"d3Attrs"),mP=b(function(e,t,i){let r=new Map;return i?(r.set("width","100%"),r.set("style",`max-width: ${t}px;`)):(r.set("height",e),r.set("width",t)),r},"calculateSvgSizeAttrs"),_4=b(function(e,t,i,r){const s=mP(t,i,r);gP(e,s)},"configureSvgSize"),bP=b(function(e,t,i,r){const s=t.node().getBBox(),o=s.width,a=s.height;vt.info(`SVG bounds: ${o}x${a}`,s);let n=0,l=0;vt.info(`Graph bounds: ${n}x${l}`,e),n=o+i*2,l=a+i*2,vt.info(`Calculated bounds: ${n}x${l}`),_4(t,l,n,r);const c=`${s.x-i} ${s.y-i} ${s.width+2*i} ${s.height+2*i}`;t.attr("viewBox",c)},"setupGraphViewbox"),id={};function Mf(e){return[...e.cssRules].map(t=>t.cssText).join(`
1390
+ `,i=o+1,r=i}return t+e.slice(i)},"stripAnyComments"),Dn,b4=(Dn=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},b(Dn,"UnknownDiagramError"),Dn),Ga={},Iu=b(function(e,t){e=mL(e.replace(m4,"").replace(dc,""));for(const[i,{detector:r}]of Object.entries(Ga))if(r(e,t))return i;throw new b4(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Sf=b((...e)=>{for(const{id:t,detector:i,loader:r}of e)y4(t,i,r)},"registerLazyLoadedDiagrams"),y4=b((e,t,i)=>{Ga[e]&&vt.warn(`Detector with key ${e} already exists. Overwriting.`),Ga[e]={detector:t,loader:i},vt.debug(`Detector with key ${e} added${i?" with loader":""}`)},"addDetector"),bL=b(e=>Ga[e].loader,"getDiagramLoader"),Cf=b((e,t,{depth:i=2}={})=>{const r={depth:i};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(s=>Cf(e,s,r)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(s=>{e.includes(s)||e.push(s)}),e;if(e==null||i<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const s=e;Object.entries(t).forEach(([o,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(e,o)||Object.defineProperty(e,o,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),s[o]===void 0&&(s[o]=Array.isArray(a)?[]:{}),typeof s[o]=="object"&&(s[o]=Cf(s[o],a,{depth:i-1}))}else typeof s[o]!="object"&&(Object.hasOwn(e,o)?s[o]=a:Object.defineProperty(e,o,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),yi=Cf,Ks="#ffffff",Zs="#f2f2f2",ue=b((e,t)=>t?B(e,{s:-40,l:10}):B(e,{s:-40,l:-10}),"mkBorder"),Fn,yL=(Fn=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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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?at(this.secondaryColor,30):this.secondaryColor),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(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||st(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||at(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||at(this.mainBkg,10)):(this.rowOdd=this.rowOdd||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||st(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 i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],75);else for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],25);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleInv"+i]=this["cScaleInv"+i]||Q(this["cScale"+i]);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this.darkMode?this["cScalePeer"+i]=this["cScalePeer"+i]||st(this["cScale"+i],10):this["cScalePeer"+i]=this["cScalePeer"+i]||at(this["cScale"+i],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleLabel"+i]=this["cScaleLabel"+i]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let i=0;i<5;i++)this["surface"+i]=this["surface"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(5+i*3)}),this["surfacePeer"+i]=this["surfacePeer"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(8+i*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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]}),Object.hasOwn(t,"nodeBorder")&&!Object.hasOwn(t,"useGradient")&&(this.useGradient=!1)}},b(Fn,"Theme"),Fn),xL=b(e=>{const t=new yL;return t.calculate(e),t},"getThemeVariables"),On,vL=(On=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=B(this.primaryColor,{h:-160}),this.primaryBorderColor=Q(this.background),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.lineColor=Q(this.background),this.textColor=Q(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(Q("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=oa(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=at("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=at(this.sectionBkgColor,10),this.taskBorderColor=oa(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=oa(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||st(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||at(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=st(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=st(this.labelBackground,25),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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=st(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=Q(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]||Q(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||st(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)]??st(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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=st(this.secondaryColor,20),this.git1=st(this.pie2||this.secondaryColor,20),this.git2=st(this.pie3||this.tertiaryColor,20),this.git3=st(this.pie4||B(this.primaryColor,{h:-30}),20),this.git4=st(this.pie5||B(this.primaryColor,{h:-60}),20),this.git5=st(this.pie6||B(this.primaryColor,{h:-90}),10),this.git6=st(this.pie7||B(this.primaryColor,{h:60}),10),this.git7=st(this.pie8||B(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Q(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Q(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||st("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||st("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||st("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||st("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||st(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||st(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||st(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||st(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(On,"Theme"),On),wL=b(e=>{const t=new vL;return t.calculate(e),t},"getThemeVariables"),Nn,kL=(Nn=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=ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.lineColor=Q(this.background),this.textColor=Q(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=ue(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=oa(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||at(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||at(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=at(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||at(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||Q(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||Q(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.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||st(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||st(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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||at(Q(this.git0),25),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Q(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(Object.keys(this).forEach(r=>{this[r]==="calculated"&&(this[r]=void 0)}),typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Nn,"Theme"),Nn),SL=b(e=>{const t=new kL;return t.calculate(e),t},"getThemeVariables"),Wn,CL=(Wn=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=st("#cde498",10),this.primaryBorderColor=ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.primaryColor),this.lineColor=Q(this.background),this.textColor=Q(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=at(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||at(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||at(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=at(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||at(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.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||st(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||st(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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Q(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Wn,"Theme"),Wn),TL=b(e=>{const t=new CL;return t.calculate(e),t},"getThemeVariables"),qn,$L=(qn=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=st(this.contrast,55),this.background="#ffffff",this.tertiaryColor=B(this.primaryColor,{h:-160}),this.primaryBorderColor=ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.lineColor=Q(this.background),this.textColor=Q(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||st(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=st(this.contrast,55),this.border2=this.contrast,this.actorBorder=st(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]||Q(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||st(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||at(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.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.sectionBkgColor=st(this.contrast,30),this.sectionBkgColor2=st(this.contrast,30),this.taskBorderColor=at(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=st(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=at(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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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=at(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||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(qn,"Theme"),qn),ML=b(e=>{const t=new $L;return t.calculate(e),t},"getThemeVariables"),Hn,AL=(Hn=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=ue(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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(this.lineColor),this.rectBkgColor=this.rectBkgColor||(Mr(this.background)?st(this.background,4):at(this.background,4));const t="#ECECFE",i="#E9E9F1",r=B(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||i,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||st(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||i,this.cScale2=this.cScale2||r,this.cScale3=this.cScale3||B(t,{h:30}),this.cScale4=this.cScale4||B(t,{h:60}),this.cScale5=this.cScale5||B(t,{h:90}),this.cScale6=this.cScale6||B(t,{h:120}),this.cScale7=this.cScale7||B(t,{h:150}),this.cScale8=this.cScale8||B(t,{h:210,l:150}),this.cScale9=this.cScale9||B(t,{h:270}),this.cScale10=this.cScale10||B(t,{h:300}),this.cScale11=this.cScale11||B(t,{h:330}),this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=at(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=at(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||Q(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||st(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||at(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||i,this.fillType2=this.fillType2||B(t,{h:64}),this.fillType3=this.fillType3||B(i,{h:64}),this.fillType4=this.fillType4||B(t,{h:-64}),this.fillType5=this.fillType5||B(i,{h:-64}),this.fillType6=this.fillType6||B(t,{h:128}),this.fillType7=this.fillType7||B(i,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||i,this.pie3=this.pie3||r,this.pie4=this.pie4||B(t,{l:-10}),this.pie5=this.pie5||B(i,{l:-10}),this.pie6=this.pie6||B(r,{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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||i,this.git2=this.git2||r,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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Hn,"Theme"),Hn),BL=b(e=>{const t=new AL;return t.calculate(e),t},"getThemeVariables"),jn,_L=(jn=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=B(this.primaryColor,{h:-160}),this.primaryBorderColor=Q(this.background),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(Q("#323D47"),10),this.border1="#ccc",this.border2=oa(255,255,255,.25),this.arrowheadColor=Q(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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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.secondBkg=this.secondBkg==="calculated"?st(this.mainBkg,16):this.secondBkg,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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(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||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,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 i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],75);else for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],25);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleInv"+i]=this["cScaleInv"+i]||Q(this["cScale"+i]);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this.darkMode?this["cScalePeer"+i]=this["cScalePeer"+i]||st(this["cScale"+i],10):this["cScalePeer"+i]=this["cScalePeer"+i]||at(this["cScale"+i],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleLabel"+i]=this["cScaleLabel"+i]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let i=0;i<5;i++)this["surface"+i]=this["surface"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(5+i*3)}),this["surfacePeer"+i]=this["surfacePeer"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(8+i*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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(jn,"Theme"),jn),LL=b(e=>{const t=new _L;return t.calculate(e),t},"getThemeVariables"),Un,PL=(Un=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=ue("#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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(this.lineColor),this.rectBkgColor=this.rectBkgColor||(Mr(this.background)?st(this.background,4):at(this.background,4));const t="#ECECFE",i="#E9E9F1",r=B(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||r,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||i,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||st(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=this.mainBkg;if(this.darkMode)for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=at(this["cScale"+o],75);else for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScale"+o]=at(this["cScale"+o],25);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||Q(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||st(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||at(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||i,this.fillType2=this.fillType2||B(t,{h:64}),this.fillType3=this.fillType3||B(i,{h:64}),this.fillType4=this.fillType4||B(t,{h:-64}),this.fillType5=this.fillType5||B(i,{h:-64}),this.fillType6=this.fillType6||B(t,{h:128}),this.fillType7=this.fillType7||B(i,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||i,this.pie3=this.pie3||r,this.pie4=this.pie4||B(t,{l:-10}),this.pie5=this.pie5||B(i,{l:-10}),this.pie6=this.pie6||B(r,{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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||i,this.git2=this.git2||r,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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Un,"Theme"),Un),EL=b(e=>{const t=new PL;return t.calculate(e),t},"getThemeVariables"),Yn,RL=(Yn=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=B(this.primaryColor,{h:-160}),this.primaryBorderColor=Q(this.background),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(Q("#323D47"),10),this.border1="#ccc",this.border2=oa(255,255,255,.25),this.arrowheadColor=Q(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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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.secondBkg=this.secondBkg==="calculated"?st(this.mainBkg,16):this.secondBkg,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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(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||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,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 i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],75);else for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScale"+i]=at(this["cScale"+i],25);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleInv"+i]=this["cScaleInv"+i]||Q(this["cScale"+i]);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this.darkMode?this["cScalePeer"+i]=this["cScalePeer"+i]||st(this["cScale"+i],10):this["cScalePeer"+i]=this["cScalePeer"+i]||at(this["cScale"+i],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleLabel"+i]=this["cScaleLabel"+i]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let i=0;i<5;i++)this["surface"+i]=this["surface"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(5+i*3)}),this["surfacePeer"+i]=this["surfacePeer"+i]||B(this.mainBkg,{h:180,s:-15,l:t*(8+i*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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Yn,"Theme"),Yn),IL=b(e=>{const t=new RL;return t.calculate(e),t},"getThemeVariables"),Gn,zL=(Gn=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=ue("#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.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.usecaseActorBorder="#A78BFA",this.usecaseActorBkg="#F5F3FF",this.usecaseBorder="#2DD4BF",this.usecaseBkg="#F0FDFA",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseBoundaryBkg="#FAFAFC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(this.lineColor),this.rectBkgColor=this.rectBkgColor||(Mr(this.background)?st(this.background,4):at(this.background,4));const t="#ECECFE",i="#E9E9F1",r=B(t,{h:180,l:5});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||st(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.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#FFFFFF",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#F9F9FB",this.compositeTitleBackground=this.compositeTitleBackground||"#F9F9FB",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",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||"white";for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleInv"+o]=this["cScaleInv"+o]||Q(this["cScale"+o]);for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this.darkMode?this["cScalePeer"+o]=this["cScalePeer"+o]||st(this["cScale"+o],10):this["cScalePeer"+o]=this["cScalePeer"+o]||at(this["cScale"+o],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["cScaleLabel"+o]=this["cScaleLabel"+o]||this.scaleLabelColor;const s=this.darkMode?-4:-1;for(let o=0;o<5;o++)this["surface"+o]=this["surface"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(5+o*3)}),this["surfacePeer"+o]=this["surfacePeer"+o]||B(this.mainBkg,{h:180,s:-15,l:s*(8+o*3)});this.classText=this.classText||this.textColor;for(let o=0;o<8;o++)this["fillType"+o]=this["fillType"+o]||this.bkgColorArray[o];for(let o=0;o<this.THEME_COLOR_LIMIT;o++)this["pie"+(o+1)]=this["pie"+(o+1)]||this["cScale"+o];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 o=0;o<8;o++)this["venn"+(o+1)]=this["venn"+(o+1)]??this.borderColorArray[o%this.borderColorArray.length];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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||i,this.git2=this.git2||r,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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Gn,"Theme"),Gn),DL=b(e=>{const t=new zL;return t.calculate(e),t},"getThemeVariables"),Xn,FL=(Xn=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=st(this.primaryColor,16),this.tertiaryColor=B(this.primaryColor,{h:-160}),this.primaryBorderColor=Q(this.background),this.secondaryBorderColor=ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ue(this.tertiaryColor,this.darkMode),this.primaryTextColor=Q(this.primaryColor),this.secondaryTextColor=Q(this.secondaryColor),this.tertiaryTextColor=Q(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=st(Q("#323D47"),10),this.border1="#ccc",this.border2=oa(255,255,255,.25),this.arrowheadColor=Q(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.usecaseActorBorder="#A78BFA",this.usecaseBorder="#2DD4BF",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",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||ue(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ue(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ue(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ue(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||Q(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Q(this.tertiaryColor),this.lineColor=this.lineColor||Q(this.background),this.arrowheadColor=this.arrowheadColor||Q(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.secondBkg=this.secondBkg==="calculated"?st(this.mainBkg,16):this.secondBkg,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?at(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,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||at(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Q(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",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||st(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,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.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#16141F",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||"#16141F",this.altBackground=this.altBackground||"#16141F",this.compositeTitleBackground=this.compositeTitleBackground||"#16141F",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",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||this.background;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||Q(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||st(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||at(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=at(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,["#701a75","#134e4a","#7c2d12","#581c87","#14532d","#4c1d95","#7f1d1d","#713f12"].forEach((r,s)=>{this["fillType"+s]=this["fillType"+s]||r});for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["pie"+(r+1)]=this["pie"+(r+1)]||this["cScale"+r];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||"#28253D",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 r=0;r<8;r++)this["venn"+(r+1)]=this["venn"+(r+1)]??this.borderColorArray[r%this.borderColorArray.length];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||Mr(this.quadrant1Fill)?st(this.quadrant1Fill):at(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,legendTextColor:this.xyChart?.legendTextColor||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?at(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=st(this.git0,25),this.git1=st(this.git1,25),this.git2=st(this.git2,25),this.git3=st(this.git3,25),this.git4=st(this.git4,25),this.git5=st(this.git5,25),this.git6=st(this.git6,25),this.git7=st(this.git7,25)):(this.git0=at(this.git0,25),this.git1=at(this.git1,25),this.git2=at(this.git2,25),this.git3=at(this.git3,25),this.git4=at(this.git4,25),this.git5=at(this.git5,25),this.git6=at(this.git6,25),this.git7=at(this.git7,25)),this.gitInv0=this.gitInv0||Q(this.git0),this.gitInv1=this.gitInv1||Q(this.git1),this.gitInv2=this.gitInv2||Q(this.git2),this.gitInv3=this.gitInv3||Q(this.git3),this.gitInv4=this.gitInv4||Q(this.git4),this.gitInv5=this.gitInv5||Q(this.git5),this.gitInv6=this.gitInv6||Q(this.git6),this.gitInv7=this.gitInv7||Q(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||Ks,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Zs}calculate(t){if(typeof t!="object"){this.updateColors();return}const i=Object.keys(t);i.forEach(r=>{this[r]=t[r]}),this.updateColors(),i.forEach(r=>{this[r]=t[r]})}},b(Xn,"Theme"),Xn),OL=b(e=>{const t=new FL;return t.calculate(e),t},"getThemeVariables"),xo={base:{getThemeVariables:xL},dark:{getThemeVariables:wL},default:{getThemeVariables:SL},forest:{getThemeVariables:TL},neutral:{getThemeVariables:ML},neo:{getThemeVariables:BL},"neo-dark":{getThemeVariables:LL},redux:{getThemeVariables:EL},"redux-dark":{getThemeVariables:IL},"redux-color":{getThemeVariables:DL},"redux-dark-color":{getThemeVariables:OL}},fi={flowchart:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,wrappingWidth:120,minNodeWidth:120,inheritDir:!1},swimlane:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"swimlane",lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},agentflow:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,diagramPadding:8,nodeSpacing:50,rankSpacing:50,wrappingWidth:120,minNodeWidth:120},sequence:{useMaxWidth:!0,theme:"redux-color",look:"neo",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,theme:"redux-color",look:"neo",titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"elk",wrappingWidth:120,minNodeWidth:120,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},er:{useMaxWidth:!0,theme:"redux-color",look:"neo",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,showLegend:!0,legendFontSize:14,legendPadding:10,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,theme:"redux-color",look:"neo",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},usecase:{useMaxWidth:!0,theme:"redux-color",look:"neo",wrappingWidth:120,minNodeWidth:120,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:"normal",usecaseFontSize:12,usecaseFontFamily:'"Open Sans", sans-serif',usecaseFontWeight:"normal",nodeSpacing:50,rankSpacing:50,diagramPadding:20,colorScheme:"role"},venn:{useMaxWidth:!0,theme:"redux-color",look:"neo",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:"elk",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},x4={...fi,deterministicIDSeed:void 0,elk:{mergeEdges:!1,straightenEdges:!0,lineHops:!0,preset:"default",nodePlacementStrategy:void 0,layeringStrategy:void 0,cycleBreakingStrategy:void 0,layeringLayerBound:4,nodePlacementAlignment:void 0,forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1},themeCSS:void 0,themeVariables:xo.default.getThemeVariables(),sequence:{...fi.sequence,messageFont:b(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:b(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:b(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{theme:fi.class?.theme,look:fi.class?.look,layout:fi.class?.layout,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...fi.gantt,tickInterval:void 0,useWidth:void 0},c4:{...fi.c4,useWidth:void 0,personFont:b(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...fi.flowchart,inheritDir:!1},external_personFont:b(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:b(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:b(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:b(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:b(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:b(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:b(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:b(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:b(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:b(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:b(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:b(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:b(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:b(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:b(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:b(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:b(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:b(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:b(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:b(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:b(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...fi.pie,useWidth:984},xyChart:{...fi.xyChart,useWidth:void 0},requirement:{...fi.requirement,useWidth:void 0},packet:{...fi.packet},eventmodeling:{...fi.eventmodeling},treeView:{...fi.treeView,useWidth:void 0},radar:{...fi.radar},usecase:{...fi.usecase},railroad:{...fi.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:{...fi.ishikawa},sankey:{...fi.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:{...fi.venn},cynefin:{...fi.cynefin}},v4=b((e,t="")=>Object.keys(e).reduce((i,r)=>Array.isArray(e[r])?i:typeof e[r]=="object"&&e[r]!==null?[...i,t+r,...v4(e[r],"")]:[...i,t+r],[]),"keyify"),NL=new Set(v4(x4,"")),fm=x4,WL={"flowchart-v2":"flowchart","flowchart-elk":"flowchart",classDiagram:"class",stateDiagram:"state",xychart:"xyChart",railroadAbnf:"railroad",railroadEbnf:"railroad",railroadPeg:"railroad"},qL=b(e=>WL[e]??e,"getDiagramConfigKey"),HL={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},jL=b((e,t)=>{for(const i of Object.keys(e)){const r=e[i];(i.startsWith("__")||i.includes("proto")||i.includes("constr")||typeof r!="string"||!t.test(r))&&(vt.debug("sanitize deleting dictionary entry:",i,r),delete e[i])}},"sanitizeDictionaryConfig"),Pd=b(e=>{if(vt.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Pd(t));return}for(const t of Object.keys(e)){if(vt.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!NL.has(t)||e[t]==null){vt.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const r=HL[t];r?jL(e[t],r):(vt.debug("sanitizing object",t),Pd(e[t]));continue}const i=["themeCSS","fontFamily","altFontFamily"];for(const r of i)t.includes(r)&&(vt.debug("sanitizing css option",t),e[t]=w4(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const i=e.themeVariables[t];i?.match&&!i.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}vt.debug("After sanitization",e)}},"sanitizeDirective"),w4=b(e=>{let t=0,i=0;for(const r of e){if(t<i)return"{ /* ERROR: Unbalanced CSS */ }";r==="{"?t++:r==="}"&&i++}return t!==i?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),ca=Object.freeze(fm),UL=["theme","look","layout"],YL=new Set(["classic","handDrawn","neo"]),GL=b((e,t)=>e==="theme"?t==="null"||Object.hasOwn(xo,t):e!=="look"||YL.has(t),"isUsableAppearance"),XL=b((e,t,i)=>e?[e[t]?.[i],e[i]].find(s=>s!==void 0&&GL(i,s)):void 0,"readAppearance"),Qs=b(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),dr=yi({},ca),Ed,Rd={},So=[],uc=yi({},ca),pc,VL=b((e,t)=>{if(!pc)return;const i=[t,...[...So].reverse(),Rd,ca],r=e[pc];for(const s of UL)for(const o of i){const a=XL(o,pc,s);if(a!==void 0){e[s]=a,r?.[s]!==void 0&&(r[s]=a);break}}},"resolveAppearance"),pl=b((e,t)=>{let i=yi({},e),r={};for(const o of t)C4(o),r=yi(r,o);if(i=yi(i,r),VL(i,r),(!!r.theme||i.theme!==e.theme)&&i.theme&&Object.hasOwn(xo,i.theme)){const o=yi({},Ed),a=yi(o.themeVariables||{},r.themeVariables);i.themeVariables=xo[i.theme].getThemeVariables(a)}return uc=i,eP(uc),uc},"updateCurrentConfig"),gm=b(e=>{pc=e===void 0?void 0:qL(e),pl(dr,So)},"setDiagramConfigScope"),KL=b(e=>(dr=yi({},ca),dr=yi(dr,e),Rd=yi({},e),e.theme&&Object.hasOwn(xo,e.theme)&&(dr.themeVariables=xo[e.theme].getThemeVariables(e.themeVariables)),pl(dr,So),dr),"setSiteConfig"),ZL=b(e=>{Ed=yi({},e)},"saveConfigFromInitialize"),QL=b(e=>(dr=yi(dr,e),Rd=yi(Rd,e),pl(dr,So),dr),"updateSiteConfig"),k4=b(()=>yi({},dr),"getSiteConfig"),S4=b(e=>(pl(uc,[e]),ei()),"setConfig"),ei=b(()=>yi({},uc),"getConfig"),C4=b(e=>{e&&(["secure",...dr.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(vt.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"&&C4(e[t])}))},"sanitize"),JL=b(e=>{Pd(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),So.push(e),pl(dr,So)},"addDirective"),Id=b((e=dr)=>{So=[],pc=void 0,pl(e,So)},"reset"),tP={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."},sx={},T4=b(e=>{sx[e]||(vt.warn(tP[e]),sx[e]=!0)},"issueWarning"),eP=b(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&T4("LAZY_LOAD_DEPRECATED")},"checkConfig"),het=b(()=>{let e={};Ed&&(e=yi(e,Ed));for(const t of So)e=yi(e,t);return e},"getUserDefinedConfig"),Ni=b(e=>(e.flowchart?.htmlLabels!=null&&T4("FLOWCHART_HTML_LABELS_DEPRECATED"),Qs(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),qc=/<\/?br\s*\/?>/gi,iP=new RegExp(qc.source,"i"),rP=b(e=>e?A4(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),sP=(()=>{let e=!1;return()=>{e||($4(),e=!0)}})();function $4(){const e="data-temp-href-target";tl.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),tl.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"))})}b($4,"setupDompurifyHooks");var M4=b(e=>(sP(),tl.sanitize(e)),"removeScript"),ox=b((e,t)=>{if(Ni(t)){const i=t.securityLevel;i==="antiscript"||i==="strict"||i==="sandbox"?e=M4(e):i!=="loose"&&(e=A4(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=lP(e))}return e},"sanitizeMore"),es=b((e,t)=>e&&(t.dompurifyConfig?e=tl.sanitize(ox(e,t),t.dompurifyConfig).toString():e=tl.sanitize(ox(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),oP=b((e,t)=>typeof e=="string"?es(e,t):e.flat().map(i=>es(i,t)),"sanitizeTextOrArray"),aP=b(e=>iP.test(e),"hasBreaks"),nP=b(e=>e.split(qc),"splitBreaks"),lP=b(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),A4=b(e=>e.replace(qc,"#br#"),"breakToPlaceholder"),cP=b(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),hP=b(function(...e){const t=e.filter(i=>!isNaN(i));return Math.max(...t)},"getMax"),dP=b(function(...e){const t=e.filter(i=>!isNaN(i));return Math.min(...t)},"getMin"),ax=b(function(e){const t=e.split(/(,)/),i=[];for(let r=0;r<t.length;r++){let s=t[r];if(s===","&&r>0&&r+1<t.length){const o=t[r-1],a=t[r+1];uP(o,a)&&(s=o+","+a,r++,i.pop())}i.push(pP(s))}return i.join("")},"parseGenericTypes"),Tf=b((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),uP=b((e,t)=>{const i=Tf(e,"~"),r=Tf(t,"~");return i===1&&r===1},"shouldCombineSets"),pP=b(e=>{const t=Tf(e,"~");let i=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),i=!0);const r=[...e];let s=r.indexOf("~"),o=r.lastIndexOf("~");for(;s!==-1&&o!==-1&&s!==o;)r[s]="<",r[o]=">",s=r.indexOf("~"),o=r.lastIndexOf("~");return i&&r.unshift("~"),r.join("")},"processSet"),nx=b(()=>window.MathMLElement!==void 0,"isMathMLSupported"),$f=/\$\$(.*?)\$\$/g,Cc=b(e=>(e.match($f)?.length??0)>0,"hasKatex"),det=b(async(e,t)=>{const i=document.createElement("div");i.innerHTML=await B4(e,t),i.id="katex-temp",i.style.visibility="hidden",i.style.position="absolute",i.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",i);const s={width:i.clientWidth,height:i.clientHeight};return i.remove(),s},"calculateMathMLDimensions"),fP=b(async(e,t)=>{if(!Cc(e))return e;if(!(nx()||t.legacyMathML||t.forceLegacyMathML))return e.replace($f,"MathML is unsupported in this environment.");{const{default:i}=await xe(async()=>{const{default:s}=await import("./katex-HP8lGamR.js");return{default:s}},[]),r=t.forceLegacyMathML||!nx()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(qc).map(s=>Cc(s)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${s}</div>`:`<div>${s}</div>`).join("").replace($f,(s,o)=>i.renderToString(o,{throwOnError:!0,displayMode:!0,output:r}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),B4=b(async(e,t)=>es(await fP(e,t),t),"renderKatexSanitized"),Hc={getRows:rP,sanitizeText:es,sanitizeTextOrArray:oP,hasBreaks:aP,splitBreaks:nP,lineBreakRegex:qc,removeScript:M4,getUrl:cP,evaluate:Qs,getMax:hP,getMin:dP},gP=b(function(e,t){for(let i of t)e.attr(i[0],i[1])},"d3Attrs"),mP=b(function(e,t,i){let r=new Map;return i?(r.set("width","100%"),r.set("style",`max-width: ${t}px;`)):(r.set("height",e),r.set("width",t)),r},"calculateSvgSizeAttrs"),_4=b(function(e,t,i,r){const s=mP(t,i,r);gP(e,s)},"configureSvgSize"),bP=b(function(e,t,i,r){const s=t.node().getBBox(),o=s.width,a=s.height;vt.info(`SVG bounds: ${o}x${a}`,s);let n=0,l=0;vt.info(`Graph bounds: ${n}x${l}`,e),n=o+i*2,l=a+i*2,vt.info(`Calculated bounds: ${n}x${l}`),_4(t,l,n,r);const c=`${s.x-i} ${s.y-i} ${s.width+2*i} ${s.height+2*i}`;t.attr("viewBox",c)},"setupGraphViewbox"),id={};function Mf(e){return[...e.cssRules].map(t=>t.cssText).join(`
1391
1391
  `)}b(Mf,"cssStyleSheetToString");var yP=b((e,t,i,r)=>{let s="";return e in id&&id[e]?s=id[e]({...i,svgId:r}):vt.warn(`No theme found for ${e}`),`& {
1392
1392
  font-family: ${i.fontFamily};
1393
1393
  font-size: ${i.fontSize};
@@ -1510,7 +1510,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1510
1510
 
1511
1511
  ${t}
1512
1512
  `},"getStyles"),xP=b((e,t)=>{t!==void 0&&(id[e]=t)},"addStylesForDiagram"),vP=yP,L4={};k_(L4,{clear:()=>wP,getAccDescription:()=>TP,getAccTitle:()=>SP,getDiagramTitle:()=>MP,setAccDescription:()=>CP,setAccTitle:()=>kP,setDiagramTitle:()=>$P});var mm="",bm="",ym="",xm=b(e=>es(e,ei()),"sanitizeText"),wP=b(()=>{mm="",ym="",bm=""},"clear"),kP=b(e=>{mm=xm(e).replace(/^\s+/g,"")},"setAccTitle"),SP=b(()=>mm,"getAccTitle"),CP=b(e=>{ym=xm(e).replace(/\n\s+/g,`
1513
- `)},"setAccDescription"),TP=b(()=>ym,"getAccDescription"),$P=b(e=>{bm=xm(e)},"setDiagramTitle"),MP=b(()=>bm,"getDiagramTitle"),lx=vt,AP=pm,ye=ei,det=S4,uet=ca,vm=b(e=>es(e,ye()),"sanitizeText"),BP=bP,_P=b(()=>L4,"getCommonDb"),zd={},Dd=b((e,t,i)=>{zd[e]&&lx.warn(`Diagram with id ${e} already registered. Overwriting.`),zd[e]=t,i&&y4(e,i),xP(e,t.styles),t.injectUtils?.(lx,AP,ye,vm,BP,_P(),()=>{})},"registerDiagram"),Af=b(e=>{if(e in zd)return zd[e];throw new LP(e)},"getDiagram"),Vn,LP=(Vn=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},b(Vn,"DiagramNotFoundError"),Vn),PP={value:()=>{}};function P4(){for(var e=0,t=arguments.length,i={},r;e<t;++e){if(!(r=arguments[e]+"")||r in i||/[\s.]/.test(r))throw new Error("illegal type: "+r);i[r]=[]}return new rd(i)}function rd(e){this._=e}function EP(e,t){return e.trim().split(/^|\s+/).map(function(i){var r="",s=i.indexOf(".");if(s>=0&&(r=i.slice(s+1),i=i.slice(0,s)),i&&!t.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:r}})}rd.prototype=P4.prototype={constructor:rd,on:function(e,t){var i=this._,r=EP(e+"",i),s,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((s=(e=r[o]).type)&&(s=RP(i[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(s=(e=r[o]).type)i[s]=cx(i[s],e.name,t);else if(t==null)for(s in i)i[s]=cx(i[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var i in t)e[i]=t[i].slice();return new rd(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var i=new Array(s),r=0,s,o;r<s;++r)i[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,i)},apply:function(e,t,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,i)}};function RP(e,t){for(var i=0,r=e.length,s;i<r;++i)if((s=e[i]).name===t)return s.value}function cx(e,t,i){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=PP,e=e.slice(0,r).concat(e.slice(r+1));break}return i!=null&&e.push({name:t,value:i}),e}var Bf="http://www.w3.org/1999/xhtml";const hx={svg:"http://www.w3.org/2000/svg",xhtml:Bf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zu(e){var t=e+="",i=t.indexOf(":");return i>=0&&(t=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),hx.hasOwnProperty(t)?{space:hx[t],local:e}:e}function IP(e){return function(){var t=this.ownerDocument,i=this.namespaceURI;return i===Bf&&t.documentElement.namespaceURI===Bf?t.createElement(e):t.createElementNS(i,e)}}function zP(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function E4(e){var t=zu(e);return(t.local?zP:IP)(t)}function DP(){}function wm(e){return e==null?DP:function(){return this.querySelector(e)}}function FP(e){typeof e!="function"&&(e=wm(e));for(var t=this._groups,i=t.length,r=new Array(i),s=0;s<i;++s)for(var o=t[s],a=o.length,n=r[s]=new Array(a),l,c,h=0;h<a;++h)(l=o[h])&&(c=e.call(l,l.__data__,h,o))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new Or(r,this._parents)}function OP(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function NP(){return[]}function R4(e){return e==null?NP:function(){return this.querySelectorAll(e)}}function WP(e){return function(){return OP(e.apply(this,arguments))}}function qP(e){typeof e=="function"?e=WP(e):e=R4(e);for(var t=this._groups,i=t.length,r=[],s=[],o=0;o<i;++o)for(var a=t[o],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),s.push(l));return new Or(r,s)}function I4(e){return function(){return this.matches(e)}}function z4(e){return function(t){return t.matches(e)}}var HP=Array.prototype.find;function jP(e){return function(){return HP.call(this.children,e)}}function UP(){return this.firstElementChild}function YP(e){return this.select(e==null?UP:jP(typeof e=="function"?e:z4(e)))}var GP=Array.prototype.filter;function XP(){return Array.from(this.children)}function VP(e){return function(){return GP.call(this.children,e)}}function KP(e){return this.selectAll(e==null?XP:VP(typeof e=="function"?e:z4(e)))}function ZP(e){typeof e!="function"&&(e=I4(e));for(var t=this._groups,i=t.length,r=new Array(i),s=0;s<i;++s)for(var o=t[s],a=o.length,n=r[s]=[],l,c=0;c<a;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&n.push(l);return new Or(r,this._parents)}function D4(e){return new Array(e.length)}function QP(){return new Or(this._enter||this._groups.map(D4),this._parents)}function Fd(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Fd.prototype={constructor:Fd,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 JP(e){return function(){return e}}function tE(e,t,i,r,s,o){for(var a=0,n,l=t.length,c=o.length;a<c;++a)(n=t[a])?(n.__data__=o[a],r[a]=n):i[a]=new Fd(e,o[a]);for(;a<l;++a)(n=t[a])&&(s[a]=n)}function eE(e,t,i,r,s,o,a){var n,l,c=new Map,h=t.length,d=o.length,u=new Array(h),p;for(n=0;n<h;++n)(l=t[n])&&(u[n]=p=a.call(l,l.__data__,n,t)+"",c.has(p)?s[n]=l:c.set(p,l));for(n=0;n<d;++n)p=a.call(e,o[n],n,o)+"",(l=c.get(p))?(r[n]=l,l.__data__=o[n],c.delete(p)):i[n]=new Fd(e,o[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(u[n])===l&&(s[n]=l)}function iE(e){return e.__data__}function rE(e,t){if(!arguments.length)return Array.from(this,iE);var i=t?eE:tE,r=this._parents,s=this._groups;typeof e!="function"&&(e=JP(e));for(var o=s.length,a=new Array(o),n=new Array(o),l=new Array(o),c=0;c<o;++c){var h=r[c],d=s[c],u=d.length,p=sE(e.call(h,h&&h.__data__,c,r)),f=p.length,g=n[c]=new Array(f),m=a[c]=new Array(f),x=l[c]=new Array(u);i(h,d,g,m,x,p,t);for(var w=0,S=0,A,C;w<f;++w)if(A=g[w]){for(w>=S&&(S=w+1);!(C=m[S])&&++S<f;);A._next=C||null}}return a=new Or(a,r),a._enter=n,a._exit=l,a}function sE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oE(){return new Or(this._exit||this._groups.map(D4),this._parents)}function aE(e,t,i){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),i==null?o.remove():i(o),r&&s?r.merge(s).order():s}function nE(e){for(var t=e.selection?e.selection():e,i=this._groups,r=t._groups,s=i.length,o=r.length,a=Math.min(s,o),n=new Array(s),l=0;l<a;++l)for(var c=i[l],h=r[l],d=c.length,u=n[l]=new Array(d),p,f=0;f<d;++f)(p=c[f]||h[f])&&(u[f]=p);for(;l<s;++l)n[l]=i[l];return new Or(n,this._parents)}function lE(){for(var e=this._groups,t=-1,i=e.length;++t<i;)for(var r=e[t],s=r.length-1,o=r[s],a;--s>=0;)(a=r[s])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function cE(e){e||(e=hE);function t(d,u){return d&&u?e(d.__data__,u.__data__):!d-!u}for(var i=this._groups,r=i.length,s=new Array(r),o=0;o<r;++o){for(var a=i[o],n=a.length,l=s[o]=new Array(n),c,h=0;h<n;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new Or(s,this._parents).order()}function hE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function uE(){return Array.from(this)}function pE(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var a=r[s];if(a)return a}return null}function fE(){let e=0;for(const t of this)++e;return e}function gE(){return!this.node()}function mE(e){for(var t=this._groups,i=0,r=t.length;i<r;++i)for(var s=t[i],o=0,a=s.length,n;o<a;++o)(n=s[o])&&e.call(n,n.__data__,o,s);return this}function bE(e){return function(){this.removeAttribute(e)}}function yE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xE(e,t){return function(){this.setAttribute(e,t)}}function vE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function wE(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function kE(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function SE(e,t){var i=zu(e);if(arguments.length<2){var r=this.node();return i.local?r.getAttributeNS(i.space,i.local):r.getAttribute(i)}return this.each((t==null?i.local?yE:bE:typeof t=="function"?i.local?kE:wE:i.local?vE:xE)(i,t))}function F4(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function CE(e){return function(){this.style.removeProperty(e)}}function TE(e,t,i){return function(){this.style.setProperty(e,t,i)}}function $E(e,t,i){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,i)}}function ME(e,t,i){return arguments.length>1?this.each((t==null?CE:typeof t=="function"?$E:TE)(e,t,i??"")):el(this.node(),e)}function el(e,t){return e.style.getPropertyValue(t)||F4(e).getComputedStyle(e,null).getPropertyValue(t)}function AE(e){return function(){delete this[e]}}function BE(e,t){return function(){this[e]=t}}function _E(e,t){return function(){var i=t.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function LE(e,t){return arguments.length>1?this.each((t==null?AE:typeof t=="function"?_E:BE)(e,t)):this.node()[e]}function O4(e){return e.trim().split(/^|\s+/)}function km(e){return e.classList||new N4(e)}function N4(e){this._node=e,this._names=O4(e.getAttribute("class")||"")}N4.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 W4(e,t){for(var i=km(e),r=-1,s=t.length;++r<s;)i.add(t[r])}function q4(e,t){for(var i=km(e),r=-1,s=t.length;++r<s;)i.remove(t[r])}function PE(e){return function(){W4(this,e)}}function EE(e){return function(){q4(this,e)}}function RE(e,t){return function(){(t.apply(this,arguments)?W4:q4)(this,e)}}function IE(e,t){var i=O4(e+"");if(arguments.length<2){for(var r=km(this.node()),s=-1,o=i.length;++s<o;)if(!r.contains(i[s]))return!1;return!0}return this.each((typeof t=="function"?RE:t?PE:EE)(i,t))}function zE(){this.textContent=""}function DE(e){return function(){this.textContent=e}}function FE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function OE(e){return arguments.length?this.each(e==null?zE:(typeof e=="function"?FE:DE)(e)):this.node().textContent}function NE(){this.innerHTML=""}function WE(e){return function(){this.innerHTML=e}}function qE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function HE(e){return arguments.length?this.each(e==null?NE:(typeof e=="function"?qE:WE)(e)):this.node().innerHTML}function jE(){this.nextSibling&&this.parentNode.appendChild(this)}function UE(){return this.each(jE)}function YE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function GE(){return this.each(YE)}function XE(e){var t=typeof e=="function"?e:E4(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function VE(){return null}function KE(e,t){var i=typeof e=="function"?e:E4(e),r=t==null?VE:typeof t=="function"?t:wm(t);return this.select(function(){return this.insertBefore(i.apply(this,arguments),r.apply(this,arguments)||null)})}function ZE(){var e=this.parentNode;e&&e.removeChild(this)}function QE(){return this.each(ZE)}function JE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tR(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eR(e){return this.select(e?tR:JE)}function iR(e){return arguments.length?this.property("__data__",e):this.node().__data__}function rR(e){return function(t){e.call(this,t,this.__data__)}}function sR(e){return e.trim().split(/^|\s+/).map(function(t){var i="",r=t.indexOf(".");return r>=0&&(i=t.slice(r+1),t=t.slice(0,r)),{type:t,name:i}})}function oR(e){return function(){var t=this.__on;if(t){for(var i=0,r=-1,s=t.length,o;i<s;++i)o=t[i],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function aR(e,t,i){return function(){var r=this.__on,s,o=rR(t);if(r){for(var a=0,n=r.length;a<n;++a)if((s=r[a]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=i),s.value=t;return}}this.addEventListener(e.type,o,i),s={type:e.type,name:e.name,value:t,listener:o,options:i},r?r.push(s):this.__on=[s]}}function nR(e,t,i){var r=sR(e+""),s,o=r.length,a;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(s=0,h=n[l];s<o;++s)if((a=r[s]).type===h.type&&a.name===h.name)return h.value}return}for(n=t?aR:oR,s=0;s<o;++s)this.each(n(r[s],t,i));return this}function H4(e,t,i){var r=F4(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,i):(s=r.document.createEvent("Event"),i?(s.initEvent(t,i.bubbles,i.cancelable),s.detail=i.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function lR(e,t){return function(){return H4(this,e,t)}}function cR(e,t){return function(){return H4(this,e,t.apply(this,arguments))}}function hR(e,t){return this.each((typeof t=="function"?cR:lR)(e,t))}function*dR(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var r=e[t],s=0,o=r.length,a;s<o;++s)(a=r[s])&&(yield a)}var j4=[null];function Or(e,t){this._groups=e,this._parents=t}function jc(){return new Or([[document.documentElement]],j4)}function uR(){return this}Or.prototype=jc.prototype={constructor:Or,select:FP,selectAll:qP,selectChild:YP,selectChildren:KP,filter:ZP,data:rE,enter:QP,exit:oE,join:aE,merge:nE,selection:uR,order:lE,sort:cE,call:dE,nodes:uE,node:pE,size:fE,empty:gE,each:mE,attr:SE,style:ME,property:LE,classed:IE,text:OE,html:HE,raise:UE,lower:GE,append:XE,insert:KE,remove:QE,clone:eR,datum:iR,on:nR,dispatch:hR,[Symbol.iterator]:dR};function me(e){return typeof e=="string"?new Or([[document.querySelector(e)]],[document.documentElement]):new Or([[e]],j4)}function Sm(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function U4(e,t){var i=Object.create(e.prototype);for(var r in t)i[r]=t[r];return i}function Uc(){}var Tc=.7,Od=1/Tc,En="\\s*([+-]?\\d+)\\s*",$c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pR=/^#([0-9a-f]{3,8})$/,fR=new RegExp(`^rgb\\(${En},${En},${En}\\)$`),gR=new RegExp(`^rgb\\(${Hs},${Hs},${Hs}\\)$`),mR=new RegExp(`^rgba\\(${En},${En},${En},${$c}\\)$`),bR=new RegExp(`^rgba\\(${Hs},${Hs},${Hs},${$c}\\)$`),yR=new RegExp(`^hsl\\(${$c},${Hs},${Hs}\\)$`),xR=new RegExp(`^hsla\\(${$c},${Hs},${Hs},${$c}\\)$`),dx={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};Sm(Uc,Mc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ux,formatHex:ux,formatHex8:vR,formatHsl:wR,formatRgb:px,toString:px});function ux(){return this.rgb().formatHex()}function vR(){return this.rgb().formatHex8()}function wR(){return Y4(this).formatHsl()}function px(){return this.rgb().formatRgb()}function Mc(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=pR.exec(e))?(i=t[1].length,t=parseInt(t[1],16),i===6?fx(t):i===3?new Cr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):i===8?gh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):i===4?gh(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=fR.exec(e))?new Cr(t[1],t[2],t[3],1):(t=gR.exec(e))?new Cr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mR.exec(e))?gh(t[1],t[2],t[3],t[4]):(t=bR.exec(e))?gh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yR.exec(e))?bx(t[1],t[2]/100,t[3]/100,1):(t=xR.exec(e))?bx(t[1],t[2]/100,t[3]/100,t[4]):dx.hasOwnProperty(e)?fx(dx[e]):e==="transparent"?new Cr(NaN,NaN,NaN,0):null}function fx(e){return new Cr(e>>16&255,e>>8&255,e&255,1)}function gh(e,t,i,r){return r<=0&&(e=t=i=NaN),new Cr(e,t,i,r)}function kR(e){return e instanceof Uc||(e=Mc(e)),e?(e=e.rgb(),new Cr(e.r,e.g,e.b,e.opacity)):new Cr}function _f(e,t,i,r){return arguments.length===1?kR(e):new Cr(e,t,i,r??1)}function Cr(e,t,i,r){this.r=+e,this.g=+t,this.b=+i,this.opacity=+r}Sm(Cr,_f,U4(Uc,{brighter(e){return e=e==null?Od:Math.pow(Od,e),new Cr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Tc:Math.pow(Tc,e),new Cr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Cr(qa(this.r),qa(this.g),qa(this.b),Nd(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:gx,formatHex:gx,formatHex8:SR,formatRgb:mx,toString:mx}));function gx(){return`#${Oa(this.r)}${Oa(this.g)}${Oa(this.b)}`}function SR(){return`#${Oa(this.r)}${Oa(this.g)}${Oa(this.b)}${Oa((isNaN(this.opacity)?1:this.opacity)*255)}`}function mx(){const e=Nd(this.opacity);return`${e===1?"rgb(":"rgba("}${qa(this.r)}, ${qa(this.g)}, ${qa(this.b)}${e===1?")":`, ${e})`}`}function Nd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oa(e){return e=qa(e),(e<16?"0":"")+e.toString(16)}function bx(e,t,i,r){return r<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new ys(e,t,i,r)}function Y4(e){if(e instanceof ys)return new ys(e.h,e.s,e.l,e.opacity);if(e instanceof Uc||(e=Mc(e)),!e)return new ys;if(e instanceof ys)return e;e=e.rgb();var t=e.r/255,i=e.g/255,r=e.b/255,s=Math.min(t,i,r),o=Math.max(t,i,r),a=NaN,n=o-s,l=(o+s)/2;return n?(t===o?a=(i-r)/n+(i<r)*6:i===o?a=(r-t)/n+2:a=(t-i)/n+4,n/=l<.5?o+s:2-o-s,a*=60):n=l>0&&l<1?0:a,new ys(a,n,l,e.opacity)}function CR(e,t,i,r){return arguments.length===1?Y4(e):new ys(e,t,i,r??1)}function ys(e,t,i,r){this.h=+e,this.s=+t,this.l=+i,this.opacity=+r}Sm(ys,CR,U4(Uc,{brighter(e){return e=e==null?Od:Math.pow(Od,e),new ys(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Tc:Math.pow(Tc,e),new ys(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,i=this.l,r=i+(i<.5?i:1-i)*t,s=2*i-r;return new Cr(Gp(e>=240?e-240:e+120,s,r),Gp(e,s,r),Gp(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new ys(yx(this.h),mh(this.s),mh(this.l),Nd(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=Nd(this.opacity);return`${e===1?"hsl(":"hsla("}${yx(this.h)}, ${mh(this.s)*100}%, ${mh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function yx(e){return e=(e||0)%360,e<0?e+360:e}function mh(e){return Math.max(0,Math.min(1,e||0))}function Gp(e,t,i){return(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)*255}const Cm=e=>()=>e;function G4(e,t){return function(i){return e+i*t}}function TR(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(r){return Math.pow(e+r*t,i)}}function pet(e,t){var i=t-e;return i?G4(e,i>180||i<-180?i-360*Math.round(i/360):i):Cm(isNaN(e)?t:e)}function $R(e){return(e=+e)==1?X4:function(t,i){return i-t?TR(t,i,e):Cm(isNaN(t)?i:t)}}function X4(e,t){var i=t-e;return i?G4(e,i):Cm(isNaN(e)?t:e)}const xx=(function e(t){var i=$R(t);function r(s,o){var a=i((s=_f(s)).r,(o=_f(o)).r),n=i(s.g,o.g),l=i(s.b,o.b),c=X4(s.opacity,o.opacity);return function(h){return s.r=a(h),s.g=n(h),s.b=l(h),s.opacity=c(h),s+""}}return r.gamma=e,r})(1);function Qo(e,t){return e=+e,t=+t,function(i){return e*(1-i)+t*i}}var Lf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xp=new RegExp(Lf.source,"g");function MR(e){return function(){return e}}function AR(e){return function(t){return e(t)+""}}function BR(e,t){var i=Lf.lastIndex=Xp.lastIndex=0,r,s,o,a=-1,n=[],l=[];for(e=e+"",t=t+"";(r=Lf.exec(e))&&(s=Xp.exec(t));)(o=s.index)>i&&(o=t.slice(i,o),n[a]?n[a]+=o:n[++a]=o),(r=r[0])===(s=s[0])?n[a]?n[a]+=s:n[++a]=s:(n[++a]=null,l.push({i:a,x:Qo(r,s)})),i=Xp.lastIndex;return i<t.length&&(o=t.slice(i),n[a]?n[a]+=o:n[++a]=o),n.length<2?l[0]?AR(l[0].x):MR(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 vx=180/Math.PI,Pf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function V4(e,t,i,r,s,o){var a,n,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*i+t*r)&&(i-=e*l,r-=t*l),(n=Math.sqrt(i*i+r*r))&&(i/=n,r/=n,l/=n),e*r<t*i&&(e=-e,t=-t,l=-l,a=-a),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*vx,skewX:Math.atan(l)*vx,scaleX:a,scaleY:n}}var bh;function _R(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Pf:V4(t.a,t.b,t.c,t.d,t.e,t.f)}function LR(e){return e==null||(bh||(bh=document.createElementNS("http://www.w3.org/2000/svg","g")),bh.setAttribute("transform",e),!(e=bh.transform.baseVal.consolidate()))?Pf:(e=e.matrix,V4(e.a,e.b,e.c,e.d,e.e,e.f))}function K4(e,t,i,r){function s(c){return c.length?c.pop()+" ":""}function o(c,h,d,u,p,f){if(c!==d||h!==u){var g=p.push("translate(",null,t,null,i);f.push({i:g-4,x:Qo(c,d)},{i:g-2,x:Qo(h,u)})}else(d||u)&&p.push("translate("+d+t+u+i)}function a(c,h,d,u){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),u.push({i:d.push(s(d)+"rotate(",null,r)-2,x:Qo(c,h)})):h&&d.push(s(d)+"rotate("+h+r)}function n(c,h,d,u){c!==h?u.push({i:d.push(s(d)+"skewX(",null,r)-2,x:Qo(c,h)}):h&&d.push(s(d)+"skewX("+h+r)}function l(c,h,d,u,p,f){if(c!==d||h!==u){var g=p.push(s(p)+"scale(",null,",",null,")");f.push({i:g-4,x:Qo(c,d)},{i:g-2,x:Qo(h,u)})}else(d!==1||u!==1)&&p.push(s(p)+"scale("+d+","+u+")")}return function(c,h){var d=[],u=[];return c=e(c),h=e(h),o(c.translateX,c.translateY,h.translateX,h.translateY,d,u),a(c.rotate,h.rotate,d,u),n(c.skewX,h.skewX,d,u),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,u),c=h=null,function(p){for(var f=-1,g=u.length,m;++f<g;)d[(m=u[f]).i]=m.x(p);return d.join("")}}}var PR=K4(_R,"px, ","px)","deg)"),ER=K4(LR,", ",")",")"),il=0,Zl=0,Rl=0,Z4=1e3,Wd,Ql,qd=0,Xa=0,Du=0,Ac=typeof performance=="object"&&performance.now?performance:Date,Q4=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Tm(){return Xa||(Q4(RR),Xa=Ac.now()+Du)}function RR(){Xa=0}function Hd(){this._call=this._time=this._next=null}Hd.prototype=J4.prototype={constructor:Hd,restart:function(e,t,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Tm():+i)+(t==null?0:+t),!this._next&&Ql!==this&&(Ql?Ql._next=this:Wd=this,Ql=this),this._call=e,this._time=i,Ef()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ef())}};function J4(e,t,i){var r=new Hd;return r.restart(e,t,i),r}function IR(){Tm(),++il;for(var e=Wd,t;e;)(t=Xa-e._time)>=0&&e._call.call(void 0,t),e=e._next;--il}function wx(){Xa=(qd=Ac.now())+Du,il=Zl=0;try{IR()}finally{il=0,DR(),Xa=0}}function zR(){var e=Ac.now(),t=e-qd;t>Z4&&(Du-=t,qd=e)}function DR(){for(var e,t=Wd,i,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(i=t._next,t._next=null,t=e?e._next=i:Wd=i);Ql=e,Ef(r)}function Ef(e){if(!il){Zl&&(Zl=clearTimeout(Zl));var t=e-Xa;t>24?(e<1/0&&(Zl=setTimeout(wx,e-Ac.now()-Du)),Rl&&(Rl=clearInterval(Rl))):(Rl||(qd=Ac.now(),Rl=setInterval(zR,Z4)),il=1,Q4(wx))}}function kx(e,t,i){var r=new Hd;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,i),r}var FR=P4("start","end","cancel","interrupt"),OR=[],tS=0,Sx=1,Rf=2,sd=3,Cx=4,If=5,od=6;function Fu(e,t,i,r,s,o){var a=e.__transition;if(!a)e.__transition={};else if(i in a)return;NR(e,i,{name:t,index:r,group:s,on:FR,tween:OR,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:tS})}function $m(e,t){var i=As(e,t);if(i.state>tS)throw new Error("too late; already scheduled");return i}function Js(e,t){var i=As(e,t);if(i.state>sd)throw new Error("too late; already running");return i}function As(e,t){var i=e.__transition;if(!i||!(i=i[t]))throw new Error("transition not found");return i}function NR(e,t,i){var r=e.__transition,s;r[t]=i,i.timer=J4(o,0,i.time);function o(c){i.state=Sx,i.timer.restart(a,i.delay,i.time),i.delay<=c&&a(c-i.delay)}function a(c){var h,d,u,p;if(i.state!==Sx)return l();for(h in r)if(p=r[h],p.name===i.name){if(p.state===sd)return kx(a);p.state===Cx?(p.state=od,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[h]):+h<t&&(p.state=od,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[h])}if(kx(function(){i.state===sd&&(i.state=Cx,i.timer.restart(n,i.delay,i.time),n(c))}),i.state=Rf,i.on.call("start",e,e.__data__,i.index,i.group),i.state===Rf){for(i.state=sd,s=new Array(u=i.tween.length),h=0,d=-1;h<u;++h)(p=i.tween[h].value.call(e,e.__data__,i.index,i.group))&&(s[++d]=p);s.length=d+1}}function n(c){for(var h=c<i.duration?i.ease.call(null,c/i.duration):(i.timer.restart(l),i.state=If,1),d=-1,u=s.length;++d<u;)s[d].call(e,h);i.state===If&&(i.on.call("end",e,e.__data__,i.index,i.group),l())}function l(){i.state=od,i.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function WR(e,t){var i=e.__transition,r,s,o=!0,a;if(i){t=t==null?null:t+"";for(a in i){if((r=i[a]).name!==t){o=!1;continue}s=r.state>Rf&&r.state<If,r.state=od,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete i[a]}o&&delete e.__transition}}function qR(e){return this.each(function(){WR(this,e)})}function HR(e,t){var i,r;return function(){var s=Js(this,e),o=s.tween;if(o!==i){r=i=o;for(var a=0,n=r.length;a<n;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}s.tween=r}}function jR(e,t,i){var r,s;if(typeof i!="function")throw new Error;return function(){var o=Js(this,e),a=o.tween;if(a!==r){s=(r=a).slice();for(var n={name:t,value:i},l=0,c=s.length;l<c;++l)if(s[l].name===t){s[l]=n;break}l===c&&s.push(n)}o.tween=s}}function UR(e,t){var i=this._id;if(e+="",arguments.length<2){for(var r=As(this.node(),i).tween,s=0,o=r.length,a;s<o;++s)if((a=r[s]).name===e)return a.value;return null}return this.each((t==null?HR:jR)(i,e,t))}function Mm(e,t,i){var r=e._id;return e.each(function(){var s=Js(this,r);(s.value||(s.value={}))[t]=i.apply(this,arguments)}),function(s){return As(s,r).value[t]}}function eS(e,t){var i;return(typeof t=="number"?Qo:t instanceof Mc?xx:(i=Mc(t))?(t=i,xx):BR)(e,t)}function YR(e){return function(){this.removeAttribute(e)}}function GR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function XR(e,t,i){var r,s=i+"",o;return function(){var a=this.getAttribute(e);return a===s?null:a===r?o:o=t(r=a,i)}}function VR(e,t,i){var r,s=i+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===s?null:a===r?o:o=t(r=a,i)}}function KR(e,t,i){var r,s,o;return function(){var a,n=i(this),l;return n==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=n+"",a===l?null:a===r&&l===s?o:(s=l,o=t(r=a,n)))}}function ZR(e,t,i){var r,s,o;return function(){var a,n=i(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===r&&l===s?o:(s=l,o=t(r=a,n)))}}function QR(e,t){var i=zu(e),r=i==="transform"?ER:eS;return this.attrTween(e,typeof t=="function"?(i.local?ZR:KR)(i,r,Mm(this,"attr."+e,t)):t==null?(i.local?GR:YR)(i):(i.local?VR:XR)(i,r,t))}function JR(e,t){return function(i){this.setAttribute(e,t.call(this,i))}}function tI(e,t){return function(i){this.setAttributeNS(e.space,e.local,t.call(this,i))}}function eI(e,t){var i,r;function s(){var o=t.apply(this,arguments);return o!==r&&(i=(r=o)&&tI(e,o)),i}return s._value=t,s}function iI(e,t){var i,r;function s(){var o=t.apply(this,arguments);return o!==r&&(i=(r=o)&&JR(e,o)),i}return s._value=t,s}function rI(e,t){var i="attr."+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;var r=zu(e);return this.tween(i,(r.local?eI:iI)(r,t))}function sI(e,t){return function(){$m(this,e).delay=+t.apply(this,arguments)}}function oI(e,t){return t=+t,function(){$m(this,e).delay=t}}function aI(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sI:oI)(t,e)):As(this.node(),t).delay}function nI(e,t){return function(){Js(this,e).duration=+t.apply(this,arguments)}}function lI(e,t){return t=+t,function(){Js(this,e).duration=t}}function cI(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?nI:lI)(t,e)):As(this.node(),t).duration}function hI(e,t){if(typeof t!="function")throw new Error;return function(){Js(this,e).ease=t}}function dI(e){var t=this._id;return arguments.length?this.each(hI(t,e)):As(this.node(),t).ease}function uI(e,t){return function(){var i=t.apply(this,arguments);if(typeof i!="function")throw new Error;Js(this,e).ease=i}}function pI(e){if(typeof e!="function")throw new Error;return this.each(uI(this._id,e))}function fI(e){typeof e!="function"&&(e=I4(e));for(var t=this._groups,i=t.length,r=new Array(i),s=0;s<i;++s)for(var o=t[s],a=o.length,n=r[s]=[],l,c=0;c<a;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&n.push(l);return new Co(r,this._parents,this._name,this._id)}function gI(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,i=e._groups,r=t.length,s=i.length,o=Math.min(r,s),a=new Array(r),n=0;n<o;++n)for(var l=t[n],c=i[n],h=l.length,d=a[n]=new Array(h),u,p=0;p<h;++p)(u=l[p]||c[p])&&(d[p]=u);for(;n<r;++n)a[n]=t[n];return new Co(a,this._parents,this._name,this._id)}function mI(e){return(e+"").trim().split(/^|\s+/).every(function(t){var i=t.indexOf(".");return i>=0&&(t=t.slice(0,i)),!t||t==="start"})}function bI(e,t,i){var r,s,o=mI(t)?$m:Js;return function(){var a=o(this,e),n=a.on;n!==r&&(s=(r=n).copy()).on(t,i),a.on=s}}function yI(e,t){var i=this._id;return arguments.length<2?As(this.node(),i).on.on(e):this.each(bI(i,e,t))}function xI(e){return function(){var t=this.parentNode;for(var i in this.__transition)if(+i!==e)return;t&&t.removeChild(this)}}function vI(){return this.on("end.remove",xI(this._id))}function wI(e){var t=this._name,i=this._id;typeof e!="function"&&(e=wm(e));for(var r=this._groups,s=r.length,o=new Array(s),a=0;a<s;++a)for(var n=r[a],l=n.length,c=o[a]=new Array(l),h,d,u=0;u<l;++u)(h=n[u])&&(d=e.call(h,h.__data__,u,n))&&("__data__"in h&&(d.__data__=h.__data__),c[u]=d,Fu(c[u],t,i,u,c,As(h,i)));return new Co(o,this._parents,t,i)}function kI(e){var t=this._name,i=this._id;typeof e!="function"&&(e=R4(e));for(var r=this._groups,s=r.length,o=[],a=[],n=0;n<s;++n)for(var l=r[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var u=e.call(h,h.__data__,d,l),p,f=As(h,i),g=0,m=u.length;g<m;++g)(p=u[g])&&Fu(p,t,i,g,u,f);o.push(u),a.push(h)}return new Co(o,a,t,i)}var SI=jc.prototype.constructor;function CI(){return new SI(this._groups,this._parents)}function TI(e,t){var i,r,s;return function(){var o=el(this,e),a=(this.style.removeProperty(e),el(this,e));return o===a?null:o===i&&a===r?s:s=t(i=o,r=a)}}function iS(e){return function(){this.style.removeProperty(e)}}function $I(e,t,i){var r,s=i+"",o;return function(){var a=el(this,e);return a===s?null:a===r?o:o=t(r=a,i)}}function MI(e,t,i){var r,s,o;return function(){var a=el(this,e),n=i(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),el(this,e))),a===l?null:a===r&&l===s?o:(s=l,o=t(r=a,n))}}function AI(e,t){var i,r,s,o="style."+t,a="end."+o,n;return function(){var l=Js(this,e),c=l.on,h=l.value[o]==null?n||(n=iS(t)):void 0;(c!==i||s!==h)&&(r=(i=c).copy()).on(a,s=h),l.on=r}}function BI(e,t,i){var r=(e+="")=="transform"?PR:eS;return t==null?this.styleTween(e,TI(e,r)).on("end.style."+e,iS(e)):typeof t=="function"?this.styleTween(e,MI(e,r,Mm(this,"style."+e,t))).each(AI(this._id,e)):this.styleTween(e,$I(e,r,t),i).on("end.style."+e,null)}function _I(e,t,i){return function(r){this.style.setProperty(e,t.call(this,r),i)}}function LI(e,t,i){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&_I(e,a,i)),r}return o._value=t,o}function PI(e,t,i){var r="style."+(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;return this.tween(r,LI(e,t,i??""))}function EI(e){return function(){this.textContent=e}}function RI(e){return function(){var t=e(this);this.textContent=t??""}}function II(e){return this.tween("text",typeof e=="function"?RI(Mm(this,"text",e)):EI(e==null?"":e+""))}function zI(e){return function(t){this.textContent=e.call(this,t)}}function DI(e){var t,i;function r(){var s=e.apply(this,arguments);return s!==i&&(t=(i=s)&&zI(s)),t}return r._value=e,r}function FI(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,DI(e))}function OI(){for(var e=this._name,t=this._id,i=rS(),r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],n=a.length,l,c=0;c<n;++c)if(l=a[c]){var h=As(l,t);Fu(l,e,i,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Co(r,this._parents,e,i)}function NI(){var e,t,i=this,r=i._id,s=i.size();return new Promise(function(o,a){var n={value:a},l={value:function(){--s===0&&o()}};i.each(function(){var c=Js(this,r),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(n),t._.interrupt.push(n),t._.end.push(l)),c.on=t}),s===0&&o()})}var WI=0;function Co(e,t,i,r){this._groups=e,this._parents=t,this._name=i,this._id=r}function rS(){return++WI}var ho=jc.prototype;Co.prototype={constructor:Co,select:wI,selectAll:kI,selectChild:ho.selectChild,selectChildren:ho.selectChildren,filter:fI,merge:gI,selection:CI,transition:OI,call:ho.call,nodes:ho.nodes,node:ho.node,size:ho.size,empty:ho.empty,each:ho.each,on:yI,attr:QR,attrTween:rI,style:BI,styleTween:PI,text:II,textTween:FI,remove:vI,tween:UR,delay:aI,duration:cI,ease:dI,easeVarying:pI,end:NI,[Symbol.iterator]:ho[Symbol.iterator]};function qI(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var HI={time:null,delay:0,duration:250,ease:qI};function jI(e,t){for(var i;!(i=e.__transition)||!(i=i[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return i}function UI(e){var t,i;e instanceof Co?(t=e._id,e=e._name):(t=rS(),(i=HI).time=Tm(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],n=a.length,l,c=0;c<n;++c)(l=a[c])&&Fu(l,e,t,c,a,i||jI(l,t));return new Co(r,this._parents,e,t)}jc.prototype.interrupt=qR;jc.prototype.transition=UI;const zf=Math.PI,Df=2*zf,Ea=1e-6,YI=Df-Ea;function sS(e){this._+=e[0];for(let t=1,i=e.length;t<i;++t)this._+=arguments[t]+e[t]}function GI(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return sS;const i=10**t;return function(r){this._+=r[0];for(let s=1,o=r.length;s<o;++s)this._+=Math.round(arguments[s]*i)/i+r[s]}}class XI{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?sS:GI(t)}moveTo(t,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+i}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,i){this._append`L${this._x1=+t},${this._y1=+i}`}quadraticCurveTo(t,i,r,s){this._append`Q${+t},${+i},${this._x1=+r},${this._y1=+s}`}bezierCurveTo(t,i,r,s,o,a){this._append`C${+t},${+i},${+r},${+s},${this._x1=+o},${this._y1=+a}`}arcTo(t,i,r,s,o){if(t=+t,i=+i,r=+r,s=+s,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,n=this._y1,l=r-t,c=s-i,h=a-t,d=n-i,u=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=i}`;else if(u>Ea)if(!(Math.abs(d*l-c*h)>Ea)||!o)this._append`L${this._x1=t},${this._y1=i}`;else{let p=r-a,f=s-n,g=l*l+c*c,m=p*p+f*f,x=Math.sqrt(g),w=Math.sqrt(u),S=o*Math.tan((zf-Math.acos((g+u-m)/(2*x*w)))/2),A=S/w,C=S/x;Math.abs(A-1)>Ea&&this._append`L${t+A*h},${i+A*d}`,this._append`A${o},${o},0,0,${+(d*p>h*f)},${this._x1=t+C*l},${this._y1=i+C*c}`}}arc(t,i,r,s,o,a){if(t=+t,i=+i,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let n=r*Math.cos(s),l=r*Math.sin(s),c=t+n,h=i+l,d=1^a,u=a?s-o:o-s;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>Ea||Math.abs(this._y1-h)>Ea)&&this._append`L${c},${h}`,r&&(u<0&&(u=u%Df+Df),u>YI?this._append`A${r},${r},0,1,${d},${t-n},${i-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=h}`:u>Ea&&this._append`A${r},${r},0,${+(u>=zf)},${d},${this._x1=t+r*Math.cos(o)},${this._y1=i+r*Math.sin(o)}`)}rect(t,i,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+i}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function dn(e){return function(){return e}}const fet=Math.abs,get=Math.atan2,met=Math.cos,bet=Math.max,yet=Math.min,xet=Math.sin,vet=Math.sqrt,Tx=1e-12,Am=Math.PI,$x=Am/2,wet=2*Am;function ket(e){return e>1?0:e<-1?Am:Math.acos(e)}function Cet(e){return e>=1?$x:e<=-1?-$x:Math.asin(e)}function VI(e){let t=3;return e.digits=function(i){if(!arguments.length)return t;if(i==null)t=null;else{const r=Math.floor(i);if(!(r>=0))throw new RangeError(`invalid digits: ${i}`);t=r}return e},()=>new XI(t)}function KI(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oS(e){this._context=e}oS.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 fc(e){return new oS(e)}function ZI(e){return e[0]}function QI(e){return e[1]}function JI(e,t){var i=dn(!0),r=null,s=fc,o=null,a=VI(n);e=typeof e=="function"?e:e===void 0?ZI:dn(e),t=typeof t=="function"?t:t===void 0?QI:dn(t);function n(l){var c,h=(l=KI(l)).length,d,u=!1,p;for(r==null&&(o=s(p=a())),c=0;c<=h;++c)!(c<h&&i(d=l[c],c,l))===u&&((u=!u)?o.lineStart():o.lineEnd()),u&&o.point(+e(d,c,l),+t(d,c,l));if(p)return o=null,p+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:dn(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:dn(+l),n):t},n.defined=function(l){return arguments.length?(i=typeof l=="function"?l:dn(!!l),n):i},n.curve=function(l){return arguments.length?(s=l,r!=null&&(o=s(r)),n):s},n.context=function(l){return arguments.length?(l==null?r=o=null:o=s(r=l),n):r},n}class aS{constructor(t,i){this._context=t,this._x=i}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,i){switch(t=+t,i=+i,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,i,t,i):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+i)/2,t,this._y0,t,i);break}}this._x0=t,this._y0=i}}function nS(e){return new aS(e,!0)}function lS(e){return new aS(e,!1)}function ha(){}function jd(e,t,i){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+i)/6)}function Ou(e){this._context=e}Ou.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:jd(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:jd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ff(e){return new Ou(e)}function cS(e){this._context=e}cS.prototype={areaStart:ha,areaEnd:ha,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:jd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tz(e){return new cS(e)}function hS(e){this._context=e}hS.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 i=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(i,r):this._context.moveTo(i,r);break;case 3:this._point=4;default:jd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ez(e){return new hS(e)}function dS(e,t){this._basis=new Ou(e),this._beta=t}dS.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,i=e.length-1;if(i>0)for(var r=e[0],s=t[0],o=e[i]-r,a=t[i]-s,n=-1,l;++n<=i;)l=n/i,this._basis.point(this._beta*e[n]+(1-this._beta)*(r+l*o),this._beta*t[n]+(1-this._beta)*(s+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const iz=(function e(t){function i(r){return t===1?new Ou(r):new dS(r,t)}return i.beta=function(r){return e(+r)},i})(.85);function Ud(e,t,i){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-i),e._x2,e._y2)}function Bm(e,t){this._context=e,this._k=(1-t)/6}Bm.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:Ud(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:Ud(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 uS=(function e(t){function i(r){return new Bm(r,t)}return i.tension=function(r){return e(+r)},i})(0);function _m(e,t){this._context=e,this._k=(1-t)/6}_m.prototype={areaStart:ha,areaEnd:ha,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:Ud(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 rz=(function e(t){function i(r){return new _m(r,t)}return i.tension=function(r){return e(+r)},i})(0);function Lm(e,t){this._context=e,this._k=(1-t)/6}Lm.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:Ud(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 sz=(function e(t){function i(r){return new Lm(r,t)}return i.tension=function(r){return e(+r)},i})(0);function Pm(e,t,i){var r=e._x1,s=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Tx){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);r=(r*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,s=(s*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Tx){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-i*e._l12_2a)/h}e._context.bezierCurveTo(r,s,o,a,e._x2,e._y2)}function pS(e,t){this._context=e,this._alpha=t}pS.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 i=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+r*r,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:Pm(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 fS=(function e(t){function i(r){return t?new pS(r,t):new Bm(r,0)}return i.alpha=function(r){return e(+r)},i})(.5);function gS(e,t){this._context=e,this._alpha=t}gS.prototype={areaStart:ha,areaEnd:ha,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 i=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+r*r,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:Pm(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 oz=(function e(t){function i(r){return t?new gS(r,t):new _m(r,0)}return i.alpha=function(r){return e(+r)},i})(.5);function mS(e,t){this._context=e,this._alpha=t}mS.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 i=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+r*r,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:Pm(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 az=(function e(t){function i(r){return t?new mS(r,t):new Lm(r,0)}return i.alpha=function(r){return e(+r)},i})(.5);function bS(e){this._context=e}bS.prototype={areaStart:ha,areaEnd:ha,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 nz(e){return new bS(e)}function Mx(e){return e<0?-1:1}function Ax(e,t,i){var r=e._x1-e._x0,s=t-e._x1,o=(e._y1-e._y0)/(r||s<0&&-0),a=(i-e._y1)/(s||r<0&&-0),n=(o*s+a*r)/(r+s);return(Mx(o)+Mx(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(n))||0}function Bx(e,t){var i=e._x1-e._x0;return i?(3*(e._y1-e._y0)/i-t)/2:t}function Vp(e,t,i){var r=e._x0,s=e._y0,o=e._x1,a=e._y1,n=(o-r)/3;e._context.bezierCurveTo(r+n,s+n*t,o-n,a-n*i,o,a)}function Yd(e){this._context=e}Yd.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:Vp(this,this._t0,Bx(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 i=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,Vp(this,Bx(this,i=Ax(this,e,t)),i);break;default:Vp(this,this._t0,i=Ax(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=i}}};function yS(e){this._context=new xS(e)}(yS.prototype=Object.create(Yd.prototype)).point=function(e,t){Yd.prototype.point.call(this,t,e)};function xS(e){this._context=e}xS.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,i,r,s,o){this._context.bezierCurveTo(t,e,r,i,o,s)}};function vS(e){return new Yd(e)}function wS(e){return new yS(e)}function kS(e){this._context=e}kS.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,i=e.length;if(i)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),i===2)this._context.lineTo(e[1],t[1]);else for(var r=_x(e),s=_x(t),o=0,a=1;a<i;++o,++a)this._context.bezierCurveTo(r[0][o],s[0][o],r[1][o],s[1][o],e[a],t[a]);(this._line||this._line!==0&&i===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 _x(e){var t,i=e.length-1,r,s=new Array(i),o=new Array(i),a=new Array(i);for(s[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<i-1;++t)s[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(s[i-1]=2,o[i-1]=7,a[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)r=s[t]/o[t-1],o[t]-=r,a[t]-=r*a[t-1];for(s[i-1]=a[i-1]/o[i-1],t=i-2;t>=0;--t)s[t]=(a[t]-s[t+1])/o[t];for(o[i-1]=(e[i]+s[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-s[t+1];return[s,o]}function SS(e){return new kS(e)}function Nu(e,t){this._context=e,this._t=t}Nu.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 i=this._x*(1-this._t)+e*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,t)}break}}this._x=e,this._y=t}};function CS(e){return new Nu(e,.5)}function TS(e){return new Nu(e,0)}function $S(e){return new Nu(e,1)}function Jl(e,t,i){this.k=e,this.x=t,this.y=i}Jl.prototype={constructor:Jl,scale:function(e){return e===1?this:new Jl(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Jl(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+")"}};Jl.prototype;var lz=b(e=>{const{securityLevel:t}=ye();let i=me("body");if(t==="sandbox"){const o=me(`#i${e}`).node()?.contentDocument??document;i=me(o.body)}return i.select(`#${e}`)},"selectSvgElement");function MS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}b(MS,"getDefaultExportFromCjs");var Vi={},yh={},Uo={},Lx;function fl(){if(Lx)return Uo;Lx=1;function e(a){return typeof a>"u"||a===null}b(e,"isNothing");function t(a){return typeof a=="object"&&a!==null}b(t,"isObject");function i(a){return Array.isArray(a)?a:e(a)?[]:[a]}b(i,"toArray");function r(a,n){if(n){const l=Object.keys(n);for(let c=0,h=l.length;c<h;c+=1){const d=l[c];a[d]=n[d]}}return a}b(r,"extend");function s(a,n){let l="";for(let c=0;c<n;c+=1)l+=a;return l}b(s,"repeat");function o(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return b(o,"isNegativeZero"),Uo.isNothing=e,Uo.isObject=t,Uo.toArray=i,Uo.repeat=s,Uo.isNegativeZero=o,Uo.extend=r,Uo}b(fl,"requireCommon");var Kp,Px;function gl(){if(Px)return Kp;Px=1;function e(i,r){let s="";const o=i.reason||"(unknown reason)";return i.mark?(i.mark.name&&(s+='in "'+i.mark.name+'" '),s+="("+(i.mark.line+1)+":"+(i.mark.column+1)+")",!r&&i.mark.snippet&&(s+=`
1513
+ `)},"setAccDescription"),TP=b(()=>ym,"getAccDescription"),$P=b(e=>{bm=xm(e)},"setDiagramTitle"),MP=b(()=>bm,"getDiagramTitle"),lx=vt,AP=pm,ye=ei,uet=S4,pet=ca,vm=b(e=>es(e,ye()),"sanitizeText"),BP=bP,_P=b(()=>L4,"getCommonDb"),zd={},Dd=b((e,t,i)=>{zd[e]&&lx.warn(`Diagram with id ${e} already registered. Overwriting.`),zd[e]=t,i&&y4(e,i),xP(e,t.styles),t.injectUtils?.(lx,AP,ye,vm,BP,_P(),()=>{})},"registerDiagram"),Af=b(e=>{if(e in zd)return zd[e];throw new LP(e)},"getDiagram"),Vn,LP=(Vn=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},b(Vn,"DiagramNotFoundError"),Vn),PP={value:()=>{}};function P4(){for(var e=0,t=arguments.length,i={},r;e<t;++e){if(!(r=arguments[e]+"")||r in i||/[\s.]/.test(r))throw new Error("illegal type: "+r);i[r]=[]}return new rd(i)}function rd(e){this._=e}function EP(e,t){return e.trim().split(/^|\s+/).map(function(i){var r="",s=i.indexOf(".");if(s>=0&&(r=i.slice(s+1),i=i.slice(0,s)),i&&!t.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:r}})}rd.prototype=P4.prototype={constructor:rd,on:function(e,t){var i=this._,r=EP(e+"",i),s,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((s=(e=r[o]).type)&&(s=RP(i[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(s=(e=r[o]).type)i[s]=cx(i[s],e.name,t);else if(t==null)for(s in i)i[s]=cx(i[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var i in t)e[i]=t[i].slice();return new rd(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var i=new Array(s),r=0,s,o;r<s;++r)i[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,i)},apply:function(e,t,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,i)}};function RP(e,t){for(var i=0,r=e.length,s;i<r;++i)if((s=e[i]).name===t)return s.value}function cx(e,t,i){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=PP,e=e.slice(0,r).concat(e.slice(r+1));break}return i!=null&&e.push({name:t,value:i}),e}var Bf="http://www.w3.org/1999/xhtml";const hx={svg:"http://www.w3.org/2000/svg",xhtml:Bf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zu(e){var t=e+="",i=t.indexOf(":");return i>=0&&(t=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),hx.hasOwnProperty(t)?{space:hx[t],local:e}:e}function IP(e){return function(){var t=this.ownerDocument,i=this.namespaceURI;return i===Bf&&t.documentElement.namespaceURI===Bf?t.createElement(e):t.createElementNS(i,e)}}function zP(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function E4(e){var t=zu(e);return(t.local?zP:IP)(t)}function DP(){}function wm(e){return e==null?DP:function(){return this.querySelector(e)}}function FP(e){typeof e!="function"&&(e=wm(e));for(var t=this._groups,i=t.length,r=new Array(i),s=0;s<i;++s)for(var o=t[s],a=o.length,n=r[s]=new Array(a),l,c,h=0;h<a;++h)(l=o[h])&&(c=e.call(l,l.__data__,h,o))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new Or(r,this._parents)}function OP(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function NP(){return[]}function R4(e){return e==null?NP:function(){return this.querySelectorAll(e)}}function WP(e){return function(){return OP(e.apply(this,arguments))}}function qP(e){typeof e=="function"?e=WP(e):e=R4(e);for(var t=this._groups,i=t.length,r=[],s=[],o=0;o<i;++o)for(var a=t[o],n=a.length,l,c=0;c<n;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),s.push(l));return new Or(r,s)}function I4(e){return function(){return this.matches(e)}}function z4(e){return function(t){return t.matches(e)}}var HP=Array.prototype.find;function jP(e){return function(){return HP.call(this.children,e)}}function UP(){return this.firstElementChild}function YP(e){return this.select(e==null?UP:jP(typeof e=="function"?e:z4(e)))}var GP=Array.prototype.filter;function XP(){return Array.from(this.children)}function VP(e){return function(){return GP.call(this.children,e)}}function KP(e){return this.selectAll(e==null?XP:VP(typeof e=="function"?e:z4(e)))}function ZP(e){typeof e!="function"&&(e=I4(e));for(var t=this._groups,i=t.length,r=new Array(i),s=0;s<i;++s)for(var o=t[s],a=o.length,n=r[s]=[],l,c=0;c<a;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&n.push(l);return new Or(r,this._parents)}function D4(e){return new Array(e.length)}function QP(){return new Or(this._enter||this._groups.map(D4),this._parents)}function Fd(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Fd.prototype={constructor:Fd,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 JP(e){return function(){return e}}function tE(e,t,i,r,s,o){for(var a=0,n,l=t.length,c=o.length;a<c;++a)(n=t[a])?(n.__data__=o[a],r[a]=n):i[a]=new Fd(e,o[a]);for(;a<l;++a)(n=t[a])&&(s[a]=n)}function eE(e,t,i,r,s,o,a){var n,l,c=new Map,h=t.length,d=o.length,u=new Array(h),p;for(n=0;n<h;++n)(l=t[n])&&(u[n]=p=a.call(l,l.__data__,n,t)+"",c.has(p)?s[n]=l:c.set(p,l));for(n=0;n<d;++n)p=a.call(e,o[n],n,o)+"",(l=c.get(p))?(r[n]=l,l.__data__=o[n],c.delete(p)):i[n]=new Fd(e,o[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(u[n])===l&&(s[n]=l)}function iE(e){return e.__data__}function rE(e,t){if(!arguments.length)return Array.from(this,iE);var i=t?eE:tE,r=this._parents,s=this._groups;typeof e!="function"&&(e=JP(e));for(var o=s.length,a=new Array(o),n=new Array(o),l=new Array(o),c=0;c<o;++c){var h=r[c],d=s[c],u=d.length,p=sE(e.call(h,h&&h.__data__,c,r)),f=p.length,g=n[c]=new Array(f),m=a[c]=new Array(f),x=l[c]=new Array(u);i(h,d,g,m,x,p,t);for(var w=0,S=0,A,C;w<f;++w)if(A=g[w]){for(w>=S&&(S=w+1);!(C=m[S])&&++S<f;);A._next=C||null}}return a=new Or(a,r),a._enter=n,a._exit=l,a}function sE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oE(){return new Or(this._exit||this._groups.map(D4),this._parents)}function aE(e,t,i){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),i==null?o.remove():i(o),r&&s?r.merge(s).order():s}function nE(e){for(var t=e.selection?e.selection():e,i=this._groups,r=t._groups,s=i.length,o=r.length,a=Math.min(s,o),n=new Array(s),l=0;l<a;++l)for(var c=i[l],h=r[l],d=c.length,u=n[l]=new Array(d),p,f=0;f<d;++f)(p=c[f]||h[f])&&(u[f]=p);for(;l<s;++l)n[l]=i[l];return new Or(n,this._parents)}function lE(){for(var e=this._groups,t=-1,i=e.length;++t<i;)for(var r=e[t],s=r.length-1,o=r[s],a;--s>=0;)(a=r[s])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function cE(e){e||(e=hE);function t(d,u){return d&&u?e(d.__data__,u.__data__):!d-!u}for(var i=this._groups,r=i.length,s=new Array(r),o=0;o<r;++o){for(var a=i[o],n=a.length,l=s[o]=new Array(n),c,h=0;h<n;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new Or(s,this._parents).order()}function hE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function uE(){return Array.from(this)}function pE(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var a=r[s];if(a)return a}return null}function fE(){let e=0;for(const t of this)++e;return e}function gE(){return!this.node()}function mE(e){for(var t=this._groups,i=0,r=t.length;i<r;++i)for(var s=t[i],o=0,a=s.length,n;o<a;++o)(n=s[o])&&e.call(n,n.__data__,o,s);return this}function bE(e){return function(){this.removeAttribute(e)}}function yE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xE(e,t){return function(){this.setAttribute(e,t)}}function vE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function wE(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function kE(e,t){return function(){var i=t.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function SE(e,t){var i=zu(e);if(arguments.length<2){var r=this.node();return i.local?r.getAttributeNS(i.space,i.local):r.getAttribute(i)}return this.each((t==null?i.local?yE:bE:typeof t=="function"?i.local?kE:wE:i.local?vE:xE)(i,t))}function F4(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function CE(e){return function(){this.style.removeProperty(e)}}function TE(e,t,i){return function(){this.style.setProperty(e,t,i)}}function $E(e,t,i){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,i)}}function ME(e,t,i){return arguments.length>1?this.each((t==null?CE:typeof t=="function"?$E:TE)(e,t,i??"")):el(this.node(),e)}function el(e,t){return e.style.getPropertyValue(t)||F4(e).getComputedStyle(e,null).getPropertyValue(t)}function AE(e){return function(){delete this[e]}}function BE(e,t){return function(){this[e]=t}}function _E(e,t){return function(){var i=t.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function LE(e,t){return arguments.length>1?this.each((t==null?AE:typeof t=="function"?_E:BE)(e,t)):this.node()[e]}function O4(e){return e.trim().split(/^|\s+/)}function km(e){return e.classList||new N4(e)}function N4(e){this._node=e,this._names=O4(e.getAttribute("class")||"")}N4.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 W4(e,t){for(var i=km(e),r=-1,s=t.length;++r<s;)i.add(t[r])}function q4(e,t){for(var i=km(e),r=-1,s=t.length;++r<s;)i.remove(t[r])}function PE(e){return function(){W4(this,e)}}function EE(e){return function(){q4(this,e)}}function RE(e,t){return function(){(t.apply(this,arguments)?W4:q4)(this,e)}}function IE(e,t){var i=O4(e+"");if(arguments.length<2){for(var r=km(this.node()),s=-1,o=i.length;++s<o;)if(!r.contains(i[s]))return!1;return!0}return this.each((typeof t=="function"?RE:t?PE:EE)(i,t))}function zE(){this.textContent=""}function DE(e){return function(){this.textContent=e}}function FE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function OE(e){return arguments.length?this.each(e==null?zE:(typeof e=="function"?FE:DE)(e)):this.node().textContent}function NE(){this.innerHTML=""}function WE(e){return function(){this.innerHTML=e}}function qE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function HE(e){return arguments.length?this.each(e==null?NE:(typeof e=="function"?qE:WE)(e)):this.node().innerHTML}function jE(){this.nextSibling&&this.parentNode.appendChild(this)}function UE(){return this.each(jE)}function YE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function GE(){return this.each(YE)}function XE(e){var t=typeof e=="function"?e:E4(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function VE(){return null}function KE(e,t){var i=typeof e=="function"?e:E4(e),r=t==null?VE:typeof t=="function"?t:wm(t);return this.select(function(){return this.insertBefore(i.apply(this,arguments),r.apply(this,arguments)||null)})}function ZE(){var e=this.parentNode;e&&e.removeChild(this)}function QE(){return this.each(ZE)}function JE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tR(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eR(e){return this.select(e?tR:JE)}function iR(e){return arguments.length?this.property("__data__",e):this.node().__data__}function rR(e){return function(t){e.call(this,t,this.__data__)}}function sR(e){return e.trim().split(/^|\s+/).map(function(t){var i="",r=t.indexOf(".");return r>=0&&(i=t.slice(r+1),t=t.slice(0,r)),{type:t,name:i}})}function oR(e){return function(){var t=this.__on;if(t){for(var i=0,r=-1,s=t.length,o;i<s;++i)o=t[i],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function aR(e,t,i){return function(){var r=this.__on,s,o=rR(t);if(r){for(var a=0,n=r.length;a<n;++a)if((s=r[a]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=i),s.value=t;return}}this.addEventListener(e.type,o,i),s={type:e.type,name:e.name,value:t,listener:o,options:i},r?r.push(s):this.__on=[s]}}function nR(e,t,i){var r=sR(e+""),s,o=r.length,a;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(s=0,h=n[l];s<o;++s)if((a=r[s]).type===h.type&&a.name===h.name)return h.value}return}for(n=t?aR:oR,s=0;s<o;++s)this.each(n(r[s],t,i));return this}function H4(e,t,i){var r=F4(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,i):(s=r.document.createEvent("Event"),i?(s.initEvent(t,i.bubbles,i.cancelable),s.detail=i.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function lR(e,t){return function(){return H4(this,e,t)}}function cR(e,t){return function(){return H4(this,e,t.apply(this,arguments))}}function hR(e,t){return this.each((typeof t=="function"?cR:lR)(e,t))}function*dR(){for(var e=this._groups,t=0,i=e.length;t<i;++t)for(var r=e[t],s=0,o=r.length,a;s<o;++s)(a=r[s])&&(yield a)}var j4=[null];function Or(e,t){this._groups=e,this._parents=t}function jc(){return new Or([[document.documentElement]],j4)}function uR(){return this}Or.prototype=jc.prototype={constructor:Or,select:FP,selectAll:qP,selectChild:YP,selectChildren:KP,filter:ZP,data:rE,enter:QP,exit:oE,join:aE,merge:nE,selection:uR,order:lE,sort:cE,call:dE,nodes:uE,node:pE,size:fE,empty:gE,each:mE,attr:SE,style:ME,property:LE,classed:IE,text:OE,html:HE,raise:UE,lower:GE,append:XE,insert:KE,remove:QE,clone:eR,datum:iR,on:nR,dispatch:hR,[Symbol.iterator]:dR};function me(e){return typeof e=="string"?new Or([[document.querySelector(e)]],[document.documentElement]):new Or([[e]],j4)}function Sm(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function U4(e,t){var i=Object.create(e.prototype);for(var r in t)i[r]=t[r];return i}function Uc(){}var Tc=.7,Od=1/Tc,En="\\s*([+-]?\\d+)\\s*",$c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pR=/^#([0-9a-f]{3,8})$/,fR=new RegExp(`^rgb\\(${En},${En},${En}\\)$`),gR=new RegExp(`^rgb\\(${Hs},${Hs},${Hs}\\)$`),mR=new RegExp(`^rgba\\(${En},${En},${En},${$c}\\)$`),bR=new RegExp(`^rgba\\(${Hs},${Hs},${Hs},${$c}\\)$`),yR=new RegExp(`^hsl\\(${$c},${Hs},${Hs}\\)$`),xR=new RegExp(`^hsla\\(${$c},${Hs},${Hs},${$c}\\)$`),dx={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};Sm(Uc,Mc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ux,formatHex:ux,formatHex8:vR,formatHsl:wR,formatRgb:px,toString:px});function ux(){return this.rgb().formatHex()}function vR(){return this.rgb().formatHex8()}function wR(){return Y4(this).formatHsl()}function px(){return this.rgb().formatRgb()}function Mc(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=pR.exec(e))?(i=t[1].length,t=parseInt(t[1],16),i===6?fx(t):i===3?new Cr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):i===8?gh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):i===4?gh(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=fR.exec(e))?new Cr(t[1],t[2],t[3],1):(t=gR.exec(e))?new Cr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mR.exec(e))?gh(t[1],t[2],t[3],t[4]):(t=bR.exec(e))?gh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yR.exec(e))?bx(t[1],t[2]/100,t[3]/100,1):(t=xR.exec(e))?bx(t[1],t[2]/100,t[3]/100,t[4]):dx.hasOwnProperty(e)?fx(dx[e]):e==="transparent"?new Cr(NaN,NaN,NaN,0):null}function fx(e){return new Cr(e>>16&255,e>>8&255,e&255,1)}function gh(e,t,i,r){return r<=0&&(e=t=i=NaN),new Cr(e,t,i,r)}function kR(e){return e instanceof Uc||(e=Mc(e)),e?(e=e.rgb(),new Cr(e.r,e.g,e.b,e.opacity)):new Cr}function _f(e,t,i,r){return arguments.length===1?kR(e):new Cr(e,t,i,r??1)}function Cr(e,t,i,r){this.r=+e,this.g=+t,this.b=+i,this.opacity=+r}Sm(Cr,_f,U4(Uc,{brighter(e){return e=e==null?Od:Math.pow(Od,e),new Cr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Tc:Math.pow(Tc,e),new Cr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Cr(qa(this.r),qa(this.g),qa(this.b),Nd(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:gx,formatHex:gx,formatHex8:SR,formatRgb:mx,toString:mx}));function gx(){return`#${Oa(this.r)}${Oa(this.g)}${Oa(this.b)}`}function SR(){return`#${Oa(this.r)}${Oa(this.g)}${Oa(this.b)}${Oa((isNaN(this.opacity)?1:this.opacity)*255)}`}function mx(){const e=Nd(this.opacity);return`${e===1?"rgb(":"rgba("}${qa(this.r)}, ${qa(this.g)}, ${qa(this.b)}${e===1?")":`, ${e})`}`}function Nd(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oa(e){return e=qa(e),(e<16?"0":"")+e.toString(16)}function bx(e,t,i,r){return r<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new ys(e,t,i,r)}function Y4(e){if(e instanceof ys)return new ys(e.h,e.s,e.l,e.opacity);if(e instanceof Uc||(e=Mc(e)),!e)return new ys;if(e instanceof ys)return e;e=e.rgb();var t=e.r/255,i=e.g/255,r=e.b/255,s=Math.min(t,i,r),o=Math.max(t,i,r),a=NaN,n=o-s,l=(o+s)/2;return n?(t===o?a=(i-r)/n+(i<r)*6:i===o?a=(r-t)/n+2:a=(t-i)/n+4,n/=l<.5?o+s:2-o-s,a*=60):n=l>0&&l<1?0:a,new ys(a,n,l,e.opacity)}function CR(e,t,i,r){return arguments.length===1?Y4(e):new ys(e,t,i,r??1)}function ys(e,t,i,r){this.h=+e,this.s=+t,this.l=+i,this.opacity=+r}Sm(ys,CR,U4(Uc,{brighter(e){return e=e==null?Od:Math.pow(Od,e),new ys(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Tc:Math.pow(Tc,e),new ys(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,i=this.l,r=i+(i<.5?i:1-i)*t,s=2*i-r;return new Cr(Gp(e>=240?e-240:e+120,s,r),Gp(e,s,r),Gp(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new ys(yx(this.h),mh(this.s),mh(this.l),Nd(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=Nd(this.opacity);return`${e===1?"hsl(":"hsla("}${yx(this.h)}, ${mh(this.s)*100}%, ${mh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function yx(e){return e=(e||0)%360,e<0?e+360:e}function mh(e){return Math.max(0,Math.min(1,e||0))}function Gp(e,t,i){return(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)*255}const Cm=e=>()=>e;function G4(e,t){return function(i){return e+i*t}}function TR(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(r){return Math.pow(e+r*t,i)}}function fet(e,t){var i=t-e;return i?G4(e,i>180||i<-180?i-360*Math.round(i/360):i):Cm(isNaN(e)?t:e)}function $R(e){return(e=+e)==1?X4:function(t,i){return i-t?TR(t,i,e):Cm(isNaN(t)?i:t)}}function X4(e,t){var i=t-e;return i?G4(e,i):Cm(isNaN(e)?t:e)}const xx=(function e(t){var i=$R(t);function r(s,o){var a=i((s=_f(s)).r,(o=_f(o)).r),n=i(s.g,o.g),l=i(s.b,o.b),c=X4(s.opacity,o.opacity);return function(h){return s.r=a(h),s.g=n(h),s.b=l(h),s.opacity=c(h),s+""}}return r.gamma=e,r})(1);function Qo(e,t){return e=+e,t=+t,function(i){return e*(1-i)+t*i}}var Lf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xp=new RegExp(Lf.source,"g");function MR(e){return function(){return e}}function AR(e){return function(t){return e(t)+""}}function BR(e,t){var i=Lf.lastIndex=Xp.lastIndex=0,r,s,o,a=-1,n=[],l=[];for(e=e+"",t=t+"";(r=Lf.exec(e))&&(s=Xp.exec(t));)(o=s.index)>i&&(o=t.slice(i,o),n[a]?n[a]+=o:n[++a]=o),(r=r[0])===(s=s[0])?n[a]?n[a]+=s:n[++a]=s:(n[++a]=null,l.push({i:a,x:Qo(r,s)})),i=Xp.lastIndex;return i<t.length&&(o=t.slice(i),n[a]?n[a]+=o:n[++a]=o),n.length<2?l[0]?AR(l[0].x):MR(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 vx=180/Math.PI,Pf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function V4(e,t,i,r,s,o){var a,n,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*i+t*r)&&(i-=e*l,r-=t*l),(n=Math.sqrt(i*i+r*r))&&(i/=n,r/=n,l/=n),e*r<t*i&&(e=-e,t=-t,l=-l,a=-a),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*vx,skewX:Math.atan(l)*vx,scaleX:a,scaleY:n}}var bh;function _R(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Pf:V4(t.a,t.b,t.c,t.d,t.e,t.f)}function LR(e){return e==null||(bh||(bh=document.createElementNS("http://www.w3.org/2000/svg","g")),bh.setAttribute("transform",e),!(e=bh.transform.baseVal.consolidate()))?Pf:(e=e.matrix,V4(e.a,e.b,e.c,e.d,e.e,e.f))}function K4(e,t,i,r){function s(c){return c.length?c.pop()+" ":""}function o(c,h,d,u,p,f){if(c!==d||h!==u){var g=p.push("translate(",null,t,null,i);f.push({i:g-4,x:Qo(c,d)},{i:g-2,x:Qo(h,u)})}else(d||u)&&p.push("translate("+d+t+u+i)}function a(c,h,d,u){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),u.push({i:d.push(s(d)+"rotate(",null,r)-2,x:Qo(c,h)})):h&&d.push(s(d)+"rotate("+h+r)}function n(c,h,d,u){c!==h?u.push({i:d.push(s(d)+"skewX(",null,r)-2,x:Qo(c,h)}):h&&d.push(s(d)+"skewX("+h+r)}function l(c,h,d,u,p,f){if(c!==d||h!==u){var g=p.push(s(p)+"scale(",null,",",null,")");f.push({i:g-4,x:Qo(c,d)},{i:g-2,x:Qo(h,u)})}else(d!==1||u!==1)&&p.push(s(p)+"scale("+d+","+u+")")}return function(c,h){var d=[],u=[];return c=e(c),h=e(h),o(c.translateX,c.translateY,h.translateX,h.translateY,d,u),a(c.rotate,h.rotate,d,u),n(c.skewX,h.skewX,d,u),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,u),c=h=null,function(p){for(var f=-1,g=u.length,m;++f<g;)d[(m=u[f]).i]=m.x(p);return d.join("")}}}var PR=K4(_R,"px, ","px)","deg)"),ER=K4(LR,", ",")",")"),il=0,Zl=0,Rl=0,Z4=1e3,Wd,Ql,qd=0,Xa=0,Du=0,Ac=typeof performance=="object"&&performance.now?performance:Date,Q4=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Tm(){return Xa||(Q4(RR),Xa=Ac.now()+Du)}function RR(){Xa=0}function Hd(){this._call=this._time=this._next=null}Hd.prototype=J4.prototype={constructor:Hd,restart:function(e,t,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Tm():+i)+(t==null?0:+t),!this._next&&Ql!==this&&(Ql?Ql._next=this:Wd=this,Ql=this),this._call=e,this._time=i,Ef()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ef())}};function J4(e,t,i){var r=new Hd;return r.restart(e,t,i),r}function IR(){Tm(),++il;for(var e=Wd,t;e;)(t=Xa-e._time)>=0&&e._call.call(void 0,t),e=e._next;--il}function wx(){Xa=(qd=Ac.now())+Du,il=Zl=0;try{IR()}finally{il=0,DR(),Xa=0}}function zR(){var e=Ac.now(),t=e-qd;t>Z4&&(Du-=t,qd=e)}function DR(){for(var e,t=Wd,i,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(i=t._next,t._next=null,t=e?e._next=i:Wd=i);Ql=e,Ef(r)}function Ef(e){if(!il){Zl&&(Zl=clearTimeout(Zl));var t=e-Xa;t>24?(e<1/0&&(Zl=setTimeout(wx,e-Ac.now()-Du)),Rl&&(Rl=clearInterval(Rl))):(Rl||(qd=Ac.now(),Rl=setInterval(zR,Z4)),il=1,Q4(wx))}}function kx(e,t,i){var r=new Hd;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,i),r}var FR=P4("start","end","cancel","interrupt"),OR=[],tS=0,Sx=1,Rf=2,sd=3,Cx=4,If=5,od=6;function Fu(e,t,i,r,s,o){var a=e.__transition;if(!a)e.__transition={};else if(i in a)return;NR(e,i,{name:t,index:r,group:s,on:FR,tween:OR,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:tS})}function $m(e,t){var i=As(e,t);if(i.state>tS)throw new Error("too late; already scheduled");return i}function Js(e,t){var i=As(e,t);if(i.state>sd)throw new Error("too late; already running");return i}function As(e,t){var i=e.__transition;if(!i||!(i=i[t]))throw new Error("transition not found");return i}function NR(e,t,i){var r=e.__transition,s;r[t]=i,i.timer=J4(o,0,i.time);function o(c){i.state=Sx,i.timer.restart(a,i.delay,i.time),i.delay<=c&&a(c-i.delay)}function a(c){var h,d,u,p;if(i.state!==Sx)return l();for(h in r)if(p=r[h],p.name===i.name){if(p.state===sd)return kx(a);p.state===Cx?(p.state=od,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[h]):+h<t&&(p.state=od,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[h])}if(kx(function(){i.state===sd&&(i.state=Cx,i.timer.restart(n,i.delay,i.time),n(c))}),i.state=Rf,i.on.call("start",e,e.__data__,i.index,i.group),i.state===Rf){for(i.state=sd,s=new Array(u=i.tween.length),h=0,d=-1;h<u;++h)(p=i.tween[h].value.call(e,e.__data__,i.index,i.group))&&(s[++d]=p);s.length=d+1}}function n(c){for(var h=c<i.duration?i.ease.call(null,c/i.duration):(i.timer.restart(l),i.state=If,1),d=-1,u=s.length;++d<u;)s[d].call(e,h);i.state===If&&(i.on.call("end",e,e.__data__,i.index,i.group),l())}function l(){i.state=od,i.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function WR(e,t){var i=e.__transition,r,s,o=!0,a;if(i){t=t==null?null:t+"";for(a in i){if((r=i[a]).name!==t){o=!1;continue}s=r.state>Rf&&r.state<If,r.state=od,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete i[a]}o&&delete e.__transition}}function qR(e){return this.each(function(){WR(this,e)})}function HR(e,t){var i,r;return function(){var s=Js(this,e),o=s.tween;if(o!==i){r=i=o;for(var a=0,n=r.length;a<n;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}s.tween=r}}function jR(e,t,i){var r,s;if(typeof i!="function")throw new Error;return function(){var o=Js(this,e),a=o.tween;if(a!==r){s=(r=a).slice();for(var n={name:t,value:i},l=0,c=s.length;l<c;++l)if(s[l].name===t){s[l]=n;break}l===c&&s.push(n)}o.tween=s}}function UR(e,t){var i=this._id;if(e+="",arguments.length<2){for(var r=As(this.node(),i).tween,s=0,o=r.length,a;s<o;++s)if((a=r[s]).name===e)return a.value;return null}return this.each((t==null?HR:jR)(i,e,t))}function Mm(e,t,i){var r=e._id;return e.each(function(){var s=Js(this,r);(s.value||(s.value={}))[t]=i.apply(this,arguments)}),function(s){return As(s,r).value[t]}}function eS(e,t){var i;return(typeof t=="number"?Qo:t instanceof Mc?xx:(i=Mc(t))?(t=i,xx):BR)(e,t)}function YR(e){return function(){this.removeAttribute(e)}}function GR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function XR(e,t,i){var r,s=i+"",o;return function(){var a=this.getAttribute(e);return a===s?null:a===r?o:o=t(r=a,i)}}function VR(e,t,i){var r,s=i+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===s?null:a===r?o:o=t(r=a,i)}}function KR(e,t,i){var r,s,o;return function(){var a,n=i(this),l;return n==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=n+"",a===l?null:a===r&&l===s?o:(s=l,o=t(r=a,n)))}}function ZR(e,t,i){var r,s,o;return function(){var a,n=i(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===r&&l===s?o:(s=l,o=t(r=a,n)))}}function QR(e,t){var i=zu(e),r=i==="transform"?ER:eS;return this.attrTween(e,typeof t=="function"?(i.local?ZR:KR)(i,r,Mm(this,"attr."+e,t)):t==null?(i.local?GR:YR)(i):(i.local?VR:XR)(i,r,t))}function JR(e,t){return function(i){this.setAttribute(e,t.call(this,i))}}function tI(e,t){return function(i){this.setAttributeNS(e.space,e.local,t.call(this,i))}}function eI(e,t){var i,r;function s(){var o=t.apply(this,arguments);return o!==r&&(i=(r=o)&&tI(e,o)),i}return s._value=t,s}function iI(e,t){var i,r;function s(){var o=t.apply(this,arguments);return o!==r&&(i=(r=o)&&JR(e,o)),i}return s._value=t,s}function rI(e,t){var i="attr."+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;var r=zu(e);return this.tween(i,(r.local?eI:iI)(r,t))}function sI(e,t){return function(){$m(this,e).delay=+t.apply(this,arguments)}}function oI(e,t){return t=+t,function(){$m(this,e).delay=t}}function aI(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?sI:oI)(t,e)):As(this.node(),t).delay}function nI(e,t){return function(){Js(this,e).duration=+t.apply(this,arguments)}}function lI(e,t){return t=+t,function(){Js(this,e).duration=t}}function cI(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?nI:lI)(t,e)):As(this.node(),t).duration}function hI(e,t){if(typeof t!="function")throw new Error;return function(){Js(this,e).ease=t}}function dI(e){var t=this._id;return arguments.length?this.each(hI(t,e)):As(this.node(),t).ease}function uI(e,t){return function(){var i=t.apply(this,arguments);if(typeof i!="function")throw new Error;Js(this,e).ease=i}}function pI(e){if(typeof e!="function")throw new Error;return this.each(uI(this._id,e))}function fI(e){typeof e!="function"&&(e=I4(e));for(var t=this._groups,i=t.length,r=new Array(i),s=0;s<i;++s)for(var o=t[s],a=o.length,n=r[s]=[],l,c=0;c<a;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&n.push(l);return new Co(r,this._parents,this._name,this._id)}function gI(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,i=e._groups,r=t.length,s=i.length,o=Math.min(r,s),a=new Array(r),n=0;n<o;++n)for(var l=t[n],c=i[n],h=l.length,d=a[n]=new Array(h),u,p=0;p<h;++p)(u=l[p]||c[p])&&(d[p]=u);for(;n<r;++n)a[n]=t[n];return new Co(a,this._parents,this._name,this._id)}function mI(e){return(e+"").trim().split(/^|\s+/).every(function(t){var i=t.indexOf(".");return i>=0&&(t=t.slice(0,i)),!t||t==="start"})}function bI(e,t,i){var r,s,o=mI(t)?$m:Js;return function(){var a=o(this,e),n=a.on;n!==r&&(s=(r=n).copy()).on(t,i),a.on=s}}function yI(e,t){var i=this._id;return arguments.length<2?As(this.node(),i).on.on(e):this.each(bI(i,e,t))}function xI(e){return function(){var t=this.parentNode;for(var i in this.__transition)if(+i!==e)return;t&&t.removeChild(this)}}function vI(){return this.on("end.remove",xI(this._id))}function wI(e){var t=this._name,i=this._id;typeof e!="function"&&(e=wm(e));for(var r=this._groups,s=r.length,o=new Array(s),a=0;a<s;++a)for(var n=r[a],l=n.length,c=o[a]=new Array(l),h,d,u=0;u<l;++u)(h=n[u])&&(d=e.call(h,h.__data__,u,n))&&("__data__"in h&&(d.__data__=h.__data__),c[u]=d,Fu(c[u],t,i,u,c,As(h,i)));return new Co(o,this._parents,t,i)}function kI(e){var t=this._name,i=this._id;typeof e!="function"&&(e=R4(e));for(var r=this._groups,s=r.length,o=[],a=[],n=0;n<s;++n)for(var l=r[n],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var u=e.call(h,h.__data__,d,l),p,f=As(h,i),g=0,m=u.length;g<m;++g)(p=u[g])&&Fu(p,t,i,g,u,f);o.push(u),a.push(h)}return new Co(o,a,t,i)}var SI=jc.prototype.constructor;function CI(){return new SI(this._groups,this._parents)}function TI(e,t){var i,r,s;return function(){var o=el(this,e),a=(this.style.removeProperty(e),el(this,e));return o===a?null:o===i&&a===r?s:s=t(i=o,r=a)}}function iS(e){return function(){this.style.removeProperty(e)}}function $I(e,t,i){var r,s=i+"",o;return function(){var a=el(this,e);return a===s?null:a===r?o:o=t(r=a,i)}}function MI(e,t,i){var r,s,o;return function(){var a=el(this,e),n=i(this),l=n+"";return n==null&&(l=n=(this.style.removeProperty(e),el(this,e))),a===l?null:a===r&&l===s?o:(s=l,o=t(r=a,n))}}function AI(e,t){var i,r,s,o="style."+t,a="end."+o,n;return function(){var l=Js(this,e),c=l.on,h=l.value[o]==null?n||(n=iS(t)):void 0;(c!==i||s!==h)&&(r=(i=c).copy()).on(a,s=h),l.on=r}}function BI(e,t,i){var r=(e+="")=="transform"?PR:eS;return t==null?this.styleTween(e,TI(e,r)).on("end.style."+e,iS(e)):typeof t=="function"?this.styleTween(e,MI(e,r,Mm(this,"style."+e,t))).each(AI(this._id,e)):this.styleTween(e,$I(e,r,t),i).on("end.style."+e,null)}function _I(e,t,i){return function(r){this.style.setProperty(e,t.call(this,r),i)}}function LI(e,t,i){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&_I(e,a,i)),r}return o._value=t,o}function PI(e,t,i){var r="style."+(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;return this.tween(r,LI(e,t,i??""))}function EI(e){return function(){this.textContent=e}}function RI(e){return function(){var t=e(this);this.textContent=t??""}}function II(e){return this.tween("text",typeof e=="function"?RI(Mm(this,"text",e)):EI(e==null?"":e+""))}function zI(e){return function(t){this.textContent=e.call(this,t)}}function DI(e){var t,i;function r(){var s=e.apply(this,arguments);return s!==i&&(t=(i=s)&&zI(s)),t}return r._value=e,r}function FI(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,DI(e))}function OI(){for(var e=this._name,t=this._id,i=rS(),r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],n=a.length,l,c=0;c<n;++c)if(l=a[c]){var h=As(l,t);Fu(l,e,i,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Co(r,this._parents,e,i)}function NI(){var e,t,i=this,r=i._id,s=i.size();return new Promise(function(o,a){var n={value:a},l={value:function(){--s===0&&o()}};i.each(function(){var c=Js(this,r),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(n),t._.interrupt.push(n),t._.end.push(l)),c.on=t}),s===0&&o()})}var WI=0;function Co(e,t,i,r){this._groups=e,this._parents=t,this._name=i,this._id=r}function rS(){return++WI}var ho=jc.prototype;Co.prototype={constructor:Co,select:wI,selectAll:kI,selectChild:ho.selectChild,selectChildren:ho.selectChildren,filter:fI,merge:gI,selection:CI,transition:OI,call:ho.call,nodes:ho.nodes,node:ho.node,size:ho.size,empty:ho.empty,each:ho.each,on:yI,attr:QR,attrTween:rI,style:BI,styleTween:PI,text:II,textTween:FI,remove:vI,tween:UR,delay:aI,duration:cI,ease:dI,easeVarying:pI,end:NI,[Symbol.iterator]:ho[Symbol.iterator]};function qI(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var HI={time:null,delay:0,duration:250,ease:qI};function jI(e,t){for(var i;!(i=e.__transition)||!(i=i[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return i}function UI(e){var t,i;e instanceof Co?(t=e._id,e=e._name):(t=rS(),(i=HI).time=Tm(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var a=r[o],n=a.length,l,c=0;c<n;++c)(l=a[c])&&Fu(l,e,t,c,a,i||jI(l,t));return new Co(r,this._parents,e,t)}jc.prototype.interrupt=qR;jc.prototype.transition=UI;const zf=Math.PI,Df=2*zf,Ea=1e-6,YI=Df-Ea;function sS(e){this._+=e[0];for(let t=1,i=e.length;t<i;++t)this._+=arguments[t]+e[t]}function GI(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return sS;const i=10**t;return function(r){this._+=r[0];for(let s=1,o=r.length;s<o;++s)this._+=Math.round(arguments[s]*i)/i+r[s]}}class XI{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?sS:GI(t)}moveTo(t,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+i}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,i){this._append`L${this._x1=+t},${this._y1=+i}`}quadraticCurveTo(t,i,r,s){this._append`Q${+t},${+i},${this._x1=+r},${this._y1=+s}`}bezierCurveTo(t,i,r,s,o,a){this._append`C${+t},${+i},${+r},${+s},${this._x1=+o},${this._y1=+a}`}arcTo(t,i,r,s,o){if(t=+t,i=+i,r=+r,s=+s,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,n=this._y1,l=r-t,c=s-i,h=a-t,d=n-i,u=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=i}`;else if(u>Ea)if(!(Math.abs(d*l-c*h)>Ea)||!o)this._append`L${this._x1=t},${this._y1=i}`;else{let p=r-a,f=s-n,g=l*l+c*c,m=p*p+f*f,x=Math.sqrt(g),w=Math.sqrt(u),S=o*Math.tan((zf-Math.acos((g+u-m)/(2*x*w)))/2),A=S/w,C=S/x;Math.abs(A-1)>Ea&&this._append`L${t+A*h},${i+A*d}`,this._append`A${o},${o},0,0,${+(d*p>h*f)},${this._x1=t+C*l},${this._y1=i+C*c}`}}arc(t,i,r,s,o,a){if(t=+t,i=+i,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let n=r*Math.cos(s),l=r*Math.sin(s),c=t+n,h=i+l,d=1^a,u=a?s-o:o-s;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>Ea||Math.abs(this._y1-h)>Ea)&&this._append`L${c},${h}`,r&&(u<0&&(u=u%Df+Df),u>YI?this._append`A${r},${r},0,1,${d},${t-n},${i-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=h}`:u>Ea&&this._append`A${r},${r},0,${+(u>=zf)},${d},${this._x1=t+r*Math.cos(o)},${this._y1=i+r*Math.sin(o)}`)}rect(t,i,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+i}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function dn(e){return function(){return e}}const get=Math.abs,met=Math.atan2,bet=Math.cos,yet=Math.max,xet=Math.min,vet=Math.sin,wet=Math.sqrt,Tx=1e-12,Am=Math.PI,$x=Am/2,ket=2*Am;function Cet(e){return e>1?0:e<-1?Am:Math.acos(e)}function Tet(e){return e>=1?$x:e<=-1?-$x:Math.asin(e)}function VI(e){let t=3;return e.digits=function(i){if(!arguments.length)return t;if(i==null)t=null;else{const r=Math.floor(i);if(!(r>=0))throw new RangeError(`invalid digits: ${i}`);t=r}return e},()=>new XI(t)}function KI(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oS(e){this._context=e}oS.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 fc(e){return new oS(e)}function ZI(e){return e[0]}function QI(e){return e[1]}function JI(e,t){var i=dn(!0),r=null,s=fc,o=null,a=VI(n);e=typeof e=="function"?e:e===void 0?ZI:dn(e),t=typeof t=="function"?t:t===void 0?QI:dn(t);function n(l){var c,h=(l=KI(l)).length,d,u=!1,p;for(r==null&&(o=s(p=a())),c=0;c<=h;++c)!(c<h&&i(d=l[c],c,l))===u&&((u=!u)?o.lineStart():o.lineEnd()),u&&o.point(+e(d,c,l),+t(d,c,l));if(p)return o=null,p+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:dn(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:dn(+l),n):t},n.defined=function(l){return arguments.length?(i=typeof l=="function"?l:dn(!!l),n):i},n.curve=function(l){return arguments.length?(s=l,r!=null&&(o=s(r)),n):s},n.context=function(l){return arguments.length?(l==null?r=o=null:o=s(r=l),n):r},n}class aS{constructor(t,i){this._context=t,this._x=i}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,i){switch(t=+t,i=+i,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,i,t,i):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+i)/2,t,this._y0,t,i);break}}this._x0=t,this._y0=i}}function nS(e){return new aS(e,!0)}function lS(e){return new aS(e,!1)}function ha(){}function jd(e,t,i){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+i)/6)}function Ou(e){this._context=e}Ou.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:jd(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:jd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ff(e){return new Ou(e)}function cS(e){this._context=e}cS.prototype={areaStart:ha,areaEnd:ha,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:jd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tz(e){return new cS(e)}function hS(e){this._context=e}hS.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 i=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(i,r):this._context.moveTo(i,r);break;case 3:this._point=4;default:jd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ez(e){return new hS(e)}function dS(e,t){this._basis=new Ou(e),this._beta=t}dS.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,i=e.length-1;if(i>0)for(var r=e[0],s=t[0],o=e[i]-r,a=t[i]-s,n=-1,l;++n<=i;)l=n/i,this._basis.point(this._beta*e[n]+(1-this._beta)*(r+l*o),this._beta*t[n]+(1-this._beta)*(s+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const iz=(function e(t){function i(r){return t===1?new Ou(r):new dS(r,t)}return i.beta=function(r){return e(+r)},i})(.85);function Ud(e,t,i){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-i),e._x2,e._y2)}function Bm(e,t){this._context=e,this._k=(1-t)/6}Bm.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:Ud(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:Ud(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 uS=(function e(t){function i(r){return new Bm(r,t)}return i.tension=function(r){return e(+r)},i})(0);function _m(e,t){this._context=e,this._k=(1-t)/6}_m.prototype={areaStart:ha,areaEnd:ha,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:Ud(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 rz=(function e(t){function i(r){return new _m(r,t)}return i.tension=function(r){return e(+r)},i})(0);function Lm(e,t){this._context=e,this._k=(1-t)/6}Lm.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:Ud(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 sz=(function e(t){function i(r){return new Lm(r,t)}return i.tension=function(r){return e(+r)},i})(0);function Pm(e,t,i){var r=e._x1,s=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Tx){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);r=(r*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,s=(s*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Tx){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-i*e._l12_2a)/h}e._context.bezierCurveTo(r,s,o,a,e._x2,e._y2)}function pS(e,t){this._context=e,this._alpha=t}pS.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 i=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+r*r,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:Pm(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 fS=(function e(t){function i(r){return t?new pS(r,t):new Bm(r,0)}return i.alpha=function(r){return e(+r)},i})(.5);function gS(e,t){this._context=e,this._alpha=t}gS.prototype={areaStart:ha,areaEnd:ha,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 i=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+r*r,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:Pm(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 oz=(function e(t){function i(r){return t?new gS(r,t):new _m(r,0)}return i.alpha=function(r){return e(+r)},i})(.5);function mS(e,t){this._context=e,this._alpha=t}mS.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 i=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+r*r,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:Pm(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 az=(function e(t){function i(r){return t?new mS(r,t):new Lm(r,0)}return i.alpha=function(r){return e(+r)},i})(.5);function bS(e){this._context=e}bS.prototype={areaStart:ha,areaEnd:ha,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 nz(e){return new bS(e)}function Mx(e){return e<0?-1:1}function Ax(e,t,i){var r=e._x1-e._x0,s=t-e._x1,o=(e._y1-e._y0)/(r||s<0&&-0),a=(i-e._y1)/(s||r<0&&-0),n=(o*s+a*r)/(r+s);return(Mx(o)+Mx(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(n))||0}function Bx(e,t){var i=e._x1-e._x0;return i?(3*(e._y1-e._y0)/i-t)/2:t}function Vp(e,t,i){var r=e._x0,s=e._y0,o=e._x1,a=e._y1,n=(o-r)/3;e._context.bezierCurveTo(r+n,s+n*t,o-n,a-n*i,o,a)}function Yd(e){this._context=e}Yd.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:Vp(this,this._t0,Bx(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 i=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,Vp(this,Bx(this,i=Ax(this,e,t)),i);break;default:Vp(this,this._t0,i=Ax(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=i}}};function yS(e){this._context=new xS(e)}(yS.prototype=Object.create(Yd.prototype)).point=function(e,t){Yd.prototype.point.call(this,t,e)};function xS(e){this._context=e}xS.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,i,r,s,o){this._context.bezierCurveTo(t,e,r,i,o,s)}};function vS(e){return new Yd(e)}function wS(e){return new yS(e)}function kS(e){this._context=e}kS.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,i=e.length;if(i)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),i===2)this._context.lineTo(e[1],t[1]);else for(var r=_x(e),s=_x(t),o=0,a=1;a<i;++o,++a)this._context.bezierCurveTo(r[0][o],s[0][o],r[1][o],s[1][o],e[a],t[a]);(this._line||this._line!==0&&i===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 _x(e){var t,i=e.length-1,r,s=new Array(i),o=new Array(i),a=new Array(i);for(s[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<i-1;++t)s[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(s[i-1]=2,o[i-1]=7,a[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)r=s[t]/o[t-1],o[t]-=r,a[t]-=r*a[t-1];for(s[i-1]=a[i-1]/o[i-1],t=i-2;t>=0;--t)s[t]=(a[t]-s[t+1])/o[t];for(o[i-1]=(e[i]+s[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-s[t+1];return[s,o]}function SS(e){return new kS(e)}function Nu(e,t){this._context=e,this._t=t}Nu.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 i=this._x*(1-this._t)+e*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,t)}break}}this._x=e,this._y=t}};function CS(e){return new Nu(e,.5)}function TS(e){return new Nu(e,0)}function $S(e){return new Nu(e,1)}function Jl(e,t,i){this.k=e,this.x=t,this.y=i}Jl.prototype={constructor:Jl,scale:function(e){return e===1?this:new Jl(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Jl(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+")"}};Jl.prototype;var lz=b(e=>{const{securityLevel:t}=ye();let i=me("body");if(t==="sandbox"){const o=me(`#i${e}`).node()?.contentDocument??document;i=me(o.body)}return i.select(`#${e}`)},"selectSvgElement");function MS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}b(MS,"getDefaultExportFromCjs");var Vi={},yh={},Uo={},Lx;function fl(){if(Lx)return Uo;Lx=1;function e(a){return typeof a>"u"||a===null}b(e,"isNothing");function t(a){return typeof a=="object"&&a!==null}b(t,"isObject");function i(a){return Array.isArray(a)?a:e(a)?[]:[a]}b(i,"toArray");function r(a,n){if(n){const l=Object.keys(n);for(let c=0,h=l.length;c<h;c+=1){const d=l[c];a[d]=n[d]}}return a}b(r,"extend");function s(a,n){let l="";for(let c=0;c<n;c+=1)l+=a;return l}b(s,"repeat");function o(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return b(o,"isNegativeZero"),Uo.isNothing=e,Uo.isObject=t,Uo.toArray=i,Uo.repeat=s,Uo.isNegativeZero=o,Uo.extend=r,Uo}b(fl,"requireCommon");var Kp,Px;function gl(){if(Px)return Kp;Px=1;function e(i,r){let s="";const o=i.reason||"(unknown reason)";return i.mark?(i.mark.name&&(s+='in "'+i.mark.name+'" '),s+="("+(i.mark.line+1)+":"+(i.mark.column+1)+")",!r&&i.mark.snippet&&(s+=`
1514
1514
 
1515
1515
  `+i.mark.snippet),o+" "+s):o}b(e,"formatError");function t(i,r){Error.call(this),this.name="YAMLException",this.reason=i,this.mark=r,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return b(t,"YAMLException2"),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=b(function(r){return this.name+": "+e(this,r)},"toString"),Kp=t,Kp}b(gl,"requireException");var Zp,Ex;function AS(){if(Ex)return Zp;Ex=1;const e=fl();function t(s,o,a,n,l){let c="",h="";const d=Math.floor(l/2)-1;return n-o>d&&(c=" ... ",o=n-d+c.length),a-n>d&&(h=" ...",a=n+d-h.length),{str:c+s.slice(o,a).replace(/\t/g,"→")+h,pos:n-o+c.length}}b(t,"getLine");function i(s,o){return e.repeat(" ",o-s.length)+s}b(i,"padStart");function r(s,o){if(o=Object.create(o||null),!s.buffer)return null;o.maxLength||(o.maxLength=79),typeof o.indent!="number"&&(o.indent=1),typeof o.linesBefore!="number"&&(o.linesBefore=3),typeof o.linesAfter!="number"&&(o.linesAfter=2);const a=/\r?\n|\r|\0/g,n=[0],l=[];let c,h=-1;for(;c=a.exec(s.buffer);)l.push(c.index),n.push(c.index+c[0].length),s.position<=c.index&&h<0&&(h=n.length-2);h<0&&(h=n.length-1);let d="";const u=Math.min(s.line+o.linesAfter,l.length).toString().length,p=o.maxLength-(o.indent+u+3);for(let g=1;g<=o.linesBefore&&!(h-g<0);g++){const m=t(s.buffer,n[h-g],l[h-g],s.position-(n[h]-n[h-g]),p);d=e.repeat(" ",o.indent)+i((s.line-g+1).toString(),u)+" | "+m.str+`
1516
1516
  `+d}const f=t(s.buffer,n[h],l[h],s.position,p);d+=e.repeat(" ",o.indent)+i((s.line+1).toString(),u)+" | "+f.str+`
@@ -1541,8 +1541,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1541
1541
  `+_.slice(xt,At),xt=At+1),St=Xt;return qt+=`
1542
1542
  `,_.length-xt>et&&St>xt?qt+=_.slice(xt,St)+`
1543
1543
  `+_.slice(St+1):qt+=_.slice(xt),qt.slice(1)}b(Te,"foldLine");function si(_){let et="",Tt=0;for(let bt=0;bt<_.length;Tt>=65536?bt+=2:bt++){Tt=ot(_,bt);const xt=D[Tt];!xt&&kt(Tt)?(et+=_[bt],Tt>=65536&&(et+=_[bt+1])):et+=xt||G(Tt)}return et}b(si,"escapeString");function li(_,et,Tt){let bt="";const xt=_.tag;for(let At=0,St=Tt.length;At<St;At+=1){let Xt=Tt[At];_.replacer&&(Xt=_.replacer.call(Tt,String(At),Xt)),(pt(_,et,Xt,!1,!1)||typeof Xt>"u"&&pt(_,et,null,!1,!1))&&(bt!==""&&(bt+=","+(_.condenseFlow?"":" ")),bt+=_.dump)}_.tag=xt,_.dump="["+bt+"]"}b(li,"writeFlowSequence");function Xi(_,et,Tt,bt){let xt="";const At=_.tag;for(let St=0,Xt=Tt.length;St<Xt;St+=1){let qt=Tt[St];_.replacer&&(qt=_.replacer.call(Tt,String(St),qt)),(pt(_,et+1,qt,!0,!0,!1,!0)||typeof qt>"u"&&pt(_,et+1,null,!0,!0,!1,!0))&&((!bt||xt!=="")&&(xt+=tt(_,et)),_.dump&&n===_.dump.charCodeAt(0)?xt+="-":xt+="- ",xt+=_.dump)}_.tag=At,_.dump=xt||"[]"}b(Xi,"writeBlockSequence");function Ti(_,et,Tt){let bt="";const xt=_.tag,At=Object.keys(Tt);for(let St=0,Xt=At.length;St<Xt;St+=1){let qt="";bt!==""&&(qt+=", "),_.condenseFlow&&(qt+='"');const Qt=At[St];let ae=Tt[Qt];_.replacer&&(ae=_.replacer.call(Tt,Qt,ae)),pt(_,et,Qt,!1,!1)&&(_.dump.length>1024&&(qt+="? "),qt+=_.dump+(_.condenseFlow?'"':"")+":"+(_.condenseFlow?"":" "),pt(_,et,ae,!1,!1)&&(qt+=_.dump,bt+=qt))}_.tag=xt,_.dump="{"+bt+"}"}b(Ti,"writeFlowMapping");function y(_,et,Tt,bt){let xt="";const At=_.tag,St=Object.keys(Tt);if(_.sortKeys===!0)St.sort();else if(typeof _.sortKeys=="function")St.sort(_.sortKeys);else if(_.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let Xt=0,qt=St.length;Xt<qt;Xt+=1){let Qt="";(!bt||xt!=="")&&(Qt+=tt(_,et));const ae=St[Xt];let $e=Tt[ae];if(_.replacer&&($e=_.replacer.call(Tt,ae,$e)),!pt(_,et+1,ae,!0,!0,!0))continue;const Ye=_.tag!==null&&_.tag!=="?"||_.dump&&_.dump.length>1024;Ye&&(_.dump&&n===_.dump.charCodeAt(0)?Qt+="?":Qt+="? "),Qt+=_.dump,Ye&&(Qt+=tt(_,et)),pt(_,et+1,$e,!0,Ye)&&(_.dump&&n===_.dump.charCodeAt(0)?Qt+=":":Qt+=": ",Qt+=_.dump,xt+=Qt)}_.tag=At,_.dump=xt||"{}"}b(y,"writeBlockMapping");function Z(_,et,Tt){const bt=Tt?_.explicitTypes:_.implicitTypes;for(let xt=0,At=bt.length;xt<At;xt+=1){const St=bt[xt];if((St.instanceOf||St.predicate)&&(!St.instanceOf||typeof et=="object"&&et instanceof St.instanceOf)&&(!St.predicate||St.predicate(et))){if(Tt?St.multi&&St.representName?_.tag=St.representName(et):_.tag=St.tag:_.tag="?",St.represent){const Xt=_.styleMap[St.tag]||St.defaultStyle;let qt;if(r.call(St.represent)==="[object Function]")qt=St.represent(et,Xt);else if(s.call(St.represent,Xt))qt=St.represent[Xt](et,Xt);else throw new t("!<"+St.tag+'> tag resolver accepts not "'+Xt+'" style');_.dump=qt}return!0}}return!1}b(Z,"detectType");function pt(_,et,Tt,bt,xt,At,St){_.tag=null,_.dump=Tt,Z(_,Tt,!1)||Z(_,Tt,!0);const Xt=r.call(_.dump),qt=bt;bt&&(bt=_.flowLevel<0||_.flowLevel>et);const Qt=Xt==="[object Object]"||Xt==="[object Array]";let ae,$e;if(Qt&&(ae=_.duplicates.indexOf(Tt),$e=ae!==-1),(_.tag!==null&&_.tag!=="?"||$e||_.indent!==2&&et>0)&&(xt=!1),$e&&_.usedDuplicates[ae])_.dump="*ref_"+ae;else{if(Qt&&$e&&!_.usedDuplicates[ae]&&(_.usedDuplicates[ae]=!0),Xt==="[object Object]")bt&&Object.keys(_.dump).length!==0?(y(_,et,_.dump,xt),$e&&(_.dump="&ref_"+ae+_.dump)):(Ti(_,et,_.dump),$e&&(_.dump="&ref_"+ae+" "+_.dump));else if(Xt==="[object Array]")bt&&_.dump.length!==0?(_.noArrayIndent&&!St&&et>0?Xi(_,et-1,_.dump,xt):Xi(_,et,_.dump,xt),$e&&(_.dump="&ref_"+ae+_.dump)):(li(_,et,_.dump),$e&&(_.dump="&ref_"+ae+" "+_.dump));else if(Xt==="[object String]")_.tag!=="?"&&re(_,_.dump,et,At,qt);else{if(Xt==="[object Undefined]")return!1;if(_.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+Xt)}if(_.tag!==null&&_.tag!=="?"){let Ye=encodeURI(_.tag[0]==="!"?_.tag.slice(1):_.tag).replace(/!/g,"%21");_.tag[0]==="!"?Ye="!"+Ye:Ye.slice(0,18)==="tag:yaml.org,2002:"?Ye="!!"+Ye.slice(18):Ye="!<"+Ye+">",_.dump=Ye+" "+_.dump}}return!0}b(pt,"writeNode");function yt(_,et){const Tt=[],bt=[];lt(_,Tt,bt);const xt=bt.length;for(let At=0;At<xt;At+=1)et.duplicates.push(Tt[bt[At]]);et.usedDuplicates=new Array(xt)}b(yt,"getDuplicateReferences");function lt(_,et,Tt){if(_!==null&&typeof _=="object"){const bt=et.indexOf(_);if(bt!==-1)Tt.indexOf(bt)===-1&&Tt.push(bt);else if(et.push(_),Array.isArray(_))for(let xt=0,At=_.length;xt<At;xt+=1)lt(_[xt],et,Tt);else{const xt=Object.keys(_);for(let At=0,St=xt.length;At<St;At+=1)lt(_[xt[At]],et,Tt)}}}b(lt,"inspectNode");function _t(_,et){et=et||{};const Tt=new ct(et);Tt.noRefs||yt(_,Tt);let bt=_;return Tt.replacer&&(bt=Tt.replacer.call({"":bt},"",bt)),pt(Tt,0,bt,!0,!0)?Tt.dump+`
1544
- `:""}return b(_t,"dump2"),b0.dump=_t,b0}b(_S,"requireDumper");var ev;function LS(){if(ev)return Vi;ev=1;const e=BS(),t=_S();function i(r,s){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+s+" instead, which is now safe by default.")}}return b(i,"renamed"),Vi.Type=ar(),Vi.Schema=Em(),Vi.FAILSAFE_SCHEMA=Dm(),Vi.JSON_SCHEMA=qm(),Vi.CORE_SCHEMA=Hm(),Vi.DEFAULT_SCHEMA=Wu(),Vi.load=e.load,Vi.loadAll=e.loadAll,Vi.dump=t.dump,Vi.YAMLException=gl(),Vi.types={binary:Ym(),float:Wm(),map:zm(),null:Fm(),pairs:Xm(),set:Vm(),timestamp:jm(),bool:Om(),int:Nm(),merge:Um(),omap:Gm(),seq:Im(),str:Rm()},Vi.safeLoad=i("safeLoad","load"),Vi.safeLoadAll=i("safeLoadAll","loadAll"),Vi.safeDump=i("safeDump","dump"),Vi}b(LS,"requireJsYaml");var cz=LS(),hz=MS(cz),{Type:Tet,Schema:$et,FAILSAFE_SCHEMA:Met,JSON_SCHEMA:dz,CORE_SCHEMA:Aet,DEFAULT_SCHEMA:Bet,load:uz,loadAll:_et,dump:Let,YAMLException:Pet,types:Eet,safeLoad:Ret,safeLoadAll:Iet,safeDump:zet}=hz,pz=b((e,t)=>{const{theme:i,themeVariables:r}=t,{useGradient:s,gradientStart:o,gradientStop:a}=r??{},n=e.attr("id"),l=i?.includes("dark")?"#FFFFFF":"#000000",c=b((d,u,p)=>e.append("defs").append("filter").attr("id",d).attr("height",u).attr("width",u).append("feDropShadow").attr("dx",p).attr("dy",p).attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",l),"dropShadow");if(c(`${n}-drop-shadow`,"130%","4"),c(`${n}-drop-shadow-small`,"150%","2"),!s)return;const h=e.append("linearGradient").attr("id",`${n}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",a).attr("stop-opacity",1)},"insertLookDefs"),fz=b(e=>{const{handDrawnSeed:t}=ye();return{fill:e,hachureAngle:120,hachureGap:1.5,fillWeight:1.5,roughness:.7,stroke:e,seed:t}},"solidStateFill"),gz=b(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),va=b(e=>{const t=mz([...e.cssCompiledStyles||[],...e.cssStyles||[],...gz(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),mz=b(e=>{const t=new Map;return e.forEach(i=>{const[r,s]=i.split(":");t.set(r.trim(),s?.trim())}),t},"styles2Map"),PS=b(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"),jt=b(e=>{const{stylesArray:t}=va(e),i=[],r=[],s=[],o=[];return t.forEach(a=>{const n=a[0];PS(n)?i.push(a.join(":")+" !important"):(r.push(a.join(":")+" !important"),n.includes("stroke")&&s.push(a.join(":")+" !important"),n==="fill"&&o.push(a.join(":")+" !important"))}),{labelStyles:i.join(";"),nodeStyles:r.join(";"),stylesArray:t,borderStyles:s,backgroundStyles:o}},"styles2String"),Ot=b((e,t)=>{const{themeVariables:i,handDrawnSeed:r}=ye(),{nodeBorder:s,mainBkg:o}=i,{stylesMap:a}=va(e);return Object.assign({roughness:.7,fill:a.get("fill")||o,fillStyle:"hachure",fillWeight:1.5,hachureGap:1.5,stroke:a.get("stroke")||s,seed:r,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:bz(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),bz=b(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const s=isNaN(t[0])?0:t[0];return[s,s]}const i=isNaN(t[0])?0:t[0],r=isNaN(t[1])?0:t[1];return[i,r]},"getStrokeDashArray");const yz=Object.freeze({left:0,top:0,width:16,height:16}),Gd=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ES=Object.freeze({...yz,...Gd}),xz=Object.freeze({...ES,body:"",hidden:!1}),vz=Object.freeze({width:null,height:null}),wz=Object.freeze({...vz,...Gd}),kz=(e,t,i,r="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;r=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const n=s.pop(),l=s.pop(),c={provider:s.length>0?s[0]:r,prefix:l,name:n};return y0(c)?c:null}const o=s[0],a=o.split("-");if(a.length>1){const n={provider:r,prefix:a.shift(),name:a.join("-")};return y0(n)?n:null}if(i&&r===""){const n={provider:r,prefix:"",name:o};return y0(n,i)?n:null}return null},y0=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function Sz(e,t){const i={};!e.hFlip!=!t.hFlip&&(i.hFlip=!0),!e.vFlip!=!t.vFlip&&(i.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(i.rotate=r),i}function iv(e,t){const i=Sz(e,t);for(const r in xz)r in Gd?r in e&&!(r in i)&&(i[r]=Gd[r]):r in t?i[r]=t[r]:r in e&&(i[r]=e[r]);return i}function Cz(e,t){const i=e.icons,r=e.aliases||Object.create(null),s=Object.create(null);function o(a){if(i[a])return s[a]=[];if(!(a in s)){s[a]=null;const n=r[a]&&r[a].parent,l=n&&o(n);l&&(s[a]=[n].concat(l))}return s[a]}return(t||Object.keys(i).concat(Object.keys(r))).forEach(o),s}function rv(e,t,i){const r=e.icons,s=e.aliases||Object.create(null);let o={};function a(n){o=iv(r[n]||s[n],o)}return a(t),i.forEach(a),iv(e,o)}function Tz(e,t){if(e.icons[t])return rv(e,t,[]);const i=Cz(e,[t])[t];return i?rv(e,t,i):null}const $z=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Mz=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function sv(e,t,i){if(t===1)return e;if(i=i||100,typeof e=="number")return Math.ceil(e*t*i)/i;if(typeof e!="string")return e;const r=e.split($z);if(r===null||!r.length)return e;const s=[];let o=r.shift(),a=Mz.test(o);for(;;){if(a){const n=parseFloat(o);isNaN(n)?s.push(o):s.push(Math.ceil(n*t*i)/i)}else s.push(o);if(o=r.shift(),o===void 0)return s.join("");a=!a}}function Az(e,t="defs"){let i="";const r=e.indexOf("<"+t);for(;r>=0;){const s=e.indexOf(">",r),o=e.indexOf("</"+t);if(s===-1||o===-1)break;const a=e.indexOf(">",o);if(a===-1)break;i+=e.slice(s+1,o).trim(),e=e.slice(0,r).trim()+e.slice(a+1)}return{defs:i,content:e}}function Bz(e,t){return e?"<defs>"+e+"</defs>"+t:t}function _z(e,t,i){const r=Az(e);return Bz(r.defs,t+r.content+i)}const Lz=e=>e==="unset"||e==="undefined"||e==="none";function Pz(e,t){const i={...ES,...e},r={...wz,...t},s={left:i.left,top:i.top,width:i.width,height:i.height};let o=i.body;[i,r].forEach(g=>{const m=[],x=g.hFlip,w=g.vFlip;let S=g.rotate;x?w?S+=2:(m.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),m.push("scale(-1 1)"),s.top=s.left=0):w&&(m.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),m.push("scale(1 -1)"),s.top=s.left=0);let A;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:A=s.height/2+s.top,m.unshift("rotate(90 "+A.toString()+" "+A.toString()+")");break;case 2:m.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:A=s.width/2+s.left,m.unshift("rotate(-90 "+A.toString()+" "+A.toString()+")")}S%2===1&&(s.left!==s.top&&(A=s.left,s.left=s.top,s.top=A),s.width!==s.height&&(A=s.width,s.width=s.height,s.height=A)),m.length&&(o=_z(o,'<g transform="'+m.join(" ")+'">',"</g>"))});const a=r.width,n=r.height,l=s.width,c=s.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=sv(d,l/c)):(h=a==="auto"?l:a,d=n===null?sv(h,c/l):n==="auto"?c:n);const u={},p=(g,m)=>{Lz(m)||(u[g]=m.toString())};p("width",h),p("height",d);const f=[s.left,s.top,l,c];return u.viewBox=f.join(" "),{attributes:u,viewBox:f,body:o}}const Ez=/\sid="(\S+)"/g,ov=new Map;function Rz(e){e=e.replace(/[0-9]+$/,"")||"a";const t=ov.get(e)||0;return ov.set(e,t+1),t?`${e}${t}`:e}function Iz(e){const t=[];let i;for(;i=Ez.exec(e);)t.push(i[1]);if(!t.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(s=>{const o=Rz(s),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),""),e}function zz(e,t){let i=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)i+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+i+">"+e+"</svg>"}var Dz={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},Of=new Map,RS=new Map,Fz=b(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(vt.debug("Registering icon pack:",t.name),"loader"in t)RS.set(t.name,t.loader);else if("icons"in t)Of.set(t.name,t.icons);else throw vt.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),IS=b(async(e,t)=>{const i=kz(e,!0,t!==void 0);if(!i)throw new Error(`Invalid icon name: ${e}`);const r=i.prefix||t;if(!r)throw new Error(`Icon name must contain a prefix: ${e}`);let s=Of.get(r);if(!s){const a=RS.get(r);if(!a)throw new Error(`Icon set not found: ${i.prefix}`);try{s={...await a(),prefix:r},Of.set(r,s)}catch(n){throw vt.error(n),new Error(`Failed to load icon set: ${i.prefix}`)}}const o=Tz(s,i.name);if(!o)throw new Error(`Icon not found: ${e}`);return o},"getRegisteredIconData"),zS=b(async e=>{try{return await IS(e),!0}catch{return!1}},"isIconAvailable"),ml=b(async(e,t,i)=>{let r;try{r=await IS(e,t?.fallbackPrefix)}catch(a){vt.error(a),r=Dz}const s=Pz(r,t),o=zz(Iz(s.body),{...s.attributes,...i});return es(o,ei())},"getIconSVG"),xh={},$i={},av;function Oz(){return av||(av=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.BLANK_URL=$i.relativeFirstCharacters=$i.whitespaceEscapeCharsRegex=$i.urlSchemeRegex=$i.ctrlCharactersRegex=$i.htmlCtrlEntityRegex=$i.htmlEntitiesRegex=$i.invalidProtocolRegex=void 0,$i.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,$i.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,$i.htmlCtrlEntityRegex=/&(newline|tab);/gi,$i.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,$i.urlSchemeRegex=/^.+(:|&colon;)/gim,$i.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,$i.relativeFirstCharacters=[".","/"],$i.BLANK_URL="about:blank"),$i}var nv;function Nz(){if(nv)return xh;nv=1,Object.defineProperty(xh,"__esModule",{value:!0}),xh.sanitizeUrl=o;var e=Oz();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function i(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function r(a){return URL.canParse(a)}function s(a){try{return decodeURIComponent(a)}catch{return a}}function o(a){if(!a)return e.BLANK_URL;var n,l=s(a.trim());do l=i(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=s(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var u=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var p=h.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return p;if(u==="http:"||u==="https:"){if(!r(p))return e.BLANK_URL;var f=new URL(p);return f.protocol=f.protocol.toLowerCase(),f.hostname=f.hostname.toLowerCase(),f.toString()}return p}return xh}var Wz=Nz();function x0(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 i=e[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${i}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function qz(){}function DS(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Km(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Hz="[object RegExp]",FS="[object String]",OS="[object Number]",NS="[object Boolean]",WS="[object Arguments]",jz="[object Symbol]",Uz="[object Date]",Yz="[object Map]",Gz="[object Set]",Xz="[object Array]",Vz="[object ArrayBuffer]",Kz="[object Object]",Zz="[object DataView]",Qz="[object Uint8Array]",Jz="[object Uint8ClampedArray]",tD="[object Uint16Array]",eD="[object Uint32Array]",iD="[object Int8Array]",rD="[object Int16Array]",sD="[object Int32Array]",oD="[object Float32Array]",aD="[object Float64Array]",lv=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Zm(e){return typeof lv.Buffer<"u"&&lv.Buffer.isBuffer(e)}function nD(e){return Number.isSafeInteger(e)&&e>=0}function qS(e){return e!=null&&typeof e!="function"&&nD(e.length)}function lD(e){return e==="__proto__"}function Qm(e){return e==null||typeof e!="object"&&typeof e!="function"}function Jm(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cD(e,t){return Bn(e,void 0,e,new Map,t)}function Bn(e,t,i,r=new Map,s=void 0){const o=s?.(e,t,i,r);if(o!==void 0)return o;if(Qm(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const a=new Array(e.length);r.set(e,a);for(let n=0;n<e.length;n++)a[n]=Bn(e[n],n,i,r,s);return Object.hasOwn(e,"index")&&(a.index=e.index),Object.hasOwn(e,"input")&&(a.input=e.input),a}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const a=new RegExp(e.source,e.flags);return a.lastIndex=e.lastIndex,a}if(e instanceof Map){const a=new Map;r.set(e,a);for(const[n,l]of e)a.set(n,Bn(l,n,i,r,s));return a}if(e instanceof Set){const a=new Set;r.set(e,a);for(const n of e)a.add(Bn(n,void 0,i,r,s));return a}if(Zm(e))return e.subarray();if(Jm(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,a);for(let n=0;n<e.length;n++)a[n]=Bn(e[n],n,i,r,s);return a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const a=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,a),us(a,e,i,r,s),a}if(typeof File<"u"&&e instanceof File){const a=new File([e],e.name,{type:e.type});return r.set(e,a),us(a,e,i,r,s),a}if(typeof Blob<"u"&&e instanceof Blob){const a=new Blob([e],{type:e.type});return r.set(e,a),us(a,e,i,r,s),a}if(e instanceof Error){const a=structuredClone(e);return r.set(e,a),a.message=e.message,a.name=e.name,a.stack=e.stack,a.cause=e.cause,a.constructor=e.constructor,us(a,e,i,r,s),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return r.set(e,a),us(a,e,i,r,s),a}if(e instanceof Number){const a=new Number(e.valueOf());return r.set(e,a),us(a,e,i,r,s),a}if(e instanceof String){const a=new String(e.valueOf());return r.set(e,a),us(a,e,i,r,s),a}if(typeof e=="object"&&hD(e)){const a=Object.create(Object.getPrototypeOf(e));return r.set(e,a),us(a,e,i,r,s),a}return e}function us(e,t,i=e,r,s){const o=[...Object.keys(t),...DS(t)];for(let a=0;a<o.length;a++){const n=o[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=Bn(t[n],n,i,r,s))}}function hD(e){switch(Km(e)){case WS:case Xz:case Vz:case Zz:case NS:case Uz:case oD:case aD:case iD:case rD:case sD:case Yz:case OS:case Kz:case Hz:case Gz:case FS:case jz:case Qz:case Jz:case tD:case eD:return!0;default:return!1}}function dD(e,t){return cD(e,(i,r,s,o)=>{if(typeof e=="object"){if(Km(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return o.set(e,a),us(a,e,s,o),a}switch(Object.prototype.toString.call(e)){case OS:case FS:case NS:{const a=new e.constructor(e?.valueOf());return us(a,e),a}case WS:{const a={};return us(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function cv(e){return dD(e)}function Nf(e){return e!==null&&typeof e=="object"&&Km(e)==="[object Arguments]"}function Wf(e){return typeof e=="object"&&e!==null}function uD(e){return Wf(e)&&qS(e)}function ad(e){return Jm(e)}function pD(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function Yc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const i=function(...r){const s=t?t.apply(this,r):r[0],o=i.cache;if(o.has(s))return o.get(s);const a=e.apply(this,r);return i.cache=o.set(s,a)||o,a};return i.cache=new(Yc.Cache||Map),i}Yc.Cache=Map;function fD(e){if(Qm(e))return e;if(Array.isArray(e)||Jm(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 i=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new i(e);if(e instanceof RegExp){const r=new i(e);return r.lastIndex=e.lastIndex,r}if(e instanceof DataView)return new i(e.buffer.slice(0));if(e instanceof Error){let r;return e instanceof AggregateError?r=new i(e.errors,e.message,{cause:e.cause}):r=new i(e.message,{cause:e.cause}),r.stack=e.stack,Object.assign(r,e),r}return typeof File<"u"&&e instanceof File?new i([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function gD(e,...t){const i=t.slice(0,-1),r=t[t.length-1];let s=e;for(let o=0;o<i.length;o++){const a=i[o];s=nd(s,a,r,new Map)}return s}function nd(e,t,i,r){if(Qm(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(r.has(t))return fD(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let o=0;o<t.length;o++)o in t||(t[o]=void 0)}const s=[...Object.keys(t),...DS(t)];for(let o=0;o<s.length;o++){const a=s[o];if(lD(a))continue;let n=t[a],l=e[a];if(Nf(n)&&(n={...n}),Nf(l)&&(l={...l}),Zm(n)&&(n=cv(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let u=0;u<d.length;u++){const p=d[u];h[p]=l[p]}l=h}else if(uD(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=i(l,n,a,e,t,r);c!==void 0?e[a]=c:Array.isArray(n)||Wf(l)&&Wf(n)&&(x0(l)||x0(n)||ad(l)||ad(n))?e[a]=nd(l,n,i,r):l==null&&x0(n)?e[a]=nd({},n,i,r):l==null&&ad(n)?e[a]=cv(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function mD(e,...t){return gD(e,...t,qz)}function hv(e){if(e==null)return!0;if(qS(e))return typeof e.splice!="function"&&typeof e!="string"&&!Zm(e)&&!ad(e)&&!Nf(e)?!1:e.length===0;if(typeof e=="object"||typeof e=="function"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);return pD(e)?t.filter(i=>i!=="constructor").length===0:t.length===0}return!0}var bD="​",yD={curveBasis:Ff,curveBasisClosed:tz,curveBasisOpen:ez,curveBumpX:nS,curveBumpY:lS,curveBundle:iz,curveCardinalClosed:rz,curveCardinalOpen:sz,curveCardinal:uS,curveCatmullRomClosed:oz,curveCatmullRomOpen:az,curveCatmullRom:fS,curveLinear:fc,curveLinearClosed:nz,curveMonotoneX:vS,curveMonotoneY:wS,curveNatural:SS,curveStep:CS,curveStepAfter:$S,curveStepBefore:TS},xD=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,vD=b(function(e,t){const i=HS(e,/(?:init\b)|(?:initialize\b)/);let r={};if(Array.isArray(i)){const a=i.map(n=>n.args);Pd(a),r=yi(r,[...a])}else r=i.args;if(!r)return;let s=Iu(e,t);const o="config";return r[o]!==void 0&&(s==="flowchart-v2"&&(s="flowchart"),r[s]=r[o],delete r[o]),r},"detectInit"),HS=b(function(e,t=null){try{const i=new RegExp(`[%]{2}(?![{]${xD.source})(?=[}][%]{2}).*
1545
- `,"ig");e=e.trim().replace(i,"").replace(/'/gm,'"'),vt.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let r;const s=[];for(;(r=dc.exec(e))!==null;)if(r.index===dc.lastIndex&&dc.lastIndex++,r&&!t||t&&r[1]?.match(t)||t&&r[2]?.match(t)){const o=r[1]?r[1]:r[2],a=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;s.push({type:o,args:a})}return s.length===0?{type:e,args:null}:s.length===1?s[0]:s}catch(i){return vt.error(`ERROR: ${i.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),wD=b(function(e){return e.replace(dc,"")},"removeDirectives"),kD=b(function(e,t){for(const[i,r]of t.entries())if(r.match(e))return i;return-1},"isSubstringInArray");function t1(e,t){if(!e)return t;const i=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return yD[i]??t}b(t1,"interpolateToCurve");function jS(e,t){const i=e.trim();if(i)return t.securityLevel!=="loose"?Wz.sanitizeUrl(i):i}b(jS,"formatUrl");var SD=b((e,...t)=>{const i=e.split("."),r=i.length-1,s=i[r];let o=window;for(let a=0;a<r;a++)if(o=o[i[a]],!o){vt.error(`Function name: ${e} not found in window`);return}o[s](...t)},"runFunc");function e1(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}b(e1,"distance");function US(e){let t,i=0;e.forEach(s=>{i+=e1(s,t),t=s});const r=i/2;return i1(e,r)}b(US,"traverseEdge");function YS(e){return e.length===1?e[0]:US(e)}b(YS,"calcLabelPosition");var dv=b((e,t=2)=>{const i=Math.pow(10,t);return Math.round(e*i)/i},"roundNumber"),i1=b((e,t)=>{let i,r=t;for(const s of e){if(i){const o=e1(s,i);if(o===0)return i;if(o<r)r-=o;else{const a=r/o;if(a<=0)return i;if(a>=1)return{x:s.x,y:s.y};if(a>0&&a<1)return{x:dv((1-a)*i.x+a*s.x,5),y:dv((1-a)*i.y+a*s.y,5)}}}i=s}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),CD=b((e,t,i)=>{vt.info(`our points ${JSON.stringify(t)}`),t[0]!==i&&(t=t.reverse());const s=i1(t,25),o=e?10:5,a=Math.atan2(t[0].y-s.y,t[0].x-s.x),n={x:0,y:0};return n.x=Math.sin(a)*o+(t[0].x+s.x)/2,n.y=-Math.cos(a)*o+(t[0].y+s.y)/2,n},"calcCardinalityPosition");function GS(e,t,i){const r=structuredClone(i);vt.info("our points",r),t!=="start_left"&&t!=="start_right"&&r.reverse();const s=25+e,o=i1(r,s),a=10+e*.5,n=Math.atan2(r[0].y-o.y,r[0].x-o.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(r[0].x+o.x)/2,l.y=-Math.cos(n+Math.PI)*a+(r[0].y+o.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(r[0].x+o.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(r[0].y+o.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(r[0].x+o.x)/2-5,l.y=-Math.cos(n)*a+(r[0].y+o.y)/2-5):(l.x=Math.sin(n)*a+(r[0].x+o.x)/2,l.y=-Math.cos(n)*a+(r[0].y+o.y)/2),l}b(GS,"calcTerminalLabelPosition");function XS(e){let t="",i="";for(const r of e)r!==void 0&&(r.startsWith("color:")||r.startsWith("text-align:")?i=i+r+";":t=t+r+";");return{style:t,labelStyle:i}}b(XS,"getStylesFromArray");var uv=0,TD=b(()=>(uv++,"id-"+Math.random().toString(36).substr(2,12)+"-"+uv),"generateId");function VS(e){let t="";const i="0123456789abcdef",r=i.length;for(let s=0;s<e;s++)t+=i.charAt(Math.floor(Math.random()*r));return t}b(VS,"makeRandomHex");var $D=b(e=>VS(e.length),"random"),MD=b(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"),AD=b(function(e,t){const i=t.text.replace(Hc.lineBreakRegex," "),[,r]=qu(t.fontSize),s=e.append("text");s.attr("x",t.x),s.attr("y",t.y),s.style("text-anchor",t.anchor),s.style("font-family",t.fontFamily),s.style("font-size",r),s.style("font-weight",t.fontWeight),s.attr("fill",t.fill),t.class!==void 0&&s.attr("class",t.class);const o=s.append("tspan");return o.attr("x",t.x+t.textMargin*2),o.attr("fill",t.fill),o.text(i),s},"drawSimpleText"),BD=Yc((e,t,i)=>{if(!e||(i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},i),Hc.hasBreaks(e)))return e;const r=e.split(" ").filter(Boolean),s=[];let o="";return r.forEach((a,n)=>{const l=To(`${a} `,i),c=To(o,i);if(l>t){const{hyphenatedStrings:u,remainingWord:p}=_D(a,t,"-",i);s.push(o,...u),o=p}else c+l>=t?(s.push(o),o=a):o=[o,a].filter(Boolean).join(" ");n+1===r.length&&s.push(o)}),s.filter(a=>a!=="").join(i.joinWith)},(e,t,i)=>`${e}${t}${i.fontSize}${i.fontWeight}${i.fontFamily}${i.joinWith}`),_D=Yc((e,t,i="-",r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);const s=[...e],o=[];let a="";return s.forEach((n,l)=>{const c=`${a}${n}`;if(To(c,r)>=t){const d=l+1,u=s.length===d,p=`${c}${i}`;o.push(u?c:p),a=""}else a=c}),{hyphenatedStrings:o,remainingWord:a}},(e,t,i="-",r)=>`${e}${t}${i}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function KS(e,t){return r1(e,t).height}b(KS,"calculateTextHeight");function To(e,t){return r1(e,t).width}b(To,"calculateTextWidth");var r1=Yc((e,t)=>{const{fontSize:i=12,fontFamily:r="Arial",fontWeight:s=400}=t;if(!e)return{width:0,height:0};const[,o]=qu(i),a=["sans-serif",r],n=e.split(Hc.lineBreakRegex),l=[],c=me("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const u of a){let p=0;const f={width:0,height:0,lineHeight:0};for(const g of n){const m=MD();m.text=g||bD;const x=AD(h,m).style("font-size",o).style("font-weight",s).style("font-family",u),w=(x._groups||x)[0][0].getBBox();if(w.width===0&&w.height===0)throw new Error("svg element not in render tree");f.width=Math.round(Math.max(f.width,w.width)),p=Math.round(w.height),f.height+=p,f.lineHeight=Math.round(Math.max(f.lineHeight,p))}l.push(f)}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}`),Kn,LD=(Kn=class{constructor(t=!1,i){this.count=0,this.count=i?i.length:0,this.next=t?()=>this.count++:()=>Date.now()}},b(Kn,"InitIDGenerator"),Kn),vh,PD=b(function(e){return vh=vh||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),vh.innerHTML=e,unescape(vh.textContent)},"entityDecode");function s1(e){return"str"in e}b(s1,"isDetailedError");var ED=b((e,t,i,r)=>{if(!r)return;const s=e.node()?.getBBox();s&&e.append("text").text(r).attr("text-anchor","middle").attr("x",s.x+s.width/2).attr("y",-i).attr("class",t)},"insertTitle"),qu=b(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 o1(e,t){return mD({},e,t)}b(o1,"cleanAndMerge");var xs={assignWithDepth:yi,wrapLabel:BD,calculateTextHeight:KS,calculateTextWidth:To,calculateTextDimensions:r1,cleanAndMerge:o1,detectInit:vD,detectDirective:HS,isSubstringInArray:kD,interpolateToCurve:t1,calcLabelPosition:YS,calcCardinalityPosition:CD,calcTerminalLabelPosition:GS,formatUrl:jS,getStylesFromArray:XS,generateId:TD,random:$D,runFunc:SD,entityDecode:PD,insertTitle:ED,isLabelCoordinateInPath:ZS,parseFontSize:qu,InitIDGenerator:LD},RD=b(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(i){return i.substring(0,i.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(i){return i.substring(0,i.length-1)}),t=t.replace(/#\w+;/g,function(i){const r=i.substring(1,i.length-1);return/^\+?\d+$/.test(r)?"fl°°"+r+"¶ß":"fl°"+r+"¶ß"}),t},"encodeEntities"),da=b(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Det=b((e,t,{counter:i=0,prefix:r,suffix:s},o)=>o||`${r?`${r}_`:""}${e}_${t}_${i}${s?`_${s}`:""}`,"getEdgeId");function wi(e){return e??null}b(wi,"handleUndefinedAttr");function ZS(e,t){const i=Math.round(e.x),r=Math.round(e.y),s=t.replace(/(\d+\.\d+)/g,o=>Math.round(parseFloat(o)).toString());return s.includes(i.toString())||s.includes(r.toString())}b(ZS,"isLabelCoordinateInPath");function a1(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ja=a1();function QS(e){Ja=e}var gc={exec:()=>null};function De(e,t=""){let i=typeof e=="string"?e:e.source,r={replace:(s,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(ur.caret,"$1"),i=i.replace(s,a),r},getRegex:()=>new RegExp(i,t)};return r}var ID=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ur={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")},zD=/^(?:[ \t]*(?:\n|$))+/,DD=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,FD=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Gc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,OD=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,n1=/(?:[*+-]|\d{1,9}[.)])/,JS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,tC=De(JS).replace(/bull/g,n1).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(),ND=De(JS).replace(/bull/g,n1).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(),l1=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,WD=/^[^\n]+/,c1=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qD=De(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",c1).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),HD=De(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,n1).getRegex(),Hu="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",h1=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,jD=De("^ {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",h1).replace("tag",Hu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),eC=De(l1).replace("hr",Gc).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",Hu).getRegex(),UD=De(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",eC).getRegex(),d1={blockquote:UD,code:DD,def:qD,fences:FD,heading:OD,hr:Gc,html:jD,lheading:tC,list:HD,newline:zD,paragraph:eC,table:gc,text:WD},pv=De("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Gc).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",Hu).getRegex(),YD={...d1,lheading:ND,table:pv,paragraph:De(l1).replace("hr",Gc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pv).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",Hu).getRegex()},GD={...d1,html:De(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",h1).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:gc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:De(l1).replace("hr",Gc).replace("heading",` *#{1,6} *[^
1544
+ `:""}return b(_t,"dump2"),b0.dump=_t,b0}b(_S,"requireDumper");var ev;function LS(){if(ev)return Vi;ev=1;const e=BS(),t=_S();function i(r,s){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+s+" instead, which is now safe by default.")}}return b(i,"renamed"),Vi.Type=ar(),Vi.Schema=Em(),Vi.FAILSAFE_SCHEMA=Dm(),Vi.JSON_SCHEMA=qm(),Vi.CORE_SCHEMA=Hm(),Vi.DEFAULT_SCHEMA=Wu(),Vi.load=e.load,Vi.loadAll=e.loadAll,Vi.dump=t.dump,Vi.YAMLException=gl(),Vi.types={binary:Ym(),float:Wm(),map:zm(),null:Fm(),pairs:Xm(),set:Vm(),timestamp:jm(),bool:Om(),int:Nm(),merge:Um(),omap:Gm(),seq:Im(),str:Rm()},Vi.safeLoad=i("safeLoad","load"),Vi.safeLoadAll=i("safeLoadAll","loadAll"),Vi.safeDump=i("safeDump","dump"),Vi}b(LS,"requireJsYaml");var cz=LS(),hz=MS(cz),{Type:$et,Schema:Met,FAILSAFE_SCHEMA:Aet,JSON_SCHEMA:dz,CORE_SCHEMA:Bet,DEFAULT_SCHEMA:_et,load:uz,loadAll:Let,dump:Pet,YAMLException:Eet,types:Ret,safeLoad:Iet,safeLoadAll:zet,safeDump:Det}=hz,pz=b((e,t)=>{const{theme:i,themeVariables:r}=t,{useGradient:s,gradientStart:o,gradientStop:a}=r??{},n=e.attr("id"),l=i?.includes("dark")?"#FFFFFF":"#000000",c=b((d,u,p)=>e.append("defs").append("filter").attr("id",d).attr("height",u).attr("width",u).append("feDropShadow").attr("dx",p).attr("dy",p).attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",l),"dropShadow");if(c(`${n}-drop-shadow`,"130%","4"),c(`${n}-drop-shadow-small`,"150%","2"),!s)return;const h=e.append("linearGradient").attr("id",`${n}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",o).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",a).attr("stop-opacity",1)},"insertLookDefs"),fz=b(e=>{const{handDrawnSeed:t}=ye();return{fill:e,hachureAngle:120,hachureGap:1.5,fillWeight:1.5,roughness:.7,stroke:e,seed:t}},"solidStateFill"),gz=b(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),va=b(e=>{const t=mz([...e.cssCompiledStyles||[],...e.cssStyles||[],...gz(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),mz=b(e=>{const t=new Map;return e.forEach(i=>{const[r,s]=i.split(":");t.set(r.trim(),s?.trim())}),t},"styles2Map"),PS=b(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"),jt=b(e=>{const{stylesArray:t}=va(e),i=[],r=[],s=[],o=[];return t.forEach(a=>{const n=a[0];PS(n)?i.push(a.join(":")+" !important"):(r.push(a.join(":")+" !important"),n.includes("stroke")&&s.push(a.join(":")+" !important"),n==="fill"&&o.push(a.join(":")+" !important"))}),{labelStyles:i.join(";"),nodeStyles:r.join(";"),stylesArray:t,borderStyles:s,backgroundStyles:o}},"styles2String"),Ot=b((e,t)=>{const{themeVariables:i,handDrawnSeed:r}=ye(),{nodeBorder:s,mainBkg:o}=i,{stylesMap:a}=va(e);return Object.assign({roughness:.7,fill:a.get("fill")||o,fillStyle:"hachure",fillWeight:1.5,hachureGap:1.5,stroke:a.get("stroke")||s,seed:r,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:bz(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),bz=b(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const s=isNaN(t[0])?0:t[0];return[s,s]}const i=isNaN(t[0])?0:t[0],r=isNaN(t[1])?0:t[1];return[i,r]},"getStrokeDashArray");const yz=Object.freeze({left:0,top:0,width:16,height:16}),Gd=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ES=Object.freeze({...yz,...Gd}),xz=Object.freeze({...ES,body:"",hidden:!1}),vz=Object.freeze({width:null,height:null}),wz=Object.freeze({...vz,...Gd}),kz=(e,t,i,r="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;r=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const n=s.pop(),l=s.pop(),c={provider:s.length>0?s[0]:r,prefix:l,name:n};return y0(c)?c:null}const o=s[0],a=o.split("-");if(a.length>1){const n={provider:r,prefix:a.shift(),name:a.join("-")};return y0(n)?n:null}if(i&&r===""){const n={provider:r,prefix:"",name:o};return y0(n,i)?n:null}return null},y0=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function Sz(e,t){const i={};!e.hFlip!=!t.hFlip&&(i.hFlip=!0),!e.vFlip!=!t.vFlip&&(i.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(i.rotate=r),i}function iv(e,t){const i=Sz(e,t);for(const r in xz)r in Gd?r in e&&!(r in i)&&(i[r]=Gd[r]):r in t?i[r]=t[r]:r in e&&(i[r]=e[r]);return i}function Cz(e,t){const i=e.icons,r=e.aliases||Object.create(null),s=Object.create(null);function o(a){if(i[a])return s[a]=[];if(!(a in s)){s[a]=null;const n=r[a]&&r[a].parent,l=n&&o(n);l&&(s[a]=[n].concat(l))}return s[a]}return(t||Object.keys(i).concat(Object.keys(r))).forEach(o),s}function rv(e,t,i){const r=e.icons,s=e.aliases||Object.create(null);let o={};function a(n){o=iv(r[n]||s[n],o)}return a(t),i.forEach(a),iv(e,o)}function Tz(e,t){if(e.icons[t])return rv(e,t,[]);const i=Cz(e,[t])[t];return i?rv(e,t,i):null}const $z=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Mz=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function sv(e,t,i){if(t===1)return e;if(i=i||100,typeof e=="number")return Math.ceil(e*t*i)/i;if(typeof e!="string")return e;const r=e.split($z);if(r===null||!r.length)return e;const s=[];let o=r.shift(),a=Mz.test(o);for(;;){if(a){const n=parseFloat(o);isNaN(n)?s.push(o):s.push(Math.ceil(n*t*i)/i)}else s.push(o);if(o=r.shift(),o===void 0)return s.join("");a=!a}}function Az(e,t="defs"){let i="";const r=e.indexOf("<"+t);for(;r>=0;){const s=e.indexOf(">",r),o=e.indexOf("</"+t);if(s===-1||o===-1)break;const a=e.indexOf(">",o);if(a===-1)break;i+=e.slice(s+1,o).trim(),e=e.slice(0,r).trim()+e.slice(a+1)}return{defs:i,content:e}}function Bz(e,t){return e?"<defs>"+e+"</defs>"+t:t}function _z(e,t,i){const r=Az(e);return Bz(r.defs,t+r.content+i)}const Lz=e=>e==="unset"||e==="undefined"||e==="none";function Pz(e,t){const i={...ES,...e},r={...wz,...t},s={left:i.left,top:i.top,width:i.width,height:i.height};let o=i.body;[i,r].forEach(g=>{const m=[],x=g.hFlip,w=g.vFlip;let S=g.rotate;x?w?S+=2:(m.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),m.push("scale(-1 1)"),s.top=s.left=0):w&&(m.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),m.push("scale(1 -1)"),s.top=s.left=0);let A;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:A=s.height/2+s.top,m.unshift("rotate(90 "+A.toString()+" "+A.toString()+")");break;case 2:m.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:A=s.width/2+s.left,m.unshift("rotate(-90 "+A.toString()+" "+A.toString()+")")}S%2===1&&(s.left!==s.top&&(A=s.left,s.left=s.top,s.top=A),s.width!==s.height&&(A=s.width,s.width=s.height,s.height=A)),m.length&&(o=_z(o,'<g transform="'+m.join(" ")+'">',"</g>"))});const a=r.width,n=r.height,l=s.width,c=s.height;let h,d;a===null?(d=n===null?"1em":n==="auto"?c:n,h=sv(d,l/c)):(h=a==="auto"?l:a,d=n===null?sv(h,c/l):n==="auto"?c:n);const u={},p=(g,m)=>{Lz(m)||(u[g]=m.toString())};p("width",h),p("height",d);const f=[s.left,s.top,l,c];return u.viewBox=f.join(" "),{attributes:u,viewBox:f,body:o}}const Ez=/\sid="(\S+)"/g,ov=new Map;function Rz(e){e=e.replace(/[0-9]+$/,"")||"a";const t=ov.get(e)||0;return ov.set(e,t+1),t?`${e}${t}`:e}function Iz(e){const t=[];let i;for(;i=Ez.exec(e);)t.push(i[1]);if(!t.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(s=>{const o=Rz(s),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),""),e}function zz(e,t){let i=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)i+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+i+">"+e+"</svg>"}var Dz={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},Of=new Map,RS=new Map,Fz=b(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(vt.debug("Registering icon pack:",t.name),"loader"in t)RS.set(t.name,t.loader);else if("icons"in t)Of.set(t.name,t.icons);else throw vt.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),IS=b(async(e,t)=>{const i=kz(e,!0,t!==void 0);if(!i)throw new Error(`Invalid icon name: ${e}`);const r=i.prefix||t;if(!r)throw new Error(`Icon name must contain a prefix: ${e}`);let s=Of.get(r);if(!s){const a=RS.get(r);if(!a)throw new Error(`Icon set not found: ${i.prefix}`);try{s={...await a(),prefix:r},Of.set(r,s)}catch(n){throw vt.error(n),new Error(`Failed to load icon set: ${i.prefix}`)}}const o=Tz(s,i.name);if(!o)throw new Error(`Icon not found: ${e}`);return o},"getRegisteredIconData"),zS=b(async e=>{try{return await IS(e),!0}catch{return!1}},"isIconAvailable"),ml=b(async(e,t,i)=>{let r;try{r=await IS(e,t?.fallbackPrefix)}catch(a){vt.error(a),r=Dz}const s=Pz(r,t),o=zz(Iz(s.body),{...s.attributes,...i});return es(o,ei())},"getIconSVG"),xh={},$i={},av;function Oz(){return av||(av=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.BLANK_URL=$i.relativeFirstCharacters=$i.whitespaceEscapeCharsRegex=$i.urlSchemeRegex=$i.ctrlCharactersRegex=$i.htmlCtrlEntityRegex=$i.htmlEntitiesRegex=$i.invalidProtocolRegex=void 0,$i.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,$i.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,$i.htmlCtrlEntityRegex=/&(newline|tab);/gi,$i.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,$i.urlSchemeRegex=/^.+(:|&colon;)/gim,$i.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,$i.relativeFirstCharacters=[".","/"],$i.BLANK_URL="about:blank"),$i}var nv;function Nz(){if(nv)return xh;nv=1,Object.defineProperty(xh,"__esModule",{value:!0}),xh.sanitizeUrl=o;var e=Oz();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function i(a){var n=a.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function r(a){return URL.canParse(a)}function s(a){try{return decodeURIComponent(a)}catch{return a}}function o(a){if(!a)return e.BLANK_URL;var n,l=s(a.trim());do l=i(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=s(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var u=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var p=h.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return p;if(u==="http:"||u==="https:"){if(!r(p))return e.BLANK_URL;var f=new URL(p);return f.protocol=f.protocol.toLowerCase(),f.hostname=f.hostname.toLowerCase(),f.toString()}return p}return xh}var Wz=Nz();function x0(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 i=e[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${i}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function qz(){}function DS(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Km(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Hz="[object RegExp]",FS="[object String]",OS="[object Number]",NS="[object Boolean]",WS="[object Arguments]",jz="[object Symbol]",Uz="[object Date]",Yz="[object Map]",Gz="[object Set]",Xz="[object Array]",Vz="[object ArrayBuffer]",Kz="[object Object]",Zz="[object DataView]",Qz="[object Uint8Array]",Jz="[object Uint8ClampedArray]",tD="[object Uint16Array]",eD="[object Uint32Array]",iD="[object Int8Array]",rD="[object Int16Array]",sD="[object Int32Array]",oD="[object Float32Array]",aD="[object Float64Array]",lv=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Zm(e){return typeof lv.Buffer<"u"&&lv.Buffer.isBuffer(e)}function nD(e){return Number.isSafeInteger(e)&&e>=0}function qS(e){return e!=null&&typeof e!="function"&&nD(e.length)}function lD(e){return e==="__proto__"}function Qm(e){return e==null||typeof e!="object"&&typeof e!="function"}function Jm(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cD(e,t){return Bn(e,void 0,e,new Map,t)}function Bn(e,t,i,r=new Map,s=void 0){const o=s?.(e,t,i,r);if(o!==void 0)return o;if(Qm(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const a=new Array(e.length);r.set(e,a);for(let n=0;n<e.length;n++)a[n]=Bn(e[n],n,i,r,s);return Object.hasOwn(e,"index")&&(a.index=e.index),Object.hasOwn(e,"input")&&(a.input=e.input),a}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const a=new RegExp(e.source,e.flags);return a.lastIndex=e.lastIndex,a}if(e instanceof Map){const a=new Map;r.set(e,a);for(const[n,l]of e)a.set(n,Bn(l,n,i,r,s));return a}if(e instanceof Set){const a=new Set;r.set(e,a);for(const n of e)a.add(Bn(n,void 0,i,r,s));return a}if(Zm(e))return e.subarray();if(Jm(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,a);for(let n=0;n<e.length;n++)a[n]=Bn(e[n],n,i,r,s);return a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const a=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,a),us(a,e,i,r,s),a}if(typeof File<"u"&&e instanceof File){const a=new File([e],e.name,{type:e.type});return r.set(e,a),us(a,e,i,r,s),a}if(typeof Blob<"u"&&e instanceof Blob){const a=new Blob([e],{type:e.type});return r.set(e,a),us(a,e,i,r,s),a}if(e instanceof Error){const a=structuredClone(e);return r.set(e,a),a.message=e.message,a.name=e.name,a.stack=e.stack,a.cause=e.cause,a.constructor=e.constructor,us(a,e,i,r,s),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return r.set(e,a),us(a,e,i,r,s),a}if(e instanceof Number){const a=new Number(e.valueOf());return r.set(e,a),us(a,e,i,r,s),a}if(e instanceof String){const a=new String(e.valueOf());return r.set(e,a),us(a,e,i,r,s),a}if(typeof e=="object"&&hD(e)){const a=Object.create(Object.getPrototypeOf(e));return r.set(e,a),us(a,e,i,r,s),a}return e}function us(e,t,i=e,r,s){const o=[...Object.keys(t),...DS(t)];for(let a=0;a<o.length;a++){const n=o[a],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=Bn(t[n],n,i,r,s))}}function hD(e){switch(Km(e)){case WS:case Xz:case Vz:case Zz:case NS:case Uz:case oD:case aD:case iD:case rD:case sD:case Yz:case OS:case Kz:case Hz:case Gz:case FS:case jz:case Qz:case Jz:case tD:case eD:return!0;default:return!1}}function dD(e,t){return cD(e,(i,r,s,o)=>{if(typeof e=="object"){if(Km(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return o.set(e,a),us(a,e,s,o),a}switch(Object.prototype.toString.call(e)){case OS:case FS:case NS:{const a=new e.constructor(e?.valueOf());return us(a,e),a}case WS:{const a={};return us(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function cv(e){return dD(e)}function Nf(e){return e!==null&&typeof e=="object"&&Km(e)==="[object Arguments]"}function Wf(e){return typeof e=="object"&&e!==null}function uD(e){return Wf(e)&&qS(e)}function ad(e){return Jm(e)}function pD(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function Yc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const i=function(...r){const s=t?t.apply(this,r):r[0],o=i.cache;if(o.has(s))return o.get(s);const a=e.apply(this,r);return i.cache=o.set(s,a)||o,a};return i.cache=new(Yc.Cache||Map),i}Yc.Cache=Map;function fD(e){if(Qm(e))return e;if(Array.isArray(e)||Jm(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 i=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new i(e);if(e instanceof RegExp){const r=new i(e);return r.lastIndex=e.lastIndex,r}if(e instanceof DataView)return new i(e.buffer.slice(0));if(e instanceof Error){let r;return e instanceof AggregateError?r=new i(e.errors,e.message,{cause:e.cause}):r=new i(e.message,{cause:e.cause}),r.stack=e.stack,Object.assign(r,e),r}return typeof File<"u"&&e instanceof File?new i([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function gD(e,...t){const i=t.slice(0,-1),r=t[t.length-1];let s=e;for(let o=0;o<i.length;o++){const a=i[o];s=nd(s,a,r,new Map)}return s}function nd(e,t,i,r){if(Qm(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(r.has(t))return fD(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let o=0;o<t.length;o++)o in t||(t[o]=void 0)}const s=[...Object.keys(t),...DS(t)];for(let o=0;o<s.length;o++){const a=s[o];if(lD(a))continue;let n=t[a],l=e[a];if(Nf(n)&&(n={...n}),Nf(l)&&(l={...l}),Zm(n)&&(n=cv(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let u=0;u<d.length;u++){const p=d[u];h[p]=l[p]}l=h}else if(uD(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=i(l,n,a,e,t,r);c!==void 0?e[a]=c:Array.isArray(n)||Wf(l)&&Wf(n)&&(x0(l)||x0(n)||ad(l)||ad(n))?e[a]=nd(l,n,i,r):l==null&&x0(n)?e[a]=nd({},n,i,r):l==null&&ad(n)?e[a]=cv(n):(l===void 0||n!==void 0)&&(e[a]=n)}return e}function mD(e,...t){return gD(e,...t,qz)}function hv(e){if(e==null)return!0;if(qS(e))return typeof e.splice!="function"&&typeof e!="string"&&!Zm(e)&&!ad(e)&&!Nf(e)?!1:e.length===0;if(typeof e=="object"||typeof e=="function"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);return pD(e)?t.filter(i=>i!=="constructor").length===0:t.length===0}return!0}var bD="​",yD={curveBasis:Ff,curveBasisClosed:tz,curveBasisOpen:ez,curveBumpX:nS,curveBumpY:lS,curveBundle:iz,curveCardinalClosed:rz,curveCardinalOpen:sz,curveCardinal:uS,curveCatmullRomClosed:oz,curveCatmullRomOpen:az,curveCatmullRom:fS,curveLinear:fc,curveLinearClosed:nz,curveMonotoneX:vS,curveMonotoneY:wS,curveNatural:SS,curveStep:CS,curveStepAfter:$S,curveStepBefore:TS},xD=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,vD=b(function(e,t){const i=HS(e,/(?:init\b)|(?:initialize\b)/);let r={};if(Array.isArray(i)){const a=i.map(n=>n.args);Pd(a),r=yi(r,[...a])}else r=i.args;if(!r)return;let s=Iu(e,t);const o="config";return r[o]!==void 0&&(s==="flowchart-v2"&&(s="flowchart"),r[s]=r[o],delete r[o]),r},"detectInit"),HS=b(function(e,t=null){try{const i=new RegExp(`[%]{2}(?![{]${xD.source})(?=[}][%]{2}).*
1545
+ `,"ig");e=e.trim().replace(i,"").replace(/'/gm,'"'),vt.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let r;const s=[];for(;(r=dc.exec(e))!==null;)if(r.index===dc.lastIndex&&dc.lastIndex++,r&&!t||t&&r[1]?.match(t)||t&&r[2]?.match(t)){const o=r[1]?r[1]:r[2],a=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;s.push({type:o,args:a})}return s.length===0?{type:e,args:null}:s.length===1?s[0]:s}catch(i){return vt.error(`ERROR: ${i.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),wD=b(function(e){return e.replace(dc,"")},"removeDirectives"),kD=b(function(e,t){for(const[i,r]of t.entries())if(r.match(e))return i;return-1},"isSubstringInArray");function t1(e,t){if(!e)return t;const i=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return yD[i]??t}b(t1,"interpolateToCurve");function jS(e,t){const i=e.trim();if(i)return t.securityLevel!=="loose"?Wz.sanitizeUrl(i):i}b(jS,"formatUrl");var SD=b((e,...t)=>{const i=e.split("."),r=i.length-1,s=i[r];let o=window;for(let a=0;a<r;a++)if(o=o[i[a]],!o){vt.error(`Function name: ${e} not found in window`);return}o[s](...t)},"runFunc");function e1(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}b(e1,"distance");function US(e){let t,i=0;e.forEach(s=>{i+=e1(s,t),t=s});const r=i/2;return i1(e,r)}b(US,"traverseEdge");function YS(e){return e.length===1?e[0]:US(e)}b(YS,"calcLabelPosition");var dv=b((e,t=2)=>{const i=Math.pow(10,t);return Math.round(e*i)/i},"roundNumber"),i1=b((e,t)=>{let i,r=t;for(const s of e){if(i){const o=e1(s,i);if(o===0)return i;if(o<r)r-=o;else{const a=r/o;if(a<=0)return i;if(a>=1)return{x:s.x,y:s.y};if(a>0&&a<1)return{x:dv((1-a)*i.x+a*s.x,5),y:dv((1-a)*i.y+a*s.y,5)}}}i=s}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),CD=b((e,t,i)=>{vt.info(`our points ${JSON.stringify(t)}`),t[0]!==i&&(t=t.reverse());const s=i1(t,25),o=e?10:5,a=Math.atan2(t[0].y-s.y,t[0].x-s.x),n={x:0,y:0};return n.x=Math.sin(a)*o+(t[0].x+s.x)/2,n.y=-Math.cos(a)*o+(t[0].y+s.y)/2,n},"calcCardinalityPosition");function GS(e,t,i){const r=structuredClone(i);vt.info("our points",r),t!=="start_left"&&t!=="start_right"&&r.reverse();const s=25+e,o=i1(r,s),a=10+e*.5,n=Math.atan2(r[0].y-o.y,r[0].x-o.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*a+(r[0].x+o.x)/2,l.y=-Math.cos(n+Math.PI)*a+(r[0].y+o.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*a+(r[0].x+o.x)/2-5,l.y=-Math.cos(n-Math.PI)*a+(r[0].y+o.y)/2-5):t==="end_left"?(l.x=Math.sin(n)*a+(r[0].x+o.x)/2-5,l.y=-Math.cos(n)*a+(r[0].y+o.y)/2-5):(l.x=Math.sin(n)*a+(r[0].x+o.x)/2,l.y=-Math.cos(n)*a+(r[0].y+o.y)/2),l}b(GS,"calcTerminalLabelPosition");function XS(e){let t="",i="";for(const r of e)r!==void 0&&(r.startsWith("color:")||r.startsWith("text-align:")?i=i+r+";":t=t+r+";");return{style:t,labelStyle:i}}b(XS,"getStylesFromArray");var uv=0,TD=b(()=>(uv++,"id-"+Math.random().toString(36).substr(2,12)+"-"+uv),"generateId");function VS(e){let t="";const i="0123456789abcdef",r=i.length;for(let s=0;s<e;s++)t+=i.charAt(Math.floor(Math.random()*r));return t}b(VS,"makeRandomHex");var $D=b(e=>VS(e.length),"random"),MD=b(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"),AD=b(function(e,t){const i=t.text.replace(Hc.lineBreakRegex," "),[,r]=qu(t.fontSize),s=e.append("text");s.attr("x",t.x),s.attr("y",t.y),s.style("text-anchor",t.anchor),s.style("font-family",t.fontFamily),s.style("font-size",r),s.style("font-weight",t.fontWeight),s.attr("fill",t.fill),t.class!==void 0&&s.attr("class",t.class);const o=s.append("tspan");return o.attr("x",t.x+t.textMargin*2),o.attr("fill",t.fill),o.text(i),s},"drawSimpleText"),BD=Yc((e,t,i)=>{if(!e||(i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},i),Hc.hasBreaks(e)))return e;const r=e.split(" ").filter(Boolean),s=[];let o="";return r.forEach((a,n)=>{const l=To(`${a} `,i),c=To(o,i);if(l>t){const{hyphenatedStrings:u,remainingWord:p}=_D(a,t,"-",i);s.push(o,...u),o=p}else c+l>=t?(s.push(o),o=a):o=[o,a].filter(Boolean).join(" ");n+1===r.length&&s.push(o)}),s.filter(a=>a!=="").join(i.joinWith)},(e,t,i)=>`${e}${t}${i.fontSize}${i.fontWeight}${i.fontFamily}${i.joinWith}`),_D=Yc((e,t,i="-",r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},r);const s=[...e],o=[];let a="";return s.forEach((n,l)=>{const c=`${a}${n}`;if(To(c,r)>=t){const d=l+1,u=s.length===d,p=`${c}${i}`;o.push(u?c:p),a=""}else a=c}),{hyphenatedStrings:o,remainingWord:a}},(e,t,i="-",r)=>`${e}${t}${i}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function KS(e,t){return r1(e,t).height}b(KS,"calculateTextHeight");function To(e,t){return r1(e,t).width}b(To,"calculateTextWidth");var r1=Yc((e,t)=>{const{fontSize:i=12,fontFamily:r="Arial",fontWeight:s=400}=t;if(!e)return{width:0,height:0};const[,o]=qu(i),a=["sans-serif",r],n=e.split(Hc.lineBreakRegex),l=[],c=me("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const u of a){let p=0;const f={width:0,height:0,lineHeight:0};for(const g of n){const m=MD();m.text=g||bD;const x=AD(h,m).style("font-size",o).style("font-weight",s).style("font-family",u),w=(x._groups||x)[0][0].getBBox();if(w.width===0&&w.height===0)throw new Error("svg element not in render tree");f.width=Math.round(Math.max(f.width,w.width)),p=Math.round(w.height),f.height+=p,f.lineHeight=Math.round(Math.max(f.lineHeight,p))}l.push(f)}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}`),Kn,LD=(Kn=class{constructor(t=!1,i){this.count=0,this.count=i?i.length:0,this.next=t?()=>this.count++:()=>Date.now()}},b(Kn,"InitIDGenerator"),Kn),vh,PD=b(function(e){return vh=vh||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),vh.innerHTML=e,unescape(vh.textContent)},"entityDecode");function s1(e){return"str"in e}b(s1,"isDetailedError");var ED=b((e,t,i,r)=>{if(!r)return;const s=e.node()?.getBBox();s&&e.append("text").text(r).attr("text-anchor","middle").attr("x",s.x+s.width/2).attr("y",-i).attr("class",t)},"insertTitle"),qu=b(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 o1(e,t){return mD({},e,t)}b(o1,"cleanAndMerge");var xs={assignWithDepth:yi,wrapLabel:BD,calculateTextHeight:KS,calculateTextWidth:To,calculateTextDimensions:r1,cleanAndMerge:o1,detectInit:vD,detectDirective:HS,isSubstringInArray:kD,interpolateToCurve:t1,calcLabelPosition:YS,calcCardinalityPosition:CD,calcTerminalLabelPosition:GS,formatUrl:jS,getStylesFromArray:XS,generateId:TD,random:$D,runFunc:SD,entityDecode:PD,insertTitle:ED,isLabelCoordinateInPath:ZS,parseFontSize:qu,InitIDGenerator:LD},RD=b(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(i){return i.substring(0,i.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(i){return i.substring(0,i.length-1)}),t=t.replace(/#\w+;/g,function(i){const r=i.substring(1,i.length-1);return/^\+?\d+$/.test(r)?"fl°°"+r+"¶ß":"fl°"+r+"¶ß"}),t},"encodeEntities"),da=b(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),Fet=b((e,t,{counter:i=0,prefix:r,suffix:s},o)=>o||`${r?`${r}_`:""}${e}_${t}_${i}${s?`_${s}`:""}`,"getEdgeId");function wi(e){return e??null}b(wi,"handleUndefinedAttr");function ZS(e,t){const i=Math.round(e.x),r=Math.round(e.y),s=t.replace(/(\d+\.\d+)/g,o=>Math.round(parseFloat(o)).toString());return s.includes(i.toString())||s.includes(r.toString())}b(ZS,"isLabelCoordinateInPath");function a1(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ja=a1();function QS(e){Ja=e}var gc={exec:()=>null};function De(e,t=""){let i=typeof e=="string"?e:e.source,r={replace:(s,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(ur.caret,"$1"),i=i.replace(s,a),r},getRegex:()=>new RegExp(i,t)};return r}var ID=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ur={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")},zD=/^(?:[ \t]*(?:\n|$))+/,DD=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,FD=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Gc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,OD=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,n1=/(?:[*+-]|\d{1,9}[.)])/,JS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,tC=De(JS).replace(/bull/g,n1).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(),ND=De(JS).replace(/bull/g,n1).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(),l1=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,WD=/^[^\n]+/,c1=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qD=De(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",c1).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),HD=De(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,n1).getRegex(),Hu="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",h1=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,jD=De("^ {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",h1).replace("tag",Hu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),eC=De(l1).replace("hr",Gc).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",Hu).getRegex(),UD=De(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",eC).getRegex(),d1={blockquote:UD,code:DD,def:qD,fences:FD,heading:OD,hr:Gc,html:jD,lheading:tC,list:HD,newline:zD,paragraph:eC,table:gc,text:WD},pv=De("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Gc).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",Hu).getRegex(),YD={...d1,lheading:ND,table:pv,paragraph:De(l1).replace("hr",Gc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pv).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",Hu).getRegex()},GD={...d1,html:De(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",h1).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:gc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:De(l1).replace("hr",Gc).replace("heading",` *#{1,6} *[^
1546
1546
  ]`).replace("lheading",tC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},XD=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,VD=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,iC=/^( {2,}|\\)\n(?!\s*$)/,KD=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ju=/[\p{P}\p{S}]/u,u1=/[\s\p{P}\p{S}]/u,rC=/[^\s\p{P}\p{S}]/u,ZD=De(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,u1).getRegex(),sC=/(?!~)[\p{P}\p{S}]/u,QD=/(?!~)[\s\p{P}\p{S}]/u,JD=/(?:[^\s\p{P}\p{S}]|~)/u,tF=De(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ID?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),oC=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,eF=De(oC,"u").replace(/punct/g,ju).getRegex(),iF=De(oC,"u").replace(/punct/g,sC).getRegex(),aC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",rF=De(aC,"gu").replace(/notPunctSpace/g,rC).replace(/punctSpace/g,u1).replace(/punct/g,ju).getRegex(),sF=De(aC,"gu").replace(/notPunctSpace/g,JD).replace(/punctSpace/g,QD).replace(/punct/g,sC).getRegex(),oF=De("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,rC).replace(/punctSpace/g,u1).replace(/punct/g,ju).getRegex(),aF=De(/\\(punct)/,"gu").replace(/punct/g,ju).getRegex(),nF=De(/^<(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(),lF=De(h1).replace("(?:-->|$)","-->").getRegex(),cF=De("^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",lF).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,hF=De(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Xd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),nC=De(/^!?\[(label)\]\[(ref)\]/).replace("label",Xd).replace("ref",c1).getRegex(),lC=De(/^!?\[(ref)\](?:\[\])?/).replace("ref",c1).getRegex(),dF=De("reflink|nolink(?!\\()","g").replace("reflink",nC).replace("nolink",lC).getRegex(),fv=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,p1={_backpedal:gc,anyPunctuation:aF,autolink:nF,blockSkip:tF,br:iC,code:VD,del:gc,emStrongLDelim:eF,emStrongRDelimAst:rF,emStrongRDelimUnd:oF,escape:XD,link:hF,nolink:lC,punctuation:ZD,reflink:nC,reflinkSearch:dF,tag:cF,text:KD,url:gc},uF={...p1,link:De(/^!?\[(label)\]\((.*?)\)/).replace("label",Xd).getRegex(),reflink:De(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xd).getRegex()},qf={...p1,emStrongRDelimAst:sF,emStrongLDelim:iF,url:De(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",fv).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:De(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",fv).getRegex()},pF={...qf,br:De(iC).replace("{2,}","*").getRegex(),text:De(qf.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},wh={normal:d1,gfm:YD,pedantic:GD},Il={normal:p1,gfm:qf,breaks:pF,pedantic:uF},fF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},gv=e=>fF[e];function Rs(e,t){if(t){if(ur.escapeTest.test(e))return e.replace(ur.escapeReplace,gv)}else if(ur.escapeTestNoEncode.test(e))return e.replace(ur.escapeReplaceNoEncode,gv);return e}function mv(e){try{e=encodeURI(e).replace(ur.percentDecode,"%")}catch{return null}return e}function bv(e,t){let i=e.replace(ur.findPipe,(o,a,n)=>{let l=!1,c=a;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),r=i.split(ur.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(ur.slashPipe,"|");return r}function zl(e,t,i){let r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function gF(e,t){if(e.indexOf(t[1])===-1)return-1;let i=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return i>0?-2:-1}function yv(e,t,i,r,s){let o=t.href,a=t.title||null,n=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:i,href:o,title:a,text:n,tokens:r.inlineTokens(n)};return r.state.inLink=!1,l}function mF(e,t,i){let r=e.match(i.other.indentCodeCompensation);if(r===null)return t;let s=r[1];return t.split(`
1547
1547
  `).map(o=>{let a=o.match(i.other.beginningSpace);if(a===null)return o;let[n]=a;return n.length>=s.length?o.slice(s.length):o}).join(`
1548
1548
  `)}var Vd=class{options;rules;lexer;constructor(t){this.options=t||Ja}space(t){let i=this.rules.block.newline.exec(t);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(t){let i=this.rules.block.code.exec(t);if(i){let r=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?r:zl(r,`
@@ -1611,9 +1611,9 @@ ${o.join(`
1611
1611
  `)}`)}},b(Zn,"Profiler");globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};function hC(e,{markdownAutoWrap:t}){const r=e.replace(/<br\/>/g,`
1612
1612
  `).replace(/\n{2,}/g,`
1613
1613
  `);return cC(r)}b(hC,"preprocessMarkdown");function dC(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(i=>({content:i,type:"normal"}))??[])}b(dC,"nonMarkdownToLines");function uC(e,t={}){const i=hC(e,t),r=We.lexer(i),s=[[]];let o=0;function a(n,l="normal"){n.type==="text"?n.text.split(`
1614
- `).forEach((h,d)=>{d!==0&&(o++,s.push([])),h.split(" ").forEach(u=>{u=u.replace(/&#39;/g,"'"),u&&s[o].push({content:u,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&s[o].push({content:n.text,type:"normal"})}return b(a,"processNode"),r.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?s[o].push({content:n.text,type:"normal"}):s[o].push({content:n.raw,type:"normal"})}),s}b(uC,"markdownToLines");function pC(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}b(pC,"nonMarkdownToHTML");function fC(e,{markdownAutoWrap:t}={}){const i=We.lexer(e);function r(s){return s.type==="text"?t===!1?s.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):s.text.replace(/\n */g,"<br/>"):s.type==="strong"?`<strong>${s.tokens?.map(r).join("")}</strong>`:s.type==="em"?`<em>${s.tokens?.map(r).join("")}</em>`:s.type==="paragraph"?`<p>${s.tokens?.map(r).join("")}</p>`:s.type==="space"?"":s.type==="html"?`${s.text}`:s.type==="escape"?s.text:(vt.warn(`Unsupported markdown: ${s.type}`),s.raw)}return b(r,"output"),i.map(r).join("")}b(fC,"markdownToHTML");var wF=(function(e){var t=function(){},i=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(c){return setTimeout(c,16)};function r(){var c=this;c.reads=[],c.writes=[],c.raf=i.bind(e)}b(r,"FastDom"),r.prototype={constructor:r,runTasks:b(function(c){for(var h;h=c.shift();)h()},"runTasks"),measure:b(function(c,h){var d=h?c.bind(h):c;return this.reads.push(d),s(this),d},"measure"),mutate:b(function(c,h){var d=h?c.bind(h):c;return this.writes.push(d),s(this),d},"mutate"),clear:b(function(c){return a(this.reads,c)||a(this.writes,c)},"clear"),extend:b(function(c){if(typeof c!="object")throw new Error("expected object");var h=Object.create(this);return n(h,c),h.fastdom=this,h.initialize&&h.initialize(),h},"extend"),catch:null};function s(c){c.scheduled||(c.scheduled=!0,c.raf(o.bind(null,c)))}b(s,"scheduleFlush");function o(c){var h=c.writes,d=c.reads,u;try{t("flushing reads",d.length),c.runTasks(d),t("flushing writes",h.length),c.runTasks(h)}catch(p){u=p}if(c.scheduled=!1,(d.length||h.length)&&s(c),u)if(t("task errored",u.message),c.catch)c.catch(u);else throw u}b(o,"flush");function a(c,h){var d=c.indexOf(h);return!!~d&&!!c.splice(d,1)}b(a,"remove");function n(c,h){for(var d in h)h.hasOwnProperty(d)&&(c[d]=h[d])}b(n,"mixin");var l=e.fastdom=e.fastdom||new r;return l})(typeof window<"u"?window:globalThis),gC={initialize:b(function(){this._tasks=new Map},"initialize"),mutate:b(function(e,t){return Yf(this,"mutate",e,t)},"mutate"),measure:b(function(e,t){return Yf(this,"measure",e,t)},"measure"),clear:b(function(e){var t=this._tasks,i=t.get(e);this.fastdom.clear(i),t.delete(e)},"clear")};function Yf(e,t,i,r){var s=e._tasks,o=e.fastdom,a,n=new Promise(function(l,c){a=o[t](function(){s.delete(n);try{l(r?i.call(r):i())}catch(h){c(h)}},r)});return s.set(n,a),n}b(Yf,"create");var{initialize:Het,mutate:jet,measure:Uet,clear:Yet}=gC,kF=gC,SF=wF.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(kF),Ka=SF;function mC(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}b(mC,"splitTextToChars");function bC(e,t){const i=mC(t.content);return g1(e,[],i,t.type)}b(bC,"splitWordToFitWidth");function g1(e,t,i,r){if(i.length===0)return[{content:t.join(""),type:r},{content:"",type:r}];const[s,...o]=i,a=[...t,s];return e([{content:a.join(""),type:r}])?g1(e,a,o,r):(t.length===0&&s&&(t.push(s),i.shift()),[{content:t.join(""),type:r},{content:i.join(""),type:r}])}b(g1,"splitWordToFitWidthRecursion");function yC(e,t){if(e.some(({content:i})=>i.includes(`
1614
+ `).forEach((h,d)=>{d!==0&&(o++,s.push([])),h.split(" ").forEach(u=>{u=u.replace(/&#39;/g,"'"),u&&s[o].push({content:u,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{a(c,n.type)}):n.type==="html"&&s[o].push({content:n.text,type:"normal"})}return b(a,"processNode"),r.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{a(l)}):n.type==="html"?s[o].push({content:n.text,type:"normal"}):s[o].push({content:n.raw,type:"normal"})}),s}b(uC,"markdownToLines");function pC(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}b(pC,"nonMarkdownToHTML");function fC(e,{markdownAutoWrap:t}={}){const i=We.lexer(e);function r(s){return s.type==="text"?t===!1?s.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):s.text.replace(/\n */g,"<br/>"):s.type==="strong"?`<strong>${s.tokens?.map(r).join("")}</strong>`:s.type==="em"?`<em>${s.tokens?.map(r).join("")}</em>`:s.type==="paragraph"?`<p>${s.tokens?.map(r).join("")}</p>`:s.type==="space"?"":s.type==="html"?`${s.text}`:s.type==="escape"?s.text:(vt.warn(`Unsupported markdown: ${s.type}`),s.raw)}return b(r,"output"),i.map(r).join("")}b(fC,"markdownToHTML");var wF=(function(e){var t=function(){},i=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(c){return setTimeout(c,16)};function r(){var c=this;c.reads=[],c.writes=[],c.raf=i.bind(e)}b(r,"FastDom"),r.prototype={constructor:r,runTasks:b(function(c){for(var h;h=c.shift();)h()},"runTasks"),measure:b(function(c,h){var d=h?c.bind(h):c;return this.reads.push(d),s(this),d},"measure"),mutate:b(function(c,h){var d=h?c.bind(h):c;return this.writes.push(d),s(this),d},"mutate"),clear:b(function(c){return a(this.reads,c)||a(this.writes,c)},"clear"),extend:b(function(c){if(typeof c!="object")throw new Error("expected object");var h=Object.create(this);return n(h,c),h.fastdom=this,h.initialize&&h.initialize(),h},"extend"),catch:null};function s(c){c.scheduled||(c.scheduled=!0,c.raf(o.bind(null,c)))}b(s,"scheduleFlush");function o(c){var h=c.writes,d=c.reads,u;try{t("flushing reads",d.length),c.runTasks(d),t("flushing writes",h.length),c.runTasks(h)}catch(p){u=p}if(c.scheduled=!1,(d.length||h.length)&&s(c),u)if(t("task errored",u.message),c.catch)c.catch(u);else throw u}b(o,"flush");function a(c,h){var d=c.indexOf(h);return!!~d&&!!c.splice(d,1)}b(a,"remove");function n(c,h){for(var d in h)h.hasOwnProperty(d)&&(c[d]=h[d])}b(n,"mixin");var l=e.fastdom=e.fastdom||new r;return l})(typeof window<"u"?window:globalThis),gC={initialize:b(function(){this._tasks=new Map},"initialize"),mutate:b(function(e,t){return Yf(this,"mutate",e,t)},"mutate"),measure:b(function(e,t){return Yf(this,"measure",e,t)},"measure"),clear:b(function(e){var t=this._tasks,i=t.get(e);this.fastdom.clear(i),t.delete(e)},"clear")};function Yf(e,t,i,r){var s=e._tasks,o=e.fastdom,a,n=new Promise(function(l,c){a=o[t](function(){s.delete(n);try{l(r?i.call(r):i())}catch(h){c(h)}},r)});return s.set(n,a),n}b(Yf,"create");var{initialize:jet,mutate:Uet,measure:Yet,clear:Get}=gC,kF=gC,SF=wF.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(kF),Ka=SF;function mC(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}b(mC,"splitTextToChars");function bC(e,t){const i=mC(t.content);return g1(e,[],i,t.type)}b(bC,"splitWordToFitWidth");function g1(e,t,i,r){if(i.length===0)return[{content:t.join(""),type:r},{content:"",type:r}];const[s,...o]=i,a=[...t,s];return e([{content:a.join(""),type:r}])?g1(e,a,o,r):(t.length===0&&s&&(t.push(s),i.shift()),[{content:t.join(""),type:r},{content:i.join(""),type:r}])}b(g1,"splitWordToFitWidthRecursion");function yC(e,t){if(e.some(({content:i})=>i.includes(`
1615
1615
  `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Zd(e,t)}b(yC,"splitLineToFitWidth");function Zd(e,t,i=[],r=[]){if(e.length===0)return r.length>0&&i.push(r),i.length>0?i:[];let s="";e[0].content===" "&&(s=" ",e.shift());const o=e.shift()??{content:" ",type:"normal"},a=[...r];if(s!==""&&a.push({content:s,type:"normal"}),a.push(o),t(a))return Zd(e,t,i,a);if(r.length>0)i.push(r),e.unshift(o);else if(o.content){const[n,l]=bC(t,o);i.push([n]),l.content&&e.unshift(l)}return Zd(e,t,i)}b(Zd,"splitLineToFitWidthRecursion");function Gf(e,t){t&&e.attr("style",t)}b(Gf,"applyStyle");var xv=16384;async function xC(e,t,i,r,s=!1,o=ei(),a=0){const n=e.append("foreignObject");n.attr("width",`${Math.min(10*i,xv)}px`),n.attr("height",`${Math.min(10*i,xv)}px`);const l=n.append("xhtml:div"),c=Cc(t.label)?await B4(t.label.replace(Hc.lineBreakRegex,`
1616
- `),o):es(t.label,o),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");d.html(c),Gf(d,t.labelStyle),d.attr("class",`${h} ${r}`),Gf(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),i!==Number.POSITIVE_INFINITY&&(l.style("max-width",i+"px"),l.style("text-align","center")),l.attr("xmlns","http://www.w3.org/1999/xhtml"),s&&l.attr("class","labelBkg");const u=await Ka.measure(()=>l.node().getBoundingClientRect());return u.width===i?(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",i+"px")):u.width<a&&(l.style("display","table"),l.style("width",a+"px"),l.style("text-align","center")),n.node()}b(xC,"addHtmlSpan");function Uu(e,t,i,r=!1){const s=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*i-.1+"em").attr("dy",i+"em");return r&&s.attr("text-anchor","middle"),s}b(Uu,"createTspan");function vC(e,t,i){const r=e.append("text"),s=Uu(r,1,t);Yu(s,i);const o=s.node().getComputedTextLength();return r.remove(),o}b(vC,"computeWidthOfText");function CF(e,t,i){const r=e.append("text"),s=Uu(r,1,t);Yu(s,[{content:i,type:"normal"}]);const o=s.node()?.getBoundingClientRect();return o&&r.remove(),o}b(CF,"computeDimensionOfText");function wC(e,t,i,r=!1,s=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");s&&l.attr("text-anchor","middle");let c=0;for(const h of i){const d=b(p=>vC(a,1.1,p)<=e,"checkWidth"),u=d(h)?[h]:yC(h,d);for(const p of u){const f=Uu(l,c,1.1,s);Yu(f,p),c++}}if(r){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()}b(wC,"createFormattedText");function Xf(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(i,r)=>{switch(r){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return i}})}b(Xf,"decodeHTMLEntities");function Yu(e,t){e.text(""),t.forEach((i,r)=>{const s=e.append("tspan").attr("font-style",i.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",i.type==="strong"?"bold":"normal");r===0?s.text(Xf(i.content)):s.text(" "+Xf(i.content))})}b(Yu,"updateTextContentAndStyles");async function kC(e,t={}){const i=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(s,o,a)=>(i.push((async()=>{const n=`${o}:${a}`;return await zS(n)?await ml(n,void 0,{class:"label-icon"}):`<i class='${es(s,t).replace(":"," ")}'></i>`})()),s));const r=await Promise.all(i);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>r.shift()??"")}b(kC,"replaceIconSubstring");var qr=b(async(e,t="",{style:i="",isTitle:r=!1,classes:s="",useHtmlLabels:o=!0,markdown:a=!0,isNode:n=!0,width:l=200,minWidth:c=0,addSvgBackground:h=!1}={},d)=>{if(vt.debug("XYZ createText",t,i,r,s,o,n,"addSvgBackground: ",h),o){const u=a?fC(t,d):pC(t),p=await kC(da(u),d),f=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Cc(t)?f:p,labelStyle:i.replace("fill:","color:")};return await xC(e,g,l,s,h,d,c)}else{const u=da(t.replace(/<br\s*\/?>/g,"<br/>")),p=a?uC(u.replace("<br>","<br/>"),d):dC(u),f=wC(l,e,p,t?h:!1,!n);if(n){/stroke:/.exec(i)&&(i=i.replace("stroke:","lineColor:"));const g=i.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");me(f).attr("style",g)}else{const g=i.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");me(f).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=i.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");me(f).select("text").attr("style",m)}return r?me(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):me(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText"),TF=new Set(["redux-color","redux-dark-color"]),$F=12,MF=64,m1=b(e=>Array.isArray(e)&&e.length>0,"hasPalette"),AF=b((e,t)=>e!=null&&TF.has(e)&&m1(t),"isColorTheme"),BF=/^[\w-]+$/,Get=b(e=>{const t=typeof e=="string"||typeof e=="number"?String(e):"";return BF.test(t)?t:"classic"},"safeLook"),SC=b(e=>m1(e)?e.length:0,"paletteSlotCount"),Xet=b((e,t)=>m1(t)?SC(t):typeof e=="number"&&Number.isInteger(e)&&e>0&&e<=MF?e:$F,"colorSlotCount"),ls=b((e,t,i,r)=>{if(t===void 0||!AF(i,r))return;const s=t%SC(r);e.attr("data-color-id",`color-${s}`)},"stampColorSlot");function w0(e,t,i){if(e&&e.length){const[r,s]=t,o=Math.PI/180*i,a=Math.cos(o),n=Math.sin(o);for(const l of e){const[c,h]=l;l[0]=(c-r)*a-(h-s)*n+r,l[1]=(c-r)*n+(h-s)*a+s}}}function _F(e,t){return e[0]===t[0]&&e[1]===t[1]}function LF(e,t,i,r=1){const s=i,o=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(s)for(const c of a)w0(c,n,s);const l=(function(c,h,d){const u=[];for(const w of c){const S=[...w];_F(S[0],S[S.length-1])||S.push([S[0][0],S[0][1]]),S.length>2&&u.push(S)}const p=[];h=Math.max(h,.1);const f=[];for(const w of u)for(let S=0;S<w.length-1;S++){const A=w[S],C=w[S+1];if(A[1]!==C[1]){const E=Math.min(A[1],C[1]);f.push({ymin:E,ymax:Math.max(A[1],C[1]),x:E===A[1]?A[0]:C[0],islope:(C[0]-A[0])/(C[1]-A[1])})}}if(f.sort(((w,S)=>w.ymin<S.ymin?-1:w.ymin>S.ymin?1:w.x<S.x?-1:w.x>S.x?1:w.ymax===S.ymax?0:(w.ymax-S.ymax)/Math.abs(w.ymax-S.ymax))),!f.length)return p;let g=[],m=f[0].ymin,x=0;for(;g.length||f.length;){if(f.length){let w=-1;for(let S=0;S<f.length&&!(f[S].ymin>m);S++)w=S;f.splice(0,w+1).forEach((S=>{g.push({s:m,edge:S})}))}if(g=g.filter((w=>!(w.edge.ymax<=m))),g.sort(((w,S)=>w.edge.x===S.edge.x?0:(w.edge.x-S.edge.x)/Math.abs(w.edge.x-S.edge.x))),(d!==1||x%h==0)&&g.length>1)for(let w=0;w<g.length;w+=2){const S=w+1;if(S>=g.length)break;const A=g[w].edge,C=g[S].edge;p.push([[Math.round(A.x),m],[Math.round(C.x),m]])}m+=d,g.forEach((w=>{w.edge.x=w.edge.x+d*w.edge.islope})),x++}return p})(a,o,r);if(s){for(const c of a)w0(c,n,-s);(function(c,h,d){const u=[];c.forEach((p=>u.push(...p))),w0(u,h,d)})(l,n,-s)}return l}function Xc(e,t){var i;const r=t.hachureAngle+90;let s=t.hachureGap;s<0&&(s=4*t.strokeWidth),s=Math.round(Math.max(s,.1));let o=1;return t.roughness>=1&&(((i=t.randomizer)===null||i===void 0?void 0:i.next())||Math.random())>.7&&(o=s),LF(e,s,r,o||1)}class b1{constructor(t){this.helper=t}fillPolygons(t,i){return this._fillPolygons(t,i)}_fillPolygons(t,i){const r=Xc(t,i);return{type:"fillSketch",ops:this.renderLines(r,i)}}renderLines(t,i){const r=[];for(const s of t)r.push(...this.helper.doubleLineOps(s[0][0],s[0][1],s[1][0],s[1][1],i));return r}}function Gu(e){const t=e[0],i=e[1];return Math.sqrt(Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2))}class PF extends b1{fillPolygons(t,i){let r=i.hachureGap;r<0&&(r=4*i.strokeWidth),r=Math.max(r,.1);const s=Xc(t,Object.assign({},i,{hachureGap:r})),o=Math.PI/180*i.hachureAngle,a=[],n=.5*r*Math.cos(o),l=.5*r*Math.sin(o);for(const[c,h]of s)Gu([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,i)}}}class EF extends b1{fillPolygons(t,i){const r=this._fillPolygons(t,i),s=Object.assign({},i,{hachureAngle:i.hachureAngle+90}),o=this._fillPolygons(t,s);return r.ops=r.ops.concat(o.ops),r}}let RF=class{constructor(t){this.helper=t}fillPolygons(t,i){const r=Xc(t,i=Object.assign({},i,{hachureAngle:0}));return this.dotsOnLines(r,i)}dotsOnLines(t,i){const r=[];let s=i.hachureGap;s<0&&(s=4*i.strokeWidth),s=Math.max(s,.1);let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const a=s/4;for(const n of t){const l=Gu(n),c=l/s,h=Math.ceil(c)-1,d=l-h*s,u=(n[0][0]+n[1][0])/2-s/4,p=Math.min(n[0][1],n[1][1]);for(let f=0;f<h;f++){const g=p+d+f*s,m=u-a+2*Math.random()*a,x=g-a+2*Math.random()*a,w=this.helper.ellipse(m,x,o,o,i);r.push(...w.ops)}}return{type:"fillSketch",ops:r}}};class IF{constructor(t){this.helper=t}fillPolygons(t,i){const r=Xc(t,i);return{type:"fillSketch",ops:this.dashedLine(r,i)}}dashedLine(t,i){const r=i.dashOffset<0?i.hachureGap<0?4*i.strokeWidth:i.hachureGap:i.dashOffset,s=i.dashGap<0?i.hachureGap<0?4*i.strokeWidth:i.hachureGap:i.dashGap,o=[];return t.forEach((a=>{const n=Gu(a),l=Math.floor(n/(r+s)),c=(n+s-l*(r+s))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const u=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p<l;p++){const f=p*(r+s),g=f+r,m=[h[0]+f*Math.cos(u)+c*Math.cos(u),h[1]+f*Math.sin(u)+c*Math.sin(u)],x=[h[0]+g*Math.cos(u)+c*Math.cos(u),h[1]+g*Math.sin(u)+c*Math.sin(u)];o.push(...this.helper.doubleLineOps(m[0],m[1],x[0],x[1],i))}})),o}}class zF{constructor(t){this.helper=t}fillPolygons(t,i){const r=i.hachureGap<0?4*i.strokeWidth:i.hachureGap,s=i.zigzagOffset<0?r:i.zigzagOffset,o=Xc(t,i=Object.assign({},i,{hachureGap:r+s}));return{type:"fillSketch",ops:this.zigzagLines(o,s,i)}}zigzagLines(t,i,r){const s=[];return t.forEach((o=>{const a=Gu(o),n=Math.round(a/(2*i));let l=o[0],c=o[1];l[0]>c[0]&&(l=o[1],c=o[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const u=2*d*i,p=2*(d+1)*i,f=Math.sqrt(2*Math.pow(i,2)),g=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],m=[l[0]+p*Math.cos(h),l[1]+p*Math.sin(h)],x=[g[0]+f*Math.cos(h+Math.PI/4),g[1]+f*Math.sin(h+Math.PI/4)];s.push(...this.helper.doubleLineOps(g[0],g[1],x[0],x[1],r),...this.helper.doubleLineOps(x[0],x[1],m[0],m[1],r))}})),s}}const wr={};class DF{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const FF=0,k0=1,vv=2,kh={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 S0(e,t){return e.type===t}function y1(e){const t=[],i=(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:FF,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:k0,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:vv,text:""},n})(e);let r="BOD",s=0,o=i[s];for(;!S0(o,vv);){let a=0;const n=[];if(r==="BOD"){if(o.text!=="M"&&o.text!=="m")return y1("M0,0"+e);s++,a=kh[o.text],r=o.text}else S0(o,k0)?a=kh[r]:(s++,a=kh[o.text],r=o.text);if(!(s+a<i.length))throw new Error("Path data ended short");for(let l=s;l<s+a;l++){const c=i[l];if(!S0(c,k0))throw new Error("Param not a number: "+r+","+c.text);n[n.length]=+c.text}if(typeof kh[r]!="number")throw new Error("Bad segment: "+r);{const l={key:r,data:n};t.push(l),s+=a,o=i[s],r==="M"&&(r="L"),r==="m"&&(r="l")}}return t}function CC(e){let t=0,i=0,r=0,s=0;const o=[];for(const{key:a,data:n}of e)switch(a){case"M":o.push({key:"M",data:[...n]}),[t,i]=n,[r,s]=n;break;case"m":t+=n[0],i+=n[1],o.push({key:"M",data:[t,i]}),r=t,s=i;break;case"L":o.push({key:"L",data:[...n]}),[t,i]=n;break;case"l":t+=n[0],i+=n[1],o.push({key:"L",data:[t,i]});break;case"C":o.push({key:"C",data:[...n]}),t=n[4],i=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+i:c+t));o.push({key:"C",data:l}),t=l[4],i=l[5];break}case"Q":o.push({key:"Q",data:[...n]}),t=n[2],i=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+i:c+t));o.push({key:"Q",data:l}),t=l[2],i=l[3];break}case"A":o.push({key:"A",data:[...n]}),t=n[5],i=n[6];break;case"a":t+=n[5],i+=n[6],o.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,i]});break;case"H":o.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...n]}),i=n[0];break;case"v":i+=n[0],o.push({key:"V",data:[i]});break;case"S":o.push({key:"S",data:[...n]}),t=n[2],i=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+i:c+t));o.push({key:"S",data:l}),t=l[2],i=l[3];break}case"T":o.push({key:"T",data:[...n]}),t=n[0],i=n[1];break;case"t":t+=n[0],i+=n[1],o.push({key:"T",data:[t,i]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=r,i=s}return o}function TC(e){const t=[];let i="",r=0,s=0,o=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[r,s]=h,[o,a]=h;break;case"C":t.push({key:"C",data:[...h]}),r=h[4],s=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[r,s]=h;break;case"H":r=h[0],t.push({key:"L",data:[r,s]});break;case"V":s=h[0],t.push({key:"L",data:[r,s]});break;case"S":{let d=0,u=0;i==="C"||i==="S"?(d=r+(r-n),u=s+(s-l)):(d=r,u=s),t.push({key:"C",data:[d,u,...h]}),n=h[0],l=h[1],r=h[2],s=h[3];break}case"T":{const[d,u]=h;let p=0,f=0;i==="Q"||i==="T"?(p=r+(r-n),f=s+(s-l)):(p=r,f=s);const g=r+2*(p-r)/3,m=s+2*(f-s)/3,x=d+2*(p-d)/3,w=u+2*(f-u)/3;t.push({key:"C",data:[g,m,x,w,d,u]}),n=p,l=f,r=d,s=u;break}case"Q":{const[d,u,p,f]=h,g=r+2*(d-r)/3,m=s+2*(u-s)/3,x=p+2*(d-p)/3,w=f+2*(u-f)/3;t.push({key:"C",data:[g,m,x,w,p,f]}),n=d,l=u,r=p,s=f;break}case"A":{const d=Math.abs(h[0]),u=Math.abs(h[1]),p=h[2],f=h[3],g=h[4],m=h[5],x=h[6];d===0||u===0?(t.push({key:"C",data:[r,s,m,x,m,x]}),r=m,s=x):(r!==m||s!==x)&&($C(r,s,m,x,d,u,p,f,g).forEach((function(w){t.push({key:"C",data:w})})),r=m,s=x);break}case"Z":t.push({key:"Z",data:[]}),r=o,s=a}i=c}return t}function Dl(e,t,i){return[e*Math.cos(i)-t*Math.sin(i),e*Math.sin(i)+t*Math.cos(i)]}function $C(e,t,i,r,s,o,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let u=[],p=0,f=0,g=0,m=0;if(c)[p,f,g,m]=c;else{[e,t]=Dl(e,t,-h),[i,r]=Dl(i,r,-h);const U=(e-i)/2,D=(t-r)/2;let O=U*U/(s*s)+D*D/(o*o);O>1&&(O=Math.sqrt(O),s*=O,o*=O);const M=s*s,X=o*o,G=M*X-M*D*D-X*U*U,nt=M*D*D+X*U*U,Y=(n===l?-1:1)*Math.sqrt(Math.abs(G/nt));g=Y*s*D/o+(e+i)/2,m=Y*-o*U/s+(t+r)/2,p=Math.asin(parseFloat(((t-m)/o).toFixed(9))),f=Math.asin(parseFloat(((r-m)/o).toFixed(9))),e<g&&(p=Math.PI-p),i<g&&(f=Math.PI-f),p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),l&&p>f&&(p-=2*Math.PI),!l&&f>p&&(f-=2*Math.PI)}let x=f-p;if(Math.abs(x)>120*Math.PI/180){const U=f,D=i,O=r;f=l&&f>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,u=$C(i=g+s*Math.cos(f),r=m+o*Math.sin(f),D,O,s,o,a,0,l,[f,U,g,m])}x=f-p;const w=Math.cos(p),S=Math.sin(p),A=Math.cos(f),C=Math.sin(f),E=Math.tan(x/4),z=4/3*s*E,R=4/3*o*E,V=[e,t],F=[e+z*S,t-R*w],H=[i+z*C,r-R*A],W=[i,r];if(F[0]=2*V[0]-F[0],F[1]=2*V[1]-F[1],c)return[F,H,W].concat(u);{u=[F,H,W].concat(u);const U=[];for(let D=0;D<u.length;D+=3){const O=Dl(u[D][0],u[D][1],h),M=Dl(u[D+1][0],u[D+1][1],h),X=Dl(u[D+2][0],u[D+2][1],h);U.push([O[0],O[1],M[0],M[1],X[0],X[1]])}return U}}const OF={randOffset:function(e,t){return de(e,t)},randOffsetWithRange:function(e,t,i){return Qd(e,t,i)},ellipse:function(e,t,i,r,s){const o=AC(i,r,s);return Vf(e,t,s,o).opset},doubleLineOps:function(e,t,i,r,s){return ua(e,t,i,r,s,!0)}};function MC(e,t,i,r,s){return{type:"path",ops:ua(e,t,i,r,s)}}function ld(e,t,i){const r=(e||[]).length;if(r>2){const s=[];for(let o=0;o<r-1;o++)s.push(...ua(e[o][0],e[o][1],e[o+1][0],e[o+1][1],i));return t&&s.push(...ua(e[r-1][0],e[r-1][1],e[0][0],e[0][1],i)),{type:"path",ops:s}}return r===2?MC(e[0][0],e[0][1],e[1][0],e[1][1],i):{type:"path",ops:[]}}function NF(e,t,i,r,s){return(function(o,a){return ld(o,!0,a)})([[e,t],[e+i,t],[e+i,t+r],[e,t+r]],s)}function wv(e,t){if(e.length){const i=typeof e[0][0]=="number"?[e]:e,r=Sh(i[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:Sh(i[0],1.5*(1+.22*t.roughness),Cv(t));for(let o=1;o<i.length;o++){const a=i[o];if(a.length){const n=Sh(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Sh(a,1.5*(1+.22*t.roughness),Cv(t));for(const c of n)c.op!=="move"&&r.push(c);for(const c of l)c.op!=="move"&&s.push(c)}}return{type:"path",ops:r.concat(s)}}return{type:"path",ops:[]}}function AC(e,t,i){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),s=Math.ceil(Math.max(i.curveStepCount,i.curveStepCount/Math.sqrt(200)*r)),o=2*Math.PI/s;let a=Math.abs(e/2),n=Math.abs(t/2);const l=1-i.curveFitting;return a+=de(a*l,i),n+=de(n*l,i),{increment:o,rx:a,ry:n}}function Vf(e,t,i,r){const[s,o]=Tv(r.increment,e,t,r.rx,r.ry,1,r.increment*Qd(.1,Qd(.4,1,i),i),i);let a=Jd(s,null,i);if(!i.disableMultiStroke&&i.roughness!==0){const[n]=Tv(r.increment,e,t,r.rx,r.ry,1.5,0,i),l=Jd(n,null,i);a=a.concat(l)}return{estimatedPoints:o,opset:{type:"path",ops:a}}}function kv(e,t,i,r,s,o,a,n,l){const c=e,h=t;let d=Math.abs(i/2),u=Math.abs(r/2);d+=de(.01*d,l),u+=de(.01*u,l);let p=s,f=o;for(;p<0;)p+=2*Math.PI,f+=2*Math.PI;f-p>2*Math.PI&&(p=0,f=2*Math.PI);const g=2*Math.PI/l.curveStepCount,m=Math.min(g/2,(f-p)/2),x=$v(m,c,h,d,u,p,f,1,l);if(!l.disableMultiStroke){const w=$v(m,c,h,d,u,p,f,1.5,l);x.push(...w)}return a&&(n?x.push(...ua(c,h,c+d*Math.cos(p),h+u*Math.sin(p),l),...ua(c,h,c+d*Math.cos(f),h+u*Math.sin(f),l)):x.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(p),h+u*Math.sin(p)]})),{type:"path",ops:x}}function Sv(e,t){const i=TC(CC(y1(e))),r=[];let s=[0,0],o=[0,0];for(const{key:a,data:n}of i)switch(a){case"M":o=[n[0],n[1]],s=[n[0],n[1]];break;case"L":r.push(...ua(o[0],o[1],n[0],n[1],t)),o=[n[0],n[1]];break;case"C":{const[l,c,h,d,u,p]=n;r.push(...WF(l,c,h,d,u,p,o,t)),o=[u,p];break}case"Z":r.push(...ua(o[0],o[1],s[0],s[1],t)),o=[s[0],s[1]]}return{type:"path",ops:r}}function C0(e,t){const i=[];for(const r of e)if(r.length){const s=t.maxRandomnessOffset||0,o=r.length;if(o>2){i.push({op:"move",data:[r[0][0]+de(s,t),r[0][1]+de(s,t)]});for(let a=1;a<o;a++)i.push({op:"lineTo",data:[r[a][0]+de(s,t),r[a][1]+de(s,t)]})}}return{type:"fillPath",ops:i}}function pn(e,t){return(function(i,r){let s=i.fillStyle||"hachure";if(!wr[s])switch(s){case"zigzag":wr[s]||(wr[s]=new PF(r));break;case"cross-hatch":wr[s]||(wr[s]=new EF(r));break;case"dots":wr[s]||(wr[s]=new RF(r));break;case"dashed":wr[s]||(wr[s]=new IF(r));break;case"zigzag-line":wr[s]||(wr[s]=new zF(r));break;default:s="hachure",wr[s]||(wr[s]=new b1(r))}return wr[s]})(t,OF).fillPolygons(e,t)}function Cv(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function BC(e){return e.randomizer||(e.randomizer=new DF(e.seed||0)),e.randomizer.next()}function Qd(e,t,i,r=1){return i.roughness*r*(BC(i)*(t-e)+e)}function de(e,t,i=1){return Qd(-e,e,t,i)}function ua(e,t,i,r,s,o=!1){const a=o?s.disableMultiStrokeFill:s.disableMultiStroke,n=Kf(e,t,i,r,s,!0,!1);if(a)return n;const l=Kf(e,t,i,r,s,!0,!0);return n.concat(l)}function Kf(e,t,i,r,s,o,a){const n=Math.pow(e-i,2)+Math.pow(t-r,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=s.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,u=.2+.2*BC(s);let p=s.bowing*s.maxRandomnessOffset*(r-t)/200,f=s.bowing*s.maxRandomnessOffset*(e-i)/200;p=de(p,s,c),f=de(f,s,c);const g=[],m=()=>de(d,s,c),x=()=>de(h,s,c),w=s.preserveVertices;return a?g.push({op:"move",data:[e+(w?0:m()),t+(w?0:m())]}):g.push({op:"move",data:[e+(w?0:de(h,s,c)),t+(w?0:de(h,s,c))]}),a?g.push({op:"bcurveTo",data:[p+e+(i-e)*u+m(),f+t+(r-t)*u+m(),p+e+2*(i-e)*u+m(),f+t+2*(r-t)*u+m(),i+(w?0:m()),r+(w?0:m())]}):g.push({op:"bcurveTo",data:[p+e+(i-e)*u+x(),f+t+(r-t)*u+x(),p+e+2*(i-e)*u+x(),f+t+2*(r-t)*u+x(),i+(w?0:x()),r+(w?0:x())]}),g}function Sh(e,t,i){if(!e.length)return[];const r=[];r.push([e[0][0]+de(t,i),e[0][1]+de(t,i)]),r.push([e[0][0]+de(t,i),e[0][1]+de(t,i)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+de(t,i),e[s][1]+de(t,i)]),s===e.length-1&&r.push([e[s][0]+de(t,i),e[s][1]+de(t,i)]);return Jd(r,null,i)}function Jd(e,t,i){const r=e.length,s=[];if(r>3){const o=[],a=1-i.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<r;n++){const l=e[n];o[0]=[l[0],l[1]],o[1]=[l[0]+(a*e[n+1][0]-a*e[n-1][0])/6,l[1]+(a*e[n+1][1]-a*e[n-1][1])/6],o[2]=[e[n+1][0]+(a*e[n][0]-a*e[n+2][0])/6,e[n+1][1]+(a*e[n][1]-a*e[n+2][1])/6],o[3]=[e[n+1][0],e[n+1][1]],s.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}}else r===3?(s.push({op:"move",data:[e[1][0],e[1][1]]}),s.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&s.push(...Kf(e[0][0],e[0][1],e[1][0],e[1][1],i,!0,!0));return s}function Tv(e,t,i,r,s,o,a,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+r*Math.cos(-e),i+s*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+r*Math.cos(h),i+s*Math.sin(h)];l.push(d),c.push(d)}c.push([t+r*Math.cos(0),i+s*Math.sin(0)]),c.push([t+r*Math.cos(e),i+s*Math.sin(e)])}else{const h=de(.5,n)-Math.PI/2;c.push([de(o,n)+t+.9*r*Math.cos(h-e),de(o,n)+i+.9*s*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let u=h;u<d;u+=e){const p=[de(o,n)+t+r*Math.cos(u),de(o,n)+i+s*Math.sin(u)];l.push(p),c.push(p)}c.push([de(o,n)+t+r*Math.cos(h+2*Math.PI+.5*a),de(o,n)+i+s*Math.sin(h+2*Math.PI+.5*a)]),c.push([de(o,n)+t+.98*r*Math.cos(h+a),de(o,n)+i+.98*s*Math.sin(h+a)]),c.push([de(o,n)+t+.9*r*Math.cos(h+.5*a),de(o,n)+i+.9*s*Math.sin(h+.5*a)])}return[c,l]}function $v(e,t,i,r,s,o,a,n,l){const c=o+de(.1,l),h=[];h.push([de(n,l)+t+.9*r*Math.cos(c-e),de(n,l)+i+.9*s*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([de(n,l)+t+r*Math.cos(d),de(n,l)+i+s*Math.sin(d)]);return h.push([t+r*Math.cos(a),i+s*Math.sin(a)]),h.push([t+r*Math.cos(a),i+s*Math.sin(a)]),Jd(h,null,l)}function WF(e,t,i,r,s,o,a,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let p=0;p<d;p++)p===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(u?0:de(c[0],n)),a[1]+(u?0:de(c[0],n))]}),h=u?[s,o]:[s+de(c[p],n),o+de(c[p],n)],l.push({op:"bcurveTo",data:[e+de(c[p],n),t+de(c[p],n),i+de(c[p],n),r+de(c[p],n),h[0],h[1]]});return l}function Fl(e){return[...e]}function Mv(e,t=0){const i=e.length;if(i<3)throw new Error("A curve must have at least three points.");const r=[];if(i===3)r.push(Fl(e[0]),Fl(e[1]),Fl(e[2]),Fl(e[2]));else{const s=[];s.push(e[0],e[0]);for(let n=1;n<e.length;n++)s.push(e[n]),n===e.length-1&&s.push(e[n]);const o=[],a=1-t;r.push(Fl(s[0]));for(let n=1;n+2<s.length;n++){const l=s[n];o[0]=[l[0],l[1]],o[1]=[l[0]+(a*s[n+1][0]-a*s[n-1][0])/6,l[1]+(a*s[n+1][1]-a*s[n-1][1])/6],o[2]=[s[n+1][0]+(a*s[n][0]-a*s[n+2][0])/6,s[n+1][1]+(a*s[n][1]-a*s[n+2][1])/6],o[3]=[s[n+1][0],s[n+1][1]],r.push(o[1],o[2],o[3])}}return r}function cd(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function qF(e,t,i){const r=cd(t,i);if(r===0)return cd(e,t);let s=((e[0]-t[0])*(i[0]-t[0])+(e[1]-t[1])*(i[1]-t[1]))/r;return s=Math.max(0,Math.min(1,s)),cd(e,Ra(t,i,s))}function Ra(e,t,i){return[e[0]+(t[0]-e[0])*i,e[1]+(t[1]-e[1])*i]}function Zf(e,t,i,r){const s=r||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],u=n[l+3];let p=3*h[0]-2*c[0]-u[0];p*=p;let f=3*h[1]-2*c[1]-u[1];f*=f;let g=3*d[0]-2*u[0]-c[0];g*=g;let m=3*d[1]-2*u[1]-c[1];return m*=m,p<g&&(p=g),f<m&&(f=m),p+f})(e,t)<i){const n=e[t+0];s.length?(o=s[s.length-1],a=n,Math.sqrt(cd(o,a))>1&&s.push(n)):s.push(n),s.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],u=Ra(l,c,.5),p=Ra(c,h,.5),f=Ra(h,d,.5),g=Ra(u,p,.5),m=Ra(p,f,.5),x=Ra(g,m,.5);Zf([l,u,g,x],0,i,s),Zf([x,m,f,d],0,i,s)}var o,a;return s}function HF(e,t){return tu(e,0,e.length,t)}function tu(e,t,i,r,s){const o=s||[],a=e[t],n=e[i-1];let l=0,c=1;for(let h=t+1;h<i-1;++h){const d=qF(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>r?(tu(e,t,c+1,r,o),tu(e,c,i,r,o)):(o.length||o.push(a),o.push(n)),o}function T0(e,t=.15,i){const r=[],s=(e.length-1)/3;for(let o=0;o<s;o++)Zf(e,3*o,t,r);return i&&i>0?tu(r,0,r.length,i):r}const Rr="none";let eu=class{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,i,r){return{shape:t,sets:i||[],options:r||this.defaultOptions}}line(t,i,r,s,o){const a=this._o(o);return this._d("line",[MC(t,i,r,s,a)],a)}rectangle(t,i,r,s,o){const a=this._o(o),n=[],l=NF(t,i,r,s,a);if(a.fill){const c=[[t,i],[t+r,i],[t+r,i+s],[t,i+s]];a.fillStyle==="solid"?n.push(C0([c],a)):n.push(pn([c],a))}return a.stroke!==Rr&&n.push(l),this._d("rectangle",n,a)}ellipse(t,i,r,s,o){const a=this._o(o),n=[],l=AC(r,s,a),c=Vf(t,i,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=Vf(t,i,a,l).opset;h.type="fillPath",n.push(h)}else n.push(pn([c.estimatedPoints],a));return a.stroke!==Rr&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,i,r,s){const o=this.ellipse(t,i,r,r,s);return o.shape="circle",o}linearPath(t,i){const r=this._o(i);return this._d("linearPath",[ld(t,!1,r)],r)}arc(t,i,r,s,o,a,n=!1,l){const c=this._o(l),h=[],d=kv(t,i,r,s,o,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const p=kv(t,i,r,s,o,a,!0,!1,u);p.type="fillPath",h.push(p)}else h.push((function(u,p,f,g,m,x,w){const S=u,A=p;let C=Math.abs(f/2),E=Math.abs(g/2);C+=de(.01*C,w),E+=de(.01*E,w);let z=m,R=x;for(;z<0;)z+=2*Math.PI,R+=2*Math.PI;R-z>2*Math.PI&&(z=0,R=2*Math.PI);const V=(R-z)/w.curveStepCount,F=[];for(let H=z;H<=R;H+=V)F.push([S+C*Math.cos(H),A+E*Math.sin(H)]);return F.push([S+C*Math.cos(R),A+E*Math.sin(R)]),F.push([S,A]),pn([F],w)})(t,i,r,s,o,a,c));return c.stroke!==Rr&&h.push(d),this._d("arc",h,c)}curve(t,i){const r=this._o(i),s=[],o=wv(t,r);if(r.fill&&r.fill!==Rr)if(r.fillStyle==="solid"){const a=wv(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...T0(Mv([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):a.push(...T0(Mv(c),10,(1+r.roughness)/2))}a.length&&s.push(pn([a],r))}return r.stroke!==Rr&&s.push(o),this._d("curve",s,r)}polygon(t,i){const r=this._o(i),s=[],o=ld(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(C0([t],r)):s.push(pn([t],r))),r.stroke!==Rr&&s.push(o),this._d("polygon",s,r)}path(t,i){const r=this._o(i),s=[];if(!t)return this._d("path",s,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=r.fill&&r.fill!=="transparent"&&r.fill!==Rr,a=r.stroke!==Rr,n=!!(r.simplification&&r.simplification<1),l=(function(h,d,u){const p=TC(CC(y1(h))),f=[];let g=[],m=[0,0],x=[];const w=()=>{x.length>=4&&g.push(...T0(x,d)),x=[]},S=()=>{w(),g.length&&(f.push(g),g=[])};for(const{key:C,data:E}of p)switch(C){case"M":S(),m=[E[0],E[1]],g.push(m);break;case"L":w(),g.push([E[0],E[1]]);break;case"C":if(!x.length){const z=g.length?g[g.length-1]:m;x.push([z[0],z[1]])}x.push([E[0],E[1]]),x.push([E[2],E[3]]),x.push([E[4],E[5]]);break;case"Z":w(),g.push([m[0],m[1]])}if(S(),!u)return f;const A=[];for(const C of f){const E=HF(C,u);E.length&&A.push(E)}return A})(t,1,n?4-4*(r.simplification||1):(1+r.roughness)/2),c=Sv(t,r);if(o)if(r.fillStyle==="solid")if(l.length===1){const h=Sv(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else s.push(C0(l,r));else s.push(pn(l,r));return a&&(n?l.forEach((h=>{s.push(ld(h,!1,r))})):s.push(c)),this._d("path",s,r)}opsToPath(t,i){let r="";for(const s of t.ops){const o=typeof i=="number"&&i>=0?s.data.map((a=>+a.toFixed(i))):s.data;switch(s.op){case"move":r+=`M${o[0]} ${o[1]} `;break;case"bcurveTo":r+=`C${o[0]} ${o[1]}, ${o[2]} ${o[3]}, ${o[4]} ${o[5]} `;break;case"lineTo":r+=`L${o[0]} ${o[1]} `}}return r.trim()}toPaths(t){const i=t.sets||[],r=t.options||this.defaultOptions,s=[];for(const o of i){let a=null;switch(o.type){case"path":a={d:this.opsToPath(o),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Rr};break;case"fillPath":a={d:this.opsToPath(o),stroke:Rr,strokeWidth:0,fill:r.fill||Rr};break;case"fillSketch":a=this.fillSketch(o,r)}a&&s.push(a)}return s}fillSketch(t,i){let r=i.fillWeight;return r<0&&(r=i.strokeWidth/2),{d:this.opsToPath(t),stroke:i.fill||Rr,strokeWidth:r,fill:Rr}}_mergedShape(t){return t.filter(((i,r)=>r===0||i.op!=="move"))}},jF=class{constructor(t,i){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new eu(i)}draw(t){const i=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const a of i)switch(a.type){case"path":s.save(),s.strokeStyle=r.stroke==="none"?"transparent":r.stroke,s.lineWidth=r.strokeWidth,r.strokeLineDash&&s.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(s.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(s,a,o),s.restore();break;case"fillPath":{s.save(),s.fillStyle=r.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(s,a,o,n),s.restore();break}case"fillSketch":this.fillSketch(s,a,r)}}fillSketch(t,i,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=s,this._drawToContext(t,i,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,i,r,s="nonzero"){t.beginPath();for(const o of i.ops){const a=typeof r=="number"&&r>=0?o.data.map((n=>+n.toFixed(r))):o.data;switch(o.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}i.type==="fillPath"?t.fill(s):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,i,r,s,o){const a=this.gen.line(t,i,r,s,o);return this.draw(a),a}rectangle(t,i,r,s,o){const a=this.gen.rectangle(t,i,r,s,o);return this.draw(a),a}ellipse(t,i,r,s,o){const a=this.gen.ellipse(t,i,r,s,o);return this.draw(a),a}circle(t,i,r,s){const o=this.gen.circle(t,i,r,s);return this.draw(o),o}linearPath(t,i){const r=this.gen.linearPath(t,i);return this.draw(r),r}polygon(t,i){const r=this.gen.polygon(t,i);return this.draw(r),r}arc(t,i,r,s,o,a,n=!1,l){const c=this.gen.arc(t,i,r,s,o,a,n,l);return this.draw(c),c}curve(t,i){const r=this.gen.curve(t,i);return this.draw(r),r}path(t,i){const r=this.gen.path(t,i);return this.draw(r),r}};const Ch="http://www.w3.org/2000/svg";let UF=class{constructor(t,i){this.svg=t,this.gen=new eu(i)}draw(t){const i=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,o=s.createElementNS(Ch,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of i){let l=null;switch(n.type){case"path":l=s.createElementNS(Ch,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",r.stroke),l.setAttribute("stroke-width",r.strokeWidth+""),l.setAttribute("fill","none"),r.strokeLineDash&&l.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":l=s.createElementNS(Ch,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",r.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(s,n,r)}l&&o.appendChild(l)}return o}fillSketch(t,i,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const o=t.createElementNS(Ch,"path");return o.setAttribute("d",this.opsToPath(i,r.fixedDecimalPlaceDigits)),o.setAttribute("stroke",r.fill||""),o.setAttribute("stroke-width",s+""),o.setAttribute("fill","none"),r.fillLineDash&&o.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,i){return this.gen.opsToPath(t,i)}line(t,i,r,s,o){const a=this.gen.line(t,i,r,s,o);return this.draw(a)}rectangle(t,i,r,s,o){const a=this.gen.rectangle(t,i,r,s,o);return this.draw(a)}ellipse(t,i,r,s,o){const a=this.gen.ellipse(t,i,r,s,o);return this.draw(a)}circle(t,i,r,s){const o=this.gen.circle(t,i,r,s);return this.draw(o)}linearPath(t,i){const r=this.gen.linearPath(t,i);return this.draw(r)}polygon(t,i){const r=this.gen.polygon(t,i);return this.draw(r)}arc(t,i,r,s,o,a,n=!1,l){const c=this.gen.arc(t,i,r,s,o,a,n,l);return this.draw(c)}curve(t,i){const r=this.gen.curve(t,i);return this.draw(r)}path(t,i){const r=this.gen.path(t,i);return this.draw(r)}};var Nt={canvas:(e,t)=>new jF(e,t),svg:(e,t)=>new UF(e,t),generator:e=>new eu(e),newSeed:()=>eu.newSeed()},YF=1,GF=3;async function x1(e){const t=e.getElementsByTagName("img");if(!t||t.length===0)return;const i=!v1(e);await Promise.all([...t].map(r=>new Promise(s=>{function o(){if(r.style.display="flex",r.style.flexDirection="column",i){const a=ye().fontSize?ye().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[l=fm.fontSize]=qu(a),c=l*n+"px";r.style.minWidth=c,r.style.maxWidth=c}else r.style.width="100%";s(r)}b(o,"setupImage"),setTimeout(()=>{r.complete&&o()}),r.addEventListener("error",o),r.addEventListener("load",o)})))}b(x1,"configureLabelImages");function v1(e){return e.nodeType===GF?e.textContent?.trim()!=="":e.nodeType!==YF||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(v1)}b(v1,"hasTextBesidesImages");var Av=3,XF=32,VF=b(async(e,t,i)=>{const r=ye(),s=e.insert("g").attr("class",i??"node default").attr("id",t.domId||t.id),o=s.insert("g").attr("class","label").attr("style",wi(t.labelStyle)),n=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(x=>({text:x,cssClass:"c4-descr"}))].filter(x=>x.text),l=t.width?Math.max(t.width-2*(t.padding??0),XF):ye().flowchart?.wrappingWidth??200,h=r.c4?.wrap??!0?l:Number.POSITIVE_INFINITY,d=await Promise.all(n.map(async x=>{const w=o.append("g").attr("class",x.cssClass),S=await qr(w,es(da(x.text??""),r),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:h,style:t.labelStyle},r);return me(S).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),me(S).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:w,box:w.node().getBBox()}})),u=Math.max(...d.map(({box:x})=>x.width),0);let p=0;for(const{el:x,box:w}of d)x.attr("transform",`translate(${u/2-w.x-w.width/2}, ${p-w.y})`),p+=w.height+Av;const f=d.length>0?p-Av:0;o.insert("rect",":first-child"),o.attr("transform",`translate(${-u/2}, ${-f/2})`);const g=o.node().getBBox(),m=(t.padding??0)/2;return{shapeSvg:s,bbox:g,halfPadding:m,label:o}},"c4LabelHelper"),Bv=b((e,t)=>{const{x:i,y:r,width:s,height:o}=e;return s>=t?e:"left"in e?{x:i,y:r,width:t,height:o,top:r,left:i,bottom:r+o,right:i+t,toJSON:b(()=>({}),"toJSON")}:{x:i-(t-s)/2,y:r,width:t,height:o}},"withMinWidth"),ee=b(async(e,t,i)=>{if(t.stereotype!==void 0)return VF(e,t,i);let r;const s=t.useHtmlLabels||Qs(ye()?.htmlLabels);i?r=i:r="node default";const o=e.insert("g").attr("class",r).attr("id",t.domId||t.id),a=o.insert("g").attr("class","label").attr("style",wi(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=n&&!t.width?t.minWidth??0:0,d=await qr(a,es(da(n),ye()),{useHtmlLabels:s,width:t.width||t.wrappingWidth||ye().flowchart?.wrappingWidth,minWidth:h,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},ye()),u=(t?.padding??0)/2;let p;if(s){const f=d.children[0],g=me(d);await x1(f),p=await Ka.measure(()=>f.getBoundingClientRect()),p=Bv(p,h),g.attr("width",p.width),g.attr("height",p.height)}else p=await Ka.measure(()=>d.getBBox()),p=Bv(p,h);return s?a.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):a.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:o,bbox:p,halfPadding:u,label:a}},"labelHelper"),Ha=b(async(e,t,i)=>{const r=i.useHtmlLabels??Ni(ye()),s=e.insert("g").attr("class","label").attr("style",i.labelStyle||""),o=await qr(s,es(da(t),ye()),{useHtmlLabels:r,width:i.width||ye()?.flowchart?.wrappingWidth,style:i.labelStyle,addSvgBackground:!!i.icon||!!i.img}),a=i.padding/2;let n;if(Ni(ye())){const l=o.children[0],c=me(o);n=await Ka.measure(()=>l.getBoundingClientRect()),c.attr("width",n.width),c.attr("height",n.height)}else n=await Ka.measure(()=>o.getBBox());return r?s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"):s.attr("transform","translate(0, "+-n.height/2+")"),i.centerLabel&&s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:e,bbox:n,halfPadding:a,label:s}},"insertLabel"),Yt=b((e,t,i)=>{if(i){e.width=i.width,e.height=i.height;return}const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),te=b((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function Pe(e){const t=e.map((i,r)=>`${r===0?"M":"L"}${i.x},${i.y}`);return t.push("Z"),t.join(" ")}b(Pe,"createPathFromPoints");function pa(e,t,i,r,s,o){const a=[],l=i-e,c=r-t,h=l/o,d=2*Math.PI/h,u=t+c/2;for(let p=0;p<=50;p++){const f=p/50,g=e+f*l,m=u+s*Math.sin(d*(g-e));a.push({x:g,y:m})}return a}b(pa,"generateFullSineWavePoints");function Os(e,t,i,r,s,o){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(r-1);for(let d=0;d<r;d++){const u=n+d*h,p=e+i*Math.cos(u),f=t+i*Math.sin(u);a.push({x:-p,y:-f})}return a}b(Os,"generateCirclePoints");function Qf(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),i=document.createElementNS("http://www.w3.org/2000/svg","path"),r=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");i.setAttribute("d",r);const s=t.find(l=>l.getAttribute("fill")!=="none"),o=t.find(l=>l.getAttribute("stroke")!=="none"),a=b((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(s){const l={fill:a(s,"fill"),"fill-opacity":a(s,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&i.setAttribute(c,h)})}if(o){const l={stroke:a(o,"stroke"),"stroke-width":a(o,"stroke-width")??"1","stroke-opacity":a(o,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&i.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(i),n}b(Qf,"mergePaths");var KF=b((e,t)=>{var i=e.x,r=e.y,s=t.x-i,o=t.y-r,a=e.width/2,n=e.height/2,l,c;return Math.abs(o)*a>Math.abs(s)*n?(o<0&&(n=-n),l=o===0?0:n*s/o,c=n):(s<0&&(a=-a),l=a,c=s===0?0:a*o/s),{x:i+l,y:r+c}},"intersectRect"),_o=KF;function _C(e,t){return e.intersect(t)}b(_C,"intersectNode");var ZF=_C;function LC(e,t,i,r){var s=e.x,o=e.y,a=s-r.x,n=o-r.y,l=Math.sqrt(t*t*n*n+i*i*a*a),c=Math.abs(t*i*a/l);r.x<s&&(c=-c);var h=Math.abs(t*i*n/l);return r.y<o&&(h=-h),{x:s+c,y:o+h}}b(LC,"intersectEllipse");var PC=LC;function EC(e,t,i){return PC(e,t,t,i)}b(EC,"intersectCircle");var QF=EC;function RC(e,t,i,r){{const s=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,n=s*i.x+o*i.y+a,l=s*r.x+o*r.y+a,c=1e-6;if(n!==0&&l!==0&&Jf(n,l))return;const h=r.y-i.y,d=i.x-r.x,u=r.x*i.y-i.x*r.y,p=h*e.x+d*e.y+u,f=h*t.x+d*t.y+u;if(Math.abs(p)<c&&Math.abs(f)<c&&Jf(p,f))return;const g=s*d-h*o;if(g===0)return;const m=(o*u-d*a)/g,x=(h*a-s*u)/g;return{x:m,y:x}}}b(RC,"intersectLine");function Jf(e,t){return e*t>0}b(Jf,"sameSign");var JF=RC;function IC(e,t,i){let r=e.x,s=e.y,o=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=r-e.width/2-a,c=s-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],u=t[h<t.length-1?h+1:0],p=JF(e,i,{x:l+d.x,y:c+d.y},{x:l+u.x,y:c+u.y});p&&o.push(p)}return o.length?(o.length>1&&o.sort(function(h,d){let u=h.x-i.x,p=h.y-i.y,f=Math.sqrt(u*u+p*p),g=d.x-i.x,m=d.y-i.y,x=Math.sqrt(g*g+m*m);return f<x?-1:f===x?0:1}),o[0]):e}b(IC,"intersectPolygon");var tO=IC,Dt={node:ZF,circle:QF,ellipse:PC,polygon:tO,rect:_o},Hr=b((e,t,i,r,s)=>["M",e+s,t,"H",e+i-s,"A",s,s,0,0,1,e+i,t+s,"V",t+r-s,"A",s,s,0,0,1,e+i-s,t+r,"H",e+s,"A",s,s,0,0,1,e,t+r-s,"V",t+s,"A",s,s,0,0,1,e+s,t,"Z"].join(" "),"createRoundedRectPathD"),eO=b(async(e,t,i,r=!1,s=!1)=>{let o=t||"";typeof o=="object"&&(o=o[0]);const a=ye(),n=Ni(a);return await qr(e,o,{style:i,isTitle:r,useHtmlLabels:n,markdown:!1,isNode:s,width:Number.POSITIVE_INFINITY},a)},"createLabel"),bo=eO;function zC(e,t){const{labelStyles:i}=jt(t);t.labelStyle=i;const r=te(t);let s=r;r||(s="anchor");const o=e.insert("g").attr("class",s).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,l=Nt.svg(o),c=Ot(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,a*2,c),d=o.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",wi(n)),Yt(t,d),t.intersect=function(u){return vt.info("Circle intersect",t,a,u),Dt.circle(t,a,u)},o}b(zC,"anchor");function tg(e,t,i,r,s,o,a){const l=(e+i)/2,c=(t+r)/2,h=Math.atan2(r-t,i-e),d=(i-e)/2,u=(r-t)/2,p=d/s,f=u/o,g=Math.sqrt(p**2+f**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");const m=Math.sqrt(1-g**2),x=l+m*o*Math.sin(h)*(a?-1:1),w=c-m*s*Math.cos(h)*(a?-1:1),S=Math.atan2((t-w)/o,(e-x)/s);let C=Math.atan2((r-w)/o,(i-x)/s)-S;a&&C<0&&(C+=2*Math.PI),!a&&C>0&&(C-=2*Math.PI);const E=[];for(let z=0;z<20;z++){const R=z/19,V=S+R*C,F=x+s*Math.cos(V),H=w+o*Math.sin(V);E.push({x:F,y:H})}return E}b(tg,"generateArcPoints");function DC(e,t,i){const[r,s]=[t,i].sort((o,a)=>a-o);return s*(1-Math.sqrt(1-(e/r/2)**2))}b(DC,"calculateArcSagitta");async function FC(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=b(V=>V+a,"calcTotalHeight"),l=b(V=>{const F=V/2;return[F/(2.5+V/50),F]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await ee(e,t,te(t)),d=n(t?.height?t?.height:h.height),[u,p]=l(d),f=DC(d,u,p),m=(t?.width?t?.width:h.width)+o*2+f-f,x=d,{cssStyles:w}=t,S=[{x:m/2,y:-x/2},{x:-m/2,y:-x/2},...tg(-m/2,-x/2,-m/2,x/2,u,p,!1),{x:m/2,y:x/2},...tg(m/2,x/2,m/2,-x/2,u,p,!0)],A=Nt.svg(c),C=Ot(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const E=Pe(S),z=A.path(E,C),R=c.insert(()=>z,":first-child");return R.attr("class","basic label-container outer-path"),w&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",w),r&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",r),R.attr("transform",`translate(${u/2}, 0)`),Yt(t,R),t.intersect=function(V){return Dt.polygon(t,S,V)},c}b(FC,"bowTieRect");async function OC(e,t,{config:{themeVariables:i}}){const{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:n}=await ee(e,t,te(t)),l=i?.nodeBorder??i?.lineColor??"currentColor",c=t.padding??12,h=Math.max(a.width+c*2,t.width??0,80),d=Math.max(Math.min(h*.08,12),5),u=Math.max(a.height+c*2+d,t.height??0),p=-u/2+d,f=u/2,g=h*.72,m=[`M${-h/2},${p}`,`L${-g/2},${f}`,`A${g/2},${d} 0 0 0 ${g/2},${f}`,`L${h/2},${p}`,`A${h/2},${d} 0 0 0 ${-h/2},${p}`,"Z"].join(" "),{cssStyles:x}=t,w=o.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const R=Nt.svg(o).path(m,Ot(t,{}));w.node()?.appendChild(R),x&&w.attr("style",x)}else w.append("path").attr("d",m).attr("style",s);w.append("ellipse").attr("cx",0).attr("cy",p).attr("rx",h/2).attr("ry",d).attr("style",`fill:none;stroke:${l};stroke-width:1px`),Yt(t,w);const S=p+(f-p)/2;n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${S-a.height/2-(a.y-(a.top??0))})`);const A=12,C=b((z,R,V)=>Array.from({length:A+1},(F,H)=>{const W=Math.PI-H*Math.PI/A;return{x:z*Math.cos(W),y:R+V*d*Math.sin(W)}}),"arc"),E=[...C(h/2,p,-1),...C(g/2,f,1).reverse()];return t.intersect=function(z){return Dt.polygon(t,E,z)},o}b(OC,"bucket");var _v=20,Lv=8,iO=80,rO=8;function NC(e){const{themeVariables:t}=ye(),i=t.clusterBkg,r=t.clusterBorder;return e==="flow"?{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"}:{rx:rO,fill:i,stroke:r,cssClass:"collapsed-group"}}b(NC,"getCollapsedStyle");async function WC(e,t){const i=NC(t.metadata?.containerType),{fill:r,stroke:s}=i,{nodeStyles:o}=jt(t),{shapeSvg:a,bbox:n}=await ee(e,t,te(t)),{theme:l,themeVariables:c}=ye();ls(a,t.colorIndex,l,c.borderColorArray);const h=t.padding??8,d=n.height,u=Math.max(n.width+h*2,iO,t?.width??0),p=Math.max(d+Lv+_v+h*2,t?.height??0),f=-u/2,g=-p/2,m=-28/2,x=a.select(".label");x&&(t.useHtmlLabels??Ni(ye())?x.attr("transform",`translate(${-n.width/2}, ${-n.height/2+m})`):x.attr("transform",`translate(0, ${-n.height/2+m})`));let w;if(t.look==="handDrawn"){const z=Nt.svg(a),R=Ot(t,{fill:r,stroke:s,...i.strokeWidth===void 0?{}:{strokeWidth:i.strokeWidth},...r==="none"?{fillWeight:0}:{fillStyle:"solid"}}),V=z.path(Hr(f,g,u,p,i.rx),R);w=a.insert(()=>V,":first-child"),w.attr("class","basic label-container "+i.cssClass).attr("style",wi(t.cssStyles))}else w=a.insert("rect",":first-child"),w.attr("class","basic label-container "+i.cssClass).attr("style",o).attr("rx",i.rx).attr("ry",i.rx).attr("x",f).attr("y",g).attr("width",u).attr("height",p).attr("fill",r).attr("stroke",s),i.strokeWidth!==void 0&&w.attr("stroke-width",i.strokeWidth+"px");const S=g+h+d+Lv;a.append("line").attr("class","collapsed-separator").attr("x1",f+8).attr("y1",S).attr("x2",f+u-8).attr("y2",S).attr("stroke",s).attr("stroke-dasharray","3, 3");const A=S+_v/2,C=2.5,E=10;for(let z=-1;z<=1;z++)a.append("circle").attr("class","collapsed-indicator").attr("cx",z*E).attr("cy",A).attr("r",C).attr("fill",s);return Yt(t,w),t.calcIntersect=function(z,R){return Dt.rect(z,R)},t.intersect=function(z){return Dt.rect(t,z)},a}b(WC,"collapsedGroup");function to(e,t,i,r){return e.insert("polygon",":first-child").attr("points",r.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+i/2+")")}b(to,"insertPolygonShape");var sO=["right","left","up","down"],w1="point",oO=b(e=>{const t=new Set;for(const i of e)switch(i){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(i);break}return t},"expandAndDeduplicateDirections"),aO=b(e=>sO.filter(t=>e.has(t)).join("|")||w1,"getDirectionKey"),Pv={"right|left|up|down":b(({height:e,midpoint:t,padding:i,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*i},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*i,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*i},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*i,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":b(({height:e,midpoint:t,width:i})=>[{x:t,y:0},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":b(({height:e,midpoint:t,width:i})=>[{x:0,y:0},{x:t,y:-e},{x:i-t,y:-e},{x:i,y:0}],"right|left|down"),"right|up|down":b(({height:e,midpoint:t,width:i})=>[{x:0,y:0},{x:i,y:-t},{x:i,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":b(({height:e,midpoint:t,width:i})=>[{x:i,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:i,y:-e}],"left|up|down"),"right|left":b(({height:e,midpoint:t,padding:i,width:r})=>[{x:t,y:0},{x:t,y:-i},{x:r-t,y:-i},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+i},{x:t,y:-e+i},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":b(({height:e,midpoint:t,padding:i,width:r})=>[{x:r/2,y:0},{x:0,y:-i},{x:t,y:-i},{x:t,y:-e+i},{x:0,y:-e+i},{x:r/2,y:-e},{x:r,y:-e+i},{x:r-t,y:-e+i},{x:r-t,y:-i},{x:r,y:-i}],"up|down"),"right|up":b(({height:e,midpoint:t,width:i})=>[{x:0,y:0},{x:i,y:-t},{x:0,y:-e}],"right|up"),"right|down":b(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":b(({height:e,midpoint:t,width:i})=>[{x:i,y:0},{x:0,y:-t},{x:i,y:-e}],"left|up"),"left|down":b(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:b(({height:e,midpoint:t,padding:i,width:r})=>[{x:t,y:-i},{x:t,y:-i},{x:r-t,y:-i},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+i},{x:t,y:-e+i},{x:t,y:-e+i}],"right"),left:b(({height:e,midpoint:t,padding:i,width:r})=>[{x:t,y:0},{x:t,y:-i},{x:r-t,y:-i},{x:r-t,y:-e+i},{x:t,y:-e+i},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:b(({height:e,midpoint:t,padding:i,width:r})=>[{x:t,y:-i},{x:t,y:-e+i},{x:0,y:-e+i},{x:r/2,y:-e},{x:r,y:-e+i},{x:r-t,y:-e+i},{x:r-t,y:-i}],"up"),down:b(({height:e,midpoint:t,padding:i,width:r})=>[{x:r/2,y:0},{x:0,y:-i},{x:t,y:-i},{x:t,y:-e+i},{x:r-t,y:-e+i},{x:r-t,y:-i},{x:r,y:-i}],"down"),[w1]:()=>[{x:0,y:0}]},nO=b((e,t,i,r)=>{const s=oO(e),o=(i.padding??0)/2,a=t.height+4*o,n=a/2,l=r??t.width+2*n+2*o,c=aO(s);return(Pv[c]??Pv[w1])({height:a,midpoint:n,padding:o,width:l})},"getArrowPoints");async function qC(e,t){const i=t,{shapeSvg:r,bbox:s}=await ee(e,i,te(i)),o=i.padding??0,a=s.height+2*o,n=a/2,l=s.width+2*n+o,c=i.width??0,d=i.positioned&&(i.widthInColumns??1)>1&&c>l?c:l,u=nO(i.directions??[],s,i,d),p=to(r,d,a,u);return p.attr("style",i.style??null),Yt(i,p),i.intersect=function(f){return Dt.polygon(i,u,f)},r}b(qC,"block_arrow");async function HC(e,t,{config:{themeVariables:i}}){const{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:n}=await ee(e,t,te(t)),l=i?.nodeBorder??i?.lineColor??"currentColor",c=t.padding??12,h=18,d=12,u=Math.max(a.width+c*2,t.width??0,90),p=Math.max(a.height+c*2+h,t.height??0),f=-p/2,{cssStyles:g}=t,m=o.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const S=Nt.svg(o).path(Hr(-u/2,f,u,p,d),Ot(t,{}));m.node()?.appendChild(S),g&&m.attr("style",g)}else m.append("rect").attr("x",-u/2).attr("y",f).attr("width",u).attr("height",p).attr("rx",d).attr("ry",d).attr("style",s);m.append("line").attr("x1",-u/2).attr("y1",f+h).attr("x2",u/2).attr("y2",f+h).attr("style",`stroke:${l};stroke-width:1px`);for(let w=0;w<3;w++)m.append("circle").attr("cx",-u/2+12+w*9).attr("cy",f+h/2).attr("r",2.5).attr("style",`fill:${l};stroke:none`);m.append("rect").attr("class","browser-address-bar").attr("x",-u/2+44).attr("y",f+4).attr("width",Math.max(u-56,10)).attr("height",h-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${l};stroke-width:1px;opacity:0.6`),Yt(t,m);const x=f+h+(p-h)/2;return n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(w){return Dt.rect(t,w)},o}b(HC,"browser");var Th=12;async function jC(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?28:s,a=t.look==="neo"?24:s,{shapeSvg:n,bbox:l}=await ee(e,t,te(t)),c=(t?.width??l.width)+(t.look==="neo"?o*2:o+Th),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,u=c,p=-h,f=0,g=[{x:d+Th,y:p},{x:u,y:p},{x:u,y:f},{x:d,y:f},{x:d,y:p+Th},{x:d+Th,y:p}];let m;const{cssStyles:x}=t;if(t.look==="handDrawn"){const w=Nt.svg(n),S=Ot(t,{}),A=Pe(g),C=w.path(A,S);m=n.insert(()=>C,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),x&&m.attr("style",x)}else m=to(n,c,h,g);return r&&m.attr("style",r),Yt(t,m),t.intersect=function(w){return Dt.polygon(t,g,w)},n}b(jC,"card");function UC(e,t){const{nodeStyles:i}=jt(t);t.label="";const r=e.insert("g").attr("class",te(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,o=Math.max(28,t.width??0),a=[{x:0,y:o/2},{x:o/2,y:0},{x:0,y:-o/2},{x:-o/2,y:0}],n=Nt.svg(r),l=Ot(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=Pe(a),h=n.path(c,l),d=r.insert(()=>h,":first-child");return s&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",i),t.width=28,t.height=28,t.intersect=function(u){return Dt.polygon(t,a,u)},r}b(UC,"choice");async function k1(e,t,i){const{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,halfPadding:n}=await ee(e,t,te(t)),l=16,c=i?.padding??n,h=Math.sqrt(a.width**2+a.height**2)/2,d=t.look==="neo"?h+l*2:h+c;let u;const{cssStyles:p}=t;if(t.look==="handDrawn"){const f=Nt.svg(o),g=Ot(t,{}),m=f.circle(0,0,d*2,g);u=o.insert(()=>m,":first-child"),u.attr("class","basic label-container").attr("style",wi(p))}else u=o.insert("circle",":first-child").attr("class","basic label-container").attr("style",s).attr("r",d).attr("cx",0).attr("cy",0);return Yt(t,u),t.calcIntersect=function(f,g){const m=f.width/2;return Dt.circle(f,m,g)},t.intersect=function(f){return vt.info("Circle intersect",t,d,f),Dt.circle(t,d,f)},o}b(k1,"circle");async function YC(e,t){const i=t,r=["node",i.cssClasses,i.class].filter(Boolean).join(" "),{shapeSvg:s,bbox:o,halfPadding:a}=await ee(e,i,r),n=s.insert("rect",":first-child"),l=i.padding??0,c=i.positioned?i.width??0:o.width+l,h=i.positioned?i.height??0:o.height+l,d=i.positioned?-c/2:-o.width/2-a,u=i.positioned?-h/2:-o.height/2-a;return n.attr("class","basic cluster composite label-container").attr("style",i.style??null).attr("rx",i.rx??null).attr("ry",i.ry??null).attr("x",d).attr("y",u).attr("width",c).attr("height",h),Yt(i,n),i.intersect=function(p){return Dt.rect(i,p)},s}b(YC,"composite");async function GC(e,t,{config:{themeVariables:i}}){const{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:n}=await ee(e,t,te(t)),l=i?.nodeBorder??i?.lineColor??"currentColor",c=t.padding??12,h=20,d=12,u=Math.max(a.width+c*2,t.width??0,90),p=Math.max(a.height+c*2+h,t.height??0),f=-p/2,{cssStyles:g}=t,m=o.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const S=Nt.svg(o).path(Hr(-u/2,f,u,p,d),Ot(t,{}));m.node()?.appendChild(S),g&&m.attr("style",g)}else m.append("rect").attr("x",-u/2).attr("y",f).attr("width",u).attr("height",p).attr("rx",d).attr("ry",d).attr("style",s);m.append("text").attr("x",-u/2+12).attr("y",f+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${l}`).text(">_"),Yt(t,m);const x=f+h+(p-h)/2;return n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(w){return Dt.rect(t,w)},o}b(GC,"consoleWindow");function XC(e){const t=Math.cos(Math.PI/4),i=Math.sin(Math.PI/4),r=e*2,s={x:r/2*t,y:r/2*i},o={x:-(r/2)*t,y:r/2*i},a={x:-(r/2)*t,y:-(r/2)*i},n={x:r/2*t,y:-(r/2)*i};return`M ${o.x},${o.y} L ${n.x},${n.y}
1616
+ `),o):es(t.label,o),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");d.html(c),Gf(d,t.labelStyle),d.attr("class",`${h} ${r}`),Gf(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),i!==Number.POSITIVE_INFINITY&&(l.style("max-width",i+"px"),l.style("text-align","center")),l.attr("xmlns","http://www.w3.org/1999/xhtml"),s&&l.attr("class","labelBkg");const u=await Ka.measure(()=>l.node().getBoundingClientRect());return u.width===i?(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",i+"px")):u.width<a&&(l.style("display","table"),l.style("width",a+"px"),l.style("text-align","center")),n.node()}b(xC,"addHtmlSpan");function Uu(e,t,i,r=!1){const s=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*i-.1+"em").attr("dy",i+"em");return r&&s.attr("text-anchor","middle"),s}b(Uu,"createTspan");function vC(e,t,i){const r=e.append("text"),s=Uu(r,1,t);Yu(s,i);const o=s.node().getComputedTextLength();return r.remove(),o}b(vC,"computeWidthOfText");function CF(e,t,i){const r=e.append("text"),s=Uu(r,1,t);Yu(s,[{content:i,type:"normal"}]);const o=s.node()?.getBoundingClientRect();return o&&r.remove(),o}b(CF,"computeDimensionOfText");function wC(e,t,i,r=!1,s=!1){const a=t.append("g"),n=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");s&&l.attr("text-anchor","middle");let c=0;for(const h of i){const d=b(p=>vC(a,1.1,p)<=e,"checkWidth"),u=d(h)?[h]:yC(h,d);for(const p of u){const f=Uu(l,c,1.1,s);Yu(f,p),c++}}if(r){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()}b(wC,"createFormattedText");function Xf(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(i,r)=>{switch(r){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return i}})}b(Xf,"decodeHTMLEntities");function Yu(e,t){e.text(""),t.forEach((i,r)=>{const s=e.append("tspan").attr("font-style",i.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",i.type==="strong"?"bold":"normal");r===0?s.text(Xf(i.content)):s.text(" "+Xf(i.content))})}b(Yu,"updateTextContentAndStyles");async function kC(e,t={}){const i=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(s,o,a)=>(i.push((async()=>{const n=`${o}:${a}`;return await zS(n)?await ml(n,void 0,{class:"label-icon"}):`<i class='${es(s,t).replace(":"," ")}'></i>`})()),s));const r=await Promise.all(i);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>r.shift()??"")}b(kC,"replaceIconSubstring");var qr=b(async(e,t="",{style:i="",isTitle:r=!1,classes:s="",useHtmlLabels:o=!0,markdown:a=!0,isNode:n=!0,width:l=200,minWidth:c=0,addSvgBackground:h=!1}={},d)=>{if(vt.debug("XYZ createText",t,i,r,s,o,n,"addSvgBackground: ",h),o){const u=a?fC(t,d):pC(t),p=await kC(da(u),d),f=t.replace(/\\\\/g,"\\"),g={isNode:n,label:Cc(t)?f:p,labelStyle:i.replace("fill:","color:")};return await xC(e,g,l,s,h,d,c)}else{const u=da(t.replace(/<br\s*\/?>/g,"<br/>")),p=a?uC(u.replace("<br>","<br/>"),d):dC(u),f=wC(l,e,p,t?h:!1,!n);if(n){/stroke:/.exec(i)&&(i=i.replace("stroke:","lineColor:"));const g=i.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");me(f).attr("style",g)}else{const g=i.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");me(f).select("rect").attr("style",g.replace(/background:/g,"fill:"));const m=i.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");me(f).select("text").attr("style",m)}return r?me(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):me(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText"),TF=new Set(["redux-color","redux-dark-color"]),$F=12,MF=64,m1=b(e=>Array.isArray(e)&&e.length>0,"hasPalette"),AF=b((e,t)=>e!=null&&TF.has(e)&&m1(t),"isColorTheme"),BF=/^[\w-]+$/,Xet=b(e=>{const t=typeof e=="string"||typeof e=="number"?String(e):"";return BF.test(t)?t:"classic"},"safeLook"),SC=b(e=>m1(e)?e.length:0,"paletteSlotCount"),Vet=b((e,t)=>m1(t)?SC(t):typeof e=="number"&&Number.isInteger(e)&&e>0&&e<=MF?e:$F,"colorSlotCount"),ls=b((e,t,i,r)=>{if(t===void 0||!AF(i,r))return;const s=t%SC(r);e.attr("data-color-id",`color-${s}`)},"stampColorSlot");function w0(e,t,i){if(e&&e.length){const[r,s]=t,o=Math.PI/180*i,a=Math.cos(o),n=Math.sin(o);for(const l of e){const[c,h]=l;l[0]=(c-r)*a-(h-s)*n+r,l[1]=(c-r)*n+(h-s)*a+s}}}function _F(e,t){return e[0]===t[0]&&e[1]===t[1]}function LF(e,t,i,r=1){const s=i,o=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(s)for(const c of a)w0(c,n,s);const l=(function(c,h,d){const u=[];for(const w of c){const S=[...w];_F(S[0],S[S.length-1])||S.push([S[0][0],S[0][1]]),S.length>2&&u.push(S)}const p=[];h=Math.max(h,.1);const f=[];for(const w of u)for(let S=0;S<w.length-1;S++){const A=w[S],C=w[S+1];if(A[1]!==C[1]){const E=Math.min(A[1],C[1]);f.push({ymin:E,ymax:Math.max(A[1],C[1]),x:E===A[1]?A[0]:C[0],islope:(C[0]-A[0])/(C[1]-A[1])})}}if(f.sort(((w,S)=>w.ymin<S.ymin?-1:w.ymin>S.ymin?1:w.x<S.x?-1:w.x>S.x?1:w.ymax===S.ymax?0:(w.ymax-S.ymax)/Math.abs(w.ymax-S.ymax))),!f.length)return p;let g=[],m=f[0].ymin,x=0;for(;g.length||f.length;){if(f.length){let w=-1;for(let S=0;S<f.length&&!(f[S].ymin>m);S++)w=S;f.splice(0,w+1).forEach((S=>{g.push({s:m,edge:S})}))}if(g=g.filter((w=>!(w.edge.ymax<=m))),g.sort(((w,S)=>w.edge.x===S.edge.x?0:(w.edge.x-S.edge.x)/Math.abs(w.edge.x-S.edge.x))),(d!==1||x%h==0)&&g.length>1)for(let w=0;w<g.length;w+=2){const S=w+1;if(S>=g.length)break;const A=g[w].edge,C=g[S].edge;p.push([[Math.round(A.x),m],[Math.round(C.x),m]])}m+=d,g.forEach((w=>{w.edge.x=w.edge.x+d*w.edge.islope})),x++}return p})(a,o,r);if(s){for(const c of a)w0(c,n,-s);(function(c,h,d){const u=[];c.forEach((p=>u.push(...p))),w0(u,h,d)})(l,n,-s)}return l}function Xc(e,t){var i;const r=t.hachureAngle+90;let s=t.hachureGap;s<0&&(s=4*t.strokeWidth),s=Math.round(Math.max(s,.1));let o=1;return t.roughness>=1&&(((i=t.randomizer)===null||i===void 0?void 0:i.next())||Math.random())>.7&&(o=s),LF(e,s,r,o||1)}class b1{constructor(t){this.helper=t}fillPolygons(t,i){return this._fillPolygons(t,i)}_fillPolygons(t,i){const r=Xc(t,i);return{type:"fillSketch",ops:this.renderLines(r,i)}}renderLines(t,i){const r=[];for(const s of t)r.push(...this.helper.doubleLineOps(s[0][0],s[0][1],s[1][0],s[1][1],i));return r}}function Gu(e){const t=e[0],i=e[1];return Math.sqrt(Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2))}class PF extends b1{fillPolygons(t,i){let r=i.hachureGap;r<0&&(r=4*i.strokeWidth),r=Math.max(r,.1);const s=Xc(t,Object.assign({},i,{hachureGap:r})),o=Math.PI/180*i.hachureAngle,a=[],n=.5*r*Math.cos(o),l=.5*r*Math.sin(o);for(const[c,h]of s)Gu([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,i)}}}class EF extends b1{fillPolygons(t,i){const r=this._fillPolygons(t,i),s=Object.assign({},i,{hachureAngle:i.hachureAngle+90}),o=this._fillPolygons(t,s);return r.ops=r.ops.concat(o.ops),r}}let RF=class{constructor(t){this.helper=t}fillPolygons(t,i){const r=Xc(t,i=Object.assign({},i,{hachureAngle:0}));return this.dotsOnLines(r,i)}dotsOnLines(t,i){const r=[];let s=i.hachureGap;s<0&&(s=4*i.strokeWidth),s=Math.max(s,.1);let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const a=s/4;for(const n of t){const l=Gu(n),c=l/s,h=Math.ceil(c)-1,d=l-h*s,u=(n[0][0]+n[1][0])/2-s/4,p=Math.min(n[0][1],n[1][1]);for(let f=0;f<h;f++){const g=p+d+f*s,m=u-a+2*Math.random()*a,x=g-a+2*Math.random()*a,w=this.helper.ellipse(m,x,o,o,i);r.push(...w.ops)}}return{type:"fillSketch",ops:r}}};class IF{constructor(t){this.helper=t}fillPolygons(t,i){const r=Xc(t,i);return{type:"fillSketch",ops:this.dashedLine(r,i)}}dashedLine(t,i){const r=i.dashOffset<0?i.hachureGap<0?4*i.strokeWidth:i.hachureGap:i.dashOffset,s=i.dashGap<0?i.hachureGap<0?4*i.strokeWidth:i.hachureGap:i.dashGap,o=[];return t.forEach((a=>{const n=Gu(a),l=Math.floor(n/(r+s)),c=(n+s-l*(r+s))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[0]);const u=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p<l;p++){const f=p*(r+s),g=f+r,m=[h[0]+f*Math.cos(u)+c*Math.cos(u),h[1]+f*Math.sin(u)+c*Math.sin(u)],x=[h[0]+g*Math.cos(u)+c*Math.cos(u),h[1]+g*Math.sin(u)+c*Math.sin(u)];o.push(...this.helper.doubleLineOps(m[0],m[1],x[0],x[1],i))}})),o}}class zF{constructor(t){this.helper=t}fillPolygons(t,i){const r=i.hachureGap<0?4*i.strokeWidth:i.hachureGap,s=i.zigzagOffset<0?r:i.zigzagOffset,o=Xc(t,i=Object.assign({},i,{hachureGap:r+s}));return{type:"fillSketch",ops:this.zigzagLines(o,s,i)}}zigzagLines(t,i,r){const s=[];return t.forEach((o=>{const a=Gu(o),n=Math.round(a/(2*i));let l=o[0],c=o[1];l[0]>c[0]&&(l=o[1],c=o[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const u=2*d*i,p=2*(d+1)*i,f=Math.sqrt(2*Math.pow(i,2)),g=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],m=[l[0]+p*Math.cos(h),l[1]+p*Math.sin(h)],x=[g[0]+f*Math.cos(h+Math.PI/4),g[1]+f*Math.sin(h+Math.PI/4)];s.push(...this.helper.doubleLineOps(g[0],g[1],x[0],x[1],r),...this.helper.doubleLineOps(x[0],x[1],m[0],m[1],r))}})),s}}const wr={};class DF{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const FF=0,k0=1,vv=2,kh={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 S0(e,t){return e.type===t}function y1(e){const t=[],i=(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:FF,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:k0,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return n[n.length]={type:vv,text:""},n})(e);let r="BOD",s=0,o=i[s];for(;!S0(o,vv);){let a=0;const n=[];if(r==="BOD"){if(o.text!=="M"&&o.text!=="m")return y1("M0,0"+e);s++,a=kh[o.text],r=o.text}else S0(o,k0)?a=kh[r]:(s++,a=kh[o.text],r=o.text);if(!(s+a<i.length))throw new Error("Path data ended short");for(let l=s;l<s+a;l++){const c=i[l];if(!S0(c,k0))throw new Error("Param not a number: "+r+","+c.text);n[n.length]=+c.text}if(typeof kh[r]!="number")throw new Error("Bad segment: "+r);{const l={key:r,data:n};t.push(l),s+=a,o=i[s],r==="M"&&(r="L"),r==="m"&&(r="l")}}return t}function CC(e){let t=0,i=0,r=0,s=0;const o=[];for(const{key:a,data:n}of e)switch(a){case"M":o.push({key:"M",data:[...n]}),[t,i]=n,[r,s]=n;break;case"m":t+=n[0],i+=n[1],o.push({key:"M",data:[t,i]}),r=t,s=i;break;case"L":o.push({key:"L",data:[...n]}),[t,i]=n;break;case"l":t+=n[0],i+=n[1],o.push({key:"L",data:[t,i]});break;case"C":o.push({key:"C",data:[...n]}),t=n[4],i=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+i:c+t));o.push({key:"C",data:l}),t=l[4],i=l[5];break}case"Q":o.push({key:"Q",data:[...n]}),t=n[2],i=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+i:c+t));o.push({key:"Q",data:l}),t=l[2],i=l[3];break}case"A":o.push({key:"A",data:[...n]}),t=n[5],i=n[6];break;case"a":t+=n[5],i+=n[6],o.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,i]});break;case"H":o.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...n]}),i=n[0];break;case"v":i+=n[0],o.push({key:"V",data:[i]});break;case"S":o.push({key:"S",data:[...n]}),t=n[2],i=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+i:c+t));o.push({key:"S",data:l}),t=l[2],i=l[3];break}case"T":o.push({key:"T",data:[...n]}),t=n[0],i=n[1];break;case"t":t+=n[0],i+=n[1],o.push({key:"T",data:[t,i]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=r,i=s}return o}function TC(e){const t=[];let i="",r=0,s=0,o=0,a=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[r,s]=h,[o,a]=h;break;case"C":t.push({key:"C",data:[...h]}),r=h[4],s=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[r,s]=h;break;case"H":r=h[0],t.push({key:"L",data:[r,s]});break;case"V":s=h[0],t.push({key:"L",data:[r,s]});break;case"S":{let d=0,u=0;i==="C"||i==="S"?(d=r+(r-n),u=s+(s-l)):(d=r,u=s),t.push({key:"C",data:[d,u,...h]}),n=h[0],l=h[1],r=h[2],s=h[3];break}case"T":{const[d,u]=h;let p=0,f=0;i==="Q"||i==="T"?(p=r+(r-n),f=s+(s-l)):(p=r,f=s);const g=r+2*(p-r)/3,m=s+2*(f-s)/3,x=d+2*(p-d)/3,w=u+2*(f-u)/3;t.push({key:"C",data:[g,m,x,w,d,u]}),n=p,l=f,r=d,s=u;break}case"Q":{const[d,u,p,f]=h,g=r+2*(d-r)/3,m=s+2*(u-s)/3,x=p+2*(d-p)/3,w=f+2*(u-f)/3;t.push({key:"C",data:[g,m,x,w,p,f]}),n=d,l=u,r=p,s=f;break}case"A":{const d=Math.abs(h[0]),u=Math.abs(h[1]),p=h[2],f=h[3],g=h[4],m=h[5],x=h[6];d===0||u===0?(t.push({key:"C",data:[r,s,m,x,m,x]}),r=m,s=x):(r!==m||s!==x)&&($C(r,s,m,x,d,u,p,f,g).forEach((function(w){t.push({key:"C",data:w})})),r=m,s=x);break}case"Z":t.push({key:"Z",data:[]}),r=o,s=a}i=c}return t}function Dl(e,t,i){return[e*Math.cos(i)-t*Math.sin(i),e*Math.sin(i)+t*Math.cos(i)]}function $C(e,t,i,r,s,o,a,n,l,c){const h=(d=a,Math.PI*d/180);var d;let u=[],p=0,f=0,g=0,m=0;if(c)[p,f,g,m]=c;else{[e,t]=Dl(e,t,-h),[i,r]=Dl(i,r,-h);const U=(e-i)/2,D=(t-r)/2;let O=U*U/(s*s)+D*D/(o*o);O>1&&(O=Math.sqrt(O),s*=O,o*=O);const M=s*s,X=o*o,G=M*X-M*D*D-X*U*U,nt=M*D*D+X*U*U,Y=(n===l?-1:1)*Math.sqrt(Math.abs(G/nt));g=Y*s*D/o+(e+i)/2,m=Y*-o*U/s+(t+r)/2,p=Math.asin(parseFloat(((t-m)/o).toFixed(9))),f=Math.asin(parseFloat(((r-m)/o).toFixed(9))),e<g&&(p=Math.PI-p),i<g&&(f=Math.PI-f),p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),l&&p>f&&(p-=2*Math.PI),!l&&f>p&&(f-=2*Math.PI)}let x=f-p;if(Math.abs(x)>120*Math.PI/180){const U=f,D=i,O=r;f=l&&f>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,u=$C(i=g+s*Math.cos(f),r=m+o*Math.sin(f),D,O,s,o,a,0,l,[f,U,g,m])}x=f-p;const w=Math.cos(p),S=Math.sin(p),A=Math.cos(f),C=Math.sin(f),E=Math.tan(x/4),z=4/3*s*E,R=4/3*o*E,V=[e,t],F=[e+z*S,t-R*w],H=[i+z*C,r-R*A],W=[i,r];if(F[0]=2*V[0]-F[0],F[1]=2*V[1]-F[1],c)return[F,H,W].concat(u);{u=[F,H,W].concat(u);const U=[];for(let D=0;D<u.length;D+=3){const O=Dl(u[D][0],u[D][1],h),M=Dl(u[D+1][0],u[D+1][1],h),X=Dl(u[D+2][0],u[D+2][1],h);U.push([O[0],O[1],M[0],M[1],X[0],X[1]])}return U}}const OF={randOffset:function(e,t){return de(e,t)},randOffsetWithRange:function(e,t,i){return Qd(e,t,i)},ellipse:function(e,t,i,r,s){const o=AC(i,r,s);return Vf(e,t,s,o).opset},doubleLineOps:function(e,t,i,r,s){return ua(e,t,i,r,s,!0)}};function MC(e,t,i,r,s){return{type:"path",ops:ua(e,t,i,r,s)}}function ld(e,t,i){const r=(e||[]).length;if(r>2){const s=[];for(let o=0;o<r-1;o++)s.push(...ua(e[o][0],e[o][1],e[o+1][0],e[o+1][1],i));return t&&s.push(...ua(e[r-1][0],e[r-1][1],e[0][0],e[0][1],i)),{type:"path",ops:s}}return r===2?MC(e[0][0],e[0][1],e[1][0],e[1][1],i):{type:"path",ops:[]}}function NF(e,t,i,r,s){return(function(o,a){return ld(o,!0,a)})([[e,t],[e+i,t],[e+i,t+r],[e,t+r]],s)}function wv(e,t){if(e.length){const i=typeof e[0][0]=="number"?[e]:e,r=Sh(i[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:Sh(i[0],1.5*(1+.22*t.roughness),Cv(t));for(let o=1;o<i.length;o++){const a=i[o];if(a.length){const n=Sh(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Sh(a,1.5*(1+.22*t.roughness),Cv(t));for(const c of n)c.op!=="move"&&r.push(c);for(const c of l)c.op!=="move"&&s.push(c)}}return{type:"path",ops:r.concat(s)}}return{type:"path",ops:[]}}function AC(e,t,i){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),s=Math.ceil(Math.max(i.curveStepCount,i.curveStepCount/Math.sqrt(200)*r)),o=2*Math.PI/s;let a=Math.abs(e/2),n=Math.abs(t/2);const l=1-i.curveFitting;return a+=de(a*l,i),n+=de(n*l,i),{increment:o,rx:a,ry:n}}function Vf(e,t,i,r){const[s,o]=Tv(r.increment,e,t,r.rx,r.ry,1,r.increment*Qd(.1,Qd(.4,1,i),i),i);let a=Jd(s,null,i);if(!i.disableMultiStroke&&i.roughness!==0){const[n]=Tv(r.increment,e,t,r.rx,r.ry,1.5,0,i),l=Jd(n,null,i);a=a.concat(l)}return{estimatedPoints:o,opset:{type:"path",ops:a}}}function kv(e,t,i,r,s,o,a,n,l){const c=e,h=t;let d=Math.abs(i/2),u=Math.abs(r/2);d+=de(.01*d,l),u+=de(.01*u,l);let p=s,f=o;for(;p<0;)p+=2*Math.PI,f+=2*Math.PI;f-p>2*Math.PI&&(p=0,f=2*Math.PI);const g=2*Math.PI/l.curveStepCount,m=Math.min(g/2,(f-p)/2),x=$v(m,c,h,d,u,p,f,1,l);if(!l.disableMultiStroke){const w=$v(m,c,h,d,u,p,f,1.5,l);x.push(...w)}return a&&(n?x.push(...ua(c,h,c+d*Math.cos(p),h+u*Math.sin(p),l),...ua(c,h,c+d*Math.cos(f),h+u*Math.sin(f),l)):x.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(p),h+u*Math.sin(p)]})),{type:"path",ops:x}}function Sv(e,t){const i=TC(CC(y1(e))),r=[];let s=[0,0],o=[0,0];for(const{key:a,data:n}of i)switch(a){case"M":o=[n[0],n[1]],s=[n[0],n[1]];break;case"L":r.push(...ua(o[0],o[1],n[0],n[1],t)),o=[n[0],n[1]];break;case"C":{const[l,c,h,d,u,p]=n;r.push(...WF(l,c,h,d,u,p,o,t)),o=[u,p];break}case"Z":r.push(...ua(o[0],o[1],s[0],s[1],t)),o=[s[0],s[1]]}return{type:"path",ops:r}}function C0(e,t){const i=[];for(const r of e)if(r.length){const s=t.maxRandomnessOffset||0,o=r.length;if(o>2){i.push({op:"move",data:[r[0][0]+de(s,t),r[0][1]+de(s,t)]});for(let a=1;a<o;a++)i.push({op:"lineTo",data:[r[a][0]+de(s,t),r[a][1]+de(s,t)]})}}return{type:"fillPath",ops:i}}function pn(e,t){return(function(i,r){let s=i.fillStyle||"hachure";if(!wr[s])switch(s){case"zigzag":wr[s]||(wr[s]=new PF(r));break;case"cross-hatch":wr[s]||(wr[s]=new EF(r));break;case"dots":wr[s]||(wr[s]=new RF(r));break;case"dashed":wr[s]||(wr[s]=new IF(r));break;case"zigzag-line":wr[s]||(wr[s]=new zF(r));break;default:s="hachure",wr[s]||(wr[s]=new b1(r))}return wr[s]})(t,OF).fillPolygons(e,t)}function Cv(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function BC(e){return e.randomizer||(e.randomizer=new DF(e.seed||0)),e.randomizer.next()}function Qd(e,t,i,r=1){return i.roughness*r*(BC(i)*(t-e)+e)}function de(e,t,i=1){return Qd(-e,e,t,i)}function ua(e,t,i,r,s,o=!1){const a=o?s.disableMultiStrokeFill:s.disableMultiStroke,n=Kf(e,t,i,r,s,!0,!1);if(a)return n;const l=Kf(e,t,i,r,s,!0,!0);return n.concat(l)}function Kf(e,t,i,r,s,o,a){const n=Math.pow(e-i,2)+Math.pow(t-r,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=s.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,u=.2+.2*BC(s);let p=s.bowing*s.maxRandomnessOffset*(r-t)/200,f=s.bowing*s.maxRandomnessOffset*(e-i)/200;p=de(p,s,c),f=de(f,s,c);const g=[],m=()=>de(d,s,c),x=()=>de(h,s,c),w=s.preserveVertices;return a?g.push({op:"move",data:[e+(w?0:m()),t+(w?0:m())]}):g.push({op:"move",data:[e+(w?0:de(h,s,c)),t+(w?0:de(h,s,c))]}),a?g.push({op:"bcurveTo",data:[p+e+(i-e)*u+m(),f+t+(r-t)*u+m(),p+e+2*(i-e)*u+m(),f+t+2*(r-t)*u+m(),i+(w?0:m()),r+(w?0:m())]}):g.push({op:"bcurveTo",data:[p+e+(i-e)*u+x(),f+t+(r-t)*u+x(),p+e+2*(i-e)*u+x(),f+t+2*(r-t)*u+x(),i+(w?0:x()),r+(w?0:x())]}),g}function Sh(e,t,i){if(!e.length)return[];const r=[];r.push([e[0][0]+de(t,i),e[0][1]+de(t,i)]),r.push([e[0][0]+de(t,i),e[0][1]+de(t,i)]);for(let s=1;s<e.length;s++)r.push([e[s][0]+de(t,i),e[s][1]+de(t,i)]),s===e.length-1&&r.push([e[s][0]+de(t,i),e[s][1]+de(t,i)]);return Jd(r,null,i)}function Jd(e,t,i){const r=e.length,s=[];if(r>3){const o=[],a=1-i.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<r;n++){const l=e[n];o[0]=[l[0],l[1]],o[1]=[l[0]+(a*e[n+1][0]-a*e[n-1][0])/6,l[1]+(a*e[n+1][1]-a*e[n-1][1])/6],o[2]=[e[n+1][0]+(a*e[n][0]-a*e[n+2][0])/6,e[n+1][1]+(a*e[n][1]-a*e[n+2][1])/6],o[3]=[e[n+1][0],e[n+1][1]],s.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}}else r===3?(s.push({op:"move",data:[e[1][0],e[1][1]]}),s.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&s.push(...Kf(e[0][0],e[0][1],e[1][0],e[1][1],i,!0,!0));return s}function Tv(e,t,i,r,s,o,a,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+r*Math.cos(-e),i+s*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+r*Math.cos(h),i+s*Math.sin(h)];l.push(d),c.push(d)}c.push([t+r*Math.cos(0),i+s*Math.sin(0)]),c.push([t+r*Math.cos(e),i+s*Math.sin(e)])}else{const h=de(.5,n)-Math.PI/2;c.push([de(o,n)+t+.9*r*Math.cos(h-e),de(o,n)+i+.9*s*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let u=h;u<d;u+=e){const p=[de(o,n)+t+r*Math.cos(u),de(o,n)+i+s*Math.sin(u)];l.push(p),c.push(p)}c.push([de(o,n)+t+r*Math.cos(h+2*Math.PI+.5*a),de(o,n)+i+s*Math.sin(h+2*Math.PI+.5*a)]),c.push([de(o,n)+t+.98*r*Math.cos(h+a),de(o,n)+i+.98*s*Math.sin(h+a)]),c.push([de(o,n)+t+.9*r*Math.cos(h+.5*a),de(o,n)+i+.9*s*Math.sin(h+.5*a)])}return[c,l]}function $v(e,t,i,r,s,o,a,n,l){const c=o+de(.1,l),h=[];h.push([de(n,l)+t+.9*r*Math.cos(c-e),de(n,l)+i+.9*s*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([de(n,l)+t+r*Math.cos(d),de(n,l)+i+s*Math.sin(d)]);return h.push([t+r*Math.cos(a),i+s*Math.sin(a)]),h.push([t+r*Math.cos(a),i+s*Math.sin(a)]),Jd(h,null,l)}function WF(e,t,i,r,s,o,a,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let p=0;p<d;p++)p===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(u?0:de(c[0],n)),a[1]+(u?0:de(c[0],n))]}),h=u?[s,o]:[s+de(c[p],n),o+de(c[p],n)],l.push({op:"bcurveTo",data:[e+de(c[p],n),t+de(c[p],n),i+de(c[p],n),r+de(c[p],n),h[0],h[1]]});return l}function Fl(e){return[...e]}function Mv(e,t=0){const i=e.length;if(i<3)throw new Error("A curve must have at least three points.");const r=[];if(i===3)r.push(Fl(e[0]),Fl(e[1]),Fl(e[2]),Fl(e[2]));else{const s=[];s.push(e[0],e[0]);for(let n=1;n<e.length;n++)s.push(e[n]),n===e.length-1&&s.push(e[n]);const o=[],a=1-t;r.push(Fl(s[0]));for(let n=1;n+2<s.length;n++){const l=s[n];o[0]=[l[0],l[1]],o[1]=[l[0]+(a*s[n+1][0]-a*s[n-1][0])/6,l[1]+(a*s[n+1][1]-a*s[n-1][1])/6],o[2]=[s[n+1][0]+(a*s[n][0]-a*s[n+2][0])/6,s[n+1][1]+(a*s[n][1]-a*s[n+2][1])/6],o[3]=[s[n+1][0],s[n+1][1]],r.push(o[1],o[2],o[3])}}return r}function cd(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function qF(e,t,i){const r=cd(t,i);if(r===0)return cd(e,t);let s=((e[0]-t[0])*(i[0]-t[0])+(e[1]-t[1])*(i[1]-t[1]))/r;return s=Math.max(0,Math.min(1,s)),cd(e,Ra(t,i,s))}function Ra(e,t,i){return[e[0]+(t[0]-e[0])*i,e[1]+(t[1]-e[1])*i]}function Zf(e,t,i,r){const s=r||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],u=n[l+3];let p=3*h[0]-2*c[0]-u[0];p*=p;let f=3*h[1]-2*c[1]-u[1];f*=f;let g=3*d[0]-2*u[0]-c[0];g*=g;let m=3*d[1]-2*u[1]-c[1];return m*=m,p<g&&(p=g),f<m&&(f=m),p+f})(e,t)<i){const n=e[t+0];s.length?(o=s[s.length-1],a=n,Math.sqrt(cd(o,a))>1&&s.push(n)):s.push(n),s.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],u=Ra(l,c,.5),p=Ra(c,h,.5),f=Ra(h,d,.5),g=Ra(u,p,.5),m=Ra(p,f,.5),x=Ra(g,m,.5);Zf([l,u,g,x],0,i,s),Zf([x,m,f,d],0,i,s)}var o,a;return s}function HF(e,t){return tu(e,0,e.length,t)}function tu(e,t,i,r,s){const o=s||[],a=e[t],n=e[i-1];let l=0,c=1;for(let h=t+1;h<i-1;++h){const d=qF(e[h],a,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>r?(tu(e,t,c+1,r,o),tu(e,c,i,r,o)):(o.length||o.push(a),o.push(n)),o}function T0(e,t=.15,i){const r=[],s=(e.length-1)/3;for(let o=0;o<s;o++)Zf(e,3*o,t,r);return i&&i>0?tu(r,0,r.length,i):r}const Rr="none";let eu=class{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,i,r){return{shape:t,sets:i||[],options:r||this.defaultOptions}}line(t,i,r,s,o){const a=this._o(o);return this._d("line",[MC(t,i,r,s,a)],a)}rectangle(t,i,r,s,o){const a=this._o(o),n=[],l=NF(t,i,r,s,a);if(a.fill){const c=[[t,i],[t+r,i],[t+r,i+s],[t,i+s]];a.fillStyle==="solid"?n.push(C0([c],a)):n.push(pn([c],a))}return a.stroke!==Rr&&n.push(l),this._d("rectangle",n,a)}ellipse(t,i,r,s,o){const a=this._o(o),n=[],l=AC(r,s,a),c=Vf(t,i,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=Vf(t,i,a,l).opset;h.type="fillPath",n.push(h)}else n.push(pn([c.estimatedPoints],a));return a.stroke!==Rr&&n.push(c.opset),this._d("ellipse",n,a)}circle(t,i,r,s){const o=this.ellipse(t,i,r,r,s);return o.shape="circle",o}linearPath(t,i){const r=this._o(i);return this._d("linearPath",[ld(t,!1,r)],r)}arc(t,i,r,s,o,a,n=!1,l){const c=this._o(l),h=[],d=kv(t,i,r,s,o,a,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const p=kv(t,i,r,s,o,a,!0,!1,u);p.type="fillPath",h.push(p)}else h.push((function(u,p,f,g,m,x,w){const S=u,A=p;let C=Math.abs(f/2),E=Math.abs(g/2);C+=de(.01*C,w),E+=de(.01*E,w);let z=m,R=x;for(;z<0;)z+=2*Math.PI,R+=2*Math.PI;R-z>2*Math.PI&&(z=0,R=2*Math.PI);const V=(R-z)/w.curveStepCount,F=[];for(let H=z;H<=R;H+=V)F.push([S+C*Math.cos(H),A+E*Math.sin(H)]);return F.push([S+C*Math.cos(R),A+E*Math.sin(R)]),F.push([S,A]),pn([F],w)})(t,i,r,s,o,a,c));return c.stroke!==Rr&&h.push(d),this._d("arc",h,c)}curve(t,i){const r=this._o(i),s=[],o=wv(t,r);if(r.fill&&r.fill!==Rr)if(r.fillStyle==="solid"){const a=wv(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...T0(Mv([c[0],c[0],c[1],c[2]]),10,(1+r.roughness)/2)):a.push(...T0(Mv(c),10,(1+r.roughness)/2))}a.length&&s.push(pn([a],r))}return r.stroke!==Rr&&s.push(o),this._d("curve",s,r)}polygon(t,i){const r=this._o(i),s=[],o=ld(t,!0,r);return r.fill&&(r.fillStyle==="solid"?s.push(C0([t],r)):s.push(pn([t],r))),r.stroke!==Rr&&s.push(o),this._d("polygon",s,r)}path(t,i){const r=this._o(i),s=[];if(!t)return this._d("path",s,r);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=r.fill&&r.fill!=="transparent"&&r.fill!==Rr,a=r.stroke!==Rr,n=!!(r.simplification&&r.simplification<1),l=(function(h,d,u){const p=TC(CC(y1(h))),f=[];let g=[],m=[0,0],x=[];const w=()=>{x.length>=4&&g.push(...T0(x,d)),x=[]},S=()=>{w(),g.length&&(f.push(g),g=[])};for(const{key:C,data:E}of p)switch(C){case"M":S(),m=[E[0],E[1]],g.push(m);break;case"L":w(),g.push([E[0],E[1]]);break;case"C":if(!x.length){const z=g.length?g[g.length-1]:m;x.push([z[0],z[1]])}x.push([E[0],E[1]]),x.push([E[2],E[3]]),x.push([E[4],E[5]]);break;case"Z":w(),g.push([m[0],m[1]])}if(S(),!u)return f;const A=[];for(const C of f){const E=HF(C,u);E.length&&A.push(E)}return A})(t,1,n?4-4*(r.simplification||1):(1+r.roughness)/2),c=Sv(t,r);if(o)if(r.fillStyle==="solid")if(l.length===1){const h=Sv(t,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else s.push(C0(l,r));else s.push(pn(l,r));return a&&(n?l.forEach((h=>{s.push(ld(h,!1,r))})):s.push(c)),this._d("path",s,r)}opsToPath(t,i){let r="";for(const s of t.ops){const o=typeof i=="number"&&i>=0?s.data.map((a=>+a.toFixed(i))):s.data;switch(s.op){case"move":r+=`M${o[0]} ${o[1]} `;break;case"bcurveTo":r+=`C${o[0]} ${o[1]}, ${o[2]} ${o[3]}, ${o[4]} ${o[5]} `;break;case"lineTo":r+=`L${o[0]} ${o[1]} `}}return r.trim()}toPaths(t){const i=t.sets||[],r=t.options||this.defaultOptions,s=[];for(const o of i){let a=null;switch(o.type){case"path":a={d:this.opsToPath(o),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Rr};break;case"fillPath":a={d:this.opsToPath(o),stroke:Rr,strokeWidth:0,fill:r.fill||Rr};break;case"fillSketch":a=this.fillSketch(o,r)}a&&s.push(a)}return s}fillSketch(t,i){let r=i.fillWeight;return r<0&&(r=i.strokeWidth/2),{d:this.opsToPath(t),stroke:i.fill||Rr,strokeWidth:r,fill:Rr}}_mergedShape(t){return t.filter(((i,r)=>r===0||i.op!=="move"))}},jF=class{constructor(t,i){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new eu(i)}draw(t){const i=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const a of i)switch(a.type){case"path":s.save(),s.strokeStyle=r.stroke==="none"?"transparent":r.stroke,s.lineWidth=r.strokeWidth,r.strokeLineDash&&s.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(s.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(s,a,o),s.restore();break;case"fillPath":{s.save(),s.fillStyle=r.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(s,a,o,n),s.restore();break}case"fillSketch":this.fillSketch(s,a,r)}}fillSketch(t,i,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2),t.save(),r.fillLineDash&&t.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(t.lineDashOffset=r.fillLineDashOffset),t.strokeStyle=r.fill||"",t.lineWidth=s,this._drawToContext(t,i,r.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,i,r,s="nonzero"){t.beginPath();for(const o of i.ops){const a=typeof r=="number"&&r>=0?o.data.map((n=>+n.toFixed(r))):o.data;switch(o.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}i.type==="fillPath"?t.fill(s):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,i,r,s,o){const a=this.gen.line(t,i,r,s,o);return this.draw(a),a}rectangle(t,i,r,s,o){const a=this.gen.rectangle(t,i,r,s,o);return this.draw(a),a}ellipse(t,i,r,s,o){const a=this.gen.ellipse(t,i,r,s,o);return this.draw(a),a}circle(t,i,r,s){const o=this.gen.circle(t,i,r,s);return this.draw(o),o}linearPath(t,i){const r=this.gen.linearPath(t,i);return this.draw(r),r}polygon(t,i){const r=this.gen.polygon(t,i);return this.draw(r),r}arc(t,i,r,s,o,a,n=!1,l){const c=this.gen.arc(t,i,r,s,o,a,n,l);return this.draw(c),c}curve(t,i){const r=this.gen.curve(t,i);return this.draw(r),r}path(t,i){const r=this.gen.path(t,i);return this.draw(r),r}};const Ch="http://www.w3.org/2000/svg";let UF=class{constructor(t,i){this.svg=t,this.gen=new eu(i)}draw(t){const i=t.sets||[],r=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,o=s.createElementNS(Ch,"g"),a=t.options.fixedDecimalPlaceDigits;for(const n of i){let l=null;switch(n.type){case"path":l=s.createElementNS(Ch,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke",r.stroke),l.setAttribute("stroke-width",r.strokeWidth+""),l.setAttribute("fill","none"),r.strokeLineDash&&l.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":l=s.createElementNS(Ch,"path"),l.setAttribute("d",this.opsToPath(n,a)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",r.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(s,n,r)}l&&o.appendChild(l)}return o}fillSketch(t,i,r){let s=r.fillWeight;s<0&&(s=r.strokeWidth/2);const o=t.createElementNS(Ch,"path");return o.setAttribute("d",this.opsToPath(i,r.fixedDecimalPlaceDigits)),o.setAttribute("stroke",r.fill||""),o.setAttribute("stroke-width",s+""),o.setAttribute("fill","none"),r.fillLineDash&&o.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,i){return this.gen.opsToPath(t,i)}line(t,i,r,s,o){const a=this.gen.line(t,i,r,s,o);return this.draw(a)}rectangle(t,i,r,s,o){const a=this.gen.rectangle(t,i,r,s,o);return this.draw(a)}ellipse(t,i,r,s,o){const a=this.gen.ellipse(t,i,r,s,o);return this.draw(a)}circle(t,i,r,s){const o=this.gen.circle(t,i,r,s);return this.draw(o)}linearPath(t,i){const r=this.gen.linearPath(t,i);return this.draw(r)}polygon(t,i){const r=this.gen.polygon(t,i);return this.draw(r)}arc(t,i,r,s,o,a,n=!1,l){const c=this.gen.arc(t,i,r,s,o,a,n,l);return this.draw(c)}curve(t,i){const r=this.gen.curve(t,i);return this.draw(r)}path(t,i){const r=this.gen.path(t,i);return this.draw(r)}};var Nt={canvas:(e,t)=>new jF(e,t),svg:(e,t)=>new UF(e,t),generator:e=>new eu(e),newSeed:()=>eu.newSeed()},YF=1,GF=3;async function x1(e){const t=e.getElementsByTagName("img");if(!t||t.length===0)return;const i=!v1(e);await Promise.all([...t].map(r=>new Promise(s=>{function o(){if(r.style.display="flex",r.style.flexDirection="column",i){const a=ye().fontSize?ye().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[l=fm.fontSize]=qu(a),c=l*n+"px";r.style.minWidth=c,r.style.maxWidth=c}else r.style.width="100%";s(r)}b(o,"setupImage"),setTimeout(()=>{r.complete&&o()}),r.addEventListener("error",o),r.addEventListener("load",o)})))}b(x1,"configureLabelImages");function v1(e){return e.nodeType===GF?e.textContent?.trim()!=="":e.nodeType!==YF||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(v1)}b(v1,"hasTextBesidesImages");var Av=3,XF=32,VF=b(async(e,t,i)=>{const r=ye(),s=e.insert("g").attr("class",i??"node default").attr("id",t.domId||t.id),o=s.insert("g").attr("class","label").attr("style",wi(t.labelStyle)),n=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(x=>({text:x,cssClass:"c4-descr"}))].filter(x=>x.text),l=t.width?Math.max(t.width-2*(t.padding??0),XF):ye().flowchart?.wrappingWidth??200,h=r.c4?.wrap??!0?l:Number.POSITIVE_INFINITY,d=await Promise.all(n.map(async x=>{const w=o.append("g").attr("class",x.cssClass),S=await qr(w,es(da(x.text??""),r),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:h,style:t.labelStyle},r);return me(S).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),me(S).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:w,box:w.node().getBBox()}})),u=Math.max(...d.map(({box:x})=>x.width),0);let p=0;for(const{el:x,box:w}of d)x.attr("transform",`translate(${u/2-w.x-w.width/2}, ${p-w.y})`),p+=w.height+Av;const f=d.length>0?p-Av:0;o.insert("rect",":first-child"),o.attr("transform",`translate(${-u/2}, ${-f/2})`);const g=o.node().getBBox(),m=(t.padding??0)/2;return{shapeSvg:s,bbox:g,halfPadding:m,label:o}},"c4LabelHelper"),Bv=b((e,t)=>{const{x:i,y:r,width:s,height:o}=e;return s>=t?e:"left"in e?{x:i,y:r,width:t,height:o,top:r,left:i,bottom:r+o,right:i+t,toJSON:b(()=>({}),"toJSON")}:{x:i-(t-s)/2,y:r,width:t,height:o}},"withMinWidth"),ee=b(async(e,t,i)=>{if(t.stereotype!==void 0)return VF(e,t,i);let r;const s=t.useHtmlLabels||Qs(ye()?.htmlLabels);i?r=i:r="node default";const o=e.insert("g").attr("class",r).attr("id",t.domId||t.id),a=o.insert("g").attr("class","label").attr("style",wi(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=n&&!t.width?t.minWidth??0:0,d=await qr(a,es(da(n),ye()),{useHtmlLabels:s,width:t.width||t.wrappingWidth||ye().flowchart?.wrappingWidth,minWidth:h,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},ye()),u=(t?.padding??0)/2;let p;if(s){const f=d.children[0],g=me(d);await x1(f),p=await Ka.measure(()=>f.getBoundingClientRect()),p=Bv(p,h),g.attr("width",p.width),g.attr("height",p.height)}else p=await Ka.measure(()=>d.getBBox()),p=Bv(p,h);return s?a.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"):a.attr("transform","translate(0, "+-p.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-p.width/2+", "+-p.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:o,bbox:p,halfPadding:u,label:a}},"labelHelper"),Ha=b(async(e,t,i)=>{const r=i.useHtmlLabels??Ni(ye()),s=e.insert("g").attr("class","label").attr("style",i.labelStyle||""),o=await qr(s,es(da(t),ye()),{useHtmlLabels:r,width:i.width||ye()?.flowchart?.wrappingWidth,style:i.labelStyle,addSvgBackground:!!i.icon||!!i.img}),a=i.padding/2;let n;if(Ni(ye())){const l=o.children[0],c=me(o);n=await Ka.measure(()=>l.getBoundingClientRect()),c.attr("width",n.width),c.attr("height",n.height)}else n=await Ka.measure(()=>o.getBBox());return r?s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"):s.attr("transform","translate(0, "+-n.height/2+")"),i.centerLabel&&s.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:e,bbox:n,halfPadding:a,label:s}},"insertLabel"),Yt=b((e,t,i)=>{if(i){e.width=i.width,e.height=i.height;return}const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),te=b((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function Pe(e){const t=e.map((i,r)=>`${r===0?"M":"L"}${i.x},${i.y}`);return t.push("Z"),t.join(" ")}b(Pe,"createPathFromPoints");function pa(e,t,i,r,s,o){const a=[],l=i-e,c=r-t,h=l/o,d=2*Math.PI/h,u=t+c/2;for(let p=0;p<=50;p++){const f=p/50,g=e+f*l,m=u+s*Math.sin(d*(g-e));a.push({x:g,y:m})}return a}b(pa,"generateFullSineWavePoints");function Os(e,t,i,r,s,o){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(r-1);for(let d=0;d<r;d++){const u=n+d*h,p=e+i*Math.cos(u),f=t+i*Math.sin(u);a.push({x:-p,y:-f})}return a}b(Os,"generateCirclePoints");function Qf(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),i=document.createElementNS("http://www.w3.org/2000/svg","path"),r=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");i.setAttribute("d",r);const s=t.find(l=>l.getAttribute("fill")!=="none"),o=t.find(l=>l.getAttribute("stroke")!=="none"),a=b((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(s){const l={fill:a(s,"fill"),"fill-opacity":a(s,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&i.setAttribute(c,h)})}if(o){const l={stroke:a(o,"stroke"),"stroke-width":a(o,"stroke-width")??"1","stroke-opacity":a(o,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&i.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(i),n}b(Qf,"mergePaths");var KF=b((e,t)=>{var i=e.x,r=e.y,s=t.x-i,o=t.y-r,a=e.width/2,n=e.height/2,l,c;return Math.abs(o)*a>Math.abs(s)*n?(o<0&&(n=-n),l=o===0?0:n*s/o,c=n):(s<0&&(a=-a),l=a,c=s===0?0:a*o/s),{x:i+l,y:r+c}},"intersectRect"),_o=KF;function _C(e,t){return e.intersect(t)}b(_C,"intersectNode");var ZF=_C;function LC(e,t,i,r){var s=e.x,o=e.y,a=s-r.x,n=o-r.y,l=Math.sqrt(t*t*n*n+i*i*a*a),c=Math.abs(t*i*a/l);r.x<s&&(c=-c);var h=Math.abs(t*i*n/l);return r.y<o&&(h=-h),{x:s+c,y:o+h}}b(LC,"intersectEllipse");var PC=LC;function EC(e,t,i){return PC(e,t,t,i)}b(EC,"intersectCircle");var QF=EC;function RC(e,t,i,r){{const s=t.y-e.y,o=e.x-t.x,a=t.x*e.y-e.x*t.y,n=s*i.x+o*i.y+a,l=s*r.x+o*r.y+a,c=1e-6;if(n!==0&&l!==0&&Jf(n,l))return;const h=r.y-i.y,d=i.x-r.x,u=r.x*i.y-i.x*r.y,p=h*e.x+d*e.y+u,f=h*t.x+d*t.y+u;if(Math.abs(p)<c&&Math.abs(f)<c&&Jf(p,f))return;const g=s*d-h*o;if(g===0)return;const m=(o*u-d*a)/g,x=(h*a-s*u)/g;return{x:m,y:x}}}b(RC,"intersectLine");function Jf(e,t){return e*t>0}b(Jf,"sameSign");var JF=RC;function IC(e,t,i){let r=e.x,s=e.y,o=[],a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),n=Math.min(n,h.y)}):(a=Math.min(a,t.x),n=Math.min(n,t.y));let l=r-e.width/2-a,c=s-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],u=t[h<t.length-1?h+1:0],p=JF(e,i,{x:l+d.x,y:c+d.y},{x:l+u.x,y:c+u.y});p&&o.push(p)}return o.length?(o.length>1&&o.sort(function(h,d){let u=h.x-i.x,p=h.y-i.y,f=Math.sqrt(u*u+p*p),g=d.x-i.x,m=d.y-i.y,x=Math.sqrt(g*g+m*m);return f<x?-1:f===x?0:1}),o[0]):e}b(IC,"intersectPolygon");var tO=IC,Dt={node:ZF,circle:QF,ellipse:PC,polygon:tO,rect:_o},Hr=b((e,t,i,r,s)=>["M",e+s,t,"H",e+i-s,"A",s,s,0,0,1,e+i,t+s,"V",t+r-s,"A",s,s,0,0,1,e+i-s,t+r,"H",e+s,"A",s,s,0,0,1,e,t+r-s,"V",t+s,"A",s,s,0,0,1,e+s,t,"Z"].join(" "),"createRoundedRectPathD"),eO=b(async(e,t,i,r=!1,s=!1)=>{let o=t||"";typeof o=="object"&&(o=o[0]);const a=ye(),n=Ni(a);return await qr(e,o,{style:i,isTitle:r,useHtmlLabels:n,markdown:!1,isNode:s,width:Number.POSITIVE_INFINITY},a)},"createLabel"),bo=eO;function zC(e,t){const{labelStyles:i}=jt(t);t.labelStyle=i;const r=te(t);let s=r;r||(s="anchor");const o=e.insert("g").attr("class",s).attr("id",t.domId||t.id),a=1,{cssStyles:n}=t,l=Nt.svg(o),c=Ot(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,a*2,c),d=o.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",wi(n)),Yt(t,d),t.intersect=function(u){return vt.info("Circle intersect",t,a,u),Dt.circle(t,a,u)},o}b(zC,"anchor");function tg(e,t,i,r,s,o,a){const l=(e+i)/2,c=(t+r)/2,h=Math.atan2(r-t,i-e),d=(i-e)/2,u=(r-t)/2,p=d/s,f=u/o,g=Math.sqrt(p**2+f**2);if(g>1)throw new Error("The given radii are too small to create an arc between the points.");const m=Math.sqrt(1-g**2),x=l+m*o*Math.sin(h)*(a?-1:1),w=c-m*s*Math.cos(h)*(a?-1:1),S=Math.atan2((t-w)/o,(e-x)/s);let C=Math.atan2((r-w)/o,(i-x)/s)-S;a&&C<0&&(C+=2*Math.PI),!a&&C>0&&(C-=2*Math.PI);const E=[];for(let z=0;z<20;z++){const R=z/19,V=S+R*C,F=x+s*Math.cos(V),H=w+o*Math.sin(V);E.push({x:F,y:H})}return E}b(tg,"generateArcPoints");function DC(e,t,i){const[r,s]=[t,i].sort((o,a)=>a-o);return s*(1-Math.sqrt(1-(e/r/2)**2))}b(DC,"calculateArcSagitta");async function FC(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=b(V=>V+a,"calcTotalHeight"),l=b(V=>{const F=V/2;return[F/(2.5+V/50),F]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await ee(e,t,te(t)),d=n(t?.height?t?.height:h.height),[u,p]=l(d),f=DC(d,u,p),m=(t?.width?t?.width:h.width)+o*2+f-f,x=d,{cssStyles:w}=t,S=[{x:m/2,y:-x/2},{x:-m/2,y:-x/2},...tg(-m/2,-x/2,-m/2,x/2,u,p,!1),{x:m/2,y:x/2},...tg(m/2,x/2,m/2,-x/2,u,p,!0)],A=Nt.svg(c),C=Ot(t,{});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const E=Pe(S),z=A.path(E,C),R=c.insert(()=>z,":first-child");return R.attr("class","basic label-container outer-path"),w&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",w),r&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",r),R.attr("transform",`translate(${u/2}, 0)`),Yt(t,R),t.intersect=function(V){return Dt.polygon(t,S,V)},c}b(FC,"bowTieRect");async function OC(e,t,{config:{themeVariables:i}}){const{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:n}=await ee(e,t,te(t)),l=i?.nodeBorder??i?.lineColor??"currentColor",c=t.padding??12,h=Math.max(a.width+c*2,t.width??0,80),d=Math.max(Math.min(h*.08,12),5),u=Math.max(a.height+c*2+d,t.height??0),p=-u/2+d,f=u/2,g=h*.72,m=[`M${-h/2},${p}`,`L${-g/2},${f}`,`A${g/2},${d} 0 0 0 ${g/2},${f}`,`L${h/2},${p}`,`A${h/2},${d} 0 0 0 ${-h/2},${p}`,"Z"].join(" "),{cssStyles:x}=t,w=o.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const R=Nt.svg(o).path(m,Ot(t,{}));w.node()?.appendChild(R),x&&w.attr("style",x)}else w.append("path").attr("d",m).attr("style",s);w.append("ellipse").attr("cx",0).attr("cy",p).attr("rx",h/2).attr("ry",d).attr("style",`fill:none;stroke:${l};stroke-width:1px`),Yt(t,w);const S=p+(f-p)/2;n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${S-a.height/2-(a.y-(a.top??0))})`);const A=12,C=b((z,R,V)=>Array.from({length:A+1},(F,H)=>{const W=Math.PI-H*Math.PI/A;return{x:z*Math.cos(W),y:R+V*d*Math.sin(W)}}),"arc"),E=[...C(h/2,p,-1),...C(g/2,f,1).reverse()];return t.intersect=function(z){return Dt.polygon(t,E,z)},o}b(OC,"bucket");var _v=20,Lv=8,iO=80,rO=8;function NC(e){const{themeVariables:t}=ye(),i=t.clusterBkg,r=t.clusterBorder;return e==="flow"?{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"}:{rx:rO,fill:i,stroke:r,cssClass:"collapsed-group"}}b(NC,"getCollapsedStyle");async function WC(e,t){const i=NC(t.metadata?.containerType),{fill:r,stroke:s}=i,{nodeStyles:o}=jt(t),{shapeSvg:a,bbox:n}=await ee(e,t,te(t)),{theme:l,themeVariables:c}=ye();ls(a,t.colorIndex,l,c.borderColorArray);const h=t.padding??8,d=n.height,u=Math.max(n.width+h*2,iO,t?.width??0),p=Math.max(d+Lv+_v+h*2,t?.height??0),f=-u/2,g=-p/2,m=-28/2,x=a.select(".label");x&&(t.useHtmlLabels??Ni(ye())?x.attr("transform",`translate(${-n.width/2}, ${-n.height/2+m})`):x.attr("transform",`translate(0, ${-n.height/2+m})`));let w;if(t.look==="handDrawn"){const z=Nt.svg(a),R=Ot(t,{fill:r,stroke:s,...i.strokeWidth===void 0?{}:{strokeWidth:i.strokeWidth},...r==="none"?{fillWeight:0}:{fillStyle:"solid"}}),V=z.path(Hr(f,g,u,p,i.rx),R);w=a.insert(()=>V,":first-child"),w.attr("class","basic label-container "+i.cssClass).attr("style",wi(t.cssStyles))}else w=a.insert("rect",":first-child"),w.attr("class","basic label-container "+i.cssClass).attr("style",o).attr("rx",i.rx).attr("ry",i.rx).attr("x",f).attr("y",g).attr("width",u).attr("height",p).attr("fill",r).attr("stroke",s),i.strokeWidth!==void 0&&w.attr("stroke-width",i.strokeWidth+"px");const S=g+h+d+Lv;a.append("line").attr("class","collapsed-separator").attr("x1",f+8).attr("y1",S).attr("x2",f+u-8).attr("y2",S).attr("stroke",s).attr("stroke-dasharray","3, 3");const A=S+_v/2,C=2.5,E=10;for(let z=-1;z<=1;z++)a.append("circle").attr("class","collapsed-indicator").attr("cx",z*E).attr("cy",A).attr("r",C).attr("fill",s);return Yt(t,w),t.calcIntersect=function(z,R){return Dt.rect(z,R)},t.intersect=function(z){return Dt.rect(t,z)},a}b(WC,"collapsedGroup");function to(e,t,i,r){return e.insert("polygon",":first-child").attr("points",r.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+i/2+")")}b(to,"insertPolygonShape");var sO=["right","left","up","down"],w1="point",oO=b(e=>{const t=new Set;for(const i of e)switch(i){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(i);break}return t},"expandAndDeduplicateDirections"),aO=b(e=>sO.filter(t=>e.has(t)).join("|")||w1,"getDirectionKey"),Pv={"right|left|up|down":b(({height:e,midpoint:t,padding:i,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*i},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*i,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*i},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*i,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":b(({height:e,midpoint:t,width:i})=>[{x:t,y:0},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":b(({height:e,midpoint:t,width:i})=>[{x:0,y:0},{x:t,y:-e},{x:i-t,y:-e},{x:i,y:0}],"right|left|down"),"right|up|down":b(({height:e,midpoint:t,width:i})=>[{x:0,y:0},{x:i,y:-t},{x:i,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":b(({height:e,midpoint:t,width:i})=>[{x:i,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:i,y:-e}],"left|up|down"),"right|left":b(({height:e,midpoint:t,padding:i,width:r})=>[{x:t,y:0},{x:t,y:-i},{x:r-t,y:-i},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+i},{x:t,y:-e+i},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":b(({height:e,midpoint:t,padding:i,width:r})=>[{x:r/2,y:0},{x:0,y:-i},{x:t,y:-i},{x:t,y:-e+i},{x:0,y:-e+i},{x:r/2,y:-e},{x:r,y:-e+i},{x:r-t,y:-e+i},{x:r-t,y:-i},{x:r,y:-i}],"up|down"),"right|up":b(({height:e,midpoint:t,width:i})=>[{x:0,y:0},{x:i,y:-t},{x:0,y:-e}],"right|up"),"right|down":b(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":b(({height:e,midpoint:t,width:i})=>[{x:i,y:0},{x:0,y:-t},{x:i,y:-e}],"left|up"),"left|down":b(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:b(({height:e,midpoint:t,padding:i,width:r})=>[{x:t,y:-i},{x:t,y:-i},{x:r-t,y:-i},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+i},{x:t,y:-e+i},{x:t,y:-e+i}],"right"),left:b(({height:e,midpoint:t,padding:i,width:r})=>[{x:t,y:0},{x:t,y:-i},{x:r-t,y:-i},{x:r-t,y:-e+i},{x:t,y:-e+i},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:b(({height:e,midpoint:t,padding:i,width:r})=>[{x:t,y:-i},{x:t,y:-e+i},{x:0,y:-e+i},{x:r/2,y:-e},{x:r,y:-e+i},{x:r-t,y:-e+i},{x:r-t,y:-i}],"up"),down:b(({height:e,midpoint:t,padding:i,width:r})=>[{x:r/2,y:0},{x:0,y:-i},{x:t,y:-i},{x:t,y:-e+i},{x:r-t,y:-e+i},{x:r-t,y:-i},{x:r,y:-i}],"down"),[w1]:()=>[{x:0,y:0}]},nO=b((e,t,i,r)=>{const s=oO(e),o=(i.padding??0)/2,a=t.height+4*o,n=a/2,l=r??t.width+2*n+2*o,c=aO(s);return(Pv[c]??Pv[w1])({height:a,midpoint:n,padding:o,width:l})},"getArrowPoints");async function qC(e,t){const i=t,{shapeSvg:r,bbox:s}=await ee(e,i,te(i)),o=i.padding??0,a=s.height+2*o,n=a/2,l=s.width+2*n+o,c=i.width??0,d=i.positioned&&(i.widthInColumns??1)>1&&c>l?c:l,u=nO(i.directions??[],s,i,d),p=to(r,d,a,u);return p.attr("style",i.style??null),Yt(i,p),i.intersect=function(f){return Dt.polygon(i,u,f)},r}b(qC,"block_arrow");async function HC(e,t,{config:{themeVariables:i}}){const{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:n}=await ee(e,t,te(t)),l=i?.nodeBorder??i?.lineColor??"currentColor",c=t.padding??12,h=18,d=12,u=Math.max(a.width+c*2,t.width??0,90),p=Math.max(a.height+c*2+h,t.height??0),f=-p/2,{cssStyles:g}=t,m=o.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const S=Nt.svg(o).path(Hr(-u/2,f,u,p,d),Ot(t,{}));m.node()?.appendChild(S),g&&m.attr("style",g)}else m.append("rect").attr("x",-u/2).attr("y",f).attr("width",u).attr("height",p).attr("rx",d).attr("ry",d).attr("style",s);m.append("line").attr("x1",-u/2).attr("y1",f+h).attr("x2",u/2).attr("y2",f+h).attr("style",`stroke:${l};stroke-width:1px`);for(let w=0;w<3;w++)m.append("circle").attr("cx",-u/2+12+w*9).attr("cy",f+h/2).attr("r",2.5).attr("style",`fill:${l};stroke:none`);m.append("rect").attr("class","browser-address-bar").attr("x",-u/2+44).attr("y",f+4).attr("width",Math.max(u-56,10)).attr("height",h-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${l};stroke-width:1px;opacity:0.6`),Yt(t,m);const x=f+h+(p-h)/2;return n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(w){return Dt.rect(t,w)},o}b(HC,"browser");var Th=12;async function jC(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?28:s,a=t.look==="neo"?24:s,{shapeSvg:n,bbox:l}=await ee(e,t,te(t)),c=(t?.width??l.width)+(t.look==="neo"?o*2:o+Th),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,u=c,p=-h,f=0,g=[{x:d+Th,y:p},{x:u,y:p},{x:u,y:f},{x:d,y:f},{x:d,y:p+Th},{x:d+Th,y:p}];let m;const{cssStyles:x}=t;if(t.look==="handDrawn"){const w=Nt.svg(n),S=Ot(t,{}),A=Pe(g),C=w.path(A,S);m=n.insert(()=>C,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),x&&m.attr("style",x)}else m=to(n,c,h,g);return r&&m.attr("style",r),Yt(t,m),t.intersect=function(w){return Dt.polygon(t,g,w)},n}b(jC,"card");function UC(e,t){const{nodeStyles:i}=jt(t);t.label="";const r=e.insert("g").attr("class",te(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,o=Math.max(28,t.width??0),a=[{x:0,y:o/2},{x:o/2,y:0},{x:0,y:-o/2},{x:-o/2,y:0}],n=Nt.svg(r),l=Ot(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=Pe(a),h=n.path(c,l),d=r.insert(()=>h,":first-child");return s&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",i),t.width=28,t.height=28,t.intersect=function(u){return Dt.polygon(t,a,u)},r}b(UC,"choice");async function k1(e,t,i){const{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,halfPadding:n}=await ee(e,t,te(t)),l=16,c=i?.padding??n,h=Math.sqrt(a.width**2+a.height**2)/2,d=t.look==="neo"?h+l*2:h+c;let u;const{cssStyles:p}=t;if(t.look==="handDrawn"){const f=Nt.svg(o),g=Ot(t,{}),m=f.circle(0,0,d*2,g);u=o.insert(()=>m,":first-child"),u.attr("class","basic label-container").attr("style",wi(p))}else u=o.insert("circle",":first-child").attr("class","basic label-container").attr("style",s).attr("r",d).attr("cx",0).attr("cy",0);return Yt(t,u),t.calcIntersect=function(f,g){const m=f.width/2;return Dt.circle(f,m,g)},t.intersect=function(f){return vt.info("Circle intersect",t,d,f),Dt.circle(t,d,f)},o}b(k1,"circle");async function YC(e,t){const i=t,r=["node",i.cssClasses,i.class].filter(Boolean).join(" "),{shapeSvg:s,bbox:o,halfPadding:a}=await ee(e,i,r),n=s.insert("rect",":first-child"),l=i.padding??0,c=i.positioned?i.width??0:o.width+l,h=i.positioned?i.height??0:o.height+l,d=i.positioned?-c/2:-o.width/2-a,u=i.positioned?-h/2:-o.height/2-a;return n.attr("class","basic cluster composite label-container").attr("style",i.style??null).attr("rx",i.rx??null).attr("ry",i.ry??null).attr("x",d).attr("y",u).attr("width",c).attr("height",h),Yt(i,n),i.intersect=function(p){return Dt.rect(i,p)},s}b(YC,"composite");async function GC(e,t,{config:{themeVariables:i}}){const{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:n}=await ee(e,t,te(t)),l=i?.nodeBorder??i?.lineColor??"currentColor",c=t.padding??12,h=20,d=12,u=Math.max(a.width+c*2,t.width??0,90),p=Math.max(a.height+c*2+h,t.height??0),f=-p/2,{cssStyles:g}=t,m=o.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const S=Nt.svg(o).path(Hr(-u/2,f,u,p,d),Ot(t,{}));m.node()?.appendChild(S),g&&m.attr("style",g)}else m.append("rect").attr("x",-u/2).attr("y",f).attr("width",u).attr("height",p).attr("rx",d).attr("ry",d).attr("style",s);m.append("text").attr("x",-u/2+12).attr("y",f+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${l}`).text(">_"),Yt(t,m);const x=f+h+(p-h)/2;return n.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(w){return Dt.rect(t,w)},o}b(GC,"consoleWindow");function XC(e){const t=Math.cos(Math.PI/4),i=Math.sin(Math.PI/4),r=e*2,s={x:r/2*t,y:r/2*i},o={x:-(r/2)*t,y:r/2*i},a={x:-(r/2)*t,y:-(r/2)*i},n={x:r/2*t,y:-(r/2)*i};return`M ${o.x},${o.y} L ${n.x},${n.y}
1617
1617
  M ${s.x},${s.y} L ${a.x},${a.y}`}b(XC,"createLine");function VC(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i,t.label="";const s=e.insert("g").attr("class",te(t)).attr("id",t.domId??t.id),o=Math.max(30,t?.width??0),{cssStyles:a}=t,n=Nt.svg(s),l=Ot(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,o*2,l),h=XC(o),d=n.path(h,l),u=s.insert(()=>c,":first-child");return u.insert(()=>d),u.attr("class","outer-path"),a&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",a),r&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",r),Yt(t,u),t.intersect=function(p){return vt.info("crossedCircle intersect",t,{radius:o,point:p}),Dt.circle(t,o,p)},s}b(VC,"crossedCircle");function po(e,t,i,r=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(r-1);for(let d=0;d<r;d++){const u=n+d*h,p=e+i*Math.cos(u),f=t+i*Math.sin(u);a.push({x:-p,y:-f})}return a}b(po,"generateCirclePoints");async function KC(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const{shapeSvg:s,bbox:o,label:a}=await ee(e,t,te(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+n,h=o.height+l,d=Math.max(5,h*.1),{cssStyles:u}=t,p=[...po(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...po(c/2+d*2,-d,d,20,-180,-270),...po(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...po(c/2,h/2,d,20,0,90)],f=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...po(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...po(c/2+c*.1,-d,d,20,-180,-270),...po(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...po(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2,y:h/2+d}],g=Nt.svg(s),m=Ot(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const w=Pe(p).replace("Z",""),S=g.path(w,m),A=Pe(f),C=g.path(A,{...m}),E=s.insert("g",":first-child");return E.insert(()=>C,":first-child").attr("stroke-opacity",0),E.insert(()=>S,":first-child"),E.attr("class","text"),u&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",u),r&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",r),E.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),Yt(t,E),t.intersect=function(z){return Dt.polygon(t,f,z)},s}b(KC,"curlyBraceLeft");function fo(e,t,i,r=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(r-1);for(let d=0;d<r;d++){const u=n+d*h,p=e+i*Math.cos(u),f=t+i*Math.sin(u);a.push({x:p,y:f})}return a}b(fo,"generateCirclePoints");async function ZC(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const{shapeSvg:s,bbox:o,label:a}=await ee(e,t,te(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,p=[...fo(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...fo(c/2+d*2,-d,d,20,-180,-270),...fo(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...fo(c/2,h/2,d,20,0,90)],f=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...fo(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...fo(c/2+d*2,-d,d,20,-180,-270),...fo(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...fo(c/2,h/2,d,20,0,90),{x:c/2,y:h/2+d},{x:-c/2,y:h/2+d}],g=Nt.svg(s),m=Ot(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const w=Pe(p).replace("Z",""),S=g.path(w,m),A=Pe(f),C=g.path(A,{...m}),E=s.insert("g",":first-child");return E.insert(()=>C,":first-child").attr("stroke-opacity",0),E.insert(()=>S,":first-child"),E.attr("class","text"),u&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",u),r&&t.look!=="handDrawn"&&E.selectAll("path").attr("style",r),E.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),Yt(t,E),t.intersect=function(z){return Dt.polygon(t,f,z)},s}b(ZC,"curlyBraceRight");function ji(e,t,i,r=100,s=0,o=180){const a=[],n=s*Math.PI/180,h=(o*Math.PI/180-n)/(r-1);for(let d=0;d<r;d++){const u=n+d*h,p=e+i*Math.cos(u),f=t+i*Math.sin(u);a.push({x:-p,y:-f})}return a}b(ji,"generateCirclePoints");async function QC(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const{shapeSvg:s,bbox:o,label:a}=await ee(e,t,te(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=o.width+(t.look==="neo"?n*2:n),h=o.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,p=[...ji(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...ji(c/2+d*2,-d,d,20,-180,-270),...ji(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...ji(c/2,h/2,d,20,0,90)],f=[...ji(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...ji(-c/2-d/2,-d,d,20,0,90),...ji(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...ji(-c/2+d+d/2,h/2,d,30,-180,-270)],g=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...ji(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...ji(c/2+d*2,-d,d,20,-180,-270),...ji(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...ji(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},...ji(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...ji(-c/2-d/2,-d,d,20,0,90),...ji(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...ji(-c/2+d+d/2,h/2,d,30,-180,-270)],m=Nt.svg(s),x=Ot(t,{fill:"none"});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const S=Pe(p).replace("Z",""),A=m.path(S,x),E=Pe(f).replace("Z",""),z=m.path(E,x),R=Pe(g),V=m.path(R,{...x}),F=s.insert("g",":first-child");return F.insert(()=>V,":first-child").attr("stroke-opacity",0),F.insert(()=>A,":first-child"),F.insert(()=>z,":first-child"),F.attr("class","text"),u&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",u),r&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",r),F.attr("transform",`translate(${d-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),Yt(t,F),t.intersect=function(H){return Dt.polygon(t,g,H)},s}b(QC,"curlyBraces");async function JC(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=20,l=5,{shapeSvg:c,bbox:h}=await ee(e,t,te(t)),d=Math.max(l,h.height+a*2,t?.height??0),u=d/2,p=u-Math.sqrt(Math.max(0,u**2-(h.height/2)**2)),f=Math.max(d/4,p),g=Math.max(n,h.width+o*2+f*2,(h.width+o*2)*1.25,t?.width??0),{cssStyles:m}=t,x=Nt.svg(c),w=Ot(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=g,A=d,C=S-u,E=A/4,z=[{x:C,y:0},{x:E,y:0},{x:0,y:A/2},{x:E,y:A},{x:C,y:A},...Os(-C,-A/2,u,50,270,90)],R=Pe(z),V=x.path(R,w),F=c.insert(()=>V,":first-child");return F.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&F.selectChildren("path").attr("style",m),r&&t.look!=="handDrawn"&&F.selectChildren("path").attr("style",r),F.attr("transform",`translate(${-g/2}, ${-d/2})`),Yt(t,F),t.intersect=function(H){return Dt.polygon(t,z,H)},c}b(JC,"curvedTrapezoid");async function t5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const{shapeSvg:s,bbox:o,label:a}=await ee(e,t,te(t)),n=t.padding??20,l=Math.max(o.width+n*2,t.width??0,100),c=Math.min(Math.max(l*.23,16),56),h=c*.27,d=Math.max(o.height+n*2,t.height?t.height-(2*c-h):0),u=Math.min(l*.177,d*.45),p=d+2*c-h,f=-p/2,g=f+2*c-h,m=s.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:x}=t;if(t.look==="handDrawn"){const R=Nt.svg(s),V=Ot(t,{}),F=R.path(Hr(-l/2,g,l,d,u),V),H=R.circle(0,f+c,c*2,V);m.insert(()=>H,":first-child"),m.insert(()=>F,":first-child"),x&&m.attr("style",x)}else m.append("rect").attr("x",-l/2).attr("y",g).attr("width",l).attr("height",d).attr("rx",u).attr("ry",u).attr("style",r),m.append("circle").attr("cx",0).attr("cy",f+c).attr("r",c).attr("style",r);Yt(t,m);const w=g+d/2;a.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${w-o.height/2-(o.y-(o.top??0))})`);const S=f+c,A=Math.asin(Math.min(1,(g-S)/c))*180/Math.PI,z=[...Os(0,-S,c,24,180+A,-A),...Os(-(-l/2+u),-(g+u),u,12,90,0),...Os(-(-l/2+u),-(p/2-u),u,12,360,270),...Os(-(l/2-u),-(p/2-u),u,12,270,180),...Os(-(l/2-u),-(g+u),u,12,180,90)];return t.intersect=function(R){return Dt.polygon(t,z,R)},s}b(t5,"person");var lO=b((e,t,i,r,s,o)=>[`M${e},${t+o}`,`a${s},${o} 0,0,0 ${i},0`,`a${s},${o} 0,0,0 ${-i},0`,`l0,${r}`,`a${s},${o} 0,0,0 ${i},0`,`l0,${-r}`].join(" "),"createCylinderPathD"),cO=b((e,t,i,r,s,o)=>[`M${e},${t+o}`,`M${e+i},${t+o}`,`a${s},${o} 0,0,0 ${-i},0`,`l0,${r}`,`a${s},${o} 0,0,0 ${i},0`,`l0,${-r}`].join(" "),"createOuterCylinderPathD"),hO=b((e,t,i,r,s,o)=>[`M${e-i/2},${-r/2}`,`a${s},${o} 0,0,0 ${i},0`].join(" "),"createInnerCylinderPathD"),Ev=8,Rv=8;async function e5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?24:s,a=t.look==="neo"?24:s,n=t.width??0;if(t.width&&(t.width=t.width-a,t.width<Rv&&(t.width=Rv)),t.height){const w=n/2/(2.5+n/50);t.height=t.height-o-w*3,t.height<Ev&&(t.height=Ev)}const{shapeSvg:l,bbox:c,label:h}=await ee(e,t,te(t)),d=Math.max(t.width??0,c.width)+a,u=d/2,p=u/(2.5+d/50),f=Math.max(t.height??0,c.height)+o+p;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const x=Nt.svg(l),w=cO(0,0,d,f,u,p),S=hO(0,p,d,f,u,p),A=Ot(t,{}),C=x.path(w,A),E=x.path(S,Ot(t,{fill:"none"}));g=l.insert(()=>E,":first-child"),g=l.insert(()=>C,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const x=lO(0,0,d,f,u,p);g=l.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",wi(m)).attr("style",r)}return g.attr("label-offset-y",p),g.attr("transform",`translate(${-d/2}, ${-(f/2+p)})`),Yt(t,g),h.attr("transform",`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+(t.padding??0)/1.5-(c.y-(c.top??0))})`),t.intersect=function(x){const w=Dt.rect(t,x),S=w.x-(t.x??0);if(u!=0&&(Math.abs(S)<(t.width??0)/2||Math.abs(S)==(t.width??0)/2&&Math.abs(w.y-(t.y??0))>(t.height??0)/2-p)){let A=p*p*(1-S*S/(u*u));A>0&&(A=Math.sqrt(A)),A=p-A,x.y-(t.y??0)>0&&(A=-A),w.y+=A}return w},l}b(e5,"cylinder");async function bl(e,t,i){const{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r;const{shapeSvg:o,bbox:a}=await ee(e,t,te(t)),n=Math.max(a.width+i.labelPaddingX*2,t?.width||0),l=Math.max(a.height+i.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:u,ry:p}=t;const{cssStyles:f}=t;if(i?.rx&&i.ry&&(u=i.rx,p=i.ry),t.look==="handDrawn"){const g=Nt.svg(o),m=Ot(t,{}),x=u||p?g.path(Hr(c,h,n,l,u||0),m):g.rectangle(c,h,n,l,m);d=o.insert(()=>x,":first-child"),d.attr("class","basic label-container").attr("style",wi(f))}else d=o.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",s).attr("rx",wi(u)).attr("ry",wi(p)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return Yt(t,d,t.look==="handDrawn"?void 0:{width:n,height:l}),t.calcIntersect=function(g,m){return Dt.rect(g,m)},t.intersect=function(g){return Dt.rect(t,g)},o}b(bl,"drawRect");async function i5(e,t){const{cssClasses:i,labelPaddingX:r,labelPaddingY:s,padding:o,width:a,height:n}=t,l={rx:0,ry:0,labelPaddingX:r??(o??0)*2,labelPaddingY:s??o??0},c=await bl(e,t,l);if(t.look==="handDrawn"){const p=Nt.svg(c),f=Ot(t,{}),g=c.select(".basic.label-container > path:nth-child(2)"),m=g.node();if(!m)return c;let x=null;if(m instanceof SVGGraphicsElement)x=m.getBBox();else return c;return c.insert(()=>p.line(x.x,x.y,x.x+x.width,x.y,f),".basic.label-container g.label"),c.insert(()=>p.line(x.x,x.y+x.height,x.x+x.width,x.y+x.height,f),".basic.label-container g.label"),g.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||a)??0,u=(Number(h.attr("height"))||n)??0;return d>0&&u>0&&h.attr("stroke-dasharray",`${d} ${u}`),c}b(i5,"datastore");async function r5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await ee(e,t,te(t)),c=n.width+s,h=n.height+o,d=h*.2,u=-c/2,p=-h/2-d/2,{cssStyles:f}=t,g=Nt.svg(a),m=Ot(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=[{x:u,y:p+d},{x:-u,y:p+d},{x:-u,y:-p},{x:u,y:-p},{x:u,y:p},{x:-u,y:p},{x:-u,y:p+d}],w=g.polygon(x.map(A=>[A.x,A.y]),m),S=a.insert(()=>w,":first-child");return S.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",f),r&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",r),l.attr("transform",`translate(${u+(t.padding??0)/2-(n.x-(n.left??0))}, ${p+d+(t.padding??0)/2-(n.y-(n.top??0))})`),Yt(t,S),t.intersect=function(A){return Dt.rect(t,A)},a}b(r5,"dividedRectangle");async function s5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t),s=t.look==="neo"?12:5;t.labelStyle=i;const o=t.padding??0,a=t.look==="neo"?16:o,{shapeSvg:n,bbox:l}=await ee(e,t,te(t)),c=Math.sqrt(l.width**2+l.height**2)/2,h=(t?.width?t?.width/2:c)+(a??0),d=h+s;let u;const{cssStyles:p}=t;if(t.look==="handDrawn"){const f=Nt.svg(n),g=Ot(t,{roughness:.2,strokeWidth:2.5}),m=Ot(t,{roughness:.2,strokeWidth:1.5}),x=f.circle(0,0,d*2,g),w=f.circle(0,0,h*2,m);u=n.insert("g",":first-child"),u.attr("class",wi(t.cssClasses)).attr("style",wi(p)),u.node()?.appendChild(x),u.node()?.appendChild(w)}else{u=n.insert("g",":first-child");const f=u.insert("circle",":first-child"),g=u.insert("circle");u.attr("class","basic label-container").attr("style",r),f.attr("class","outer-circle").attr("style",r).attr("r",d).attr("cx",0).attr("cy",0),g.attr("class","inner-circle").attr("style",r).attr("r",h).attr("cx",0).attr("cy",0)}return Yt(t,u),t.intersect=function(f){return vt.info("DoubleCircle intersect",t,d,f),Dt.circle(t,d,f)},n}b(s5,"doublecircle");async function o5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const{shapeSvg:s,bbox:o,halfPadding:a}=await ee(e,t,te(t)),{theme:n,themeVariables:l}=ye();ls(s,t.colorIndex,n,l.borderColorArray);const c=a??10,h=o.width/2+c*2,d=o.height/2+c*2;let u;const{cssStyles:p}=t;if(t.look==="handDrawn"){const f=Nt.svg(s),g=Ot(t,{}),m=f.ellipse(0,0,h*2,d*2,g);u=s.insert(()=>m,":first-child"),u.attr("class","basic label-container"),p&&u.attr("style",p)}else u=s.insert("ellipse",":first-child").attr("class","basic label-container").attr("style",r).attr("rx",h).attr("ry",d).attr("cx",0).attr("cy",0);return t.width=h*2,t.height=d*2,Yt(t,u),t.calcIntersect=function(f,g){const m=f.width/2,x=f.height/2;return Dt.ellipse(f,m,x,g)},t.intersect=function(f){return Dt.ellipse(t,h,d,f)},s}b(o5,"usecaseEllipse");function a5(e,t,{config:{themeVariables:i}}){const{labelStyles:r,nodeStyles:s}=jt(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",te(t)).attr("id",t.domId??t.id),a=7,{cssStyles:n}=t,l=Nt.svg(o),{nodeBorder:c}=i,h=Ot(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),u=o.insert(()=>d,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",n),s&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",s),Yt(t,u),t.intersect=function(p){return vt.info("filledCircle intersect",t,{radius:a,point:p}),Dt.circle(t,a,p)},o}b(a5,"filledCircle");var Iv=10,zv=10;async function n5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?s*2:s;(t.width||t.height)&&(t.height=t?.height??0,t.height<Iv&&(t.height=Iv),t.width=(t?.width??0)-o-o/2,t.width<zv&&(t.width=zv));const{shapeSvg:a,bbox:n,label:l}=await ee(e,t,te(t)),c=(t?.width?t?.width:n.width)+(o??0),h=t?.height?t?.height:c+n.height,d=h,u=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:p}=t,f=Nt.svg(a),g=Ot(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=Pe(u),x=f.path(m,g),w=a.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return p&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",p),r&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",r),t.width=c,t.height=h,Yt(t,w),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(S){return vt.info("Triangle intersect",t,u,S),Dt.polygon(t,u,S)},a}b(n5,"flippedTriangle");async function l5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const{shapeSvg:s,bbox:o,label:a}=await ee(e,t,te(t)),n=t.padding??12,l=Math.max(o.width+n*2,t.width??0,90),c=o.height+n*2,h=Math.max(Math.min(c*.16,14),8),d=Math.max(c+h,t.height??0),u=d-h,p=Math.max(l*.38,28),f=-d/2,g=[{x:-l/2,y:f},{x:-l/2+p,y:f},{x:-l/2+p,y:f+h},{x:l/2,y:f+h},{x:l/2,y:d/2},{x:-l/2,y:d/2}],m=[`M${g[0].x},${g[0].y}`,...g.slice(1).map(A=>`L${A.x},${A.y}`),"Z"].join(" "),{cssStyles:x}=t;let w;if(t.look==="handDrawn"){const C=Nt.svg(s).path(m,Ot(t,{}));w=s.insert(()=>C,":first-child").attr("class","basic label-container"),x&&w.attr("style",x)}else w=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",r);t.look==="handDrawn"?Yt(t,w):Yt(t,w,{width:l,height:d});const S=f+h+u/2;return a.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${S-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(A){return Dt.polygon(t,g,A)},s}b(l5,"folder");function c5(e,t,{dir:i,config:{state:r,themeVariables:s}}){const{nodeStyles:o}=jt(t);t.label="";const a=e.insert("g").attr("class",te(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);(i==="LR"||i==="RL")&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,u=Nt.svg(a),p=Ot(t,{stroke:s.lineColor,fill:s.lineColor});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const f=u.rectangle(h,d,l,c,p),g=a.insert(()=>f,":first-child");n&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",o),Yt(t,g);const m=r?.padding??0;return t.width&&t.height&&(t.width+=m/2||0,t.height+=m/2||0),t.intersect=function(x){return Dt.rect(t,x)},a}b(c5,"forkJoin");async function h5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=15,o=10,a=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<o&&(t.height=o),t.width=(t?.width??0)-a*2,t.width<s&&(t.width=s));const{shapeSvg:l,bbox:c}=await ee(e,t,te(t)),h=(t?.height?t?.height:Math.max(o,c.height))+n*2,d=h/2,u=d-Math.sqrt(Math.max(0,d**2-(c.height/2)**2)),p=(t?.width?t?.width:Math.max(s,c.width)+u*2)+a*2,{cssStyles:f}=t,g=Nt.svg(l),m=Ot(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=[{x:-p/2,y:-h/2},{x:p/2-d,y:-h/2},...Os(-p/2+d,0,d,50,90,270),{x:p/2-d,y:h/2},{x:-p/2,y:h/2}],w=Pe(x),S=g.path(w,m),A=l.insert(()=>S,":first-child");return A.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&A.selectChildren("path").attr("style",f),r&&t.look!=="handDrawn"&&A.selectChildren("path").attr("style",r),Yt(t,A),t.intersect=function(C){return vt.info("Pill intersect",t,{radius:d,point:C}),Dt.polygon(t,x,C)},l}b(h5,"halfRoundedRectangle");var dO=b((e,t,i,r,s)=>[`M${e+s},${t}`,`L${e+i-s},${t}`,`L${e+i},${t-r/2}`,`L${e+i-s},${t-r}`,`L${e+s},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createHexagonPathD");async function d5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t),s=t.look==="neo"?3.5:4;t.labelStyle=i;const o=t.padding??0,a=70,n=32,l=t.look==="neo"?a:o,c=t.look==="neo"?n:o;if(t.width||t.height){const S=(t.height??0)/s;t.width=(t?.width??0)-2*S-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await ee(e,t,te(t)),u=(t?.height?t?.height:d.height)+l,p=u/s,f=(t?.width?t?.width:d.width)+2*p+c,g=[{x:p,y:0},{x:f-p,y:0},{x:f,y:-u/2},{x:f-p,y:-u},{x:p,y:-u},{x:0,y:-u/2}];let m;const{cssStyles:x}=t;if(t.look==="handDrawn"){const w=Nt.svg(h),S=Ot(t,{}),A=dO(0,0,f,u,p),C=w.path(A,S);m=h.insert(()=>C,":first-child").attr("transform",`translate(${-f/2}, ${u/2})`),x&&m.attr("style",x)}else m=to(h,f,u,g);return r&&m.attr("style",r),t.width=f,t.height=u,Yt(t,m),t.intersect=function(w){return Dt.polygon(t,g,w)},h}b(d5,"hexagon");async function u5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.label="",t.labelStyle=i;const{shapeSvg:s}=await ee(e,t,te(t)),o=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:n}=t,l=Nt.svg(s),c=Ot(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:o,y:0},{x:0,y:a},{x:o,y:a}],d=Pe(h),u=l.path(d,c),p=s.insert(()=>u,":first-child");return p.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),r&&t.look!=="handDrawn"&&p.selectChildren("path").attr("style",r),p.attr("transform",`translate(${-o/2}, ${-a/2})`),Yt(t,p),t.intersect=function(f){return vt.info("Pill intersect",t,{points:h}),Dt.polygon(t,h,f)},s}b(u5,"hourglass");async function p5(e,t,{config:{themeVariables:i,flowchart:r}}){const{labelStyles:s}=jt(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=r?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await ee(e,t,"icon-shape default"),u=t.pos==="t",p=n,f=n,{nodeBorder:g}=i,{stylesMap:m}=va(t),x=-f/2,w=-p/2,S=t.label?8:0,A=Nt.svg(c),C=Ot(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const E=A.rectangle(x,w,f,p,C),z=Math.max(f,h.width),R=p+h.height+S,V=A.rectangle(-z/2,-R/2,z,R,{...C,fill:"transparent",stroke:"none"}),F=c.insert(()=>E,":first-child"),H=c.insert(()=>V);if(t.icon){const W=c.append("g");W.html(`<g>${await ml(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const U=W.node().getBBox(),D=U.width,O=U.height,M=U.x,X=U.y;W.attr("transform",`translate(${-D/2-M},${u?h.height/2+S/2-O/2-X:-h.height/2-S/2-O/2-X})`),W.attr("style",`color: ${m.get("stroke")??g};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-R/2:R/2-h.height})`),F.attr("transform",`translate(0,${u?h.height/2+S/2:-h.height/2-S/2})`),Yt(t,H),t.intersect=function(W){if(vt.info("iconSquare intersect",t,W),!t.label)return Dt.rect(t,W);const U=t.x??0,D=t.y??0,O=t.height??0;let M=[];return u?M=[{x:U-h.width/2,y:D-O/2},{x:U+h.width/2,y:D-O/2},{x:U+h.width/2,y:D-O/2+h.height+S},{x:U+f/2,y:D-O/2+h.height+S},{x:U+f/2,y:D+O/2},{x:U-f/2,y:D+O/2},{x:U-f/2,y:D-O/2+h.height+S},{x:U-h.width/2,y:D-O/2+h.height+S}]:M=[{x:U-f/2,y:D-O/2},{x:U+f/2,y:D-O/2},{x:U+f/2,y:D-O/2+p},{x:U+h.width/2,y:D-O/2+p},{x:U+h.width/2/2,y:D+O/2},{x:U-h.width/2,y:D+O/2},{x:U-h.width/2,y:D-O/2+p},{x:U-f/2,y:D-O/2+p}],Dt.polygon(t,M,W)},c}b(p5,"icon");async function f5(e,t,{config:{themeVariables:i,flowchart:r}}){const{labelStyles:s}=jt(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=r?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await ee(e,t,"icon-shape default"),u=20,p=t.label?8:0,f=t.pos==="t",{nodeBorder:g,mainBkg:m}=i,{stylesMap:x}=va(t),w=Nt.svg(c),S=Ot(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const A=x.get("fill");S.stroke=A??m;const C=c.append("g");t.icon&&C.html(`<g>${await ml(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const E=C.node().getBBox(),z=E.width,R=E.height,V=E.x,F=E.y,H=Math.max(z,R)*Math.SQRT2+u*2,W=w.circle(0,0,H,S),U=Math.max(H,h.width),D=H+h.height+p,O=w.rectangle(-U/2,-D/2,U,D,{...S,fill:"transparent",stroke:"none"}),M=c.insert(()=>W,":first-child"),X=c.insert(()=>O);return C.attr("transform",`translate(${-z/2-V},${f?h.height/2+p/2-R/2-F:-h.height/2-p/2-R/2-F})`),C.attr("style",`color: ${x.get("stroke")??g};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-D/2:D/2-h.height})`),M.attr("transform",`translate(0,${f?h.height/2+p/2:-h.height/2-p/2})`),Yt(t,X),t.intersect=function(G){return vt.info("iconSquare intersect",t,G),Dt.rect(t,G)},c}b(f5,"iconCircle");async function g5(e,t,{config:{themeVariables:i,flowchart:r}}){const{labelStyles:s}=jt(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=r?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await ee(e,t,"icon-shape default"),p=t.pos==="t",f=n+d*2,g=n+d*2,{nodeBorder:m,mainBkg:x}=i,{stylesMap:w}=va(t),S=-g/2,A=-f/2,C=t.label?8:0,E=Nt.svg(c),z=Ot(t,{});t.look!=="handDrawn"&&(z.roughness=0,z.fillStyle="solid");const R=w.get("fill");z.stroke=R??x;const V=E.path(Hr(S,A,g,f,5),z),F=Math.max(g,h.width),H=f+h.height+C,W=E.rectangle(-F/2,-H/2,F,H,{...z,fill:"transparent",stroke:"none"}),U=c.insert(()=>V,":first-child").attr("class","icon-shape2"),D=c.insert(()=>W);if(t.icon){const O=c.append("g");O.html(`<g>${await ml(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const M=O.node().getBBox(),X=M.width,G=M.height,nt=M.x,Y=M.y;O.attr("transform",`translate(${-X/2-nt},${p?h.height/2+C/2-G/2-Y:-h.height/2-C/2-G/2-Y})`),O.attr("style",`color: ${w.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-H/2:H/2-h.height})`),U.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Yt(t,D),t.intersect=function(O){if(vt.info("iconSquare intersect",t,O),!t.label)return Dt.rect(t,O);const M=t.x??0,X=t.y??0,G=t.height??0;let nt=[];return p?nt=[{x:M-h.width/2,y:X-G/2},{x:M+h.width/2,y:X-G/2},{x:M+h.width/2,y:X-G/2+h.height+C},{x:M+g/2,y:X-G/2+h.height+C},{x:M+g/2,y:X+G/2},{x:M-g/2,y:X+G/2},{x:M-g/2,y:X-G/2+h.height+C},{x:M-h.width/2,y:X-G/2+h.height+C}]:nt=[{x:M-g/2,y:X-G/2},{x:M+g/2,y:X-G/2},{x:M+g/2,y:X-G/2+f},{x:M+h.width/2,y:X-G/2+f},{x:M+h.width/2/2,y:X+G/2},{x:M-h.width/2,y:X+G/2},{x:M-h.width/2,y:X-G/2+f},{x:M-g/2,y:X-G/2+f}],Dt.polygon(t,nt,O)},c}b(g5,"iconRounded");async function m5(e,t,{config:{themeVariables:i,flowchart:r}}){const{labelStyles:s}=jt(t);t.labelStyle=s;const o=t.assetHeight??48,a=t.assetWidth??48,n=Math.max(o,a),l=r?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await ee(e,t,"icon-shape default"),p=t.pos==="t",f=n+d*2,g=n+d*2,{nodeBorder:m,mainBkg:x}=i,{stylesMap:w}=va(t),S=-g/2,A=-f/2,C=t.label?8:0,E=Nt.svg(c),z=Ot(t,{});t.look!=="handDrawn"&&(z.roughness=0,z.fillStyle="solid");const R=w.get("fill");z.stroke=R??x;const V=E.path(Hr(S,A,g,f,.1),z),F=Math.max(g,h.width),H=f+h.height+C,W=E.rectangle(-F/2,-H/2,F,H,{...z,fill:"transparent",stroke:"none"}),U=c.insert(()=>V,":first-child"),D=c.insert(()=>W);if(t.icon){const O=c.append("g");O.html(`<g>${await ml(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const M=O.node().getBBox(),X=M.width,G=M.height,nt=M.x,Y=M.y;O.attr("transform",`translate(${-X/2-nt},${p?h.height/2+C/2-G/2-Y:-h.height/2-C/2-G/2-Y})`),O.attr("style",`color: ${w.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${p?-H/2:H/2-h.height})`),U.attr("transform",`translate(0,${p?h.height/2+C/2:-h.height/2-C/2})`),Yt(t,D),t.intersect=function(O){if(vt.info("iconSquare intersect",t,O),!t.label)return Dt.rect(t,O);const M=t.x??0,X=t.y??0,G=t.height??0;let nt=[];return p?nt=[{x:M-h.width/2,y:X-G/2},{x:M+h.width/2,y:X-G/2},{x:M+h.width/2,y:X-G/2+h.height+C},{x:M+g/2,y:X-G/2+h.height+C},{x:M+g/2,y:X+G/2},{x:M-g/2,y:X+G/2},{x:M-g/2,y:X-G/2+h.height+C},{x:M-h.width/2,y:X-G/2+h.height+C}]:nt=[{x:M-g/2,y:X-G/2},{x:M+g/2,y:X-G/2},{x:M+g/2,y:X-G/2+f},{x:M+h.width/2,y:X-G/2+f},{x:M+h.width/2/2,y:X+G/2},{x:M-h.width/2,y:X+G/2},{x:M-h.width/2,y:X-G/2+f},{x:M-g/2,y:X-G/2+f}],Dt.polygon(t,nt,O)},c}b(m5,"iconSquare");async function b5(e,t,{config:{flowchart:i}}){const r=new Image;r.src=t?.img??"",await r.decode();const s=Number(r.naturalWidth.toString().replace("px","")),o=Number(r.naturalHeight.toString().replace("px",""));t.imageAspectRatio=s/o;const{labelStyles:a}=jt(t);t.labelStyle=a;const n=i?.wrappingWidth;t.defaultWidth=i?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??s),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??o;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:u,label:p}=await ee(e,t,"image-shape default"),f=t.pos==="t",g=-c/2,m=-h/2,x=t.label?8:0,w=Nt.svg(d),S=Ot(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const A=w.rectangle(g,m,c,h,S),C=Math.max(c,u.width),E=h+u.height+x,z=w.rectangle(-C/2,-E/2,C,E,{...S,fill:"none",stroke:"none"}),R=d.insert(()=>A,":first-child"),V=d.insert(()=>z);if(t.img){const F=d.append("image");F.attr("href",t.img),F.attr("width",c),F.attr("height",h),F.attr("preserveAspectRatio","none"),F.attr("transform",`translate(${-c/2},${f?E/2-h:-E/2})`)}return p.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${f?-h/2-u.height/2-x/2:h/2-u.height/2+x/2})`),R.attr("transform",`translate(0,${f?u.height/2+x/2:-u.height/2-x/2})`),Yt(t,V),t.intersect=function(F){if(vt.info("iconSquare intersect",t,F),!t.label)return Dt.rect(t,F);const H=t.x??0,W=t.y??0,U=t.height??0;let D=[];return f?D=[{x:H-u.width/2,y:W-U/2},{x:H+u.width/2,y:W-U/2},{x:H+u.width/2,y:W-U/2+u.height+x},{x:H+c/2,y:W-U/2+u.height+x},{x:H+c/2,y:W+U/2},{x:H-c/2,y:W+U/2},{x:H-c/2,y:W-U/2+u.height+x},{x:H-u.width/2,y:W-U/2+u.height+x}]:D=[{x:H-c/2,y:W-U/2},{x:H+c/2,y:W-U/2},{x:H+c/2,y:W-U/2+h},{x:H+u.width/2,y:W-U/2+h},{x:H+u.width/2/2,y:W+U/2},{x:H-u.width/2,y:W+U/2},{x:H-u.width/2,y:W-U/2+h},{x:H-c/2,y:W-U/2+h}],Dt.polygon(t,D,F)},d}b(b5,"imageSquare");async function y5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=s,a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await ee(e,t,te(t)),c=Math.max(l.height+o*2,t.height??0),h=Math.max(l.width+a*2,(t.width??0)-c),d=[{x:0,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:-3*c/6,y:-c}];let u;const{cssStyles:p}=t;if(t.look==="handDrawn"){const f=Nt.svg(n),g=Ot(t,{}),m=Pe(d),x=f.path(m,g);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),p&&u.attr("style",p)}else u=to(n,h,c,d);return r&&u.attr("style",r),t.width=h,t.height=c,Yt(t,u),t.intersect=function(f){return Dt.polygon(t,d,f)},n}b(y5,"inv_trapezoid");async function x5(e,t){const{shapeSvg:i,bbox:r,label:s}=await ee(e,t,"label"),o=i.insert("rect",":first-child");return o.attr("width",.1).attr("height",.1),i.attr("class","label edgeLabel"),s.attr("transform",`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),Yt(t,o),t.intersect=function(l){return Dt.rect(t,l)},i}b(x5,"labelRect");async function v5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=s,a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await ee(e,t,te(t)),c=Math.max(l.height+o,t.height??0),h=Math.max(l.width+a,(t.width??0)-c),d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let u;const{cssStyles:p}=t;if(t.look==="handDrawn"){const f=Nt.svg(n),g=Ot(t,{}),m=Pe(d),x=f.path(m,g);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),p&&u.attr("style",p)}else u=to(n,h,c,d);return r&&u.attr("style",r),t.width=h,t.height=c,Yt(t,u),t.intersect=function(f){return Dt.polygon(t,d,f)},n}b(v5,"lean_left");async function w5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=s,a=t.look==="neo"?s*2:s,{shapeSvg:n,bbox:l}=await ee(e,t,te(t)),c=Math.max(l.height+o,t.height??0),h=Math.max(l.width+a,(t.width??0)-c),d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let u;const{cssStyles:p}=t;if(t.look==="handDrawn"){const f=Nt.svg(n),g=Ot(t,{}),m=Pe(d),x=f.path(m,g);u=n.insert(()=>x,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),p&&u.attr("style",p)}else u=to(n,h,c,d);return r&&u.attr("style",r),t.width=h,t.height=c,Yt(t,u),t.intersect=function(f){return Dt.polygon(t,d,f)},n}b(w5,"lean_right");function k5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.label="",t.labelStyle=i;const s=e.insert("g").attr("class",te(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,a=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:n+l/2},{x:a-2*l,y:n+l/2},{x:0,y:2*n},{x:a,y:n-l/2},{x:2*l,y:n-l/2}],h=Nt.svg(s),d=Ot(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=Pe(c),p=h.path(u,d),f=s.insert(()=>p,":first-child");return f.attr("class","outer-path"),o&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&f.selectAll("path").attr("style",r),f.attr("transform",`translate(-${a/2},${-n})`),Yt(t,f),t.intersect=function(g){return vt.info("lightningBolt intersect",t,g),Dt.polygon(t,c,g)},s}b(k5,"lightningBolt");var uO=b((e,t,i,r,s,o,a)=>[`M${e},${t+o}`,`a${s},${o} 0,0,0 ${i},0`,`a${s},${o} 0,0,0 ${-i},0`,`l0,${r}`,`a${s},${o} 0,0,0 ${i},0`,`l0,${-r}`,`M${e},${t+o+a}`,`a${s},${o} 0,0,0 ${i},0`].join(" "),"createCylinderPathD"),pO=b((e,t,i,r,s,o,a)=>[`M${e},${t+o}`,`M${e+i},${t+o}`,`a${s},${o} 0,0,0 ${-i},0`,`l0,${r}`,`a${s},${o} 0,0,0 ${i},0`,`l0,${-r}`,`M${e},${t+o+a}`,`a${s},${o} 0,0,0 ${i},0`].join(" "),"createOuterCylinderPathD"),fO=b((e,t,i,r,s,o)=>[`M${e-i/2},${-r/2}`,`a${s},${o} 0,0,0 ${i},0`].join(" "),"createInnerCylinderPathD"),Dv=10,Fv=10;async function S5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?24:s;if(t.width||t.height){const x=t.width??0;t.width=(t.width??0)-o,t.width<Fv&&(t.width=Fv);const S=x/2/(2.5+x/50);t.height=(t.height??0)-a-S*3,t.height<Dv&&(t.height=Dv)}const{shapeSvg:n,bbox:l,label:c}=await ee(e,t,te(t)),h=(t?.width?t?.width:l.width)+o*2,d=h/2,u=d/(2.5+h/50),p=(t?.height?t?.height:l.height)+u+a*2,f=p*.1;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const x=Nt.svg(n),w=pO(0,0,h,p,d,u,f),S=fO(0,u,h,p,d,u),A=Ot(t,{}),C=x.path(w,A),E=x.path(S,A);n.insert(()=>E,":first-child").attr("class","line"),g=n.insert(()=>C,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const x=uO(0,0,h,p,d,u,f);g=n.insert("path",":first-child").attr("d",x).attr("class","basic label-container outer-path").attr("style",wi(m)).attr("style",r)}return g.attr("label-offset-y",u),g.attr("transform",`translate(${-h/2}, ${-(p/2+u)})`),Yt(t,g),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+u-(l.y-(l.top??0))})`),t.intersect=function(x){const w=Dt.rect(t,x),S=w.x-(t.x??0);if(d!=0&&(Math.abs(S)<(t.width??0)/2||Math.abs(S)==(t.width??0)/2&&Math.abs(w.y-(t.y??0))>(t.height??0)/2-u)){let A=u*u*(1-S*S/(d*d));A>0&&(A=Math.sqrt(A)),A=u-A,x.y-(t.y??0)>0&&(A=-A),w.y+=A}return w},n}b(S5,"linedCylinder");async function C5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;if(t.width||t.height){const A=t.width;t.width=(A??0)*10/11-o*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await ee(e,t,te(t)),h=(t?.width?t?.width:l.width)+(o??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,u=t.look==="neo"?d/4:d/8,p=d+u,{cssStyles:f}=t,g=Nt.svg(n),m=Ot(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=[{x:-h/2-h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:p/2},...pa(-h/2-h/2*.1,p/2,h/2+h/2*.1,p/2,u,.8),{x:h/2+h/2*.1,y:-p/2},{x:-h/2-h/2*.1,y:-p/2},{x:-h/2,y:-p/2},{x:-h/2,y:p/2*1.1},{x:-h/2,y:-p/2}],w=g.polygon(x.map(A=>[A.x,A.y]),m),S=n.insert(()=>w,":first-child");return S.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",f),r&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",r),S.attr("transform",`translate(0,${-u/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-u-(l.y-(l.top??0))})`),Yt(t,S),t.intersect=function(A){return Dt.polygon(t,x,A)},n}b(C5,"linedWaveEdgedRect");var gO=56,$0=72,Ov=8,Nv=2,mO=8,bO={normal:"usecase-actor-shape usecase-actor-normal",hollow:"usecase-actor-hollow",awesome:"usecase-actor-awesome",icon:"usecase-actor-icon"},Wv=Math.PI/3,qv=.6,M0=b((e,t)=>{const i=t*qv,r=t*Math.sqrt(1-qv**2),s=Math.cos(Wv),o=-Math.sin(Wv),a=i*-o,n=e+i*s,l=r*s,c=r*o;return`M ${a-l} ${n-c} L ${a+l} ${n+c}`},"businessMarkerPathForCircle"),yO={normal:M0(-24,12),hollow:M0(-23,9),awesome:M0(-21,13),icon:"M 12 -8 L 26 -26"},Hv=b((e,t,i)=>{const r=(t.x??0)-(t.left??0),s=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-r},${i-t.height/2-s})`)},"positionLabel"),S1=b((e,t,i,r,s=!1)=>{if(t.look==="handDrawn"){const n=Nt.svg(e).path(i,Ot(t,s?{fill:"none"}:{}));return e.insert(()=>n,":first-child").attr("class",r)}const o=e.append("path").attr("class",r).attr("d",i);return s&&o.attr("fill","none"),o},"appendActorPath"),xO=b((e,t,i,r,s,o,a=!1)=>{if(t.look==="handDrawn"){const c=Nt.svg(e).circle(i,r,s*2,Ot(t,a?{fill:"none"}:{}));return e.insert(()=>c,":first-child").attr("class",o)}const n=e.append("circle").attr("class",o).attr("cx",i).attr("cy",r).attr("r",s);return a&&n.attr("fill","none"),n},"appendActorCircle"),vO=b((e,t,i)=>{t.business&&e.append("path").attr("class","usecase-business-marker usecase-actor-business-marker").attr("d",yO[i]).attr("fill","none").attr("style","stroke: inherit !important; stroke-width: inherit !important")},"appendBusinessActorMarker");async function Vc(e,t,i,r){const{labelStyles:s,nodeStyles:o}=jt(t);t.labelStyle=s;const a=i==="icon"||t.stereotype!==void 0?{...t,icon:i==="icon"?void 0:t.icon,stereotype:void 0}:t,{shapeSvg:n,bbox:l,label:c}=await ee(e,a,te(t,`usecase-actor-variant usecase-actor-${i}`)),h=t.accessibleName??t.label;h&&n.attr("role","img").attr("aria-label",h),c.attr("class","label actor-label usecase-actor-label");const{theme:d,themeVariables:u}=ye();ls(n,t.colorIndex,d,u.borderColorArray);let p,f;if(t.stereotype){const R=await Ha(n,`«${t.stereotype}»`,{labelStyle:s,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});p=R.label.attr("class","label usecase-stereotype"),f=R.bbox}const g=n.append("g").attr("class",`usecase-actor-glyph ${bO[i]}`).attr("style",o||null);await r(g,t),vO(g,t,i);const m=t.padding??mO,x=f?.height??0,w=$0+Ov+l.height+(f?x+Nv:0),S=Math.max(gO,l.width,f?.width??0)+m*2,A=w+m*2,C=-w/2;g.attr("transform",`translate(0,${C+$0/2})`);let E=C+$0+Ov;p&&f&&(E+=x/2,Hv(p,f,E),E+=x/2+Nv),Hv(c,l,E+l.height/2);const z=n.insert("rect",":first-child").attr("class","usecase-actor-outline").attr("x",-S/2).attr("y",-A/2).attr("width",S).attr("height",A).attr("opacity",0).attr("aria-hidden","true");return Yt(t,z),t.intersect=R=>Dt.rect(t,R),n}b(Vc,"renderUsecaseActor");var wO=["M 0 -12","C 6.627 -12 12 -17.373 12 -24","C 12 -30.627 6.627 -36 0 -36","C -6.627 -36 -12 -30.627 -12 -24","C -12 -17.373 -6.627 -12 0 -12 Z","M 0 -12 V 8","M -17 -5 H 17","M 0 8 L -15 28","M 0 8 L 15 28"].join(" ");async function T5(e,t){return Vc(e,t,"normal",(i,r)=>{S1(i,r,wO,"usecase-actor-stick")})}b(T5,"usecaseActor");var kO=["M 0 -34","C 7.18 -34 13 -28.18 13 -21","C 13 -13.82 7.18 -8 0 -8","C -7.18 -8 -13 -13.82 -13 -21","C -13 -28.18 -7.18 -34 0 -34 Z","M -24 25","C -24 7 -14 -3 0 -3","C 14 -3 24 7 24 25","C 24 28 21 30 18 30","H -18","C -21 30 -24 28 -24 25 Z"].join(" ");async function $5(e,t){return Vc(e,t,"awesome",(i,r)=>{S1(i,r,kO,"usecase-actor-awesome-silhouette")})}b($5,"usecaseActorAwesome");var SO=["M -22 -10","H 22","V 0","H 6","L 22 17","L 13 28","L 0 13","L -13 28","L -22 17","L -6 0","H -22","Z"].join(" ");async function M5(e,t){return Vc(e,t,"hollow",(i,r)=>{xO(i,r,0,-23,9,"usecase-actor-hollow-head",!0),S1(i,r,SO,"usecase-actor-hollow-body",!0)})}b(M5,"usecaseActorHollow");var fn=52,jv=42,Uv=-2,CO=b(async(e,t)=>{const i=-fn/2,r=Uv-fn/2;if(t.look==="handDrawn"){const h=Nt.svg(e).rectangle(i,r,fn,fn,Ot(t,{}));e.insert(()=>h,":first-child").attr("class","usecase-actor-icon-frame")}else e.append("rect").attr("class","usecase-actor-icon-frame").attr("x",i).attr("y",r).attr("width",fn).attr("height",fn).attr("rx",4).attr("ry",4);const s=t.icon??"",o=await zS(s.includes(":")?s:`fa:${s}`),a=await ml(s,{height:jv,width:jv,fallbackPrefix:"fa"}),n=e.append("g").attr("class",`usecase-actor-icon-symbol${o?"":" usecase-actor-icon-fallback"}`).attr("aria-hidden","true").html(`<g>${a}</g>`),l=n.node()?.getBBox();l&&n.attr("transform",`translate(${-l.width/2-l.x},${Uv-l.height/2-l.y})`)},"drawIconActor");async function A5(e,t){return Vc(e,t,"icon",CO)}b(A5,"usecaseActorIcon");var Yv=b((e,t,i)=>{const r=(t.x??0)-(t.left??0),s=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-r},${i-t.height/2-s})`)},"positionLabel");async function B5(e,t){const i=t,{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r;const o=i.stereotype?{...t,stereotype:void 0}:t,{shapeSvg:a,bbox:n,halfPadding:l,label:c}=await ee(e,o,te(t,"usecase-business-shape"));c.attr("class","label usecase-label");const{theme:h,themeVariables:d}=ye();ls(a,t.colorIndex,h,d.borderColorArray);let u,p;if(i.stereotype){const U=await Ha(a,`«${i.stereotype}»`,{labelStyle:r,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});u=U.label.attr("class","label usecase-stereotype"),p=U.bbox}const f=p?2:0,g=n.height+(p?.height??0)+f,m=Math.max(n.width,p?.width??0),x=l??10,w=m/2+x*2,S=g/2+x*2,A=Math.min(Math.max(x/5,1),x/2),C=m/2+A,E=w-A,z=C/w,R=E/w,V=S*Math.sqrt(Math.max(0,1-z*z)),F=-S*Math.sqrt(Math.max(0,1-R*R));u&&p&&Yv(u,p,-g/2+p.height/2),Yv(c,n,g/2-n.height/2);let H;if(t.look==="handDrawn"){const D=Nt.svg(a).ellipse(0,0,w*2,S*2,Ot(t,{}));H=a.insert(()=>D,":first-child").attr("class","basic label-container usecase-business-ellipse")}else H=a.insert("ellipse",":first-child").attr("class","basic label-container usecase-business-ellipse").attr("style",s).attr("rx",w).attr("ry",S).attr("cx",0).attr("cy",0);a.append("path").attr("class","usecase-business-marker").attr("d",`M ${C} ${V} L ${E} ${F}`).attr("fill","none").attr("style",s||null);const W=i.accessibleName??i.label;return W&&a.attr("role","img").attr("aria-label",W),Yt(t,H),t.calcIntersect=(U,D)=>Dt.ellipse(U,U.width/2,U.height/2,D),t.intersect=U=>Dt.ellipse(t,w,S,U),a}b(B5,"usecaseBusiness");var A0=8,Gv=4,TO=1,B0=b((e,t,i,r)=>{const s=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);e.attr("transform",`translate(${i-t.width/2-s},${r-t.height/2-o})`)},"positionLabel"),$O=b(e=>{const t=Number.parseFloat(e??"");return Number.isFinite(t)&&t>=0?t:TO},"numericStrokeWidth");async function _5(e,t){const i=t,{labelStyles:r,nodeStyles:s}=jt(t),{stylesMap:o}=va(t);t.labelStyle=r;const{shapeSvg:a,bbox:n,label:l}=await ee(e,t,te(t,"usecase-json-table"));a.attr("role","img"),i.accessibleName&&a.attr("aria-label",i.accessibleName),l.attr("class","label usecase-json-title");const c=a.append("g").attr("class","usecase-json-table-grid"),h=[];for(const U of i.jsonRows??[]){const D=await Ha(c,U.key,{labelStyle:r,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0}),O=await Ha(c,U.value,{labelStyle:r,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0});h.push({key:{label:D.label.attr("class","label usecase-json-key"),bbox:D.bbox},value:{label:O.label.attr("class","label usecase-json-value"),bbox:O.bbox}})}const d=Math.max(0,...h.map(({key:U})=>U.bbox.width))+A0*2,u=Math.max(0,...h.map(({value:U})=>U.bbox.width))+A0*2,p=n.width+A0*2,f=Math.max(p,d+u),g=u+Math.max(0,f-d-u),m=n.height+Gv*2,x=h.map(({key:U,value:D})=>Math.max(U.bbox.height,D.bbox.height)+Gv*2),w=m+x.reduce((U,D)=>U+D,0),S=$O(o.get("stroke-width")),A=f+S*2,C=w+S*2,E=-f/2,z=-w/2,R=t.look==="handDrawn"?Nt.svg(a):void 0,V=R?Ot(t,{}):void 0,F=b((U,D,O,M,X,G)=>{if(R&&V){const nt=R.rectangle(O,M,X,G,V);return U.insert(()=>nt,":first-child").attr("class",D)}return U.insert("rect",":first-child").attr("class",D).attr("x",O).attr("y",M).attr("width",X).attr("height",G).attr("style",s)},"insertCell"),H=F(a,"label-container usecase-json-border",-A/2,-C/2,A,C);F(c,"usecase-json-cell usecase-json-title-cell",E,z,f,m),c.node()?.append(l.node()),B0(l,n,0,z+m/2);let W=z+m;return h.forEach(({key:U,value:D},O)=>{const M=x[O],X=c.append("g").attr("class","usecase-json-row").attr("data-row-index",O).attr("transform",`translate(0,${W})`);F(X,"usecase-json-cell usecase-json-key-cell",E,0,d,M),F(X,"usecase-json-cell usecase-json-value-cell",E+d,0,g,M),X.node()?.append(U.label.node(),D.label.node()),B0(U.label,U.bbox,E+d/2,M/2),B0(D.label,D.bbox,E+d+g/2,M/2),W+=M}),Yt(t,H),t.intersect=U=>Dt.rect(t,U),a}b(_5,"usecaseJsonTable");async function L5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-2*n,10),t.height=Math.max((t?.height??0)-a*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await ee(e,t,te(t)),d=(t?.width?t?.width:c.width)+o*2+2*n,u=(t?.height?t?.height:c.height)+a*2+2*n,p=d-2*n,f=u-2*n,g=-p/2,m=-f/2,{cssStyles:x}=t,w=Nt.svg(l),S=Ot(t,{}),A=[{x:g-n,y:m+n},{x:g-n,y:m+f+n},{x:g+p-n,y:m+f+n},{x:g+p-n,y:m+f},{x:g+p,y:m+f},{x:g+p,y:m+f-n},{x:g+p+n,y:m+f-n},{x:g+p+n,y:m-n},{x:g+n,y:m-n},{x:g+n,y:m},{x:g,y:m},{x:g,y:m+n}],C=[{x:g,y:m+n},{x:g+p-n,y:m+n},{x:g+p-n,y:m+f},{x:g+p,y:m+f},{x:g+p,y:m},{x:g,y:m}];t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const E=Pe(A);let z=w.path(E,S);const R=Pe(C);let V=w.path(R,S);t.look!=="handDrawn"&&(z=Qf(z),V=Qf(V));const F=l.insert("g",":first-child");return F.insert(()=>z),F.insert(()=>V),F.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",x),r&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",r),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),Yt(t,F),t.intersect=function(H){return Dt.polygon(t,A,H)},l}b(L5,"multiRect");async function P5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const{shapeSvg:s,bbox:o,label:a}=await ee(e,t,te(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(o.width,t?.width??0)+l*2,u=Math.max(o.height,t?.height??0)+c*3,p=t.look==="neo"?u/4:u/8,f=u+(h?p/2:-p/2),g=-d/2,m=-f/2,x=10,{cssStyles:w}=t,S=pa(g-x,m+f+x,g+d-x,m+f+x,p,.8),A=S?.[S.length-1],C=[{x:g-x,y:m+x},{x:g-x,y:m+f+x},...S,{x:g+d-x,y:A.y-x},{x:g+d,y:A.y-x},{x:g+d,y:A.y-2*x},{x:g+d+x,y:A.y-2*x},{x:g+d+x,y:m-x},{x:g+x,y:m-x},{x:g+x,y:m},{x:g,y:m},{x:g,y:m+x}],E=[{x:g,y:m+x},{x:g+d-x,y:m+x},{x:g+d-x,y:A.y-x},{x:g+d,y:A.y-x},{x:g+d,y:m},{x:g,y:m}],z=Nt.svg(s),R=Ot(t,{});t.look!=="handDrawn"&&(R.roughness=0,R.fillStyle="solid");const V=Pe(C),F=z.path(V,R),H=Pe(E),W=z.path(H,R),U=s.insert(()=>F,":first-child");return U.insert(()=>W),U.attr("class","basic label-container outer-path"),w&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",w),r&&t.look!=="handDrawn"&&U.selectAll("path").attr("style",r),U.attr("transform",`translate(0,${-p/2})`),a.attr("transform",`translate(${-(o.width/2)-x-(o.x-(o.left??0))}, ${-(o.height/2)+x-p-(o.y-(o.top??0))})`),Yt(t,U),t.intersect=function(D){return Dt.polygon(t,C,D)},s}b(P5,"multiWaveEdgedRectangle");async function E5(e,t,{config:{themeVariables:i}}){const{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r,t.useHtmlLabels||Ni(ei())||(t.centerLabel=!0);const{shapeSvg:a,bbox:n,label:l}=await ee(e,t,te(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,u=-h/2,{cssStyles:p}=t,f=Nt.svg(a),g=Ot(t,{fill:i.noteBkgColor,stroke:i.noteBorderColor});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=f.rectangle(d,u,c,h,g),x=a.insert(()=>m,":first-child");return x.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),p&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",p),s&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",s),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Yt(t,x),t.intersect=function(w){return Dt.rect(t,w)},a}b(E5,"note");var MO=b((e,t,i)=>[`M${e+i/2},${t}`,`L${e+i},${t-i/2}`,`L${e+i/2},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function R5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const{shapeSvg:s,bbox:o}=await ee(e,t,te(t)),a=o.width+(t.padding??0),n=o.height+(t.padding??0),l=a+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const p=Nt.svg(s),f=Ot(t,{}),g=MO(0,0,l),m=p.path(g,f);d=s.insert(()=>m,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),u&&d.attr("style",u)}else d=to(s,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return r&&d.attr("style",r),Yt(t,d),t.calcIntersect=function(p,f){const g=p.width,m=[{x:g/2,y:0},{x:g,y:-g/2},{x:g/2,y:-g},{x:0,y:-g/2}];return Dt.polygon(p,m,f)},t.intersect=function(p){return this.calcIntersect(t,p)},s}b(R5,"question");async function I5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?21:s??0,a=t.look==="neo"?12:s??0,{shapeSvg:n,bbox:l,label:c}=await ee(e,t,te(t)),h=l.width+(t.look==="neo"?o*2:o),d=Math.max(l.height+(t.look==="neo"?a*2:a),t.height??0),u=d/4,f=-Math.max(h,(t.width??0)-u)/2,g=-d/2,m=g/2,x=[{x:f+m,y:g},{x:f,y:0},{x:f+m,y:-g},{x:-f,y:-g},{x:-f,y:g}],{cssStyles:w}=t,S=Nt.svg(n),A=Ot(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const C=Pe(x),E=S.path(C,A),z=n.insert(()=>E,":first-child");return z.attr("class","basic label-container outer-path"),w&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",w),r&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",r),z.attr("transform",`translate(${-m/2},0)`),c.attr("transform",`translate(${-m/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Yt(t,z),t.intersect=function(R){return Dt.polygon(t,x,R)},n}b(I5,"rect_left_inv_arrow");async function z5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;let s;t.cssClasses?s="node "+t.cssClasses:s="node default";const o=e.insert("g").attr("class",s).attr("id",t.domId||t.id),a=o.insert("g"),n=o.insert("g").attr("class","label").attr("style",r),l=t.description,c=t.label,h=await bo(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(Ni(ye())){const R=h.children[0],V=me(h);d=R.getBoundingClientRect(),V.attr("width",d.width),V.attr("height",d.height)}vt.info("Text 2",l);const u=l||[],p=h.getBBox(),f=await bo(n,Array.isArray(u)?u.join("<br/>"):u,t.labelStyle,!0,!0),g=f.children[0],m=me(f);d=g.getBoundingClientRect(),m.attr("width",d.width),m.attr("height",d.height);const x=(t.padding||0)/2;me(f).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+x+5)+")"),me(h).attr("transform","translate( "+(d.width<p.width?0:-(p.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-x+3)+")");const w=d.width+(t.padding||0),S=d.height+(t.padding||0),A=-d.width/2-x,C=-d.height/2-x;let E,z;if(t.look==="handDrawn"){const R=Nt.svg(o),V=Ot(t,{}),F=R.path(Hr(A,C,w,S,t.rx||0),V),H=R.line(-d.width/2-x,-d.height/2-x+p.height+x,d.width/2+x,-d.height/2-x+p.height+x,V);z=o.insert(()=>(vt.debug("Rough node insert CXC",F),H),":first-child"),E=o.insert(()=>(vt.debug("Rough node insert CXC",F),F),":first-child")}else E=a.insert("rect",":first-child"),z=a.insert("line"),E.attr("class","outer title-state").attr("style",r).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)),z.attr("class","divider").attr("x1",-d.width/2-x).attr("x2",d.width/2+x).attr("y1",-d.height/2-x+p.height+x).attr("y2",-d.height/2-x+p.height+x);return Yt(t,E),t.intersect=function(R){return Dt.rect(t,R)},o}b(z5,"rectWithTitle");async function D5(e,t,{config:{themeVariables:i}}){const r=i?.radius??5,s={rx:r,ry:r,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return bl(e,t,s)}b(D5,"roundedRect");var Aa=8;async function F5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.look==="neo"?16:t.padding??0,o=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:n,label:l}=await ee(e,t,te(t)),c=(t?.width??n.width)+s*2+(t.look==="neo"?Aa:Aa*2),h=(t?.height??n.height)+o*2,d=c-Aa,u=h,p=Aa-c/2,f=-h/2,{cssStyles:g}=t,m=Nt.svg(a),x=Ot(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const w=[{x:p,y:f},{x:p+d,y:f},{x:p+d,y:f+u},{x:p-Aa,y:f+u},{x:p-Aa,y:f},{x:p,y:f},{x:p,y:f+u}],S=m.polygon(w.map(C=>[C.x,C.y]),x),A=a.insert(()=>S,":first-child");return A.attr("class","basic label-container outer-path").attr("style",wi(g)),r&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",r),g&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",r),l.attr("transform",`translate(${Aa/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Yt(t,A),t.intersect=function(C){return Dt.rect(t,C)},a}b(F5,"shadedProcess");async function O5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:n,bbox:l,label:c}=await ee(e,t,te(t)),h=(t?.width?t?.width:l.width)+o*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,u=h,p=d/1.5,f=-u/2,g=-p/2,{cssStyles:m}=t,x=Nt.svg(n),w=Ot(t,{});t.look!=="handDrawn"&&(w.roughness=0,w.fillStyle="solid");const S=[{x:f,y:g},{x:f,y:g+p},{x:f+u,y:g+p},{x:f+u,y:g-p/2}],A=Pe(S),C=x.path(A,w),E=n.insert(()=>C,":first-child");return E.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&E.selectChildren("path").attr("style",m),r&&t.look!=="handDrawn"&&E.selectChildren("path").attr("style",r),E.attr("transform",`translate(0, ${p/4})`),c.attr("transform",`translate(${-u/2+(t.padding??0)-(l.x-(l.left??0))}, ${-p/4+(t.padding??0)-(l.y-(l.top??0))})`),Yt(t,E),t.intersect=function(z){return Dt.polygon(t,S,z)},n}b(O5,"slopedRect");async function N5(e,t){const i=t.padding??0,r=t.look==="neo"?16:i*2,s=t.look==="neo"?12:i,o={rx:0,ry:0,labelPaddingX:t.labelPaddingX??r,labelPaddingY:s},a=await bl(e,t,o);if(t.colorIndex!==void 0){const{theme:n,themeVariables:l}=ye();ls(a,t.colorIndex,n,l.borderColorArray)}return a}b(N5,"squareRect");var eg=50,AO=b((e,t,i)=>{const r=e.height+i,s=r*Math.cos(Math.PI/(2*(eg-1))),o=Math.sqrt(Math.max(0,s**2-e.height**2));return{w:Math.max(e.width+r/4+t,1.5*r+(r-s),e.width+t+r-o),h:r}},"stadiumDimensions");async function W5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?40:s,a=t.look==="neo"?24:s,{shapeSvg:n,bbox:l}=await ee(e,t,te(t)),{w:c,h}=AO(l,o,a),d=h/2,{cssStyles:u}=t,p=Nt.svg(n),f=Ot(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=[{x:-c/2+d,y:-h/2},{x:c/2-d,y:-h/2},...Os(-c/2+d,0,d,eg,90,270),{x:c/2-d,y:h/2},...Os(c/2-d,0,d,eg,270,450)],m=Pe(g),x=p.path(m,f),w=n.insert(()=>x,":first-child");return w.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",u),r&&t.look!=="handDrawn"&&w.selectChildren("path").attr("style",r),Yt(t,w),t.intersect=function(S){return Dt.polygon(t,g,S)},n}b(W5,"stadium");async function q5(e,t){const i={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return bl(e,t,i)}b(q5,"state");function H5(e,t,{config:{themeVariables:i}}){const{labelStyles:r,nodeStyles:s}=jt(t);t.labelStyle=r;const{cssStyles:o}=t,{lineColor:a,stateBorder:n,nodeBorder:l,nodeShadow:c}=i;(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=Nt.svg(h),u=Ot(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const p=d.circle(0,0,t.width,{...u,stroke:a,strokeWidth:2}),f=n??l,g=(t.width??0)*5/14,m=d.circle(0,0,g,{...u,fill:f,stroke:f,strokeWidth:2,fillStyle:"solid"}),x=h.insert(()=>p,":first-child");if(x.insert(()=>m),t.look!=="handDrawn"&&x.attr("class","outer-path"),o&&x.selectAll("path").attr("style",o),s&&x.selectAll("path").attr("style",s),t.width<25&&c&&t.look!=="handDrawn"){const w=e.node()?.ownerSVGElement?.id??"",S=w?`${w}-drop-shadow-small`:"drop-shadow-small";x.attr("style",`filter:url(#${S})`)}return Yt(t,x),t.intersect=function(w){return Dt.circle(t,(t.width??0)/2,w)},h}b(H5,"stateEnd");function j5(e,t,{config:{themeVariables:i}}){const{lineColor:r,nodeShadow:s}=i;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const o=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=Nt.svg(o).circle(0,0,t.width,fz(r));a=o.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=o.insert("circle",":first-child"),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&s&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return Yt(t,a),t.intersect=function(n){return Dt.circle(t,(t.width??7)/2,n)},o}b(j5,"stateStart");var gn=8;async function U5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t?.padding??8,o=t.look==="neo"?28:s,a=t.look==="neo"?12:s,{shapeSvg:n,bbox:l}=await ee(e,t,te(t)),c=Math.max(l.width+2*gn+o,t.width??0),h=Math.max(l.height+a,t.height??0),d=c-2*gn,u=h,p=-c/2,f=-h/2,g=[{x:0,y:0},{x:d,y:0},{x:d,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(t.look==="handDrawn"){const m=Nt.svg(n),x=Ot(t,{}),w=m.rectangle(p,f,d+16,u,x),S=m.line(p+gn,f,p+gn,f+u,x),A=m.line(p+gn+d,f,p+gn+d,f+u,x);n.insert(()=>S,":first-child"),n.insert(()=>A,":first-child");const C=n.insert(()=>w,":first-child"),{cssStyles:E}=t;C.attr("class","basic label-container").attr("style",wi(E)),Yt(t,C)}else{const m=to(n,d,u,g);r&&m.attr("style",r),Yt(t,m)}return t.intersect=function(m){return Dt.polygon(t,g,m)},n}b(U5,"subroutine");var _0=.2;async function Y5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const s=t.padding??0,o=t.look==="neo"?16:s,a=t.look==="neo"?12:s;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-o*2-_0*(t.height+a*2),10));const{shapeSvg:n,bbox:l}=await ee(e,t,te(t)),c=(t?.height?t?.height:l.height)+a*2,h=_0*c,d=_0*c,p=(t?.width?t?.width:l.width)+o*2+h-h,f=c,g=-p/2,m=-f/2,{cssStyles:x}=t,w=Nt.svg(n),S=Ot(t,{}),A=[{x:g-h/2,y:m},{x:g+p+h/2,y:m},{x:g+p+h/2,y:m+f},{x:g-h/2,y:m+f}],C=[{x:g+p-h/2,y:m+f},{x:g+p+h/2,y:m+f},{x:g+p+h/2,y:m+f-d}];t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const E=Pe(A),z=w.path(E,S),R=Pe(C),V=w.path(R,{...S,fillStyle:"solid"}),F=n.insert(()=>V,":first-child");return F.insert(()=>z,":first-child"),F.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",x),r&&t.look!=="handDrawn"&&F.selectAll("path").attr("style",r),Yt(t,F),t.intersect=function(H){return Dt.polygon(t,A,H)},n}b(Y5,"taggedRect");async function G5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const{shapeSvg:s,bbox:o,label:a}=await ee(e,t,te(t)),n=Math.max(o.width+(t.padding??0)*2,t?.width??0),l=Math.max(o.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,u=l+c,{cssStyles:p}=t,f=Nt.svg(s),g=Ot(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-n/2-n/2*.1,y:u/2},...pa(-n/2-n/2*.1,u/2,n/2+n/2*.1,u/2,c,.8),{x:n/2+n/2*.1,y:-u/2},{x:-n/2-n/2*.1,y:-u/2}],x=-n/2+n/2*.1,w=-u/2-d*.4,S=[{x:x+n-h,y:(w+l)*1.3},{x:x+n,y:w+l-d},{x:x+n,y:(w+l)*.9},...pa(x+n,(w+l)*1.25,x+n-h,(w+l)*1.3,-l*.02,.5)],A=Pe(m),C=f.path(A,g),E=Pe(S),z=f.path(E,{...g,fillStyle:"solid"}),R=s.insert(()=>z,":first-child");return R.insert(()=>C,":first-child"),R.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",p),r&&t.look!=="handDrawn"&&R.selectAll("path").attr("style",r),R.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-n/2+(t.padding??0)-(o.x-(o.left??0))},${-l/2+(t.padding??0)-c/2-(o.y-(o.top??0))})`),Yt(t,R),t.intersect=function(V){return Dt.polygon(t,m,V)},s}b(G5,"taggedWaveEdgedRectangle");async function X5(e,t){const{labelStyles:i,nodeStyles:r}=jt(t);t.labelStyle=i;const{shapeSvg:s,bbox:o}=await ee(e,t,te(t)),a=Math.max(o.width+(t.padding??0),t?.width||0),n=Math.max(o.height+(t.padding??0),t?.height||0),l=-a/2,c=-n/2,h=s.insert("rect",":first-child");return h.attr("class","text").attr("style",r).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",a).attr("height",n),Yt(t,h),t.intersect=function(d){return Dt.rect(t,d)},s}b(X5,"text");var BO=b((e,t,i,r,s,o)=>`M${e},${t}
1618
1618
  a${s},${o} 0,0,1 0,${-r}
1619
1619
  l${i},0
@@ -1674,7 +1674,7 @@ ${o.join(`
1674
1674
  h${-(l-2*h)}
1675
1675
  q${-h},0 ${-h},${-h}
1676
1676
  Z
1677
- `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const u=s.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",r).attr("d",d);return s.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),s.append(()=>n.node()),Yt(t,u),t.calcIntersect=function(p,f){return Dt.rect(p,f)},t.intersect=function(p){return Dt.rect(t,p)},s}b(l3,"defaultMindmapNode");async function c3(e,t){const i={padding:t.padding??0};return k1(e,t,i)}b(c3,"mindmapCircle");var RO=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:N5},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:D5},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:W5},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:U5},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:e5},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:i5},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:l5},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:OC},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:GC},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:HC},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:t5},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:k1},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:a3},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:n3},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:R5},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:d5},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:w5},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:v5},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:K5},{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:y5},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:s5},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:X5},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:jC},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:F5},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:j5},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:H5},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:c5},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:u5},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:KC},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:ZC},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:QC},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:k5},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:J5},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:h5},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:V5},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:S5},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:JC},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:r5},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Q5},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:e3},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:a5},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Z5},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:n5},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:O5},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:P5},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:L5},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:FC},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:VC},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:G5},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Y5},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:t3},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:I5},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:C5}],IO=b(()=>{const t=[...Object.entries({state:q5,choice:UC,note:E5,composite:YC,rectWithTitle:z5,labelRect:x5,block_arrow:qC,collapsedGroup:WC,iconSquare:m5,iconCircle:f5,icon:p5,iconRounded:g5,imageSquare:b5,anchor:zC,kanbanItem:o3,mindmapCircle:c3,defaultMindmapNode:l3,classBox:r3,erBox:C1,requirementBox:s3,usecaseActor:T5,usecaseActorHollow:M5,usecaseActorAwesome:$5,usecaseActorIcon:A5,usecaseBusiness:B5,usecaseEllipse:o5,usecaseJsonTable:_5}),...RO.flatMap(i=>[i.shortName,..."aliases"in i?i.aliases:[],..."internalAliases"in i?i.internalAliases:[]].map(s=>[s,i.handler]))];return Object.fromEntries(t)},"generateShapeMap"),h3=IO();function zO(e){return e in h3}b(zO,"isValidShape");var Kc=b(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,i=e?.subGraphTitleMargin?.bottom??0,r=t+i;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:i,subGraphTitleTotalMargin:r}},"getSubGraphTitleMargins"),Xu=new Map;async function d3(e,t,i){let r,s;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const o=t.shape?h3[t.shape]:void 0;if(!o)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;i.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),r=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),s=await o(r,t,i)}else s=await o(e,t,i),r=s;return r.attr("data-look",wi(t.look)),t.tooltip&&s.attr("title",t.tooltip),Xu.set(t.id,r),t.haveCallback&&r.attr("class",r.attr("class")+" clickable"),r}b(d3,"insertNode");var Jet=b((e,t)=>{Xu.set(t.id,e)},"setNodeElem"),tit=b(()=>{Xu.clear()},"clear"),eit=b(e=>{const t=Xu.get(e.id);vt.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const i=8,r=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+r-e.width/2)+", "+(e.y-e.height/2-i)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),r},"positionNode"),DO=b(async(e,t)=>{const i=ye(),{theme:r,themeVariables:s,handDrawnSeed:o}=i,{clusterBkg:a,clusterBorder:n,borderColorArray:l}=s,c=n,{labelStyles:h,nodeStyles:d,borderStyles:u,backgroundStyles:p}=jt(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);ls(f,t.colorIndex,r,l);const g=Qs(i.flowchart.htmlLabels),m=t.direction==="LR",x=f.insert("g").attr("class","cluster-label swimlane-label"),w=await qr(x,t.label,{style:t.labelStyle,useHtmlLabels:g,isNode:!0,width:t.width});let S=w.getBBox();if(g){const O=w.children[0],M=me(w);S=O.getBoundingClientRect(),M.attr("width",S.width),M.attr("height",S.height)}const A=t.padding??0,C=t.width<=S.width+A?S.width+A:t.width;t.width<=S.width+A?t.diff=(C-t.width)/2-A:t.diff=-A;const E=t.height,z=t.y-E/2,R=t.y+E/2,V=t.x-C/2,F=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:z+E/3,H=m?4:0,W=S.height+2*H;let U,D;if(m){const O=Math.max(W,S.height+2*H),M=V+O,X=Math.max(0,C-O);if(t.look==="handDrawn"){const Y=Nt.svg(f),ct=Ot(t,{roughness:.7,fill:a,stroke:c,seed:o}),dt=Ot(t,{roughness:.7,fill:"none",stroke:c,seed:o}),tt=Y.rectangle(V,z,O,E,ct);U=f.insert(()=>tt,":first-child").attr("class","swimlane-title");const mt=Y.rectangle(M,z,X,E,dt);D=f.insert(()=>mt,":first-child").attr("class","swimlane-body"),U.select("path:nth-child(2)").attr("style",u.join(";")),U.select("path").attr("style",p.join(";").replace("fill","stroke"))}else U=f.insert("rect",":first-child"),D=f.insert("rect",":first-child"),U.attr("class","swimlane-title").attr("style",d).attr("x",V).attr("y",z).attr("width",O).attr("height",E).attr("fill",a).attr("stroke",c),D.attr("class","swimlane-body").attr("style",d).attr("x",M).attr("y",z).attr("width",X).attr("height",E).attr("fill","none").attr("stroke",c);const G=V+O/2,nt=t.y;x.attr("transform",`translate(${G}, ${nt}) rotate(-90) translate(${-S.width/2}, ${-S.height/2})`)}else{const O=Math.max(0,F-z),M=Math.min(W,O),X=z+M,G=Math.max(0,R-X),nt=t.x-C/2;if(t.look==="handDrawn"){const dt=Nt.svg(f),tt=Ot(t,{roughness:.7,fill:a,stroke:c,fillWeight:3,seed:o}),mt=Ot(t,{roughness:.7,fill:"none",stroke:c,seed:o}),ft=dt.rectangle(nt,z,C,M,tt);U=f.insert(()=>ft,":first-child").attr("class","swimlane-title");const kt=dt.rectangle(nt,X,C,G,mt);D=f.insert(()=>kt,":first-child").attr("class","swimlane-body"),U.select("path:nth-child(2)").attr("style",u.join(";")),U.select("path").attr("style",p.join(";").replace("fill","stroke"))}else U=f.insert("rect",":first-child"),D=f.insert("rect",":first-child"),U.attr("class","swimlane-title").attr("style",d).attr("x",nt).attr("y",z).attr("width",C).attr("height",M).attr("fill",a).attr("stroke",c),D.attr("class","swimlane-body").attr("style",d).attr("x",nt).attr("y",X).attr("width",C).attr("height",G).attr("fill","none").attr("stroke",c);const Y=t.x-S.width/2,ct=z+(M-S.height)/2;x.attr("transform",`translate(${Y}, ${ct})`)}if(vt.trace("Swimlane data ",t,JSON.stringify(t)),h){const O=x.select("span");O&&O.attr("style",h)}return t.offsetX=0,t.width=C,t.height=E,t.offsetY=S.height-A/2,t.intersect=function(O){return _o(t,O)},{cluster:f,labelBBox:S}},"swimlane"),u3=b(async(e,t)=>{vt.info("Creating subgraph rect for ",t.id,t);const i=ye(),{theme:r,themeVariables:s,handDrawnSeed:o}=i,{clusterBkg:a,clusterBorder:n,borderColorArray:l}=s,{labelStyles:c,nodeStyles:h,borderStyles:d,backgroundStyles:u}=jt(t),p=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look);ls(p,t.colorIndex,r,l);const f=Ni(i),g=p.insert("g").attr("class","cluster-label ");let m;t.labelType==="markdown"?m=await qr(g,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):m=await bo(g,t.label,t.labelStyle||"",!1,!0);let x=m.getBBox();if(Ni(i)){const V=m.children[0],F=me(m);x=V.getBoundingClientRect(),F.attr("width",x.width),F.attr("height",x.height)}const w=t.width<=x.width+t.padding?x.width+t.padding:t.width;t.width<=x.width+t.padding?t.diff=(w-t.width)/2-t.padding:t.diff=-t.padding;const S=t.height,A=t.x-w/2,C=t.y-S/2;vt.trace("Data ",t,JSON.stringify(t));let E;if(t.look==="handDrawn"){const V=Nt.svg(p),F=Ot(t,{roughness:.7,fill:a,stroke:n,fillWeight:3,seed:o}),H=V.path(Hr(A,C,w,S,0),F);E=p.insert(()=>(vt.debug("Rough node insert CXC",H),H),":first-child"),E.select("path:nth-child(2)").attr("style",d.join(";")),E.select("path").attr("style",u.join(";").replace("fill","stroke"))}else E=p.insert("rect",":first-child"),E.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",A).attr("y",C).attr("width",w).attr("height",S);const{subGraphTitleTopMargin:z}=Kc(i);if(g.attr("transform",`translate(${t.x-x.width/2}, ${t.y-t.height/2+z})`),c){const V=g.select("span");V&&V.attr("style",c)}const R=E.node().getBBox();return t.offsetX=0,t.width=R.width,t.height=R.height,t.offsetY=x.height-t.padding/2,t.intersect=function(V){return _o(t,V)},{cluster:p,labelBBox:x}},"rect"),FO=b((e,t)=>{const i=e.insert("g").attr("class","note-cluster").attr("id",t.domId),r=i.insert("rect",":first-child"),s=0*t.padding,o=s/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2-o).attr("width",t.width+s).attr("height",t.height+s).attr("fill","none");const a=r.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return _o(t,n)},{cluster:i,labelBBox:{width:0,height:0}}},"noteGroup"),OO=b(async(e,t)=>{const i=ye(),{theme:r,themeVariables:s,handDrawnSeed:o}=i,{altBackground:a,borderColorArray:n,compositeBackground:l,compositeTitleBackground:c,nodeBorder:h}=s,d=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look);ls(d,t.colorIndex,r,n);const u=d.insert("g",":first-child"),p=d.insert("g").attr("class","cluster-label");let f=d.append("rect");const g=await bo(p,t.label,t.labelStyle,void 0,!0);let m=g.getBBox();if(Ni(i)){const H=g.children[0],W=me(g);m=H.getBoundingClientRect(),W.attr("width",m.width),W.attr("height",m.height)}const x=0*t.padding,w=x/2,S=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+x;t.width<=m.width+t.padding?t.diff=(S-t.width)/2-t.padding:t.diff=-t.padding;const A=t.height+x,C=t.height+x-m.height-6,E=t.x-S/2,z=t.y-A/2;t.width=S;const R=t.y-t.height/2-w+m.height+2;let V;if(t.look==="handDrawn"){const H=t.cssClasses.includes("statediagram-cluster-alt"),W=Nt.svg(d),U=t.rx||t.ry?W.path(Hr(E,z,S,A,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:h,seed:o}):W.rectangle(E,z,S,A,{seed:o});V=d.insert(()=>U,":first-child");const D=W.rectangle(E,R,S,C,{fill:H?a:l,fillStyle:H?"hachure":"solid",stroke:h,seed:o});V=d.insert(()=>U,":first-child"),f=d.insert(()=>D),V.attr("class","outer"),f.attr("class","inner")}else V=u.insert("rect",":first-child"),V.attr("class","outer").attr("x",E).attr("y",z).attr("width",S).attr("height",A).attr("data-look",t.look),f.attr("class","inner").attr("x",E).attr("y",R).attr("width",S).attr("height",C);p.attr("transform",`translate(${t.x-m.width/2}, ${z+1-(Ni(i)?0:3)})`);const F=V.node().getBBox();return t.height=F.height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function(H){return _o(t,H)},{cluster:d,labelBBox:m}},"roundedWithTitle"),NO=b(async(e,t)=>{vt.info("Creating subgraph rect for ",t.id,t);const i=ye(),{themeVariables:r,handDrawnSeed:s}=i,{clusterBkg:o,clusterBorder:a}=r,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=jt(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=Ni(i),p=d.insert("g").attr("class","cluster-label "),f=await qr(p,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let g=f.getBBox();if(Ni(i)){const z=f.children[0],R=me(f);g=z.getBoundingClientRect(),R.attr("width",g.width),R.attr("height",g.height)}const m=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(m-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,w=t.x-m/2,S=t.y-x/2;vt.trace("Data ",t,JSON.stringify(t));let A;if(t.look==="handDrawn"){const z=Nt.svg(d),R=Ot(t,{roughness:.7,fill:o,stroke:a,fillWeight:4,seed:s}),V=z.path(Hr(w,S,m,x,t.rx),R);A=d.insert(()=>(vt.debug("Rough node insert CXC",V),V),":first-child"),A.select("path:nth-child(2)").attr("style",c.join(";")),A.select("path").attr("style",h.join(";").replace("fill","stroke"))}else A=d.insert("rect",":first-child"),A.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",w).attr("y",S).attr("width",m).attr("height",x);const{subGraphTitleTopMargin:C}=Kc(i);if(p.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+C})`),n){const z=p.select("span");z&&z.attr("style",n)}const E=A.node().getBBox();return t.offsetX=0,t.width=E.width,t.height=E.height,t.offsetY=g.height-t.padding/2,t.intersect=function(z){return _o(t,z)},{cluster:d,labelBBox:g}},"kanbanSection"),WO=b((e,t)=>{const i=ye(),{theme:r,themeVariables:s,handDrawnSeed:o}=i,{altBackground:a,nodeBorder:n,borderColorArray:l}=s,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look);ls(c,t.colorIndex,r,l);const h=c.insert("g",":first-child"),d=0*t.padding,u=t.width+d;t.diff=-t.padding;const p=t.height+d,f=t.x-u/2,g=t.y-p/2;t.width=u;let m;if(t.look==="handDrawn"){const S=Nt.svg(c).rectangle(f,g,u,p,{fill:a??"#efefef",fillStyle:"solid",roughness:.5,strokeLineDash:[5],stroke:n,seed:o});m=c.insert(()=>S,":first-child").attr("class","divider")}else{m=h.insert("rect",":first-child");let w="outer";t.look,w="divider",m.attr("class",w).attr("x",f).attr("y",g).attr("width",u).attr("height",p).attr("data-look",t.look)}const x=m.node().getBBox();return t.height=x.height,t.offsetX=0,t.offsetY=0,t.intersect=function(w){return _o(t,w)},{cluster:c,labelBBox:{}}},"divider"),qO=b(async(e,t,i)=>{vt.info(`Creating ${i.cssClass} for `,t.id,t);const r=ye(),{theme:s,themeVariables:o,handDrawnSeed:a}=r,{borderColorArray:n}=o,{labelStyles:l,borderStyles:c}=jt(t),h=e.insert("g").attr("class","cluster "+i.cssClass+" "+t.cssClasses).attr("id",t.domId??t.id).attr("data-look",t.look);ls(h,t.colorIndex,s,n);const d=Ni(r),u=h.insert("g").attr("class","cluster-label");let p={width:0,height:0};const f=t.label?.trim();if(f){let C;if(t.labelType==="markdown"?C=await qr(u,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0,width:t.width}):C=await bo(u,t.label,t.labelStyle||"",!1,!0),p=C.getBBox(),d){const E=C.children[0],z=me(C);p=E.getBoundingClientRect(),z.attr("width",p.width),z.attr("height",p.height)}}const g=t.width<=p.width+t.padding?p.width+t.padding:t.width;t.width<=p.width+t.padding?t.diff=(g-t.width)/2-t.padding:t.diff=-t.padding;const m=t.height,x=t.x-g/2,w=t.y-m/2;let S;if(t.look==="handDrawn"){const C=Nt.svg(h),E=Ot(t,{roughness:i.roughness,fill:i.fill,stroke:i.stroke,strokeWidth:i.strokeWidth,seed:a,...i.fill==="none"?{fillWeight:0}:{fillStyle:"solid"},...i.strokeDash?{strokeLineDash:i.strokeDash}:{}}),z=C.path(Hr(x,w,g,m,i.rx),E);S=h.insert(()=>z,":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";"))}else S=h.insert("rect",":first-child"),S.attr("rx",i.rx).attr("ry",i.rx).attr("x",x).attr("y",w).attr("width",g).attr("height",m).attr("fill",i.fill).attr("stroke",i.stroke).attr("stroke-width",i.strokeWidth+"px"),i.strokeDash&&S.attr("stroke-dasharray",i.strokeDash.join(", "));if(f){const{subGraphTitleTopMargin:C}=Kc(r);if(u.attr("transform",`translate(${t.x-p.width/2}, ${t.y-t.height/2+C})`),l){const E=u.select("span");E&&E.attr("style",l)}}const A=S.node().getBBox();return t.offsetX=0,t.width=A.width,t.height=A.height,t.offsetY=p.height-t.padding/2,t.intersect=function(C){return _o(t,C)},{cluster:h,labelBBox:p}},"createContainerGroup"),HO=b(async(e,t)=>{const{themeVariables:i}=ye(),r=i.flowContainerStroke||i.secondaryBorderColor;return qO(e,t,{cssClass:"flow-cluster",rx:10,fill:"none",stroke:r,strokeWidth:.75,roughness:.7})},"flowGroup"),jO=b((e,t)=>{const i=e.boundaryType||"rect",r=i==="package"?20:e.padding,s=i==="package"?t.height+10:0,o=Math.max(e.width,t.width+r),a=i==="package"?Math.max(e.height,s+e.padding*2):e.height,n=e.x-o/2,l=e.y-a/2;return{boundaryType:i,width:o,height:a,x:n,y:l,bodyY:l+s,bodyHeight:a-s,tabHeight:s,tabWidth:i==="package"?Math.min(o,Math.max(80,t.width+20)):0}},"getUsecaseSystemBoundaryGeometry"),UO=b(async(e,t)=>{vt.info("Creating usecase system boundary for ",t.id,t);const i=ye(),{theme:r,themeVariables:s,handDrawnSeed:o}=i,{clusterBkg:a,clusterBorder:n,borderColorArray:l}=s,{labelStyles:c,nodeStyles:h}=jt(t),{stylesMap:d}=va(t),u=t.boundaryType||"rect",p=e.insert("g").attr("class",`cluster usecase-system-boundary usecase-system-boundary-${u} ${t.cssClasses}`).attr("id",typeof t.domId=="string"?t.domId:t.id).attr("data-boundary-type",u).attr("data-look",t.look);ls(p,t.colorIndex,r,l);const f=Ni(i),g=p.insert("g").attr("class","cluster-label system-boundary-title"),m=await qr(g,t.label,{style:c,useHtmlLabels:f,isNode:!0});let x=m.getBBox();if(f){const U=m.children[0],D=me(m);x=U.getBoundingClientRect(),D.attr("width",x.width),D.attr("height",x.height)}const w=jO(t,x),{width:S,height:A,x:C,y:E,bodyY:z,bodyHeight:R,tabHeight:V,tabWidth:F}=w;t.diff=t.width<=x.width+t.padding?(S-t.width)/2-t.padding:-t.padding;const H=Ot(t,{fill:d.get("fill")||a,stroke:d.get("stroke")||n,strokeWidth:d.get("stroke-width")?.replace("px","")||1,seed:o});if(t.look==="handDrawn"){const U=Nt.svg(p),D=U.rectangle(C,z,S,R,H);if(p.insert(()=>D,":first-child").attr("class","boundary-body label-container"),u==="package"){const O=U.rectangle(C,E,F,V,H);p.insert(()=>O,":first-child").attr("class","boundary-tab system-boundary-package-tab label-container")}}else p.insert("rect",":first-child").attr("class","boundary-body label-container").attr("style",h).attr("x",C).attr("y",z).attr("width",S).attr("height",R),u==="package"&&p.insert("rect",":first-child").attr("class","boundary-tab system-boundary-package-tab label-container").attr("style",h).attr("x",C).attr("y",E).attr("width",F).attr("height",V);const{subGraphTitleTopMargin:W}=Kc(i);return u==="package"?g.attr("transform",`translate(${C+(F-x.width)/2}, ${E+(V-x.height)/2})`):g.attr("transform",`translate(${t.x-x.width/2}, ${E+W})`),c&&(g.attr("style",c),g.select("span").attr("style",c)),t.offsetX=0,t.width=S,t.height=A,t.offsetY=x.height-t.padding/2,t.labelBBox=x,t.intersect=function(U){return _o(t,U)},{cluster:p,labelBBox:x}},"usecaseSystemBoundary"),YO=u3,GO={rect:u3,squareRect:YO,roundedWithTitle:OO,noteGroup:FO,divider:WO,kanbanSection:NO,flowGroup:HO,usecaseSystemBoundary:UO,swimlane:DO},XO=new Set(["noteGroup","divider"]),iit=b(e=>!XO.has(e??"rect"),"clusterPaintsTitle"),p3=new Map,VO=b(async(e,t)=>{const i=t.shape||"rect",r=await GO[i](e,t);return p3.set(t.id,r),r},"insertCluster"),rit=b(()=>{p3=new Map},"clear"),Ol=b((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const i=e.x??0,r=e.y??0;return"translate("+-(i+e.width/2)+", "+-(r+e.height/2)+")"},"computeLabelTransform"),Qi={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},Jv={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function ic(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=ti(e),t=ti(t);const[i,r]=[e.x,e.y],[s,o]=[t.x,t.y],a=s-i,n=o-r;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}b(ic,"calculateDeltaAndAngle");var ti=b(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),KO=b(e=>({x:b(function(t,i,r){let s=0;const o=ti(r[0]).x<ti(r[r.length-1]).x?"left":"right";if(i===0&&Object.hasOwn(Qi,e.arrowTypeStart)){const{angle:p,deltaX:f}=ic(r[0],r[1]);s=Qi[e.arrowTypeStart]*Math.cos(p)*(f>=0?1:-1)}else if(i===r.length-1&&Object.hasOwn(Qi,e.arrowTypeEnd)){const{angle:p,deltaX:f}=ic(r[r.length-1],r[r.length-2]);s=Qi[e.arrowTypeEnd]*Math.cos(p)*(f>=0?1:-1)}const a=Math.abs(ti(t).x-ti(r[r.length-1]).x),n=Math.abs(ti(t).y-ti(r[r.length-1]).y),l=Math.abs(ti(t).x-ti(r[0]).x),c=Math.abs(ti(t).y-ti(r[0]).y),h=Qi[e.arrowTypeStart],d=Qi[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let p=d+u-a;p*=o==="right"?-1:1,s-=p}if(l<h&&l>0&&c<h){let p=h+u-l;p*=o==="right"?-1:1,s+=p}return ti(t).x+s},"x"),y:b(function(t,i,r){let s=0;const o=ti(r[0]).y<ti(r[r.length-1]).y?"down":"up";if(i===0&&Object.hasOwn(Qi,e.arrowTypeStart)){const{angle:p,deltaY:f}=ic(r[0],r[1]);s=Qi[e.arrowTypeStart]*Math.abs(Math.sin(p))*(f>=0?1:-1)}else if(i===r.length-1&&Object.hasOwn(Qi,e.arrowTypeEnd)){const{angle:p,deltaY:f}=ic(r[r.length-1],r[r.length-2]);s=Qi[e.arrowTypeEnd]*Math.abs(Math.sin(p))*(f>=0?1:-1)}const a=Math.abs(ti(t).y-ti(r[r.length-1]).y),n=Math.abs(ti(t).x-ti(r[r.length-1]).x),l=Math.abs(ti(t).y-ti(r[0]).y),c=Math.abs(ti(t).x-ti(r[0]).x),h=Qi[e.arrowTypeStart],d=Qi[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let p=d+u-a;p*=o==="up"?-1:1,s-=p}if(l<h&&l>0&&c<h){let p=h+u-l;p*=o==="up"?-1:1,s+=p}return ti(t).y+s},"y")}),"getLineFunctionsWithOffset"),ZO=b((e,t,i,r,s,o=!1,a)=>{t.arrowTypeStart&&t2(e,"start",t.arrowTypeStart,i,r,s,o,a),t.arrowTypeEnd&&t2(e,"end",t.arrowTypeEnd,i,r,s,o,a)},"addEdgeMarkers"),QO={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},arrow_hierarchy:{type:"hierarchy",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}},JO=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],t2=b((e,t,i,r,s,o,a=!1,n)=>{if(!i||i==="none")return;const l=QO[i],c=l&&JO.includes(l.type);if(!l){vt.warn(`Unknown arrow type: ${i}`);return}const h=l.type,p=`${s}_${o}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const f=n.replace(/[^\dA-Za-z]/g,"_"),g=`${p}_${f}`;if(!document.getElementById(g)){const m=document.getElementById(p);if(m){const x=m.cloneNode(!0);x.id=g,x.querySelectorAll("path, circle, line").forEach(S=>{S.setAttribute("stroke",n),l.fill&&S.setAttribute("fill",n)}),m.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${r}#${g})`)}else e.attr(`marker-${t}`,`url(${r}#${p})`)},"addEdgeMarker"),tN=b(e=>typeof e=="string"?e:ye()?.flowchart?.curve,"resolveEdgeCurveType"),iu=new Map,Ui=new Map,sit=b(()=>{iu.clear(),Ui.clear()},"clear"),oit=b(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),Nl=b(e=>e?typeof e=="string"?e:e.reduce((t,i)=>t+";"+i,""):"","getLabelStyles"),eN=b(async(e,t)=>{const i=ye();let r=Ni(i);const{labelStyles:s}=jt(t);t.labelStyle=s;const o=e.insert("g").attr("class","edgeLabel"),a=o.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await qr(e,t.label,{style:Nl(t.labelStyle),useHtmlLabels:r,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},i);a.node().appendChild(c),vt.info("abc82",t,t.labelType);let h,d;if(r){const p=c.children[0],f=me(c);h=await Ka.measure(()=>p.getBoundingClientRect()),d=h,f.attr("width",h.width),f.attr("height",h.height)}else{const p=me(c).select("text").node();await Ka.measure(()=>{h=c.getBBox(),p&&typeof p.getBBox=="function"?d=p.getBBox():d=h})}a.attr("transform",Ol(d,r)),iu.set(t.id,o),t.width=h.width,t.height=h.height;let u;if(t.startLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),f=p.insert("g").attr("class","inner"),g=await bo(f,t.startLabelLeft,Nl(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(r){const x=g.children[0],w=me(g);m=x.getBoundingClientRect(),w.attr("width",m.width),w.attr("height",m.height)}f.attr("transform",Ol(m,r)),Ui.get(t.id)||Ui.set(t.id,{}),Ui.get(t.id).startLeft=p,rc(u,t.startLabelLeft)}if(t.startLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),f=p.insert("g").attr("class","inner"),g=await bo(f,t.startLabelRight,Nl(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(r){const x=g.children[0],w=me(g);m=x.getBoundingClientRect(),w.attr("width",m.width),w.attr("height",m.height)}f.attr("transform",Ol(m,r)),Ui.get(t.id)||Ui.set(t.id,{}),Ui.get(t.id).startRight=p,rc(u,t.startLabelRight)}if(t.endLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),f=p.insert("g").attr("class","inner"),g=await bo(p,t.endLabelLeft,Nl(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(r){const x=g.children[0],w=me(g);m=x.getBoundingClientRect(),w.attr("width",m.width),w.attr("height",m.height)}f.attr("transform",Ol(m,r)),Ui.get(t.id)||Ui.set(t.id,{}),Ui.get(t.id).endLeft=p,rc(u,t.endLabelLeft)}if(t.endLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),f=p.insert("g").attr("class","inner"),g=await bo(p,t.endLabelRight,Nl(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(r){const x=g.children[0],w=me(g);m=x.getBoundingClientRect(),w.attr("width",m.width),w.attr("height",m.height)}f.attr("transform",Ol(m,r)),Ui.get(t.id)||Ui.set(t.id,{}),Ui.get(t.id).endRight=p,rc(u,t.endLabelRight)}return c},"insertEdgeLabel");function rc(e,t){Ni(ye())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}b(rc,"setTerminalWidth");var iN=b((e,t)=>{vt.debug("Moving label abc88 ",e.id,e.label,iu.get(e.id),t);let i=t.updatedPath?t.updatedPath:t.originalPath;const r=ye(),{subGraphTitleTotalMargin:s}=Kc(r);if(e.label){const o=iu.get(e.id);let a=e.x,n=e.y;if(i){const l=xs.calcLabelPosition(i);vt.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}o.attr("transform",`translate(${a}, ${n+s/2})`)}if(e.startLabelLeft){const o=Ui.get(e.id).startLeft;let a=e.x,n=e.y;if(i){const l=xs.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",i);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const o=Ui.get(e.id).startRight;let a=e.x,n=e.y;if(i){const l=xs.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",i);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const o=Ui.get(e.id).endLeft;let a=e.x,n=e.y;if(i){const l=xs.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",i);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const o=Ui.get(e.id).endRight;let a=e.x,n=e.y;if(i){const l=xs.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",i);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),rN=b((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[i,r]=t,s=Math.abs(r.x-i.x),o=Math.abs(r.y-i.y);return s<.001||o<.001?t:o>=s?[i,{x:i.x,y:r.y},r]:[i,{x:r.x,y:i.y},r]},"orthogonalizeToLabelClippedPoints"),sN=b((e,t)=>{const i=e.x,r=e.y,s=Math.abs(t.x-i),o=Math.abs(t.y-r),a=e.width/2,n=e.height/2;return s>=a||o>=n},"outsideNode"),oN=b((e,t,i)=>{vt.debug(`intersection calc abc89:
1677
+ `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const u=s.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",r).attr("d",d);return s.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),s.append(()=>n.node()),Yt(t,u),t.calcIntersect=function(p,f){return Dt.rect(p,f)},t.intersect=function(p){return Dt.rect(t,p)},s}b(l3,"defaultMindmapNode");async function c3(e,t){const i={padding:t.padding??0};return k1(e,t,i)}b(c3,"mindmapCircle");var RO=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:N5},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:D5},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:W5},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:U5},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:e5},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:i5},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:l5},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:OC},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:GC},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:HC},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:t5},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:k1},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:a3},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:n3},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:R5},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:d5},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:w5},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:v5},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:K5},{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:y5},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:s5},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:X5},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:jC},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:F5},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:j5},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:H5},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:c5},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:u5},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:KC},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:ZC},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:QC},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:k5},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:J5},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:h5},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:V5},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:S5},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:JC},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:r5},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Q5},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:e3},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:a5},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Z5},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:n5},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:O5},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:P5},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:L5},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:FC},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:VC},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:G5},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:Y5},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:t3},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:I5},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:C5}],IO=b(()=>{const t=[...Object.entries({state:q5,choice:UC,note:E5,composite:YC,rectWithTitle:z5,labelRect:x5,block_arrow:qC,collapsedGroup:WC,iconSquare:m5,iconCircle:f5,icon:p5,iconRounded:g5,imageSquare:b5,anchor:zC,kanbanItem:o3,mindmapCircle:c3,defaultMindmapNode:l3,classBox:r3,erBox:C1,requirementBox:s3,usecaseActor:T5,usecaseActorHollow:M5,usecaseActorAwesome:$5,usecaseActorIcon:A5,usecaseBusiness:B5,usecaseEllipse:o5,usecaseJsonTable:_5}),...RO.flatMap(i=>[i.shortName,..."aliases"in i?i.aliases:[],..."internalAliases"in i?i.internalAliases:[]].map(s=>[s,i.handler]))];return Object.fromEntries(t)},"generateShapeMap"),h3=IO();function zO(e){return e in h3}b(zO,"isValidShape");var Kc=b(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,i=e?.subGraphTitleMargin?.bottom??0,r=t+i;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:i,subGraphTitleTotalMargin:r}},"getSubGraphTitleMargins"),Xu=new Map;async function d3(e,t,i){let r,s;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const o=t.shape?h3[t.shape]:void 0;if(!o)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;i.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),r=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),s=await o(r,t,i)}else s=await o(e,t,i),r=s;return r.attr("data-look",wi(t.look)),t.tooltip&&s.attr("title",t.tooltip),Xu.set(t.id,r),t.haveCallback&&r.attr("class",r.attr("class")+" clickable"),r}b(d3,"insertNode");var tit=b((e,t)=>{Xu.set(t.id,e)},"setNodeElem"),eit=b(()=>{Xu.clear()},"clear"),iit=b(e=>{const t=Xu.get(e.id);vt.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const i=8,r=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+r-e.width/2)+", "+(e.y-e.height/2-i)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),r},"positionNode"),DO=b(async(e,t)=>{const i=ye(),{theme:r,themeVariables:s,handDrawnSeed:o}=i,{clusterBkg:a,clusterBorder:n,borderColorArray:l}=s,c=n,{labelStyles:h,nodeStyles:d,borderStyles:u,backgroundStyles:p}=jt(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);ls(f,t.colorIndex,r,l);const g=Qs(i.flowchart.htmlLabels),m=t.direction==="LR",x=f.insert("g").attr("class","cluster-label swimlane-label"),w=await qr(x,t.label,{style:t.labelStyle,useHtmlLabels:g,isNode:!0,width:t.width});let S=w.getBBox();if(g){const O=w.children[0],M=me(w);S=O.getBoundingClientRect(),M.attr("width",S.width),M.attr("height",S.height)}const A=t.padding??0,C=t.width<=S.width+A?S.width+A:t.width;t.width<=S.width+A?t.diff=(C-t.width)/2-A:t.diff=-A;const E=t.height,z=t.y-E/2,R=t.y+E/2,V=t.x-C/2,F=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:z+E/3,H=m?4:0,W=S.height+2*H;let U,D;if(m){const O=Math.max(W,S.height+2*H),M=V+O,X=Math.max(0,C-O);if(t.look==="handDrawn"){const Y=Nt.svg(f),ct=Ot(t,{roughness:.7,fill:a,stroke:c,seed:o}),dt=Ot(t,{roughness:.7,fill:"none",stroke:c,seed:o}),tt=Y.rectangle(V,z,O,E,ct);U=f.insert(()=>tt,":first-child").attr("class","swimlane-title");const mt=Y.rectangle(M,z,X,E,dt);D=f.insert(()=>mt,":first-child").attr("class","swimlane-body"),U.select("path:nth-child(2)").attr("style",u.join(";")),U.select("path").attr("style",p.join(";").replace("fill","stroke"))}else U=f.insert("rect",":first-child"),D=f.insert("rect",":first-child"),U.attr("class","swimlane-title").attr("style",d).attr("x",V).attr("y",z).attr("width",O).attr("height",E).attr("fill",a).attr("stroke",c),D.attr("class","swimlane-body").attr("style",d).attr("x",M).attr("y",z).attr("width",X).attr("height",E).attr("fill","none").attr("stroke",c);const G=V+O/2,nt=t.y;x.attr("transform",`translate(${G}, ${nt}) rotate(-90) translate(${-S.width/2}, ${-S.height/2})`)}else{const O=Math.max(0,F-z),M=Math.min(W,O),X=z+M,G=Math.max(0,R-X),nt=t.x-C/2;if(t.look==="handDrawn"){const dt=Nt.svg(f),tt=Ot(t,{roughness:.7,fill:a,stroke:c,fillWeight:3,seed:o}),mt=Ot(t,{roughness:.7,fill:"none",stroke:c,seed:o}),ft=dt.rectangle(nt,z,C,M,tt);U=f.insert(()=>ft,":first-child").attr("class","swimlane-title");const kt=dt.rectangle(nt,X,C,G,mt);D=f.insert(()=>kt,":first-child").attr("class","swimlane-body"),U.select("path:nth-child(2)").attr("style",u.join(";")),U.select("path").attr("style",p.join(";").replace("fill","stroke"))}else U=f.insert("rect",":first-child"),D=f.insert("rect",":first-child"),U.attr("class","swimlane-title").attr("style",d).attr("x",nt).attr("y",z).attr("width",C).attr("height",M).attr("fill",a).attr("stroke",c),D.attr("class","swimlane-body").attr("style",d).attr("x",nt).attr("y",X).attr("width",C).attr("height",G).attr("fill","none").attr("stroke",c);const Y=t.x-S.width/2,ct=z+(M-S.height)/2;x.attr("transform",`translate(${Y}, ${ct})`)}if(vt.trace("Swimlane data ",t,JSON.stringify(t)),h){const O=x.select("span");O&&O.attr("style",h)}return t.offsetX=0,t.width=C,t.height=E,t.offsetY=S.height-A/2,t.intersect=function(O){return _o(t,O)},{cluster:f,labelBBox:S}},"swimlane"),u3=b(async(e,t)=>{vt.info("Creating subgraph rect for ",t.id,t);const i=ye(),{theme:r,themeVariables:s,handDrawnSeed:o}=i,{clusterBkg:a,clusterBorder:n,borderColorArray:l}=s,{labelStyles:c,nodeStyles:h,borderStyles:d,backgroundStyles:u}=jt(t),p=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look);ls(p,t.colorIndex,r,l);const f=Ni(i),g=p.insert("g").attr("class","cluster-label ");let m;t.labelType==="markdown"?m=await qr(g,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):m=await bo(g,t.label,t.labelStyle||"",!1,!0);let x=m.getBBox();if(Ni(i)){const V=m.children[0],F=me(m);x=V.getBoundingClientRect(),F.attr("width",x.width),F.attr("height",x.height)}const w=t.width<=x.width+t.padding?x.width+t.padding:t.width;t.width<=x.width+t.padding?t.diff=(w-t.width)/2-t.padding:t.diff=-t.padding;const S=t.height,A=t.x-w/2,C=t.y-S/2;vt.trace("Data ",t,JSON.stringify(t));let E;if(t.look==="handDrawn"){const V=Nt.svg(p),F=Ot(t,{roughness:.7,fill:a,stroke:n,fillWeight:3,seed:o}),H=V.path(Hr(A,C,w,S,0),F);E=p.insert(()=>(vt.debug("Rough node insert CXC",H),H),":first-child"),E.select("path:nth-child(2)").attr("style",d.join(";")),E.select("path").attr("style",u.join(";").replace("fill","stroke"))}else E=p.insert("rect",":first-child"),E.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",A).attr("y",C).attr("width",w).attr("height",S);const{subGraphTitleTopMargin:z}=Kc(i);if(g.attr("transform",`translate(${t.x-x.width/2}, ${t.y-t.height/2+z})`),c){const V=g.select("span");V&&V.attr("style",c)}const R=E.node().getBBox();return t.offsetX=0,t.width=R.width,t.height=R.height,t.offsetY=x.height-t.padding/2,t.intersect=function(V){return _o(t,V)},{cluster:p,labelBBox:x}},"rect"),FO=b((e,t)=>{const i=e.insert("g").attr("class","note-cluster").attr("id",t.domId),r=i.insert("rect",":first-child"),s=0*t.padding,o=s/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-o).attr("y",t.y-t.height/2-o).attr("width",t.width+s).attr("height",t.height+s).attr("fill","none");const a=r.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(n){return _o(t,n)},{cluster:i,labelBBox:{width:0,height:0}}},"noteGroup"),OO=b(async(e,t)=>{const i=ye(),{theme:r,themeVariables:s,handDrawnSeed:o}=i,{altBackground:a,borderColorArray:n,compositeBackground:l,compositeTitleBackground:c,nodeBorder:h}=s,d=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look);ls(d,t.colorIndex,r,n);const u=d.insert("g",":first-child"),p=d.insert("g").attr("class","cluster-label");let f=d.append("rect");const g=await bo(p,t.label,t.labelStyle,void 0,!0);let m=g.getBBox();if(Ni(i)){const H=g.children[0],W=me(g);m=H.getBoundingClientRect(),W.attr("width",m.width),W.attr("height",m.height)}const x=0*t.padding,w=x/2,S=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+x;t.width<=m.width+t.padding?t.diff=(S-t.width)/2-t.padding:t.diff=-t.padding;const A=t.height+x,C=t.height+x-m.height-6,E=t.x-S/2,z=t.y-A/2;t.width=S;const R=t.y-t.height/2-w+m.height+2;let V;if(t.look==="handDrawn"){const H=t.cssClasses.includes("statediagram-cluster-alt"),W=Nt.svg(d),U=t.rx||t.ry?W.path(Hr(E,z,S,A,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:h,seed:o}):W.rectangle(E,z,S,A,{seed:o});V=d.insert(()=>U,":first-child");const D=W.rectangle(E,R,S,C,{fill:H?a:l,fillStyle:H?"hachure":"solid",stroke:h,seed:o});V=d.insert(()=>U,":first-child"),f=d.insert(()=>D),V.attr("class","outer"),f.attr("class","inner")}else V=u.insert("rect",":first-child"),V.attr("class","outer").attr("x",E).attr("y",z).attr("width",S).attr("height",A).attr("data-look",t.look),f.attr("class","inner").attr("x",E).attr("y",R).attr("width",S).attr("height",C);p.attr("transform",`translate(${t.x-m.width/2}, ${z+1-(Ni(i)?0:3)})`);const F=V.node().getBBox();return t.height=F.height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function(H){return _o(t,H)},{cluster:d,labelBBox:m}},"roundedWithTitle"),NO=b(async(e,t)=>{vt.info("Creating subgraph rect for ",t.id,t);const i=ye(),{themeVariables:r,handDrawnSeed:s}=i,{clusterBkg:o,clusterBorder:a}=r,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=jt(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=Ni(i),p=d.insert("g").attr("class","cluster-label "),f=await qr(p,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let g=f.getBBox();if(Ni(i)){const z=f.children[0],R=me(f);g=z.getBoundingClientRect(),R.attr("width",g.width),R.attr("height",g.height)}const m=t.width<=g.width+t.padding?g.width+t.padding:t.width;t.width<=g.width+t.padding?t.diff=(m-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height,w=t.x-m/2,S=t.y-x/2;vt.trace("Data ",t,JSON.stringify(t));let A;if(t.look==="handDrawn"){const z=Nt.svg(d),R=Ot(t,{roughness:.7,fill:o,stroke:a,fillWeight:4,seed:s}),V=z.path(Hr(w,S,m,x,t.rx),R);A=d.insert(()=>(vt.debug("Rough node insert CXC",V),V),":first-child"),A.select("path:nth-child(2)").attr("style",c.join(";")),A.select("path").attr("style",h.join(";").replace("fill","stroke"))}else A=d.insert("rect",":first-child"),A.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",w).attr("y",S).attr("width",m).attr("height",x);const{subGraphTitleTopMargin:C}=Kc(i);if(p.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+C})`),n){const z=p.select("span");z&&z.attr("style",n)}const E=A.node().getBBox();return t.offsetX=0,t.width=E.width,t.height=E.height,t.offsetY=g.height-t.padding/2,t.intersect=function(z){return _o(t,z)},{cluster:d,labelBBox:g}},"kanbanSection"),WO=b((e,t)=>{const i=ye(),{theme:r,themeVariables:s,handDrawnSeed:o}=i,{altBackground:a,nodeBorder:n,borderColorArray:l}=s,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look);ls(c,t.colorIndex,r,l);const h=c.insert("g",":first-child"),d=0*t.padding,u=t.width+d;t.diff=-t.padding;const p=t.height+d,f=t.x-u/2,g=t.y-p/2;t.width=u;let m;if(t.look==="handDrawn"){const S=Nt.svg(c).rectangle(f,g,u,p,{fill:a??"#efefef",fillStyle:"solid",roughness:.5,strokeLineDash:[5],stroke:n,seed:o});m=c.insert(()=>S,":first-child").attr("class","divider")}else{m=h.insert("rect",":first-child");let w="outer";t.look,w="divider",m.attr("class",w).attr("x",f).attr("y",g).attr("width",u).attr("height",p).attr("data-look",t.look)}const x=m.node().getBBox();return t.height=x.height,t.offsetX=0,t.offsetY=0,t.intersect=function(w){return _o(t,w)},{cluster:c,labelBBox:{}}},"divider"),qO=b(async(e,t,i)=>{vt.info(`Creating ${i.cssClass} for `,t.id,t);const r=ye(),{theme:s,themeVariables:o,handDrawnSeed:a}=r,{borderColorArray:n}=o,{labelStyles:l,borderStyles:c}=jt(t),h=e.insert("g").attr("class","cluster "+i.cssClass+" "+t.cssClasses).attr("id",t.domId??t.id).attr("data-look",t.look);ls(h,t.colorIndex,s,n);const d=Ni(r),u=h.insert("g").attr("class","cluster-label");let p={width:0,height:0};const f=t.label?.trim();if(f){let C;if(t.labelType==="markdown"?C=await qr(u,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0,width:t.width}):C=await bo(u,t.label,t.labelStyle||"",!1,!0),p=C.getBBox(),d){const E=C.children[0],z=me(C);p=E.getBoundingClientRect(),z.attr("width",p.width),z.attr("height",p.height)}}const g=t.width<=p.width+t.padding?p.width+t.padding:t.width;t.width<=p.width+t.padding?t.diff=(g-t.width)/2-t.padding:t.diff=-t.padding;const m=t.height,x=t.x-g/2,w=t.y-m/2;let S;if(t.look==="handDrawn"){const C=Nt.svg(h),E=Ot(t,{roughness:i.roughness,fill:i.fill,stroke:i.stroke,strokeWidth:i.strokeWidth,seed:a,...i.fill==="none"?{fillWeight:0}:{fillStyle:"solid"},...i.strokeDash?{strokeLineDash:i.strokeDash}:{}}),z=C.path(Hr(x,w,g,m,i.rx),E);S=h.insert(()=>z,":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";"))}else S=h.insert("rect",":first-child"),S.attr("rx",i.rx).attr("ry",i.rx).attr("x",x).attr("y",w).attr("width",g).attr("height",m).attr("fill",i.fill).attr("stroke",i.stroke).attr("stroke-width",i.strokeWidth+"px"),i.strokeDash&&S.attr("stroke-dasharray",i.strokeDash.join(", "));if(f){const{subGraphTitleTopMargin:C}=Kc(r);if(u.attr("transform",`translate(${t.x-p.width/2}, ${t.y-t.height/2+C})`),l){const E=u.select("span");E&&E.attr("style",l)}}const A=S.node().getBBox();return t.offsetX=0,t.width=A.width,t.height=A.height,t.offsetY=p.height-t.padding/2,t.intersect=function(C){return _o(t,C)},{cluster:h,labelBBox:p}},"createContainerGroup"),HO=b(async(e,t)=>{const{themeVariables:i}=ye(),r=i.flowContainerStroke||i.secondaryBorderColor;return qO(e,t,{cssClass:"flow-cluster",rx:10,fill:"none",stroke:r,strokeWidth:.75,roughness:.7})},"flowGroup"),jO=b((e,t)=>{const i=e.boundaryType||"rect",r=i==="package"?20:e.padding,s=i==="package"?t.height+10:0,o=Math.max(e.width,t.width+r),a=i==="package"?Math.max(e.height,s+e.padding*2):e.height,n=e.x-o/2,l=e.y-a/2;return{boundaryType:i,width:o,height:a,x:n,y:l,bodyY:l+s,bodyHeight:a-s,tabHeight:s,tabWidth:i==="package"?Math.min(o,Math.max(80,t.width+20)):0}},"getUsecaseSystemBoundaryGeometry"),UO=b(async(e,t)=>{vt.info("Creating usecase system boundary for ",t.id,t);const i=ye(),{theme:r,themeVariables:s,handDrawnSeed:o}=i,{clusterBkg:a,clusterBorder:n,borderColorArray:l}=s,{labelStyles:c,nodeStyles:h}=jt(t),{stylesMap:d}=va(t),u=t.boundaryType||"rect",p=e.insert("g").attr("class",`cluster usecase-system-boundary usecase-system-boundary-${u} ${t.cssClasses}`).attr("id",typeof t.domId=="string"?t.domId:t.id).attr("data-boundary-type",u).attr("data-look",t.look);ls(p,t.colorIndex,r,l);const f=Ni(i),g=p.insert("g").attr("class","cluster-label system-boundary-title"),m=await qr(g,t.label,{style:c,useHtmlLabels:f,isNode:!0});let x=m.getBBox();if(f){const U=m.children[0],D=me(m);x=U.getBoundingClientRect(),D.attr("width",x.width),D.attr("height",x.height)}const w=jO(t,x),{width:S,height:A,x:C,y:E,bodyY:z,bodyHeight:R,tabHeight:V,tabWidth:F}=w;t.diff=t.width<=x.width+t.padding?(S-t.width)/2-t.padding:-t.padding;const H=Ot(t,{fill:d.get("fill")||a,stroke:d.get("stroke")||n,strokeWidth:d.get("stroke-width")?.replace("px","")||1,seed:o});if(t.look==="handDrawn"){const U=Nt.svg(p),D=U.rectangle(C,z,S,R,H);if(p.insert(()=>D,":first-child").attr("class","boundary-body label-container"),u==="package"){const O=U.rectangle(C,E,F,V,H);p.insert(()=>O,":first-child").attr("class","boundary-tab system-boundary-package-tab label-container")}}else p.insert("rect",":first-child").attr("class","boundary-body label-container").attr("style",h).attr("x",C).attr("y",z).attr("width",S).attr("height",R),u==="package"&&p.insert("rect",":first-child").attr("class","boundary-tab system-boundary-package-tab label-container").attr("style",h).attr("x",C).attr("y",E).attr("width",F).attr("height",V);const{subGraphTitleTopMargin:W}=Kc(i);return u==="package"?g.attr("transform",`translate(${C+(F-x.width)/2}, ${E+(V-x.height)/2})`):g.attr("transform",`translate(${t.x-x.width/2}, ${E+W})`),c&&(g.attr("style",c),g.select("span").attr("style",c)),t.offsetX=0,t.width=S,t.height=A,t.offsetY=x.height-t.padding/2,t.labelBBox=x,t.intersect=function(U){return _o(t,U)},{cluster:p,labelBBox:x}},"usecaseSystemBoundary"),YO=u3,GO={rect:u3,squareRect:YO,roundedWithTitle:OO,noteGroup:FO,divider:WO,kanbanSection:NO,flowGroup:HO,usecaseSystemBoundary:UO,swimlane:DO},XO=new Set(["noteGroup","divider"]),rit=b(e=>!XO.has(e??"rect"),"clusterPaintsTitle"),p3=new Map,VO=b(async(e,t)=>{const i=t.shape||"rect",r=await GO[i](e,t);return p3.set(t.id,r),r},"insertCluster"),sit=b(()=>{p3=new Map},"clear"),Ol=b((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const i=e.x??0,r=e.y??0;return"translate("+-(i+e.width/2)+", "+-(r+e.height/2)+")"},"computeLabelTransform"),Qi={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},Jv={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function ic(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=ti(e),t=ti(t);const[i,r]=[e.x,e.y],[s,o]=[t.x,t.y],a=s-i,n=o-r;return{angle:Math.atan(n/a),deltaX:a,deltaY:n}}b(ic,"calculateDeltaAndAngle");var ti=b(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),KO=b(e=>({x:b(function(t,i,r){let s=0;const o=ti(r[0]).x<ti(r[r.length-1]).x?"left":"right";if(i===0&&Object.hasOwn(Qi,e.arrowTypeStart)){const{angle:p,deltaX:f}=ic(r[0],r[1]);s=Qi[e.arrowTypeStart]*Math.cos(p)*(f>=0?1:-1)}else if(i===r.length-1&&Object.hasOwn(Qi,e.arrowTypeEnd)){const{angle:p,deltaX:f}=ic(r[r.length-1],r[r.length-2]);s=Qi[e.arrowTypeEnd]*Math.cos(p)*(f>=0?1:-1)}const a=Math.abs(ti(t).x-ti(r[r.length-1]).x),n=Math.abs(ti(t).y-ti(r[r.length-1]).y),l=Math.abs(ti(t).x-ti(r[0]).x),c=Math.abs(ti(t).y-ti(r[0]).y),h=Qi[e.arrowTypeStart],d=Qi[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let p=d+u-a;p*=o==="right"?-1:1,s-=p}if(l<h&&l>0&&c<h){let p=h+u-l;p*=o==="right"?-1:1,s+=p}return ti(t).x+s},"x"),y:b(function(t,i,r){let s=0;const o=ti(r[0]).y<ti(r[r.length-1]).y?"down":"up";if(i===0&&Object.hasOwn(Qi,e.arrowTypeStart)){const{angle:p,deltaY:f}=ic(r[0],r[1]);s=Qi[e.arrowTypeStart]*Math.abs(Math.sin(p))*(f>=0?1:-1)}else if(i===r.length-1&&Object.hasOwn(Qi,e.arrowTypeEnd)){const{angle:p,deltaY:f}=ic(r[r.length-1],r[r.length-2]);s=Qi[e.arrowTypeEnd]*Math.abs(Math.sin(p))*(f>=0?1:-1)}const a=Math.abs(ti(t).y-ti(r[r.length-1]).y),n=Math.abs(ti(t).x-ti(r[r.length-1]).x),l=Math.abs(ti(t).y-ti(r[0]).y),c=Math.abs(ti(t).x-ti(r[0]).x),h=Qi[e.arrowTypeStart],d=Qi[e.arrowTypeEnd],u=1;if(a<d&&a>0&&n<d){let p=d+u-a;p*=o==="up"?-1:1,s-=p}if(l<h&&l>0&&c<h){let p=h+u-l;p*=o==="up"?-1:1,s+=p}return ti(t).y+s},"y")}),"getLineFunctionsWithOffset"),ZO=b((e,t,i,r,s,o=!1,a)=>{t.arrowTypeStart&&t2(e,"start",t.arrowTypeStart,i,r,s,o,a),t.arrowTypeEnd&&t2(e,"end",t.arrowTypeEnd,i,r,s,o,a)},"addEdgeMarkers"),QO={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},arrow_hierarchy:{type:"hierarchy",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}},JO=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],t2=b((e,t,i,r,s,o,a=!1,n)=>{if(!i||i==="none")return;const l=QO[i],c=l&&JO.includes(l.type);if(!l){vt.warn(`Unknown arrow type: ${i}`);return}const h=l.type,p=`${s}_${o}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(n&&n.trim()!==""){const f=n.replace(/[^\dA-Za-z]/g,"_"),g=`${p}_${f}`;if(!document.getElementById(g)){const m=document.getElementById(p);if(m){const x=m.cloneNode(!0);x.id=g,x.querySelectorAll("path, circle, line").forEach(S=>{S.setAttribute("stroke",n),l.fill&&S.setAttribute("fill",n)}),m.parentNode?.appendChild(x)}}e.attr(`marker-${t}`,`url(${r}#${g})`)}else e.attr(`marker-${t}`,`url(${r}#${p})`)},"addEdgeMarker"),tN=b(e=>typeof e=="string"?e:ye()?.flowchart?.curve,"resolveEdgeCurveType"),iu=new Map,Ui=new Map,oit=b(()=>{iu.clear(),Ui.clear()},"clear"),ait=b(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),Nl=b(e=>e?typeof e=="string"?e:e.reduce((t,i)=>t+";"+i,""):"","getLabelStyles"),eN=b(async(e,t)=>{const i=ye();let r=Ni(i);const{labelStyles:s}=jt(t);t.labelStyle=s;const o=e.insert("g").attr("class","edgeLabel"),a=o.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await qr(e,t.label,{style:Nl(t.labelStyle),useHtmlLabels:r,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},i);a.node().appendChild(c),vt.info("abc82",t,t.labelType);let h,d;if(r){const p=c.children[0],f=me(c);h=await Ka.measure(()=>p.getBoundingClientRect()),d=h,f.attr("width",h.width),f.attr("height",h.height)}else{const p=me(c).select("text").node();await Ka.measure(()=>{h=c.getBBox(),p&&typeof p.getBBox=="function"?d=p.getBBox():d=h})}a.attr("transform",Ol(d,r)),iu.set(t.id,o),t.width=h.width,t.height=h.height;let u;if(t.startLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),f=p.insert("g").attr("class","inner"),g=await bo(f,t.startLabelLeft,Nl(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(r){const x=g.children[0],w=me(g);m=x.getBoundingClientRect(),w.attr("width",m.width),w.attr("height",m.height)}f.attr("transform",Ol(m,r)),Ui.get(t.id)||Ui.set(t.id,{}),Ui.get(t.id).startLeft=p,rc(u,t.startLabelLeft)}if(t.startLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),f=p.insert("g").attr("class","inner"),g=await bo(f,t.startLabelRight,Nl(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(r){const x=g.children[0],w=me(g);m=x.getBoundingClientRect(),w.attr("width",m.width),w.attr("height",m.height)}f.attr("transform",Ol(m,r)),Ui.get(t.id)||Ui.set(t.id,{}),Ui.get(t.id).startRight=p,rc(u,t.startLabelRight)}if(t.endLabelLeft){const p=e.insert("g").attr("class","edgeTerminals"),f=p.insert("g").attr("class","inner"),g=await bo(p,t.endLabelLeft,Nl(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(r){const x=g.children[0],w=me(g);m=x.getBoundingClientRect(),w.attr("width",m.width),w.attr("height",m.height)}f.attr("transform",Ol(m,r)),Ui.get(t.id)||Ui.set(t.id,{}),Ui.get(t.id).endLeft=p,rc(u,t.endLabelLeft)}if(t.endLabelRight){const p=e.insert("g").attr("class","edgeTerminals"),f=p.insert("g").attr("class","inner"),g=await bo(p,t.endLabelRight,Nl(t.labelStyle)||"",!1,!1);u=g;let m=g.getBBox();if(r){const x=g.children[0],w=me(g);m=x.getBoundingClientRect(),w.attr("width",m.width),w.attr("height",m.height)}f.attr("transform",Ol(m,r)),Ui.get(t.id)||Ui.set(t.id,{}),Ui.get(t.id).endRight=p,rc(u,t.endLabelRight)}return c},"insertEdgeLabel");function rc(e,t){Ni(ye())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}b(rc,"setTerminalWidth");var iN=b((e,t)=>{vt.debug("Moving label abc88 ",e.id,e.label,iu.get(e.id),t);let i=t.updatedPath?t.updatedPath:t.originalPath;const r=ye(),{subGraphTitleTotalMargin:s}=Kc(r);if(e.label){const o=iu.get(e.id);let a=e.x,n=e.y;if(i){const l=xs.calcLabelPosition(i);vt.debug("Moving label "+e.label+" from (",a,",",n,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,n=l.y)}o.attr("transform",`translate(${a}, ${n+s/2})`)}if(e.startLabelLeft){const o=Ui.get(e.id).startLeft;let a=e.x,n=e.y;if(i){const l=xs.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",i);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.startLabelRight){const o=Ui.get(e.id).startRight;let a=e.x,n=e.y;if(i){const l=xs.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",i);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelLeft){const o=Ui.get(e.id).endLeft;let a=e.x,n=e.y;if(i){const l=xs.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",i);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}if(e.endLabelRight){const o=Ui.get(e.id).endRight;let a=e.x,n=e.y;if(i){const l=xs.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",i);a=l.x,n=l.y}o.attr("transform",`translate(${a}, ${n})`)}},"positionEdgeLabel"),rN=b((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[i,r]=t,s=Math.abs(r.x-i.x),o=Math.abs(r.y-i.y);return s<.001||o<.001?t:o>=s?[i,{x:i.x,y:r.y},r]:[i,{x:r.x,y:i.y},r]},"orthogonalizeToLabelClippedPoints"),sN=b((e,t)=>{const i=e.x,r=e.y,s=Math.abs(t.x-i),o=Math.abs(t.y-r),a=e.width/2,n=e.height/2;return s>=a||o>=n},"outsideNode"),oN=b((e,t,i)=>{vt.debug(`intersection calc abc89:
1678
1678
  outsidePoint: ${JSON.stringify(t)}
1679
1679
  insidePoint : ${JSON.stringify(i)}
1680
1680
  node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const r=e.x,s=e.y,o=Math.abs(r-i.x),a=e.width/2;let n=i.x<t.x?a-o:a+o;const l=e.height/2,c=Math.abs(t.y-i.y),h=Math.abs(t.x-i.x);if(Math.abs(s-t.y)*a>Math.abs(r-t.x)*l){let d=i.y<t.y?t.y-l-s:s-l-t.y;n=h*d/c;const u={x:i.x<t.x?i.x+n:i.x-h+n,y:i.y<t.y?i.y+c-d:i.y-c+d};return n===0&&(u.x=t.x,u.y=t.y),h===0&&(u.x=t.x),c===0&&(u.y=t.y),vt.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${n}`,u),u}else{i.x<t.x?n=t.x-a-r:n=r-a-t.x;let d=c*n/h,u=i.x<t.x?i.x+h-n:i.x-h+n,p=i.y<t.y?i.y+d:i.y-d;return vt.debug(`sides calc abc89, Q ${c}, q ${d}, R ${h}, r ${n}`,{_x:u,_y:p}),n===0&&(u=t.x,p=t.y),h===0&&(u=t.x),c===0&&(p=t.y),{x:u,y:p}}},"intersection"),e2=b((e,t)=>{vt.warn("abc88 cutPathAtIntersect",e,t);let i=[],r=e[0],s=!1;return e.forEach(o=>{if(vt.info("abc88 checking point",o,t),!sN(t,o)&&!s){const a=oN(t,r,o);vt.debug("abc88 inside",o,r,a),vt.debug("abc88 intersection",a,t);let n=!1;i.forEach(l=>{n=n||l.x===a.x&&l.y===a.y}),i.some(l=>l.x===a.x&&l.y===a.y)?vt.warn("abc88 no intersect",a,i):i.push(a),s=!0}else vt.warn("abc88 outside",o,r),r=o,s||i.push(o)}),vt.debug("returning points",i),i},"cutPathAtIntersect");function f3(e){const t=[],i=[];for(let r=1;r<e.length-1;r++){const s=e[r-1],o=e[r],a=e[r+1];(s.x===o.x&&o.y===a.y&&Math.abs(o.x-a.x)>5&&Math.abs(o.y-s.y)>5||s.y===o.y&&o.x===a.x&&Math.abs(o.x-s.x)>5&&Math.abs(o.y-a.y)>5)&&(t.push(o),i.push(r))}return{cornerPoints:t,cornerPointPositions:i}}b(f3,"extractCornerPoints");var i2=b(function(e,t,i){const r=t.x-e.x,s=t.y-e.y,o=Math.sqrt(r*r+s*s),a=i/o;return{x:t.x-a*r,y:t.y-a*s}},"findAdjacentPoint"),aN=b(function(e){const{cornerPointPositions:t}=f3(e),i=[];for(let r=0;r<e.length;r++)if(t.includes(r)){const s=e[r-1],o=e[r+1],a=e[r],n=i2(s,a,5),l=i2(o,a,5),c=l.x-n.x,h=l.y-n.y;i.push(n);const d=Math.sqrt(2)*2;let u={x:a.x,y:a.y};if(Math.abs(o.x-s.x)>10&&Math.abs(o.y-s.y)>=10){vt.debug("Corner point fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));const p=5;a.x===n.x?u={x:c<0?n.x-p+d:n.x+p-d,y:h<0?n.y-d:n.y+d}:u={x:c<0?n.x-d:n.x+d,y:h<0?n.y-p+d:n.y+p-d}}else vt.debug("Corner point skipping fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));i.push(u,l)}else i.push(e[r]);return i},"fixCorners"),nN=b((e,t,i)=>{const r=e-t-i,s=2,o=2,a=s+o,n=Math.floor(r/a),l=Number.isFinite(n)?Math.max(0,n):0,c=Array(l).fill(`${s} ${o}`).join(" ");return`0 ${t} ${c} ${i}`},"generateDashArray"),lN=b(function(e,t,i,r,s,o,a,n=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=ye();let h=t.points,d=!1;const u=s;var p=o;const f=[];for(const G in t.cssCompiledStyles)PS(G)||f.push(t.cssCompiledStyles[G]);if(c==="swimlane"){if(p.intersect&&u.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[u.intersect(h[0]),p.intersect(h[1])];else{const G=h.slice(1,-1),nt=G[0],Y=G[G.length-1],ct=.5,dt=Math.abs(h[h.length-1].x-Y.x)<ct&&Math.abs(h[h.length-1].y-Y.y)<ct,tt=u.intersect(nt),mt=dt?Y:p.intersect(Y),ft=Math.abs(mt.x-Y.x)<ct&&Math.abs(mt.y-Y.y)<ct,j=Math.abs(tt.x-nt.x)<ct&&Math.abs(tt.y-nt.y)<ct?[]:[tt],ht=ft?[]:[mt];h=[...j,...G,...ht]}h=rN(t,h)}else p.intersect&&u.intersect&&!n&&(h=h.slice(1,t.points.length-1),h.unshift(u.intersect(h[0])),h.push(p.intersect(h[h.length-1])));const g=btoa(JSON.stringify(h));t.toCluster&&(vt.info("to cluster abc88",i.get(t.toCluster)),h=e2(t.points,i.get(t.toCluster).node),d=!0),t.fromCluster&&(vt.debug("from cluster abc88",i.get(t.fromCluster),JSON.stringify(h,null,2)),h=e2(h.reverse(),i.get(t.fromCluster).node).reverse(),d=!0);let m=h.filter(G=>!Number.isNaN(G.y));const x=tN(t.curve);x!=="rounded"&&(m=aN(m));let w=fc;switch(x){case"linear":w=fc;break;case"basis":w=Ff;break;case"cardinal":w=uS;break;case"bumpX":w=nS;break;case"bumpY":w=lS;break;case"catmullRom":w=fS;break;case"monotoneX":w=vS;break;case"monotoneY":w=wS;break;case"natural":w=SS;break;case"step":w=CS;break;case"stepAfter":w=$S;break;case"stepBefore":w=TS;break;case"rounded":w=fc;break;default:w=Ff}const{x:S,y:A}=KO(t),C=JI().x(S).y(A).curve(w);let E;switch(t.thickness){case"normal":E="edge-thickness-normal";break;case"thick":E="edge-thickness-thick";break;case"invisible":E="edge-thickness-invisible";break;default:E="edge-thickness-normal"}switch(t.pattern){case"solid":E+=" edge-pattern-solid";break;case"dotted":E+=" edge-pattern-dotted";break;case"dashed":E+=" edge-pattern-dashed";break;default:E+=" edge-pattern-solid"}let z,R=x==="rounded"?g3(m3(m,t),5):C(m);const V=Array.isArray(t.style)?t.style:[t.style];let F=V.find(G=>G?.startsWith("stroke:")),H="";t.animate&&(H="edge-animation-fast"),t.animation&&(H="edge-animation-"+t.animation);let W=!1;if(t.look==="handDrawn"){const G=Nt.svg(e);Object.assign([],m);const nt=G.path(R,{roughness:.3,seed:l});E+=" transition",z=me(nt).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+E+(t.classes?" "+t.classes:"")+(H?" "+H:"")).attr("style",V?V.reduce((ct,dt)=>ct+";"+dt,""):"");let Y=z.attr("d");z.attr("d",Y),e.node().appendChild(z.node())}else{const G=f.join(";"),nt=V?V.reduce((ft,kt)=>ft+kt+";",""):"",Y=(G?G+";"+nt+";":nt)+";"+(V?V.reduce((ft,kt)=>ft+";"+kt,""):"");z=e.append("path").attr("d",R).attr("id",`${a}-${t.id}`).attr("class"," "+E+(t.classes?" "+t.classes:"")+(H?" "+H:"")).attr("style",Y),F=Y.match(/stroke:([^;]+)/)?.[1],W=t.animate===!0||!!t.animation||G.includes("animation");const ct=z.node(),dt=typeof ct.getTotalLength=="function"?ct.getTotalLength():0,tt=Jv[t.arrowTypeStart]||0,mt=Jv[t.arrowTypeEnd]||0;if(t.look==="neo"&&!W){const kt=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?nN(dt,tt,mt):`0 ${tt} ${dt-tt-mt} ${mt}`}; stroke-dashoffset: 0;`;z.attr("style",kt+z.attr("style"))}}z.attr("data-edge",!0),z.attr("data-et","edge"),z.attr("data-id",t.id),z.attr("data-points",g),z.attr("data-look",wi(t.look)),t.showPoints&&m.forEach(G=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",G.x).attr("cy",G.y)});let U="";(ye().flowchart.arrowMarkerAbsolute||ye().state.arrowMarkerAbsolute)&&(U=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,U=U.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),vt.info("arrowTypeStart",t.arrowTypeStart),vt.info("arrowTypeEnd",t.arrowTypeEnd);const D=!W&&t?.look==="neo";ZO(z,t,U,a,r,D,F);const O=Math.floor(h.length/2),M=h[O];xs.isLabelCoordinateInPath(M,z.attr("d"))||(d=!0);let X={};return d&&(X.updatedPath=h),X.originalPath=t.points,X},"insertEdge");function g3(e,t){if(e.length<2)return"";let i="";const r=e.length,s=1e-5;for(let o=0;o<r;o++){const a=e[o],n=e[o-1],l=e[o+1];if(o===0)i+=`M${a.x},${a.y}`;else if(o===r-1)i+=`L${a.x},${a.y}`;else{const c=a.x-n.x,h=a.y-n.y,d=l.x-a.x,u=l.y-a.y,p=Math.hypot(c,h),f=Math.hypot(d,u);if(p<s||f<s){i+=`L${a.x},${a.y}`;continue}const g=c/p,m=h/p,x=d/f,w=u/f,S=g*x+m*w,A=Math.max(-1,Math.min(1,S)),C=Math.acos(A);if(C<s||Math.abs(Math.PI-C)<s){i+=`L${a.x},${a.y}`;continue}const E=Math.min(t/Math.sin(C/2),p/2,f/2),z=a.x-g*E,R=a.y-m*E,V=a.x+x*E,F=a.y+w*E;i+=`L${z},${R}`,i+=`Q${a.x},${a.y} ${V},${F}`}}return i}b(g3,"generateRoundedPath");function ig(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const i=t.x-e.x,r=t.y-e.y;return{angle:Math.atan2(r,i),deltaX:i,deltaY:r}}b(ig,"calculateDeltaAndAngle");function m3(e,t){const i=e.map(s=>({...s}));if(e.length>=2&&Qi[t.arrowTypeStart]){const s=Qi[t.arrowTypeStart],o=e[0],a=e[1],{angle:n}=ig(o,a),l=s*Math.cos(n),c=s*Math.sin(n);i[0].x=o.x+l,i[0].y=o.y+c}const r=e.length;if(r>=2&&Qi[t.arrowTypeEnd]){const s=Qi[t.arrowTypeEnd],o=e[r-1],a=e[r-2],{angle:n}=ig(a,o),l=s*Math.cos(n),c=s*Math.sin(n);i[r-1].x=o.x-l,i[r-1].y=o.y-c}return i}b(m3,"applyMarkerOffsetsToPoints");var cN=b((e,t,i,r)=>{t.forEach(s=>{EN[s](e,i,r)})},"insertMarkers"),hN=b((e,t,i)=>{vt.trace("Making markers for ",i),e.append("defs").append("marker").attr("id",i+"_"+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",i+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",i+"_"+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",i+"_"+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"),dN=b((e,t,i)=>{e.append("defs").append("marker").attr("id",i+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",i+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",i+"_"+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",i+"_"+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"),uN=b((e,t,i)=>{e.append("defs").append("marker").attr("id",i+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",i+"_"+t+"-aggregationEnd").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").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",i+"_"+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",i+"_"+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"),pN=b((e,t,i)=>{e.append("defs").append("marker").attr("id",i+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",i+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",i+"_"+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",i+"_"+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"),fN=b((e,t,i)=>{e.append("defs").append("marker").attr("id",i+"_"+t+"-lollipopStart").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),e.append("defs").append("marker").attr("id",i+"_"+t+"-lollipopEnd").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),e.append("defs").append("marker").attr("id",i+"_"+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",i+"_"+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"),gN=b((e,t,i)=>{e.append("marker").attr("id",i+"_"+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",i+"_"+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",i+"_"+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",i+"_"+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"),mN=b((e,t,i)=>{e.append("marker").attr("id",i+"_"+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",i+"_"+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",i+"_"+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",i+"_"+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"),bN=b((e,t,i)=>{e.append("marker").attr("id",i+"_"+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",i+"_"+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",i+"_"+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",i+"_"+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"),yN=b((e,t,i)=>{e.append("defs").append("marker").attr("id",i+"_"+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"),xN=b((e,t,i)=>{const r=ei(),{themeVariables:s}=r,{transitionColor:o}=s;e.append("defs").append("marker").attr("id",i+"_"+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",i+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${o}`)},"barbNeo"),vN=b((e,t,i)=>{e.append("defs").append("marker").attr("id",i+"_"+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",i+"_"+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"),wN=b((e,t,i)=>{const r=e.append("defs").append("marker").attr("id",i+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),r.append("path").attr("d","M9,0 L9,18");const s=e.append("defs").append("marker").attr("id",i+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),s.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),kN=b((e,t,i)=>{e.append("defs").append("marker").attr("id",i+"_"+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",i+"_"+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"),SN=b((e,t,i)=>{const r=e.append("defs").append("marker").attr("id",i+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");r.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),r.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const s=e.append("defs").append("marker").attr("id",i+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),s.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),CN=b((e,t,i)=>{const r=ei(),{themeVariables:s}=r,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",i+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${o}`),e.append("defs").append("marker").attr("id",i+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${o}`)},"only_one_neo"),TN=b((e,t,i)=>{const r=ei(),{themeVariables:s}=r,{strokeWidth:o,mainBkg:a}=s,n=e.append("defs").append("marker").attr("id",i+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${o}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${o}`);const l=e.append("defs").append("marker").attr("id",i+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${o}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${o}`)},"zero_or_one_neo"),$N=b((e,t,i)=>{const r=ei(),{themeVariables:s}=r,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",i+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${o}`),e.append("defs").append("marker").attr("id",i+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${o}`)},"one_or_more_neo"),MN=b((e,t,i)=>{const r=ei(),{themeVariables:s}=r,{strokeWidth:o,mainBkg:a}=s,n=e.append("defs").append("marker").attr("id",i+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${o}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${o}`);const l=e.append("defs").append("marker").attr("id",i+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${o}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${o}`)},"zero_or_more_neo"),AN=b((e,t,i)=>{e.append("defs").append("marker").attr("id",i+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
@@ -1683,8 +1683,8 @@ ${o.join(`
1683
1683
  L0,20`)},"requirement_arrow"),BN=b((e,t,i)=>{const r=ei(),{themeVariables:s}=r,{strokeWidth:o}=s;e.append("defs").append("marker").attr("id",i+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
1684
1684
  L20,10
1685
1685
  M20,10
1686
- L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),_N=b((e,t,i)=>{const r=e.append("defs").append("marker").attr("id",i+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),LN=b((e,t,i)=>{const r=ei(),{themeVariables:s}=r,{strokeWidth:o}=s,a=e.append("defs").append("marker").attr("id",i+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),PN=b((e,t,i)=>{e.append("marker").attr("id",i+"_"+t+"-hierarchyEnd").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",i+"_"+t+"-hierarchyStart").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none")},"hierarchy"),EN={extension:hN,composition:dN,aggregation:uN,dependency:pN,lollipop:fN,point:gN,circle:mN,cross:bN,barb:yN,barbNeo:xN,hierarchy:PN,only_one:vN,zero_or_one:wN,one_or_more:kN,zero_or_more:SN,only_one_neo:CN,zero_or_one_neo:TN,one_or_more_neo:$N,zero_or_more_neo:MN,requirement_arrow:AN,requirement_contains:_N,requirement_arrow_neo:BN,requirement_contains_neo:LN},RN=cN,IN={common:Hc,getConfig:ei,insertCluster:VO,insertEdge:lN,insertEdgeLabel:eN,insertMarkers:RN,insertNode:d3,interpolateToCurve:t1,labelHelper:ee,log:vt,positionEdgeLabel:iN},zN=["elk.stress","elk.force","elk.mrtree","elk.sporeOverlap","elk.box","elk.rectpacking"],Bc=Object.create(null),b3=b(e=>{for(const t of e)Bc[t.name]=t},"registerLayoutLoaders"),DN=b(()=>{const e=b(async()=>await xe(()=>import("./elk-276RUBZZ-OZ3Zw5zt.js"),__vite__mapDeps([0,1,2,3,4,5])),"loader");return[{name:"elk",loader:e,algorithm:"elk.layered"},...zN.map(t=>({name:t,loader:e,algorithm:t}))]},"elkLayoutLoaders"),FN=b(()=>{b3([{name:"dagre",loader:b(async()=>await xe(()=>import("./dagre-6A5THRUB-qquzH4Ev.js"),__vite__mapDeps([6,2,3,4,5])),"loader")},{name:"swimlane",loader:b(async()=>await xe(()=>import("./swimlanes-2SLR337P-CBONvDhF.js"),__vite__mapDeps([7,1,2,3,4,5])),"loader")},{name:"cose-bilkent",loader:b(async()=>await xe(()=>import("./cose-bilkent-JH36ORCC-CBJJYOd5.js"),__vite__mapDeps([8,9,4,5])),"loader")},...DN()])},"registerDefaultLayoutLoaders");FN();var ait=b(async(e,t)=>{if(!Object.hasOwn(Bc,e.layoutAlgorithm))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const s of e.nodes){const o=s.domId||s.id;s.domId=`${e.diagramId}-${o}`}const i=Bc[e.layoutAlgorithm],r=await i.loader();return pz(t,e.config),r.render(e,t,IN,{algorithm:i.algorithm})},"render"),L0="dagre",nit=b((e="",{fallback:t=L0}={})=>{if(Object.hasOwn(Bc,e))return e;for(const i of[t,L0])if(Object.hasOwn(Bc,i))return vt.warn(`Layout algorithm ${e} is not registered. Using ${i} as fallback.`),i;throw new Error(`Neither layout algorithm ${e}, ${t}, nor ${L0} is registered.`)},"getRegisteredLayoutAlgorithm"),T1="comm",y3="rule",x3="decl",ON="@media",NN="@import",WN="@supports",qN="@namespace",rg="@keyframes",v3="@layer",HN="@scope",jN=Math.abs,mc=String.fromCharCode;function w3(e){return e.trim()}function sg(e,t,i){return e.replace(t,i)}function Rn(e,t){return e.charCodeAt(t)|0}function rl(e,t,i){return e.slice(t,i)}function Ds(e){return e.length}function k3(e){return e.length}function $h(e,t){return t.push(e),e}var Vu=1,sl=1,S3=0,is=0,bi=0,yl="";function $1(e,t,i,r,s,o,a,n){return{value:e,root:t,parent:i,type:r,props:s,children:o,line:Vu,column:sl,length:a,return:"",siblings:n}}function UN(){return bi}function YN(){return bi=is>0?Rn(yl,--is):0,sl--,bi===10&&(sl=1,Vu--),bi}function ws(){return bi=is<S3?Rn(yl,is++):0,sl++,bi===10&&(sl=1,Vu++),bi}function ia(){return Rn(yl,is)}function hd(){return is}function Ku(e,t){return rl(yl,e,t)}function _c(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 GN(e){return Vu=sl=1,S3=Ds(yl=e),is=0,[]}function XN(e){return yl="",e}function P0(e){return w3(Ku(is-1,og(e===91?e+2:e===40?e+1:e)))}function VN(e){for(;(bi=ia())&&bi<33;)ws();return _c(e)>2||_c(bi)>3?"":" "}function KN(e,t){for(;--t&&ws()&&!(bi<48||bi>102||bi>57&&bi<65||bi>70&&bi<97););return Ku(e,hd()+(t<6&&ia()==32&&ws()==32))}function og(e){for(;ws();)switch(bi){case e:return is;case 34:case 39:e!==34&&e!==39&&og(bi);break;case 40:e===41&&og(e);break;case 92:ws();break}return is}function ZN(e,t){for(;ws()&&e+bi!==57;)if(e+bi===84&&ia()===47)break;return"/*"+Ku(t,is-1)+"*"+mc(e===47?e:ws())}function QN(e){for(;!_c(ia());)ws();return Ku(e,is)}function JN(e){return XN(dd("",null,null,null,[""],e=GN(e),0,[0],e))}function dd(e,t,i,r,s,o,a,n,l){for(var c=0,h=0,d=a,u=0,p=0,f=0,g=1,m=1,x=1,w=0,S=0,A="",C=s,E=o,z=r,R=A;m;)switch(f=S,S=ws()){case 40:f!=108&&Rn(R,d-1)==58?(w++,R+="("):R+=P0(S);break;case 41:w--,R+=")";break;case 34:case 39:case 91:R+=P0(S);break;case 9:case 10:case 13:case 32:if(w>0){R+=mc(S);break}R+=VN(f);break;case 92:R+=KN(hd()-1,7);continue;case 47:switch(ia()){case 42:case 47:$h(tW(ZN(ws(),hd()),t,i,l),l),(_c(f||1)==5||_c(ia()||1)==5)&&Ds(R)&&rl(R,-1,void 0)!==" "&&(R+=" ");break;default:R+="/"}break;case 123*g:n[c++]=Ds(R)*x;case 125*g:case 59:case 0:if(w>0&&S){R+=mc(S);break}switch(S){case 0:case 125:m=0;case 59+h:x==-1&&(R=sg(R,/\f/g,"")),p>0&&(Ds(R)-d||g===0)&&$h(p>32?s2(R+";",r,i,d-1,l):s2(sg(R," ","")+";",r,i,d-2,l),l);break;case 59:R+=";";default:if($h(z=r2(R,t,i,c,h,s,n,A,C=[],E=[],d,o),o),S===123)if(h===0)dd(R,t,z,z,C,o,d,n,E);else{switch(u){case 99:if(Rn(R,3)===110)break;case 108:if(Rn(R,2)===97)break;default:h=0;case 100:case 109:case 115:}h?dd(e,z,z,r&&$h(r2(e,z,z,0,0,s,n,A,s,C=[],d,E),E),s,E,d,n,r?C:E):dd(R,z,z,z,[""],E,0,n,E)}}c=h=p=0,g=x=1,A=R="",d=a;break;case 58:d=1+Ds(R),p=f;default:if(g<1){if(S==123)--g;else if(S==125&&g++==0&&YN()==125)continue}switch(R+=mc(S),S*g){case 38:x=h>0?1:(R+="\f",-1);break;case 44:if(w>0)break;n[c++]=(Ds(R)-1)*x,x=1;break;case 64:ia()===45&&(R+=P0(ws())),u=ia(),h=d=Ds(A=R+=QN(hd())),S++;break;case 45:f===45&&Ds(R)==2&&(g=0)}}return o}function r2(e,t,i,r,s,o,a,n,l,c,h,d){for(var u=s-1,p=s===0?o:[""],f=k3(p),g=0,m=0,x=0;g<r;++g)for(var w=0,S=rl(e,u+1,u=jN(m=a[g])),A=e;w<f;++w)(A=w3(m>0?p[w]+" "+S:sg(S,/&\f/g,p[w])))&&(l[x++]=A);return $1(e,t,i,s===0?y3:n,l,c,h,d)}function tW(e,t,i,r){return $1(e,t,i,T1,mc(UN()),rl(e,2,-2),0,r)}function s2(e,t,i,r,s){return $1(e,t,i,x3,rl(e,0,r),rl(e,r+1,-1),r,s)}function ag(e,t){for(var i="",r=0;r<e.length;r++)i+=t(e[r],r,e,t)||"";return i}function eW(e,t,i,r){switch(e.type){case v3:if(e.children.length)break;case NN:case qN:case x3:return e.return=e.return||e.value;case T1:return"";case rg:return e.return=e.value+"{"+ag(e.children,r)+"}";case y3:if(!Ds(e.value=e.props.join(",")))return""}return Ds(i=ag(e.children,r))?e.return=e.value+"{"+i+"}":""}function iW(e){var t=k3(e);return function(i,r,s,o){for(var a="",n=0;n<t;n++)a+=e[n](i,r,s,o)||"";return a}}var C3="c4",rW=b(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),sW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./c4Diagram-YGBWAQC7-ZicrYBFE.js");return{diagram:t}},__vite__mapDeps([10,11,4,5]));return{id:C3,diagram:e}},"loader"),oW={id:C3,detector:rW,loader:sW},aW=oW,T3="flowchart-v2",nW=b(e=>/^\s*(graph|flowchart)/.test(e),"detector"),lW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./flowDiagram-KWPJA3E3-CYfjFu_3.js").then(i=>i.f);return{diagram:t}},__vite__mapDeps([12,13,14,15,11,16]));return{id:T3,diagram:e}},"loader"),cW={id:T3,detector:nW,loader:lW},hW=cW,$3="agentflow",dW=b(e=>/^\s*agentflow-beta\b/.test(e),"detector"),uW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-22UHCM2B-HDLtgJRK.js");return{diagram:t}},__vite__mapDeps([17,13,14,15,11,16,4,5]));return{id:$3,diagram:e}},"loader"),pW={id:$3,detector:dW,loader:uW},fW=pW,M3="swimlane",gW=b(e=>/^\s*swimlane-beta\b/.test(e),"detector"),mW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./swimlanesDiagram-TC7HE7FX-DUA_t92u.js");return{diagram:t}},__vite__mapDeps([18,12,13,14,15,11,16,4,5]));return{id:M3,diagram:e}},"loader"),bW={id:M3,detector:gW,loader:mW},yW=bW,A3="er",xW=b(e=>/^\s*erDiagram/.test(e),"detector"),vW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./erDiagram-OPXOYQCR-CB71jEyA.js");return{diagram:t}},__vite__mapDeps([19,14,15,16,4,5]));return{id:A3,diagram:e}},"loader"),wW={id:A3,detector:xW,loader:vW},kW=wW,B3="gitGraph",SW=b(e=>/^\s*gitGraph/.test(e),"detector"),CW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./gitGraphDiagram-X574FWY7-HBid3FDo.js");return{diagram:t}},__vite__mapDeps([20,21,22,23,4,5]));return{id:B3,diagram:e}},"loader"),TW={id:B3,detector:SW,loader:CW},$W=TW,_3="gantt",MW=b(e=>/^\s*gantt/.test(e),"detector"),AW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./ganttDiagram-FUAMR5RP-BE7B_UzV.js");return{diagram:t}},__vite__mapDeps([24,25,26,27,4,5]));return{id:_3,diagram:e}},"loader"),BW={id:_3,detector:MW,loader:AW},_W=BW,L3="info",LW=b(e=>/^\s*info/.test(e),"detector"),PW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./infoDiagram-VRGFBTTK-4JprhzHA.js");return{diagram:t}},__vite__mapDeps([28,23,4,5]));return{id:L3,diagram:e}},"loader"),EW={id:L3,detector:LW,loader:PW},P3="pie",RW=b(e=>/^\s*pie/.test(e),"detector"),IW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./pieDiagram-5QR66LMP-BXICkLn_.js");return{diagram:t}},__vite__mapDeps([29,22,23,30,31,26,4,5]));return{id:P3,diagram:e}},"loader"),zW={id:P3,detector:RW,loader:IW},E3="quadrantChart",DW=b(e=>/^\s*quadrantChart/.test(e),"detector"),FW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./quadrantDiagram-O4NWA36T-CnFY0fxq.js");return{diagram:t}},__vite__mapDeps([32,25,26,27,4,5]));return{id:E3,diagram:e}},"loader"),OW={id:E3,detector:DW,loader:FW},NW=OW,R3="xychart",WW=b(e=>/^\s*xychart(-beta)?/.test(e),"detector"),qW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./xychartDiagram-PMCCYNJV-DPxnNxcI.js");return{diagram:t}},__vite__mapDeps([33,26,31,25,27,4,5]));return{id:R3,diagram:e}},"loader"),HW={id:R3,detector:WW,loader:qW},jW=HW,I3="requirement",UW=b(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),YW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./requirementDiagram-PLB6GJNP-DmnKxfFp.js");return{diagram:t}},__vite__mapDeps([34,14,15,4,5]));return{id:I3,diagram:e}},"loader"),GW={id:I3,detector:UW,loader:YW},XW=GW,z3="sequence",VW=b(e=>/^\s*sequenceDiagram/.test(e),"detector"),KW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./sequenceDiagram-PO4LG4MO-4cmBIYSV.js");return{diagram:t}},__vite__mapDeps([35,21,11,4,5]));return{id:z3,diagram:e}},"loader"),ZW={id:z3,detector:VW,loader:KW},QW=ZW,D3="classDiagram",JW=b(e=>/^\s*classDiagram/.test(e),"detector"),tq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./classDiagram-v2-NBCMYWYE-CT9N6_lF.js");return{diagram:t}},__vite__mapDeps([36,13,14,15,11,4,5]));return{id:D3,diagram:e}},"loader"),eq={id:D3,detector:JW,loader:tq},iq=eq,F3="stateDiagram",rq=b(e=>/^\s*stateDiagram/.test(e),"detector"),sq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./stateDiagram-v2-GCMORJYK-BKkiHc4R.js");return{diagram:t}},__vite__mapDeps([37,14,15,11,4,5]));return{id:F3,diagram:e}},"loader"),oq={id:F3,detector:rq,loader:sq},aq=oq,O3="journey",nq=b(e=>/^\s*journey/.test(e),"detector"),lq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./journeyDiagram-ZHPQQLJL-j9c9R8jU.js");return{diagram:t}},__vite__mapDeps([38,13,11,30,4,5]));return{id:O3,diagram:e}},"loader"),cq={id:O3,detector:nq,loader:lq},hq=cq,dq=b((e,t,i)=>{vt.debug(`rendering svg for syntax error
1687
- `);const r=lz(t),s=r.append("g");r.attr("viewBox","0 0 2412 512"),_4(r,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${i}`)},"draw"),N3={draw:dq},uq=N3,pq={db:{},renderer:N3,parser:{parse:b(()=>{},"parse")}},fq=pq,W3="flowchart-elk",gq=b((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout="elk",!0):!1,"detector"),mq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./flowDiagram-KWPJA3E3-CYfjFu_3.js").then(i=>i.f);return{diagram:t}},__vite__mapDeps([12,13,14,15,11,16]));return{id:W3,diagram:e}},"loader"),bq={id:W3,detector:gq,loader:mq},yq=bq,q3="timeline",xq=b(e=>/^\s*timeline/.test(e),"detector"),vq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./timeline-definition-EJHVYXUP-BG9z7YWj.js");return{diagram:t}},__vite__mapDeps([39,30,4,5]));return{id:q3,diagram:e}},"loader"),wq={id:q3,detector:xq,loader:vq},kq=wq,H3="mindmap",Sq=b(e=>/^\s*mindmap/.test(e),"detector"),Cq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./mindmap-definition-NLK3R4M7-CvMFAKuS.js");return{diagram:t}},__vite__mapDeps([40,14,15,4,5]));return{id:H3,diagram:e}},"loader"),Tq={id:H3,detector:Sq,loader:Cq},$q=Tq,j3="kanban",Mq=b(e=>/^\s*kanban/.test(e),"detector"),Aq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./kanban-definition-PNTS6WVX-DWQBxist.js");return{diagram:t}},__vite__mapDeps([41,13,4,5]));return{id:j3,diagram:e}},"loader"),Bq={id:j3,detector:Mq,loader:Aq},_q=Bq,U3="sankey",Lq=b(e=>/^\s*sankey(-beta)?/.test(e),"detector"),Pq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./sankeyDiagram-IPEJSGJF-Bz1YIaMr.js");return{diagram:t}},__vite__mapDeps([42,31,26,4,5]));return{id:U3,diagram:e}},"loader"),Eq={id:U3,detector:Lq,loader:Pq},Rq=Eq,Y3="packet",Iq=b(e=>/^\s*packet(-beta)?/.test(e),"detector"),zq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-MLGK6HIB-ChaEhVd4.js");return{diagram:t}},__vite__mapDeps([43,22,23,4,5]));return{id:Y3,diagram:e}},"loader"),Dq={id:Y3,detector:Iq,loader:zq},G3="radar",Fq=b(e=>/^\s*radar-beta/.test(e),"detector"),Oq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-MPIPVDR6-gYxYar4V.js");return{diagram:t}},__vite__mapDeps([44,22,23,4,5]));return{id:G3,diagram:e}},"loader"),Nq={id:G3,detector:Fq,loader:Oq},X3="block",Wq=b(e=>/^\s*block(-beta)?/.test(e),"detector"),qq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./blockDiagram-BEXU5L5S-DLGMX1ky.js");return{diagram:t}},__vite__mapDeps([45,13,3,16,4,5]));return{id:X3,diagram:e}},"loader"),Hq={id:X3,detector:Wq,loader:qq},jq=Hq,V3="treeView",Uq=b(e=>/^\s*treeView-beta/.test(e),"detector"),Yq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-CDSNMT55-hNm66Cr9.js");return{diagram:t}},__vite__mapDeps([46,21,22,23,4,5]));return{id:V3,diagram:e}},"loader"),Gq={id:V3,detector:Uq,loader:Yq},Xq=Gq,K3="architecture",Vq=b(e=>/^\s*architecture/.test(e),"detector"),Kq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./architectureDiagram-NJMV4G6O-DNZZOJHJ.js");return{diagram:t}},__vite__mapDeps([47,22,23,9,4,5]));return{id:K3,diagram:e}},"loader"),Zq={id:K3,detector:Vq,loader:Kq},Qq=Zq,Z3="eventmodeling",Jq=b(e=>/^\s*eventmodeling/.test(e),"detector"),tH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-ATOU4E4O-DR72H135.js");return{diagram:t}},__vite__mapDeps([48,22,23,4,5]));return{id:Z3,diagram:e}},"loader"),eH={id:Z3,detector:Jq,loader:tH},iH=eH,Q3="ishikawa",rH=b(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),sH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./ishikawaDiagram-OU5B5YK6-UAP9bqUn.js");return{diagram:t}},__vite__mapDeps([49,4,5]));return{id:Q3,diagram:e}},"loader"),oH={id:Q3,detector:rH,loader:sH},J3="venn",aH=b(e=>/^\s*venn-beta/.test(e),"detector"),nH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./vennDiagram-UO4OBE2U-DYr42cwJ.js");return{diagram:t}},__vite__mapDeps([50,4,5]));return{id:J3,diagram:e}},"loader"),lH={id:J3,detector:aH,loader:nH},cH=lH,t6="treemap",hH=b(e=>/^\s*treemap/.test(e),"detector"),dH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-3UASUU5V-Bc2_UO5k.js");return{diagram:t}},__vite__mapDeps([51,22,15,23,27,31,26,4,5]));return{id:t6,diagram:e}},"loader"),uH={id:t6,detector:hH,loader:dH},e6="usecase",pH=b(e=>/^\s*usecase-beta(?:\s|$)/.test(e),"detector"),fH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./usecaseDiagram-POWQR4AR--yXc6tgF.js");return{diagram:t}},__vite__mapDeps([52,14,15,4,5]));return{id:e6,diagram:e}},"loader"),gH={id:e6,detector:pH,loader:fH},i6="wardley",mH=b(e=>/^\s*wardley-beta/i.test(e),"detector"),bH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./wardleyDiagram-VNRHLVJA-DksCy2aR.js");return{diagram:t}},__vite__mapDeps([53,22,23,4,5]));return{id:i6,diagram:e}},"loader"),yH={id:i6,detector:mH,loader:bH},xH=yH,r6="cynefin",vH=b(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),wH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./cynefinDiagram-VND7K2PF-otEJqM7K.js");return{diagram:t}},__vite__mapDeps([54,22,23,4,5]));return{id:r6,diagram:e}},"loader"),kH={id:r6,detector:vH,loader:wH},s6="railroad",SH=b(e=>/^\s*railroad-beta/i.test(e),"detector"),CH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./railroadDiagram-XR7U4H2S-BeRVo7yu.js");return{diagram:t}},__vite__mapDeps([55,56,22,23,4,5]));return{id:s6,diagram:e}},"loader"),TH={id:s6,detector:SH,loader:CH},o6="railroadEbnf",$H=b(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),MH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./ebnfDiagram-ZINNZB2B-CRQjE5YW.js");return{diagram:t}},__vite__mapDeps([57,56,22,23,4,5]));return{id:o6,diagram:e}},"loader"),AH={id:o6,detector:$H,loader:MH},a6="railroadAbnf",BH=b(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),_H=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./abnfDiagram-O67JEVCF-Bd6-T6CG.js");return{diagram:t}},__vite__mapDeps([58,56,22,23,4,5]));return{id:a6,diagram:e}},"loader"),LH={id:a6,detector:BH,loader:_H},n6="railroadPeg",PH=b(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),EH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./pegDiagram-GJSIUBJH-hvF632kF.js");return{diagram:t}},__vite__mapDeps([59,56,22,23,4,5]));return{id:n6,diagram:e}},"loader"),RH={id:n6,detector:PH,loader:EH},o2=!1,Zu=b(()=>{o2||(o2=!0,Dd("error",fq,e=>e.toLowerCase().trim()==="error"),Dd("---",{db:{clear:b(()=>{},"clear")},styles:{},renderer:{draw:b(()=>{},"draw")},parser:{parse:b(()=>{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:b(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Sf(yq,$q,Qq),Sf(fW,aW,_q,iq,kW,_W,EW,zW,XW,QW,yW,hW,kq,$W,aq,hq,NW,Rq,Dq,jW,jq,iH,Xq,Nq,oH,uH,TH,AH,LH,RH,cH,xH,kH,gH))},"addDiagrams"),IH=b(async()=>{vt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Ga).map(async([i,{detector:r,loader:s}])=>{if(s)try{Af(i)}catch{try{const{diagram:o,id:a}=await s();Dd(a,o,r)}catch(o){throw vt.error(`Failed to load external diagram with key ${i}. Removing from detectors.`),delete Ga[i],o}}}))).filter(i=>i.status==="rejected");if(t.length>0){vt.error(`Failed to load ${t.length} external diagrams`);for(const i of t)vt.error(i);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),zH="graphics-document document";function l6(e,t){e.attr("role",zH),t!==""&&e.attr("aria-roledescription",t)}b(l6,"setA11yDiagramInfo");function c6(e,t,i,r){if(e.insert!==void 0){if(i){const s=`chart-desc-${r}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(i)}if(t){const s=`chart-title-${r}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}b(c6,"addSVGa11yTitleDescription");var Ua,ru=(Ua=class{constructor(t,i,r,s,o){this.type=t,this.text=i,this.db=r,this.parser=s,this.renderer=o}static async fromText(t,i={}){const r=typeof t=="string"?{cleaned:t}:t,s=ei(),o=Iu(r.cleaned,s);try{Af(o)}catch{const u=bL(o);if(!u)throw new b4(`Diagram ${o} not found.`);const{id:p,diagram:f}=await u();Dd(p,f)}const{db:a,parser:n,renderer:l,init:c}=Af(o);n.parser&&(n.parser.yy=a),a.clear?.(),c?.(s),i.title&&a.setDiagramTitle?.(i.title);let h=r.cleaned;if(a.preserveCommentsWhenParsing&&r.withComments){const u=s.maxTextSize??fm.maxTextSize;r.withComments.length>u?vt.warn(`Comment-preserving source exceeds maxTextSize (${r.withComments.length} > ${u}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):h=r.withComments}const d=RD(h)+`
1686
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),_N=b((e,t,i)=>{const r=e.append("defs").append("marker").attr("id",i+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),LN=b((e,t,i)=>{const r=ei(),{themeVariables:s}=r,{strokeWidth:o}=s,a=e.append("defs").append("marker").attr("id",i+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),PN=b((e,t,i)=>{e.append("marker").attr("id",i+"_"+t+"-hierarchyEnd").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",i+"_"+t+"-hierarchyStart").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none")},"hierarchy"),EN={extension:hN,composition:dN,aggregation:uN,dependency:pN,lollipop:fN,point:gN,circle:mN,cross:bN,barb:yN,barbNeo:xN,hierarchy:PN,only_one:vN,zero_or_one:wN,one_or_more:kN,zero_or_more:SN,only_one_neo:CN,zero_or_one_neo:TN,one_or_more_neo:$N,zero_or_more_neo:MN,requirement_arrow:AN,requirement_contains:_N,requirement_arrow_neo:BN,requirement_contains_neo:LN},RN=cN,IN={common:Hc,getConfig:ei,insertCluster:VO,insertEdge:lN,insertEdgeLabel:eN,insertMarkers:RN,insertNode:d3,interpolateToCurve:t1,labelHelper:ee,log:vt,positionEdgeLabel:iN},zN=["elk.stress","elk.force","elk.mrtree","elk.sporeOverlap","elk.box","elk.rectpacking"],Bc=Object.create(null),b3=b(e=>{for(const t of e)Bc[t.name]=t},"registerLayoutLoaders"),DN=b(()=>{const e=b(async()=>await xe(()=>import("./elk-276RUBZZ-CoNCqJcP.js"),__vite__mapDeps([0,1,2,3,4,5])),"loader");return[{name:"elk",loader:e,algorithm:"elk.layered"},...zN.map(t=>({name:t,loader:e,algorithm:t}))]},"elkLayoutLoaders"),FN=b(()=>{b3([{name:"dagre",loader:b(async()=>await xe(()=>import("./dagre-6A5THRUB-DWT5RQye.js"),__vite__mapDeps([6,2,3,4,5])),"loader")},{name:"swimlane",loader:b(async()=>await xe(()=>import("./swimlanes-2SLR337P-Bf3UNf_T.js"),__vite__mapDeps([7,1,2,3,4,5])),"loader")},{name:"cose-bilkent",loader:b(async()=>await xe(()=>import("./cose-bilkent-JH36ORCC-CyHRIgUx.js"),__vite__mapDeps([8,9,4,5])),"loader")},...DN()])},"registerDefaultLayoutLoaders");FN();var nit=b(async(e,t)=>{if(!Object.hasOwn(Bc,e.layoutAlgorithm))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const s of e.nodes){const o=s.domId||s.id;s.domId=`${e.diagramId}-${o}`}const i=Bc[e.layoutAlgorithm],r=await i.loader();return pz(t,e.config),r.render(e,t,IN,{algorithm:i.algorithm})},"render"),L0="dagre",lit=b((e="",{fallback:t=L0}={})=>{if(Object.hasOwn(Bc,e))return e;for(const i of[t,L0])if(Object.hasOwn(Bc,i))return vt.warn(`Layout algorithm ${e} is not registered. Using ${i} as fallback.`),i;throw new Error(`Neither layout algorithm ${e}, ${t}, nor ${L0} is registered.`)},"getRegisteredLayoutAlgorithm"),T1="comm",y3="rule",x3="decl",ON="@media",NN="@import",WN="@supports",qN="@namespace",rg="@keyframes",v3="@layer",HN="@scope",jN=Math.abs,mc=String.fromCharCode;function w3(e){return e.trim()}function sg(e,t,i){return e.replace(t,i)}function Rn(e,t){return e.charCodeAt(t)|0}function rl(e,t,i){return e.slice(t,i)}function Ds(e){return e.length}function k3(e){return e.length}function $h(e,t){return t.push(e),e}var Vu=1,sl=1,S3=0,is=0,bi=0,yl="";function $1(e,t,i,r,s,o,a,n){return{value:e,root:t,parent:i,type:r,props:s,children:o,line:Vu,column:sl,length:a,return:"",siblings:n}}function UN(){return bi}function YN(){return bi=is>0?Rn(yl,--is):0,sl--,bi===10&&(sl=1,Vu--),bi}function ws(){return bi=is<S3?Rn(yl,is++):0,sl++,bi===10&&(sl=1,Vu++),bi}function ia(){return Rn(yl,is)}function hd(){return is}function Ku(e,t){return rl(yl,e,t)}function _c(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 GN(e){return Vu=sl=1,S3=Ds(yl=e),is=0,[]}function XN(e){return yl="",e}function P0(e){return w3(Ku(is-1,og(e===91?e+2:e===40?e+1:e)))}function VN(e){for(;(bi=ia())&&bi<33;)ws();return _c(e)>2||_c(bi)>3?"":" "}function KN(e,t){for(;--t&&ws()&&!(bi<48||bi>102||bi>57&&bi<65||bi>70&&bi<97););return Ku(e,hd()+(t<6&&ia()==32&&ws()==32))}function og(e){for(;ws();)switch(bi){case e:return is;case 34:case 39:e!==34&&e!==39&&og(bi);break;case 40:e===41&&og(e);break;case 92:ws();break}return is}function ZN(e,t){for(;ws()&&e+bi!==57;)if(e+bi===84&&ia()===47)break;return"/*"+Ku(t,is-1)+"*"+mc(e===47?e:ws())}function QN(e){for(;!_c(ia());)ws();return Ku(e,is)}function JN(e){return XN(dd("",null,null,null,[""],e=GN(e),0,[0],e))}function dd(e,t,i,r,s,o,a,n,l){for(var c=0,h=0,d=a,u=0,p=0,f=0,g=1,m=1,x=1,w=0,S=0,A="",C=s,E=o,z=r,R=A;m;)switch(f=S,S=ws()){case 40:f!=108&&Rn(R,d-1)==58?(w++,R+="("):R+=P0(S);break;case 41:w--,R+=")";break;case 34:case 39:case 91:R+=P0(S);break;case 9:case 10:case 13:case 32:if(w>0){R+=mc(S);break}R+=VN(f);break;case 92:R+=KN(hd()-1,7);continue;case 47:switch(ia()){case 42:case 47:$h(tW(ZN(ws(),hd()),t,i,l),l),(_c(f||1)==5||_c(ia()||1)==5)&&Ds(R)&&rl(R,-1,void 0)!==" "&&(R+=" ");break;default:R+="/"}break;case 123*g:n[c++]=Ds(R)*x;case 125*g:case 59:case 0:if(w>0&&S){R+=mc(S);break}switch(S){case 0:case 125:m=0;case 59+h:x==-1&&(R=sg(R,/\f/g,"")),p>0&&(Ds(R)-d||g===0)&&$h(p>32?s2(R+";",r,i,d-1,l):s2(sg(R," ","")+";",r,i,d-2,l),l);break;case 59:R+=";";default:if($h(z=r2(R,t,i,c,h,s,n,A,C=[],E=[],d,o),o),S===123)if(h===0)dd(R,t,z,z,C,o,d,n,E);else{switch(u){case 99:if(Rn(R,3)===110)break;case 108:if(Rn(R,2)===97)break;default:h=0;case 100:case 109:case 115:}h?dd(e,z,z,r&&$h(r2(e,z,z,0,0,s,n,A,s,C=[],d,E),E),s,E,d,n,r?C:E):dd(R,z,z,z,[""],E,0,n,E)}}c=h=p=0,g=x=1,A=R="",d=a;break;case 58:d=1+Ds(R),p=f;default:if(g<1){if(S==123)--g;else if(S==125&&g++==0&&YN()==125)continue}switch(R+=mc(S),S*g){case 38:x=h>0?1:(R+="\f",-1);break;case 44:if(w>0)break;n[c++]=(Ds(R)-1)*x,x=1;break;case 64:ia()===45&&(R+=P0(ws())),u=ia(),h=d=Ds(A=R+=QN(hd())),S++;break;case 45:f===45&&Ds(R)==2&&(g=0)}}return o}function r2(e,t,i,r,s,o,a,n,l,c,h,d){for(var u=s-1,p=s===0?o:[""],f=k3(p),g=0,m=0,x=0;g<r;++g)for(var w=0,S=rl(e,u+1,u=jN(m=a[g])),A=e;w<f;++w)(A=w3(m>0?p[w]+" "+S:sg(S,/&\f/g,p[w])))&&(l[x++]=A);return $1(e,t,i,s===0?y3:n,l,c,h,d)}function tW(e,t,i,r){return $1(e,t,i,T1,mc(UN()),rl(e,2,-2),0,r)}function s2(e,t,i,r,s){return $1(e,t,i,x3,rl(e,0,r),rl(e,r+1,-1),r,s)}function ag(e,t){for(var i="",r=0;r<e.length;r++)i+=t(e[r],r,e,t)||"";return i}function eW(e,t,i,r){switch(e.type){case v3:if(e.children.length)break;case NN:case qN:case x3:return e.return=e.return||e.value;case T1:return"";case rg:return e.return=e.value+"{"+ag(e.children,r)+"}";case y3:if(!Ds(e.value=e.props.join(",")))return""}return Ds(i=ag(e.children,r))?e.return=e.value+"{"+i+"}":""}function iW(e){var t=k3(e);return function(i,r,s,o){for(var a="",n=0;n<t;n++)a+=e[n](i,r,s,o)||"";return a}}var C3="c4",rW=b(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),sW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./c4Diagram-YGBWAQC7-DvjNg-67.js");return{diagram:t}},__vite__mapDeps([10,11,4,5]));return{id:C3,diagram:e}},"loader"),oW={id:C3,detector:rW,loader:sW},aW=oW,T3="flowchart-v2",nW=b(e=>/^\s*(graph|flowchart)/.test(e),"detector"),lW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./flowDiagram-KWPJA3E3-B0w84_XU.js").then(i=>i.f);return{diagram:t}},__vite__mapDeps([12,13,14,15,11,16]));return{id:T3,diagram:e}},"loader"),cW={id:T3,detector:nW,loader:lW},hW=cW,$3="agentflow",dW=b(e=>/^\s*agentflow-beta\b/.test(e),"detector"),uW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-22UHCM2B-DP58QDft.js");return{diagram:t}},__vite__mapDeps([17,13,14,15,11,16,4,5]));return{id:$3,diagram:e}},"loader"),pW={id:$3,detector:dW,loader:uW},fW=pW,M3="swimlane",gW=b(e=>/^\s*swimlane-beta\b/.test(e),"detector"),mW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./swimlanesDiagram-TC7HE7FX-CAjvJtrv.js");return{diagram:t}},__vite__mapDeps([18,12,13,14,15,11,16,4,5]));return{id:M3,diagram:e}},"loader"),bW={id:M3,detector:gW,loader:mW},yW=bW,A3="er",xW=b(e=>/^\s*erDiagram/.test(e),"detector"),vW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./erDiagram-OPXOYQCR-D9OB6b4G.js");return{diagram:t}},__vite__mapDeps([19,14,15,16,4,5]));return{id:A3,diagram:e}},"loader"),wW={id:A3,detector:xW,loader:vW},kW=wW,B3="gitGraph",SW=b(e=>/^\s*gitGraph/.test(e),"detector"),CW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./gitGraphDiagram-X574FWY7-BUuBUocx.js");return{diagram:t}},__vite__mapDeps([20,21,22,23,4,5]));return{id:B3,diagram:e}},"loader"),TW={id:B3,detector:SW,loader:CW},$W=TW,_3="gantt",MW=b(e=>/^\s*gantt/.test(e),"detector"),AW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./ganttDiagram-FUAMR5RP-DuTuwJBe.js");return{diagram:t}},__vite__mapDeps([24,25,26,27,4,5]));return{id:_3,diagram:e}},"loader"),BW={id:_3,detector:MW,loader:AW},_W=BW,L3="info",LW=b(e=>/^\s*info/.test(e),"detector"),PW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./infoDiagram-VRGFBTTK-CGKca5hP.js");return{diagram:t}},__vite__mapDeps([28,23,4,5]));return{id:L3,diagram:e}},"loader"),EW={id:L3,detector:LW,loader:PW},P3="pie",RW=b(e=>/^\s*pie/.test(e),"detector"),IW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./pieDiagram-5QR66LMP-BJ2L-dQa.js");return{diagram:t}},__vite__mapDeps([29,22,23,30,31,26,4,5]));return{id:P3,diagram:e}},"loader"),zW={id:P3,detector:RW,loader:IW},E3="quadrantChart",DW=b(e=>/^\s*quadrantChart/.test(e),"detector"),FW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./quadrantDiagram-O4NWA36T-zlLKeeUR.js");return{diagram:t}},__vite__mapDeps([32,25,26,27,4,5]));return{id:E3,diagram:e}},"loader"),OW={id:E3,detector:DW,loader:FW},NW=OW,R3="xychart",WW=b(e=>/^\s*xychart(-beta)?/.test(e),"detector"),qW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./xychartDiagram-PMCCYNJV-Bxzt39ml.js");return{diagram:t}},__vite__mapDeps([33,26,31,25,27,4,5]));return{id:R3,diagram:e}},"loader"),HW={id:R3,detector:WW,loader:qW},jW=HW,I3="requirement",UW=b(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),YW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./requirementDiagram-PLB6GJNP-Cnj6GBT0.js");return{diagram:t}},__vite__mapDeps([34,14,15,4,5]));return{id:I3,diagram:e}},"loader"),GW={id:I3,detector:UW,loader:YW},XW=GW,z3="sequence",VW=b(e=>/^\s*sequenceDiagram/.test(e),"detector"),KW=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./sequenceDiagram-PO4LG4MO-DTCmIrg-.js");return{diagram:t}},__vite__mapDeps([35,21,11,4,5]));return{id:z3,diagram:e}},"loader"),ZW={id:z3,detector:VW,loader:KW},QW=ZW,D3="classDiagram",JW=b(e=>/^\s*classDiagram/.test(e),"detector"),tq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./classDiagram-v2-NBCMYWYE-CIkJY9Ou.js");return{diagram:t}},__vite__mapDeps([36,13,14,15,11,4,5]));return{id:D3,diagram:e}},"loader"),eq={id:D3,detector:JW,loader:tq},iq=eq,F3="stateDiagram",rq=b(e=>/^\s*stateDiagram/.test(e),"detector"),sq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./stateDiagram-v2-GCMORJYK-LRnQ_KvI.js");return{diagram:t}},__vite__mapDeps([37,14,15,11,4,5]));return{id:F3,diagram:e}},"loader"),oq={id:F3,detector:rq,loader:sq},aq=oq,O3="journey",nq=b(e=>/^\s*journey/.test(e),"detector"),lq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./journeyDiagram-ZHPQQLJL-CvVcj_qr.js");return{diagram:t}},__vite__mapDeps([38,13,11,30,4,5]));return{id:O3,diagram:e}},"loader"),cq={id:O3,detector:nq,loader:lq},hq=cq,dq=b((e,t,i)=>{vt.debug(`rendering svg for syntax error
1687
+ `);const r=lz(t),s=r.append("g");r.attr("viewBox","0 0 2412 512"),_4(r,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${i}`)},"draw"),N3={draw:dq},uq=N3,pq={db:{},renderer:N3,parser:{parse:b(()=>{},"parse")}},fq=pq,W3="flowchart-elk",gq=b((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout="elk",!0):!1,"detector"),mq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./flowDiagram-KWPJA3E3-B0w84_XU.js").then(i=>i.f);return{diagram:t}},__vite__mapDeps([12,13,14,15,11,16]));return{id:W3,diagram:e}},"loader"),bq={id:W3,detector:gq,loader:mq},yq=bq,q3="timeline",xq=b(e=>/^\s*timeline/.test(e),"detector"),vq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./timeline-definition-EJHVYXUP-C-hFa0Xg.js");return{diagram:t}},__vite__mapDeps([39,30,4,5]));return{id:q3,diagram:e}},"loader"),wq={id:q3,detector:xq,loader:vq},kq=wq,H3="mindmap",Sq=b(e=>/^\s*mindmap/.test(e),"detector"),Cq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./mindmap-definition-NLK3R4M7-CwZQvHXR.js");return{diagram:t}},__vite__mapDeps([40,14,15,4,5]));return{id:H3,diagram:e}},"loader"),Tq={id:H3,detector:Sq,loader:Cq},$q=Tq,j3="kanban",Mq=b(e=>/^\s*kanban/.test(e),"detector"),Aq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./kanban-definition-PNTS6WVX-CFVMh7as.js");return{diagram:t}},__vite__mapDeps([41,13,4,5]));return{id:j3,diagram:e}},"loader"),Bq={id:j3,detector:Mq,loader:Aq},_q=Bq,U3="sankey",Lq=b(e=>/^\s*sankey(-beta)?/.test(e),"detector"),Pq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./sankeyDiagram-IPEJSGJF-D7QbwNbF.js");return{diagram:t}},__vite__mapDeps([42,31,26,4,5]));return{id:U3,diagram:e}},"loader"),Eq={id:U3,detector:Lq,loader:Pq},Rq=Eq,Y3="packet",Iq=b(e=>/^\s*packet(-beta)?/.test(e),"detector"),zq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-MLGK6HIB-B9wJ9DgU.js");return{diagram:t}},__vite__mapDeps([43,22,23,4,5]));return{id:Y3,diagram:e}},"loader"),Dq={id:Y3,detector:Iq,loader:zq},G3="radar",Fq=b(e=>/^\s*radar-beta/.test(e),"detector"),Oq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-MPIPVDR6-B7VqKNt7.js");return{diagram:t}},__vite__mapDeps([44,22,23,4,5]));return{id:G3,diagram:e}},"loader"),Nq={id:G3,detector:Fq,loader:Oq},X3="block",Wq=b(e=>/^\s*block(-beta)?/.test(e),"detector"),qq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./blockDiagram-BEXU5L5S-BBoE7P9Y.js");return{diagram:t}},__vite__mapDeps([45,13,3,16,4,5]));return{id:X3,diagram:e}},"loader"),Hq={id:X3,detector:Wq,loader:qq},jq=Hq,V3="treeView",Uq=b(e=>/^\s*treeView-beta/.test(e),"detector"),Yq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-CDSNMT55-4dwnMZ-w.js");return{diagram:t}},__vite__mapDeps([46,21,22,23,4,5]));return{id:V3,diagram:e}},"loader"),Gq={id:V3,detector:Uq,loader:Yq},Xq=Gq,K3="architecture",Vq=b(e=>/^\s*architecture/.test(e),"detector"),Kq=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./architectureDiagram-NJMV4G6O-DtWgCy1z.js");return{diagram:t}},__vite__mapDeps([47,22,23,9,4,5]));return{id:K3,diagram:e}},"loader"),Zq={id:K3,detector:Vq,loader:Kq},Qq=Zq,Z3="eventmodeling",Jq=b(e=>/^\s*eventmodeling/.test(e),"detector"),tH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-ATOU4E4O-DujESIkQ.js");return{diagram:t}},__vite__mapDeps([48,22,23,4,5]));return{id:Z3,diagram:e}},"loader"),eH={id:Z3,detector:Jq,loader:tH},iH=eH,Q3="ishikawa",rH=b(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),sH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./ishikawaDiagram-OU5B5YK6-DHRV6yYl.js");return{diagram:t}},__vite__mapDeps([49,4,5]));return{id:Q3,diagram:e}},"loader"),oH={id:Q3,detector:rH,loader:sH},J3="venn",aH=b(e=>/^\s*venn-beta/.test(e),"detector"),nH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./vennDiagram-UO4OBE2U-JRvs9XFy.js");return{diagram:t}},__vite__mapDeps([50,4,5]));return{id:J3,diagram:e}},"loader"),lH={id:J3,detector:aH,loader:nH},cH=lH,t6="treemap",hH=b(e=>/^\s*treemap/.test(e),"detector"),dH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./diagram-3UASUU5V-DbO0luGb.js");return{diagram:t}},__vite__mapDeps([51,22,15,23,27,31,26,4,5]));return{id:t6,diagram:e}},"loader"),uH={id:t6,detector:hH,loader:dH},e6="usecase",pH=b(e=>/^\s*usecase-beta(?:\s|$)/.test(e),"detector"),fH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./usecaseDiagram-POWQR4AR-CeJlL3Iz.js");return{diagram:t}},__vite__mapDeps([52,14,15,4,5]));return{id:e6,diagram:e}},"loader"),gH={id:e6,detector:pH,loader:fH},i6="wardley",mH=b(e=>/^\s*wardley-beta/i.test(e),"detector"),bH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./wardleyDiagram-VNRHLVJA-BrFqMbb0.js");return{diagram:t}},__vite__mapDeps([53,22,23,4,5]));return{id:i6,diagram:e}},"loader"),yH={id:i6,detector:mH,loader:bH},xH=yH,r6="cynefin",vH=b(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),wH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./cynefinDiagram-VND7K2PF-BWnjhGsJ.js");return{diagram:t}},__vite__mapDeps([54,22,23,4,5]));return{id:r6,diagram:e}},"loader"),kH={id:r6,detector:vH,loader:wH},s6="railroad",SH=b(e=>/^\s*railroad-beta/i.test(e),"detector"),CH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./railroadDiagram-XR7U4H2S-ChQ2Bzn8.js");return{diagram:t}},__vite__mapDeps([55,56,22,23,4,5]));return{id:s6,diagram:e}},"loader"),TH={id:s6,detector:SH,loader:CH},o6="railroadEbnf",$H=b(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),MH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./ebnfDiagram-ZINNZB2B-DeWm3AYC.js");return{diagram:t}},__vite__mapDeps([57,56,22,23,4,5]));return{id:o6,diagram:e}},"loader"),AH={id:o6,detector:$H,loader:MH},a6="railroadAbnf",BH=b(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),_H=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./abnfDiagram-O67JEVCF-XZ1qQ8z4.js");return{diagram:t}},__vite__mapDeps([58,56,22,23,4,5]));return{id:a6,diagram:e}},"loader"),LH={id:a6,detector:BH,loader:_H},n6="railroadPeg",PH=b(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),EH=b(async()=>{const{diagram:e}=await xe(async()=>{const{diagram:t}=await import("./pegDiagram-GJSIUBJH-BNXgc7-g.js");return{diagram:t}},__vite__mapDeps([59,56,22,23,4,5]));return{id:n6,diagram:e}},"loader"),RH={id:n6,detector:PH,loader:EH},o2=!1,Zu=b(()=>{o2||(o2=!0,Dd("error",fq,e=>e.toLowerCase().trim()==="error"),Dd("---",{db:{clear:b(()=>{},"clear")},styles:{},renderer:{draw:b(()=>{},"draw")},parser:{parse:b(()=>{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:b(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Sf(yq,$q,Qq),Sf(fW,aW,_q,iq,kW,_W,EW,zW,XW,QW,yW,hW,kq,$W,aq,hq,NW,Rq,Dq,jW,jq,iH,Xq,Nq,oH,uH,TH,AH,LH,RH,cH,xH,kH,gH))},"addDiagrams"),IH=b(async()=>{vt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Ga).map(async([i,{detector:r,loader:s}])=>{if(s)try{Af(i)}catch{try{const{diagram:o,id:a}=await s();Dd(a,o,r)}catch(o){throw vt.error(`Failed to load external diagram with key ${i}. Removing from detectors.`),delete Ga[i],o}}}))).filter(i=>i.status==="rejected");if(t.length>0){vt.error(`Failed to load ${t.length} external diagrams`);for(const i of t)vt.error(i);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),zH="graphics-document document";function l6(e,t){e.attr("role",zH),t!==""&&e.attr("aria-roledescription",t)}b(l6,"setA11yDiagramInfo");function c6(e,t,i,r){if(e.insert!==void 0){if(i){const s=`chart-desc-${r}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(i)}if(t){const s=`chart-title-${r}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}b(c6,"addSVGa11yTitleDescription");var Ua,ru=(Ua=class{constructor(t,i,r,s,o){this.type=t,this.text=i,this.db=r,this.parser=s,this.renderer=o}static async fromText(t,i={}){const r=typeof t=="string"?{cleaned:t}:t,s=ei(),o=Iu(r.cleaned,s);try{Af(o)}catch{const u=bL(o);if(!u)throw new b4(`Diagram ${o} not found.`);const{id:p,diagram:f}=await u();Dd(p,f)}const{db:a,parser:n,renderer:l,init:c}=Af(o);n.parser&&(n.parser.yy=a),a.clear?.(),c?.(s),i.title&&a.setDiagramTitle?.(i.title);let h=r.cleaned;if(a.preserveCommentsWhenParsing&&r.withComments){const u=s.maxTextSize??fm.maxTextSize;r.withComments.length>u?vt.warn(`Comment-preserving source exceeds maxTextSize (${r.withComments.length} > ${u}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):h=r.withComments}const d=RD(h)+`
1688
1688
  `;return r.frontmatterLineOffset&&a.setFrontmatterLineOffset?.(r.frontmatterLineOffset),await n.parse(d),new Ua(o,d,a,n,l)}async render(t,i){await this.renderer.draw(this.text,t,i,this)}getParser(){return this.parser}getType(){return this.type}},b(Ua,"Diagram"),Ua),a2=[],DH=b(()=>{a2.forEach(e=>{e()}),a2=[]},"attachFunctions"),FH=b(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function h6(e){const t=e.match(m4);if(!t)return{text:e,metadata:{}};const i=t[1],r=i?t[2].split(`
1689
1689
  `).map(a=>a.startsWith(i)?a.slice(i.length):a).join(`
1690
1690
  `):t[2];let s=uz(r,{schema:dz})??{};s=typeof s=="object"&&!Array.isArray(s)?s:{};const o={};return s.displayMode&&(o.displayMode=s.displayMode.toString()),s.title&&(o.title=s.title.toString()),s.config&&(o.config=s.config),{text:e.slice(t[0].length),metadata:o}}b(h6,"extractFrontMatter");var OH=b(e=>e.replace(/\r\n?/g,`
@@ -3873,9 +3873,9 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
3873
3873
  .section-heading { display: grid; gap: 12px; }
3874
3874
  .heading-actions { justify-self: start; }
3875
3875
  }
3876
- `;ka([P()],Vs.prototype,"heading",2);ka([P({attribute:!1})],Vs.prototype,"description",2);ka([P()],Vs.prototype,"actionLabel",2);ka([P()],Vs.prototype,"actionTitle",2);ka([P({type:Boolean})],Vs.prototype,"actionDisabled",2);ka([P({attribute:!1})],Vs.prototype,"notices",2);ka([P({attribute:!1})],Vs.prototype,"onAction",2);Vs=ka([Ae("settings-panel-frame")],Vs);function eQ(e){switch(e){case"error":return"alert";case"success":return"status";case"warning":case"info":return"note"}}function iQ(){return{host:"",port:"",allowedHostsMode:"list",allowedHostsText:""}}function rQ(){return{allowedPathsText:"",uploadDefaultFolder:""}}function sQ(e){return{host:e.host??"",port:e.port===void 0?"":String(e.port),allowedHostsMode:e.allowedHosts===!0?"all":"list",allowedHostsText:Array.isArray(e.allowedHosts)?e.allowedHosts.join(`
3877
- `):""}}function oQ(e){return{allowedPathsText:e.pathAccess?.allowedPaths?.join(`
3878
- `)??"",uploadDefaultFolder:e.uploads?.defaultFolder??""}}function aQ(e,t={}){const i=lQ(t),r=e.host.trim(),s=e.port.trim();if(r!==""&&(i.host=r),s!==""){const o=Number(s);if(!Number.isInteger(o)||o<1||o>65535)throw new Error("Port must be an integer from 1 to 65535.");i.port=o}return i.allowedHosts=e.allowedHostsMode==="all"?!0:cQ(e.allowedHostsText),i}function nQ(e){const t=hQ(e.allowedPathsText),i=dQ(e.uploadDefaultFolder);return{pathAccess:{allowedPaths:t},uploads:i===""?{}:{defaultFolder:i}}}function lQ(e){return{...e.shortcuts===void 0?{}:{shortcuts:e.shortcuts},...e.vimMode===void 0?{}:{vimMode:e.vimMode},...e.plugins===void 0?{}:{plugins:e.plugins},...e.pathAccess===void 0?{}:{pathAccess:e.pathAccess},...e.uploads===void 0?{}:{uploads:e.uploads},...e.maxUploadBytes===void 0?{}:{maxUploadBytes:e.maxUploadBytes},...e.spawnSessions===void 0?{}:{spawnSessions:e.spawnSessions},...e.subsessions===void 0?{}:{subsessions:e.subsessions}}}function cQ(e){return e.split(/[\n,]/u).map(t=>t.trim()).filter(t=>t!=="")}function hQ(e){const t=e.split(`
3876
+ `;ka([P()],Vs.prototype,"heading",2);ka([P({attribute:!1})],Vs.prototype,"description",2);ka([P()],Vs.prototype,"actionLabel",2);ka([P()],Vs.prototype,"actionTitle",2);ka([P({type:Boolean})],Vs.prototype,"actionDisabled",2);ka([P({attribute:!1})],Vs.prototype,"notices",2);ka([P({attribute:!1})],Vs.prototype,"onAction",2);Vs=ka([Ae("settings-panel-frame")],Vs);function eQ(e){switch(e){case"error":return"alert";case"success":return"status";case"warning":case"info":return"note"}}function iQ(){return{host:"",port:"",allowedHostsMode:"list",allowedHostsText:"",allowPrivateMachines:!1}}function rQ(){return{allowedPathsText:"",uploadDefaultFolder:""}}function sQ(e){return{host:e.host??"",port:e.port===void 0?"":String(e.port),allowedHostsMode:e.allowedHosts===!0?"all":"list",allowedHostsText:Array.isArray(e.allowedHosts)?e.allowedHosts.join(`
3877
+ `):"",allowPrivateMachines:e.allowPrivateMachines??!1}}function oQ(e){return{allowedPathsText:e.pathAccess?.allowedPaths?.join(`
3878
+ `)??"",uploadDefaultFolder:e.uploads?.defaultFolder??""}}function aQ(e,t={}){const i=lQ(t),r=e.host.trim(),s=e.port.trim();if(r!==""&&(i.host=r),s!==""){const o=Number(s);if(!Number.isInteger(o)||o<1||o>65535)throw new Error("Port must be an integer from 1 to 65535.");i.port=o}return i.allowedHosts=e.allowedHostsMode==="all"?!0:cQ(e.allowedHostsText),i.allowPrivateMachines=e.allowPrivateMachines,i}function nQ(e){const t=hQ(e.allowedPathsText),i=dQ(e.uploadDefaultFolder);return{pathAccess:{allowedPaths:t},uploads:i===""?{}:{defaultFolder:i}}}function lQ(e){return{...e.shortcuts===void 0?{}:{shortcuts:e.shortcuts},...e.vimMode===void 0?{}:{vimMode:e.vimMode},...e.plugins===void 0?{}:{plugins:e.plugins},...e.pathAccess===void 0?{}:{pathAccess:e.pathAccess},...e.uploads===void 0?{}:{uploads:e.uploads},...e.maxUploadBytes===void 0?{}:{maxUploadBytes:e.maxUploadBytes},...e.spawnSessions===void 0?{}:{spawnSessions:e.spawnSessions},...e.subsessions===void 0?{}:{subsessions:e.subsessions},...e.authRequired===void 0?{}:{authRequired:e.authRequired},...e.authToken===void 0?{}:{authToken:e.authToken},...e.allowPrivateMachines===void 0?{}:{allowPrivateMachines:e.allowPrivateMachines}}}function cQ(e){return e.split(/[\n,]/u).map(t=>t.trim()).filter(t=>t!=="")}function hQ(e){const t=e.split(`
3879
3879
  `).map(r=>r.trim()).filter(r=>r!==""),i=t.find(r=>!uQ(r));if(i!==void 0)throw new Error(`Allowed external paths must be absolute paths or start with ~: ${i}`);return t}function dQ(e){const t=e.trim();if(t==="")return"";if(pQ(t))throw new Error("Upload default folder must be workspace-relative.");const i=t.split(/[\\/]+/u).filter(r=>r!==""&&r!==".");if(i.length===0)return"";if(i.some(r=>r===".."))throw new Error("Upload default folder must not contain path traversal.");return i.join("/")}function uQ(e){return e==="~"||e.startsWith("~/")||e.startsWith("~\\")||e.startsWith("/")||e.startsWith("\\")||/^[A-Za-z]:[\\/]/u.test(e)}function pQ(e){const t=e.replace(/\\/g,"/");return t.startsWith("/")||/^[A-Za-z]:\//u.test(t)}var fQ=Object.defineProperty,gQ=Object.getOwnPropertyDescriptor,Ei=(e,t,i,r)=>{for(var s=r>1?void 0:r?gQ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&fQ(t,i,s),s};function mQ(e){return T`Gateway server fields edit this local gateway. File access and upload defaults edit ${e}.`}let mi=class extends we{constructor(){super(...arguments),this.loading=!1,this.machineLoading=!1,this.saving=!1,this.error="",this.machineError="",this.savedMessage="",this.targetLabel="selected machine",this.gatewayDraft=iQ(),this.machineDraft=rQ(),this.gatewayLocalError="",this.machineLocalError="",this.chatPrefs=$r(),this.handleChatPrefsChange=e=>{e instanceof CustomEvent&&$u(e.detail)?this.chatPrefs=e.detail:this.chatPrefs=$r()}}connectedCallback(){super.connectedCallback(),this.chatPrefs=$r(),Us()?.addEventListener(js,this.handleChatPrefsChange)}disconnectedCallback(){Us()?.removeEventListener(js,this.handleChatPrefsChange),super.disconnectedCallback()}willUpdate(e){e.has("configResponse")&&this.configResponse!==void 0&&(this.gatewayDraft=sQ(this.configResponse.config),this.gatewayLocalError=""),e.has("machineConfigResponse")&&this.machineConfigResponse!==void 0&&(this.machineDraft=oQ(this.machineConfigResponse.config),this.machineLocalError="")}render(){return T`
3880
3880
  <settings-panel-frame
3881
3881
  heading="General configuration"
@@ -3935,6 +3935,14 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
3935
3935
  <small>Enter one host per line, or choose “Allow every host” to write <code>true</code>.</small>
3936
3936
  </div>
3937
3937
 
3938
+ <label class="toggle-row">
3939
+ <input type="checkbox" .checked=${this.gatewayDraft.allowPrivateMachines} @change=${t=>{this.updateGatewayDraft({allowPrivateMachines:vQ(t)})}} />
3940
+ <div class="toggle-copy">
3941
+ <strong>Allow private & VPN machines</strong>
3942
+ <small>Permits registering remote machines on Tailscale (100.64.0.0/10), WireGuard, or private LAN networks.</small>
3943
+ </div>
3944
+ </label>
3945
+
3938
3946
  ${this.renderGatewayEffectiveConfig()}
3939
3947
 
3940
3948
  <footer class="form-actions">
@@ -4102,10 +4110,10 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4102
4110
  @media (max-width: 760px) {
4103
4111
  .effective-card dl > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
4104
4112
  }
4105
- `;Ei([P({attribute:!1})],mi.prototype,"configResponse",2);Ei([P({attribute:!1})],mi.prototype,"machineConfigResponse",2);Ei([P({type:Boolean})],mi.prototype,"loading",2);Ei([P({type:Boolean})],mi.prototype,"machineLoading",2);Ei([P({type:Boolean})],mi.prototype,"saving",2);Ei([P()],mi.prototype,"error",2);Ei([P()],mi.prototype,"machineError",2);Ei([P()],mi.prototype,"savedMessage",2);Ei([P()],mi.prototype,"targetLabel",2);Ei([P({attribute:!1})],mi.prototype,"onReload",2);Ei([P({attribute:!1})],mi.prototype,"onReloadMachine",2);Ei([P({attribute:!1})],mi.prototype,"onSave",2);Ei([P({attribute:!1})],mi.prototype,"onSaveMachineConfig",2);Ei([Ct()],mi.prototype,"gatewayDraft",2);Ei([Ct()],mi.prototype,"machineDraft",2);Ei([Ct()],mi.prototype,"gatewayLocalError",2);Ei([Ct()],mi.prototype,"machineLocalError",2);Ei([Ct()],mi.prototype,"chatPrefs",2);mi=Ei([Ae("settings-general-panel")],mi);function bQ(e){return e===!0?"Any host":Array.isArray(e)?e.length===0?T`<span class="muted">None listed</span>`:e.join(", "):T`<span class="muted">Unset</span>`}function yQ(e){return e===void 0||e.length===0?T`<span class="muted">External paths denied</span>`:e.join(", ")}function rf(e){return e.target instanceof HTMLInputElement?e.target.value:""}function xQ(e){return e.target instanceof HTMLSelectElement?e.target.value:""}function Pw(e){return e.target instanceof HTMLTextAreaElement?e.target.value:""}function vQ(e){return{spawnSessions:e}}function wQ(e){return{subsessions:e}}function kQ(e,t){return{...e,config:{...e.config,...t.config},effectiveConfig:{...e.effectiveConfig,...t.effectiveConfig},envOverrides:{...e.envOverrides,spawnSessions:t.envOverrides.spawnSessions,subsessions:t.envOverrides.subsessions}}}var SQ=Object.defineProperty,CQ=Object.getOwnPropertyDescriptor,Oo=(e,t,i,r)=>{for(var s=r>1?void 0:r?CQ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&SQ(t,i,s),s};let $s=class extends we{constructor(){super(...arguments),this.loading=!1,this.saving=!1,this.error="",this.savedMessage="",this.targetLabel="local (local gateway)"}render(){const e=this.configResponse,t=e?.envOverrides.spawnSessions===!0,i=e?.effectiveConfig.spawnSessions!==!1,r=e?.envOverrides.subsessions===!0,s=e?.effectiveConfig.subsessions===!0&&i;return T`
4113
+ `;Ei([P({attribute:!1})],mi.prototype,"configResponse",2);Ei([P({attribute:!1})],mi.prototype,"machineConfigResponse",2);Ei([P({type:Boolean})],mi.prototype,"loading",2);Ei([P({type:Boolean})],mi.prototype,"machineLoading",2);Ei([P({type:Boolean})],mi.prototype,"saving",2);Ei([P()],mi.prototype,"error",2);Ei([P()],mi.prototype,"machineError",2);Ei([P()],mi.prototype,"savedMessage",2);Ei([P()],mi.prototype,"targetLabel",2);Ei([P({attribute:!1})],mi.prototype,"onReload",2);Ei([P({attribute:!1})],mi.prototype,"onReloadMachine",2);Ei([P({attribute:!1})],mi.prototype,"onSave",2);Ei([P({attribute:!1})],mi.prototype,"onSaveMachineConfig",2);Ei([Ct()],mi.prototype,"gatewayDraft",2);Ei([Ct()],mi.prototype,"machineDraft",2);Ei([Ct()],mi.prototype,"gatewayLocalError",2);Ei([Ct()],mi.prototype,"machineLocalError",2);Ei([Ct()],mi.prototype,"chatPrefs",2);mi=Ei([Ae("settings-general-panel")],mi);function bQ(e){return e===!0?"Any host":Array.isArray(e)?e.length===0?T`<span class="muted">None listed</span>`:e.join(", "):T`<span class="muted">Unset</span>`}function yQ(e){return e===void 0||e.length===0?T`<span class="muted">External paths denied</span>`:e.join(", ")}function rf(e){return e.target instanceof HTMLInputElement?e.target.value:""}function xQ(e){return e.target instanceof HTMLSelectElement?e.target.value:""}function Pw(e){return e.target instanceof HTMLTextAreaElement?e.target.value:""}function vQ(e){return e.target instanceof HTMLInputElement?e.target.checked:!1}function wQ(e){return{spawnSessions:e}}function kQ(e){return{subsessions:e}}function SQ(e,t){return{...e,config:{...e.config,...t.config},effectiveConfig:{...e.effectiveConfig,...t.effectiveConfig},envOverrides:{...e.envOverrides,spawnSessions:t.envOverrides.spawnSessions,subsessions:t.envOverrides.subsessions}}}var CQ=Object.defineProperty,TQ=Object.getOwnPropertyDescriptor,Oo=(e,t,i,r)=>{for(var s=r>1?void 0:r?TQ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&CQ(t,i,s),s};let $s=class extends we{constructor(){super(...arguments),this.loading=!1,this.saving=!1,this.error="",this.savedMessage="",this.targetLabel="local (local gateway)"}render(){const e=this.configResponse,t=e?.envOverrides.spawnSessions===!0,i=e?.effectiveConfig.spawnSessions!==!1,r=e?.envOverrides.subsessions===!0,s=e?.effectiveConfig.subsessions===!0&&i;return T`
4106
4114
  <settings-panel-frame
4107
4115
  heading="Session daemon"
4108
- .description=${TQ(this.targetLabel)}
4116
+ .description=${$Q(this.targetLabel)}
4109
4117
  actionLabel="Reload"
4110
4118
  .actionDisabled=${this.loading}
4111
4119
  .notices=${this.panelNotices(e)}
@@ -4158,7 +4166,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4158
4166
  </section>
4159
4167
  `}
4160
4168
  </settings-panel-frame>
4161
- `}panelNotices(e){const t=[];return this.error!==""&&t.push({type:"error",content:this.error}),this.savedMessage!==""&&t.push({type:"success",content:this.savedMessage}),e!==void 0&&t.push({type:"warning",title:`Restart required on ${this.targetLabel}`,content:T`run <code>omp-web restart</code> on that machine (or restart its session daemon service) after changing these settings.`}),t}renderUnavailableConfigState(){return T`<div class="loading-card">${this.loading?"Loading configuration…":"Configuration is unavailable. Reload to try again."}</div>`}async toggleSpawnSessions(e){const t=e.target instanceof HTMLInputElement&&e.target.checked;await this.onSave?.(vQ(t))}async toggleSubsessions(e){const t=e.target instanceof HTMLInputElement&&e.target.checked;await this.onSave?.(wQ(t))}};$s.styles=_e`
4169
+ `}panelNotices(e){const t=[];return this.error!==""&&t.push({type:"error",content:this.error}),this.savedMessage!==""&&t.push({type:"success",content:this.savedMessage}),e!==void 0&&t.push({type:"warning",title:`Restart required on ${this.targetLabel}`,content:T`run <code>omp-web restart</code> on that machine (or restart its session daemon service) after changing these settings.`}),t}renderUnavailableConfigState(){return T`<div class="loading-card">${this.loading?"Loading configuration…":"Configuration is unavailable. Reload to try again."}</div>`}async toggleSpawnSessions(e){const t=e.target instanceof HTMLInputElement&&e.target.checked;await this.onSave?.(wQ(t))}async toggleSubsessions(e){const t=e.target instanceof HTMLInputElement&&e.target.checked;await this.onSave?.(kQ(t))}};$s.styles=_e`
4162
4170
  :host { display: block; }
4163
4171
  h3 { margin: 0; font-size: 13px; line-height: 1.3; }
4164
4172
  button, input { font: inherit; }
@@ -4186,10 +4194,10 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4186
4194
  @media (max-width: 760px) {
4187
4195
  .effective-card dl > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
4188
4196
  }
4189
- `;Oo([P({attribute:!1})],$s.prototype,"configResponse",2);Oo([P({type:Boolean})],$s.prototype,"loading",2);Oo([P({type:Boolean})],$s.prototype,"saving",2);Oo([P()],$s.prototype,"error",2);Oo([P()],$s.prototype,"savedMessage",2);Oo([P()],$s.prototype,"targetLabel",2);Oo([P({attribute:!1})],$s.prototype,"onReload",2);Oo([P({attribute:!1})],$s.prototype,"onSave",2);$s=Oo([Ae("settings-sessiond-panel")],$s);function TQ(e){return`These settings affect the long-lived session runtime on ${e}. Changes are saved immediately but only take effect after the session daemon on that machine restarts.`}function zg(e){return e!==void 0?{id:e.id,name:e.name,kind:e.kind}:{id:"local",name:"local",kind:"local"}}function Hi(e){return e.kind==="local"?`${e.name} (local gateway)`:`${e.name} (remote machine)`}function Ew(e,t){return e.kind==="local"?{state:"supported"}:t?.ok!==!0?{state:"unknown"}:vs(t,Kr.selectedMachineSettings)?{state:"supported"}:{state:"unsupported",message:i7(e)}}function Rw(e){return`${e.state}:${e.message??""}`}function vn(e){return e?.state==="unsupported"}function i7(e){return`Selected-machine settings are not available on ${e.name}. Update and restart PI WEB on that machine, then try again.`}function Ko(e,t){const i=e.trim();return t.kind!=="remote"?i:$Q(i)?i7(t):i==="Remote machine timeout"?`Timed out while contacting ${t.name} for selected-machine settings. The operation may still be running remotely; reload before retrying.`:i==="Remote machine unavailable"?`Could not reach ${t.name} for selected-machine settings. Check the machine connection and try again.`:i}function $Q(e){return e==="Not Found"||/route\s+(GET|PUT):?\/api\/(config|plugins)\b.*not found/iu.test(e)||/cannot\s+(GET|PUT)\s+.*\/api\/(config|plugins)\b/iu.test(e)}function r7(e){return zg(e)}function ja(e){return e.kind==="local"?`${e.name} (local gateway)`:`${e.name} (remote machine)`}function Iw(e,t){return e.kind==="local"?{state:"supported"}:t?.ok!==!0?{state:"unknown"}:vs(t,Kr.piPackagesManage)?{state:"supported"}:{state:"unsupported",message:s7(e)}}function zw(e){return`${e.state}:${e.message??""}`}function sb(e){return e?.state==="unsupported"}function s7(e){return`Pi package management is not available on ${e.name}. Update and restart Omp-Web on that machine, then try again.`}function MQ(e){return e.kind==="local"}function o7(e){return e.trim()}function AQ(e){if(o7(e)==="")return"Enter a Pi package source accepted by Pi, such as npm:@scope/package, a git/URL source, or a local path."}function BQ(e){return e.scope==="project"?"Project scope":"User scope"}function _Q(e){return e.filtered?"Filtered by current Pi package settings":"Available in this PI WEB process"}function LQ(e){return e.installedPath??"Installed path not reported by Pi"}function a7(e){return e.scope==="user"}function PQ(e){if(!a7(e))return"Project-scope Pi packages are listed for visibility, but PI WEB only updates user-scope Pi packages safely from this view."}function EQ(e){return e.length>0&&e.every(a7)}function RQ(e){if(e.length===0)return"No Pi packages are configured yet.";if(!EQ(e))return"Update all is disabled while project-scope Pi packages are listed; update user-scope packages individually."}function Hh(e,t,i){return e?.kind!==t?!1:i===void 0||e.source===i}function IQ(e,t=r7(void 0)){const i=e==="install"?"installed":e==="remove"?"removed":"updated",r=t.kind==="local"?"":` on ${t.name}`,s=t.kind==="local"?"each idle PI WEB session":`each idle PI WEB session on ${t.name}`,o=t.kind==="local"?"PI WEB browser plugin changes":`PI WEB browser plugin changes served by ${t.name}`;return`Pi package ${i}${r}. Type /reload in ${s} to rediscover Pi runtime resources: extensions, skills, prompt templates, themes, and context/system prompt files. Reload the browser page separately for ${o}.`}function n7(e,t){const i=e.trim();return t.kind!=="remote"?i:zQ(i)?s7(t):i==="Remote machine timeout"?`Timed out while contacting ${t.name} for Pi package management. The package operation may still be running remotely; reload the package list before retrying.`:i==="Remote machine unavailable"?`Could not reach ${t.name} for Pi package management. Check the machine connection and try again.`:i}function zQ(e){return e==="Not Found"||/route\s+(GET|POST):?\/api\/pi-packages\b.*not found/iu.test(e)||/cannot\s+(GET|POST)\s+.*\/api\/pi-packages\b/iu.test(e)}var DQ=Object.defineProperty,FQ=Object.getOwnPropertyDescriptor,Lr=(e,t,i,r)=>{for(var s=r>1?void 0:r?FQ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&DQ(t,i,s),s};let rr=class extends we{constructor(){super(...arguments),this.loading=!1,this.error="",this.operationMessage="",this.installSource="",this.validationMessage=""}render(){const e=this.packagesResponse?.packages??[],t=this.packageTarget,i=ja(t),r=this.packageManagementUnavailable,s=this.packagesResponse!==void 0&&!r;return T`
4197
+ `;Oo([P({attribute:!1})],$s.prototype,"configResponse",2);Oo([P({type:Boolean})],$s.prototype,"loading",2);Oo([P({type:Boolean})],$s.prototype,"saving",2);Oo([P()],$s.prototype,"error",2);Oo([P()],$s.prototype,"savedMessage",2);Oo([P()],$s.prototype,"targetLabel",2);Oo([P({attribute:!1})],$s.prototype,"onReload",2);Oo([P({attribute:!1})],$s.prototype,"onSave",2);$s=Oo([Ae("settings-sessiond-panel")],$s);function $Q(e){return`These settings affect the long-lived session runtime on ${e}. Changes are saved immediately but only take effect after the session daemon on that machine restarts.`}function zg(e){return e!==void 0?{id:e.id,name:e.name,kind:e.kind}:{id:"local",name:"local",kind:"local"}}function Hi(e){return e.kind==="local"?`${e.name} (local gateway)`:`${e.name} (remote machine)`}function Ew(e,t){return e.kind==="local"?{state:"supported"}:t?.ok!==!0?{state:"unknown"}:vs(t,Kr.selectedMachineSettings)?{state:"supported"}:{state:"unsupported",message:i7(e)}}function Rw(e){return`${e.state}:${e.message??""}`}function vn(e){return e?.state==="unsupported"}function i7(e){return`Selected-machine settings are not available on ${e.name}. Update and restart PI WEB on that machine, then try again.`}function Ko(e,t){const i=e.trim();return t.kind!=="remote"?i:MQ(i)?i7(t):i==="Remote machine timeout"?`Timed out while contacting ${t.name} for selected-machine settings. The operation may still be running remotely; reload before retrying.`:i==="Remote machine unavailable"?`Could not reach ${t.name} for selected-machine settings. Check the machine connection and try again.`:i}function MQ(e){return e==="Not Found"||/route\s+(GET|PUT):?\/api\/(config|plugins)\b.*not found/iu.test(e)||/cannot\s+(GET|PUT)\s+.*\/api\/(config|plugins)\b/iu.test(e)}function r7(e){return zg(e)}function ja(e){return e.kind==="local"?`${e.name} (local gateway)`:`${e.name} (remote machine)`}function Iw(e,t){return e.kind==="local"?{state:"supported"}:t?.ok!==!0?{state:"unknown"}:vs(t,Kr.piPackagesManage)?{state:"supported"}:{state:"unsupported",message:s7(e)}}function zw(e){return`${e.state}:${e.message??""}`}function sb(e){return e?.state==="unsupported"}function s7(e){return`Pi package management is not available on ${e.name}. Update and restart Omp-Web on that machine, then try again.`}function AQ(e){return e.kind==="local"}function o7(e){return e.trim()}function BQ(e){if(o7(e)==="")return"Enter a Pi package source accepted by Pi, such as npm:@scope/package, a git/URL source, or a local path."}function _Q(e){return e.scope==="project"?"Project scope":"User scope"}function LQ(e){return e.filtered?"Filtered by current Pi package settings":"Available in this PI WEB process"}function PQ(e){return e.installedPath??"Installed path not reported by Pi"}function a7(e){return e.scope==="user"}function EQ(e){if(!a7(e))return"Project-scope Pi packages are listed for visibility, but PI WEB only updates user-scope Pi packages safely from this view."}function RQ(e){return e.length>0&&e.every(a7)}function IQ(e){if(e.length===0)return"No Pi packages are configured yet.";if(!RQ(e))return"Update all is disabled while project-scope Pi packages are listed; update user-scope packages individually."}function Hh(e,t,i){return e?.kind!==t?!1:i===void 0||e.source===i}function zQ(e,t=r7(void 0)){const i=e==="install"?"installed":e==="remove"?"removed":"updated",r=t.kind==="local"?"":` on ${t.name}`,s=t.kind==="local"?"each idle PI WEB session":`each idle PI WEB session on ${t.name}`,o=t.kind==="local"?"PI WEB browser plugin changes":`PI WEB browser plugin changes served by ${t.name}`;return`Pi package ${i}${r}. Type /reload in ${s} to rediscover Pi runtime resources: extensions, skills, prompt templates, themes, and context/system prompt files. Reload the browser page separately for ${o}.`}function n7(e,t){const i=e.trim();return t.kind!=="remote"?i:DQ(i)?s7(t):i==="Remote machine timeout"?`Timed out while contacting ${t.name} for Pi package management. The package operation may still be running remotely; reload the package list before retrying.`:i==="Remote machine unavailable"?`Could not reach ${t.name} for Pi package management. Check the machine connection and try again.`:i}function DQ(e){return e==="Not Found"||/route\s+(GET|POST):?\/api\/pi-packages\b.*not found/iu.test(e)||/cannot\s+(GET|POST)\s+.*\/api\/pi-packages\b/iu.test(e)}var FQ=Object.defineProperty,OQ=Object.getOwnPropertyDescriptor,Lr=(e,t,i,r)=>{for(var s=r>1?void 0:r?OQ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&FQ(t,i,s),s};let rr=class extends we{constructor(){super(...arguments),this.loading=!1,this.error="",this.operationMessage="",this.installSource="",this.validationMessage=""}render(){const e=this.packagesResponse?.packages??[],t=this.packageTarget,i=ja(t),r=this.packageManagementUnavailable,s=this.packagesResponse!==void 0&&!r;return T`
4190
4198
  <settings-panel-frame
4191
4199
  heading="Pi packages"
4192
- .description=${OQ(i)}
4200
+ .description=${NQ(i)}
4193
4201
  actionLabel="Reload"
4194
4202
  actionTitle=${r?this.packageManagementUnavailableMessage(i):`Reload Pi packages from ${i}`}
4195
4203
  .actionDisabled=${this.loading||this.isOperating||r}
@@ -4211,7 +4219,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4211
4219
  ${this.validationMessage===""?null:T`<div class="field-error">${this.validationMessage}</div>`}
4212
4220
  <small>Installs run on ${e} and use Pi's default package location, equivalent to <code>pi install &lt;source&gt;</code>. PI WEB does not ask you to choose an install location.</small>
4213
4221
  </form>
4214
- `}renderPackageList(e,t){const i=ja(t),s=this.packageManagementUnavailable?this.packageManagementUnavailableMessage(i):RQ(e),o=s!==void 0&&e.length>0;return T`
4222
+ `}renderPackageList(e,t){const i=ja(t),s=this.packageManagementUnavailable?this.packageManagementUnavailableMessage(i):IQ(e),o=s!==void 0&&e.length>0;return T`
4215
4223
  <section class="package-section" aria-label="Configured Pi packages">
4216
4224
  <div class="package-toolbar">
4217
4225
  <div>
@@ -4230,12 +4238,12 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4230
4238
  <div class="package-list">
4231
4239
  ${e.map(i=>this.renderPackage(i))}
4232
4240
  </div>
4233
- `}renderPackage(e){const t=ja(this.packageTarget),i=this.packageManagementUnavailable,r=i?this.packageManagementUnavailableMessage(t):PQ(e),s=i?this.packageManagementUnavailableMessage(t):"Remove this Pi package",o=Hh(this.operation,"update",e.source),a=Hh(this.operation,"remove",e.source);return T`
4241
+ `}renderPackage(e){const t=ja(this.packageTarget),i=this.packageManagementUnavailable,r=i?this.packageManagementUnavailableMessage(t):EQ(e),s=i?this.packageManagementUnavailableMessage(t):"Remove this Pi package",o=Hh(this.operation,"update",e.source),a=Hh(this.operation,"remove",e.source);return T`
4234
4242
  <article class=${`package-card${e.filtered?" filtered":""}`}>
4235
4243
  <div class="package-main">
4236
4244
  <strong>${e.source}</strong>
4237
- <small>${BQ(e)} · ${_Q(e)}</small>
4238
- <small>Installed path: <code>${LQ(e)}</code></small>
4245
+ <small>${_Q(e)} · ${LQ(e)}</small>
4246
+ <small>Installed path: <code>${PQ(e)}</code></small>
4239
4247
  ${r===void 0?null:T`<small class="action-note">${r}</small>`}
4240
4248
  </div>
4241
4249
  <div class="package-actions">
@@ -4243,7 +4251,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4243
4251
  <button class="danger" title=${s} ?disabled=${this.isOperating||i} @click=${()=>{this.removePackage(e)}}>${a?"Removing…":"Remove"}</button>
4244
4252
  </div>
4245
4253
  </article>
4246
- `}updateInstallSource(e){this.installSource=e.target instanceof HTMLInputElement?e.target.value:"",this.validationMessage=""}async installPackage(e){e.preventDefault();const t=AQ(this.installSource);if(t!==void 0){this.validationMessage=t;return}const i=o7(this.installSource);try{await this.onInstallPackage?.(i),this.installSource="",this.validationMessage=""}catch{}}async removePackage(e){try{await this.onRemovePackage?.(e.source,e.scope)}catch{}}async updatePackage(e){try{await this.onUpdatePackage?.(e)}catch{}}get packageTarget(){return this.targetMachine??r7(void 0)}get packageManagementUnavailable(){return sb(this.managementSupport)}packageManagementUnavailableMessage(e){return this.managementSupport?.message??`Pi package management is not available on ${e}.`}get isOperating(){return this.operation!==void 0}};rr.styles=_e`
4254
+ `}updateInstallSource(e){this.installSource=e.target instanceof HTMLInputElement?e.target.value:"",this.validationMessage=""}async installPackage(e){e.preventDefault();const t=BQ(this.installSource);if(t!==void 0){this.validationMessage=t;return}const i=o7(this.installSource);try{await this.onInstallPackage?.(i),this.installSource="",this.validationMessage=""}catch{}}async removePackage(e){try{await this.onRemovePackage?.(e.source,e.scope)}catch{}}async updatePackage(e){try{await this.onUpdatePackage?.(e)}catch{}}get packageTarget(){return this.targetMachine??r7(void 0)}get packageManagementUnavailable(){return sb(this.managementSupport)}packageManagementUnavailableMessage(e){return this.managementSupport?.message??`Pi package management is not available on ${e}.`}get isOperating(){return this.operation!==void 0}};rr.styles=_e`
4247
4255
  :host { display: block; }
4248
4256
  .package-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
4249
4257
  .package-toolbar > div, .package-main { display: grid; gap: 6px; min-width: 0; }
@@ -4278,10 +4286,10 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4278
4286
  .package-actions { justify-self: start; flex-wrap: wrap; }
4279
4287
  .package-main strong, .package-main small { white-space: normal; }
4280
4288
  }
4281
- `;Lr([P({attribute:!1})],rr.prototype,"packagesResponse",2);Lr([P({type:Boolean})],rr.prototype,"loading",2);Lr([P({attribute:!1})],rr.prototype,"operation",2);Lr([P({attribute:!1})],rr.prototype,"targetMachine",2);Lr([P({attribute:!1})],rr.prototype,"managementSupport",2);Lr([P()],rr.prototype,"error",2);Lr([P()],rr.prototype,"operationMessage",2);Lr([P({attribute:!1})],rr.prototype,"onReload",2);Lr([P({attribute:!1})],rr.prototype,"onInstallPackage",2);Lr([P({attribute:!1})],rr.prototype,"onRemovePackage",2);Lr([P({attribute:!1})],rr.prototype,"onUpdatePackage",2);Lr([Ct()],rr.prototype,"installSource",2);Lr([Ct()],rr.prototype,"validationMessage",2);rr=Lr([Ae("settings-packages-panel")],rr);function OQ(e){return T`Managing Pi packages on <strong>${e}</strong>. Install, remove, and update packages managed by Pi on the selected machine. Pi packages can provide extensions, skills, prompt templates, themes, context/system prompt files, and PI WEB browser plugins.`}var NQ=Object.defineProperty,WQ=Object.getOwnPropertyDescriptor,no=(e,t,i,r)=>{for(var s=r>1?void 0:r?WQ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&NQ(t,i,s),s};let as=class extends we{constructor(){super(...arguments),this.loading=!1,this.saving=!1,this.error="",this.savedMessage="",this.targetLabel="local (local gateway)"}render(){const e=this.pluginsResponse?.plugins??[],t=this.pluginsResponse!==void 0;return T`
4289
+ `;Lr([P({attribute:!1})],rr.prototype,"packagesResponse",2);Lr([P({type:Boolean})],rr.prototype,"loading",2);Lr([P({attribute:!1})],rr.prototype,"operation",2);Lr([P({attribute:!1})],rr.prototype,"targetMachine",2);Lr([P({attribute:!1})],rr.prototype,"managementSupport",2);Lr([P()],rr.prototype,"error",2);Lr([P()],rr.prototype,"operationMessage",2);Lr([P({attribute:!1})],rr.prototype,"onReload",2);Lr([P({attribute:!1})],rr.prototype,"onInstallPackage",2);Lr([P({attribute:!1})],rr.prototype,"onRemovePackage",2);Lr([P({attribute:!1})],rr.prototype,"onUpdatePackage",2);Lr([Ct()],rr.prototype,"installSource",2);Lr([Ct()],rr.prototype,"validationMessage",2);rr=Lr([Ae("settings-packages-panel")],rr);function NQ(e){return T`Managing Pi packages on <strong>${e}</strong>. Install, remove, and update packages managed by Pi on the selected machine. Pi packages can provide extensions, skills, prompt templates, themes, context/system prompt files, and PI WEB browser plugins.`}var WQ=Object.defineProperty,qQ=Object.getOwnPropertyDescriptor,no=(e,t,i,r)=>{for(var s=r>1?void 0:r?qQ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&WQ(t,i,s),s};let as=class extends we{constructor(){super(...arguments),this.loading=!1,this.saving=!1,this.error="",this.savedMessage="",this.targetLabel="local (local gateway)"}render(){const e=this.pluginsResponse?.plugins??[],t=this.pluginsResponse!==void 0;return T`
4282
4290
  <settings-panel-frame
4283
4291
  heading="PI WEB plugins"
4284
- .description=${qQ(this.targetLabel)}
4292
+ .description=${HQ(this.targetLabel)}
4285
4293
  actionLabel="Reload"
4286
4294
  actionTitle=${`Reload PI WEB plugins from ${this.targetLabel}`}
4287
4295
  .actionDisabled=${this.loading}
@@ -4327,10 +4335,10 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4327
4335
  .plugin-card { grid-template-columns: minmax(0, 1fr); align-items: start; }
4328
4336
  .toggle { justify-self: start; }
4329
4337
  }
4330
- `;no([P({attribute:!1})],as.prototype,"pluginsResponse",2);no([P({attribute:!1})],as.prototype,"configResponse",2);no([P({type:Boolean})],as.prototype,"loading",2);no([P({type:Boolean})],as.prototype,"saving",2);no([P()],as.prototype,"error",2);no([P()],as.prototype,"savedMessage",2);no([P()],as.prototype,"targetLabel",2);no([P({attribute:!1})],as.prototype,"onReload",2);no([P({attribute:!1})],as.prototype,"onTogglePlugin",2);as=no([Ae("settings-plugins-panel")],as);function qQ(e){return T`Enable or disable discovered PI WEB browser plugins on <strong>${e}</strong>. This is separate from installing Pi packages. Reload the browser tab to apply plugin runtime changes.`}var HQ=Object.defineProperty,jQ=Object.getOwnPropertyDescriptor,Yr=(e,t,i,r)=>{for(var s=r>1?void 0:r?jQ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&HQ(t,i,s),s};const Dw={capture:!0},UQ=[{value:"auto",label:"Auto/default",description:"Desktop-like Enter sends; mobile, coarse pointer, or narrow screens insert a new line."},{value:"send",label:"Enter sends message",description:"Enter sends the chat message; Shift+Enter adds a new line when supported."},{value:"newline",label:"Enter inserts new line",description:"Enter adds a line break; Shift+Enter sends the chat message when supported."}];function YQ(){return T`Edit app shortcuts by action. Type a shortcut such as <code>mod+k</code> or <code>mod+g p</code>, record one from the keyboard, disable it with None, or reset it to the default. When shortcuts conflict, custom shortcuts win before defaults; ties are resolved by action id, and shorter shortcuts shadow longer sequences with the same prefix.`}let fr=class extends we{constructor(){super(...arguments),this.actions=[],this.loading=!1,this.saving=!1,this.error="",this.savedMessage="",this.drafts={},this.localError="",this.promptEnterPreference=fp(),this.recordingListenerActive=!1,this.onRecordKeyDown=e=>{const t=this.recording;if(t===void 0)return;if(e.preventDefault(),e.stopPropagation(),e.key==="Escape"){this.stopRecording();return}const i=Ik(e);if(i===void 0){this.localError="Press a letter, number, punctuation, function, or navigation key. Press Esc to cancel recording.";return}if(t.tokens.length===0&&!kc(i)){this.localError="Start shortcuts with Ctrl/⌘ or Alt so normal typing is not captured.";return}const r=[...t.tokens,i];this.localError="",this.drafts={[t.actionId]:r.join(" ")},this.recording={actionId:t.actionId,tokens:r},this.armRecordingTimer()}}willUpdate(e){e.has("configResponse")&&this.configResponse!==void 0&&(this.drafts={},this.localError="",this.stopRecording())}disconnectedCallback(){this.stopRecording(),super.disconnectedCallback()}render(){const e=KQ(this.actions),t=this.shortcutResolutions();return T`
4338
+ `;no([P({attribute:!1})],as.prototype,"pluginsResponse",2);no([P({attribute:!1})],as.prototype,"configResponse",2);no([P({type:Boolean})],as.prototype,"loading",2);no([P({type:Boolean})],as.prototype,"saving",2);no([P()],as.prototype,"error",2);no([P()],as.prototype,"savedMessage",2);no([P()],as.prototype,"targetLabel",2);no([P({attribute:!1})],as.prototype,"onReload",2);no([P({attribute:!1})],as.prototype,"onTogglePlugin",2);as=no([Ae("settings-plugins-panel")],as);function HQ(e){return T`Enable or disable discovered PI WEB browser plugins on <strong>${e}</strong>. This is separate from installing Pi packages. Reload the browser tab to apply plugin runtime changes.`}var jQ=Object.defineProperty,UQ=Object.getOwnPropertyDescriptor,Yr=(e,t,i,r)=>{for(var s=r>1?void 0:r?UQ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&jQ(t,i,s),s};const Dw={capture:!0},YQ=[{value:"auto",label:"Auto/default",description:"Desktop-like Enter sends; mobile, coarse pointer, or narrow screens insert a new line."},{value:"send",label:"Enter sends message",description:"Enter sends the chat message; Shift+Enter adds a new line when supported."},{value:"newline",label:"Enter inserts new line",description:"Enter adds a line break; Shift+Enter sends the chat message when supported."}];function GQ(){return T`Edit app shortcuts by action. Type a shortcut such as <code>mod+k</code> or <code>mod+g p</code>, record one from the keyboard, disable it with None, or reset it to the default. When shortcuts conflict, custom shortcuts win before defaults; ties are resolved by action id, and shorter shortcuts shadow longer sequences with the same prefix.`}let fr=class extends we{constructor(){super(...arguments),this.actions=[],this.loading=!1,this.saving=!1,this.error="",this.savedMessage="",this.drafts={},this.localError="",this.promptEnterPreference=fp(),this.recordingListenerActive=!1,this.onRecordKeyDown=e=>{const t=this.recording;if(t===void 0)return;if(e.preventDefault(),e.stopPropagation(),e.key==="Escape"){this.stopRecording();return}const i=Ik(e);if(i===void 0){this.localError="Press a letter, number, punctuation, function, or navigation key. Press Esc to cancel recording.";return}if(t.tokens.length===0&&!kc(i)){this.localError="Start shortcuts with Ctrl/⌘ or Alt so normal typing is not captured.";return}const r=[...t.tokens,i];this.localError="",this.drafts={[t.actionId]:r.join(" ")},this.recording={actionId:t.actionId,tokens:r},this.armRecordingTimer()}}willUpdate(e){e.has("configResponse")&&this.configResponse!==void 0&&(this.drafts={},this.localError="",this.stopRecording())}disconnectedCallback(){this.stopRecording(),super.disconnectedCallback()}render(){const e=ZQ(this.actions),t=this.shortcutResolutions();return T`
4331
4339
  <settings-panel-frame
4332
4340
  heading="Keyboard shortcuts"
4333
- .description=${YQ()}
4341
+ .description=${GQ()}
4334
4342
  actionLabel="Reload"
4335
4343
  .actionDisabled=${this.loading}
4336
4344
  .notices=${this.panelNotices()}
@@ -4361,7 +4369,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4361
4369
  <p>Choose what Enter does in this browser. Shift+Enter does the opposite when supported; automatic touch-keyboard capitalization is ignored to avoid accidental sends.</p>
4362
4370
  </div>
4363
4371
  <div class="prompt-enter-options" role="radiogroup" aria-label="Enter and Shift Enter behavior in the chat composer">
4364
- ${UQ.map(e=>T`
4372
+ ${YQ.map(e=>T`
4365
4373
  <label class="prompt-enter-option">
4366
4374
  <input
4367
4375
  type="radio"
@@ -4378,8 +4386,8 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4378
4386
  `)}
4379
4387
  </div>
4380
4388
  </section>
4381
- `}updatePromptEnterPreference(e){this.promptEnterPreference=e,iZ(e)}renderShortcutRow(e,t){const i=this.configResponse?.config.shortcuts,r=gu(e.id,i),s=tJ(e,i),o=this.shortcutInputText(e),a=o.trim()===""?void 0:Lp(o),n=a?.ok===!0?a.shortcut:JQ(e,i),l=r!==void 0,c=this.drafts[e.id]!==void 0,h=c&&o.trim()!==""?"custom":s,d=this.recordingHint(e.id),u=VQ(t);return T`
4382
- <article class=${GQ(t)}>
4389
+ `}updatePromptEnterPreference(e){this.promptEnterPreference=e,iZ(e)}renderShortcutRow(e,t){const i=this.configResponse?.config.shortcuts,r=gu(e.id,i),s=eJ(e,i),o=this.shortcutInputText(e),a=o.trim()===""?void 0:Lp(o),n=a?.ok===!0?a.shortcut:tJ(e,i),l=r!==void 0,c=this.drafts[e.id]!==void 0,h=c&&o.trim()!==""?"custom":s,d=this.recordingHint(e.id),u=KQ(t);return T`
4390
+ <article class=${XQ(t)}>
4383
4391
  <div class="shortcut-main">
4384
4392
  <strong>${e.title}</strong>
4385
4393
  ${e.description!==void 0&&e.description!==""?T`<small>${e.description}</small>`:null}
@@ -4389,8 +4397,8 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4389
4397
  <div class="shortcut-editor">
4390
4398
  <div class="shortcut-status">
4391
4399
  ${n!==void 0&&n!==""?T`<kbd>${Qh(n)}</kbd>`:T`<span class="unassigned">${s==="disabled"?"Disabled":"Unassigned"}</span>`}
4392
- <small class=${h}>${eJ(h)}${c?" · Unsaved":""}</small>
4393
- ${u===void 0?null:T`<small class=${XQ(t)}>${u}</small>`}
4400
+ <small class=${h}>${iJ(h)}${c?" · Unsaved":""}</small>
4401
+ ${u===void 0?null:T`<small class=${VQ(t)}>${u}</small>`}
4394
4402
  </div>
4395
4403
  <label class="shortcut-input-label">
4396
4404
  <span>Shortcut</span>
@@ -4403,7 +4411,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4403
4411
  autocapitalize="off"
4404
4412
  spellcheck="false"
4405
4413
  ?disabled=${this.saving}
4406
- @input=${p=>{this.updateDraft(e.id,iJ(p))}}
4414
+ @input=${p=>{this.updateDraft(e.id,rJ(p))}}
4407
4415
  >
4408
4416
  </label>
4409
4417
  ${d!==""?T`<small class="recording-hint">${d}</small>`:null}
@@ -4415,7 +4423,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4415
4423
  </div>
4416
4424
  </div>
4417
4425
  </article>
4418
- `}shortcutInputText(e){const t=this.drafts[e.id];if(t!==void 0)return t;const i=gu(e.id,this.configResponse?.config.shortcuts);return i===null?"":i??e.shortcut??""}recordingHint(e){const t=this.recording;return t?.actionId!==e?"":t.tokens.length===0?"Recording: press Ctrl/⌘ or Alt with a key. Press Esc to cancel.":`Recording: ${Qh(t.tokens.join(" "))}. Press another key to add a sequence, or wait to finish.`}updateDraft(e,t){this.drafts={[e]:t},this.localError=""}async saveShortcut(e){this.stopRecording();const t=this.shortcutInputText(e).trim(),i=Lp(t);if(!i.ok){this.localError=i.message;return}this.localError="",await this.saveShortcutPreference(e.id,i.shortcut)}async setShortcutNone(e){this.stopRecording(),this.localError="",await this.saveShortcutPreference(e,null)}async resetShortcut(e){this.stopRecording(),this.localError="",await this.saveShortcutPreference(e,void 0)}async saveShortcutPreference(e,t){const i={...this.configResponse?.config??{}},r=i.shortcuts??{},s=t===void 0?QQ(r,e):{...r,[e]:t};Object.keys(s).length===0?delete i.shortcuts:i.shortcuts=s,await this.onSave?.(i)}shortcutResolutions(){return new Map(em(this.actions,this.previewShortcutConfig(),{enabledOnly:!0}).map(e=>[e.action.id,e]))}previewShortcutConfig(){const e={...this.configResponse?.config.shortcuts??{}};for(const[t,i]of Object.entries(this.drafts)){const r=i.trim();if(r==="")continue;const s=Lp(r);s.ok&&(e[t]=s.shortcut)}return Object.keys(e).length===0?void 0:e}async toggleRecording(e){if(this.recording?.actionId===e){this.stopRecording();return}this.stopRecording(),this.localError="",this.recording={actionId:e,tokens:[]},this.ensureRecordingListener(),await this.updateComplete,this.focusShortcutInput(e)}focusShortcutInput(e){for(const t of this.renderRoot.querySelectorAll(".shortcut-input"))if(t.dataset.actionId===e){t.focus(),t.select();return}}armRecordingTimer(){this.clearRecordingTimer(),this.recordingTimer=window.setTimeout(()=>{this.recordingTimer=void 0,this.stopRecording()},Ek)}stopRecording(){this.clearRecordingTimer(),this.removeRecordingListener(),this.recording=void 0}clearRecordingTimer(){this.recordingTimer!==void 0&&(window.clearTimeout(this.recordingTimer),this.recordingTimer=void 0)}ensureRecordingListener(){this.recordingListenerActive||(window.addEventListener("keydown",this.onRecordKeyDown,Dw),this.recordingListenerActive=!0)}removeRecordingListener(){this.recordingListenerActive&&(window.removeEventListener("keydown",this.onRecordKeyDown,Dw),this.recordingListenerActive=!1)}};fr.styles=_e`
4426
+ `}shortcutInputText(e){const t=this.drafts[e.id];if(t!==void 0)return t;const i=gu(e.id,this.configResponse?.config.shortcuts);return i===null?"":i??e.shortcut??""}recordingHint(e){const t=this.recording;return t?.actionId!==e?"":t.tokens.length===0?"Recording: press Ctrl/⌘ or Alt with a key. Press Esc to cancel.":`Recording: ${Qh(t.tokens.join(" "))}. Press another key to add a sequence, or wait to finish.`}updateDraft(e,t){this.drafts={[e]:t},this.localError=""}async saveShortcut(e){this.stopRecording();const t=this.shortcutInputText(e).trim(),i=Lp(t);if(!i.ok){this.localError=i.message;return}this.localError="",await this.saveShortcutPreference(e.id,i.shortcut)}async setShortcutNone(e){this.stopRecording(),this.localError="",await this.saveShortcutPreference(e,null)}async resetShortcut(e){this.stopRecording(),this.localError="",await this.saveShortcutPreference(e,void 0)}async saveShortcutPreference(e,t){const i={...this.configResponse?.config??{}},r=i.shortcuts??{},s=t===void 0?JQ(r,e):{...r,[e]:t};Object.keys(s).length===0?delete i.shortcuts:i.shortcuts=s,await this.onSave?.(i)}shortcutResolutions(){return new Map(em(this.actions,this.previewShortcutConfig(),{enabledOnly:!0}).map(e=>[e.action.id,e]))}previewShortcutConfig(){const e={...this.configResponse?.config.shortcuts??{}};for(const[t,i]of Object.entries(this.drafts)){const r=i.trim();if(r==="")continue;const s=Lp(r);s.ok&&(e[t]=s.shortcut)}return Object.keys(e).length===0?void 0:e}async toggleRecording(e){if(this.recording?.actionId===e){this.stopRecording();return}this.stopRecording(),this.localError="",this.recording={actionId:e,tokens:[]},this.ensureRecordingListener(),await this.updateComplete,this.focusShortcutInput(e)}focusShortcutInput(e){for(const t of this.renderRoot.querySelectorAll(".shortcut-input"))if(t.dataset.actionId===e){t.focus(),t.select();return}}armRecordingTimer(){this.clearRecordingTimer(),this.recordingTimer=window.setTimeout(()=>{this.recordingTimer=void 0,this.stopRecording()},Ek)}stopRecording(){this.clearRecordingTimer(),this.removeRecordingListener(),this.recording=void 0}clearRecordingTimer(){this.recordingTimer!==void 0&&(window.clearTimeout(this.recordingTimer),this.recordingTimer=void 0)}ensureRecordingListener(){this.recordingListenerActive||(window.addEventListener("keydown",this.onRecordKeyDown,Dw),this.recordingListenerActive=!0)}removeRecordingListener(){this.recordingListenerActive&&(window.removeEventListener("keydown",this.onRecordKeyDown,Dw),this.recordingListenerActive=!1)}};fr.styles=_e`
4419
4427
  :host { display: block; }
4420
4428
  h3, p { margin: 0; }
4421
4429
  h3 { font-size: 13px; line-height: 1.3; }
@@ -4471,7 +4479,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4471
4479
  .shortcut-row { grid-template-columns: minmax(0, 1fr); align-items: start; }
4472
4480
  .shortcut-status, .shortcut-actions { justify-content: flex-start; }
4473
4481
  }
4474
- `;Yr([P({attribute:!1})],fr.prototype,"actions",2);Yr([P({attribute:!1})],fr.prototype,"configResponse",2);Yr([P({type:Boolean})],fr.prototype,"loading",2);Yr([P({type:Boolean})],fr.prototype,"saving",2);Yr([P()],fr.prototype,"error",2);Yr([P()],fr.prototype,"savedMessage",2);Yr([P({attribute:!1})],fr.prototype,"onReload",2);Yr([P({attribute:!1})],fr.prototype,"onSave",2);Yr([Ct()],fr.prototype,"drafts",2);Yr([Ct()],fr.prototype,"localError",2);Yr([Ct()],fr.prototype,"promptEnterPreference",2);Yr([Ct()],fr.prototype,"recording",2);fr=Yr([Ae("settings-shortcuts-panel")],fr);function GQ(e){return e?.active===!1?"shortcut-row shadowed":e?.active===!0&&e.shadows.length>0?"shortcut-row shadowing":"shortcut-row"}function XQ(e){return e?.active===!1?"conflict shadowed":"conflict shadowing"}function VQ(e){if(e===void 0)return;if(!e.active)return`Shadowed by ${e.shadowedBy?.action.title??"another action"}`;const t=e.shadows.length;if(t===0)return;const i=e.shadows.slice(0,2).map(s=>s.action.title).join(", "),r=t>2?`, +${String(t-2)} more`:"";return`Shadows ${String(t)} ${t===1?"action":"actions"}: ${i}${r}`}function KQ(e){const t=new Map;for(const i of[...e].sort(ZQ)){const r=i.group??"Other";t.set(r,[...t.get(r)??[],i])}return[...t.entries()].map(([i,r])=>({name:i,actions:r}))}function ZQ(e,t){return(e.group??"Other").localeCompare(t.group??"Other")||e.title.localeCompare(t.title)}function gu(e,t){if(!(t===void 0||!Object.hasOwn(t,e)))return t[e]}function QQ(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>i!==t))}function JQ(e,t){const i=gu(e.id,t);if(i!==null)return i??e.shortcut}function tJ(e,t){const i=gu(e.id,t);return i===null?"disabled":i!==void 0?"custom":e.shortcut===void 0||e.shortcut===""?"unassigned":"default"}function eJ(e){switch(e){case"default":return"Default";case"custom":return"Custom";case"disabled":return"Disabled";case"unassigned":return"No default"}}function iJ(e){return e.target instanceof HTMLInputElement?e.target.value:""}async function rJ(e){const[t,i]=await Promise.allSettled([e.loadConfig(),e.loadPlugins()]),r={error:""},s=[];return t.status==="fulfilled"?r.config=t.value:s.push(`config: ${Je(t.reason)}`),i.status==="fulfilled"?r.plugins=i.value:s.push(`PI WEB plugins: ${Je(i.reason)}`),s.length>0&&(r.error=`Failed to load settings: ${s.join("; ")}`),r}async function sJ(e,t,i){if(sb(i))return{error:i.message??`Pi package management is not available on ${ja(e)}.`,skipped:!0};try{return{packagesResponse:await t(e.id),error:""}}catch(r){return{error:`Failed to load Pi packages from ${ja(e)}: ${n7(Je(r),e)}`}}}function oJ(e,t){return{...e,config:Fw(e.config,t.config),effectiveConfig:Fw(e.effectiveConfig,t.effectiveConfig)}}function Fw(e,t){return{...e,...t.pathAccess===void 0?{}:{pathAccess:t.pathAccess},...t.uploads===void 0?{}:{uploads:t.uploads},...t.maxUploadBytes===void 0?{}:{maxUploadBytes:t.maxUploadBytes}}}function aJ(e,t,i){const r=e.plugins??{},s=r[t]??{};return{plugins:{...r,[t]:{...s,enabled:i}}}}function nJ(e,t){return{...e,config:Ow(e.config,t.config),effectiveConfig:Ow(e.effectiveConfig,t.effectiveConfig)}}function Ow(e,t){return t.plugins===void 0?e:{...e,plugins:t.plugins}}var lJ=Object.defineProperty,cJ=Object.getOwnPropertyDescriptor,Ue=(e,t,i,r)=>{for(var s=r>1?void 0:r?cJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&lJ(t,i,s),s};let Ne=class extends we{constructor(){super(...arguments),this.section="general",this.actions=[],this.loading=!0,this.accessLoading=!0,this.sessiondLoading=!0,this.pluginLoading=!0,this.packageLoading=!0,this.saving=!1,this.error="",this.accessError="",this.sessiondError="",this.pluginError="",this.packageError="",this.savedMessage="",this.packageMessage="",this.loadRequestSeq=0,this.accessLoadRequestSeq=0,this.sessiondLoadRequestSeq=0,this.pluginLoadRequestSeq=0,this.packageLoadRequestSeq=0,this.packageMutationSeq=0}connectedCallback(){super.connectedCallback(),this.loadConfig(),this.loadAccessConfigForTarget(),this.loadSessiondConfigForTarget(),this.loadPluginsForTarget(),this.loadPackagesForTarget()}disconnectedCallback(){this.savedMessageTimer!==void 0&&window.clearTimeout(this.savedMessageTimer),this.savedMessageTimer=void 0,super.disconnectedCallback()}updated(e){const t=this.settingsTarget();if(e.has("machine")&&zg(e.get("machine")).id!==t.id){this.resetAccessStateForTargetChange(),this.isConnected&&this.loadAccessConfigForTarget(t),this.resetSessiondStateForTargetChange(),this.isConnected&&this.loadSessiondConfigForTarget(t),this.resetPluginStateForTargetChange(),this.isConnected&&this.loadPluginsForTarget(t),this.resetPackageStateForTargetChange(),this.isConnected&&this.loadPackagesForTarget(t);return}e.has("machineRuntime")&&(this.selectedMachineSettingsSupportNeedsReload(e.get("machineRuntime"),t)&&(this.resetAccessStateForTargetChange(),this.isConnected&&this.loadAccessConfigForTarget(t),this.resetSessiondStateForTargetChange(),this.isConnected&&this.loadSessiondConfigForTarget(t),this.resetPluginStateForTargetChange(),this.isConnected&&this.loadPluginsForTarget(t)),this.packageManagementSupportNeedsReload(e.get("machineRuntime"),t)&&(this.resetPackageStateForTargetChange(),this.isConnected&&this.loadPackagesForTarget(t)))}render(){return T`
4482
+ `;Yr([P({attribute:!1})],fr.prototype,"actions",2);Yr([P({attribute:!1})],fr.prototype,"configResponse",2);Yr([P({type:Boolean})],fr.prototype,"loading",2);Yr([P({type:Boolean})],fr.prototype,"saving",2);Yr([P()],fr.prototype,"error",2);Yr([P()],fr.prototype,"savedMessage",2);Yr([P({attribute:!1})],fr.prototype,"onReload",2);Yr([P({attribute:!1})],fr.prototype,"onSave",2);Yr([Ct()],fr.prototype,"drafts",2);Yr([Ct()],fr.prototype,"localError",2);Yr([Ct()],fr.prototype,"promptEnterPreference",2);Yr([Ct()],fr.prototype,"recording",2);fr=Yr([Ae("settings-shortcuts-panel")],fr);function XQ(e){return e?.active===!1?"shortcut-row shadowed":e?.active===!0&&e.shadows.length>0?"shortcut-row shadowing":"shortcut-row"}function VQ(e){return e?.active===!1?"conflict shadowed":"conflict shadowing"}function KQ(e){if(e===void 0)return;if(!e.active)return`Shadowed by ${e.shadowedBy?.action.title??"another action"}`;const t=e.shadows.length;if(t===0)return;const i=e.shadows.slice(0,2).map(s=>s.action.title).join(", "),r=t>2?`, +${String(t-2)} more`:"";return`Shadows ${String(t)} ${t===1?"action":"actions"}: ${i}${r}`}function ZQ(e){const t=new Map;for(const i of[...e].sort(QQ)){const r=i.group??"Other";t.set(r,[...t.get(r)??[],i])}return[...t.entries()].map(([i,r])=>({name:i,actions:r}))}function QQ(e,t){return(e.group??"Other").localeCompare(t.group??"Other")||e.title.localeCompare(t.title)}function gu(e,t){if(!(t===void 0||!Object.hasOwn(t,e)))return t[e]}function JQ(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>i!==t))}function tJ(e,t){const i=gu(e.id,t);if(i!==null)return i??e.shortcut}function eJ(e,t){const i=gu(e.id,t);return i===null?"disabled":i!==void 0?"custom":e.shortcut===void 0||e.shortcut===""?"unassigned":"default"}function iJ(e){switch(e){case"default":return"Default";case"custom":return"Custom";case"disabled":return"Disabled";case"unassigned":return"No default"}}function rJ(e){return e.target instanceof HTMLInputElement?e.target.value:""}async function sJ(e){const[t,i]=await Promise.allSettled([e.loadConfig(),e.loadPlugins()]),r={error:""},s=[];return t.status==="fulfilled"?r.config=t.value:s.push(`config: ${Je(t.reason)}`),i.status==="fulfilled"?r.plugins=i.value:s.push(`PI WEB plugins: ${Je(i.reason)}`),s.length>0&&(r.error=`Failed to load settings: ${s.join("; ")}`),r}async function oJ(e,t,i){if(sb(i))return{error:i.message??`Pi package management is not available on ${ja(e)}.`,skipped:!0};try{return{packagesResponse:await t(e.id),error:""}}catch(r){return{error:`Failed to load Pi packages from ${ja(e)}: ${n7(Je(r),e)}`}}}function aJ(e,t){return{...e,config:Fw(e.config,t.config),effectiveConfig:Fw(e.effectiveConfig,t.effectiveConfig)}}function Fw(e,t){return{...e,...t.pathAccess===void 0?{}:{pathAccess:t.pathAccess},...t.uploads===void 0?{}:{uploads:t.uploads},...t.maxUploadBytes===void 0?{}:{maxUploadBytes:t.maxUploadBytes}}}function nJ(e,t,i){const r=e.plugins??{},s=r[t]??{};return{plugins:{...r,[t]:{...s,enabled:i}}}}function lJ(e,t){return{...e,config:Ow(e.config,t.config),effectiveConfig:Ow(e.effectiveConfig,t.effectiveConfig)}}function Ow(e,t){return t.plugins===void 0?e:{...e,plugins:t.plugins}}var cJ=Object.defineProperty,hJ=Object.getOwnPropertyDescriptor,Ue=(e,t,i,r)=>{for(var s=r>1?void 0:r?hJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&cJ(t,i,s),s};let Ne=class extends we{constructor(){super(...arguments),this.section="general",this.actions=[],this.loading=!0,this.accessLoading=!0,this.sessiondLoading=!0,this.pluginLoading=!0,this.packageLoading=!0,this.saving=!1,this.error="",this.accessError="",this.sessiondError="",this.pluginError="",this.packageError="",this.savedMessage="",this.packageMessage="",this.loadRequestSeq=0,this.accessLoadRequestSeq=0,this.sessiondLoadRequestSeq=0,this.pluginLoadRequestSeq=0,this.packageLoadRequestSeq=0,this.packageMutationSeq=0}connectedCallback(){super.connectedCallback(),this.loadConfig(),this.loadAccessConfigForTarget(),this.loadSessiondConfigForTarget(),this.loadPluginsForTarget(),this.loadPackagesForTarget()}disconnectedCallback(){this.savedMessageTimer!==void 0&&window.clearTimeout(this.savedMessageTimer),this.savedMessageTimer=void 0,super.disconnectedCallback()}updated(e){const t=this.settingsTarget();if(e.has("machine")&&zg(e.get("machine")).id!==t.id){this.resetAccessStateForTargetChange(),this.isConnected&&this.loadAccessConfigForTarget(t),this.resetSessiondStateForTargetChange(),this.isConnected&&this.loadSessiondConfigForTarget(t),this.resetPluginStateForTargetChange(),this.isConnected&&this.loadPluginsForTarget(t),this.resetPackageStateForTargetChange(),this.isConnected&&this.loadPackagesForTarget(t);return}e.has("machineRuntime")&&(this.selectedMachineSettingsSupportNeedsReload(e.get("machineRuntime"),t)&&(this.resetAccessStateForTargetChange(),this.isConnected&&this.loadAccessConfigForTarget(t),this.resetSessiondStateForTargetChange(),this.isConnected&&this.loadSessiondConfigForTarget(t),this.resetPluginStateForTargetChange(),this.isConnected&&this.loadPluginsForTarget(t)),this.packageManagementSupportNeedsReload(e.get("machineRuntime"),t)&&(this.resetPackageStateForTargetChange(),this.isConnected&&this.loadPackagesForTarget(t)))}render(){return T`
4475
4483
  <div class="backdrop" @mousedown=${()=>this.onClose?.()}>
4476
4484
  <section class="settings-shell" role="dialog" aria-modal="true" aria-label="OMP Web settings" @mousedown=${e=>{e.stopPropagation()}} @keydown=${e=>{this.handleKeyDown(e)}}>
4477
4485
  <header class="settings-header">
@@ -4564,7 +4572,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4564
4572
  <strong>${t}</strong>
4565
4573
  <small>${i}</small>
4566
4574
  </button>
4567
- `}navigate(e){this.onNavigate?.(e)}async loadConfig(){const e=++this.loadRequestSeq;this.loading=!0,this.error="";try{const t=await rJ({loadConfig:()=>zs.config(),loadPlugins:()=>Ul.plugins()});if(!this.isCurrentLoad(e))return;t.config!==void 0&&(this.configResponse=t.config),t.plugins!==void 0&&(this.pluginsResponse=t.plugins),this.error=t.error}finally{this.isCurrentLoad(e)&&(this.loading=!1)}}async loadAccessConfigForTarget(e=this.settingsTarget()){const t=++this.accessLoadRequestSeq,i=this.selectedMachineSettingsSupport(e);if(vn(i)){this.accessConfigResponse=void 0,this.accessLoading=!1,this.accessError=i.message??`Selected-machine settings are not available on ${Hi(e)}.`;return}this.accessLoading=!0,this.accessError="";try{const r=await zs.config(e.id);if(!this.isCurrentAccessLoad(t,e))return;this.accessConfigResponse=r}catch(r){this.isCurrentAccessLoad(t,e)&&(this.accessError=`Failed to load file access/upload config from ${Hi(e)}: ${Ko(Je(r),e)}`)}finally{this.isCurrentAccessLoad(t,e)&&(this.accessLoading=!1)}}async loadSessiondConfigForTarget(e=this.settingsTarget()){const t=++this.sessiondLoadRequestSeq,i=this.selectedMachineSettingsSupport(e);if(vn(i)){this.sessiondConfigResponse=void 0,this.sessiondLoading=!1,this.sessiondError=i.message??`Selected-machine settings are not available on ${Hi(e)}.`;return}this.sessiondLoading=!0,this.sessiondError="";try{const r=await zs.config(e.id);if(!this.isCurrentSessiondLoad(t,e))return;this.sessiondConfigResponse=r}catch(r){this.isCurrentSessiondLoad(t,e)&&(this.sessiondError=`Failed to load session-daemon config from ${Hi(e)}: ${Ko(Je(r),e)}`)}finally{this.isCurrentSessiondLoad(t,e)&&(this.sessiondLoading=!1)}}async loadPluginsForTarget(e=this.settingsTarget()){const t=++this.pluginLoadRequestSeq,i=this.selectedMachineSettingsSupport(e);if(vn(i)){this.selectedPluginConfigResponse=void 0,this.selectedPluginsResponse=void 0,this.pluginLoading=!1,this.pluginError=i.message??`Selected-machine settings are not available on ${Hi(e)}.`;return}this.pluginLoading=!0,this.pluginError="";try{const[r,s]=await Promise.allSettled([zs.config(e.id),Ul.plugins(e.id)]);if(!this.isCurrentPluginLoad(t,e))return;const o=[];r.status==="fulfilled"?this.selectedPluginConfigResponse=r.value:o.push(`config: ${Ko(Je(r.reason),e)}`),s.status==="fulfilled"?this.selectedPluginsResponse=s.value:o.push(`PI WEB plugins: ${Ko(Je(s.reason),e)}`),this.pluginError=o.length===0?"":`Failed to load PI WEB plugin settings from ${Hi(e)}: ${o.join("; ")}`}finally{this.isCurrentPluginLoad(t,e)&&(this.pluginLoading=!1)}}async loadPackagesForTarget(e=this.packageTarget()){const t=++this.packageLoadRequestSeq;this.packageLoading=!0,this.packageError="",this.packageMessage="";try{const i=await sJ(e,r=>Yl.packages(r),this.packageManagementSupport(e));if(!this.isCurrentPackageLoad(t,e))return;this.packagesResponse=i.packagesResponse,this.packageError=i.error}finally{this.isCurrentPackageLoad(t,e)&&(this.packageLoading=!1)}}async togglePlugin(e,t){if(this.saving)return;const i=this.settingsTarget(),r=this.selectedMachineSettingsSupport(i);if(vn(r)){this.pluginError=r.message??`Selected-machine settings are not available on ${Hi(i)}.`;return}if(this.selectedPluginConfigResponse===void 0){this.pluginError=`Plugin config is not loaded for ${Hi(i)}. Reload before changing plugin enablement.`;return}const s=aJ(this.selectedPluginConfigResponse.config,e,t);this.saving=!0,this.pluginError="",this.savedMessage="";try{const o=await zs.saveConfig(s,i.id);if(!this.isCurrentSettingsTarget(i))return;this.selectedPluginConfigResponse=o,i.kind==="local"&&this.configResponse!==void 0&&(this.configResponse=nJ(this.configResponse,o),this.onConfigSaved?.(this.configResponse.effectiveConfig));const a=await this.refreshPluginsForTarget(i);if(!this.isCurrentSettingsTarget(i))return;a!==void 0&&(this.pluginError=a),this.showSavedMessage()}catch(o){this.isCurrentSettingsTarget(i)&&(this.pluginError=`Failed to save PI WEB plugin config on ${Hi(i)}: ${Ko(Je(o),i)}`)}finally{this.saving=!1}}async saveConfig(e){if(!this.saving){this.saving=!0,this.error="",this.savedMessage="";try{const t=await zs.saveConfig(e);this.configResponse=t,this.onConfigSaved?.(t.effectiveConfig),this.showSavedMessage()}catch(t){this.error=`Failed to save config: ${Je(t)}`}finally{this.saving=!1}}}async saveMachineAccessConfig(e){if(this.saving)return;const t=this.settingsTarget(),i=this.selectedMachineSettingsSupport(t);if(vn(i)){this.accessError=i.message??`Selected-machine settings are not available on ${Hi(t)}.`;return}this.saving=!0,this.accessError="",this.savedMessage="";try{const r=await zs.saveConfig(e,t.id);if(!this.isCurrentSettingsTarget(t))return;this.accessConfigResponse=r,t.kind==="local"&&this.configResponse!==void 0&&(this.configResponse=oJ(this.configResponse,r),this.onConfigSaved?.(this.configResponse.effectiveConfig)),this.showSavedMessage()}catch(r){this.isCurrentSettingsTarget(t)&&(this.accessError=`Failed to save file access/upload config on ${Hi(t)}: ${Ko(Je(r),t)}`)}finally{this.saving=!1}}async saveSessiondConfig(e){if(this.saving)return;const t=this.settingsTarget(),i=this.selectedMachineSettingsSupport(t);if(vn(i)){this.sessiondError=i.message??`Selected-machine settings are not available on ${Hi(t)}.`;return}this.saving=!0,this.sessiondError="",this.savedMessage="";try{const r=await zs.saveConfig(e,t.id);if(!this.isCurrentSettingsTarget(t))return;this.sessiondConfigResponse=r,t.kind==="local"&&this.configResponse!==void 0&&(this.configResponse=kQ(this.configResponse,r)),this.showSavedMessage()}catch(r){this.isCurrentSettingsTarget(t)&&(this.sessiondError=`Failed to save session-daemon config on ${Hi(t)}: ${Ko(Je(r),t)}`)}finally{this.saving=!1}}async installPiPackage(e){const t=this.packageTarget();await this.runPiPackageMutation({kind:"install",source:e},"install Pi package",t,()=>Yl.install(e,t.id))}async removePiPackage(e,t){const i=this.packageTarget();await this.runPiPackageMutation({kind:"remove",source:e},"remove Pi package",i,()=>Yl.remove(e,t,i.id))}async updatePiPackage(e){const t=this.packageTarget();await this.runPiPackageMutation(e===void 0?{kind:"update-all"}:{kind:"update",source:e},"update Pi packages",t,()=>Yl.update(e,t.id))}async runPiPackageMutation(e,t,i,r){const s=this.packageManagementSupport(i);if(sb(s))throw this.packageError=s.message??`Pi package management is not available on ${ja(i)}.`,new Error(this.packageError);if(this.saving)throw new Error("A settings operation is already running.");const o=++this.packageMutationSeq;this.packageLoadRequestSeq+=1,this.packageLoading=!1,this.saving=!0,this.packageOperation=e,this.packageError="",this.packageMessage="";try{const a=await r();if(!this.isCurrentPackageMutation(o,i))return;this.packagesResponse={packages:a.packages};const n=MQ(i)?await this.refreshGatewayPlugins():void 0;if(!this.isCurrentPackageMutation(o,i))return;n!==void 0&&(this.packageError=n),this.packageMessage=IQ(a.action,i)}catch(a){throw this.isCurrentPackageMutation(o,i)&&(this.packageError=`Failed to ${t} on ${ja(i)}: ${n7(Je(a),i)}`),a}finally{this.packageMutationSeq===o&&(this.packageOperation=void 0,this.saving=!1)}}async refreshGatewayPlugins(){try{this.pluginsResponse=await Ul.plugins();return}catch(e){return`Failed to refresh gateway PI WEB plugins: ${Je(e)}`}}async refreshPluginsForTarget(e){try{const t=await Ul.plugins(e.id);this.isCurrentSettingsTarget(e)&&(this.selectedPluginsResponse=t);return}catch(t){return`Config saved, but failed to refresh PI WEB plugins from ${Hi(e)}: ${Ko(Je(t),e)}`}}settingsTarget(){return zg(this.machine)}packageTarget(){return this.settingsTarget()}selectedMachineSettingsSupport(e=this.settingsTarget()){return Ew(e,this.machineRuntime)}selectedMachineSettingsSupportNeedsReload(e,t){const i=Ew(t,e),r=this.selectedMachineSettingsSupport(t);return Rw(i)!==Rw(r)}packageManagementSupport(e=this.packageTarget()){return Iw(e,this.machineRuntime)}packageManagementSupportNeedsReload(e,t){const i=Iw(t,e),r=this.packageManagementSupport(t);return zw(i)===zw(r)?!1:i.state==="unsupported"||r.state==="unsupported"}isCurrentLoad(e){return e===this.loadRequestSeq}isCurrentAccessLoad(e,t){return e===this.accessLoadRequestSeq&&this.isCurrentSettingsTarget(t)}isCurrentSessiondLoad(e,t){return e===this.sessiondLoadRequestSeq&&this.isCurrentSettingsTarget(t)}isCurrentPluginLoad(e,t){return e===this.pluginLoadRequestSeq&&this.isCurrentSettingsTarget(t)}isCurrentPackageLoad(e,t){return e===this.packageLoadRequestSeq&&this.isCurrentPackageTarget(t)}isCurrentPackageMutation(e,t){return e===this.packageMutationSeq&&this.isCurrentPackageTarget(t)}isCurrentPackageTarget(e){return this.packageTarget().id===e.id}isCurrentSettingsTarget(e){return this.settingsTarget().id===e.id}resetAccessStateForTargetChange(){this.accessLoadRequestSeq+=1,this.accessLoading=!1,this.accessError="",this.accessConfigResponse=void 0,this.savedMessage=""}resetSessiondStateForTargetChange(){this.sessiondLoadRequestSeq+=1,this.sessiondLoading=!1,this.sessiondError="",this.sessiondConfigResponse=void 0,this.savedMessage=""}resetPluginStateForTargetChange(){this.pluginLoadRequestSeq+=1,this.pluginLoading=!1,this.pluginError="",this.selectedPluginConfigResponse=void 0,this.selectedPluginsResponse=void 0,this.savedMessage=""}resetPackageStateForTargetChange(){const e=this.packageOperation!==void 0;this.packageLoadRequestSeq+=1,this.packageMutationSeq+=1,this.packageLoading=!1,this.packageOperation=void 0,this.packageMessage="",this.packageError="",this.packagesResponse=void 0,e&&(this.saving=!1)}showSavedMessage(){this.savedMessage="Config saved.",this.savedMessageTimer!==void 0&&window.clearTimeout(this.savedMessageTimer),this.savedMessageTimer=window.setTimeout(()=>{this.savedMessage==="Config saved."&&(this.savedMessage=""),this.savedMessageTimer=void 0},3e3)}handleKeyDown(e){e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this.onClose?.())}};Ne.styles=_e`
4575
+ `}navigate(e){this.onNavigate?.(e)}async loadConfig(){const e=++this.loadRequestSeq;this.loading=!0,this.error="";try{const t=await sJ({loadConfig:()=>zs.config(),loadPlugins:()=>Ul.plugins()});if(!this.isCurrentLoad(e))return;t.config!==void 0&&(this.configResponse=t.config),t.plugins!==void 0&&(this.pluginsResponse=t.plugins),this.error=t.error}finally{this.isCurrentLoad(e)&&(this.loading=!1)}}async loadAccessConfigForTarget(e=this.settingsTarget()){const t=++this.accessLoadRequestSeq,i=this.selectedMachineSettingsSupport(e);if(vn(i)){this.accessConfigResponse=void 0,this.accessLoading=!1,this.accessError=i.message??`Selected-machine settings are not available on ${Hi(e)}.`;return}this.accessLoading=!0,this.accessError="";try{const r=await zs.config(e.id);if(!this.isCurrentAccessLoad(t,e))return;this.accessConfigResponse=r}catch(r){this.isCurrentAccessLoad(t,e)&&(this.accessError=`Failed to load file access/upload config from ${Hi(e)}: ${Ko(Je(r),e)}`)}finally{this.isCurrentAccessLoad(t,e)&&(this.accessLoading=!1)}}async loadSessiondConfigForTarget(e=this.settingsTarget()){const t=++this.sessiondLoadRequestSeq,i=this.selectedMachineSettingsSupport(e);if(vn(i)){this.sessiondConfigResponse=void 0,this.sessiondLoading=!1,this.sessiondError=i.message??`Selected-machine settings are not available on ${Hi(e)}.`;return}this.sessiondLoading=!0,this.sessiondError="";try{const r=await zs.config(e.id);if(!this.isCurrentSessiondLoad(t,e))return;this.sessiondConfigResponse=r}catch(r){this.isCurrentSessiondLoad(t,e)&&(this.sessiondError=`Failed to load session-daemon config from ${Hi(e)}: ${Ko(Je(r),e)}`)}finally{this.isCurrentSessiondLoad(t,e)&&(this.sessiondLoading=!1)}}async loadPluginsForTarget(e=this.settingsTarget()){const t=++this.pluginLoadRequestSeq,i=this.selectedMachineSettingsSupport(e);if(vn(i)){this.selectedPluginConfigResponse=void 0,this.selectedPluginsResponse=void 0,this.pluginLoading=!1,this.pluginError=i.message??`Selected-machine settings are not available on ${Hi(e)}.`;return}this.pluginLoading=!0,this.pluginError="";try{const[r,s]=await Promise.allSettled([zs.config(e.id),Ul.plugins(e.id)]);if(!this.isCurrentPluginLoad(t,e))return;const o=[];r.status==="fulfilled"?this.selectedPluginConfigResponse=r.value:o.push(`config: ${Ko(Je(r.reason),e)}`),s.status==="fulfilled"?this.selectedPluginsResponse=s.value:o.push(`PI WEB plugins: ${Ko(Je(s.reason),e)}`),this.pluginError=o.length===0?"":`Failed to load PI WEB plugin settings from ${Hi(e)}: ${o.join("; ")}`}finally{this.isCurrentPluginLoad(t,e)&&(this.pluginLoading=!1)}}async loadPackagesForTarget(e=this.packageTarget()){const t=++this.packageLoadRequestSeq;this.packageLoading=!0,this.packageError="",this.packageMessage="";try{const i=await oJ(e,r=>Yl.packages(r),this.packageManagementSupport(e));if(!this.isCurrentPackageLoad(t,e))return;this.packagesResponse=i.packagesResponse,this.packageError=i.error}finally{this.isCurrentPackageLoad(t,e)&&(this.packageLoading=!1)}}async togglePlugin(e,t){if(this.saving)return;const i=this.settingsTarget(),r=this.selectedMachineSettingsSupport(i);if(vn(r)){this.pluginError=r.message??`Selected-machine settings are not available on ${Hi(i)}.`;return}if(this.selectedPluginConfigResponse===void 0){this.pluginError=`Plugin config is not loaded for ${Hi(i)}. Reload before changing plugin enablement.`;return}const s=nJ(this.selectedPluginConfigResponse.config,e,t);this.saving=!0,this.pluginError="",this.savedMessage="";try{const o=await zs.saveConfig(s,i.id);if(!this.isCurrentSettingsTarget(i))return;this.selectedPluginConfigResponse=o,i.kind==="local"&&this.configResponse!==void 0&&(this.configResponse=lJ(this.configResponse,o),this.onConfigSaved?.(this.configResponse.effectiveConfig));const a=await this.refreshPluginsForTarget(i);if(!this.isCurrentSettingsTarget(i))return;a!==void 0&&(this.pluginError=a),this.showSavedMessage()}catch(o){this.isCurrentSettingsTarget(i)&&(this.pluginError=`Failed to save PI WEB plugin config on ${Hi(i)}: ${Ko(Je(o),i)}`)}finally{this.saving=!1}}async saveConfig(e){if(!this.saving){this.saving=!0,this.error="",this.savedMessage="";try{const t=await zs.saveConfig(e);this.configResponse=t,this.onConfigSaved?.(t.effectiveConfig),this.showSavedMessage()}catch(t){this.error=`Failed to save config: ${Je(t)}`}finally{this.saving=!1}}}async saveMachineAccessConfig(e){if(this.saving)return;const t=this.settingsTarget(),i=this.selectedMachineSettingsSupport(t);if(vn(i)){this.accessError=i.message??`Selected-machine settings are not available on ${Hi(t)}.`;return}this.saving=!0,this.accessError="",this.savedMessage="";try{const r=await zs.saveConfig(e,t.id);if(!this.isCurrentSettingsTarget(t))return;this.accessConfigResponse=r,t.kind==="local"&&this.configResponse!==void 0&&(this.configResponse=aJ(this.configResponse,r),this.onConfigSaved?.(this.configResponse.effectiveConfig)),this.showSavedMessage()}catch(r){this.isCurrentSettingsTarget(t)&&(this.accessError=`Failed to save file access/upload config on ${Hi(t)}: ${Ko(Je(r),t)}`)}finally{this.saving=!1}}async saveSessiondConfig(e){if(this.saving)return;const t=this.settingsTarget(),i=this.selectedMachineSettingsSupport(t);if(vn(i)){this.sessiondError=i.message??`Selected-machine settings are not available on ${Hi(t)}.`;return}this.saving=!0,this.sessiondError="",this.savedMessage="";try{const r=await zs.saveConfig(e,t.id);if(!this.isCurrentSettingsTarget(t))return;this.sessiondConfigResponse=r,t.kind==="local"&&this.configResponse!==void 0&&(this.configResponse=SQ(this.configResponse,r)),this.showSavedMessage()}catch(r){this.isCurrentSettingsTarget(t)&&(this.sessiondError=`Failed to save session-daemon config on ${Hi(t)}: ${Ko(Je(r),t)}`)}finally{this.saving=!1}}async installPiPackage(e){const t=this.packageTarget();await this.runPiPackageMutation({kind:"install",source:e},"install Pi package",t,()=>Yl.install(e,t.id))}async removePiPackage(e,t){const i=this.packageTarget();await this.runPiPackageMutation({kind:"remove",source:e},"remove Pi package",i,()=>Yl.remove(e,t,i.id))}async updatePiPackage(e){const t=this.packageTarget();await this.runPiPackageMutation(e===void 0?{kind:"update-all"}:{kind:"update",source:e},"update Pi packages",t,()=>Yl.update(e,t.id))}async runPiPackageMutation(e,t,i,r){const s=this.packageManagementSupport(i);if(sb(s))throw this.packageError=s.message??`Pi package management is not available on ${ja(i)}.`,new Error(this.packageError);if(this.saving)throw new Error("A settings operation is already running.");const o=++this.packageMutationSeq;this.packageLoadRequestSeq+=1,this.packageLoading=!1,this.saving=!0,this.packageOperation=e,this.packageError="",this.packageMessage="";try{const a=await r();if(!this.isCurrentPackageMutation(o,i))return;this.packagesResponse={packages:a.packages};const n=AQ(i)?await this.refreshGatewayPlugins():void 0;if(!this.isCurrentPackageMutation(o,i))return;n!==void 0&&(this.packageError=n),this.packageMessage=zQ(a.action,i)}catch(a){throw this.isCurrentPackageMutation(o,i)&&(this.packageError=`Failed to ${t} on ${ja(i)}: ${n7(Je(a),i)}`),a}finally{this.packageMutationSeq===o&&(this.packageOperation=void 0,this.saving=!1)}}async refreshGatewayPlugins(){try{this.pluginsResponse=await Ul.plugins();return}catch(e){return`Failed to refresh gateway PI WEB plugins: ${Je(e)}`}}async refreshPluginsForTarget(e){try{const t=await Ul.plugins(e.id);this.isCurrentSettingsTarget(e)&&(this.selectedPluginsResponse=t);return}catch(t){return`Config saved, but failed to refresh PI WEB plugins from ${Hi(e)}: ${Ko(Je(t),e)}`}}settingsTarget(){return zg(this.machine)}packageTarget(){return this.settingsTarget()}selectedMachineSettingsSupport(e=this.settingsTarget()){return Ew(e,this.machineRuntime)}selectedMachineSettingsSupportNeedsReload(e,t){const i=Ew(t,e),r=this.selectedMachineSettingsSupport(t);return Rw(i)!==Rw(r)}packageManagementSupport(e=this.packageTarget()){return Iw(e,this.machineRuntime)}packageManagementSupportNeedsReload(e,t){const i=Iw(t,e),r=this.packageManagementSupport(t);return zw(i)===zw(r)?!1:i.state==="unsupported"||r.state==="unsupported"}isCurrentLoad(e){return e===this.loadRequestSeq}isCurrentAccessLoad(e,t){return e===this.accessLoadRequestSeq&&this.isCurrentSettingsTarget(t)}isCurrentSessiondLoad(e,t){return e===this.sessiondLoadRequestSeq&&this.isCurrentSettingsTarget(t)}isCurrentPluginLoad(e,t){return e===this.pluginLoadRequestSeq&&this.isCurrentSettingsTarget(t)}isCurrentPackageLoad(e,t){return e===this.packageLoadRequestSeq&&this.isCurrentPackageTarget(t)}isCurrentPackageMutation(e,t){return e===this.packageMutationSeq&&this.isCurrentPackageTarget(t)}isCurrentPackageTarget(e){return this.packageTarget().id===e.id}isCurrentSettingsTarget(e){return this.settingsTarget().id===e.id}resetAccessStateForTargetChange(){this.accessLoadRequestSeq+=1,this.accessLoading=!1,this.accessError="",this.accessConfigResponse=void 0,this.savedMessage=""}resetSessiondStateForTargetChange(){this.sessiondLoadRequestSeq+=1,this.sessiondLoading=!1,this.sessiondError="",this.sessiondConfigResponse=void 0,this.savedMessage=""}resetPluginStateForTargetChange(){this.pluginLoadRequestSeq+=1,this.pluginLoading=!1,this.pluginError="",this.selectedPluginConfigResponse=void 0,this.selectedPluginsResponse=void 0,this.savedMessage=""}resetPackageStateForTargetChange(){const e=this.packageOperation!==void 0;this.packageLoadRequestSeq+=1,this.packageMutationSeq+=1,this.packageLoading=!1,this.packageOperation=void 0,this.packageMessage="",this.packageError="",this.packagesResponse=void 0,e&&(this.saving=!1)}showSavedMessage(){this.savedMessage="Config saved.",this.savedMessageTimer!==void 0&&window.clearTimeout(this.savedMessageTimer),this.savedMessageTimer=window.setTimeout(()=>{this.savedMessage==="Config saved."&&(this.savedMessage=""),this.savedMessageTimer=void 0},3e3)}handleKeyDown(e){e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this.onClose?.())}};Ne.styles=_e`
4568
4576
  :host { position: fixed; inset: 0; z-index: 30; color: var(--pi-text); font: 14px system-ui, sans-serif; }
4569
4577
  .backdrop { box-sizing: border-box; width: 100%; height: 100dvh; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: var(--pi-overlay); overflow: hidden; }
4570
4578
  .settings-shell { width: min(980px, 100%); max-height: min(760px, 100%); min-height: min(620px, 100%); display: grid; grid-template-rows: auto minmax(0, 1fr); border: 1px solid var(--pi-border); border-radius: 14px; background: var(--pi-bg); box-shadow: 0 20px 60px var(--pi-shadow-strong); overflow: hidden; }
@@ -4591,7 +4599,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4591
4599
  .settings-nav button { flex: 0 0 auto; width: auto; min-width: 128px; margin: 0; }
4592
4600
  .settings-content { padding: 14px 12px calc(18px + env(safe-area-inset-bottom)); }
4593
4601
  }
4594
- `;Ue([P({attribute:!1})],Ne.prototype,"section",2);Ue([P({attribute:!1})],Ne.prototype,"actions",2);Ue([P({attribute:!1})],Ne.prototype,"machine",2);Ue([P({attribute:!1})],Ne.prototype,"machineRuntime",2);Ue([P({attribute:!1})],Ne.prototype,"onNavigate",2);Ue([P({attribute:!1})],Ne.prototype,"onClose",2);Ue([P({attribute:!1})],Ne.prototype,"onConfigSaved",2);Ue([Ct()],Ne.prototype,"configResponse",2);Ue([Ct()],Ne.prototype,"accessConfigResponse",2);Ue([Ct()],Ne.prototype,"sessiondConfigResponse",2);Ue([Ct()],Ne.prototype,"pluginsResponse",2);Ue([Ct()],Ne.prototype,"selectedPluginConfigResponse",2);Ue([Ct()],Ne.prototype,"selectedPluginsResponse",2);Ue([Ct()],Ne.prototype,"packagesResponse",2);Ue([Ct()],Ne.prototype,"loading",2);Ue([Ct()],Ne.prototype,"accessLoading",2);Ue([Ct()],Ne.prototype,"sessiondLoading",2);Ue([Ct()],Ne.prototype,"pluginLoading",2);Ue([Ct()],Ne.prototype,"packageLoading",2);Ue([Ct()],Ne.prototype,"saving",2);Ue([Ct()],Ne.prototype,"packageOperation",2);Ue([Ct()],Ne.prototype,"error",2);Ue([Ct()],Ne.prototype,"accessError",2);Ue([Ct()],Ne.prototype,"sessiondError",2);Ue([Ct()],Ne.prototype,"pluginError",2);Ue([Ct()],Ne.prototype,"packageError",2);Ue([Ct()],Ne.prototype,"savedMessage",2);Ue([Ct()],Ne.prototype,"packageMessage",2);Ne=Ue([Ae("settings-dialog")],Ne);var hJ=Object.defineProperty,dJ=Object.getOwnPropertyDescriptor,Bs=(e,t,i,r)=>{for(var s=r>1?void 0:r?dJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&hJ(t,i,s),s};let Wr=class extends we{constructor(){super(...arguments),this.tool="core:workspace.files",this.panels=[],this.hideToolTabs=!1,this.onSelectTool=()=>{},this.workspaceHeaderCanScrollLeft=!1,this.workspaceHeaderCanScrollRight=!1,this.onWorkspaceHeaderScroll=()=>{this.updateWorkspaceHeaderScrollState()}}firstUpdated(){this.observeWorkspaceHeaderStrip(),this.updateWorkspaceHeaderScrollState()}updated(){this.observeWorkspaceHeaderStrip(),this.updateWorkspaceHeaderScrollState()}disconnectedCallback(){this.workspaceHeaderResizeObserver?.disconnect(),this.workspaceHeaderResizeObserver=void 0,this.observedWorkspaceHeaderStrip=void 0,super.disconnectedCallback()}render(){if(this.workspace===void 0)return this.renderEmptyState(this.emptyState??{title:"Select a workspace",body:"Choose a workspace to inspect files, Git, or terminals."});const t=this.panelContext;if(t===void 0)return this.renderEmptyState({title:"Workspace tools unavailable",body:"Try selecting the workspace again."});const i=this.panels,r=i.find(s=>s.id===this.tool)??i[0];return T`
4602
+ `;Ue([P({attribute:!1})],Ne.prototype,"section",2);Ue([P({attribute:!1})],Ne.prototype,"actions",2);Ue([P({attribute:!1})],Ne.prototype,"machine",2);Ue([P({attribute:!1})],Ne.prototype,"machineRuntime",2);Ue([P({attribute:!1})],Ne.prototype,"onNavigate",2);Ue([P({attribute:!1})],Ne.prototype,"onClose",2);Ue([P({attribute:!1})],Ne.prototype,"onConfigSaved",2);Ue([Ct()],Ne.prototype,"configResponse",2);Ue([Ct()],Ne.prototype,"accessConfigResponse",2);Ue([Ct()],Ne.prototype,"sessiondConfigResponse",2);Ue([Ct()],Ne.prototype,"pluginsResponse",2);Ue([Ct()],Ne.prototype,"selectedPluginConfigResponse",2);Ue([Ct()],Ne.prototype,"selectedPluginsResponse",2);Ue([Ct()],Ne.prototype,"packagesResponse",2);Ue([Ct()],Ne.prototype,"loading",2);Ue([Ct()],Ne.prototype,"accessLoading",2);Ue([Ct()],Ne.prototype,"sessiondLoading",2);Ue([Ct()],Ne.prototype,"pluginLoading",2);Ue([Ct()],Ne.prototype,"packageLoading",2);Ue([Ct()],Ne.prototype,"saving",2);Ue([Ct()],Ne.prototype,"packageOperation",2);Ue([Ct()],Ne.prototype,"error",2);Ue([Ct()],Ne.prototype,"accessError",2);Ue([Ct()],Ne.prototype,"sessiondError",2);Ue([Ct()],Ne.prototype,"pluginError",2);Ue([Ct()],Ne.prototype,"packageError",2);Ue([Ct()],Ne.prototype,"savedMessage",2);Ue([Ct()],Ne.prototype,"packageMessage",2);Ne=Ue([Ae("settings-dialog")],Ne);var dJ=Object.defineProperty,uJ=Object.getOwnPropertyDescriptor,Bs=(e,t,i,r)=>{for(var s=r>1?void 0:r?uJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&dJ(t,i,s),s};let Wr=class extends we{constructor(){super(...arguments),this.tool="core:workspace.files",this.panels=[],this.hideToolTabs=!1,this.onSelectTool=()=>{},this.workspaceHeaderCanScrollLeft=!1,this.workspaceHeaderCanScrollRight=!1,this.onWorkspaceHeaderScroll=()=>{this.updateWorkspaceHeaderScrollState()}}firstUpdated(){this.observeWorkspaceHeaderStrip(),this.updateWorkspaceHeaderScrollState()}updated(){this.observeWorkspaceHeaderStrip(),this.updateWorkspaceHeaderScrollState()}disconnectedCallback(){this.workspaceHeaderResizeObserver?.disconnect(),this.workspaceHeaderResizeObserver=void 0,this.observedWorkspaceHeaderStrip=void 0,super.disconnectedCallback()}render(){if(this.workspace===void 0)return this.renderEmptyState(this.emptyState??{title:"Select a workspace",body:"Choose a workspace to inspect files, Git, or terminals."});const t=this.panelContext;if(t===void 0)return this.renderEmptyState({title:"Workspace tools unavailable",body:"Try selecting the workspace again."});const i=this.panels,r=i.find(s=>s.id===this.tool)??i[0];return T`
4595
4603
  ${this.hideToolTabs?null:T`
4596
4604
  <header>
4597
4605
  <div class=${this.workspaceHeaderFrameClass()}>
@@ -4621,32 +4629,32 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4621
4629
  <h2>${e.title}</h2>
4622
4630
  ${e.body===void 0?null:T`<p>${e.body}</p>`}
4623
4631
  </section>
4624
- `}workspaceHeaderFrameClass(){return`workspace-header-scroll-frame${this.workspaceHeaderCanScrollLeft?" can-scroll-left":""}${this.workspaceHeaderCanScrollRight?" can-scroll-right":""}`}observeWorkspaceHeaderStrip(){const e=this.workspaceHeaderStripElement();this.observedWorkspaceHeaderStrip!==e&&(this.workspaceHeaderResizeObserver?.disconnect(),this.observedWorkspaceHeaderStrip=e,this.workspaceHeaderResizeObserver=void 0,!(e===void 0||typeof ResizeObserver>"u")&&(this.workspaceHeaderResizeObserver=new ResizeObserver(()=>{this.updateWorkspaceHeaderScrollState()}),this.workspaceHeaderResizeObserver.observe(e)))}updateWorkspaceHeaderScrollState(){const e=this.workspaceHeaderStripElement(),t=e===void 0?0:Math.max(0,e.scrollWidth-e.clientWidth),i=e!==void 0&&e.scrollLeft>1,r=e!==void 0&&t-e.scrollLeft>1;this.workspaceHeaderCanScrollLeft!==i&&(this.workspaceHeaderCanScrollLeft=i),this.workspaceHeaderCanScrollRight!==r&&(this.workspaceHeaderCanScrollRight=r)}workspaceHeaderStripElement(){const e=this.workspaceHeaderStrip;return e instanceof HTMLElement?e:void 0}};Wr.styles=nm;Bs([P({attribute:!1})],Wr.prototype,"workspace",2);Bs([P({attribute:!1})],Wr.prototype,"panelContext",2);Bs([P({attribute:!1})],Wr.prototype,"emptyState",2);Bs([P()],Wr.prototype,"tool",2);Bs([P({attribute:!1})],Wr.prototype,"panels",2);Bs([P({type:Boolean})],Wr.prototype,"hideToolTabs",2);Bs([P({attribute:!1})],Wr.prototype,"onSelectTool",2);Bs([ui(".workspace-header-strip")],Wr.prototype,"workspaceHeaderStrip",2);Bs([Ct()],Wr.prototype,"workspaceHeaderCanScrollLeft",2);Bs([Ct()],Wr.prototype,"workspaceHeaderCanScrollRight",2);Wr=Bs([Ae("workspace-panel")],Wr);var uJ=Object.defineProperty,pJ=Object.getOwnPropertyDescriptor,ds=(e,t,i,r)=>{for(var s=r>1?void 0:r?pJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&uJ(t,i,s),s};let Br=class extends we{constructor(){super(...arguments),this.machines=[],this.canScrollLeft=!1,this.canScrollRight=!1,this.onContextScroll=()=>{this.updateScrollState()}}disconnectedCallback(){this.contextItemsResizeObserver?.disconnect(),this.contextItemsResizeObserver=void 0,this.observedContextItems=void 0,super.disconnectedCallback()}firstUpdated(){this.observeContextItems(),this.updateScrollState()}updated(){this.observeContextItems(),this.updateScrollState()}render(){const e=fJ(this.machines),t=gJ(this.machine),i=bJ(this.project),r=xJ(this.workspace),s=wJ(this.session);return T`
4632
+ `}workspaceHeaderFrameClass(){return`workspace-header-scroll-frame${this.workspaceHeaderCanScrollLeft?" can-scroll-left":""}${this.workspaceHeaderCanScrollRight?" can-scroll-right":""}`}observeWorkspaceHeaderStrip(){const e=this.workspaceHeaderStripElement();this.observedWorkspaceHeaderStrip!==e&&(this.workspaceHeaderResizeObserver?.disconnect(),this.observedWorkspaceHeaderStrip=e,this.workspaceHeaderResizeObserver=void 0,!(e===void 0||typeof ResizeObserver>"u")&&(this.workspaceHeaderResizeObserver=new ResizeObserver(()=>{this.updateWorkspaceHeaderScrollState()}),this.workspaceHeaderResizeObserver.observe(e)))}updateWorkspaceHeaderScrollState(){const e=this.workspaceHeaderStripElement(),t=e===void 0?0:Math.max(0,e.scrollWidth-e.clientWidth),i=e!==void 0&&e.scrollLeft>1,r=e!==void 0&&t-e.scrollLeft>1;this.workspaceHeaderCanScrollLeft!==i&&(this.workspaceHeaderCanScrollLeft=i),this.workspaceHeaderCanScrollRight!==r&&(this.workspaceHeaderCanScrollRight=r)}workspaceHeaderStripElement(){const e=this.workspaceHeaderStrip;return e instanceof HTMLElement?e:void 0}};Wr.styles=nm;Bs([P({attribute:!1})],Wr.prototype,"workspace",2);Bs([P({attribute:!1})],Wr.prototype,"panelContext",2);Bs([P({attribute:!1})],Wr.prototype,"emptyState",2);Bs([P()],Wr.prototype,"tool",2);Bs([P({attribute:!1})],Wr.prototype,"panels",2);Bs([P({type:Boolean})],Wr.prototype,"hideToolTabs",2);Bs([P({attribute:!1})],Wr.prototype,"onSelectTool",2);Bs([ui(".workspace-header-strip")],Wr.prototype,"workspaceHeaderStrip",2);Bs([Ct()],Wr.prototype,"workspaceHeaderCanScrollLeft",2);Bs([Ct()],Wr.prototype,"workspaceHeaderCanScrollRight",2);Wr=Bs([Ae("workspace-panel")],Wr);var pJ=Object.defineProperty,fJ=Object.getOwnPropertyDescriptor,ds=(e,t,i,r)=>{for(var s=r>1?void 0:r?fJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&pJ(t,i,s),s};let Br=class extends we{constructor(){super(...arguments),this.machines=[],this.canScrollLeft=!1,this.canScrollRight=!1,this.onContextScroll=()=>{this.updateScrollState()}}disconnectedCallback(){this.contextItemsResizeObserver?.disconnect(),this.contextItemsResizeObserver=void 0,this.observedContextItems=void 0,super.disconnectedCallback()}firstUpdated(){this.observeContextItems(),this.updateScrollState()}updated(){this.observeContextItems(),this.updateScrollState()}render(){const e=gJ(this.machines),t=mJ(this.machine),i=yJ(this.project),r=vJ(this.workspace),s=kJ(this.session);return T`
4625
4633
  <nav class=${this.contextBarClass()} aria-label="Current location">
4626
4634
  <span class="context-bar-label">Location</span>
4627
4635
  <ol class="context-items" @scroll=${this.onContextScroll}>
4628
4636
  ${e?T`
4629
4637
  <li class="context-item">
4630
- <button type="button" class=${this.machine===void 0?"context-chip empty":"context-chip"} title=${mJ(this.machine)} aria-label=${`Machine: ${t}. Open machine selection.`} @click=${()=>{this.onOpenSection?.("machines")}}>
4638
+ <button type="button" class=${this.machine===void 0?"context-chip empty":"context-chip"} title=${bJ(this.machine)} aria-label=${`Machine: ${t}. Open machine selection.`} @click=${()=>{this.onOpenSection?.("machines")}}>
4631
4639
  <span class="context-kind">Machine</span>
4632
4640
  <span class="context-value">${t}</span>
4633
4641
  </button>
4634
4642
  </li>
4635
4643
  `:null}
4636
4644
  <li class="context-item">
4637
- <button type="button" class=${this.project===void 0?"context-chip empty":"context-chip"} title=${yJ(this.project)} aria-label=${`Project: ${i}. Open project selection.`} @click=${()=>{this.onOpenSection?.("projects")}}>
4645
+ <button type="button" class=${this.project===void 0?"context-chip empty":"context-chip"} title=${xJ(this.project)} aria-label=${`Project: ${i}. Open project selection.`} @click=${()=>{this.onOpenSection?.("projects")}}>
4638
4646
  <span class="context-kind">Project</span>
4639
4647
  <span class="context-value">${i}</span>
4640
4648
  </button>
4641
4649
  </li>
4642
4650
  <li class="context-item">
4643
- <button type="button" class=${this.workspace===void 0?"context-chip empty":"context-chip"} title=${vJ(this.workspace)} aria-label=${`Workspace: ${r}. Open workspace selection.`} @click=${()=>{this.onOpenSection?.("workspaces")}}>
4651
+ <button type="button" class=${this.workspace===void 0?"context-chip empty":"context-chip"} title=${wJ(this.workspace)} aria-label=${`Workspace: ${r}. Open workspace selection.`} @click=${()=>{this.onOpenSection?.("workspaces")}}>
4644
4652
  <span class="context-kind">Workspace</span>
4645
4653
  <span class="context-value">${r}</span>
4646
4654
  </button>
4647
4655
  </li>
4648
4656
  <li class="context-item">
4649
- <button type="button" class=${this.session===void 0?"context-chip empty":"context-chip"} title=${kJ(this.session)} aria-label=${`Session: ${s}. Open session selection.`} @click=${()=>{this.onOpenSection?.("sessions")}}>
4657
+ <button type="button" class=${this.session===void 0?"context-chip empty":"context-chip"} title=${SJ(this.session)} aria-label=${`Session: ${s}. Open session selection.`} @click=${()=>{this.onOpenSection?.("sessions")}}>
4650
4658
  <span class="context-kind">Session</span>
4651
4659
  <span class="context-value">${s}</span>
4652
4660
  </button>
@@ -4686,7 +4694,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4686
4694
  .context-kind { display: none; }
4687
4695
  .context-value { min-width: 0; overflow: visible; text-overflow: clip; white-space: nowrap; }
4688
4696
  button { cursor: pointer; }
4689
- `;ds([P({attribute:!1})],Br.prototype,"machines",2);ds([P({attribute:!1})],Br.prototype,"machine",2);ds([P({attribute:!1})],Br.prototype,"project",2);ds([P({attribute:!1})],Br.prototype,"workspace",2);ds([P({attribute:!1})],Br.prototype,"session",2);ds([P({attribute:!1})],Br.prototype,"refreshControl",2);ds([P({attribute:!1})],Br.prototype,"onOpenSection",2);ds([P({attribute:!1})],Br.prototype,"onShowActions",2);ds([ui(".context-items")],Br.prototype,"contextItems",2);ds([Ct()],Br.prototype,"canScrollLeft",2);ds([Ct()],Br.prototype,"canScrollRight",2);Br=ds([Ae("app-context-bar")],Br);function fJ(e){return e.length>1}function gJ(e){return e===void 0?"No machine":`${e.name}${e.kind==="remote"?" · remote":""}`}function mJ(e){return e===void 0?"No machine selected":e.baseUrl??e.name}function bJ(e){return e?.name??"No project"}function yJ(e){return e===void 0?"No project selected":`${e.name} — ${e.path}`}function xJ(e){return e===void 0?"No workspace":`${e.label}${e.isMain?" · main":""} · ${e.path}`}function vJ(e){return e===void 0?"No workspace selected":`${e.label}${e.isMain?" · main":""} — ${e.path}`}function wJ(e){const t=e?.name?.trim(),i=e?.firstMessage.trim();return t!==void 0&&t!==""?t:i!==void 0&&i!==""?i:e===void 0?"No session":o4(e.id)}function kJ(e){return e===void 0?"No session selected":e.path}function SJ(e){return typeof e!="string"?T`<span class="tab-custom-icon" aria-hidden="true">${e}</span>`:nc(e)}function nc(e){switch(e){case"navigation":return Dr`
4697
+ `;ds([P({attribute:!1})],Br.prototype,"machines",2);ds([P({attribute:!1})],Br.prototype,"machine",2);ds([P({attribute:!1})],Br.prototype,"project",2);ds([P({attribute:!1})],Br.prototype,"workspace",2);ds([P({attribute:!1})],Br.prototype,"session",2);ds([P({attribute:!1})],Br.prototype,"refreshControl",2);ds([P({attribute:!1})],Br.prototype,"onOpenSection",2);ds([P({attribute:!1})],Br.prototype,"onShowActions",2);ds([ui(".context-items")],Br.prototype,"contextItems",2);ds([Ct()],Br.prototype,"canScrollLeft",2);ds([Ct()],Br.prototype,"canScrollRight",2);Br=ds([Ae("app-context-bar")],Br);function gJ(e){return e.length>1}function mJ(e){return e===void 0?"No machine":`${e.name}${e.kind==="remote"?" · remote":""}`}function bJ(e){return e===void 0?"No machine selected":e.baseUrl??e.name}function yJ(e){return e?.name??"No project"}function xJ(e){return e===void 0?"No project selected":`${e.name} — ${e.path}`}function vJ(e){return e===void 0?"No workspace":`${e.label}${e.isMain?" · main":""} · ${e.path}`}function wJ(e){return e===void 0?"No workspace selected":`${e.label}${e.isMain?" · main":""} — ${e.path}`}function kJ(e){const t=e?.name?.trim(),i=e?.firstMessage.trim();return t!==void 0&&t!==""?t:i!==void 0&&i!==""?i:e===void 0?"No session":o4(e.id)}function SJ(e){return e===void 0?"No session selected":e.path}function CJ(e){return typeof e!="string"?T`<span class="tab-custom-icon" aria-hidden="true">${e}</span>`:nc(e)}function nc(e){switch(e){case"navigation":return Dr`
4690
4698
  <svg class="tab-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
4691
4699
  <circle cx="6" cy="7" r="1.5"></circle>
4692
4700
  <path d="M10 7h8"></path>
@@ -4728,7 +4736,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4728
4736
  <path d="M9 18h4"></path>
4729
4737
  <path d="M9 6h6"></path>
4730
4738
  </svg>
4731
- `}}var CJ=Object.defineProperty,TJ=Object.getOwnPropertyDescriptor,lo=(e,t,i,r)=>{for(var s=r>1?void 0:r?TJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&CJ(t,i,s),s};let ns=class extends we{constructor(){super(...arguments),this.tabs=[],this.selectedView="chat",this.bottom=!0,this.canScrollLeft=!1,this.canScrollRight=!1,this.onMobileTabsScroll=()=>{this.updateScrollState()}}disconnectedCallback(){this.mobileTabsResizeObserver?.disconnect(),this.mobileTabsResizeObserver=void 0,this.observedMobileTabs=void 0,super.disconnectedCallback()}firstUpdated(){this.observeMobileTabs(),this.updateScrollState()}updated(){this.observeMobileTabs(),this.updateScrollState()}render(){const e=this.fallbackLabels();return T`
4739
+ `}}var TJ=Object.defineProperty,$J=Object.getOwnPropertyDescriptor,lo=(e,t,i,r)=>{for(var s=r>1?void 0:r?$J(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&TJ(t,i,s),s};let ns=class extends we{constructor(){super(...arguments),this.tabs=[],this.selectedView="chat",this.bottom=!0,this.canScrollLeft=!1,this.canScrollRight=!1,this.onMobileTabsScroll=()=>{this.updateScrollState()}}disconnectedCallback(){this.mobileTabsResizeObserver?.disconnect(),this.mobileTabsResizeObserver=void 0,this.observedMobileTabs=void 0,super.disconnectedCallback()}firstUpdated(){this.observeMobileTabs(),this.updateScrollState()}updated(){this.observeMobileTabs(),this.updateScrollState()}render(){const e=this.fallbackLabels();return T`
4732
4740
  <div class=${this.frameClass()}>
4733
4741
  <div class="mobile-tabs" @scroll=${this.onMobileTabsScroll}>
4734
4742
  ${this.tabs.map(t=>{const i=this.selectedView===t.id;return T`
@@ -4757,7 +4765,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4757
4765
  <path d="M13 2 4 14h7l-1 8 10-13h-7V2Z"></path>
4758
4766
  </svg>
4759
4767
  </button>
4760
- `}frameClass(){const e=["mobile-tabs-frame"];return this.hasActions()&&e.push("has-mobile-actions"),this.hasDoubleActions()&&e.push("has-mobile-actions-double"),this.canScrollLeft&&e.push("can-scroll-left"),this.canScrollRight&&e.push("can-scroll-right"),e.join(" ")}hasActions(){return this.onShowActions!==void 0||this.refreshControl!==void 0}hasDoubleActions(){return this.onShowActions!==void 0&&this.refreshControl!==void 0}tabClass(e){return[...e.className===void 0?[]:[e.className],...this.selectedView===e.id?["selected"]:[]].join(" ")}tabAriaLabel(e){if(typeof e.badge!="string"&&typeof e.badge!="number")return e.label;const t=String(e.badge).trim();return t===""?e.label:`${e.label}, ${t}`}isEmptyBadge(e){return e===void 0||e===""}renderTabMark(e,t){return e.icon===void 0?T`<span class="tab-fallback" aria-hidden="true">${t.get(e.id)??this.initialsLabel(e.label)}</span>`:SJ(e.icon)}fallbackLabels(){const e=this.tabs.filter(r=>r.icon===void 0),t=new Map;for(const r of e){const s=this.initialsLabel(r.label);t.set(s,(t.get(s)??0)+1)}const i=new Map;for(const r of e){const s=this.initialsLabel(r.label);i.set(r.id,(t.get(s)??0)>1?this.fullFallbackLabel(r.label):s)}return i}initialsLabel(e){const i=(e.match(/[\p{L}\p{N}]+/gu)??[]).map(r=>Array.from(r)[0]??"").join("").toLocaleUpperCase();return i===""?"?":i}fullFallbackLabel(e){const t=e.trim();return t===""?"?":t}observeMobileTabs(){const e=this.mobileTabsElement();this.observedMobileTabs!==e&&(this.mobileTabsResizeObserver?.disconnect(),this.observedMobileTabs=e,this.mobileTabsResizeObserver=void 0,!(e===void 0||typeof ResizeObserver>"u")&&(this.mobileTabsResizeObserver=new ResizeObserver(()=>{this.updateScrollState()}),this.mobileTabsResizeObserver.observe(e)))}updateScrollState(){const e=this.mobileTabsElement(),t=e===void 0?0:Math.max(0,e.scrollWidth-e.clientWidth),i=e!==void 0&&e.scrollLeft>1,r=e!==void 0&&t-e.scrollLeft>1;this.canScrollLeft!==i&&(this.canScrollLeft=i),this.canScrollRight!==r&&(this.canScrollRight=r)}mobileTabsElement(){const e=this.mobileTabs;return e instanceof HTMLElement?e:void 0}};ns.styles=_e`
4768
+ `}frameClass(){const e=["mobile-tabs-frame"];return this.hasActions()&&e.push("has-mobile-actions"),this.hasDoubleActions()&&e.push("has-mobile-actions-double"),this.canScrollLeft&&e.push("can-scroll-left"),this.canScrollRight&&e.push("can-scroll-right"),e.join(" ")}hasActions(){return this.onShowActions!==void 0||this.refreshControl!==void 0}hasDoubleActions(){return this.onShowActions!==void 0&&this.refreshControl!==void 0}tabClass(e){return[...e.className===void 0?[]:[e.className],...this.selectedView===e.id?["selected"]:[]].join(" ")}tabAriaLabel(e){if(typeof e.badge!="string"&&typeof e.badge!="number")return e.label;const t=String(e.badge).trim();return t===""?e.label:`${e.label}, ${t}`}isEmptyBadge(e){return e===void 0||e===""}renderTabMark(e,t){return e.icon===void 0?T`<span class="tab-fallback" aria-hidden="true">${t.get(e.id)??this.initialsLabel(e.label)}</span>`:CJ(e.icon)}fallbackLabels(){const e=this.tabs.filter(r=>r.icon===void 0),t=new Map;for(const r of e){const s=this.initialsLabel(r.label);t.set(s,(t.get(s)??0)+1)}const i=new Map;for(const r of e){const s=this.initialsLabel(r.label);i.set(r.id,(t.get(s)??0)>1?this.fullFallbackLabel(r.label):s)}return i}initialsLabel(e){const i=(e.match(/[\p{L}\p{N}]+/gu)??[]).map(r=>Array.from(r)[0]??"").join("").toLocaleUpperCase();return i===""?"?":i}fullFallbackLabel(e){const t=e.trim();return t===""?"?":t}observeMobileTabs(){const e=this.mobileTabsElement();this.observedMobileTabs!==e&&(this.mobileTabsResizeObserver?.disconnect(),this.observedMobileTabs=e,this.mobileTabsResizeObserver=void 0,!(e===void 0||typeof ResizeObserver>"u")&&(this.mobileTabsResizeObserver=new ResizeObserver(()=>{this.updateScrollState()}),this.mobileTabsResizeObserver.observe(e)))}updateScrollState(){const e=this.mobileTabsElement(),t=e===void 0?0:Math.max(0,e.scrollWidth-e.clientWidth),i=e!==void 0&&e.scrollLeft>1,r=e!==void 0&&t-e.scrollLeft>1;this.canScrollLeft!==i&&(this.canScrollLeft=i),this.canScrollRight!==r&&(this.canScrollRight=r)}mobileTabsElement(){const e=this.mobileTabs;return e instanceof HTMLElement?e:void 0}};ns.styles=_e`
4761
4769
  :host { flex: 0 0 auto; min-width: 0; }
4762
4770
  .mobile-tabs-frame { position: relative; display: flex; flex: 0 0 auto; min-width: 0; border-bottom: 1px solid var(--pi-border); background: var(--pi-bg); }
4763
4771
  :host([bottom]) .mobile-tabs-frame { border-bottom: 0; border-top: 1px solid var(--pi-border); padding-bottom: max(0px, env(safe-area-inset-bottom)); }
@@ -4795,7 +4803,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4795
4803
  .tab-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
4796
4804
  .tab-badge { min-width: 13px; padding: 0 4px; font-size: 10px; line-height: 13px; }
4797
4805
  }
4798
- `;lo([P({attribute:!1})],ns.prototype,"tabs",2);lo([P({attribute:!1})],ns.prototype,"selectedView",2);lo([P({attribute:!1})],ns.prototype,"onSelect",2);lo([P({attribute:!1})],ns.prototype,"onShowActions",2);lo([P({attribute:!1})],ns.prototype,"refreshControl",2);lo([P({type:Boolean,reflect:!0})],ns.prototype,"bottom",2);lo([ui(".mobile-tabs")],ns.prototype,"mobileTabs",2);lo([Ct()],ns.prototype,"canScrollLeft",2);lo([Ct()],ns.prototype,"canScrollRight",2);ns=lo([Ae("app-mobile-main-tabs")],ns);var $J=Object.defineProperty,MJ=Object.getOwnPropertyDescriptor,Gr=(e,t,i,r)=>{for(var s=r>1?void 0:r?MJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&$J(t,i,s),s};let gr=class extends we{constructor(){super(...arguments),this.machines=[],this.statuses={},this.activities={},this.open=!1,this.menuStyle="",this.actionMenuStyle="",this.onDocumentClick=e=>{e.composedPath().includes(this)||(this.open=!1,this.openActionsMachineId=void 0)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick)}disconnectedCallback(){document.removeEventListener("click",this.onDocumentClick),super.disconnectedCallback()}updated(e){e.has("machines")&&this.open&&this.selectedMachine()===void 0&&(this.open=!1),e.has("machines")&&this.openActionsMachineId!==void 0&&!this.machines.some(t=>t.id===this.openActionsMachineId)&&(this.openActionsMachineId=void 0)}async focusSelectedOrFirst(){const e=this.switcherButton();return e===null?!1:await this.openMenuAndFocusOption(e)}render(){const e=this.selectedMachine();if(e===void 0)return null;const t=sf(e,this.statuses),i=e.name;return T`
4806
+ `;lo([P({attribute:!1})],ns.prototype,"tabs",2);lo([P({attribute:!1})],ns.prototype,"selectedView",2);lo([P({attribute:!1})],ns.prototype,"onSelect",2);lo([P({attribute:!1})],ns.prototype,"onShowActions",2);lo([P({attribute:!1})],ns.prototype,"refreshControl",2);lo([P({type:Boolean,reflect:!0})],ns.prototype,"bottom",2);lo([ui(".mobile-tabs")],ns.prototype,"mobileTabs",2);lo([Ct()],ns.prototype,"canScrollLeft",2);lo([Ct()],ns.prototype,"canScrollRight",2);ns=lo([Ae("app-mobile-main-tabs")],ns);var MJ=Object.defineProperty,AJ=Object.getOwnPropertyDescriptor,Gr=(e,t,i,r)=>{for(var s=r>1?void 0:r?AJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&MJ(t,i,s),s};let gr=class extends we{constructor(){super(...arguments),this.machines=[],this.statuses={},this.activities={},this.open=!1,this.menuStyle="",this.actionMenuStyle="",this.onDocumentClick=e=>{e.composedPath().includes(this)||(this.open=!1,this.openActionsMachineId=void 0)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick)}disconnectedCallback(){document.removeEventListener("click",this.onDocumentClick),super.disconnectedCallback()}updated(e){e.has("machines")&&this.open&&this.selectedMachine()===void 0&&(this.open=!1),e.has("machines")&&this.openActionsMachineId!==void 0&&!this.machines.some(t=>t.id===this.openActionsMachineId)&&(this.openActionsMachineId=void 0)}async focusSelectedOrFirst(){const e=this.switcherButton();return e===null?!1:await this.openMenuAndFocusOption(e)}render(){const e=this.selectedMachine();if(e===void 0)return null;const t=sf(e,this.statuses),i=e.name;return T`
4799
4807
  <div class="machine-switcher">
4800
4808
  <button
4801
4809
  type="button"
@@ -4884,7 +4892,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4884
4892
  .machine-option-actions-panel button:hover, .machine-option-actions-panel button:focus-visible { background: var(--pi-selection-bg); }
4885
4893
  .machine-option-actions-panel button.danger:hover, .machine-option-actions-panel button.danger:focus-visible { background: color-mix(in srgb, var(--pi-danger) 14%, transparent); }
4886
4894
  @keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
4887
- `;Gr([P({attribute:!1})],gr.prototype,"machines",2);Gr([P({attribute:!1})],gr.prototype,"selected",2);Gr([P({attribute:!1})],gr.prototype,"statuses",2);Gr([P({attribute:!1})],gr.prototype,"activities",2);Gr([P({attribute:!1})],gr.prototype,"onSelect",2);Gr([P({attribute:!1})],gr.prototype,"onRemove",2);Gr([P({attribute:!1})],gr.prototype,"onFocusNextSection",2);Gr([P({attribute:!1})],gr.prototype,"onCancelKeyboardNavigation",2);Gr([Ct()],gr.prototype,"open",2);Gr([Ct()],gr.prototype,"menuStyle",2);Gr([Ct()],gr.prototype,"openActionsMachineId",2);Gr([Ct()],gr.prototype,"actionMenuStyle",2);gr=Gr([Ae("machine-switcher")],gr);function sf(e,t){return t[e.id]?.status??e.status??"unknown"}function Nw(e){return e==="online"?"online":e==="offline"?"offline":e==="error"?"error":"unknown"}function Ww(e){return e.baseUrl??e.name}function qw(e){if(typeof HTMLElement>"u"||typeof window>"u"||!(e instanceof HTMLElement))return"";const t=e.getBoundingClientRect(),i=8,r=Math.min(280,Math.max(0,window.innerWidth-i*2)),s=Math.min(Math.max(i,t.left),Math.max(i,window.innerWidth-i-r)),o=Math.max(0,window.innerHeight-t.bottom-i);return[`top: ${jh(t.bottom)};`,`left: ${jh(s)};`,`width: ${jh(r)};`,`max-height: ${jh(o)};`].join(" ")}function jh(e){return`${String(Math.round(e))}px`}var AJ=Object.defineProperty,BJ=Object.getOwnPropertyDescriptor,Jt=(e,t,i,r)=>{for(var s=r>1?void 0:r?BJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&AJ(t,i,s),s};let Zt=class extends we{constructor(){super(...arguments),this.machines=[],this.machineStatuses={},this.machineActivities={},this.projects=[],this.workspaces=[],this.sessions=[],this.workspaceActivities={},this.sessionActivities={},this.sessionStatuses={},this.sendingPrompts={},this.workspacesByProjectId={},this.deletingWorkspaceIds=[],this.workspaceLabelItems=()=>[],this.collapsible=!1,this.compact=!1,this.machinesCollapsed=!1,this.projectsCollapsed=!1,this.workspacesCollapsed=!1,this.sessionsCollapsed=!1,this.hideWorkspaces=!1,this.startingSessionCount=0,this.canStartSession=!1,this.canDeleteArchivedSessions=!1,this.canReloadSessions=!1,this.canCleanupSessions=!1,this.archivedDeleteUnavailableMessage="Update and restart Omp-Web on this machine to delete archived sessions.",this.cleanupUnavailableMessage="Update and restart Omp-Web on this machine to clean up sessions."}async focusSection(e){switch(await this.updateComplete,e){case"machines":return await this.focusNavigableSection(this.compact?this.machineList:this.machineSwitcher);case"projects":return await this.focusNavigableSection(this.projectList);case"workspaces":return this.hideWorkspaces?await this.focusNavigableSection(this.sessionList):await this.focusNavigableSection(this.workspaceList);case"sessions":return await this.focusNavigableSection(this.sessionList)}}render(){return T`
4895
+ `;Gr([P({attribute:!1})],gr.prototype,"machines",2);Gr([P({attribute:!1})],gr.prototype,"selected",2);Gr([P({attribute:!1})],gr.prototype,"statuses",2);Gr([P({attribute:!1})],gr.prototype,"activities",2);Gr([P({attribute:!1})],gr.prototype,"onSelect",2);Gr([P({attribute:!1})],gr.prototype,"onRemove",2);Gr([P({attribute:!1})],gr.prototype,"onFocusNextSection",2);Gr([P({attribute:!1})],gr.prototype,"onCancelKeyboardNavigation",2);Gr([Ct()],gr.prototype,"open",2);Gr([Ct()],gr.prototype,"menuStyle",2);Gr([Ct()],gr.prototype,"openActionsMachineId",2);Gr([Ct()],gr.prototype,"actionMenuStyle",2);gr=Gr([Ae("machine-switcher")],gr);function sf(e,t){return t[e.id]?.status??e.status??"unknown"}function Nw(e){return e==="online"?"online":e==="offline"?"offline":e==="error"?"error":"unknown"}function Ww(e){return e.baseUrl??e.name}function qw(e){if(typeof HTMLElement>"u"||typeof window>"u"||!(e instanceof HTMLElement))return"";const t=e.getBoundingClientRect(),i=8,r=Math.min(280,Math.max(0,window.innerWidth-i*2)),s=Math.min(Math.max(i,t.left),Math.max(i,window.innerWidth-i-r)),o=Math.max(0,window.innerHeight-t.bottom-i);return[`top: ${jh(t.bottom)};`,`left: ${jh(s)};`,`width: ${jh(r)};`,`max-height: ${jh(o)};`].join(" ")}function jh(e){return`${String(Math.round(e))}px`}var BJ=Object.defineProperty,_J=Object.getOwnPropertyDescriptor,Jt=(e,t,i,r)=>{for(var s=r>1?void 0:r?_J(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&BJ(t,i,s),s};let Zt=class extends we{constructor(){super(...arguments),this.machines=[],this.machineStatuses={},this.machineActivities={},this.projects=[],this.workspaces=[],this.sessions=[],this.workspaceActivities={},this.sessionActivities={},this.sessionStatuses={},this.sendingPrompts={},this.workspacesByProjectId={},this.deletingWorkspaceIds=[],this.workspaceLabelItems=()=>[],this.collapsible=!1,this.compact=!1,this.machinesCollapsed=!1,this.projectsCollapsed=!1,this.workspacesCollapsed=!1,this.sessionsCollapsed=!1,this.hideWorkspaces=!1,this.startingSessionCount=0,this.canStartSession=!1,this.canDeleteArchivedSessions=!1,this.canReloadSessions=!1,this.canCleanupSessions=!1,this.archivedDeleteUnavailableMessage="Update and restart Omp-Web on this machine to delete archived sessions.",this.cleanupUnavailableMessage="Update and restart Omp-Web on this machine to clean up sessions."}async focusSection(e){switch(await this.updateComplete,e){case"machines":return await this.focusNavigableSection(this.compact?this.machineList:this.machineSwitcher);case"projects":return await this.focusNavigableSection(this.projectList);case"workspaces":return this.hideWorkspaces?await this.focusNavigableSection(this.sessionList):await this.focusNavigableSection(this.workspaceList);case"sessions":return await this.focusNavigableSection(this.sessionList)}}render(){return T`
4888
4896
  <header>
4889
4897
  <strong>OMP Web</strong>
4890
4898
  ${mu(this.machines)?T`
@@ -4983,7 +4991,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
4983
4991
  .onFocusNextSection=${()=>{this.focusNextFrom("sessions")}}
4984
4992
  .onCancelKeyboardNavigation=${()=>{this.cancelKeyboardNavigation()}}
4985
4993
  ></session-list>
4986
- `}async focusNavigableSection(e){return e===void 0?!1:await e.focusSelectedOrFirst()}focusPreviousFrom(e){const t=_J(e,this.machines);t!==void 0&&this.onFocusNavigationTarget?.(t)}focusNextFrom(e){this.onFocusNavigationTarget?.(LJ(e,this.machines))}cancelKeyboardNavigation(){this.onCancelKeyboardNavigation?.()}};Zt.styles=_e`
4994
+ `}async focusNavigableSection(e){return e===void 0?!1:await e.focusSelectedOrFirst()}focusPreviousFrom(e){const t=LJ(e,this.machines);t!==void 0&&this.onFocusNavigationTarget?.(t)}focusNextFrom(e){this.onFocusNavigationTarget?.(PJ(e,this.machines))}cancelKeyboardNavigation(){this.onCancelKeyboardNavigation?.()}};Zt.styles=_e`
4987
4995
  :host { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
4988
4996
  :host([compact]) { flex: 1 1 auto; }
4989
4997
  header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; border-bottom: 1px solid var(--pi-border); }
@@ -5007,7 +5015,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5007
5015
  :host([compact]) workspace-list[collapsed],
5008
5016
  :host([compact]) session-list[collapsed] { flex: 0 0 auto; min-height: auto; overflow: hidden; }
5009
5017
  button { border: 1px solid var(--pi-border); border-radius: 8px; background: var(--pi-surface); color: var(--pi-text); padding: 7px 9px; cursor: pointer; }
5010
- `;Jt([P({attribute:!1})],Zt.prototype,"machines",2);Jt([P({attribute:!1})],Zt.prototype,"selectedMachine",2);Jt([P({attribute:!1})],Zt.prototype,"machineStatuses",2);Jt([P({attribute:!1})],Zt.prototype,"machineActivities",2);Jt([P({attribute:!1})],Zt.prototype,"projects",2);Jt([P({attribute:!1})],Zt.prototype,"selectedProject",2);Jt([P({attribute:!1})],Zt.prototype,"workspaces",2);Jt([P({attribute:!1})],Zt.prototype,"selectedWorkspace",2);Jt([P({attribute:!1})],Zt.prototype,"sessions",2);Jt([P({attribute:!1})],Zt.prototype,"selectedSession",2);Jt([P({attribute:!1})],Zt.prototype,"workspaceActivities",2);Jt([P({attribute:!1})],Zt.prototype,"sessionActivities",2);Jt([P({attribute:!1})],Zt.prototype,"sessionStatuses",2);Jt([P({attribute:!1})],Zt.prototype,"sendingPrompts",2);Jt([P({attribute:!1})],Zt.prototype,"workspacesByProjectId",2);Jt([P({attribute:!1})],Zt.prototype,"deletingWorkspaceIds",2);Jt([P({attribute:!1})],Zt.prototype,"workspaceLabelItems",2);Jt([P({attribute:!1})],Zt.prototype,"refreshControl",2);Jt([P({type:Boolean,reflect:!0})],Zt.prototype,"collapsible",2);Jt([P({type:Boolean,reflect:!0})],Zt.prototype,"compact",2);Jt([P({type:Boolean})],Zt.prototype,"machinesCollapsed",2);Jt([P({type:Boolean})],Zt.prototype,"projectsCollapsed",2);Jt([P({type:Boolean})],Zt.prototype,"workspacesCollapsed",2);Jt([P({type:Boolean})],Zt.prototype,"sessionsCollapsed",2);Jt([P({type:Boolean,reflect:!0,attribute:"hide-workspaces"})],Zt.prototype,"hideWorkspaces",2);Jt([P({type:Number})],Zt.prototype,"startingSessionCount",2);Jt([P({type:Boolean})],Zt.prototype,"canStartSession",2);Jt([P({type:Boolean})],Zt.prototype,"canDeleteArchivedSessions",2);Jt([P({type:Boolean})],Zt.prototype,"canReloadSessions",2);Jt([P({type:Boolean})],Zt.prototype,"canCleanupSessions",2);Jt([P({type:String})],Zt.prototype,"archivedDeleteUnavailableMessage",2);Jt([P({type:String})],Zt.prototype,"cleanupUnavailableMessage",2);Jt([P({attribute:!1})],Zt.prototype,"onShowActions",2);Jt([P({attribute:!1})],Zt.prototype,"onToggleMachines",2);Jt([P({attribute:!1})],Zt.prototype,"onToggleProjects",2);Jt([P({attribute:!1})],Zt.prototype,"onToggleWorkspaces",2);Jt([P({attribute:!1})],Zt.prototype,"onToggleSessions",2);Jt([P({attribute:!1})],Zt.prototype,"onSelectProject",2);Jt([P({attribute:!1})],Zt.prototype,"onCloseProject",2);Jt([P({attribute:!1})],Zt.prototype,"onSelectWorkspace",2);Jt([P({attribute:!1})],Zt.prototype,"onDeleteWorkspace",2);Jt([P({attribute:!1})],Zt.prototype,"onStartSession",2);Jt([P({attribute:!1})],Zt.prototype,"onSelectSession",2);Jt([P({attribute:!1})],Zt.prototype,"onArchiveSession",2);Jt([P({attribute:!1})],Zt.prototype,"onArchiveSessionWithDescendants",2);Jt([P({attribute:!1})],Zt.prototype,"onArchiveSessions",2);Jt([P({attribute:!1})],Zt.prototype,"onRestoreSession",2);Jt([P({attribute:!1})],Zt.prototype,"onDeleteCachedNewSession",2);Jt([P({attribute:!1})],Zt.prototype,"onDeleteArchivedSession",2);Jt([P({attribute:!1})],Zt.prototype,"onDeleteArchivedSessions",2);Jt([P({attribute:!1})],Zt.prototype,"onDetachParentSession",2);Jt([P({attribute:!1})],Zt.prototype,"onReloadSession",2);Jt([P({attribute:!1})],Zt.prototype,"onCleanupSessions",2);Jt([P({attribute:!1})],Zt.prototype,"onArchivedCollapsed",2);Jt([P({attribute:!1})],Zt.prototype,"onSelectMachine",2);Jt([P({attribute:!1})],Zt.prototype,"onRemoveMachine",2);Jt([P({attribute:!1})],Zt.prototype,"onFocusNavigationTarget",2);Jt([P({attribute:!1})],Zt.prototype,"onCancelKeyboardNavigation",2);Jt([ui("machine-list")],Zt.prototype,"machineList",2);Jt([ui("machine-switcher")],Zt.prototype,"machineSwitcher",2);Jt([ui("project-list")],Zt.prototype,"projectList",2);Jt([ui("workspace-list")],Zt.prototype,"workspaceList",2);Jt([ui("session-list")],Zt.prototype,"sessionList",2);Zt=Jt([Ae("app-navigation-panel")],Zt);function mu(e){return e.length>1}function _J(e,t){const i=l7(t);return i[i.indexOf(e)-1]}function LJ(e,t){const i=l7(t);return i[i.indexOf(e)+1]??"chat"}function l7(e){return Bd.filter(t=>t!=="machines"||mu(e))}var PJ=Object.defineProperty,EJ=Object.getOwnPropertyDescriptor,nr=(e,t,i,r)=>{for(var s=r>1?void 0:r?EJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&PJ(t,i,s),s};const RJ=new Set(["ArrowLeft","ArrowRight","Home","End"]),IJ=420,zJ=4;let Wi=class extends we{constructor(){super(...arguments),this.side="navigation",this.collapsed=!1,this.resizable=!1,this.controls="",this.resizeLabel="Resize panel",this.expandLabel="Expand panel",this.collapseLabel="Collapse panel",this.lastTapAt=0}disconnectedCallback(){this.finishActiveResize(),super.disconnectedCallback()}render(){const e=this.collapsed?this.expandLabel:this.collapseLabel;return T`
5018
+ `;Jt([P({attribute:!1})],Zt.prototype,"machines",2);Jt([P({attribute:!1})],Zt.prototype,"selectedMachine",2);Jt([P({attribute:!1})],Zt.prototype,"machineStatuses",2);Jt([P({attribute:!1})],Zt.prototype,"machineActivities",2);Jt([P({attribute:!1})],Zt.prototype,"projects",2);Jt([P({attribute:!1})],Zt.prototype,"selectedProject",2);Jt([P({attribute:!1})],Zt.prototype,"workspaces",2);Jt([P({attribute:!1})],Zt.prototype,"selectedWorkspace",2);Jt([P({attribute:!1})],Zt.prototype,"sessions",2);Jt([P({attribute:!1})],Zt.prototype,"selectedSession",2);Jt([P({attribute:!1})],Zt.prototype,"workspaceActivities",2);Jt([P({attribute:!1})],Zt.prototype,"sessionActivities",2);Jt([P({attribute:!1})],Zt.prototype,"sessionStatuses",2);Jt([P({attribute:!1})],Zt.prototype,"sendingPrompts",2);Jt([P({attribute:!1})],Zt.prototype,"workspacesByProjectId",2);Jt([P({attribute:!1})],Zt.prototype,"deletingWorkspaceIds",2);Jt([P({attribute:!1})],Zt.prototype,"workspaceLabelItems",2);Jt([P({attribute:!1})],Zt.prototype,"refreshControl",2);Jt([P({type:Boolean,reflect:!0})],Zt.prototype,"collapsible",2);Jt([P({type:Boolean,reflect:!0})],Zt.prototype,"compact",2);Jt([P({type:Boolean})],Zt.prototype,"machinesCollapsed",2);Jt([P({type:Boolean})],Zt.prototype,"projectsCollapsed",2);Jt([P({type:Boolean})],Zt.prototype,"workspacesCollapsed",2);Jt([P({type:Boolean})],Zt.prototype,"sessionsCollapsed",2);Jt([P({type:Boolean,reflect:!0,attribute:"hide-workspaces"})],Zt.prototype,"hideWorkspaces",2);Jt([P({type:Number})],Zt.prototype,"startingSessionCount",2);Jt([P({type:Boolean})],Zt.prototype,"canStartSession",2);Jt([P({type:Boolean})],Zt.prototype,"canDeleteArchivedSessions",2);Jt([P({type:Boolean})],Zt.prototype,"canReloadSessions",2);Jt([P({type:Boolean})],Zt.prototype,"canCleanupSessions",2);Jt([P({type:String})],Zt.prototype,"archivedDeleteUnavailableMessage",2);Jt([P({type:String})],Zt.prototype,"cleanupUnavailableMessage",2);Jt([P({attribute:!1})],Zt.prototype,"onShowActions",2);Jt([P({attribute:!1})],Zt.prototype,"onToggleMachines",2);Jt([P({attribute:!1})],Zt.prototype,"onToggleProjects",2);Jt([P({attribute:!1})],Zt.prototype,"onToggleWorkspaces",2);Jt([P({attribute:!1})],Zt.prototype,"onToggleSessions",2);Jt([P({attribute:!1})],Zt.prototype,"onSelectProject",2);Jt([P({attribute:!1})],Zt.prototype,"onCloseProject",2);Jt([P({attribute:!1})],Zt.prototype,"onSelectWorkspace",2);Jt([P({attribute:!1})],Zt.prototype,"onDeleteWorkspace",2);Jt([P({attribute:!1})],Zt.prototype,"onStartSession",2);Jt([P({attribute:!1})],Zt.prototype,"onSelectSession",2);Jt([P({attribute:!1})],Zt.prototype,"onArchiveSession",2);Jt([P({attribute:!1})],Zt.prototype,"onArchiveSessionWithDescendants",2);Jt([P({attribute:!1})],Zt.prototype,"onArchiveSessions",2);Jt([P({attribute:!1})],Zt.prototype,"onRestoreSession",2);Jt([P({attribute:!1})],Zt.prototype,"onDeleteCachedNewSession",2);Jt([P({attribute:!1})],Zt.prototype,"onDeleteArchivedSession",2);Jt([P({attribute:!1})],Zt.prototype,"onDeleteArchivedSessions",2);Jt([P({attribute:!1})],Zt.prototype,"onDetachParentSession",2);Jt([P({attribute:!1})],Zt.prototype,"onReloadSession",2);Jt([P({attribute:!1})],Zt.prototype,"onCleanupSessions",2);Jt([P({attribute:!1})],Zt.prototype,"onArchivedCollapsed",2);Jt([P({attribute:!1})],Zt.prototype,"onSelectMachine",2);Jt([P({attribute:!1})],Zt.prototype,"onRemoveMachine",2);Jt([P({attribute:!1})],Zt.prototype,"onFocusNavigationTarget",2);Jt([P({attribute:!1})],Zt.prototype,"onCancelKeyboardNavigation",2);Jt([ui("machine-list")],Zt.prototype,"machineList",2);Jt([ui("machine-switcher")],Zt.prototype,"machineSwitcher",2);Jt([ui("project-list")],Zt.prototype,"projectList",2);Jt([ui("workspace-list")],Zt.prototype,"workspaceList",2);Jt([ui("session-list")],Zt.prototype,"sessionList",2);Zt=Jt([Ae("app-navigation-panel")],Zt);function mu(e){return e.length>1}function LJ(e,t){const i=l7(t);return i[i.indexOf(e)-1]}function PJ(e,t){const i=l7(t);return i[i.indexOf(e)+1]??"chat"}function l7(e){return Bd.filter(t=>t!=="machines"||mu(e))}var EJ=Object.defineProperty,RJ=Object.getOwnPropertyDescriptor,nr=(e,t,i,r)=>{for(var s=r>1?void 0:r?RJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&EJ(t,i,s),s};const IJ=new Set(["ArrowLeft","ArrowRight","Home","End"]),zJ=420,DJ=4;let Wi=class extends we{constructor(){super(...arguments),this.side="navigation",this.collapsed=!1,this.resizable=!1,this.controls="",this.resizeLabel="Resize panel",this.expandLabel="Expand panel",this.collapseLabel="Collapse panel",this.lastTapAt=0}disconnectedCallback(){this.finishActiveResize(),super.disconnectedCallback()}render(){const e=this.collapsed?this.expandLabel:this.collapseLabel;return T`
5011
5019
  ${this.renderResizeHandle()}
5012
5020
  <button
5013
5021
  type="button"
@@ -5037,7 +5045,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5037
5045
  @dblclick=${t=>{this.onResizeDoubleClick(t)}}
5038
5046
  @keydown=${t=>{this.onResizeKeyDown(t)}}
5039
5047
  ></div>
5040
- `}resizeAriaValueNow(){return this.panelWidth===void 0?Qe:String(Math.round(this.panelWidth))}renderIcon(){const t=this.iconDirection()==="left"?"M15 18l-6-6 6-6":"M9 18l6-6-6-6";return T`<svg class="edge-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d=${t}/></svg>`}iconDirection(){return this.side==="navigation"?this.collapsed?"right":"left":this.collapsed?"left":"right"}onResizePointerDown(e){if(!this.resizable||e.button!==0)return;const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const i=this.resizeStartWidth();i!==void 0&&(e.preventDefault(),e.stopPropagation(),t.setPointerCapture(e.pointerId),this.activeResize={pointerId:e.pointerId,startClientX:e.clientX,startWidth:i,handle:t,moved:!1},this.toggleAttribute("resizing",!0))}onResizePointerMove(e){const t=this.activeResize;t?.pointerId===e.pointerId&&(e.preventDefault(),!(Math.abs(e.clientX-t.startClientX)<=zJ)&&(t.moved=!0,this.commitPanelWidth(LA(this.side,t.startWidth,t.startClientX,e.clientX,this.resizeConstraints()))))}onResizePointerUp(e){const t=this.activeResize;t?.pointerId===e.pointerId&&(e.preventDefault(),this.finishActiveResize(),t.moved||this.registerTapForReset())}onResizePointerCancel(e){this.activeResize?.pointerId===e.pointerId&&this.finishActiveResize()}onResizeDoubleClick(e){e.preventDefault(),e.stopPropagation(),this.resetPanelSize()}onResizeKeyDown(e){if(!this.resizable||!RJ.has(e.key))return;const t=this.resizeStartWidth();if(t===void 0)return;const i=PA(this.side,t,e.key,{largeStep:e.shiftKey,constraints:this.resizeConstraints()});i!==void 0&&(e.preventDefault(),e.stopPropagation(),this.commitPanelWidth(i),this.onResizeEnd?.())}registerTapForReset(){const e=Date.now();if(e-this.lastTapAt<=IJ){this.lastTapAt=0,this.resetPanelSize();return}this.lastTapAt=e}resetPanelSize(){this.finishActiveResize(),this.onReset?.()}resizeStartWidth(){const e=this.onResizeStart?.()??this.panelWidth;if(e!==void 0)return Zr(this.side,e,this.resizeConstraints())}commitPanelWidth(e){this.onResize?.(Zr(this.side,e,this.resizeConstraints()))}finishActiveResize(){const e=this.activeResize;if(e!==void 0){try{e.handle.releasePointerCapture(e.pointerId)}catch{}this.activeResize=void 0,this.toggleAttribute("resizing",!1),this.onResizeEnd?.()}}resizeConstraints(){const e=Nc(this.side);return{...e,minWidth:this.minWidth??e.minWidth,maxWidth:this.maxWidth??e.maxWidth}}};Wi.styles=_e`
5048
+ `}resizeAriaValueNow(){return this.panelWidth===void 0?Qe:String(Math.round(this.panelWidth))}renderIcon(){const t=this.iconDirection()==="left"?"M15 18l-6-6 6-6":"M9 18l6-6-6-6";return T`<svg class="edge-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d=${t}/></svg>`}iconDirection(){return this.side==="navigation"?this.collapsed?"right":"left":this.collapsed?"left":"right"}onResizePointerDown(e){if(!this.resizable||e.button!==0)return;const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const i=this.resizeStartWidth();i!==void 0&&(e.preventDefault(),e.stopPropagation(),t.setPointerCapture(e.pointerId),this.activeResize={pointerId:e.pointerId,startClientX:e.clientX,startWidth:i,handle:t,moved:!1},this.toggleAttribute("resizing",!0))}onResizePointerMove(e){const t=this.activeResize;t?.pointerId===e.pointerId&&(e.preventDefault(),!(Math.abs(e.clientX-t.startClientX)<=DJ)&&(t.moved=!0,this.commitPanelWidth(LA(this.side,t.startWidth,t.startClientX,e.clientX,this.resizeConstraints()))))}onResizePointerUp(e){const t=this.activeResize;t?.pointerId===e.pointerId&&(e.preventDefault(),this.finishActiveResize(),t.moved||this.registerTapForReset())}onResizePointerCancel(e){this.activeResize?.pointerId===e.pointerId&&this.finishActiveResize()}onResizeDoubleClick(e){e.preventDefault(),e.stopPropagation(),this.resetPanelSize()}onResizeKeyDown(e){if(!this.resizable||!IJ.has(e.key))return;const t=this.resizeStartWidth();if(t===void 0)return;const i=PA(this.side,t,e.key,{largeStep:e.shiftKey,constraints:this.resizeConstraints()});i!==void 0&&(e.preventDefault(),e.stopPropagation(),this.commitPanelWidth(i),this.onResizeEnd?.())}registerTapForReset(){const e=Date.now();if(e-this.lastTapAt<=zJ){this.lastTapAt=0,this.resetPanelSize();return}this.lastTapAt=e}resetPanelSize(){this.finishActiveResize(),this.onReset?.()}resizeStartWidth(){const e=this.onResizeStart?.()??this.panelWidth;if(e!==void 0)return Zr(this.side,e,this.resizeConstraints())}commitPanelWidth(e){this.onResize?.(Zr(this.side,e,this.resizeConstraints()))}finishActiveResize(){const e=this.activeResize;if(e!==void 0){try{e.handle.releasePointerCapture(e.pointerId)}catch{}this.activeResize=void 0,this.toggleAttribute("resizing",!1),this.onResizeEnd?.()}}resizeConstraints(){const e=Nc(this.side);return{...e,minWidth:this.minWidth??e.minWidth,maxWidth:this.maxWidth??e.maxWidth}}};Wi.styles=_e`
5041
5049
  :host { position: relative; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: visible; background: var(--pi-border-muted); z-index: 2; }
5042
5050
  :host([side="navigation"]) { grid-column: 2; }
5043
5051
  :host([side="workspace"]) { grid-column: 4; }
@@ -5056,7 +5064,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5056
5064
  @media (max-width: 760px) {
5057
5065
  :host([side="navigation"]) { display: none; }
5058
5066
  }
5059
- `;nr([P({reflect:!0})],Wi.prototype,"side",2);nr([P({type:Boolean,reflect:!0})],Wi.prototype,"collapsed",2);nr([P({type:Boolean})],Wi.prototype,"resizable",2);nr([P({type:Number})],Wi.prototype,"panelWidth",2);nr([P({type:Number})],Wi.prototype,"minWidth",2);nr([P({type:Number})],Wi.prototype,"maxWidth",2);nr([P()],Wi.prototype,"controls",2);nr([P()],Wi.prototype,"resizeLabel",2);nr([P()],Wi.prototype,"expandLabel",2);nr([P()],Wi.prototype,"collapseLabel",2);nr([P({attribute:!1})],Wi.prototype,"onToggle",2);nr([P({attribute:!1})],Wi.prototype,"onResizeStart",2);nr([P({attribute:!1})],Wi.prototype,"onResize",2);nr([P({attribute:!1})],Wi.prototype,"onResizeEnd",2);nr([P({attribute:!1})],Wi.prototype,"onReset",2);Wi=nr([Ae("app-panel-edge-control")],Wi);var DJ=Object.defineProperty,FJ=Object.getOwnPropertyDescriptor,c7=(e,t,i,r)=>{for(var s=r>1?void 0:r?FJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&DJ(t,i,s),s};let bu=class extends we{constructor(){super(...arguments),this.onReloadClick=e=>{e.stopPropagation(),this.onReload?.()}}render(){const e="Full page reload";return T`
5067
+ `;nr([P({reflect:!0})],Wi.prototype,"side",2);nr([P({type:Boolean,reflect:!0})],Wi.prototype,"collapsed",2);nr([P({type:Boolean})],Wi.prototype,"resizable",2);nr([P({type:Number})],Wi.prototype,"panelWidth",2);nr([P({type:Number})],Wi.prototype,"minWidth",2);nr([P({type:Number})],Wi.prototype,"maxWidth",2);nr([P()],Wi.prototype,"controls",2);nr([P()],Wi.prototype,"resizeLabel",2);nr([P()],Wi.prototype,"expandLabel",2);nr([P()],Wi.prototype,"collapseLabel",2);nr([P({attribute:!1})],Wi.prototype,"onToggle",2);nr([P({attribute:!1})],Wi.prototype,"onResizeStart",2);nr([P({attribute:!1})],Wi.prototype,"onResize",2);nr([P({attribute:!1})],Wi.prototype,"onResizeEnd",2);nr([P({attribute:!1})],Wi.prototype,"onReset",2);Wi=nr([Ae("app-panel-edge-control")],Wi);var FJ=Object.defineProperty,OJ=Object.getOwnPropertyDescriptor,c7=(e,t,i,r)=>{for(var s=r>1?void 0:r?OJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&FJ(t,i,s),s};let bu=class extends we{constructor(){super(...arguments),this.onReloadClick=e=>{e.stopPropagation(),this.onReload?.()}}render(){const e="Full page reload";return T`
5060
5068
  <button
5061
5069
  class="app-refresh-button"
5062
5070
  title=${e}
@@ -5075,7 +5083,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5075
5083
  :host, :host * { -webkit-user-select: none; user-select: none; }
5076
5084
  .app-refresh-button { box-sizing: border-box; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--pi-border); border-radius: 999px; background: var(--pi-surface); color: var(--pi-text); padding: 0; line-height: 1; cursor: pointer; touch-action: manipulation; -webkit-touch-callout: none; }
5077
5085
  .app-refresh-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
5078
- `;c7([P({attribute:!1})],bu.prototype,"onReload",2);bu=c7([Ae("app-refresh-control")],bu);function OJ(){return[{id:"actions.show",title:"Show Actions",description:"Open the command palette",shortcut:"mod+k",group:"General",run:e=>{e.openActionPalette()}},{id:"prompt.focus",title:"Focus Prompt",description:"Move keyboard focus to the message composer",shortcut:"mod+g c",group:"General",run:e=>{e.focusPrompt()}},{id:"machine.add",title:"Add Machine",description:"Register another PI WEB runtime reachable from this gateway",group:"Machine",run:e=>e.addMachine()},{id:"machine.refresh",title:"Refresh Selected Machine",description:"Check whether the selected PI WEB runtime is online",group:"Machine",run:e=>e.refreshSelectedMachine()},{id:"machine.open",title:"Open Selected Machine PI WEB",description:"Open the selected remote PI WEB directly in a new tab",group:"Machine",enabled:e=>e.state.selectedMachine?.kind==="remote"&&e.state.selectedMachine.baseUrl!==void 0,run:e=>e.openSelectedMachine()},{id:"machine.remove",title:"Remove Selected Machine",description:"Remove the selected remote machine from this gateway",group:"Machine",enabled:e=>e.state.selectedMachine?.kind==="remote",run:e=>e.removeSelectedMachine()},{id:"project.add",title:"Add Project",group:"Project",run:e=>e.addProject()},{id:"auth.login",title:"Configure Provider Authentication",description:"Run /login without tying authentication to a session",group:"General",run:e=>e.configureAuth()},{id:"auth.logout",title:"Remove Provider Authentication",description:"Run /logout for stored pi credentials",group:"General",run:e=>e.logoutAuth()},{id:"theme.select",title:"Select Theme",description:"Choose the PI WEB color theme",group:"Preferences",run:e=>{e.openThemePicker()}},{id:"settings.open",title:"Open Settings",description:"Manage PI WEB configuration and keyboard shortcuts",shortcut:"mod+,",group:"Preferences",run:e=>{e.ompWebUnstable?.openSettings?.()}},{id:"app.reload-page",title:"Full Page Reload",description:"Reload the PI WEB browser page",group:"General",run:e=>{e.reloadPage()}},{id:"view.chat",title:"Go to Chat",shortcut:"mod+1",group:"Navigation",run:e=>{e.focusPrompt()}},{id:"view.files",title:"Go to Files",shortcut:"mod+2",group:"Navigation",enabled:jl,run:e=>{e.selectMainView("core:workspace.files")}},{id:"view.git",title:"Go to Git",shortcut:"mod+3",group:"Navigation",enabled:Hw,run:e=>{e.selectMainView("core:workspace.git")}},{id:"view.terminal",title:"Go to Terminal",shortcut:"mod+4",group:"Navigation",enabled:jl,run:e=>{e.selectMainView("core:workspace.terminal")}},{id:"workspace.refresh-files",title:"Refresh Files",shortcut:"mod+shift+f",group:"Workspace",enabled:jl,run:e=>e.refreshFiles()},{id:"workspace.refresh-git",title:"Refresh Git",shortcut:"mod+shift+g",group:"Workspace",enabled:Hw,run:e=>e.refreshGit()},{id:"workspace.refresh-current",title:"Refresh Current Panel",shortcut:"mod+shift+r",group:"Workspace",enabled:jl,run:e=>e.state.workspaceTool==="core:workspace.git"&&e.state.selectedWorkspace?.isGitRepo===!0?e.refreshGit():e.refreshFiles()},{id:"workspace.delete",title:"Delete Workspace",description:"Remove the selected Git worktree",group:"Workspace",enabled:NJ,run:e=>e.deleteWorkspace()},{id:"session.start",title:"Start Session",shortcut:"mod+enter",group:"Session",enabled:jl,run:e=>e.startSession()},{id:"session.archive",title:"Archive Session",description:"Archive the selected session",group:"Session",enabled:WJ,run:e=>e.archiveSession()},{id:"session.reload",title:"Reload Session from Disk",description:"Close and re-open the selected session from its session file. Use /reload in the prompt for Pi runtime resources.",group:"Session",enabled:HJ,disabledReason:h7,run:e=>e.reloadSession()},{id:"session.delete",title:"Delete New Session",description:"Delete the selected transient new session",group:"Session",enabled:qJ,run:e=>e.deleteCachedNewSession()},{id:"session.stop",title:"Stop Active Work",shortcut:"mod+.",group:"Session",enabled:e=>e.state.selectedSession!==void 0&&na(e.state.status,e.state.activity),run:e=>e.stopActiveWork()}]}function jl(e){return e.state.selectedWorkspace!==void 0}function Hw(e){return e.state.selectedWorkspace?.isGitRepo===!0}function NJ(e){const t=e.state.selectedWorkspace;return t!==void 0&&t.isGitWorktree&&!t.isMain&&!Gk(e.state,t)}function WJ(e){return Ws(e.state.selectedSession,e.state.status)}function qJ(e){return wc(e.state.selectedSession,e.state.status)}function HJ(e){return!Ws(e.state.selectedSession,e.state.status)||h7(e)!==void 0?!1:!na(e.state.status,e.state.activity)}function h7(e){if(Ws(e.state.selectedSession,e.state.status)&&!na(e.state.status,e.state.activity))return jJ(e.state,Kr.sessionsReload,"reload sessions from disk")}function jJ(e,t,i){const r=e.machineRuntimes[wt(e)];if(!(r?.ok===!0&&vs(r,t)))return`Update and restart Omp-Web on ${e.selectedMachine?.name??"this machine"} to ${i}.`}const UJ=10*1024*1024,YJ="10 MB";var GJ=Object.defineProperty,XJ=Object.getOwnPropertyDescriptor,No=(e,t,i,r)=>{for(var s=r>1?void 0:r?XJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&GJ(t,i,s),s};function VJ(e){return e.split("/").pop()??e}let Ms=class extends we{constructor(){super(...arguments),this.destinationFolder="",this.overwrite=!1,this.createDirs=!0,this.formError="",this.dragActive=!1,this.dragDepth=0,this.openFilePicker=()=>{this.uploadInput?.click()},this.handleFileInputChange=e=>{const t=e.currentTarget instanceof HTMLInputElement?e.currentTarget:void 0,i=t?.files?Array.from(t.files):[];t!==void 0&&(t.value=""),i.length>0&&this.openUploadReview(i)},this.handleDragEnter=e=>{Uh(e)&&(e.preventDefault(),this.dragDepth+=1,this.dragActive=!0)},this.handleDragOver=e=>{Uh(e)&&(e.preventDefault(),e.dataTransfer!==null&&(e.dataTransfer.dropEffect="copy"),this.dragActive=!0)},this.handleDragLeave=e=>{Uh(e)&&(e.preventDefault(),this.dragDepth=Math.max(0,this.dragDepth-1),this.dragDepth===0&&(this.dragActive=!1))},this.handleDrop=e=>{if(!Uh(e))return;e.preventDefault(),this.dragDepth=0,this.dragActive=!1;const t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[],i=this.context;t.length>0&&i!==void 0&&JJ(i,t)},this.handleDestinationInput=e=>{const t=e.currentTarget instanceof HTMLInputElement?e.currentTarget:void 0;this.destinationFolder=t?.value??"",this.formError=""},this.handleCreateDirsChange=e=>{const t=e.currentTarget instanceof HTMLInputElement?e.currentTarget:void 0;this.createDirs=t?.checked??!0},this.handleOverwriteChange=e=>{const t=e.currentTarget instanceof HTMLInputElement?e.currentTarget:void 0;this.overwrite=t?.checked??!1},this.handleDialogKeyDown=e=>{e.key==="Escape"&&(e.preventDefault(),this.closeUploadDialog())}}willUpdate(e){if(!e.has("context"))return;const t=e.get("context");t!==void 0&&this.context!==void 0&&jw(t)!==jw(this.context)&&this.resetPendingUpload()}render(){const e=this.context;return e===void 0?T`<p class="muted">Files unavailable.</p>`:T`
5086
+ `;c7([P({attribute:!1})],bu.prototype,"onReload",2);bu=c7([Ae("app-refresh-control")],bu);function NJ(){return[{id:"actions.show",title:"Show Actions",description:"Open the command palette",shortcut:"mod+k",group:"General",run:e=>{e.openActionPalette()}},{id:"prompt.focus",title:"Focus Prompt",description:"Move keyboard focus to the message composer",shortcut:"mod+g c",group:"General",run:e=>{e.focusPrompt()}},{id:"machine.add",title:"Add Machine",description:"Register another PI WEB runtime reachable from this gateway",group:"Machine",run:e=>e.addMachine()},{id:"machine.refresh",title:"Refresh Selected Machine",description:"Check whether the selected PI WEB runtime is online",group:"Machine",run:e=>e.refreshSelectedMachine()},{id:"machine.open",title:"Open Selected Machine PI WEB",description:"Open the selected remote PI WEB directly in a new tab",group:"Machine",enabled:e=>e.state.selectedMachine?.kind==="remote"&&e.state.selectedMachine.baseUrl!==void 0,run:e=>e.openSelectedMachine()},{id:"machine.remove",title:"Remove Selected Machine",description:"Remove the selected remote machine from this gateway",group:"Machine",enabled:e=>e.state.selectedMachine?.kind==="remote",run:e=>e.removeSelectedMachine()},{id:"project.add",title:"Add Project",group:"Project",run:e=>e.addProject()},{id:"auth.login",title:"Configure Provider Authentication",description:"Run /login without tying authentication to a session",group:"General",run:e=>e.configureAuth()},{id:"auth.logout",title:"Remove Provider Authentication",description:"Run /logout for stored pi credentials",group:"General",run:e=>e.logoutAuth()},{id:"theme.select",title:"Select Theme",description:"Choose the PI WEB color theme",group:"Preferences",run:e=>{e.openThemePicker()}},{id:"settings.open",title:"Open Settings",description:"Manage PI WEB configuration and keyboard shortcuts",shortcut:"mod+,",group:"Preferences",run:e=>{e.ompWebUnstable?.openSettings?.()}},{id:"app.reload-page",title:"Full Page Reload",description:"Reload the PI WEB browser page",group:"General",run:e=>{e.reloadPage()}},{id:"view.chat",title:"Go to Chat",shortcut:"mod+1",group:"Navigation",run:e=>{e.focusPrompt()}},{id:"view.files",title:"Go to Files",shortcut:"mod+2",group:"Navigation",enabled:jl,run:e=>{e.selectMainView("core:workspace.files")}},{id:"view.git",title:"Go to Git",shortcut:"mod+3",group:"Navigation",enabled:Hw,run:e=>{e.selectMainView("core:workspace.git")}},{id:"view.terminal",title:"Go to Terminal",shortcut:"mod+4",group:"Navigation",enabled:jl,run:e=>{e.selectMainView("core:workspace.terminal")}},{id:"workspace.refresh-files",title:"Refresh Files",shortcut:"mod+shift+f",group:"Workspace",enabled:jl,run:e=>e.refreshFiles()},{id:"workspace.refresh-git",title:"Refresh Git",shortcut:"mod+shift+g",group:"Workspace",enabled:Hw,run:e=>e.refreshGit()},{id:"workspace.refresh-current",title:"Refresh Current Panel",shortcut:"mod+shift+r",group:"Workspace",enabled:jl,run:e=>e.state.workspaceTool==="core:workspace.git"&&e.state.selectedWorkspace?.isGitRepo===!0?e.refreshGit():e.refreshFiles()},{id:"workspace.delete",title:"Delete Workspace",description:"Remove the selected Git worktree",group:"Workspace",enabled:WJ,run:e=>e.deleteWorkspace()},{id:"session.start",title:"Start Session",shortcut:"mod+enter",group:"Session",enabled:jl,run:e=>e.startSession()},{id:"session.archive",title:"Archive Session",description:"Archive the selected session",group:"Session",enabled:qJ,run:e=>e.archiveSession()},{id:"session.reload",title:"Reload Session from Disk",description:"Close and re-open the selected session from its session file. Use /reload in the prompt for Pi runtime resources.",group:"Session",enabled:jJ,disabledReason:h7,run:e=>e.reloadSession()},{id:"session.delete",title:"Delete New Session",description:"Delete the selected transient new session",group:"Session",enabled:HJ,run:e=>e.deleteCachedNewSession()},{id:"session.stop",title:"Stop Active Work",shortcut:"mod+.",group:"Session",enabled:e=>e.state.selectedSession!==void 0&&na(e.state.status,e.state.activity),run:e=>e.stopActiveWork()}]}function jl(e){return e.state.selectedWorkspace!==void 0}function Hw(e){return e.state.selectedWorkspace?.isGitRepo===!0}function WJ(e){const t=e.state.selectedWorkspace;return t!==void 0&&t.isGitWorktree&&!t.isMain&&!Gk(e.state,t)}function qJ(e){return Ws(e.state.selectedSession,e.state.status)}function HJ(e){return wc(e.state.selectedSession,e.state.status)}function jJ(e){return!Ws(e.state.selectedSession,e.state.status)||h7(e)!==void 0?!1:!na(e.state.status,e.state.activity)}function h7(e){if(Ws(e.state.selectedSession,e.state.status)&&!na(e.state.status,e.state.activity))return UJ(e.state,Kr.sessionsReload,"reload sessions from disk")}function UJ(e,t,i){const r=e.machineRuntimes[wt(e)];if(!(r?.ok===!0&&vs(r,t)))return`Update and restart Omp-Web on ${e.selectedMachine?.name??"this machine"} to ${i}.`}const YJ=10*1024*1024,GJ="10 MB";var XJ=Object.defineProperty,VJ=Object.getOwnPropertyDescriptor,No=(e,t,i,r)=>{for(var s=r>1?void 0:r?VJ(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&XJ(t,i,s),s};function KJ(e){return e.split("/").pop()??e}let Ms=class extends we{constructor(){super(...arguments),this.destinationFolder="",this.overwrite=!1,this.createDirs=!0,this.formError="",this.dragActive=!1,this.dragDepth=0,this.openFilePicker=()=>{this.uploadInput?.click()},this.handleFileInputChange=e=>{const t=e.currentTarget instanceof HTMLInputElement?e.currentTarget:void 0,i=t?.files?Array.from(t.files):[];t!==void 0&&(t.value=""),i.length>0&&this.openUploadReview(i)},this.handleDragEnter=e=>{Uh(e)&&(e.preventDefault(),this.dragDepth+=1,this.dragActive=!0)},this.handleDragOver=e=>{Uh(e)&&(e.preventDefault(),e.dataTransfer!==null&&(e.dataTransfer.dropEffect="copy"),this.dragActive=!0)},this.handleDragLeave=e=>{Uh(e)&&(e.preventDefault(),this.dragDepth=Math.max(0,this.dragDepth-1),this.dragDepth===0&&(this.dragActive=!1))},this.handleDrop=e=>{if(!Uh(e))return;e.preventDefault(),this.dragDepth=0,this.dragActive=!1;const t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[],i=this.context;t.length>0&&i!==void 0&&ttt(i,t)},this.handleDestinationInput=e=>{const t=e.currentTarget instanceof HTMLInputElement?e.currentTarget:void 0;this.destinationFolder=t?.value??"",this.formError=""},this.handleCreateDirsChange=e=>{const t=e.currentTarget instanceof HTMLInputElement?e.currentTarget:void 0;this.createDirs=t?.checked??!0},this.handleOverwriteChange=e=>{const t=e.currentTarget instanceof HTMLInputElement?e.currentTarget:void 0;this.overwrite=t?.checked??!1},this.handleDialogKeyDown=e=>{e.key==="Escape"&&(e.preventDefault(),this.closeUploadDialog())}}willUpdate(e){if(!e.has("context"))return;const t=e.get("context");t!==void 0&&this.context!==void 0&&jw(t)!==jw(this.context)&&this.resetPendingUpload()}render(){const e=this.context;return e===void 0?T`<p class="muted">Files unavailable.</p>`:T`
5079
5087
  <section
5080
5088
  class=${this.dragActive?"files-panel dragging":"files-panel"}
5081
5089
  @dragenter=${this.handleDragEnter}
@@ -5132,7 +5140,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5132
5140
  `}selectTreeEntry(e,t){t.type==="directory"?e.onExpandDir(t.path):e.onSelectFile(t.path)}renderFileViewer(e){const t=e.selectedFileContent;if(e.selectedFilePath===void 0||e.selectedFilePath==="")return T`<p class="muted">Select a file.</p>`;if(e.state.error!==""&&t===void 0)return T`
5133
5141
  <div class="viewer-header"><strong>${e.selectedFilePath}</strong><small>Error</small></div>
5134
5142
  <p class="muted dialog-error" style="margin: 16px;">${e.state.error}</p>
5135
- `;if(t===void 0)return T`<p class="muted">Loading ${e.selectedFilePath}…</p>`;const i=Db(e.workspace.projectId,e.workspace.id,t.path,{machineId:e.machine.id}),r=VJ(t.path);return t.mediaType==="image"?this.renderImageViewer(e,t,i,r):t.mediaType==="video"?this.renderVideoViewer(e,t,i,r):t.binary?T`
5143
+ `;if(t===void 0)return T`<p class="muted">Loading ${e.selectedFilePath}…</p>`;const i=Db(e.workspace.projectId,e.workspace.id,t.path,{machineId:e.machine.id}),r=KJ(t.path);return t.mediaType==="image"?this.renderImageViewer(e,t,i,r):t.mediaType==="video"?this.renderVideoViewer(e,t,i,r):t.binary?T`
5136
5144
  <div class="viewer-header">
5137
5145
  <strong>${t.path}</strong>
5138
5146
  <div class="viewer-actions">
@@ -5144,7 +5152,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5144
5152
  <p class="muted">Binary file: ${t.path} · ${Jo(t.size)}</p>
5145
5153
  <a class="download-button primary" href=${i} download=${r} target="_blank" rel="noopener">Download ${r}</a>
5146
5154
  </div>
5147
- `:(att(),T`
5155
+ `:(ntt(),T`
5148
5156
  <div class="viewer-header">
5149
5157
  <strong>${t.path}</strong>
5150
5158
  <div class="viewer-actions">
@@ -5167,7 +5175,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5167
5175
  Your browser does not support the video tag.
5168
5176
  </video>
5169
5177
  </div>
5170
- `}renderImageViewer(e,t,i,r){const s=`${t.mimeType??"image"} · ${Jo(t.size)}`;if(t.size>UJ)return T`
5178
+ `}renderImageViewer(e,t,i,r){const s=`${t.mimeType??"image"} · ${Jo(t.size)}`;if(t.size>YJ)return T`
5171
5179
  <div class="viewer-header">
5172
5180
  <strong>${t.path}</strong>
5173
5181
  <div class="viewer-actions">
@@ -5176,7 +5184,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5176
5184
  </div>
5177
5185
  </div>
5178
5186
  <div class="binary-file-view">
5179
- <p class="muted">Image too large to preview: ${Jo(t.size)} · limit ${YJ}</p>
5187
+ <p class="muted">Image too large to preview: ${Jo(t.size)} · limit ${GJ}</p>
5180
5188
  <a class="download-button primary" href=${i} download=${r} target="_blank" rel="noopener">Download ${r}</a>
5181
5189
  </div>
5182
5190
  `;const o=zb(e.workspace.projectId,e.workspace.id,t.path,{modifiedAt:t.modifiedAt,machineId:e.machine.id});return T`
@@ -5190,11 +5198,11 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5190
5198
  <div class="image-preview">
5191
5199
  <img src=${o} alt=${t.path} decoding="async" />
5192
5200
  </div>
5193
- `}renderUploadProgress(e){const t=KJ(e.state.workspaceUploadBatches,{projectId:e.workspace.projectId,workspaceId:e.workspace.id,machineId:e.machine.id});return t.length===0?null:T`
5201
+ `}renderUploadProgress(e){const t=ZJ(e.state.workspaceUploadBatches,{projectId:e.workspace.projectId,workspaceId:e.workspace.id,machineId:e.machine.id});return t.length===0?null:T`
5194
5202
  <section class="upload-progress" aria-label="Workspace uploads">
5195
5203
  <div class="upload-progress-header">
5196
5204
  <strong>Uploads</strong>
5197
- <small>${ttt(t)}</small>
5205
+ <small>${ett(t)}</small>
5198
5206
  </div>
5199
5207
  ${t.map(i=>this.renderUploadBatch(e,i))}
5200
5208
  </section>
@@ -5202,12 +5210,12 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5202
5210
  <article class=${`upload-batch ${t.status}`}>
5203
5211
  <div class="upload-batch-heading">
5204
5212
  <div>
5205
- <strong>${ett(t)}</strong>
5213
+ <strong>${itt(t)}</strong>
5206
5214
  <small>${t.destinationFolder===""?"workspace root":t.destinationFolder}</small>
5207
5215
  </div>
5208
- <span>${itt(t)}</span>
5216
+ <span>${rtt(t)}</span>
5209
5217
  </div>
5210
- <progress max="1" .value=${rtt(t)}></progress>
5218
+ <progress max="1" .value=${stt(t)}></progress>
5211
5219
  <div class="upload-file-list">
5212
5220
  ${t.files.map(i=>this.renderUploadFile(i))}
5213
5221
  </div>
@@ -5215,13 +5223,13 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5215
5223
  ${t.status==="uploading"?T`<button @click=${()=>{e.onCancelWorkspaceUpload(t.id)}}>Cancel</button>`:T`<button @click=${()=>{e.onClearWorkspaceUpload(t.id)}}>Dismiss</button>`}
5216
5224
  </div>
5217
5225
  </article>
5218
- `}renderUploadFile(e){const t=ott(e);return T`
5226
+ `}renderUploadFile(e){const t=att(e);return T`
5219
5227
  <div class=${`upload-file ${e.status}`}>
5220
5228
  <div class="upload-file-main">
5221
5229
  <span>${e.name}</span>
5222
5230
  <small>${t}</small>
5223
5231
  </div>
5224
- <span class="upload-file-status">${stt(e)}</span>
5232
+ <span class="upload-file-status">${ott(e)}</span>
5225
5233
  </div>
5226
5234
  `}renderUploadDialog(e,t){const i=t.files.length;return T`
5227
5235
  <div class="dialog-backdrop" @mousedown=${()=>{this.closeUploadDialog()}}>
@@ -5266,7 +5274,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5266
5274
  </form>
5267
5275
  </section>
5268
5276
  </div>
5269
- `}openUploadReview(e){const t=this.context,i=QJ(t?.workspaceUploadDefaultFolder??"");this.pendingUpload={files:e},this.destinationFolder=i.destinationFolder,this.overwrite=i.overwrite,this.createDirs=i.createDirs,this.formError=""}submitUploadReview(e,t,i){e.preventDefault();const r=ZJ(i.files,this.destinationFolder);if(r!==void 0){this.formError=r;return}t.onStartWorkspaceUpload(i.files,{destinationFolder:this.destinationFolder,createDirs:this.createDirs,overwrite:this.overwrite,selectUploadedFile:!0})!==void 0&&this.closeUploadDialog()}closeUploadDialog(){this.pendingUpload=void 0,this.formError=""}resetPendingUpload(){this.closeUploadDialog(),this.dragDepth=0,this.dragActive=!1}};Ms.styles=[nm,_e`
5277
+ `}openUploadReview(e){const t=this.context,i=JJ(t?.workspaceUploadDefaultFolder??"");this.pendingUpload={files:e},this.destinationFolder=i.destinationFolder,this.overwrite=i.overwrite,this.createDirs=i.createDirs,this.formError=""}submitUploadReview(e,t,i){e.preventDefault();const r=QJ(i.files,this.destinationFolder);if(r!==void 0){this.formError=r;return}t.onStartWorkspaceUpload(i.files,{destinationFolder:this.destinationFolder,createDirs:this.createDirs,overwrite:this.overwrite,selectUploadedFile:!0})!==void 0&&this.closeUploadDialog()}closeUploadDialog(){this.pendingUpload=void 0,this.formError=""}resetPendingUpload(){this.closeUploadDialog(),this.dragDepth=0,this.dragActive=!1}};Ms.styles=[nm,_e`
5270
5278
  :host { flex: 1 1 auto; }
5271
5279
  .files-panel { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
5272
5280
  .toolbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@@ -5385,7 +5393,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5385
5393
  gap: 12px;
5386
5394
  }
5387
5395
  .binary-file-view p { margin: 0; }
5388
- `];No([P({attribute:!1})],Ms.prototype,"context",2);No([ui("#workspace-upload-input")],Ms.prototype,"uploadInput",2);No([Ct()],Ms.prototype,"pendingUpload",2);No([Ct()],Ms.prototype,"destinationFolder",2);No([Ct()],Ms.prototype,"overwrite",2);No([Ct()],Ms.prototype,"createDirs",2);No([Ct()],Ms.prototype,"formError",2);No([Ct()],Ms.prototype,"dragActive",2);Ms=No([Ae("workspace-files-panel")],Ms);function KJ(e,t){return Object.values(e).filter(i=>i.projectId===t.projectId&&i.workspaceId===t.workspaceId&&i.machineId===t.machineId).sort((i,r)=>r.startedAt.localeCompare(i.startedAt))}function ZJ(e,t){if(e.length===0)return"Choose at least one file to upload.";for(const i of e)try{Yg(t,i.name)}catch(r){return r instanceof Error?r.message:String(r)}}function QJ(e){return{destinationFolder:e,createDirs:!0,overwrite:!1}}function JJ(e,t){if(t.length!==0)return e.onStartWorkspaceUpload(t,{destinationFolder:e.workspaceUploadDefaultFolder,createDirs:!0,overwrite:!1,selectUploadedFile:!0})}function jw(e){return`${e.machine.id}:${e.workspace.projectId}:${e.workspace.id}`}function Uh(e){return Array.from(e.dataTransfer?.types??[]).includes("Files")}function ttt(e){const t=e.filter(i=>i.status==="uploading").length;return t===0?`${String(e.length)} recent`:`${String(t)} uploading`}function ett(e){const t=e.files.length,i=t===1?"file":"files";switch(e.status){case"completed":return`Uploaded ${String(t)} ${i}`;case"error":return`Upload failed for ${String(t)} ${i}`;case"cancelled":return`Upload cancelled for ${String(t)} ${i}`;case"uploading":return`Uploading ${String(t)} ${i}`}}function itt(e){switch(e.status){case"completed":return"Done";case"error":return"Failed";case"cancelled":return"Cancelled";case"uploading":return d7(e.percent)}}function rtt(e){return e.status==="uploading"?e.percent:1}function stt(e){switch(e.status){case"pending":return"Pending";case"uploading":return d7(e.percent);case"completed":return"Done";case"error":return"Error";case"cancelled":return"Cancelled"}}function ott(e){return e.error!==void 0?e.error:e.response!==void 0?`Wrote ${e.response.path}`:`${e.path} · ${Jo(e.loaded)} / ${Jo(e.total)}`}function d7(e){return`${String(Math.round(Math.max(0,Math.min(1,e))*100))}%`}function att(){xe(()=>import("./CodeViewer-DHlYSlFA.js"),__vite__mapDeps([60,4,5]))}function Jo(e){if(!Number.isFinite(e)||e<0)return"0 B";if(e<1024)return`${String(e)} B`;const t=e/1024;if(t<1024)return`${of(t)} KB`;const i=t/1024;return i<1024?`${of(i)} MB`:`${of(i/1024)} GB`}function of(e){return e>=10?String(Math.round(e)):e.toFixed(1)}var ntt=Object.defineProperty,ltt=Object.getOwnPropertyDescriptor,u7=(e,t,i,r)=>{for(var s=r>1?void 0:r?ltt(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&ntt(t,i,s),s};let yu=class extends we{get executions(){if(!this.context)return[];const e=this.context.state.messages;if(e.length===0)return[];const t=[];for(const i of e)for(const r of i.parts)r.type==="toolExecution"&&(r.toolName==="task"||r.toolName==="todo")&&t.push(r);return t}render(){const e=this.executions;return e.length===0?T`
5396
+ `];No([P({attribute:!1})],Ms.prototype,"context",2);No([ui("#workspace-upload-input")],Ms.prototype,"uploadInput",2);No([Ct()],Ms.prototype,"pendingUpload",2);No([Ct()],Ms.prototype,"destinationFolder",2);No([Ct()],Ms.prototype,"overwrite",2);No([Ct()],Ms.prototype,"createDirs",2);No([Ct()],Ms.prototype,"formError",2);No([Ct()],Ms.prototype,"dragActive",2);Ms=No([Ae("workspace-files-panel")],Ms);function ZJ(e,t){return Object.values(e).filter(i=>i.projectId===t.projectId&&i.workspaceId===t.workspaceId&&i.machineId===t.machineId).sort((i,r)=>r.startedAt.localeCompare(i.startedAt))}function QJ(e,t){if(e.length===0)return"Choose at least one file to upload.";for(const i of e)try{Yg(t,i.name)}catch(r){return r instanceof Error?r.message:String(r)}}function JJ(e){return{destinationFolder:e,createDirs:!0,overwrite:!1}}function ttt(e,t){if(t.length!==0)return e.onStartWorkspaceUpload(t,{destinationFolder:e.workspaceUploadDefaultFolder,createDirs:!0,overwrite:!1,selectUploadedFile:!0})}function jw(e){return`${e.machine.id}:${e.workspace.projectId}:${e.workspace.id}`}function Uh(e){return Array.from(e.dataTransfer?.types??[]).includes("Files")}function ett(e){const t=e.filter(i=>i.status==="uploading").length;return t===0?`${String(e.length)} recent`:`${String(t)} uploading`}function itt(e){const t=e.files.length,i=t===1?"file":"files";switch(e.status){case"completed":return`Uploaded ${String(t)} ${i}`;case"error":return`Upload failed for ${String(t)} ${i}`;case"cancelled":return`Upload cancelled for ${String(t)} ${i}`;case"uploading":return`Uploading ${String(t)} ${i}`}}function rtt(e){switch(e.status){case"completed":return"Done";case"error":return"Failed";case"cancelled":return"Cancelled";case"uploading":return d7(e.percent)}}function stt(e){return e.status==="uploading"?e.percent:1}function ott(e){switch(e.status){case"pending":return"Pending";case"uploading":return d7(e.percent);case"completed":return"Done";case"error":return"Error";case"cancelled":return"Cancelled"}}function att(e){return e.error!==void 0?e.error:e.response!==void 0?`Wrote ${e.response.path}`:`${e.path} · ${Jo(e.loaded)} / ${Jo(e.total)}`}function d7(e){return`${String(Math.round(Math.max(0,Math.min(1,e))*100))}%`}function ntt(){xe(()=>import("./CodeViewer-CCLKHm96.js"),__vite__mapDeps([60,4,5]))}function Jo(e){if(!Number.isFinite(e)||e<0)return"0 B";if(e<1024)return`${String(e)} B`;const t=e/1024;if(t<1024)return`${of(t)} KB`;const i=t/1024;return i<1024?`${of(i)} MB`:`${of(i/1024)} GB`}function of(e){return e>=10?String(Math.round(e)):e.toFixed(1)}var ltt=Object.defineProperty,ctt=Object.getOwnPropertyDescriptor,u7=(e,t,i,r)=>{for(var s=r>1?void 0:r?ctt(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&ltt(t,i,s),s};let yu=class extends we{get executions(){if(!this.context)return[];const e=this.context.state.messages;if(e.length===0)return[];const t=[];for(const i of e)for(const r of i.parts)r.type==="toolExecution"&&(r.toolName==="task"||r.toolName==="todo")&&t.push(r);return t}render(){const e=this.executions;return e.length===0?T`
5389
5397
  <section class="panel-content">
5390
5398
  <div class="empty-state" role="status">
5391
5399
  <h2>No tasks</h2>
@@ -5398,10 +5406,10 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5398
5406
  ${e.map(t=>t.toolName==="task"?this.renderTask(t):this.renderTodo(t))}
5399
5407
  </div>
5400
5408
  </section>
5401
- `}renderTask(e){const t=htt(e.args),i=t?.length??0;return T`
5409
+ `}renderTask(e){const t=dtt(e.args),i=t?.length??0;return T`
5402
5410
  <details class="task-card ${e.status}">
5403
5411
  <summary class="task-header">
5404
- <span class="status-icon" aria-hidden="true">${ctt(e.status)}</span>
5412
+ <span class="status-icon" aria-hidden="true">${htt(e.status)}</span>
5405
5413
  <span class="tool-badge task-badge">subagent</span>
5406
5414
  <span class="task-summary">${e.summary||"Task"}</span>
5407
5415
  <span class="task-meta">
@@ -5482,7 +5490,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5482
5490
  .subagent - label { font - weight: 600; font - size: 12px; overflow: hidden; text - overflow: ellipsis; white - space: nowrap; }
5483
5491
  .subagent - assignment { color: var(--pi - muted); font - size: 11px; margin - top: 2px; display: -webkit - box; -webkit - line - clamp: 3; -webkit - box - orient: vertical; overflow: hidden; }
5484
5492
  .task - result { margin: 0; padding: 8px; background: var(--pi - bg); border: 1px solid var(--pi - border - muted); border - radius: 5px; font: 12px ui - monospace, SFMono - Regular, Menlo, Consolas, monospace; line - height: 1.4; white - space: pre - wrap; overflow - wrap: anywhere; max - height: 200px; overflow: auto; }
5485
- `];u7([P({attribute:!1})],yu.prototype,"context",2);yu=u7([Ae("workspace-tasks-panel")],yu);function ctt(e){return e==="success"?"✓":e==="error"?"✖":e==="running"?"●":"○"}function Uw(e){return e==="success"?"done":e==="error"?"failed":e==="running"?"running":"pending"}function htt(e){if(typeof e!="object"||e===null)return;const i=e.tasks;if(Array.isArray(i))return i.map(r=>{if(typeof r!="object"||r===null)return{};const s=r;return{...typeof s.id=="string"?{id:s.id}:{},...typeof s.description=="string"?{description:s.description}:{},...typeof s.assignment=="string"?{assignment:s.assignment}:{}}})}function dtt(){return[{id:"workspace.files",title:"Files",icon:nc("files"),order:10,render:utt},{id:"workspace.git",title:"Git",icon:nc("git"),order:20,visible:({workspace:e})=>e.isGitRepo,render:ftt},{id:"workspace.terminal",title:"Terminal",icon:nc("terminal"),order:30,badge:e=>e.activeTerminalCount>0?e.activeTerminalCount:void 0,render:ptt},{id:"workspace.tasks",title:"Tasks",icon:nc("tasks"),order:35,render:xtt}]}function utt(e){return T`<workspace-files-panel .context=${e}></workspace-files-panel>`}function ptt(e){return ytt(),T`<terminal-panel .workspace=${e.workspace} .machineId=${e.machine.id} .selectedTerminalId=${e.selectedTerminalId} .autoStart=${e.terminalAutoStart} .onSelectTerminal=${e.onSelectTerminal}></terminal-panel>`}function ftt(e){const t=e.gitStatus;return T`
5493
+ `];u7([P({attribute:!1})],yu.prototype,"context",2);yu=u7([Ae("workspace-tasks-panel")],yu);function htt(e){return e==="success"?"✓":e==="error"?"✖":e==="running"?"●":"○"}function Uw(e){return e==="success"?"done":e==="error"?"failed":e==="running"?"running":"pending"}function dtt(e){if(typeof e!="object"||e===null)return;const i=e.tasks;if(Array.isArray(i))return i.map(r=>{if(typeof r!="object"||r===null)return{};const s=r;return{...typeof s.id=="string"?{id:s.id}:{},...typeof s.description=="string"?{description:s.description}:{},...typeof s.assignment=="string"?{assignment:s.assignment}:{}}})}function utt(){return[{id:"workspace.files",title:"Files",icon:nc("files"),order:10,render:ptt},{id:"workspace.git",title:"Git",icon:nc("git"),order:20,visible:({workspace:e})=>e.isGitRepo,render:gtt},{id:"workspace.terminal",title:"Terminal",icon:nc("terminal"),order:30,badge:e=>e.activeTerminalCount>0?e.activeTerminalCount:void 0,render:ftt},{id:"workspace.tasks",title:"Tasks",icon:nc("tasks"),order:35,render:vtt}]}function ptt(e){return T`<workspace-files-panel .context=${e}></workspace-files-panel>`}function ftt(e){return xtt(),T`<terminal-panel .workspace=${e.workspace} .machineId=${e.machine.id} .selectedTerminalId=${e.selectedTerminalId} .autoStart=${e.terminalAutoStart} .onSelectTerminal=${e.onSelectTerminal}></terminal-panel>`}function gtt(e){const t=e.gitStatus;return T`
5486
5494
  <section class="toolbar">
5487
5495
  <strong>Git</strong>
5488
5496
  ${e.gitStale?T`<span class="stale">stale</span>`:null}
@@ -5491,29 +5499,29 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5491
5499
  <section class="split">
5492
5500
  <div class="list">
5493
5501
  ${t===void 0?T`<p class="muted">No status loaded.</p>`:t.isGitRepo?T`
5494
- <p class="summary">${vtt(t)}</p>
5502
+ <p class="summary">${wtt(t)}</p>
5495
5503
  ${t.files.length===0?T`<p class="muted">No changes.</p>`:t.files.map(i=>T`
5496
5504
  <button class="row ${e.selectedDiffPath===i.path?"selected":""}" @click=${()=>{e.onSelectDiff(i.path)}}>
5497
- <span>${wtt(i.index,i.workingTree)}</span>
5505
+ <span>${ktt(i.index,i.workingTree)}</span>
5498
5506
  <span>${i.path}</span>
5499
5507
  </button>
5500
5508
  `)}
5501
5509
  `:T`<p class="muted">Not a git repository.</p>`}
5502
5510
  </div>
5503
5511
  <div class="viewer">
5504
- ${gtt(e)}
5512
+ ${mtt(e)}
5505
5513
  </div>
5506
5514
  </section>
5507
- `}function gtt(e){if(e.selectedDiffPath===void 0||e.selectedDiffPath==="")return T`<p class="muted">Select a changed file.</p>`;const t=e.selectedDiff,i=e.selectedStagedDiff;if(t===void 0||i===void 0)return T`<p class="muted">Loading diff…</p>`;const r=[i,t].filter(s=>s.diff!=="");return r.length===0?T`<p class="muted">No staged or unstaged diff.</p>`:T`
5515
+ `}function mtt(e){if(e.selectedDiffPath===void 0||e.selectedDiffPath==="")return T`<p class="muted">Select a changed file.</p>`;const t=e.selectedDiff,i=e.selectedStagedDiff;if(t===void 0||i===void 0)return T`<p class="muted">Loading diff…</p>`;const r=[i,t].filter(s=>s.diff!=="");return r.length===0?T`<p class="muted">No staged or unstaged diff.</p>`:T`
5508
5516
  <div class=${r.length===1?"diffs single":"diffs"}>
5509
- ${r.map(s=>mtt(s))}
5517
+ ${r.map(s=>btt(s))}
5510
5518
  </div>
5511
- `}function mtt(e){return btt(),T`
5519
+ `}function btt(e){return ytt(),T`
5512
5520
  <section class="diff-section">
5513
5521
  <div class="viewer-header"><strong>${e.path??"diff"}</strong><small>${e.staged?"staged":"unstaged"}${e.truncated?" · truncated":""}</small></div>
5514
5522
  <unified-diff-viewer .diff=${e.diff}></unified-diff-viewer>
5515
5523
  </section>
5516
- `}function btt(){xe(()=>import("./UnifiedDiffViewer-Bsxe8vEO.js"),__vite__mapDeps([61,4,5]))}function ytt(){xe(()=>import("./TerminalPanel-B7ErBads.js"),__vite__mapDeps([62,63,64,4,5]))}function xtt(e){return T`<workspace-tasks-panel .context=${e}></workspace-tasks-panel>`}function vtt(e){const t=e.branch??"detached",i=e.ahead??0,r=e.behind??0;return i===0&&r===0?t:`${t} · ↑${String(i)} ↓${String(r)}`}function wtt(e,t){return(t!=="unmodified"?t:e).slice(0,1).toUpperCase()}const ktt={apiVersion:1,name:"PI WEB Core",activate:()=>({contributions:{actions:OJ(),workspacePanels:dtt()}})},Stt={"--pi-bg":"#0d1117","--pi-surface":"#161b22","--pi-surface-hover":"#21262d","--pi-terminal-bg":"#05070a","--pi-terminal-text":"#e6edf3","--pi-border":"#30363d","--pi-border-muted":"#21262d","--pi-text":"#e6edf3","--pi-text-secondary":"#c9d1d9","--pi-text-bright":"#f0f6fc","--pi-muted":"#8b949e","--pi-dim":"#6e7681","--pi-accent":"#58a6ff","--pi-accent-border":"#2f81f7","--pi-selection-bg":"#0d2847","--pi-success":"#3fb950","--pi-success-border":"#238636","--pi-success-bg":"#0f1b12","--pi-success-surface":"#0f2a16","--pi-success-ring":"#3fb95055","--pi-warning":"#d29922","--pi-warning-border":"#6e5200","--pi-warning-surface":"#1f1a10","--pi-danger":"#ff7b72","--pi-purple":"#d2a8ff","--pi-purple-border":"#a371f7","--pi-purple-surface":"#21132f","--pi-overlay":"#0008","--pi-shadow-soft":"#0006","--pi-shadow":"#0008","--pi-shadow-strong":"#000b","--pi-bg-overlay-soft":"#0d1117dd","--pi-bg-overlay":"#0d1117e6","--pi-success-bg-overlay":"#0f1b12ee","--pi-terminal-selection":"#264f78"},Ctt={"--pi-bg":"#070912","--pi-surface":"#101527","--pi-surface-hover":"#151b31","--pi-terminal-bg":"#050710","--pi-terminal-text":"#f7f4ff","--pi-border":"#26304f","--pi-border-muted":"#26304f","--pi-text":"#f7f4ff","--pi-text-secondary":"#aaa4bd","--pi-text-bright":"#ffffff","--pi-muted":"#aaa4bd","--pi-dim":"#817a99","--pi-accent":"#7c3cff","--pi-accent-border":"#5a47b0","--pi-selection-bg":"#1d2547","--pi-success":"#00f0d8","--pi-success-border":"#00f0d8","--pi-success-bg":"#071e22","--pi-success-surface":"#092d31","--pi-success-ring":"#00f0d855","--pi-warning":"#ffb000","--pi-warning-border":"#ffb000","--pi-warning-surface":"#16140d","--pi-danger":"#ff4f7b","--pi-purple":"#b7a2ff","--pi-purple-border":"#7c3cff","--pi-purple-surface":"#181026","--pi-overlay":"#0008","--pi-shadow-soft":"#0006","--pi-shadow":"#0008","--pi-shadow-strong":"#000b","--pi-bg-overlay-soft":"#070912dd","--pi-bg-overlay":"#070912e6","--pi-success-bg-overlay":"#071e22ee","--pi-terminal-selection":"#3d4a78"},Ttt={"--pi-bg":"#f7f1e6","--pi-surface":"#fff9ee","--pi-surface-hover":"#f0e6d6","--pi-terminal-bg":"#15131b","--pi-terminal-text":"#fff9ee","--pi-border":"#c9bca8","--pi-border-muted":"#d8cdbc","--pi-text":"#15131b","--pi-text-secondary":"#15131b","--pi-text-bright":"#15131b","--pi-muted":"#5f586a","--pi-dim":"#766f7e","--pi-accent":"#6430d8","--pi-accent-border":"#6430d8","--pi-selection-bg":"#eadff8","--pi-success":"#008c82","--pi-success-border":"#008c82","--pi-success-bg":"#e1f4ef","--pi-success-surface":"#d7f0ec","--pi-success-ring":"#008c8255","--pi-warning":"#b05f00","--pi-warning-border":"#b05f00","--pi-warning-surface":"#fff2d2","--pi-danger":"#b51d49","--pi-purple":"#6430d8","--pi-purple-border":"#6430d8","--pi-purple-surface":"#eadff8","--pi-overlay":"#15131b66","--pi-shadow-soft":"#15131b22","--pi-shadow":"#15131b33","--pi-shadow-strong":"#15131b44","--pi-bg-overlay-soft":"#f7f1e6dd","--pi-bg-overlay":"#f7f1e6e6","--pi-success-bg-overlay":"#e1f4efee","--pi-terminal-selection":"#8d7b64"},$tt={apiVersion:1,name:"PI WEB Themes",activate:()=>({contributions:{themes:[{id:"omp-web-dark",name:"PI WEB Dark",description:"Dark PI WEB palette.",order:10,colorScheme:"dark",tokens:Ctt},{id:"omp-web-light",name:"PI WEB Light",description:"Light PI WEB palette.",order:20,colorScheme:"light",tokens:Ttt},{id:"classic",name:"PI WEB Classic",description:"The original PI WEB dark palette.",order:30,colorScheme:"dark",tokens:Stt}],themePairs:[{id:"omp-web",name:"PI WEB",description:"Follow the system light/dark preference with PI WEB themes.",order:10,light:"omp-web-light",dark:"omp-web-dark"}]}})},Yw=[1e3,3e3,8e3,15e3,3e4];function Mtt(){const e=new eA;return e.register({id:"core",plugin:ktt}),e.register({id:"themes",plugin:$tt}),e}function Gw(e){const t=e.selectedMachine;return t!==void 0?{id:t.id,name:t.name,kind:t.kind}:{id:"local",name:"local",kind:"local"}}function Att(e,t){return e.machines!==t.machines||e.machineStatuses!==t.machineStatuses||(e.selectedMachine?.id??"local")!==(t.selectedMachine?.id??"local")}function Btt(e,t){return p7(e,t)}function p7(e,t){if(e.kind==="local")return!0;const i=t?.status??e.status;return i===void 0||i==="unknown"||i==="online"}function _tt(e,t){return Object.entries(t).some(([i,r])=>Reflect.get(e,i)!==r)}function Xw(e){return na(e.status,e.activity)}function Ltt(e){return e.type==="terminal.created"||e.type==="terminal.exited"||e.type==="terminal.closed"}function Vw(){return{}}function Kw(e,t){return JSON.stringify([e,t])}function Ptt(e){const t=Math.min(e,Yw.length-1);return Yw[t]??3e4}function Ett(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>i!==t))}function af(){return new Promise(e=>requestAnimationFrame(()=>{e()}))}function Rtt(e){switch(e){case"off":return"No reasoning";case"minimal":return"Very brief reasoning (~1k tokens)";case"low":return"Light reasoning (~2k tokens)";case"medium":return"Moderate reasoning (~8k tokens)";case"high":return"Deep reasoning (~16k tokens)";case"xhigh":return"Maximum reasoning (~32k tokens)";default:return}}var Itt=Object.defineProperty,ztt=Object.getOwnPropertyDescriptor,Pr=(e,t,i,r)=>{for(var s=r>1?void 0:r?ztt(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&Itt(t,i,s),s};const Dtt=900*1e3,Ftt=750,Ott=[1e3,3e3,8e3,15e3,3e4],Zw={capture:!0},nf="auto:on",Qw="auto:off",Yh="theme:",lf=zc("core:workspace.files"),cf=zc("core:workspace.git"),Gh=zc("core:workspace.terminal"),Ntt=320,Wtt=2,qtt="(min-width: 1181px)";let sr=class extends we{constructor(){super(...arguments),this.state=KT(),this.chatPreferences=$r(),this.handleChatPreferencesChanged=e=>{if(e instanceof CustomEvent&&$u(e.detail)?this.chatPreferences=e.detail:this.chatPreferences=$r(),this.chatPreferences.hideWorkspaces&&this.state.workspaces.length>0&&this.state.selectedWorkspace?.id!==this.state.workspaces[0]?.id){const t=this.state.workspaces[0];t!==void 0&&this.workspaces.selectWorkspace(t)}this.requestUpdate()},this.sessions=new U9(()=>this.state,e=>{this.setState(e)},()=>{this.updateUrl()},new O9),this.activity=new QT(()=>this.state,e=>{this.setState(e)}),this.auth=new e$(()=>this.state,e=>{this.setState(e)},e=>{this.sessions.applySessionStatus(e)}),this.workspaces=new sM(()=>this.state,e=>{this.setState(e)},()=>{this.updateUrl()},this.sessions,new J9),this.projects=new f$(()=>this.state,e=>{this.setState(e)},this.workspaces),this.machines=new p$(()=>this.state,e=>{this.setState(e)},()=>{this.updateUrl()},this.projects),this.files=new c$(()=>this.state,e=>{this.setState(e)},()=>{this.updateUrl()}),this.git=new u$(()=>this.state,e=>{this.setState(e)},()=>{this.updateUrl()}),this.keyboard=new bM,this.realtime=new iy,this.machineActivitySockets=new Map,this.activeTerminalIds=new Set,this.machineNavigation=new lM,this.terminalSelection=new gM,this.appShell=new mA(this),this.panelCollapse=new MA(this),this.panelResize=new BA(this),this.navigationSections=new CA(this,()=>this.state,()=>this.appShell.isMobileNavigationLayout),this.systemLightThemeMedia=typeof window<"u"&&"matchMedia"in window?window.matchMedia("(prefers-color-scheme: light)"):void 0,this.refreshingWorkspaceDeletionRuns=!1,this.handledWorkspaceDeletionRunIds=new Set,this.terminalCommandRunRuntimes=new Map,this.machineNavigationRestoreSeq=0,this.navigationSelectionSeq=0,this.routeRestoreSeq=0,this.routeRestoreDepth=0,this.remoteRouteRestoreAttempt=0,this.remoteRouteRestoreInProgress=!1,this.plugins=Mtt(),this.loadedMachinePluginIds=new Set,this.machinePluginLoadPromises=new Map,this.themePreference=zM()??EM,this.activeThemeId=rm,this.isRefreshingApp=!1,this.settingsSection=My(),this.shortcutConfig={},this.workspaceUploadDefaultFolder=Nb(void 0),this.onPopState=()=>{this.withChatScrollTransition(async()=>{this.restoreSettingsRoute(),await this.restoreRoute(!1)})},this.onPageShow=()=>{this.appShell.repairViewportPosition(),this.retryPendingRemoteRouteRestoreSoon()},this.onFocus=()=>{this.appShell.repairViewportPosition(),this.sessions.refreshSelectedSession(),this.scheduleOmpWebStatusRefresh(),this.refreshMachineActivities(),this.refreshWorkspaceDeletionRuns(),this.retryPendingRemoteRouteRestoreSoon()},this.onVisibilityChange=()=>{document.visibilityState==="visible"&&(this.appShell.repairViewportPosition(),this.sessions.refreshSelectedSession(),this.scheduleOmpWebStatusRefresh(),this.refreshMachineActivities(),this.refreshWorkspaceDeletionRuns(),this.retryPendingRemoteRouteRestoreSoon())},this.onSystemLightThemeChange=()=>{this.themePreference.auto&&this.applyPreferredTheme(!1)},this.onKeyDown=e=>{this.settingsSection===void 0&&this.keyboard.handle(e,this.getDefaultActions(),{shortcuts:this.shortcutConfig})&&(e.preventDefault(),e.stopPropagation())},this.onWindowMouseMove=e=>{const t=e.clientX,i=e.clientY,r=t<=40,s=t<=80&&i<=80,o=t<=80&&i>=window.innerHeight-80;if(!(!r&&!s&&!o)){if(this.appShell.isMobileNavigationLayout){this.state.mainView!=="navigation"&&this.selectMainView("navigation");return}(this.panelCollapse.navigationPanelCollapsed||this.panelResize.panelWidth("navigation")<50)&&(this.panelCollapse.expandNavigationPanel(),this.panelResize.panelWidth("navigation")<180&&this.panelResize.resizePanel("navigation",340),this.requestUpdate())}},this.handleSendPrompt=(e,t,i,r)=>{this.sendPrompt(e,t,i,r)},this.handleStopActiveWork=()=>{this.sessions.stopActiveWork()},this.handleSelectModel=()=>{this.openModelDialog()},this.handleSelectThinking=()=>{this.openThinkingDialog()},this.handlePromptEscape=()=>{this.chatView?.focusConversation()}}get routeRestoreInProgress(){return this.routeRestoreDepth>0}willUpdate(){this.toggleAttribute("pwa-display-mode",this.appShell.isPwaDisplayMode)}connectedCallback(){super.connectedCallback(),this.chatPreferences=$r(),Us()?.addEventListener(js,this.handleChatPreferencesChanged),window.addEventListener("popstate",this.onPopState),window.addEventListener("pageshow",this.onPageShow),window.addEventListener("focus",this.onFocus),document.addEventListener("visibilitychange",this.onVisibilityChange),window.addEventListener("keydown",this.onKeyDown,Zw),this.systemLightThemeMedia?.addEventListener("change",this.onSystemLightThemeChange),this.applyPreferredTheme(!1),window.addEventListener("mousemove",this.onWindowMouseMove,{passive:!0,capture:!0}),document.addEventListener("pointermove",this.onWindowMouseMove,{passive:!0,capture:!0}),this.connectRealtime(),this.ompWebStatusTimer=window.setInterval(()=>{this.scheduleOmpWebStatusRefresh()},Dtt),this.refreshWorkspaceActivity(),this.loadClientConfig(),this.ensureGatewayPluginsLoaded(),this.loadProjectsAndRestoreRoute().finally(()=>{this.scheduleOmpWebStatusRefresh()})}disconnectedCallback(){window.removeEventListener("popstate",this.onPopState),window.removeEventListener("pageshow",this.onPageShow),window.removeEventListener("focus",this.onFocus),document.removeEventListener("visibilitychange",this.onVisibilityChange),window.removeEventListener("keydown",this.onKeyDown,Zw),this.systemLightThemeMedia?.removeEventListener("change",this.onSystemLightThemeChange),Us()?.removeEventListener(js,this.handleChatPreferencesChanged),this.keyboard.reset(),this.auth.dispose(),this.sessions.dispose(),this.realtime.close(),this.closeMachineActivitySockets(),this.git.dispose(),this.ompWebStatusTimer!==void 0&&window.clearInterval(this.ompWebStatusTimer),this.ompWebStatusTimer=void 0,this.clearScheduledOmpWebStatusRefresh(),this.workspaceDeletionPollTimer!==void 0&&window.clearInterval(this.workspaceDeletionPollTimer),this.workspaceDeletionPollTimer=void 0,window.removeEventListener("mousemove",this.onWindowMouseMove,{capture:!0}),document.removeEventListener("pointermove",this.onWindowMouseMove,{capture:!0}),this.clearPendingRemoteRouteRestore(),super.disconnectedCallback()}setState(e){if(!_tt(this.state,e))return;const t=this.state;this.state={...this.state,...e},this.handleActivityTransition(t,this.state),this.handleWorkspaceChange(t,this.state),this.handleMachineChange(t,this.state),Att(t,this.state)&&this.syncMachineActivitySubscriptions()}async loadProjectsAndRestoreRoute(){this.restoreSettingsRoute();const e=$y();await this.machines.loadMachines(e.machineId);const t=this.routeForSelectedMachine(e),i=this.state.machineStatuses[t.machineId??"local"];t!==e&&this.replaceRouteAndClearWorkspaceQuery(t),await this.projects.loadProjects(),await this.withChatScrollTransition(()=>this.restoreRouteFor(t,!1)),this.shouldDeferRemoteRouteRestore(t,i)?this.deferRemoteRouteRestore(t):(this.clearPendingRemoteRouteRestore(),this.rememberCurrentMachineNavigation()),await this.refreshWorkspaceDeletionRuns()}scheduleOmpWebStatusRefresh(e=Ftt){this.clearScheduledOmpWebStatusRefresh(),this.ompWebStatusDeferredTimer=window.setTimeout(()=>{this.ompWebStatusDeferredTimer=void 0,this.refreshOmpWebStatus()},e)}clearScheduledOmpWebStatusRefresh(){this.ompWebStatusDeferredTimer!==void 0&&(window.clearTimeout(this.ompWebStatusDeferredTimer),this.ompWebStatusDeferredTimer=void 0)}async refreshOmpWebStatus(){const e=wt(this.state);try{const t=await uk.ompWebStatus(e);wt(this.state)===e&&this.setState({ompWebStatus:t})}catch(t){wt(this.state)===e&&this.setState({ompWebStatus:void 0}),console.warn(`Failed to refresh PI WEB status for ${e}`,t)}}async refreshWorkspaceActivity(e=wt(this.state)){try{await this.activity.refresh(e)}catch(t){console.warn(`Failed to refresh workspace activity for ${e}`,t)}}async refreshMachineActivities(){const e=this.state.machines.length===0?[wt(this.state)]:this.state.machines.filter(t=>p7(t,this.state.machineStatuses[t.id])).map(t=>t.id);await Promise.all(e.map(t=>this.refreshWorkspaceActivity(t)))}async loadClientConfig(){try{this.applyClientConfig((await zs.config()).effectiveConfig)}catch(e){console.warn("Failed to load PI WEB config",e)}}applyClientConfig(e){this.shortcutConfig=e.shortcuts??{},this.workspaceUploadDefaultFolder=Nb(e),iM({vimMode:e.vimMode??!1})}async refreshAppData(){if(!this.isRefreshingApp){this.isRefreshingApp=!0;try{await Promise.all([this.sessions.refreshSelectedSession(),this.refreshMachineActivities(),this.loadClientConfig(),this.refreshWorkspaceDeletionRuns(),this.refreshCurrentWorkspaceSurface()]),this.scheduleOmpWebStatusRefresh()}finally{this.isRefreshingApp=!1}}}async refreshCurrentWorkspaceSurface(){const e=this.state.selectedWorkspace,t=this.state.mainView!=="chat"&&this.state.mainView!=="navigation"?this.state.mainView:this.state.workspaceTool;t==="core:workspace.files"?await this.files.refreshFiles():t==="core:workspace.git"?await this.git.refreshGit():t==="core:workspace.terminal"&&e!==void 0&&await this.refreshActiveTerminals(e)}hardReloadApp(){window.location.reload()}async restoreRoute(e){await this.restoreRouteFor($y(),e),this.rememberCurrentMachineNavigation()}async restoreRouteFor(e,t,i=this.readWorkspaceRouteSurface(e),r){const s=wt(this.state),o=e.projectId===void 0||e.projectId===""?Vw():i,a=++this.routeRestoreSeq;this.routeRestoreDepth+=1,this.restoringRouteTerminalId=o.selectedTerminalId;try{await this.restoreRouteMachine(e,!1);const n=this.loadPluginsForSelectedMachine();if(e.tool?.startsWith("machine.")===!0&&await n,!this.isCurrentRouteRestore(a))return;if(this.setState({workspaceTool:e.tool??this.state.workspaceTool,mainView:r??e.view??this.defaultRouteView(),selectedFilePath:o.selectedFilePath,selectedDiffPath:o.selectedDiffPath,selectedTerminalId:o.selectedTerminalId}),e.projectId===void 0||e.projectId===""){t&&this.updateUrl();return}if(this.routeMatchesCurrentSelection(e)){o.selectedTerminalId!==void 0&&this.rememberSelectedTerminal(o.selectedTerminalId),await this.refreshRestoredWorkspaceTool(e.tool,o.selectedFilePath),this.git.updatePolling(),t&&this.updateUrl();return}const l=this.state.projects.find(c=>c.id===e.projectId);if(!l){this.setState({selectedFilePath:void 0,selectedDiffPath:void 0,selectedTerminalId:void 0}),t&&this.updateUrl();return}if(await this.workspaces.selectProject(l,{workspaceId:e.workspaceId,sessionId:e.sessionId,updateUrl:!1}),!this.isCurrentRouteRestore(a))return;this.setState({selectedFilePath:o.selectedFilePath,selectedDiffPath:o.selectedDiffPath,selectedTerminalId:o.selectedTerminalId}),o.selectedTerminalId!==void 0&&this.rememberSelectedTerminal(o.selectedTerminalId),await this.refreshRestoredWorkspaceTool(e.tool,o.selectedFilePath),this.git.updatePolling(),t&&this.updateUrl()}finally{this.routeRestoreDepth=Math.max(0,this.routeRestoreDepth-1),this.routeRestoreDepth===0&&(this.restoringRouteTerminalId=void 0),wt(this.state)!==s&&this.scheduleOmpWebStatusRefresh()}}isCurrentRouteRestore(e){return e===this.routeRestoreSeq}readWorkspaceRouteSurface(e){return e.projectId===void 0||e.projectId===""?Vw():{selectedFilePath:Ap(lf,"file"),selectedDiffPath:Ap(cf,"diff"),selectedTerminalId:Ap(Gh,"terminal")}}routeForSelectedMachine(e){const t=this.state.selectedMachine?.id??"local";return(e.machineId??"local")===t?e:{machineId:t,projectId:void 0,workspaceId:void 0,sessionId:void 0,tool:void 0,view:void 0}}replaceRouteAndClearWorkspaceQuery(e){Ep(e,{replace:!0}),ps(lf,"file",void 0,{replace:!0}),ps(cf,"diff",void 0,{replace:!0}),ps(Gh,"terminal",void 0,{replace:!0})}shouldDeferRemoteRouteRestore(e,t=this.state.machineStatuses[e.machineId??"local"]){const i=e.machineId??"local",r=this.state.selectedMachine;return i==="local"||r?.id!==i||r.kind!=="remote"||t?.ok!==!1?!1:e.projectId===void 0||e.projectId===""?this.state.projects.length===0:this.state.selectedProject?.id!==e.projectId}deferRemoteRouteRestore(e){this.pendingRemoteRouteRestore=e,this.remoteRouteRestoreAttempt=0,this.setRemoteRouteRestoreMessage(e),this.schedulePendingRemoteRouteRestore()}retryPendingRemoteRouteRestoreSoon(){this.pendingRemoteRouteRestore!==void 0&&this.schedulePendingRemoteRouteRestore(0)}schedulePendingRemoteRouteRestore(e=Ptt(this.remoteRouteRestoreAttempt)){this.pendingRemoteRouteRestore!==void 0&&(this.clearPendingRemoteRouteRestoreTimer(),this.remoteRouteRestoreTimer=window.setTimeout(()=>{this.remoteRouteRestoreTimer=void 0,this.retryPendingRemoteRouteRestore()},e))}async retryPendingRemoteRouteRestore(){if(this.remoteRouteRestoreInProgress)return;const e=this.pendingRemoteRouteRestore;if(e!==void 0){if(!this.pendingRemoteRouteRestoreStillCurrent(e)){this.clearPendingRemoteRouteRestore();return}this.remoteRouteRestoreInProgress=!0;try{const t=e.machineId??"local",i=await this.machines.refreshMachineHealth(t);if(!this.pendingRemoteRouteRestoreStillCurrent(e))return;if(i?.ok!==!0){this.scheduleNextRemoteRouteRestoreAttempt(e);return}if(await this.machines.refreshMachineRuntime(t),!this.pendingRemoteRouteRestoreStillCurrent(e)||(await this.projects.loadProjects(),!this.pendingRemoteRouteRestoreStillCurrent(e)))return;if(this.state.error!==""){this.scheduleNextRemoteRouteRestoreAttempt(e);return}if(await this.withChatScrollTransition(()=>this.restoreRouteFor(e,!1)),!this.pendingRemoteRouteRestoreStillCurrent(e))return;this.clearPendingRemoteRouteRestore(),this.rememberCurrentMachineNavigation(),await this.refreshWorkspaceDeletionRuns()}finally{this.remoteRouteRestoreInProgress=!1}}}scheduleNextRemoteRouteRestoreAttempt(e){if(this.remoteRouteRestoreAttempt+=1,this.remoteRouteRestoreAttempt>=Ott.length){this.setRemoteRouteRestoreMessage(e,{exhausted:!0}),this.clearPendingRemoteRouteRestore();return}this.setRemoteRouteRestoreMessage(e),this.schedulePendingRemoteRouteRestore()}setRemoteRouteRestoreMessage(e,t={}){const i=e.machineId??"local",r=this.state.machines.find(n=>n.id===i)?.name??this.state.selectedMachine?.name??"Remote machine",o=this.state.machineStatuses[i]?.error??(this.state.error===""?void 0:this.state.error),a=t.exhausted===!0?`${r} is still unavailable.`:`${r} is unavailable; reconnecting…`;this.setState({error:`${a}${o===void 0?"":` ${o}`}`})}pendingRemoteRouteRestoreStillCurrent(e){const t=e.machineId??"local";return t!=="local"&&this.pendingRemoteRouteRestore===e&&this.state.selectedMachine?.id===t&&this.state.machines.some(i=>i.id===t)}clearPendingRemoteRouteRestore(){this.clearPendingRemoteRouteRestoreTimer(),this.pendingRemoteRouteRestore=void 0,this.remoteRouteRestoreAttempt=0}clearPendingRemoteRouteRestoreTimer(){this.remoteRouteRestoreTimer!==void 0&&(window.clearTimeout(this.remoteRouteRestoreTimer),this.remoteRouteRestoreTimer=void 0)}async restoreRouteMachine(e,t){const i=e.machineId??"local";if(this.state.selectedMachine?.id===i)return;const r=this.state.machines.find(s=>s.id===i);r!==void 0&&await this.machines.selectMachine(r,{updateUrl:t})}routeMatchesCurrentSelection(e){return(e.machineId??"local")===(this.state.selectedMachine?.id??"local")&&e.workspaceId!==void 0&&e.workspaceId!==""&&this.state.selectedProject?.id===e.projectId&&this.state.selectedWorkspace?.id===e.workspaceId&&this.state.selectedSession?.id===e.sessionId}async refreshRestoredWorkspaceTool(e,t){e==="core:workspace.files"&&await this.files.refreshFiles(),e==="core:workspace.files"&&t!==void 0&&await this.files.restoreFile(t),e==="core:workspace.git"&&await this.git.refreshGit()}async withChatScrollTransition(e,t=()=>!0){this.chatView?.saveScrollPosition(),await e(),t()&&(await this.updateComplete,t()&&(await this.chatView?.updateComplete,t()&&(await af(),t()&&(this.chatView?.restoreScrollPosition(),this.chatView?.focusConversation()))))}shouldAutoFocusPrompt(){return this.appShell.shouldAutoFocusPrompt()}async withChatPrependTransition(e){await e(),await this.updateComplete,await this.chatView?.updateComplete}defaultRouteView(){return this.appShell.defaultRouteView()}updateUrl(e){this.rememberCurrentMachineNavigation(),Ep({machineId:this.state.selectedMachine?.id,projectId:this.state.selectedProject?.id,workspaceId:this.state.selectedWorkspace?.id,sessionId:this.state.selectedSession?.id,tool:this.state.workspaceTool,view:this.state.mainView==="navigation"?void 0:this.state.mainView},e),this.syncWorkspaceRouteSurfaceToUrl()}rememberCurrentMachineNavigation(){this.machineNavigation.remember(dy(this.state))}syncWorkspaceRouteSurfaceToUrl(){this.writeWorkspaceRouteSurfaceToUrl(dy(this.state).surface)}writeMachineNavigationSnapshotToUrl(e,t){Ep(uy(e),t),this.writeWorkspaceRouteSurfaceToUrl(e.surface)}writeWorkspaceRouteSurfaceToUrl(e){ps(lf,"file",e.selectedFilePath,{replace:!0}),ps(cf,"diff",e.selectedDiffPath,{replace:!0}),ps(Gh,"terminal",e.selectedTerminalId,{replace:!0})}async selectMachineWithMemory(e,t={}){if(this.state.selectedMachine?.id===e.id)return;t.rememberCurrent!==!1&&!this.routeRestoreInProgress&&this.rememberCurrentMachineNavigation();const i=++this.machineNavigationRestoreSeq,r=this.machineNavigation.latest(e.id)??cM(e.id);if(await this.restoreRouteFor(uy(r),!1,r.surface,r.view),!(i!==this.machineNavigationRestoreSeq||this.state.selectedMachine?.id!==e.id)){if(this.shouldPreserveUnrestoredMachineNavigation(r)){this.machineNavigation.remember(r),this.writeMachineNavigationSnapshotToUrl(r);return}this.updateUrl()}}shouldPreserveUnrestoredMachineNavigation(e){return e.projectId!==void 0&&this.state.selectedProject?.id!==e.projectId&&this.state.error!==""}openWorkspaceTool(e){e==="core:workspace.terminal"&&(this.terminalAutoStartWorkspaceId=this.state.selectedWorkspace?.id),this.setState({workspaceTool:e,mainView:e}),this.updateUrl(),this.refreshSelectedWorkspaceTool(e),this.git.updatePolling()}openTerminal(e){e?.terminalId!==void 0&&this.selectTerminal(e.terminalId,{replace:!0}),this.openWorkspaceTool("core:workspace.terminal")}terminalCommandRunsForOrigin(e,t=wt(this.state)){const i=Kw(t,e),r=this.terminalCommandRunRuntimes.get(i);if(r!==void 0)return r;const s=UA(e,{api:{runTerminalCommand:(o,a)=>An.runTerminalCommand(o,a,t),listCommandRuns:o=>An.listCommandRuns(o,t),getCommandRun:o=>An.getCommandRun(o,t)},openTerminal:(o,a)=>{this.openRuntimeTerminal(t,o,a)}});return this.terminalCommandRunRuntimes.set(i,s),s}async openRuntimeTerminal(e,t,i){if((wt(this.state)!==e||t!==void 0&&(this.state.selectedWorkspace?.id!==t.id||this.state.selectedProject?.id!==t.projectId))&&(this.routeRestoreInProgress||this.rememberCurrentMachineNavigation(),await this.restoreRouteFor({machineId:e,projectId:t?.projectId,workspaceId:t?.id,sessionId:void 0,tool:"core:workspace.terminal",view:"core:workspace.terminal"},!1,{selectedTerminalId:i?.terminalId},"core:workspace.terminal"),wt(this.state)!==e)){this.setState({error:"Machine not found for terminal command run"});return}this.openTerminal(i)}selectTerminal(e,t){this.rememberSelectedTerminal(e),this.setState({selectedTerminalId:e}),this.rememberCurrentMachineNavigation(),this.writeSelectedTerminalToUrl(e,t)}rememberSelectedTerminal(e){const t=this.state.selectedWorkspace;t!==void 0&&(e===void 0?this.terminalSelection.forgetWorkspace(this.terminalWorkspaceKey(t)):this.terminalSelection.rememberTerminal(this.terminalWorkspaceKey(t),e))}writeSelectedTerminalToUrl(e,t){ps(Gh,"terminal",e,t)}terminalWorkspaceKey(e){return`${wt(this.state)}:${e.path}`}selectMainView(e){if(e!=="navigation"&&e!=="chat"){this.openWorkspaceTool(e);return}this.setState({mainView:e}),this.updateUrl(),this.git.updatePolling()}openSettings(e="general"){this.settingsSection=e,Rp(e)}closeSettings(){this.settingsSection=void 0,Rp(void 0)}navigateSettings(e){this.settingsSection=e,Rp(e)}restoreSettingsRoute(){this.settingsSection=My()}handleWorkspaceChange(e,t){if(e.selectedWorkspace?.id===t.selectedWorkspace?.id)return;this.terminalAutoStartWorkspaceId=void 0,this.activeTerminalIds.clear();const i=this.routeRestoreInProgress?this.restoringRouteTerminalId:t.selectedWorkspace===void 0?void 0:this.terminalSelection.latestTerminalId(this.terminalWorkspaceKey(t.selectedWorkspace));this.setState({activeTerminalCount:0,selectedTerminalId:i}),this.routeRestoreInProgress||(this.rememberCurrentMachineNavigation(),this.writeSelectedTerminalToUrl(i,{replace:!0})),t.selectedWorkspace!==void 0&&(this.refreshActiveTerminals(t.selectedWorkspace),this.refreshWorkspaceDeletionRuns(),this.refreshSelectedWorkspaceTool(t.workspaceTool),this.git.updatePolling())}connectRealtime(){this.realtime.connect(e=>{this.handleRealtimeEvent(e)},()=>{const e=this.state.selectedWorkspace;e!==void 0&&this.refreshActiveTerminals(e),this.refreshWorkspaceActivity()},wt(this.state))}syncMachineActivitySubscriptions(){const e=this.machineActivitySubscriptionIds();for(const[t,i]of this.machineActivitySockets.entries())e.has(t)||(i.close(),this.machineActivitySockets.delete(t));for(const t of e){if(this.machineActivitySockets.has(t))continue;const i=new iy;i.connect(r=>{this.handleMachineActivityEvent(t,r)},()=>{this.refreshWorkspaceActivity(t)},t),this.machineActivitySockets.set(t,i)}}closeMachineActivitySockets(){for(const e of this.machineActivitySockets.values())e.close();this.machineActivitySockets.clear()}machineActivitySubscriptionIds(){const e=wt(this.state);return new Set(this.state.machines.filter(t=>t.id!==e).filter(t=>Btt(t,this.state.machineStatuses[t.id])).map(t=>t.id))}handleMachineActivityEvent(e,t){t.type==="workspace.activity"&&this.activity.applyWorkspaceActivity(t.activity,e)}handleRealtimeEvent(e){e.type==="workspace.activity"?this.activity.applyWorkspaceActivity(e.activity):Ltt(e)?(this.applyTerminalEvent(e),e.type==="terminal.exited"&&this.refreshWorkspaceDeletionRuns()):this.sessions.applyGlobalEvent(e)}applyTerminalEvent(e){const t=this.state.selectedWorkspace;t===void 0||(e.type==="terminal.closed"?e.cwd:e.terminal.cwd)!==t.path||(e.type==="terminal.created"&&!e.terminal.exited?this.activeTerminalIds.add(e.terminal.id):this.activeTerminalIds.delete(e.type==="terminal.closed"?e.terminalId:e.terminal.id),e.type==="terminal.closed"&&(this.terminalSelection.forgetTerminal(e.terminalId),this.state.selectedTerminalId===e.terminalId&&this.selectTerminal(void 0,{replace:!0})),this.setState({activeTerminalCount:this.activeTerminalIds.size}))}async refreshActiveTerminals(e){const t=wt(this.state);try{const i=await An.terminals(e.projectId,e.id,t);if(wt(this.state)!==t||this.state.selectedWorkspace?.id!==e.id)return;this.activeTerminalIds.clear();for(const r of i)r.exited||this.activeTerminalIds.add(r.id);this.setState({activeTerminalCount:this.activeTerminalIds.size})}catch(i){this.setState({error:String(i)})}}handleActivityTransition(e,t){const i=Xw(e),r=Xw(t);i&&!r&&(this.setState({fileTreeStale:!0,gitStale:!0}),this.refreshSelectedWorkspaceTool(this.state.workspaceTool))}handleMachineChange(e,t){if((e.selectedMachine?.id??"local")===(t.selectedMachine?.id??"local"))return;(this.pendingRemoteRouteRestore?.machineId??"local")!==(t.selectedMachine?.id??"local")&&this.clearPendingRemoteRouteRestore(),this.sessions.clearActiveSession(),this.realtime.close(),window.addEventListener("mousemove",this.onWindowMouseMove,{passive:!0,capture:!0}),document.addEventListener("pointermove",this.onWindowMouseMove,{passive:!0,capture:!0}),this.connectRealtime(),this.activeTerminalIds.clear(),this.sessionCleanupDialog=void 0,this.setState({ompWebStatus:void 0}),this.git.updatePolling(),this.loadPluginsForSelectedMachine()}refreshSelectedWorkspaceTool(e){e==="core:workspace.files"&&this.files.refreshFiles(),e==="core:workspace.git"&&this.git.refreshGit()}renderWorkspacePanel(){const e=this.state.selectedWorkspace,t=e===void 0?void 0:this.createWorkspacePanelContext(e),i=e===void 0?this.workspacePanelEmptyState():void 0;return T`
5524
+ `}function ytt(){xe(()=>import("./UnifiedDiffViewer-DNmO4uBQ.js"),__vite__mapDeps([61,4,5]))}function xtt(){xe(()=>import("./TerminalPanel-Cz-DYrx6.js"),__vite__mapDeps([62,63,64,4,5]))}function vtt(e){return T`<workspace-tasks-panel .context=${e}></workspace-tasks-panel>`}function wtt(e){const t=e.branch??"detached",i=e.ahead??0,r=e.behind??0;return i===0&&r===0?t:`${t} · ↑${String(i)} ↓${String(r)}`}function ktt(e,t){return(t!=="unmodified"?t:e).slice(0,1).toUpperCase()}const Stt={apiVersion:1,name:"PI WEB Core",activate:()=>({contributions:{actions:NJ(),workspacePanels:utt()}})},Ctt={"--pi-bg":"#0d1117","--pi-surface":"#161b22","--pi-surface-hover":"#21262d","--pi-terminal-bg":"#05070a","--pi-terminal-text":"#e6edf3","--pi-border":"#30363d","--pi-border-muted":"#21262d","--pi-text":"#e6edf3","--pi-text-secondary":"#c9d1d9","--pi-text-bright":"#f0f6fc","--pi-muted":"#8b949e","--pi-dim":"#6e7681","--pi-accent":"#58a6ff","--pi-accent-border":"#2f81f7","--pi-selection-bg":"#0d2847","--pi-success":"#3fb950","--pi-success-border":"#238636","--pi-success-bg":"#0f1b12","--pi-success-surface":"#0f2a16","--pi-success-ring":"#3fb95055","--pi-warning":"#d29922","--pi-warning-border":"#6e5200","--pi-warning-surface":"#1f1a10","--pi-danger":"#ff7b72","--pi-purple":"#d2a8ff","--pi-purple-border":"#a371f7","--pi-purple-surface":"#21132f","--pi-overlay":"#0008","--pi-shadow-soft":"#0006","--pi-shadow":"#0008","--pi-shadow-strong":"#000b","--pi-bg-overlay-soft":"#0d1117dd","--pi-bg-overlay":"#0d1117e6","--pi-success-bg-overlay":"#0f1b12ee","--pi-terminal-selection":"#264f78"},Ttt={"--pi-bg":"#070912","--pi-surface":"#101527","--pi-surface-hover":"#151b31","--pi-terminal-bg":"#050710","--pi-terminal-text":"#f7f4ff","--pi-border":"#26304f","--pi-border-muted":"#26304f","--pi-text":"#f7f4ff","--pi-text-secondary":"#aaa4bd","--pi-text-bright":"#ffffff","--pi-muted":"#aaa4bd","--pi-dim":"#817a99","--pi-accent":"#7c3cff","--pi-accent-border":"#5a47b0","--pi-selection-bg":"#1d2547","--pi-success":"#00f0d8","--pi-success-border":"#00f0d8","--pi-success-bg":"#071e22","--pi-success-surface":"#092d31","--pi-success-ring":"#00f0d855","--pi-warning":"#ffb000","--pi-warning-border":"#ffb000","--pi-warning-surface":"#16140d","--pi-danger":"#ff4f7b","--pi-purple":"#b7a2ff","--pi-purple-border":"#7c3cff","--pi-purple-surface":"#181026","--pi-overlay":"#0008","--pi-shadow-soft":"#0006","--pi-shadow":"#0008","--pi-shadow-strong":"#000b","--pi-bg-overlay-soft":"#070912dd","--pi-bg-overlay":"#070912e6","--pi-success-bg-overlay":"#071e22ee","--pi-terminal-selection":"#3d4a78"},$tt={"--pi-bg":"#f7f1e6","--pi-surface":"#fff9ee","--pi-surface-hover":"#f0e6d6","--pi-terminal-bg":"#15131b","--pi-terminal-text":"#fff9ee","--pi-border":"#c9bca8","--pi-border-muted":"#d8cdbc","--pi-text":"#15131b","--pi-text-secondary":"#15131b","--pi-text-bright":"#15131b","--pi-muted":"#5f586a","--pi-dim":"#766f7e","--pi-accent":"#6430d8","--pi-accent-border":"#6430d8","--pi-selection-bg":"#eadff8","--pi-success":"#008c82","--pi-success-border":"#008c82","--pi-success-bg":"#e1f4ef","--pi-success-surface":"#d7f0ec","--pi-success-ring":"#008c8255","--pi-warning":"#b05f00","--pi-warning-border":"#b05f00","--pi-warning-surface":"#fff2d2","--pi-danger":"#b51d49","--pi-purple":"#6430d8","--pi-purple-border":"#6430d8","--pi-purple-surface":"#eadff8","--pi-overlay":"#15131b66","--pi-shadow-soft":"#15131b22","--pi-shadow":"#15131b33","--pi-shadow-strong":"#15131b44","--pi-bg-overlay-soft":"#f7f1e6dd","--pi-bg-overlay":"#f7f1e6e6","--pi-success-bg-overlay":"#e1f4efee","--pi-terminal-selection":"#8d7b64"},Mtt={apiVersion:1,name:"PI WEB Themes",activate:()=>({contributions:{themes:[{id:"omp-web-dark",name:"PI WEB Dark",description:"Dark PI WEB palette.",order:10,colorScheme:"dark",tokens:Ttt},{id:"omp-web-light",name:"PI WEB Light",description:"Light PI WEB palette.",order:20,colorScheme:"light",tokens:$tt},{id:"classic",name:"PI WEB Classic",description:"The original PI WEB dark palette.",order:30,colorScheme:"dark",tokens:Ctt}],themePairs:[{id:"omp-web",name:"PI WEB",description:"Follow the system light/dark preference with PI WEB themes.",order:10,light:"omp-web-light",dark:"omp-web-dark"}]}})},Yw=[1e3,3e3,8e3,15e3,3e4];function Att(){const e=new eA;return e.register({id:"core",plugin:Stt}),e.register({id:"themes",plugin:Mtt}),e}function Gw(e){const t=e.selectedMachine;return t!==void 0?{id:t.id,name:t.name,kind:t.kind}:{id:"local",name:"local",kind:"local"}}function Btt(e,t){return e.machines!==t.machines||e.machineStatuses!==t.machineStatuses||(e.selectedMachine?.id??"local")!==(t.selectedMachine?.id??"local")}function _tt(e,t){return p7(e,t)}function p7(e,t){if(e.kind==="local")return!0;const i=t?.status??e.status;return i===void 0||i==="unknown"||i==="online"}function Ltt(e,t){return Object.entries(t).some(([i,r])=>Reflect.get(e,i)!==r)}function Xw(e){return na(e.status,e.activity)}function Ptt(e){return e.type==="terminal.created"||e.type==="terminal.exited"||e.type==="terminal.closed"}function Vw(){return{}}function Kw(e,t){return JSON.stringify([e,t])}function Ett(e){const t=Math.min(e,Yw.length-1);return Yw[t]??3e4}function Rtt(e,t){return Object.fromEntries(Object.entries(e).filter(([i])=>i!==t))}function af(){return new Promise(e=>requestAnimationFrame(()=>{e()}))}function Itt(e){switch(e){case"off":return"No reasoning";case"minimal":return"Very brief reasoning (~1k tokens)";case"low":return"Light reasoning (~2k tokens)";case"medium":return"Moderate reasoning (~8k tokens)";case"high":return"Deep reasoning (~16k tokens)";case"xhigh":return"Maximum reasoning (~32k tokens)";default:return}}var ztt=Object.defineProperty,Dtt=Object.getOwnPropertyDescriptor,Pr=(e,t,i,r)=>{for(var s=r>1?void 0:r?Dtt(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(s=(r?a(t,i,s):a(s))||s);return r&&s&&ztt(t,i,s),s};const Ftt=900*1e3,Ott=750,Ntt=[1e3,3e3,8e3,15e3,3e4],Zw={capture:!0},nf="auto:on",Qw="auto:off",Yh="theme:",lf=zc("core:workspace.files"),cf=zc("core:workspace.git"),Gh=zc("core:workspace.terminal"),Wtt=320,qtt=2,Htt="(min-width: 1181px)";let sr=class extends we{constructor(){super(...arguments),this.state=KT(),this.chatPreferences=$r(),this.handleChatPreferencesChanged=e=>{if(e instanceof CustomEvent&&$u(e.detail)?this.chatPreferences=e.detail:this.chatPreferences=$r(),this.chatPreferences.hideWorkspaces&&this.state.workspaces.length>0&&this.state.selectedWorkspace?.id!==this.state.workspaces[0]?.id){const t=this.state.workspaces[0];t!==void 0&&this.workspaces.selectWorkspace(t)}this.requestUpdate()},this.sessions=new U9(()=>this.state,e=>{this.setState(e)},()=>{this.updateUrl()},new O9),this.activity=new QT(()=>this.state,e=>{this.setState(e)}),this.auth=new e$(()=>this.state,e=>{this.setState(e)},e=>{this.sessions.applySessionStatus(e)}),this.workspaces=new sM(()=>this.state,e=>{this.setState(e)},()=>{this.updateUrl()},this.sessions,new J9),this.projects=new f$(()=>this.state,e=>{this.setState(e)},this.workspaces),this.machines=new p$(()=>this.state,e=>{this.setState(e)},()=>{this.updateUrl()},this.projects),this.files=new c$(()=>this.state,e=>{this.setState(e)},()=>{this.updateUrl()}),this.git=new u$(()=>this.state,e=>{this.setState(e)},()=>{this.updateUrl()}),this.keyboard=new bM,this.realtime=new iy,this.machineActivitySockets=new Map,this.activeTerminalIds=new Set,this.machineNavigation=new lM,this.terminalSelection=new gM,this.appShell=new mA(this),this.panelCollapse=new MA(this),this.panelResize=new BA(this),this.navigationSections=new CA(this,()=>this.state,()=>this.appShell.isMobileNavigationLayout),this.systemLightThemeMedia=typeof window<"u"&&"matchMedia"in window?window.matchMedia("(prefers-color-scheme: light)"):void 0,this.refreshingWorkspaceDeletionRuns=!1,this.handledWorkspaceDeletionRunIds=new Set,this.terminalCommandRunRuntimes=new Map,this.machineNavigationRestoreSeq=0,this.navigationSelectionSeq=0,this.routeRestoreSeq=0,this.routeRestoreDepth=0,this.remoteRouteRestoreAttempt=0,this.remoteRouteRestoreInProgress=!1,this.plugins=Att(),this.loadedMachinePluginIds=new Set,this.machinePluginLoadPromises=new Map,this.themePreference=zM()??EM,this.activeThemeId=rm,this.isRefreshingApp=!1,this.settingsSection=My(),this.shortcutConfig={},this.workspaceUploadDefaultFolder=Nb(void 0),this.onPopState=()=>{this.withChatScrollTransition(async()=>{this.restoreSettingsRoute(),await this.restoreRoute(!1)})},this.onPageShow=()=>{this.appShell.repairViewportPosition(),this.retryPendingRemoteRouteRestoreSoon()},this.onFocus=()=>{this.appShell.repairViewportPosition(),this.sessions.refreshSelectedSession(),this.scheduleOmpWebStatusRefresh(),this.refreshMachineActivities(),this.refreshWorkspaceDeletionRuns(),this.retryPendingRemoteRouteRestoreSoon()},this.onVisibilityChange=()=>{document.visibilityState==="visible"&&(this.appShell.repairViewportPosition(),this.sessions.refreshSelectedSession(),this.scheduleOmpWebStatusRefresh(),this.refreshMachineActivities(),this.refreshWorkspaceDeletionRuns(),this.retryPendingRemoteRouteRestoreSoon())},this.onSystemLightThemeChange=()=>{this.themePreference.auto&&this.applyPreferredTheme(!1)},this.onKeyDown=e=>{this.settingsSection===void 0&&this.keyboard.handle(e,this.getDefaultActions(),{shortcuts:this.shortcutConfig})&&(e.preventDefault(),e.stopPropagation())},this.onWindowMouseMove=e=>{const t=e.clientX,i=e.clientY,r=t<=40,s=t<=80&&i<=80,o=t<=80&&i>=window.innerHeight-80;if(!(!r&&!s&&!o)){if(this.appShell.isMobileNavigationLayout){this.state.mainView!=="navigation"&&this.selectMainView("navigation");return}(this.panelCollapse.navigationPanelCollapsed||this.panelResize.panelWidth("navigation")<50)&&(this.panelCollapse.expandNavigationPanel(),this.panelResize.panelWidth("navigation")<180&&this.panelResize.resizePanel("navigation",340),this.requestUpdate())}},this.handleSendPrompt=(e,t,i,r)=>{this.sendPrompt(e,t,i,r)},this.handleStopActiveWork=()=>{this.sessions.stopActiveWork()},this.handleSelectModel=()=>{this.openModelDialog()},this.handleSelectThinking=()=>{this.openThinkingDialog()},this.handlePromptEscape=()=>{this.chatView?.focusConversation()}}get routeRestoreInProgress(){return this.routeRestoreDepth>0}willUpdate(){this.toggleAttribute("pwa-display-mode",this.appShell.isPwaDisplayMode)}connectedCallback(){super.connectedCallback(),this.chatPreferences=$r(),Us()?.addEventListener(js,this.handleChatPreferencesChanged),window.addEventListener("popstate",this.onPopState),window.addEventListener("pageshow",this.onPageShow),window.addEventListener("focus",this.onFocus),document.addEventListener("visibilitychange",this.onVisibilityChange),window.addEventListener("keydown",this.onKeyDown,Zw),this.systemLightThemeMedia?.addEventListener("change",this.onSystemLightThemeChange),this.applyPreferredTheme(!1),window.addEventListener("mousemove",this.onWindowMouseMove,{passive:!0,capture:!0}),document.addEventListener("pointermove",this.onWindowMouseMove,{passive:!0,capture:!0}),this.connectRealtime(),this.ompWebStatusTimer=window.setInterval(()=>{this.scheduleOmpWebStatusRefresh()},Ftt),this.refreshWorkspaceActivity(),this.loadClientConfig(),this.ensureGatewayPluginsLoaded(),this.loadProjectsAndRestoreRoute().finally(()=>{this.scheduleOmpWebStatusRefresh()})}disconnectedCallback(){window.removeEventListener("popstate",this.onPopState),window.removeEventListener("pageshow",this.onPageShow),window.removeEventListener("focus",this.onFocus),document.removeEventListener("visibilitychange",this.onVisibilityChange),window.removeEventListener("keydown",this.onKeyDown,Zw),this.systemLightThemeMedia?.removeEventListener("change",this.onSystemLightThemeChange),Us()?.removeEventListener(js,this.handleChatPreferencesChanged),this.keyboard.reset(),this.auth.dispose(),this.sessions.dispose(),this.realtime.close(),this.closeMachineActivitySockets(),this.git.dispose(),this.ompWebStatusTimer!==void 0&&window.clearInterval(this.ompWebStatusTimer),this.ompWebStatusTimer=void 0,this.clearScheduledOmpWebStatusRefresh(),this.workspaceDeletionPollTimer!==void 0&&window.clearInterval(this.workspaceDeletionPollTimer),this.workspaceDeletionPollTimer=void 0,window.removeEventListener("mousemove",this.onWindowMouseMove,{capture:!0}),document.removeEventListener("pointermove",this.onWindowMouseMove,{capture:!0}),this.clearPendingRemoteRouteRestore(),super.disconnectedCallback()}setState(e){if(!Ltt(this.state,e))return;const t=this.state;this.state={...this.state,...e},this.handleActivityTransition(t,this.state),this.handleWorkspaceChange(t,this.state),this.handleMachineChange(t,this.state),Btt(t,this.state)&&this.syncMachineActivitySubscriptions()}async loadProjectsAndRestoreRoute(){this.restoreSettingsRoute();const e=$y();await this.machines.loadMachines(e.machineId);const t=this.routeForSelectedMachine(e),i=this.state.machineStatuses[t.machineId??"local"];t!==e&&this.replaceRouteAndClearWorkspaceQuery(t),await this.projects.loadProjects(),await this.withChatScrollTransition(()=>this.restoreRouteFor(t,!1)),this.shouldDeferRemoteRouteRestore(t,i)?this.deferRemoteRouteRestore(t):(this.clearPendingRemoteRouteRestore(),this.rememberCurrentMachineNavigation()),await this.refreshWorkspaceDeletionRuns()}scheduleOmpWebStatusRefresh(e=Ott){this.clearScheduledOmpWebStatusRefresh(),this.ompWebStatusDeferredTimer=window.setTimeout(()=>{this.ompWebStatusDeferredTimer=void 0,this.refreshOmpWebStatus()},e)}clearScheduledOmpWebStatusRefresh(){this.ompWebStatusDeferredTimer!==void 0&&(window.clearTimeout(this.ompWebStatusDeferredTimer),this.ompWebStatusDeferredTimer=void 0)}async refreshOmpWebStatus(){const e=wt(this.state);try{const t=await uk.ompWebStatus(e);wt(this.state)===e&&this.setState({ompWebStatus:t})}catch(t){wt(this.state)===e&&this.setState({ompWebStatus:void 0}),console.warn(`Failed to refresh PI WEB status for ${e}`,t)}}async refreshWorkspaceActivity(e=wt(this.state)){try{await this.activity.refresh(e)}catch(t){console.warn(`Failed to refresh workspace activity for ${e}`,t)}}async refreshMachineActivities(){const e=this.state.machines.length===0?[wt(this.state)]:this.state.machines.filter(t=>p7(t,this.state.machineStatuses[t.id])).map(t=>t.id);await Promise.all(e.map(t=>this.refreshWorkspaceActivity(t)))}async loadClientConfig(){try{this.applyClientConfig((await zs.config()).effectiveConfig)}catch(e){console.warn("Failed to load PI WEB config",e)}}applyClientConfig(e){this.shortcutConfig=e.shortcuts??{},this.workspaceUploadDefaultFolder=Nb(e),iM({vimMode:e.vimMode??!1})}async refreshAppData(){if(!this.isRefreshingApp){this.isRefreshingApp=!0;try{await Promise.all([this.sessions.refreshSelectedSession(),this.refreshMachineActivities(),this.loadClientConfig(),this.refreshWorkspaceDeletionRuns(),this.refreshCurrentWorkspaceSurface()]),this.scheduleOmpWebStatusRefresh()}finally{this.isRefreshingApp=!1}}}async refreshCurrentWorkspaceSurface(){const e=this.state.selectedWorkspace,t=this.state.mainView!=="chat"&&this.state.mainView!=="navigation"?this.state.mainView:this.state.workspaceTool;t==="core:workspace.files"?await this.files.refreshFiles():t==="core:workspace.git"?await this.git.refreshGit():t==="core:workspace.terminal"&&e!==void 0&&await this.refreshActiveTerminals(e)}hardReloadApp(){window.location.reload()}async restoreRoute(e){await this.restoreRouteFor($y(),e),this.rememberCurrentMachineNavigation()}async restoreRouteFor(e,t,i=this.readWorkspaceRouteSurface(e),r){const s=wt(this.state),o=e.projectId===void 0||e.projectId===""?Vw():i,a=++this.routeRestoreSeq;this.routeRestoreDepth+=1,this.restoringRouteTerminalId=o.selectedTerminalId;try{await this.restoreRouteMachine(e,!1);const n=this.loadPluginsForSelectedMachine();if(e.tool?.startsWith("machine.")===!0&&await n,!this.isCurrentRouteRestore(a))return;if(this.setState({workspaceTool:e.tool??this.state.workspaceTool,mainView:r??e.view??this.defaultRouteView(),selectedFilePath:o.selectedFilePath,selectedDiffPath:o.selectedDiffPath,selectedTerminalId:o.selectedTerminalId}),e.projectId===void 0||e.projectId===""){t&&this.updateUrl();return}if(this.routeMatchesCurrentSelection(e)){o.selectedTerminalId!==void 0&&this.rememberSelectedTerminal(o.selectedTerminalId),await this.refreshRestoredWorkspaceTool(e.tool,o.selectedFilePath),this.git.updatePolling(),t&&this.updateUrl();return}const l=this.state.projects.find(c=>c.id===e.projectId);if(!l){this.setState({selectedFilePath:void 0,selectedDiffPath:void 0,selectedTerminalId:void 0}),t&&this.updateUrl();return}if(await this.workspaces.selectProject(l,{workspaceId:e.workspaceId,sessionId:e.sessionId,updateUrl:!1}),!this.isCurrentRouteRestore(a))return;this.setState({selectedFilePath:o.selectedFilePath,selectedDiffPath:o.selectedDiffPath,selectedTerminalId:o.selectedTerminalId}),o.selectedTerminalId!==void 0&&this.rememberSelectedTerminal(o.selectedTerminalId),await this.refreshRestoredWorkspaceTool(e.tool,o.selectedFilePath),this.git.updatePolling(),t&&this.updateUrl()}finally{this.routeRestoreDepth=Math.max(0,this.routeRestoreDepth-1),this.routeRestoreDepth===0&&(this.restoringRouteTerminalId=void 0),wt(this.state)!==s&&this.scheduleOmpWebStatusRefresh()}}isCurrentRouteRestore(e){return e===this.routeRestoreSeq}readWorkspaceRouteSurface(e){return e.projectId===void 0||e.projectId===""?Vw():{selectedFilePath:Ap(lf,"file"),selectedDiffPath:Ap(cf,"diff"),selectedTerminalId:Ap(Gh,"terminal")}}routeForSelectedMachine(e){const t=this.state.selectedMachine?.id??"local";return(e.machineId??"local")===t?e:{machineId:t,projectId:void 0,workspaceId:void 0,sessionId:void 0,tool:void 0,view:void 0}}replaceRouteAndClearWorkspaceQuery(e){Ep(e,{replace:!0}),ps(lf,"file",void 0,{replace:!0}),ps(cf,"diff",void 0,{replace:!0}),ps(Gh,"terminal",void 0,{replace:!0})}shouldDeferRemoteRouteRestore(e,t=this.state.machineStatuses[e.machineId??"local"]){const i=e.machineId??"local",r=this.state.selectedMachine;return i==="local"||r?.id!==i||r.kind!=="remote"||t?.ok!==!1?!1:e.projectId===void 0||e.projectId===""?this.state.projects.length===0:this.state.selectedProject?.id!==e.projectId}deferRemoteRouteRestore(e){this.pendingRemoteRouteRestore=e,this.remoteRouteRestoreAttempt=0,this.setRemoteRouteRestoreMessage(e),this.schedulePendingRemoteRouteRestore()}retryPendingRemoteRouteRestoreSoon(){this.pendingRemoteRouteRestore!==void 0&&this.schedulePendingRemoteRouteRestore(0)}schedulePendingRemoteRouteRestore(e=Ett(this.remoteRouteRestoreAttempt)){this.pendingRemoteRouteRestore!==void 0&&(this.clearPendingRemoteRouteRestoreTimer(),this.remoteRouteRestoreTimer=window.setTimeout(()=>{this.remoteRouteRestoreTimer=void 0,this.retryPendingRemoteRouteRestore()},e))}async retryPendingRemoteRouteRestore(){if(this.remoteRouteRestoreInProgress)return;const e=this.pendingRemoteRouteRestore;if(e!==void 0){if(!this.pendingRemoteRouteRestoreStillCurrent(e)){this.clearPendingRemoteRouteRestore();return}this.remoteRouteRestoreInProgress=!0;try{const t=e.machineId??"local",i=await this.machines.refreshMachineHealth(t);if(!this.pendingRemoteRouteRestoreStillCurrent(e))return;if(i?.ok!==!0){this.scheduleNextRemoteRouteRestoreAttempt(e);return}if(await this.machines.refreshMachineRuntime(t),!this.pendingRemoteRouteRestoreStillCurrent(e)||(await this.projects.loadProjects(),!this.pendingRemoteRouteRestoreStillCurrent(e)))return;if(this.state.error!==""){this.scheduleNextRemoteRouteRestoreAttempt(e);return}if(await this.withChatScrollTransition(()=>this.restoreRouteFor(e,!1)),!this.pendingRemoteRouteRestoreStillCurrent(e))return;this.clearPendingRemoteRouteRestore(),this.rememberCurrentMachineNavigation(),await this.refreshWorkspaceDeletionRuns()}finally{this.remoteRouteRestoreInProgress=!1}}}scheduleNextRemoteRouteRestoreAttempt(e){if(this.remoteRouteRestoreAttempt+=1,this.remoteRouteRestoreAttempt>=Ntt.length){this.setRemoteRouteRestoreMessage(e,{exhausted:!0}),this.clearPendingRemoteRouteRestore();return}this.setRemoteRouteRestoreMessage(e),this.schedulePendingRemoteRouteRestore()}setRemoteRouteRestoreMessage(e,t={}){const i=e.machineId??"local",r=this.state.machines.find(n=>n.id===i)?.name??this.state.selectedMachine?.name??"Remote machine",o=this.state.machineStatuses[i]?.error??(this.state.error===""?void 0:this.state.error),a=t.exhausted===!0?`${r} is still unavailable.`:`${r} is unavailable; reconnecting…`;this.setState({error:`${a}${o===void 0?"":` ${o}`}`})}pendingRemoteRouteRestoreStillCurrent(e){const t=e.machineId??"local";return t!=="local"&&this.pendingRemoteRouteRestore===e&&this.state.selectedMachine?.id===t&&this.state.machines.some(i=>i.id===t)}clearPendingRemoteRouteRestore(){this.clearPendingRemoteRouteRestoreTimer(),this.pendingRemoteRouteRestore=void 0,this.remoteRouteRestoreAttempt=0}clearPendingRemoteRouteRestoreTimer(){this.remoteRouteRestoreTimer!==void 0&&(window.clearTimeout(this.remoteRouteRestoreTimer),this.remoteRouteRestoreTimer=void 0)}async restoreRouteMachine(e,t){const i=e.machineId??"local";if(this.state.selectedMachine?.id===i)return;const r=this.state.machines.find(s=>s.id===i);r!==void 0&&await this.machines.selectMachine(r,{updateUrl:t})}routeMatchesCurrentSelection(e){return(e.machineId??"local")===(this.state.selectedMachine?.id??"local")&&e.workspaceId!==void 0&&e.workspaceId!==""&&this.state.selectedProject?.id===e.projectId&&this.state.selectedWorkspace?.id===e.workspaceId&&this.state.selectedSession?.id===e.sessionId}async refreshRestoredWorkspaceTool(e,t){e==="core:workspace.files"&&await this.files.refreshFiles(),e==="core:workspace.files"&&t!==void 0&&await this.files.restoreFile(t),e==="core:workspace.git"&&await this.git.refreshGit()}async withChatScrollTransition(e,t=()=>!0){this.chatView?.saveScrollPosition(),await e(),t()&&(await this.updateComplete,t()&&(await this.chatView?.updateComplete,t()&&(await af(),t()&&(this.chatView?.restoreScrollPosition(),this.chatView?.focusConversation()))))}shouldAutoFocusPrompt(){return this.appShell.shouldAutoFocusPrompt()}async withChatPrependTransition(e){await e(),await this.updateComplete,await this.chatView?.updateComplete}defaultRouteView(){return this.appShell.defaultRouteView()}updateUrl(e){this.rememberCurrentMachineNavigation(),Ep({machineId:this.state.selectedMachine?.id,projectId:this.state.selectedProject?.id,workspaceId:this.state.selectedWorkspace?.id,sessionId:this.state.selectedSession?.id,tool:this.state.workspaceTool,view:this.state.mainView==="navigation"?void 0:this.state.mainView},e),this.syncWorkspaceRouteSurfaceToUrl()}rememberCurrentMachineNavigation(){this.machineNavigation.remember(dy(this.state))}syncWorkspaceRouteSurfaceToUrl(){this.writeWorkspaceRouteSurfaceToUrl(dy(this.state).surface)}writeMachineNavigationSnapshotToUrl(e,t){Ep(uy(e),t),this.writeWorkspaceRouteSurfaceToUrl(e.surface)}writeWorkspaceRouteSurfaceToUrl(e){ps(lf,"file",e.selectedFilePath,{replace:!0}),ps(cf,"diff",e.selectedDiffPath,{replace:!0}),ps(Gh,"terminal",e.selectedTerminalId,{replace:!0})}async selectMachineWithMemory(e,t={}){if(this.state.selectedMachine?.id===e.id)return;t.rememberCurrent!==!1&&!this.routeRestoreInProgress&&this.rememberCurrentMachineNavigation();const i=++this.machineNavigationRestoreSeq,r=this.machineNavigation.latest(e.id)??cM(e.id);if(await this.restoreRouteFor(uy(r),!1,r.surface,r.view),!(i!==this.machineNavigationRestoreSeq||this.state.selectedMachine?.id!==e.id)){if(this.shouldPreserveUnrestoredMachineNavigation(r)){this.machineNavigation.remember(r),this.writeMachineNavigationSnapshotToUrl(r);return}this.updateUrl()}}shouldPreserveUnrestoredMachineNavigation(e){return e.projectId!==void 0&&this.state.selectedProject?.id!==e.projectId&&this.state.error!==""}openWorkspaceTool(e){e==="core:workspace.terminal"&&(this.terminalAutoStartWorkspaceId=this.state.selectedWorkspace?.id),this.setState({workspaceTool:e,mainView:e}),this.updateUrl(),this.refreshSelectedWorkspaceTool(e),this.git.updatePolling()}openTerminal(e){e?.terminalId!==void 0&&this.selectTerminal(e.terminalId,{replace:!0}),this.openWorkspaceTool("core:workspace.terminal")}terminalCommandRunsForOrigin(e,t=wt(this.state)){const i=Kw(t,e),r=this.terminalCommandRunRuntimes.get(i);if(r!==void 0)return r;const s=UA(e,{api:{runTerminalCommand:(o,a)=>An.runTerminalCommand(o,a,t),listCommandRuns:o=>An.listCommandRuns(o,t),getCommandRun:o=>An.getCommandRun(o,t)},openTerminal:(o,a)=>{this.openRuntimeTerminal(t,o,a)}});return this.terminalCommandRunRuntimes.set(i,s),s}async openRuntimeTerminal(e,t,i){if((wt(this.state)!==e||t!==void 0&&(this.state.selectedWorkspace?.id!==t.id||this.state.selectedProject?.id!==t.projectId))&&(this.routeRestoreInProgress||this.rememberCurrentMachineNavigation(),await this.restoreRouteFor({machineId:e,projectId:t?.projectId,workspaceId:t?.id,sessionId:void 0,tool:"core:workspace.terminal",view:"core:workspace.terminal"},!1,{selectedTerminalId:i?.terminalId},"core:workspace.terminal"),wt(this.state)!==e)){this.setState({error:"Machine not found for terminal command run"});return}this.openTerminal(i)}selectTerminal(e,t){this.rememberSelectedTerminal(e),this.setState({selectedTerminalId:e}),this.rememberCurrentMachineNavigation(),this.writeSelectedTerminalToUrl(e,t)}rememberSelectedTerminal(e){const t=this.state.selectedWorkspace;t!==void 0&&(e===void 0?this.terminalSelection.forgetWorkspace(this.terminalWorkspaceKey(t)):this.terminalSelection.rememberTerminal(this.terminalWorkspaceKey(t),e))}writeSelectedTerminalToUrl(e,t){ps(Gh,"terminal",e,t)}terminalWorkspaceKey(e){return`${wt(this.state)}:${e.path}`}selectMainView(e){if(e!=="navigation"&&e!=="chat"){this.openWorkspaceTool(e);return}this.setState({mainView:e}),this.updateUrl(),this.git.updatePolling()}openSettings(e="general"){this.settingsSection=e,Rp(e)}closeSettings(){this.settingsSection=void 0,Rp(void 0)}navigateSettings(e){this.settingsSection=e,Rp(e)}restoreSettingsRoute(){this.settingsSection=My()}handleWorkspaceChange(e,t){if(e.selectedWorkspace?.id===t.selectedWorkspace?.id)return;this.terminalAutoStartWorkspaceId=void 0,this.activeTerminalIds.clear();const i=this.routeRestoreInProgress?this.restoringRouteTerminalId:t.selectedWorkspace===void 0?void 0:this.terminalSelection.latestTerminalId(this.terminalWorkspaceKey(t.selectedWorkspace));this.setState({activeTerminalCount:0,selectedTerminalId:i}),this.routeRestoreInProgress||(this.rememberCurrentMachineNavigation(),this.writeSelectedTerminalToUrl(i,{replace:!0})),t.selectedWorkspace!==void 0&&(this.refreshActiveTerminals(t.selectedWorkspace),this.refreshWorkspaceDeletionRuns(),this.refreshSelectedWorkspaceTool(t.workspaceTool),this.git.updatePolling())}connectRealtime(){this.realtime.connect(e=>{this.handleRealtimeEvent(e)},()=>{const e=this.state.selectedWorkspace;e!==void 0&&this.refreshActiveTerminals(e),this.refreshWorkspaceActivity()},wt(this.state))}syncMachineActivitySubscriptions(){const e=this.machineActivitySubscriptionIds();for(const[t,i]of this.machineActivitySockets.entries())e.has(t)||(i.close(),this.machineActivitySockets.delete(t));for(const t of e){if(this.machineActivitySockets.has(t))continue;const i=new iy;i.connect(r=>{this.handleMachineActivityEvent(t,r)},()=>{this.refreshWorkspaceActivity(t)},t),this.machineActivitySockets.set(t,i)}}closeMachineActivitySockets(){for(const e of this.machineActivitySockets.values())e.close();this.machineActivitySockets.clear()}machineActivitySubscriptionIds(){const e=wt(this.state);return new Set(this.state.machines.filter(t=>t.id!==e).filter(t=>_tt(t,this.state.machineStatuses[t.id])).map(t=>t.id))}handleMachineActivityEvent(e,t){t.type==="workspace.activity"&&this.activity.applyWorkspaceActivity(t.activity,e)}handleRealtimeEvent(e){e.type==="workspace.activity"?this.activity.applyWorkspaceActivity(e.activity):Ptt(e)?(this.applyTerminalEvent(e),e.type==="terminal.exited"&&this.refreshWorkspaceDeletionRuns()):this.sessions.applyGlobalEvent(e)}applyTerminalEvent(e){const t=this.state.selectedWorkspace;t===void 0||(e.type==="terminal.closed"?e.cwd:e.terminal.cwd)!==t.path||(e.type==="terminal.created"&&!e.terminal.exited?this.activeTerminalIds.add(e.terminal.id):this.activeTerminalIds.delete(e.type==="terminal.closed"?e.terminalId:e.terminal.id),e.type==="terminal.closed"&&(this.terminalSelection.forgetTerminal(e.terminalId),this.state.selectedTerminalId===e.terminalId&&this.selectTerminal(void 0,{replace:!0})),this.setState({activeTerminalCount:this.activeTerminalIds.size}))}async refreshActiveTerminals(e){const t=wt(this.state);try{const i=await An.terminals(e.projectId,e.id,t);if(wt(this.state)!==t||this.state.selectedWorkspace?.id!==e.id)return;this.activeTerminalIds.clear();for(const r of i)r.exited||this.activeTerminalIds.add(r.id);this.setState({activeTerminalCount:this.activeTerminalIds.size})}catch(i){this.setState({error:String(i)})}}handleActivityTransition(e,t){const i=Xw(e),r=Xw(t);i&&!r&&(this.setState({fileTreeStale:!0,gitStale:!0}),this.refreshSelectedWorkspaceTool(this.state.workspaceTool))}handleMachineChange(e,t){if((e.selectedMachine?.id??"local")===(t.selectedMachine?.id??"local"))return;(this.pendingRemoteRouteRestore?.machineId??"local")!==(t.selectedMachine?.id??"local")&&this.clearPendingRemoteRouteRestore(),this.sessions.clearActiveSession(),this.realtime.close(),window.addEventListener("mousemove",this.onWindowMouseMove,{passive:!0,capture:!0}),document.addEventListener("pointermove",this.onWindowMouseMove,{passive:!0,capture:!0}),this.connectRealtime(),this.activeTerminalIds.clear(),this.sessionCleanupDialog=void 0,this.setState({ompWebStatus:void 0}),this.git.updatePolling(),this.loadPluginsForSelectedMachine()}refreshSelectedWorkspaceTool(e){e==="core:workspace.files"&&this.files.refreshFiles(),e==="core:workspace.git"&&this.git.refreshGit()}renderWorkspacePanel(){const e=this.state.selectedWorkspace,t=e===void 0?void 0:this.createWorkspacePanelContext(e),i=e===void 0?this.workspacePanelEmptyState():void 0;return T`
5517
5525
  <workspace-panel
5518
5526
  id="workspace-panel"
5519
5527
  .workspace=${e}
@@ -5559,7 +5567,7 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5559
5567
  .onResizeEnd=${()=>{this.panelResize.persistPanelSizes()}}
5560
5568
  .onReset=${()=>{this.resetResizablePanel("workspace")}}
5561
5569
  ></app-panel-edge-control>
5562
- `}startPanelResize(e){return e==="navigation"?this.panelCollapse.expandNavigationPanel():this.panelCollapse.expandWorkspacePanel(),this.measuredPanelWidth(e)??this.panelResize.panelWidth(e)}resizablePanelConstraints(e){const t=this.panelResize.constraints(e);return{...t,maxWidth:this.resizablePanelMaxWidth(e,t)}}resizablePanelMaxWidth(e,t){const i=this.getBoundingClientRect().width||(typeof window>"u"?0:window.innerWidth);if(i<=0)return t.maxWidth;const r=this.oppositeResizablePanelWidth(e),s=Math.floor(i-r-Wtt-Ntt);return Math.max(t.minWidth,Math.min(t.maxWidth,s))}oppositeResizablePanelWidth(e){const t=e==="navigation"?"workspace":"navigation";return this.isResizablePanelCollapsedOrStacked(t)?0:this.measuredPanelWidth(t)??this.panelResize.panelWidth(t)}isResizablePanelCollapsedOrStacked(e){return e==="navigation"?this.panelCollapse.navigationPanelCollapsed:this.panelCollapse.workspacePanelCollapsed||!this.isDesktopSideBySideLayout()}isDesktopSideBySideLayout(){return typeof window>"u"||!("matchMedia"in window)?!0:window.matchMedia(qtt).matches}measuredPanelWidth(e){const i=(e==="navigation"?this.navigationPanelFrame:this.workspacePanelFrame)?.getBoundingClientRect().width;return i===void 0||i<=0?void 0:i}resetResizablePanel(e){this.panelResize.resetPanel(e)}resetResizablePanels(){this.panelResize.resetPanels()}canDeleteArchivedSessions(){const e=this.selectedMachineRuntime();return e?.ok===!0&&vs(e,Kr.sessionsDeleteArchived)}canReloadSessions(){const e=this.selectedMachineRuntime();return e?.ok===!0&&vs(e,Kr.sessionsReload)}canCleanupSessions(){const e=this.selectedMachineRuntime();return e?.ok===!0&&vs(e,Kr.sessionsCleanup)}supportsWorkspaceFileSuggestions(e=wt(this.state)){if(e==="local")return!0;const t=this.state.machineRuntimes[e];return t?.ok===!0&&vs(t,Kr.workspaceFileSuggestions)}archivedDeleteUnavailableMessage(){return`Update and restart Omp-Web on ${this.state.selectedMachine?.name??"this machine"} to delete archived sessions.`}sessionCleanupUnavailableMessage(){return LM(this.state.selectedMachine?.name)}selectedMachineRuntime(){return this.state.machineRuntimes[wt(this.state)]}openSessionCleanupDialog(){this.sessionCleanupDialog={error:""}}closeSessionCleanupDialog(){this.sessionCleanupDialog=void 0}async previewSessionCleanup(e){if(!this.canCleanupSessions()){this.sessionCleanupDialog={...this.sessionCleanupDialog??{},error:this.sessionCleanupUnavailableMessage(),preview:void 0,previewRequest:void 0,result:void 0,loading:!1};return}const t=wt(this.state);this.sessionCleanupDialog={...this.sessionCleanupDialog??{},loading:!0,error:"",preview:void 0,previewRequest:void 0,result:void 0};try{const i=await df.cleanupPreview(e,t);if(wt(this.state)!==t)return;this.sessionCleanupDialog={...this.sessionCleanupDialog,preview:i,previewRequest:e,result:void 0,loading:!1,error:""}}catch(i){wt(this.state)===t&&(this.sessionCleanupDialog={...this.sessionCleanupDialog,loading:!1,error:`Failed to preview cleanup: ${Je(i)}`})}}async runSessionCleanup(e){const t=this.sessionCleanupDialog;if(t?.preview===void 0||Jn(t.previewRequest)!==Jn(e)){this.sessionCleanupDialog={...t??{},error:"Preview cleanup before running it."};return}if(!this.canCleanupSessions()){this.sessionCleanupDialog={...t,error:this.sessionCleanupUnavailableMessage(),running:!1};return}const i=wt(this.state);this.sessionCleanupDialog={...t,running:!0,error:""};try{const r=await df.cleanup(e,i);if(wt(this.state)!==i)return;this.sessionCleanupDialog={...this.sessionCleanupDialog,preview:r,previewRequest:e,result:r,running:!1,error:""},await this.sessions.applySessionCleanupResult(r,i)}catch(r){wt(this.state)===i&&(this.sessionCleanupDialog={...this.sessionCleanupDialog,running:!1,error:`Failed to run cleanup: ${Je(r)}`})}}renderNavigationPanel(){return T`
5570
+ `}startPanelResize(e){return e==="navigation"?this.panelCollapse.expandNavigationPanel():this.panelCollapse.expandWorkspacePanel(),this.measuredPanelWidth(e)??this.panelResize.panelWidth(e)}resizablePanelConstraints(e){const t=this.panelResize.constraints(e);return{...t,maxWidth:this.resizablePanelMaxWidth(e,t)}}resizablePanelMaxWidth(e,t){const i=this.getBoundingClientRect().width||(typeof window>"u"?0:window.innerWidth);if(i<=0)return t.maxWidth;const r=this.oppositeResizablePanelWidth(e),s=Math.floor(i-r-qtt-Wtt);return Math.max(t.minWidth,Math.min(t.maxWidth,s))}oppositeResizablePanelWidth(e){const t=e==="navigation"?"workspace":"navigation";return this.isResizablePanelCollapsedOrStacked(t)?0:this.measuredPanelWidth(t)??this.panelResize.panelWidth(t)}isResizablePanelCollapsedOrStacked(e){return e==="navigation"?this.panelCollapse.navigationPanelCollapsed:this.panelCollapse.workspacePanelCollapsed||!this.isDesktopSideBySideLayout()}isDesktopSideBySideLayout(){return typeof window>"u"||!("matchMedia"in window)?!0:window.matchMedia(Htt).matches}measuredPanelWidth(e){const i=(e==="navigation"?this.navigationPanelFrame:this.workspacePanelFrame)?.getBoundingClientRect().width;return i===void 0||i<=0?void 0:i}resetResizablePanel(e){this.panelResize.resetPanel(e)}resetResizablePanels(){this.panelResize.resetPanels()}canDeleteArchivedSessions(){const e=this.selectedMachineRuntime();return e?.ok===!0&&vs(e,Kr.sessionsDeleteArchived)}canReloadSessions(){const e=this.selectedMachineRuntime();return e?.ok===!0&&vs(e,Kr.sessionsReload)}canCleanupSessions(){const e=this.selectedMachineRuntime();return e?.ok===!0&&vs(e,Kr.sessionsCleanup)}supportsWorkspaceFileSuggestions(e=wt(this.state)){if(e==="local")return!0;const t=this.state.machineRuntimes[e];return t?.ok===!0&&vs(t,Kr.workspaceFileSuggestions)}archivedDeleteUnavailableMessage(){return`Update and restart Omp-Web on ${this.state.selectedMachine?.name??"this machine"} to delete archived sessions.`}sessionCleanupUnavailableMessage(){return LM(this.state.selectedMachine?.name)}selectedMachineRuntime(){return this.state.machineRuntimes[wt(this.state)]}openSessionCleanupDialog(){this.sessionCleanupDialog={error:""}}closeSessionCleanupDialog(){this.sessionCleanupDialog=void 0}async previewSessionCleanup(e){if(!this.canCleanupSessions()){this.sessionCleanupDialog={...this.sessionCleanupDialog??{},error:this.sessionCleanupUnavailableMessage(),preview:void 0,previewRequest:void 0,result:void 0,loading:!1};return}const t=wt(this.state);this.sessionCleanupDialog={...this.sessionCleanupDialog??{},loading:!0,error:"",preview:void 0,previewRequest:void 0,result:void 0};try{const i=await df.cleanupPreview(e,t);if(wt(this.state)!==t)return;this.sessionCleanupDialog={...this.sessionCleanupDialog,preview:i,previewRequest:e,result:void 0,loading:!1,error:""}}catch(i){wt(this.state)===t&&(this.sessionCleanupDialog={...this.sessionCleanupDialog,loading:!1,error:`Failed to preview cleanup: ${Je(i)}`})}}async runSessionCleanup(e){const t=this.sessionCleanupDialog;if(t?.preview===void 0||Jn(t.previewRequest)!==Jn(e)){this.sessionCleanupDialog={...t??{},error:"Preview cleanup before running it."};return}if(!this.canCleanupSessions()){this.sessionCleanupDialog={...t,error:this.sessionCleanupUnavailableMessage(),running:!1};return}const i=wt(this.state);this.sessionCleanupDialog={...t,running:!0,error:""};try{const r=await df.cleanup(e,i);if(wt(this.state)!==i)return;this.sessionCleanupDialog={...this.sessionCleanupDialog,preview:r,previewRequest:e,result:r,running:!1,error:""},await this.sessions.applySessionCleanupResult(r,i)}catch(r){wt(this.state)===i&&(this.sessionCleanupDialog={...this.sessionCleanupDialog,running:!1,error:`Failed to run cleanup: ${Je(r)}`})}}renderNavigationPanel(){return T`
5563
5571
  <app-navigation-panel
5564
5572
  .machines=${this.state.machines}
5565
5573
  .selectedMachine=${this.state.selectedMachine}
@@ -5625,9 +5633,9 @@ ${e}`:e;this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,in
5625
5633
  This will run git worktree remove and delete:
5626
5634
  ${e.path}
5627
5635
 
5628
- The Git branch will not be deleted.`))return;const r=wt(this.state);try{const s=await kn.deleteWorkspace(e.projectId,e.id,r);if(wt(this.state)!==r)return;this.recordWorkspaceDeletionRun(s,r);const o=await this.workspaceForCommandRun(s);if(wt(this.state)!==r)return;o!==void 0&&this.openRuntimeTerminal(r,o,{terminalId:s.terminalId})}catch(s){wt(this.state)===r&&this.setState({error:`Failed to start workspace deletion: ${Je(s)}`})}}async workspaceForCommandRun(e){let t=this.state.selectedProject?.id===e.projectId?this.state.workspaces:this.state.workspacesByProjectId[e.projectId];return(t===void 0||t.length===0)&&(t=await this.workspaces.refreshProjectWorkspaces(e.projectId)),t.find(i=>i.id===e.workspaceId)}recordWorkspaceDeletionRun(e,t){if(wt(this.state)!==t)return;const i=yf(e);i!==void 0&&(this.setState({workspaceDeletionRuns:{...this.state.workspaceDeletionRuns,[i]:e}}),this.updateWorkspaceDeletionPolling())}async refreshWorkspaceDeletionRuns(){if(this.refreshingWorkspaceDeletionRuns)return;const e=wt(this.state),t=this.state.selectedProject;if(t===void 0){this.setState({workspaceDeletionRuns:{}}),this.updateWorkspaceDeletionPolling();return}this.refreshingWorkspaceDeletionRuns=!0;try{const i=await this.terminalCommandRunsForOrigin("core",e).listCommandRuns(QA(t.id));if(wt(this.state)!==e)return;const r=JA(i);this.setState({workspaceDeletionRuns:r});for(const s of Object.values(r))_d(s)||await this.handleCompletedWorkspaceDeletionRun(s,e)}catch(i){console.warn("Failed to refresh workspace deletion runs",i)}finally{this.refreshingWorkspaceDeletionRuns=!1,this.updateWorkspaceDeletionPolling()}}updateWorkspaceDeletionPolling(){const e=Object.values(this.state.workspaceDeletionRuns).some(_d);if(e&&this.workspaceDeletionPollTimer===void 0){this.workspaceDeletionPollTimer=window.setInterval(()=>{this.refreshWorkspaceDeletionRuns()},1e3);return}!e&&this.workspaceDeletionPollTimer!==void 0&&(window.clearInterval(this.workspaceDeletionPollTimer),this.workspaceDeletionPollTimer=void 0)}async handleCompletedWorkspaceDeletionRun(e,t=wt(this.state)){if(wt(this.state)!==t)return;const i=Kw(t,e.id);if(this.handledWorkspaceDeletionRunIds.has(i))return;const r=yf(e);if(r!==void 0){if(this.handledWorkspaceDeletionRunIds.add(i),e.status==="succeeded"){if(await this.workspaces.refreshAfterWorkspaceDeleted(e.projectId,r),wt(this.state)!==t)return;this.setState({workspaceDeletionRuns:Ett(this.state.workspaceDeletionRuns,r)}),this.updateWorkspaceDeletionPolling();return}e.status==="failed"&&(this.setState({error:"Workspace deletion failed. See terminal output."}),this.updateWorkspaceDeletionPolling())}}openMachineDialog(){this.setState({machineDialogOpen:!0,error:""})}async submitMachineDialog(e){await this.machines.addMachine(e)!==void 0&&(this.setState({machineDialogOpen:!1}),this.scheduleOmpWebStatusRefresh())}async removeMachine(e=this.state.selectedMachine){if(e===void 0||e.kind==="local"||!window.confirm(`Remove ${e.name}?
5636
+ The Git branch will not be deleted.`))return;const r=wt(this.state);try{const s=await kn.deleteWorkspace(e.projectId,e.id,r);if(wt(this.state)!==r)return;this.recordWorkspaceDeletionRun(s,r);const o=await this.workspaceForCommandRun(s);if(wt(this.state)!==r)return;o!==void 0&&this.openRuntimeTerminal(r,o,{terminalId:s.terminalId})}catch(s){wt(this.state)===r&&this.setState({error:`Failed to start workspace deletion: ${Je(s)}`})}}async workspaceForCommandRun(e){let t=this.state.selectedProject?.id===e.projectId?this.state.workspaces:this.state.workspacesByProjectId[e.projectId];return(t===void 0||t.length===0)&&(t=await this.workspaces.refreshProjectWorkspaces(e.projectId)),t.find(i=>i.id===e.workspaceId)}recordWorkspaceDeletionRun(e,t){if(wt(this.state)!==t)return;const i=yf(e);i!==void 0&&(this.setState({workspaceDeletionRuns:{...this.state.workspaceDeletionRuns,[i]:e}}),this.updateWorkspaceDeletionPolling())}async refreshWorkspaceDeletionRuns(){if(this.refreshingWorkspaceDeletionRuns)return;const e=wt(this.state),t=this.state.selectedProject;if(t===void 0){this.setState({workspaceDeletionRuns:{}}),this.updateWorkspaceDeletionPolling();return}this.refreshingWorkspaceDeletionRuns=!0;try{const i=await this.terminalCommandRunsForOrigin("core",e).listCommandRuns(QA(t.id));if(wt(this.state)!==e)return;const r=JA(i);this.setState({workspaceDeletionRuns:r});for(const s of Object.values(r))_d(s)||await this.handleCompletedWorkspaceDeletionRun(s,e)}catch(i){console.warn("Failed to refresh workspace deletion runs",i)}finally{this.refreshingWorkspaceDeletionRuns=!1,this.updateWorkspaceDeletionPolling()}}updateWorkspaceDeletionPolling(){const e=Object.values(this.state.workspaceDeletionRuns).some(_d);if(e&&this.workspaceDeletionPollTimer===void 0){this.workspaceDeletionPollTimer=window.setInterval(()=>{this.refreshWorkspaceDeletionRuns()},1e3);return}!e&&this.workspaceDeletionPollTimer!==void 0&&(window.clearInterval(this.workspaceDeletionPollTimer),this.workspaceDeletionPollTimer=void 0)}async handleCompletedWorkspaceDeletionRun(e,t=wt(this.state)){if(wt(this.state)!==t)return;const i=Kw(t,e.id);if(this.handledWorkspaceDeletionRunIds.has(i))return;const r=yf(e);if(r!==void 0){if(this.handledWorkspaceDeletionRunIds.add(i),e.status==="succeeded"){if(await this.workspaces.refreshAfterWorkspaceDeleted(e.projectId,r),wt(this.state)!==t)return;this.setState({workspaceDeletionRuns:Rtt(this.state.workspaceDeletionRuns,r)}),this.updateWorkspaceDeletionPolling();return}e.status==="failed"&&(this.setState({error:"Workspace deletion failed. See terminal output."}),this.updateWorkspaceDeletionPolling())}}openMachineDialog(){this.setState({machineDialogOpen:!0,error:""})}async submitMachineDialog(e){await this.machines.addMachine(e)!==void 0&&(this.setState({machineDialogOpen:!1}),this.scheduleOmpWebStatusRefresh())}async removeMachine(e=this.state.selectedMachine){if(e===void 0||e.kind==="local"||!window.confirm(`Remove ${e.name}?
5629
5637
 
5630
- This only removes it from this PI WEB gateway.`))return;const t=this.state.selectedMachine?.id===e.id;t&&this.rememberCurrentMachineNavigation();const i=await this.machines.deleteMachine(e,{selectFallback:!t});this.state.machines.some(r=>r.id===e.id)||this.machineNavigation.forget(e.id),t&&i!==void 0&&await this.selectMachineWithMemory(i,{rememberCurrent:!1})}openSelectedMachine(){const e=this.state.selectedMachine;e?.kind!=="remote"||e.baseUrl===void 0||window.open(e.baseUrl,"_blank","noopener,noreferrer")}runAction(e){Promise.resolve().then(()=>e.run()).catch(t=>{const i=t instanceof Error?t.message:String(t);console.warn(`Action failed: ${e.id}`,t),this.setState({error:`Action failed: ${i}`})})}async openModelDialog(){const e=await this.sessions.listModels(),t=this.state.status?.model?.provider,i=this.state.status?.model?.id;this.setState({modelDialog:{title:"Select Model",...t!==void 0&&i!==void 0?{selectedValue:`${t}/${i}`}:{},options:(()=>{const r=e.map(s=>{const o=s.provider??"",a=s.id??"",n=qK(o,a),l=o===t&&a===i;return{provider:o,id:a,info:n,option:{value:`${o}/${a}`,label:`${a}${l?" ✓ current":""}`,description:o,category:n.category,icon:n.icon}}});return r.sort((s,o)=>s.info.priority!==o.info.priority?s.info.priority-o.info.priority:s.info.category!==o.info.category?s.info.category.localeCompare(o.info.category):s.id.localeCompare(o.id)),r.map(s=>s.option)})()}})}pickModel(e){this.setState({modelDialog:void 0});const t=e.indexOf("/");if(t<=0)return;const i=e.slice(0,t),r=e.slice(t+1);this.setState({modelActionDialog:{title:`${i}/${r}`,selectedValue:`default:${i}/${r}`,options:[{value:`default:${i}/${r}`,label:"Definir como padrão",description:"Salva como modelo padrão para todas as novas sessões (config.yml)"},{value:`session:${i}/${r}`,label:"Apenas nesta sessão",description:"Altera o modelo somente na conversa atual"}]}})}async pickModelAction(e){this.setState({modelActionDialog:void 0});const t=e.indexOf(":");if(t<=0)return;const i=e.slice(0,t),r=e.slice(t+1),s=r.indexOf("/");if(s<=0)return;const o=r.slice(0,s),a=r.slice(s+1),n=i==="default";await this.sessions.setModel(o,a,n)}openThemeDialog(){const e=this.plugins.getThemes(),t=this.resolveCurrentThemePreference(e),i=t.selectedTheme?.id,r=this.themePreference.auto?Qw:nf;this.setState({themeDialog:{title:"Select Theme",selectedValue:i===void 0?r:`${Yh}${i}`,options:[{value:r,label:`Auto ${this.themePreference.auto?"✓ on":"off"}`,description:this.autoThemeDescription(t)},...e.map(s=>({value:`${Yh}${s.id}`,label:this.themeOptionLabel(s,i),description:this.themeOptionDescription(s)}))]}})}pickTheme(e){if(this.setState({themeDialog:void 0}),e===nf||e===Qw){const r=this.resolveCurrentThemePreference().selectedTheme?.id;if(r===void 0)return;this.themePreference={themeId:r,auto:e===nf},this.applyPreferredTheme(!0);return}if(!e.startsWith(Yh))return;const t=e.slice(Yh.length),i=this.plugins.getThemes().find(r=>r.id===t);i!==void 0&&(this.themePreference={themeId:i.id,auto:this.themePreference.auto},this.applyPreferredTheme(!0))}applyPreferredTheme(e){const t=this.resolveCurrentThemePreference().activeTheme;t!==void 0&&(this.activeThemeId=t.id,FM(t),e&&DM(this.themePreference))}resolveCurrentThemePreference(e=this.plugins.getThemes()){return OM({themes:e,themePairs:this.plugins.getThemePairs(),preference:this.themePreference,prefersLight:this.systemPrefersLight()})}themePairForTheme(e){return Wk(this.plugins.getThemePairs(),e)}systemPrefersLight(){return this.systemLightThemeMedia?.matches??!1}autoThemeDescription(e){return!this.themePreference.auto||e.selectedTheme===void 0?"Follow the system light/dark preference when the selected theme has a pair.":e.selectedThemePair===void 0?"On, but the selected theme has no light/dark pair, so it will stay selected.":`On · ${e.selectedThemePair.name} follows the system ${this.systemPrefersLight()?"light":"dark"} preference.`}themeOptionLabel(e,t){const i=[...e.id===t?["selected"]:[],...e.id===this.activeThemeId&&e.id!==t?["active"]:[]];return i.length===0?e.name:`${e.name} ✓ ${i.join(" · ")}`}themeOptionDescription(e){const t=[e.colorScheme];return this.themePairForTheme(e.id)!==void 0&&t.push("auto pair"),e.description!==void 0&&t.push(e.description),t.join(" · ")}async openThinkingDialog(){const e=await this.sessions.listThinkingLevels(),t=this.state.status?.thinkingLevel??"off";this.setState({thinkingDialog:{title:"Select Thinking Level",selectedValue:t,options:e.map(i=>{const r=Rtt(i);return{value:i,label:`${i}${i===t?" ✓ current":""}`,...r===void 0?{}:{description:r}}})}})}async pickThinking(e){this.setState({thinkingDialog:void 0}),e!==""&&await this.sessions.setThinkingLevel(e)}handleClientSlashCommand(e){if(this.auth.handleSlashCommand(e))return!0;const t=e.trim();if(!t.startsWith("/"))return!1;const[i=""]=t.slice(1).split(/\s+/),r=i.toLowerCase();return r==="model"?(this.openModelDialog(),!0):r==="settings"?(this.openSettings("general"),!0):r==="theme"?(this.openThemeDialog(),!0):r==="new"?(this.startSessionAndOpenChat(),!0):r==="hotkeys"?(this.openSettings("shortcuts"),!0):!1}sendPrompt(e,t,i,r){!(i!==void 0&&i.length>0)&&t===void 0&&this.handleClientSlashCommand(e)||this.sessions.send(e,t,i,r)}renderContextBar(){return null}renderMobileMainTabs(){return T`
5638
+ This only removes it from this PI WEB gateway.`))return;const t=this.state.selectedMachine?.id===e.id;t&&this.rememberCurrentMachineNavigation();const i=await this.machines.deleteMachine(e,{selectFallback:!t});this.state.machines.some(r=>r.id===e.id)||this.machineNavigation.forget(e.id),t&&i!==void 0&&await this.selectMachineWithMemory(i,{rememberCurrent:!1})}openSelectedMachine(){const e=this.state.selectedMachine;e?.kind!=="remote"||e.baseUrl===void 0||window.open(e.baseUrl,"_blank","noopener,noreferrer")}runAction(e){Promise.resolve().then(()=>e.run()).catch(t=>{const i=t instanceof Error?t.message:String(t);console.warn(`Action failed: ${e.id}`,t),this.setState({error:`Action failed: ${i}`})})}async openModelDialog(){const e=await this.sessions.listModels(),t=this.state.status?.model?.provider,i=this.state.status?.model?.id;this.setState({modelDialog:{title:"Select Model",...t!==void 0&&i!==void 0?{selectedValue:`${t}/${i}`}:{},options:(()=>{const r=e.map(s=>{const o=s.provider??"",a=s.id??"",n=qK(o,a),l=o===t&&a===i;return{provider:o,id:a,info:n,option:{value:`${o}/${a}`,label:`${a}${l?" ✓ current":""}`,description:o,category:n.category,icon:n.icon}}});return r.sort((s,o)=>s.info.priority!==o.info.priority?s.info.priority-o.info.priority:s.info.category!==o.info.category?s.info.category.localeCompare(o.info.category):s.id.localeCompare(o.id)),r.map(s=>s.option)})()}})}pickModel(e){this.setState({modelDialog:void 0});const t=e.indexOf("/");if(t<=0)return;const i=e.slice(0,t),r=e.slice(t+1);this.setState({modelActionDialog:{title:`${i}/${r}`,selectedValue:`default:${i}/${r}`,options:[{value:`default:${i}/${r}`,label:"Definir como padrão",description:"Salva como modelo padrão para todas as novas sessões (config.yml)"},{value:`session:${i}/${r}`,label:"Apenas nesta sessão",description:"Altera o modelo somente na conversa atual"}]}})}async pickModelAction(e){this.setState({modelActionDialog:void 0});const t=e.indexOf(":");if(t<=0)return;const i=e.slice(0,t),r=e.slice(t+1),s=r.indexOf("/");if(s<=0)return;const o=r.slice(0,s),a=r.slice(s+1),n=i==="default";await this.sessions.setModel(o,a,n)}openThemeDialog(){const e=this.plugins.getThemes(),t=this.resolveCurrentThemePreference(e),i=t.selectedTheme?.id,r=this.themePreference.auto?Qw:nf;this.setState({themeDialog:{title:"Select Theme",selectedValue:i===void 0?r:`${Yh}${i}`,options:[{value:r,label:`Auto ${this.themePreference.auto?"✓ on":"off"}`,description:this.autoThemeDescription(t)},...e.map(s=>({value:`${Yh}${s.id}`,label:this.themeOptionLabel(s,i),description:this.themeOptionDescription(s)}))]}})}pickTheme(e){if(this.setState({themeDialog:void 0}),e===nf||e===Qw){const r=this.resolveCurrentThemePreference().selectedTheme?.id;if(r===void 0)return;this.themePreference={themeId:r,auto:e===nf},this.applyPreferredTheme(!0);return}if(!e.startsWith(Yh))return;const t=e.slice(Yh.length),i=this.plugins.getThemes().find(r=>r.id===t);i!==void 0&&(this.themePreference={themeId:i.id,auto:this.themePreference.auto},this.applyPreferredTheme(!0))}applyPreferredTheme(e){const t=this.resolveCurrentThemePreference().activeTheme;t!==void 0&&(this.activeThemeId=t.id,FM(t),e&&DM(this.themePreference))}resolveCurrentThemePreference(e=this.plugins.getThemes()){return OM({themes:e,themePairs:this.plugins.getThemePairs(),preference:this.themePreference,prefersLight:this.systemPrefersLight()})}themePairForTheme(e){return Wk(this.plugins.getThemePairs(),e)}systemPrefersLight(){return this.systemLightThemeMedia?.matches??!1}autoThemeDescription(e){return!this.themePreference.auto||e.selectedTheme===void 0?"Follow the system light/dark preference when the selected theme has a pair.":e.selectedThemePair===void 0?"On, but the selected theme has no light/dark pair, so it will stay selected.":`On · ${e.selectedThemePair.name} follows the system ${this.systemPrefersLight()?"light":"dark"} preference.`}themeOptionLabel(e,t){const i=[...e.id===t?["selected"]:[],...e.id===this.activeThemeId&&e.id!==t?["active"]:[]];return i.length===0?e.name:`${e.name} ✓ ${i.join(" · ")}`}themeOptionDescription(e){const t=[e.colorScheme];return this.themePairForTheme(e.id)!==void 0&&t.push("auto pair"),e.description!==void 0&&t.push(e.description),t.join(" · ")}async openThinkingDialog(){const e=await this.sessions.listThinkingLevels(),t=this.state.status?.thinkingLevel??"off";this.setState({thinkingDialog:{title:"Select Thinking Level",selectedValue:t,options:e.map(i=>{const r=Itt(i);return{value:i,label:`${i}${i===t?" ✓ current":""}`,...r===void 0?{}:{description:r}}})}})}async pickThinking(e){this.setState({thinkingDialog:void 0}),e!==""&&await this.sessions.setThinkingLevel(e)}handleClientSlashCommand(e){if(this.auth.handleSlashCommand(e))return!0;const t=e.trim();if(!t.startsWith("/"))return!1;const[i=""]=t.slice(1).split(/\s+/),r=i.toLowerCase();return r==="model"?(this.openModelDialog(),!0):r==="settings"?(this.openSettings("general"),!0):r==="theme"?(this.openThemeDialog(),!0):r==="new"?(this.startSessionAndOpenChat(),!0):r==="hotkeys"?(this.openSettings("shortcuts"),!0):!1}sendPrompt(e,t,i,r){!(i!==void 0&&i.length>0)&&t===void 0&&this.handleClientSlashCommand(e)||this.sessions.send(e,t,i,r)}renderContextBar(){return null}renderMobileMainTabs(){return T`
5631
5639
  <app-mobile-main-tabs
5632
5640
  ?bottom=${!0}
5633
5641
  .tabs=${this.mobileMainTabs()}
@@ -5686,4 +5694,4 @@ This only removes it from this PI WEB gateway.`))return;const t=this.state.selec
5686
5694
  ${this.renderWorkspacePanel()}
5687
5695
  ${this.renderModals(e)}
5688
5696
  </div>
5689
- `}};sr.styles=hB;Pr([Ct()],sr.prototype,"state",2);Pr([ui("chat-view")],sr.prototype,"chatView",2);Pr([ui("prompt-editor")],sr.prototype,"promptEditor",2);Pr([Ct()],sr.prototype,"chatPreferences",2);Pr([ui("app-navigation-panel")],sr.prototype,"navigationPanel",2);Pr([ui("#navigation-panel")],sr.prototype,"navigationPanelFrame",2);Pr([ui("#workspace-panel")],sr.prototype,"workspacePanelFrame",2);Pr([Ct()],sr.prototype,"activeThemeId",2);Pr([Ct()],sr.prototype,"isRefreshingApp",2);Pr([Ct()],sr.prototype,"sessionCleanupDialog",2);Pr([Ct()],sr.prototype,"settingsSection",2);Pr([Ct()],sr.prototype,"shortcutConfig",2);Pr([Ct()],sr.prototype,"workspaceUploadDefaultFolder",2);sr=Pr([Ae("omp-web-app")],sr);export{TD as $,wP as A,uet as B,AF as C,Get as D,m1 as E,Xet as F,oa as G,TF as H,SC as I,dz as J,k_ as K,ei as L,BP as M,o1 as N,fm as O,$D as P,lz as Q,SL as R,Wz as S,Cc as T,het as U,qu as V,cP as W,B4 as X,ax as Y,bD as Z,b as _,SP as a,OS as a$,qc as a0,Mr as a1,st as a2,at as a3,bP as a4,L4 as a5,VI as a6,$x as a7,Tx as a8,wet as a9,oit as aA,iu as aB,eN as aC,xe as aD,Kc as aE,Ui as aF,ee as aG,we as aH,T as aI,_e as aJ,P as aK,ui as aL,Ae as aM,CF as aN,JI as aO,Qm as aP,Km as aQ,ad as aR,eD as aS,tD as aT,Jz as aU,Qz as aV,jz as aW,FS as aX,Gz as aY,Hz as aZ,Kz as a_,met as aa,xet as ab,yet as ac,fet as ad,Am as ae,vet as af,get as ag,dn as ah,Cet as ai,ket as aj,bet as ak,VO as al,d3 as am,eit as an,ge as ao,Ys as ap,ml as aq,Fz as ar,r1 as as,Nt as at,Qi as au,RN as av,tit as aw,sit as ax,rit as ay,lN as az,kP as b,Yz as b0,sD as b1,rD as b2,iD as b3,aD as b4,oD as b5,Uz as b6,NS as b7,Zz as b8,Vz as b9,BR as bA,jt as bB,PS as bC,Cr as bD,kR as bE,Sm as bF,U4 as bG,Uc as bH,X4 as bI,pet as bJ,M_ as bK,Yt as bL,Jet as bM,uC as bN,Xz as ba,WS as bb,pz as bc,iN as bd,XS as be,ls as bf,d4 as bg,KI as bh,cet as bi,An as bj,iet as bk,ret as bl,eet as bm,ki as bn,Ct as bo,aet as bp,S_ as bq,fc as br,iit as bs,Jv as bt,qr as bu,Dz as bv,Cm as bw,Qo as bx,Mc as by,xx as bz,ye as c,_4 as d,yi as e,To as f,TP as g,h3 as h,Dt as i,es as j,me as k,vt as l,Hc as m,KS as n,det as o,nit as p,$P as q,ait as r,CP as s,MP as t,xs as u,uz as v,BD as w,zO as x,Det as y,tl as z};
5697
+ `}};sr.styles=hB;Pr([Ct()],sr.prototype,"state",2);Pr([ui("chat-view")],sr.prototype,"chatView",2);Pr([ui("prompt-editor")],sr.prototype,"promptEditor",2);Pr([Ct()],sr.prototype,"chatPreferences",2);Pr([ui("app-navigation-panel")],sr.prototype,"navigationPanel",2);Pr([ui("#navigation-panel")],sr.prototype,"navigationPanelFrame",2);Pr([ui("#workspace-panel")],sr.prototype,"workspacePanelFrame",2);Pr([Ct()],sr.prototype,"activeThemeId",2);Pr([Ct()],sr.prototype,"isRefreshingApp",2);Pr([Ct()],sr.prototype,"sessionCleanupDialog",2);Pr([Ct()],sr.prototype,"settingsSection",2);Pr([Ct()],sr.prototype,"shortcutConfig",2);Pr([Ct()],sr.prototype,"workspaceUploadDefaultFolder",2);sr=Pr([Ae("omp-web-app")],sr);export{TD as $,wP as A,pet as B,AF as C,Xet as D,m1 as E,Vet as F,oa as G,TF as H,SC as I,dz as J,k_ as K,ei as L,BP as M,o1 as N,fm as O,$D as P,lz as Q,SL as R,Wz as S,Cc as T,det as U,qu as V,cP as W,B4 as X,ax as Y,bD as Z,b as _,SP as a,OS as a$,qc as a0,Mr as a1,st as a2,at as a3,bP as a4,L4 as a5,VI as a6,$x as a7,Tx as a8,ket as a9,ait as aA,iu as aB,eN as aC,xe as aD,Kc as aE,Ui as aF,ee as aG,we as aH,T as aI,_e as aJ,P as aK,ui as aL,Ae as aM,CF as aN,JI as aO,Qm as aP,Km as aQ,ad as aR,eD as aS,tD as aT,Jz as aU,Qz as aV,jz as aW,FS as aX,Gz as aY,Hz as aZ,Kz as a_,bet as aa,vet as ab,xet as ac,get as ad,Am as ae,wet as af,met as ag,dn as ah,Tet as ai,Cet as aj,yet as ak,VO as al,d3 as am,iit as an,ge as ao,Ys as ap,ml as aq,Fz as ar,r1 as as,Nt as at,Qi as au,RN as av,eit as aw,oit as ax,sit as ay,lN as az,kP as b,Yz as b0,sD as b1,rD as b2,iD as b3,aD as b4,oD as b5,Uz as b6,NS as b7,Zz as b8,Vz as b9,BR as bA,jt as bB,PS as bC,Cr as bD,kR as bE,Sm as bF,U4 as bG,Uc as bH,X4 as bI,fet as bJ,M_ as bK,Yt as bL,tit as bM,uC as bN,Xz as ba,WS as bb,pz as bc,iN as bd,XS as be,ls as bf,d4 as bg,KI as bh,het as bi,An as bj,ret as bk,set as bl,iet as bm,ki as bn,Ct as bo,net as bp,S_ as bq,fc as br,rit as bs,Jv as bt,qr as bu,Dz as bv,Cm as bw,Qo as bx,Mc as by,xx as bz,ye as c,_4 as d,yi as e,To as f,TP as g,h3 as h,Dt as i,es as j,me as k,vt as l,Hc as m,KS as n,uet as o,lit as p,$P as q,nit as r,CP as s,MP as t,xs as u,uz as v,BD as w,zO as x,Fet as y,tl as z};