@shaykec/bridge 0.4.19 → 0.4.20

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 (58) hide show
  1. package/canvas-dist/assets/{_basePickBy-BOTBlJNd.js → _basePickBy-CWoeT3J7.js} +1 -1
  2. package/canvas-dist/assets/{_baseUniq-EF6Y2_Wm.js → _baseUniq-Dtuvtwtn.js} +1 -1
  3. package/canvas-dist/assets/{arc-C_vIirh2.js → arc-YYWnrNJU.js} +1 -1
  4. package/canvas-dist/assets/{architectureDiagram-VXUJARFQ-EvM6tQ7I.js → architectureDiagram-VXUJARFQ-CegbV-RR.js} +1 -1
  5. package/canvas-dist/assets/{blockDiagram-VD42YOAC-B_rbZyqc.js → blockDiagram-VD42YOAC-C2e_j6ry.js} +1 -1
  6. package/canvas-dist/assets/{c4Diagram-YG6GDRKO-J9PHecY3.js → c4Diagram-YG6GDRKO-rIpnAud9.js} +1 -1
  7. package/canvas-dist/assets/channel-BzJVlie3.js +1 -0
  8. package/canvas-dist/assets/{chunk-4BX2VUAB-DjcN96Mk.js → chunk-4BX2VUAB-CpZGetnU.js} +1 -1
  9. package/canvas-dist/assets/{chunk-55IACEB6-CTdcUQSV.js → chunk-55IACEB6-L0OhcFdd.js} +1 -1
  10. package/canvas-dist/assets/{chunk-B4BG7PRW-Dcov7eRi.js → chunk-B4BG7PRW-Cv9vsAzg.js} +1 -1
  11. package/canvas-dist/assets/{chunk-DI55MBZ5-DUJCBZzM.js → chunk-DI55MBZ5-B3p1mU43.js} +1 -1
  12. package/canvas-dist/assets/{chunk-FMBD7UC4-EfGA9ufe.js → chunk-FMBD7UC4-JCLAHw5x.js} +1 -1
  13. package/canvas-dist/assets/{chunk-QN33PNHL-Cu6V1xBU.js → chunk-QN33PNHL-C9arKEVq.js} +1 -1
  14. package/canvas-dist/assets/{chunk-QZHKN3VN-avF3sH_r.js → chunk-QZHKN3VN-Bs1r3d9U.js} +1 -1
  15. package/canvas-dist/assets/{chunk-TZMSLE5B-CkWW-qpk.js → chunk-TZMSLE5B-_Ye6r84Y.js} +1 -1
  16. package/canvas-dist/assets/classDiagram-2ON5EDUG-BTs-zEmB.js +1 -0
  17. package/canvas-dist/assets/classDiagram-v2-WZHVMYZB-BTs-zEmB.js +1 -0
  18. package/canvas-dist/assets/clone-CXEfuXmc.js +1 -0
  19. package/canvas-dist/assets/{cose-bilkent-S5V4N54A-DDE4zf7X.js → cose-bilkent-S5V4N54A-2O2oovOj.js} +1 -1
  20. package/canvas-dist/assets/{dagre-6UL2VRFP-BD6MGb7B.js → dagre-6UL2VRFP-gRmGLrEW.js} +1 -1
  21. package/canvas-dist/assets/{diagram-PSM6KHXK-yyu-ytzf.js → diagram-PSM6KHXK-B7Li-xxw.js} +1 -1
  22. package/canvas-dist/assets/{diagram-QEK2KX5R-B_H957Uf.js → diagram-QEK2KX5R-B_NNUAm3.js} +1 -1
  23. package/canvas-dist/assets/{diagram-S2PKOQOG-DuebuBVv.js → diagram-S2PKOQOG-NcK-KHaA.js} +1 -1
  24. package/canvas-dist/assets/{erDiagram-Q2GNP2WA-AxqPt6IZ.js → erDiagram-Q2GNP2WA-CG7dqzk3.js} +1 -1
  25. package/canvas-dist/assets/{flowDiagram-NV44I4VS-mDhW3D3Q.js → flowDiagram-NV44I4VS-CBzCj5D6.js} +1 -1
  26. package/canvas-dist/assets/{ganttDiagram-JELNMOA3-sA8pHJPp.js → ganttDiagram-JELNMOA3-CHw-4qJC.js} +1 -1
  27. package/canvas-dist/assets/{gitGraphDiagram-V2S2FVAM-CvLzvhKr.js → gitGraphDiagram-V2S2FVAM-Dqrc4wUs.js} +1 -1
  28. package/canvas-dist/assets/{graph-BVZqMrwW.js → graph-X9Kzu-pf.js} +1 -1
  29. package/canvas-dist/assets/{index-CF3qc2Xb.js → index-BQFKo-II.js} +1 -1
  30. package/canvas-dist/assets/index-DJ49c6u-.js +426 -0
  31. package/canvas-dist/assets/{infoDiagram-HS3SLOUP-D1Kg3Q9d.js → infoDiagram-HS3SLOUP-CflnZPsm.js} +1 -1
  32. package/canvas-dist/assets/{journeyDiagram-XKPGCS4Q-D7ogbx9z.js → journeyDiagram-XKPGCS4Q-D2gkCipQ.js} +1 -1
  33. package/canvas-dist/assets/{kanban-definition-3W4ZIXB7-CDcnICM9.js → kanban-definition-3W4ZIXB7-CtLLz4o8.js} +1 -1
  34. package/canvas-dist/assets/{layout-CuaK7i3M.js → layout-CjvV_Dms.js} +1 -1
  35. package/canvas-dist/assets/{linear-CLSTOJ0g.js → linear-D3cIYHoS.js} +1 -1
  36. package/canvas-dist/assets/{mindmap-definition-VGOIOE7T-TrK7CIKt.js → mindmap-definition-VGOIOE7T-DSgjVg-P.js} +1 -1
  37. package/canvas-dist/assets/{pieDiagram-ADFJNKIX-BcIKTRbi.js → pieDiagram-ADFJNKIX-B_lYaGFj.js} +1 -1
  38. package/canvas-dist/assets/{quadrantDiagram-AYHSOK5B-EOHXFGoQ.js → quadrantDiagram-AYHSOK5B-DLZLTJe3.js} +1 -1
  39. package/canvas-dist/assets/{requirementDiagram-UZGBJVZJ-CJ8lImGs.js → requirementDiagram-UZGBJVZJ-CZE26rhL.js} +1 -1
  40. package/canvas-dist/assets/{sankeyDiagram-TZEHDZUN-4cANY87E.js → sankeyDiagram-TZEHDZUN-DQMRJAPV.js} +1 -1
  41. package/canvas-dist/assets/{sequenceDiagram-WL72ISMW-D9HrEsci.js → sequenceDiagram-WL72ISMW-BY723FEn.js} +1 -1
  42. package/canvas-dist/assets/{stateDiagram-FKZM4ZOC-qVbMjauZ.js → stateDiagram-FKZM4ZOC-C_UdOFhy.js} +1 -1
  43. package/canvas-dist/assets/stateDiagram-v2-4FDKWEC3-DXIiFh0L.js +1 -0
  44. package/canvas-dist/assets/{timeline-definition-IT6M3QCI-DDBlkydm.js → timeline-definition-IT6M3QCI-DkrJqww0.js} +1 -1
  45. package/canvas-dist/assets/{treemap-GDKQZRPO-D4a8udjO.js → treemap-GDKQZRPO-B-6bMZqD.js} +1 -1
  46. package/canvas-dist/assets/{xychartDiagram-PRI3JC2R-DteXAAAu.js → xychartDiagram-PRI3JC2R-DkBhUy_D.js} +1 -1
  47. package/canvas-dist/index.html +1 -1
  48. package/package.json +3 -2
  49. package/src/server.e2e.test.js +10 -41
  50. package/src/server.js +302 -186
  51. package/canvas-dist/assets/channel-saCUO1KA.js +0 -1
  52. package/canvas-dist/assets/classDiagram-2ON5EDUG-CBLbQwHx.js +0 -1
  53. package/canvas-dist/assets/classDiagram-v2-WZHVMYZB-CBLbQwHx.js +0 -1
  54. package/canvas-dist/assets/clone-DXnda9BY.js +0 -1
  55. package/canvas-dist/assets/index-DYNtb52W.js +0 -426
  56. package/canvas-dist/assets/stateDiagram-v2-4FDKWEC3-MT16RLO4.js +0 -1
  57. package/src/claude-session.js +0 -414
  58. package/src/claude-session.test.js +0 -326
@@ -0,0 +1,426 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-6UL2VRFP-gRmGLrEW.js","assets/graph-X9Kzu-pf.js","assets/_baseUniq-Dtuvtwtn.js","assets/layout-CjvV_Dms.js","assets/_basePickBy-CWoeT3J7.js","assets/clone-CXEfuXmc.js","assets/cose-bilkent-S5V4N54A-2O2oovOj.js","assets/cytoscape.esm-BQaXIfA_.js","assets/c4Diagram-YG6GDRKO-rIpnAud9.js","assets/chunk-TZMSLE5B-_Ye6r84Y.js","assets/flowDiagram-NV44I4VS-CBzCj5D6.js","assets/chunk-FMBD7UC4-JCLAHw5x.js","assets/chunk-55IACEB6-L0OhcFdd.js","assets/chunk-QN33PNHL-C9arKEVq.js","assets/channel-BzJVlie3.js","assets/erDiagram-Q2GNP2WA-CG7dqzk3.js","assets/gitGraphDiagram-V2S2FVAM-Dqrc4wUs.js","assets/chunk-4BX2VUAB-CpZGetnU.js","assets/chunk-QZHKN3VN-Bs1r3d9U.js","assets/treemap-GDKQZRPO-B-6bMZqD.js","assets/ganttDiagram-JELNMOA3-CHw-4qJC.js","assets/linear-D3cIYHoS.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-HS3SLOUP-CflnZPsm.js","assets/pieDiagram-ADFJNKIX-B_lYaGFj.js","assets/arc-YYWnrNJU.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-AYHSOK5B-DLZLTJe3.js","assets/xychartDiagram-PRI3JC2R-DkBhUy_D.js","assets/requirementDiagram-UZGBJVZJ-CZE26rhL.js","assets/sequenceDiagram-WL72ISMW-BY723FEn.js","assets/classDiagram-2ON5EDUG-BTs-zEmB.js","assets/chunk-B4BG7PRW-Cv9vsAzg.js","assets/classDiagram-v2-WZHVMYZB-BTs-zEmB.js","assets/stateDiagram-FKZM4ZOC-C_UdOFhy.js","assets/chunk-DI55MBZ5-B3p1mU43.js","assets/stateDiagram-v2-4FDKWEC3-DXIiFh0L.js","assets/journeyDiagram-XKPGCS4Q-D2gkCipQ.js","assets/timeline-definition-IT6M3QCI-DkrJqww0.js","assets/mindmap-definition-VGOIOE7T-DSgjVg-P.js","assets/kanban-definition-3W4ZIXB7-CtLLz4o8.js","assets/sankeyDiagram-TZEHDZUN-DQMRJAPV.js","assets/diagram-S2PKOQOG-NcK-KHaA.js","assets/diagram-QEK2KX5R-B_NNUAm3.js","assets/blockDiagram-VD42YOAC-C2e_j6ry.js","assets/architectureDiagram-VXUJARFQ-CegbV-RR.js","assets/diagram-PSM6KHXK-B7Li-xxw.js"])))=>i.map(i=>d[i]);
2
+ var Nk=Object.defineProperty;var Wk=(e,t,r)=>t in e?Nk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ne=(e,t,r)=>Wk(e,typeof t!="symbol"?t+"":t,r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function r(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 n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();function up(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jO(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),r}var Dd={exports:{}},uo={},Od={exports:{}},Wt={};/**
3
+ * @license React
4
+ * react.production.min.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var Dy;function Hk(){if(Dy)return Wt;Dy=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.iterator;function m(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function k(I,tt,ct){this.props=I,this.context=tt,this.refs=b,this.updater=ct||y}k.prototype.isReactComponent={},k.prototype.setState=function(I,tt){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,tt,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function T(){}T.prototype=k.prototype;function _(I,tt,ct){this.props=I,this.context=tt,this.refs=b,this.updater=ct||y}var B=_.prototype=new T;B.constructor=_,v(B,k.prototype),B.isPureReactComponent=!0;var L=Array.isArray,A=Object.prototype.hasOwnProperty,E={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function z(I,tt,ct){var mt,dt={},ht=null,X=null;if(tt!=null)for(mt in tt.ref!==void 0&&(X=tt.ref),tt.key!==void 0&&(ht=""+tt.key),tt)A.call(tt,mt)&&!$.hasOwnProperty(mt)&&(dt[mt]=tt[mt]);var ft=arguments.length-2;if(ft===1)dt.children=ct;else if(1<ft){for(var vt=Array(ft),Ft=0;Ft<ft;Ft++)vt[Ft]=arguments[Ft+2];dt.children=vt}if(I&&I.defaultProps)for(mt in ft=I.defaultProps,ft)dt[mt]===void 0&&(dt[mt]=ft[mt]);return{$$typeof:e,type:I,key:ht,ref:X,props:dt,_owner:E.current}}function Z(I,tt){return{$$typeof:e,type:I.type,key:tt,ref:I.ref,props:I.props,_owner:I._owner}}function W(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function G(I){var tt={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(ct){return tt[ct]})}var it=/\/+/g;function rt(I,tt){return typeof I=="object"&&I!==null&&I.key!=null?G(""+I.key):tt.toString(36)}function H(I,tt,ct,mt,dt){var ht=typeof I;(ht==="undefined"||ht==="boolean")&&(I=null);var X=!1;if(I===null)X=!0;else switch(ht){case"string":case"number":X=!0;break;case"object":switch(I.$$typeof){case e:case t:X=!0}}if(X)return X=I,dt=dt(X),I=mt===""?"."+rt(X,0):mt,L(dt)?(ct="",I!=null&&(ct=I.replace(it,"$&/")+"/"),H(dt,tt,ct,"",function(Ft){return Ft})):dt!=null&&(W(dt)&&(dt=Z(dt,ct+(!dt.key||X&&X.key===dt.key?"":(""+dt.key).replace(it,"$&/")+"/")+I)),tt.push(dt)),1;if(X=0,mt=mt===""?".":mt+":",L(I))for(var ft=0;ft<I.length;ft++){ht=I[ft];var vt=mt+rt(ht,ft);X+=H(ht,tt,ct,vt,dt)}else if(vt=m(I),typeof vt=="function")for(I=vt.call(I),ft=0;!(ht=I.next()).done;)ht=ht.value,vt=mt+rt(ht,ft++),X+=H(ht,tt,ct,vt,dt);else if(ht==="object")throw tt=String(I),Error("Objects are not valid as a React child (found: "+(tt==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":tt)+"). If you meant to render a collection of children, use an array instead.");return X}function q(I,tt,ct){if(I==null)return I;var mt=[],dt=0;return H(I,mt,"","",function(ht){return tt.call(ct,ht,dt++)}),mt}function N(I){if(I._status===-1){var tt=I._result;tt=tt(),tt.then(function(ct){(I._status===0||I._status===-1)&&(I._status=1,I._result=ct)},function(ct){(I._status===0||I._status===-1)&&(I._status=2,I._result=ct)}),I._status===-1&&(I._status=0,I._result=tt)}if(I._status===1)return I._result.default;throw I._result}var Y={current:null},P={transition:null},K={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:P,ReactCurrentOwner:E};function et(){throw Error("act(...) is not supported in production builds of React.")}return Wt.Children={map:q,forEach:function(I,tt,ct){q(I,function(){tt.apply(this,arguments)},ct)},count:function(I){var tt=0;return q(I,function(){tt++}),tt},toArray:function(I){return q(I,function(tt){return tt})||[]},only:function(I){if(!W(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Wt.Component=k,Wt.Fragment=r,Wt.Profiler=s,Wt.PureComponent=_,Wt.StrictMode=n,Wt.Suspense=h,Wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K,Wt.act=et,Wt.cloneElement=function(I,tt,ct){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var mt=v({},I.props),dt=I.key,ht=I.ref,X=I._owner;if(tt!=null){if(tt.ref!==void 0&&(ht=tt.ref,X=E.current),tt.key!==void 0&&(dt=""+tt.key),I.type&&I.type.defaultProps)var ft=I.type.defaultProps;for(vt in tt)A.call(tt,vt)&&!$.hasOwnProperty(vt)&&(mt[vt]=tt[vt]===void 0&&ft!==void 0?ft[vt]:tt[vt])}var vt=arguments.length-2;if(vt===1)mt.children=ct;else if(1<vt){ft=Array(vt);for(var Ft=0;Ft<vt;Ft++)ft[Ft]=arguments[Ft+2];mt.children=ft}return{$$typeof:e,type:I.type,key:dt,ref:ht,props:mt,_owner:X}},Wt.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:o,_context:I},I.Consumer=I},Wt.createElement=z,Wt.createFactory=function(I){var tt=z.bind(null,I);return tt.type=I,tt},Wt.createRef=function(){return{current:null}},Wt.forwardRef=function(I){return{$$typeof:l,render:I}},Wt.isValidElement=W,Wt.lazy=function(I){return{$$typeof:f,_payload:{_status:-1,_result:I},_init:N}},Wt.memo=function(I,tt){return{$$typeof:d,type:I,compare:tt===void 0?null:tt}},Wt.startTransition=function(I){var tt=P.transition;P.transition={};try{I()}finally{P.transition=tt}},Wt.unstable_act=et,Wt.useCallback=function(I,tt){return Y.current.useCallback(I,tt)},Wt.useContext=function(I){return Y.current.useContext(I)},Wt.useDebugValue=function(){},Wt.useDeferredValue=function(I){return Y.current.useDeferredValue(I)},Wt.useEffect=function(I,tt){return Y.current.useEffect(I,tt)},Wt.useId=function(){return Y.current.useId()},Wt.useImperativeHandle=function(I,tt,ct){return Y.current.useImperativeHandle(I,tt,ct)},Wt.useInsertionEffect=function(I,tt){return Y.current.useInsertionEffect(I,tt)},Wt.useLayoutEffect=function(I,tt){return Y.current.useLayoutEffect(I,tt)},Wt.useMemo=function(I,tt){return Y.current.useMemo(I,tt)},Wt.useReducer=function(I,tt,ct){return Y.current.useReducer(I,tt,ct)},Wt.useRef=function(I){return Y.current.useRef(I)},Wt.useState=function(I){return Y.current.useState(I)},Wt.useSyncExternalStore=function(I,tt,ct){return Y.current.useSyncExternalStore(I,tt,ct)},Wt.useTransition=function(){return Y.current.useTransition()},Wt.version="18.3.1",Wt}var Oy;function hp(){return Oy||(Oy=1,Od.exports=Hk()),Od.exports}/**
11
+ * @license React
12
+ * react-jsx-runtime.production.min.js
13
+ *
14
+ * Copyright (c) Facebook, Inc. and its affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var zy;function qk(){if(zy)return uo;zy=1;var e=hp(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function c(l,h,d){var f,g={},m=null,y=null;d!==void 0&&(m=""+d),h.key!==void 0&&(m=""+h.key),h.ref!==void 0&&(y=h.ref);for(f in h)n.call(h,f)&&!o.hasOwnProperty(f)&&(g[f]=h[f]);if(l&&l.defaultProps)for(f in h=l.defaultProps,h)g[f]===void 0&&(g[f]=h[f]);return{$$typeof:t,type:l,key:m,ref:y,props:g,_owner:s.current}}return uo.Fragment=r,uo.jsx=c,uo.jsxs=c,uo}var jy;function Uk(){return jy||(jy=1,Dd.exports=qk()),Dd.exports}var C=Uk(),F=hp();const Gk=up(F);var pc={},zd={exports:{}},vr={},jd={exports:{}},Nd={};/**
19
+ * @license React
20
+ * scheduler.production.min.js
21
+ *
22
+ * Copyright (c) Facebook, Inc. and its affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var Ny;function Vk(){return Ny||(Ny=1,(function(e){function t(P,K){var et=P.length;P.push(K);t:for(;0<et;){var I=et-1>>>1,tt=P[I];if(0<s(tt,K))P[I]=K,P[et]=tt,et=I;else break t}}function r(P){return P.length===0?null:P[0]}function n(P){if(P.length===0)return null;var K=P[0],et=P.pop();if(et!==K){P[0]=et;t:for(var I=0,tt=P.length,ct=tt>>>1;I<ct;){var mt=2*(I+1)-1,dt=P[mt],ht=mt+1,X=P[ht];if(0>s(dt,et))ht<tt&&0>s(X,dt)?(P[I]=X,P[ht]=et,I=ht):(P[I]=dt,P[mt]=et,I=mt);else if(ht<tt&&0>s(X,et))P[I]=X,P[ht]=et,I=ht;else break t}}return K}function s(P,K){var et=P.sortIndex-K.sortIndex;return et!==0?et:P.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,l=c.now();e.unstable_now=function(){return c.now()-l}}var h=[],d=[],f=1,g=null,m=3,y=!1,v=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function B(P){for(var K=r(d);K!==null;){if(K.callback===null)n(d);else if(K.startTime<=P)n(d),K.sortIndex=K.expirationTime,t(h,K);else break;K=r(d)}}function L(P){if(b=!1,B(P),!v)if(r(h)!==null)v=!0,N(A);else{var K=r(d);K!==null&&Y(L,K.startTime-P)}}function A(P,K){v=!1,b&&(b=!1,T(z),z=-1),y=!0;var et=m;try{for(B(K),g=r(h);g!==null&&(!(g.expirationTime>K)||P&&!G());){var I=g.callback;if(typeof I=="function"){g.callback=null,m=g.priorityLevel;var tt=I(g.expirationTime<=K);K=e.unstable_now(),typeof tt=="function"?g.callback=tt:g===r(h)&&n(h),B(K)}else n(h);g=r(h)}if(g!==null)var ct=!0;else{var mt=r(d);mt!==null&&Y(L,mt.startTime-K),ct=!1}return ct}finally{g=null,m=et,y=!1}}var E=!1,$=null,z=-1,Z=5,W=-1;function G(){return!(e.unstable_now()-W<Z)}function it(){if($!==null){var P=e.unstable_now();W=P;var K=!0;try{K=$(!0,P)}finally{K?rt():(E=!1,$=null)}}else E=!1}var rt;if(typeof _=="function")rt=function(){_(it)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,q=H.port2;H.port1.onmessage=it,rt=function(){q.postMessage(null)}}else rt=function(){k(it,0)};function N(P){$=P,E||(E=!0,rt())}function Y(P,K){z=k(function(){P(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_continueExecution=function(){v||y||(v=!0,N(A))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(h)},e.unstable_next=function(P){switch(m){case 1:case 2:case 3:var K=3;break;default:K=m}var et=m;m=K;try{return P()}finally{m=et}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,K){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var et=m;m=P;try{return K()}finally{m=et}},e.unstable_scheduleCallback=function(P,K,et){var I=e.unstable_now();switch(typeof et=="object"&&et!==null?(et=et.delay,et=typeof et=="number"&&0<et?I+et:I):et=I,P){case 1:var tt=-1;break;case 2:tt=250;break;case 5:tt=1073741823;break;case 4:tt=1e4;break;default:tt=5e3}return tt=et+tt,P={id:f++,callback:K,priorityLevel:P,startTime:et,expirationTime:tt,sortIndex:-1},et>I?(P.sortIndex=et,t(d,P),r(h)===null&&P===r(d)&&(b?(T(z),z=-1):b=!0,Y(L,et-I))):(P.sortIndex=tt,t(h,P),v||y||(v=!0,N(A))),P},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(P){var K=m;return function(){var et=m;m=K;try{return P.apply(this,arguments)}finally{m=et}}}})(Nd)),Nd}var Wy;function Yk(){return Wy||(Wy=1,jd.exports=Vk()),jd.exports}/**
27
+ * @license React
28
+ * react-dom.production.min.js
29
+ *
30
+ * Copyright (c) Facebook, Inc. and its affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var Hy;function Xk(){if(Hy)return vr;Hy=1;var e=hp(),t=Yk();function r(i){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+i,u=1;u<arguments.length;u++)a+="&args[]="+encodeURIComponent(arguments[u]);return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,s={};function o(i,a){c(i,a),c(i+"Capture",a)}function c(i,a){for(s[i]=a,i=0;i<a.length;i++)n.add(a[i])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},g={};function m(i){return h.call(g,i)?!0:h.call(f,i)?!1:d.test(i)?g[i]=!0:(f[i]=!0,!1)}function y(i,a,u,p){if(u!==null&&u.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return p?!1:u!==null?!u.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function v(i,a,u,p){if(a===null||typeof a>"u"||y(i,a,u,p))return!0;if(p)return!1;if(u!==null)switch(u.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function b(i,a,u,p,x,S,M){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=p,this.attributeNamespace=x,this.mustUseProperty=u,this.propertyName=i,this.type=a,this.sanitizeURL=S,this.removeEmptyString=M}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){k[i]=new b(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var a=i[0];k[a]=new b(a,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){k[i]=new b(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){k[i]=new b(i,2,!1,i,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(i){k[i]=new b(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){k[i]=new b(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){k[i]=new b(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){k[i]=new b(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){k[i]=new b(i,5,!1,i.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function _(i){return i[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(i){var a=i.replace(T,_);k[a]=new b(a,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var a=i.replace(T,_);k[a]=new b(a,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var a=i.replace(T,_);k[a]=new b(a,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){k[i]=new b(i,1,!1,i.toLowerCase(),null,!1,!1)}),k.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){k[i]=new b(i,1,!1,i.toLowerCase(),null,!0,!0)});function B(i,a,u,p){var x=k.hasOwnProperty(a)?k[a]:null;(x!==null?x.type!==0:p||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(v(a,u,x,p)&&(u=null),p||x===null?m(a)&&(u===null?i.removeAttribute(a):i.setAttribute(a,""+u)):x.mustUseProperty?i[x.propertyName]=u===null?x.type===3?!1:"":u:(a=x.attributeName,p=x.attributeNamespace,u===null?i.removeAttribute(a):(x=x.type,u=x===3||x===4&&u===!0?"":""+u,p?i.setAttributeNS(p,a,u):i.setAttribute(a,u))))}var L=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),E=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),G=Symbol.for("react.context"),it=Symbol.for("react.forward_ref"),rt=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),P=Symbol.iterator;function K(i){return i===null||typeof i!="object"?null:(i=P&&i[P]||i["@@iterator"],typeof i=="function"?i:null)}var et=Object.assign,I;function tt(i){if(I===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);I=a&&a[1]||""}return`
35
+ `+I+i}var ct=!1;function mt(i,a){if(!i||ct)return"";ct=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(J){var p=J}Reflect.construct(i,[],a)}else{try{a.call()}catch(J){p=J}i.call(a.prototype)}else{try{throw Error()}catch(J){p=J}i()}}catch(J){if(J&&p&&typeof J.stack=="string"){for(var x=J.stack.split(`
36
+ `),S=p.stack.split(`
37
+ `),M=x.length-1,R=S.length-1;1<=M&&0<=R&&x[M]!==S[R];)R--;for(;1<=M&&0<=R;M--,R--)if(x[M]!==S[R]){if(M!==1||R!==1)do if(M--,R--,0>R||x[M]!==S[R]){var D=`
38
+ `+x[M].replace(" at new "," at ");return i.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",i.displayName)),D}while(1<=M&&0<=R);break}}}finally{ct=!1,Error.prepareStackTrace=u}return(i=i?i.displayName||i.name:"")?tt(i):""}function dt(i){switch(i.tag){case 5:return tt(i.type);case 16:return tt("Lazy");case 13:return tt("Suspense");case 19:return tt("SuspenseList");case 0:case 2:case 15:return i=mt(i.type,!1),i;case 11:return i=mt(i.type.render,!1),i;case 1:return i=mt(i.type,!0),i;default:return""}}function ht(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case $:return"Fragment";case E:return"Portal";case Z:return"Profiler";case z:return"StrictMode";case rt:return"Suspense";case H:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case G:return(i.displayName||"Context")+".Consumer";case W:return(i._context.displayName||"Context")+".Provider";case it:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case q:return a=i.displayName||null,a!==null?a:ht(i.type)||"Memo";case N:a=i._payload,i=i._init;try{return ht(i(a))}catch{}}return null}function X(i){var a=i.type;switch(i.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=a.render,i=i.displayName||i.name||"",a.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ht(a);case 8:return a===z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function ft(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function vt(i){var a=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Ft(i){var a=vt(i)?"checked":"value",u=Object.getOwnPropertyDescriptor(i.constructor.prototype,a),p=""+i[a];if(!i.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var x=u.get,S=u.set;return Object.defineProperty(i,a,{configurable:!0,get:function(){return x.call(this)},set:function(M){p=""+M,S.call(this,M)}}),Object.defineProperty(i,a,{enumerable:u.enumerable}),{getValue:function(){return p},setValue:function(M){p=""+M},stopTracking:function(){i._valueTracker=null,delete i[a]}}}}function ie(i){i._valueTracker||(i._valueTracker=Ft(i))}function ze(i){if(!i)return!1;var a=i._valueTracker;if(!a)return!0;var u=a.getValue(),p="";return i&&(p=vt(i)?i.checked?"true":"false":i.value),i=p,i!==u?(a.setValue(i),!0):!1}function ee(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function cr(i,a){var u=a.checked;return et({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:u??i._wrapperState.initialChecked})}function Dr(i,a){var u=a.defaultValue==null?"":a.defaultValue,p=a.checked!=null?a.checked:a.defaultChecked;u=ft(a.value!=null?a.value:u),i._wrapperState={initialChecked:p,initialValue:u,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function tn(i,a){a=a.checked,a!=null&&B(i,"checked",a,!1)}function Je(i,a){tn(i,a);var u=ft(a.value),p=a.type;if(u!=null)p==="number"?(u===0&&i.value===""||i.value!=u)&&(i.value=""+u):i.value!==""+u&&(i.value=""+u);else if(p==="submit"||p==="reset"){i.removeAttribute("value");return}a.hasOwnProperty("value")?Or(i,a.type,u):a.hasOwnProperty("defaultValue")&&Or(i,a.type,ft(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(i.defaultChecked=!!a.defaultChecked)}function ur(i,a,u){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var p=a.type;if(!(p!=="submit"&&p!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+i._wrapperState.initialValue,u||a===i.value||(i.value=a),i.defaultValue=a}u=i.name,u!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,u!==""&&(i.name=u)}function Or(i,a,u){(a!=="number"||ee(i.ownerDocument)!==i)&&(u==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+u&&(i.defaultValue=""+u))}var zr=Array.isArray;function en(i,a,u,p){if(i=i.options,a){a={};for(var x=0;x<u.length;x++)a["$"+u[x]]=!0;for(u=0;u<i.length;u++)x=a.hasOwnProperty("$"+i[u].value),i[u].selected!==x&&(i[u].selected=x),x&&p&&(i[u].defaultSelected=!0)}else{for(u=""+ft(u),a=null,x=0;x<i.length;x++){if(i[x].value===u){i[x].selected=!0,p&&(i[x].defaultSelected=!0);return}a!==null||i[x].disabled||(a=i[x])}a!==null&&(a.selected=!0)}}function jr(i,a){if(a.dangerouslySetInnerHTML!=null)throw Error(r(91));return et({},a,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function Ts(i,a){var u=a.value;if(u==null){if(u=a.children,a=a.defaultValue,u!=null){if(a!=null)throw Error(r(92));if(zr(u)){if(1<u.length)throw Error(r(93));u=u[0]}a=u}a==null&&(a=""),u=a}i._wrapperState={initialValue:ft(u)}}function Wn(i,a){var u=ft(a.value),p=ft(a.defaultValue);u!=null&&(u=""+u,u!==i.value&&(i.value=u),a.defaultValue==null&&i.defaultValue!==u&&(i.defaultValue=u)),p!=null&&(i.defaultValue=""+p)}function kn(i){var a=i.textContent;a===i._wrapperState.initialValue&&a!==""&&a!==null&&(i.value=a)}function rn(i){switch(i){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function je(i,a){return i==null||i==="http://www.w3.org/1999/xhtml"?rn(a):i==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var _n,hr=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,u,p,x){MSApp.execUnsafeLocalFunction(function(){return i(a,u,p,x)})}:i})(function(i,a){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=a;else{for(_n=_n||document.createElement("div"),_n.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=_n.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;a.firstChild;)i.appendChild(a.firstChild)}});function nn(i,a){if(a){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=a;return}}i.textContent=a}var pt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},re=["Webkit","ms","Moz","O"];Object.keys(pt).forEach(function(i){re.forEach(function(a){a=a+i.charAt(0).toUpperCase()+i.substring(1),pt[a]=pt[i]})});function Nr(i,a,u){return a==null||typeof a=="boolean"||a===""?"":u||typeof a!="number"||a===0||pt.hasOwnProperty(i)&&pt[i]?(""+a).trim():a+"px"}function kr(i,a){i=i.style;for(var u in a)if(a.hasOwnProperty(u)){var p=u.indexOf("--")===0,x=Nr(u,a[u],p);u==="float"&&(u="cssFloat"),p?i.setProperty(u,x):i[u]=x}}var Fe=et({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ne(i,a){if(a){if(Fe[i]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(r(137,i));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(r(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(r(61))}if(a.style!=null&&typeof a.style!="object")throw Error(r(62))}}function _r(i,a){if(i.indexOf("-")===-1)return typeof a.is=="string";switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var dr=null;function Tn(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var sn=null,fr=null,an=null;function on(i){if(i=Xa(i)){if(typeof sn!="function")throw Error(r(280));var a=i.stateNode;a&&(a=Ml(a),sn(i.stateNode,i.type,a))}}function Ni(i){fr?an?an.push(i):an=[i]:fr=i}function Wi(){if(fr){var i=fr,a=an;if(an=fr=null,on(i),a)for(i=0;i<a.length;i++)on(a[i])}}function Kt(i,a){return i(a)}function de(){}var Me=!1;function ai(i,a,u){if(Me)return i(a,u);Me=!0;try{return Kt(i,a,u)}finally{Me=!1,(fr!==null||an!==null)&&(de(),Wi())}}function Tr(i,a){var u=i.stateNode;if(u===null)return null;var p=Ml(u);if(p===null)return null;u=p[a];t:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(i=i.type,p=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!p;break t;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,a,typeof u));return u}var Es=!1;if(l)try{var oi={};Object.defineProperty(oi,"passive",{get:function(){Es=!0}}),window.addEventListener("test",oi,oi),window.removeEventListener("test",oi,oi)}catch{Es=!1}function nh(i,a,u,p,x,S,M,R,D){var J=Array.prototype.slice.call(arguments,3);try{a.apply(u,J)}catch(at){this.onError(at)}}var We=!1,Wr=null,Hi=!1,Ls=null,Ea={onError:function(i){We=!0,Wr=i}};function ll(i,a,u,p,x,S,M,R,D){We=!1,Wr=null,nh.apply(Ea,arguments)}function ln(i,a,u,p,x,S,M,R,D){if(ll.apply(this,arguments),We){if(We){var J=Wr;We=!1,Wr=null}else throw Error(r(198));Hi||(Hi=!0,Ls=J)}}function En(i){var a=i,u=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,(a.flags&4098)!==0&&(u=a.return),i=a.return;while(i)}return a.tag===3?u:null}function La(i){if(i.tag===13){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function Ma(i){if(En(i)!==i)throw Error(r(188))}function cl(i){var a=i.alternate;if(!a){if(a=En(i),a===null)throw Error(r(188));return a!==i?null:i}for(var u=i,p=a;;){var x=u.return;if(x===null)break;var S=x.alternate;if(S===null){if(p=x.return,p!==null){u=p;continue}break}if(x.child===S.child){for(S=x.child;S;){if(S===u)return Ma(x),i;if(S===p)return Ma(x),a;S=S.sibling}throw Error(r(188))}if(u.return!==p.return)u=x,p=S;else{for(var M=!1,R=x.child;R;){if(R===u){M=!0,u=x,p=S;break}if(R===p){M=!0,p=x,u=S;break}R=R.sibling}if(!M){for(R=S.child;R;){if(R===u){M=!0,u=S,p=x;break}if(R===p){M=!0,p=S,u=x;break}R=R.sibling}if(!M)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:a}function ul(i){return i=cl(i),i!==null?Bt(i):null}function Bt(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var a=Bt(i);if(a!==null)return a;i=i.sibling}return null}var O=t.unstable_scheduleCallback,lt=t.unstable_cancelCallback,kt=t.unstable_shouldYield,se=t.unstable_requestPaint,Nt=t.unstable_now,ge=t.unstable_getCurrentPriorityLevel,Be=t.unstable_ImmediatePriority,Hr=t.unstable_UserBlockingPriority,cn=t.unstable_NormalPriority,Ba=t.unstable_LowPriority,be=t.unstable_IdlePriority,qi=null,Er=null;function rw(i){if(Er&&typeof Er.onCommitFiberRoot=="function")try{Er.onCommitFiberRoot(qi,i,void 0,(i.current.flags&128)===128)}catch{}}var un=Math.clz32?Math.clz32:sw,nw=Math.log,iw=Math.LN2;function sw(i){return i>>>=0,i===0?32:31-(nw(i)/iw|0)|0}var hl=64,dl=4194304;function Aa(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function fl(i,a){var u=i.pendingLanes;if(u===0)return 0;var p=0,x=i.suspendedLanes,S=i.pingedLanes,M=u&268435455;if(M!==0){var R=M&~x;R!==0?p=Aa(R):(S&=M,S!==0&&(p=Aa(S)))}else M=u&~x,M!==0?p=Aa(M):S!==0&&(p=Aa(S));if(p===0)return 0;if(a!==0&&a!==p&&(a&x)===0&&(x=p&-p,S=a&-a,x>=S||x===16&&(S&4194240)!==0))return a;if((p&4)!==0&&(p|=u&16),a=i.entangledLanes,a!==0)for(i=i.entanglements,a&=p;0<a;)u=31-un(a),x=1<<u,p|=i[u],a&=~x;return p}function aw(i,a){switch(i){case 1:case 2:case 4:return a+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ow(i,a){for(var u=i.suspendedLanes,p=i.pingedLanes,x=i.expirationTimes,S=i.pendingLanes;0<S;){var M=31-un(S),R=1<<M,D=x[M];D===-1?((R&u)===0||(R&p)!==0)&&(x[M]=aw(R,a)):D<=a&&(i.expiredLanes|=R),S&=~R}}function ih(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function pg(){var i=hl;return hl<<=1,(hl&4194240)===0&&(hl=64),i}function sh(i){for(var a=[],u=0;31>u;u++)a.push(i);return a}function $a(i,a,u){i.pendingLanes|=a,a!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,a=31-un(a),i[a]=u}function lw(i,a){var u=i.pendingLanes&~a;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=a,i.mutableReadLanes&=a,i.entangledLanes&=a,a=i.entanglements;var p=i.eventTimes;for(i=i.expirationTimes;0<u;){var x=31-un(u),S=1<<x;a[x]=0,p[x]=-1,i[x]=-1,u&=~S}}function ah(i,a){var u=i.entangledLanes|=a;for(i=i.entanglements;u;){var p=31-un(u),x=1<<p;x&a|i[p]&a&&(i[p]|=a),u&=~x}}var te=0;function gg(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var mg,oh,yg,xg,vg,lh=!1,pl=[],li=null,ci=null,ui=null,Ra=new Map,Fa=new Map,hi=[],cw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function bg(i,a){switch(i){case"focusin":case"focusout":li=null;break;case"dragenter":case"dragleave":ci=null;break;case"mouseover":case"mouseout":ui=null;break;case"pointerover":case"pointerout":Ra.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fa.delete(a.pointerId)}}function Ia(i,a,u,p,x,S){return i===null||i.nativeEvent!==S?(i={blockedOn:a,domEventName:u,eventSystemFlags:p,nativeEvent:S,targetContainers:[x]},a!==null&&(a=Xa(a),a!==null&&oh(a)),i):(i.eventSystemFlags|=p,a=i.targetContainers,x!==null&&a.indexOf(x)===-1&&a.push(x),i)}function uw(i,a,u,p,x){switch(a){case"focusin":return li=Ia(li,i,a,u,p,x),!0;case"dragenter":return ci=Ia(ci,i,a,u,p,x),!0;case"mouseover":return ui=Ia(ui,i,a,u,p,x),!0;case"pointerover":var S=x.pointerId;return Ra.set(S,Ia(Ra.get(S)||null,i,a,u,p,x)),!0;case"gotpointercapture":return S=x.pointerId,Fa.set(S,Ia(Fa.get(S)||null,i,a,u,p,x)),!0}return!1}function Sg(i){var a=Ui(i.target);if(a!==null){var u=En(a);if(u!==null){if(a=u.tag,a===13){if(a=La(u),a!==null){i.blockedOn=a,vg(i.priority,function(){yg(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function gl(i){if(i.blockedOn!==null)return!1;for(var a=i.targetContainers;0<a.length;){var u=uh(i.domEventName,i.eventSystemFlags,a[0],i.nativeEvent);if(u===null){u=i.nativeEvent;var p=new u.constructor(u.type,u);dr=p,u.target.dispatchEvent(p),dr=null}else return a=Xa(u),a!==null&&oh(a),i.blockedOn=u,!1;a.shift()}return!0}function Cg(i,a,u){gl(i)&&u.delete(a)}function hw(){lh=!1,li!==null&&gl(li)&&(li=null),ci!==null&&gl(ci)&&(ci=null),ui!==null&&gl(ui)&&(ui=null),Ra.forEach(Cg),Fa.forEach(Cg)}function Pa(i,a){i.blockedOn===a&&(i.blockedOn=null,lh||(lh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,hw)))}function Da(i){function a(x){return Pa(x,i)}if(0<pl.length){Pa(pl[0],i);for(var u=1;u<pl.length;u++){var p=pl[u];p.blockedOn===i&&(p.blockedOn=null)}}for(li!==null&&Pa(li,i),ci!==null&&Pa(ci,i),ui!==null&&Pa(ui,i),Ra.forEach(a),Fa.forEach(a),u=0;u<hi.length;u++)p=hi[u],p.blockedOn===i&&(p.blockedOn=null);for(;0<hi.length&&(u=hi[0],u.blockedOn===null);)Sg(u),u.blockedOn===null&&hi.shift()}var Ms=L.ReactCurrentBatchConfig,ml=!0;function dw(i,a,u,p){var x=te,S=Ms.transition;Ms.transition=null;try{te=1,ch(i,a,u,p)}finally{te=x,Ms.transition=S}}function fw(i,a,u,p){var x=te,S=Ms.transition;Ms.transition=null;try{te=4,ch(i,a,u,p)}finally{te=x,Ms.transition=S}}function ch(i,a,u,p){if(ml){var x=uh(i,a,u,p);if(x===null)Eh(i,a,p,yl,u),bg(i,p);else if(uw(x,i,a,u,p))p.stopPropagation();else if(bg(i,p),a&4&&-1<cw.indexOf(i)){for(;x!==null;){var S=Xa(x);if(S!==null&&mg(S),S=uh(i,a,u,p),S===null&&Eh(i,a,p,yl,u),S===x)break;x=S}x!==null&&p.stopPropagation()}else Eh(i,a,p,null,u)}}var yl=null;function uh(i,a,u,p){if(yl=null,i=Tn(p),i=Ui(i),i!==null)if(a=En(i),a===null)i=null;else if(u=a.tag,u===13){if(i=La(a),i!==null)return i;i=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null);return yl=i,null}function wg(i){switch(i){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ge()){case Be:return 1;case Hr:return 4;case cn:case Ba:return 16;case be:return 536870912;default:return 16}default:return 16}}var di=null,hh=null,xl=null;function kg(){if(xl)return xl;var i,a=hh,u=a.length,p,x="value"in di?di.value:di.textContent,S=x.length;for(i=0;i<u&&a[i]===x[i];i++);var M=u-i;for(p=1;p<=M&&a[u-p]===x[S-p];p++);return xl=x.slice(i,1<p?1-p:void 0)}function vl(i){var a=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&a===13&&(i=13)):i=a,i===10&&(i=13),32<=i||i===13?i:0}function bl(){return!0}function _g(){return!1}function Lr(i){function a(u,p,x,S,M){this._reactName=u,this._targetInst=x,this.type=p,this.nativeEvent=S,this.target=M,this.currentTarget=null;for(var R in i)i.hasOwnProperty(R)&&(u=i[R],this[R]=u?u(S):S[R]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?bl:_g,this.isPropagationStopped=_g,this}return et(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=bl)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=bl)},persist:function(){},isPersistent:bl}),a}var Bs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dh=Lr(Bs),Oa=et({},Bs,{view:0,detail:0}),pw=Lr(Oa),fh,ph,za,Sl=et({},Oa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mh,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==za&&(za&&i.type==="mousemove"?(fh=i.screenX-za.screenX,ph=i.screenY-za.screenY):ph=fh=0,za=i),fh)},movementY:function(i){return"movementY"in i?i.movementY:ph}}),Tg=Lr(Sl),gw=et({},Sl,{dataTransfer:0}),mw=Lr(gw),yw=et({},Oa,{relatedTarget:0}),gh=Lr(yw),xw=et({},Bs,{animationName:0,elapsedTime:0,pseudoElement:0}),vw=Lr(xw),bw=et({},Bs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Sw=Lr(bw),Cw=et({},Bs,{data:0}),Eg=Lr(Cw),ww={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kw={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},_w={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tw(i){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(i):(i=_w[i])?!!a[i]:!1}function mh(){return Tw}var Ew=et({},Oa,{key:function(i){if(i.key){var a=ww[i.key]||i.key;if(a!=="Unidentified")return a}return i.type==="keypress"?(i=vl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?kw[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mh,charCode:function(i){return i.type==="keypress"?vl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?vl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Lw=Lr(Ew),Mw=et({},Sl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lg=Lr(Mw),Bw=et({},Oa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mh}),Aw=Lr(Bw),$w=et({},Bs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rw=Lr($w),Fw=et({},Sl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),Iw=Lr(Fw),Pw=[9,13,27,32],yh=l&&"CompositionEvent"in window,ja=null;l&&"documentMode"in document&&(ja=document.documentMode);var Dw=l&&"TextEvent"in window&&!ja,Mg=l&&(!yh||ja&&8<ja&&11>=ja),Bg=" ",Ag=!1;function $g(i,a){switch(i){case"keyup":return Pw.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var As=!1;function Ow(i,a){switch(i){case"compositionend":return Rg(a);case"keypress":return a.which!==32?null:(Ag=!0,Bg);case"textInput":return i=a.data,i===Bg&&Ag?null:i;default:return null}}function zw(i,a){if(As)return i==="compositionend"||!yh&&$g(i,a)?(i=kg(),xl=hh=di=null,As=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Mg&&a.locale!=="ko"?null:a.data;default:return null}}var jw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fg(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a==="input"?!!jw[i.type]:a==="textarea"}function Ig(i,a,u,p){Ni(p),a=Tl(a,"onChange"),0<a.length&&(u=new dh("onChange","change",null,u,p),i.push({event:u,listeners:a}))}var Na=null,Wa=null;function Nw(i){Jg(i,0)}function Cl(i){var a=Ps(i);if(ze(a))return i}function Ww(i,a){if(i==="change")return a}var Pg=!1;if(l){var xh;if(l){var vh="oninput"in document;if(!vh){var Dg=document.createElement("div");Dg.setAttribute("oninput","return;"),vh=typeof Dg.oninput=="function"}xh=vh}else xh=!1;Pg=xh&&(!document.documentMode||9<document.documentMode)}function Og(){Na&&(Na.detachEvent("onpropertychange",zg),Wa=Na=null)}function zg(i){if(i.propertyName==="value"&&Cl(Wa)){var a=[];Ig(a,Wa,i,Tn(i)),ai(Nw,a)}}function Hw(i,a,u){i==="focusin"?(Og(),Na=a,Wa=u,Na.attachEvent("onpropertychange",zg)):i==="focusout"&&Og()}function qw(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Cl(Wa)}function Uw(i,a){if(i==="click")return Cl(a)}function Gw(i,a){if(i==="input"||i==="change")return Cl(a)}function Vw(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var hn=typeof Object.is=="function"?Object.is:Vw;function Ha(i,a){if(hn(i,a))return!0;if(typeof i!="object"||i===null||typeof a!="object"||a===null)return!1;var u=Object.keys(i),p=Object.keys(a);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var x=u[p];if(!h.call(a,x)||!hn(i[x],a[x]))return!1}return!0}function jg(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Ng(i,a){var u=jg(i);i=0;for(var p;u;){if(u.nodeType===3){if(p=i+u.textContent.length,i<=a&&p>=a)return{node:u,offset:a-i};i=p}t:{for(;u;){if(u.nextSibling){u=u.nextSibling;break t}u=u.parentNode}u=void 0}u=jg(u)}}function Wg(i,a){return i&&a?i===a?!0:i&&i.nodeType===3?!1:a&&a.nodeType===3?Wg(i,a.parentNode):"contains"in i?i.contains(a):i.compareDocumentPosition?!!(i.compareDocumentPosition(a)&16):!1:!1}function Hg(){for(var i=window,a=ee();a instanceof i.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)i=a.contentWindow;else break;a=ee(i.document)}return a}function bh(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a&&(a==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||a==="textarea"||i.contentEditable==="true")}function Yw(i){var a=Hg(),u=i.focusedElem,p=i.selectionRange;if(a!==u&&u&&u.ownerDocument&&Wg(u.ownerDocument.documentElement,u)){if(p!==null&&bh(u)){if(a=p.start,i=p.end,i===void 0&&(i=a),"selectionStart"in u)u.selectionStart=a,u.selectionEnd=Math.min(i,u.value.length);else if(i=(a=u.ownerDocument||document)&&a.defaultView||window,i.getSelection){i=i.getSelection();var x=u.textContent.length,S=Math.min(p.start,x);p=p.end===void 0?S:Math.min(p.end,x),!i.extend&&S>p&&(x=p,p=S,S=x),x=Ng(u,S);var M=Ng(u,p);x&&M&&(i.rangeCount!==1||i.anchorNode!==x.node||i.anchorOffset!==x.offset||i.focusNode!==M.node||i.focusOffset!==M.offset)&&(a=a.createRange(),a.setStart(x.node,x.offset),i.removeAllRanges(),S>p?(i.addRange(a),i.extend(M.node,M.offset)):(a.setEnd(M.node,M.offset),i.addRange(a)))}}for(a=[],i=u;i=i.parentNode;)i.nodeType===1&&a.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof u.focus=="function"&&u.focus(),u=0;u<a.length;u++)i=a[u],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var Xw=l&&"documentMode"in document&&11>=document.documentMode,$s=null,Sh=null,qa=null,Ch=!1;function qg(i,a,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Ch||$s==null||$s!==ee(p)||(p=$s,"selectionStart"in p&&bh(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),qa&&Ha(qa,p)||(qa=p,p=Tl(Sh,"onSelect"),0<p.length&&(a=new dh("onSelect","select",null,a,u),i.push({event:a,listeners:p}),a.target=$s)))}function wl(i,a){var u={};return u[i.toLowerCase()]=a.toLowerCase(),u["Webkit"+i]="webkit"+a,u["Moz"+i]="moz"+a,u}var Rs={animationend:wl("Animation","AnimationEnd"),animationiteration:wl("Animation","AnimationIteration"),animationstart:wl("Animation","AnimationStart"),transitionend:wl("Transition","TransitionEnd")},wh={},Ug={};l&&(Ug=document.createElement("div").style,"AnimationEvent"in window||(delete Rs.animationend.animation,delete Rs.animationiteration.animation,delete Rs.animationstart.animation),"TransitionEvent"in window||delete Rs.transitionend.transition);function kl(i){if(wh[i])return wh[i];if(!Rs[i])return i;var a=Rs[i],u;for(u in a)if(a.hasOwnProperty(u)&&u in Ug)return wh[i]=a[u];return i}var Gg=kl("animationend"),Vg=kl("animationiteration"),Yg=kl("animationstart"),Xg=kl("transitionend"),Qg=new Map,Kg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function fi(i,a){Qg.set(i,a),o(a,[i])}for(var kh=0;kh<Kg.length;kh++){var _h=Kg[kh],Qw=_h.toLowerCase(),Kw=_h[0].toUpperCase()+_h.slice(1);fi(Qw,"on"+Kw)}fi(Gg,"onAnimationEnd"),fi(Vg,"onAnimationIteration"),fi(Yg,"onAnimationStart"),fi("dblclick","onDoubleClick"),fi("focusin","onFocus"),fi("focusout","onBlur"),fi(Xg,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ua="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Zw=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ua));function Zg(i,a,u){var p=i.type||"unknown-event";i.currentTarget=u,ln(p,a,void 0,i),i.currentTarget=null}function Jg(i,a){a=(a&4)!==0;for(var u=0;u<i.length;u++){var p=i[u],x=p.event;p=p.listeners;t:{var S=void 0;if(a)for(var M=p.length-1;0<=M;M--){var R=p[M],D=R.instance,J=R.currentTarget;if(R=R.listener,D!==S&&x.isPropagationStopped())break t;Zg(x,R,J),S=D}else for(M=0;M<p.length;M++){if(R=p[M],D=R.instance,J=R.currentTarget,R=R.listener,D!==S&&x.isPropagationStopped())break t;Zg(x,R,J),S=D}}}if(Hi)throw i=Ls,Hi=!1,Ls=null,i}function oe(i,a){var u=a[Rh];u===void 0&&(u=a[Rh]=new Set);var p=i+"__bubble";u.has(p)||(tm(a,i,2,!1),u.add(p))}function Th(i,a,u){var p=0;a&&(p|=4),tm(u,i,p,a)}var _l="_reactListening"+Math.random().toString(36).slice(2);function Ga(i){if(!i[_l]){i[_l]=!0,n.forEach(function(u){u!=="selectionchange"&&(Zw.has(u)||Th(u,!1,i),Th(u,!0,i))});var a=i.nodeType===9?i:i.ownerDocument;a===null||a[_l]||(a[_l]=!0,Th("selectionchange",!1,a))}}function tm(i,a,u,p){switch(wg(a)){case 1:var x=dw;break;case 4:x=fw;break;default:x=ch}u=x.bind(null,a,u,i),x=void 0,!Es||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(x=!0),p?x!==void 0?i.addEventListener(a,u,{capture:!0,passive:x}):i.addEventListener(a,u,!0):x!==void 0?i.addEventListener(a,u,{passive:x}):i.addEventListener(a,u,!1)}function Eh(i,a,u,p,x){var S=p;if((a&1)===0&&(a&2)===0&&p!==null)t:for(;;){if(p===null)return;var M=p.tag;if(M===3||M===4){var R=p.stateNode.containerInfo;if(R===x||R.nodeType===8&&R.parentNode===x)break;if(M===4)for(M=p.return;M!==null;){var D=M.tag;if((D===3||D===4)&&(D=M.stateNode.containerInfo,D===x||D.nodeType===8&&D.parentNode===x))return;M=M.return}for(;R!==null;){if(M=Ui(R),M===null)return;if(D=M.tag,D===5||D===6){p=S=M;continue t}R=R.parentNode}}p=p.return}ai(function(){var J=S,at=Tn(u),ot=[];t:{var st=Qg.get(i);if(st!==void 0){var xt=dh,St=i;switch(i){case"keypress":if(vl(u)===0)break t;case"keydown":case"keyup":xt=Lw;break;case"focusin":St="focus",xt=gh;break;case"focusout":St="blur",xt=gh;break;case"beforeblur":case"afterblur":xt=gh;break;case"click":if(u.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xt=Tg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xt=mw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xt=Aw;break;case Gg:case Vg:case Yg:xt=vw;break;case Xg:xt=Rw;break;case"scroll":xt=pw;break;case"wheel":xt=Iw;break;case"copy":case"cut":case"paste":xt=Sw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xt=Lg}var Et=(a&4)!==0,ye=!Et&&i==="scroll",V=Et?st!==null?st+"Capture":null:st;Et=[];for(var j=J,Q;j!==null;){Q=j;var ut=Q.stateNode;if(Q.tag===5&&ut!==null&&(Q=ut,V!==null&&(ut=Tr(j,V),ut!=null&&Et.push(Va(j,ut,Q)))),ye)break;j=j.return}0<Et.length&&(st=new xt(st,St,null,u,at),ot.push({event:st,listeners:Et}))}}if((a&7)===0){t:{if(st=i==="mouseover"||i==="pointerover",xt=i==="mouseout"||i==="pointerout",st&&u!==dr&&(St=u.relatedTarget||u.fromElement)&&(Ui(St)||St[Hn]))break t;if((xt||st)&&(st=at.window===at?at:(st=at.ownerDocument)?st.defaultView||st.parentWindow:window,xt?(St=u.relatedTarget||u.toElement,xt=J,St=St?Ui(St):null,St!==null&&(ye=En(St),St!==ye||St.tag!==5&&St.tag!==6)&&(St=null)):(xt=null,St=J),xt!==St)){if(Et=Tg,ut="onMouseLeave",V="onMouseEnter",j="mouse",(i==="pointerout"||i==="pointerover")&&(Et=Lg,ut="onPointerLeave",V="onPointerEnter",j="pointer"),ye=xt==null?st:Ps(xt),Q=St==null?st:Ps(St),st=new Et(ut,j+"leave",xt,u,at),st.target=ye,st.relatedTarget=Q,ut=null,Ui(at)===J&&(Et=new Et(V,j+"enter",St,u,at),Et.target=Q,Et.relatedTarget=ye,ut=Et),ye=ut,xt&&St)e:{for(Et=xt,V=St,j=0,Q=Et;Q;Q=Fs(Q))j++;for(Q=0,ut=V;ut;ut=Fs(ut))Q++;for(;0<j-Q;)Et=Fs(Et),j--;for(;0<Q-j;)V=Fs(V),Q--;for(;j--;){if(Et===V||V!==null&&Et===V.alternate)break e;Et=Fs(Et),V=Fs(V)}Et=null}else Et=null;xt!==null&&em(ot,st,xt,Et,!1),St!==null&&ye!==null&&em(ot,ye,St,Et,!0)}}t:{if(st=J?Ps(J):window,xt=st.nodeName&&st.nodeName.toLowerCase(),xt==="select"||xt==="input"&&st.type==="file")var Mt=Ww;else if(Fg(st))if(Pg)Mt=Gw;else{Mt=qw;var It=Hw}else(xt=st.nodeName)&&xt.toLowerCase()==="input"&&(st.type==="checkbox"||st.type==="radio")&&(Mt=Uw);if(Mt&&(Mt=Mt(i,J))){Ig(ot,Mt,u,at);break t}It&&It(i,st,J),i==="focusout"&&(It=st._wrapperState)&&It.controlled&&st.type==="number"&&Or(st,"number",st.value)}switch(It=J?Ps(J):window,i){case"focusin":(Fg(It)||It.contentEditable==="true")&&($s=It,Sh=J,qa=null);break;case"focusout":qa=Sh=$s=null;break;case"mousedown":Ch=!0;break;case"contextmenu":case"mouseup":case"dragend":Ch=!1,qg(ot,u,at);break;case"selectionchange":if(Xw)break;case"keydown":case"keyup":qg(ot,u,at)}var Pt;if(yh)t:{switch(i){case"compositionstart":var zt="onCompositionStart";break t;case"compositionend":zt="onCompositionEnd";break t;case"compositionupdate":zt="onCompositionUpdate";break t}zt=void 0}else As?$g(i,u)&&(zt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(zt="onCompositionStart");zt&&(Mg&&u.locale!=="ko"&&(As||zt!=="onCompositionStart"?zt==="onCompositionEnd"&&As&&(Pt=kg()):(di=at,hh="value"in di?di.value:di.textContent,As=!0)),It=Tl(J,zt),0<It.length&&(zt=new Eg(zt,i,null,u,at),ot.push({event:zt,listeners:It}),Pt?zt.data=Pt:(Pt=Rg(u),Pt!==null&&(zt.data=Pt)))),(Pt=Dw?Ow(i,u):zw(i,u))&&(J=Tl(J,"onBeforeInput"),0<J.length&&(at=new Eg("onBeforeInput","beforeinput",null,u,at),ot.push({event:at,listeners:J}),at.data=Pt))}Jg(ot,a)})}function Va(i,a,u){return{instance:i,listener:a,currentTarget:u}}function Tl(i,a){for(var u=a+"Capture",p=[];i!==null;){var x=i,S=x.stateNode;x.tag===5&&S!==null&&(x=S,S=Tr(i,u),S!=null&&p.unshift(Va(i,S,x)),S=Tr(i,a),S!=null&&p.push(Va(i,S,x))),i=i.return}return p}function Fs(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function em(i,a,u,p,x){for(var S=a._reactName,M=[];u!==null&&u!==p;){var R=u,D=R.alternate,J=R.stateNode;if(D!==null&&D===p)break;R.tag===5&&J!==null&&(R=J,x?(D=Tr(u,S),D!=null&&M.unshift(Va(u,D,R))):x||(D=Tr(u,S),D!=null&&M.push(Va(u,D,R)))),u=u.return}M.length!==0&&i.push({event:a,listeners:M})}var Jw=/\r\n?/g,tk=/\u0000|\uFFFD/g;function rm(i){return(typeof i=="string"?i:""+i).replace(Jw,`
39
+ `).replace(tk,"")}function El(i,a,u){if(a=rm(a),rm(i)!==a&&u)throw Error(r(425))}function Ll(){}var Lh=null,Mh=null;function Bh(i,a){return i==="textarea"||i==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Ah=typeof setTimeout=="function"?setTimeout:void 0,ek=typeof clearTimeout=="function"?clearTimeout:void 0,nm=typeof Promise=="function"?Promise:void 0,rk=typeof queueMicrotask=="function"?queueMicrotask:typeof nm<"u"?function(i){return nm.resolve(null).then(i).catch(nk)}:Ah;function nk(i){setTimeout(function(){throw i})}function $h(i,a){var u=a,p=0;do{var x=u.nextSibling;if(i.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"){if(p===0){i.removeChild(x),Da(a);return}p--}else u!=="$"&&u!=="$?"&&u!=="$!"||p++;u=x}while(u);Da(a)}function pi(i){for(;i!=null;i=i.nextSibling){var a=i.nodeType;if(a===1||a===3)break;if(a===8){if(a=i.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return i}function im(i){i=i.previousSibling;for(var a=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"){if(a===0)return i;a--}else u==="/$"&&a++}i=i.previousSibling}return null}var Is=Math.random().toString(36).slice(2),Ln="__reactFiber$"+Is,Ya="__reactProps$"+Is,Hn="__reactContainer$"+Is,Rh="__reactEvents$"+Is,ik="__reactListeners$"+Is,sk="__reactHandles$"+Is;function Ui(i){var a=i[Ln];if(a)return a;for(var u=i.parentNode;u;){if(a=u[Hn]||u[Ln]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(i=im(i);i!==null;){if(u=i[Ln])return u;i=im(i)}return a}i=u,u=i.parentNode}return null}function Xa(i){return i=i[Ln]||i[Hn],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Ps(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(r(33))}function Ml(i){return i[Ya]||null}var Fh=[],Ds=-1;function gi(i){return{current:i}}function le(i){0>Ds||(i.current=Fh[Ds],Fh[Ds]=null,Ds--)}function ae(i,a){Ds++,Fh[Ds]=i.current,i.current=a}var mi={},He=gi(mi),pr=gi(!1),Gi=mi;function Os(i,a){var u=i.type.contextTypes;if(!u)return mi;var p=i.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===a)return p.__reactInternalMemoizedMaskedChildContext;var x={},S;for(S in u)x[S]=a[S];return p&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=a,i.__reactInternalMemoizedMaskedChildContext=x),x}function gr(i){return i=i.childContextTypes,i!=null}function Bl(){le(pr),le(He)}function sm(i,a,u){if(He.current!==mi)throw Error(r(168));ae(He,a),ae(pr,u)}function am(i,a,u){var p=i.stateNode;if(a=a.childContextTypes,typeof p.getChildContext!="function")return u;p=p.getChildContext();for(var x in p)if(!(x in a))throw Error(r(108,X(i)||"Unknown",x));return et({},u,p)}function Al(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||mi,Gi=He.current,ae(He,i),ae(pr,pr.current),!0}function om(i,a,u){var p=i.stateNode;if(!p)throw Error(r(169));u?(i=am(i,a,Gi),p.__reactInternalMemoizedMergedChildContext=i,le(pr),le(He),ae(He,i)):le(pr),ae(pr,u)}var qn=null,$l=!1,Ih=!1;function lm(i){qn===null?qn=[i]:qn.push(i)}function ak(i){$l=!0,lm(i)}function yi(){if(!Ih&&qn!==null){Ih=!0;var i=0,a=te;try{var u=qn;for(te=1;i<u.length;i++){var p=u[i];do p=p(!0);while(p!==null)}qn=null,$l=!1}catch(x){throw qn!==null&&(qn=qn.slice(i+1)),O(Be,yi),x}finally{te=a,Ih=!1}}return null}var zs=[],js=0,Rl=null,Fl=0,qr=[],Ur=0,Vi=null,Un=1,Gn="";function Yi(i,a){zs[js++]=Fl,zs[js++]=Rl,Rl=i,Fl=a}function cm(i,a,u){qr[Ur++]=Un,qr[Ur++]=Gn,qr[Ur++]=Vi,Vi=i;var p=Un;i=Gn;var x=32-un(p)-1;p&=~(1<<x),u+=1;var S=32-un(a)+x;if(30<S){var M=x-x%5;S=(p&(1<<M)-1).toString(32),p>>=M,x-=M,Un=1<<32-un(a)+x|u<<x|p,Gn=S+i}else Un=1<<S|u<<x|p,Gn=i}function Ph(i){i.return!==null&&(Yi(i,1),cm(i,1,0))}function Dh(i){for(;i===Rl;)Rl=zs[--js],zs[js]=null,Fl=zs[--js],zs[js]=null;for(;i===Vi;)Vi=qr[--Ur],qr[Ur]=null,Gn=qr[--Ur],qr[Ur]=null,Un=qr[--Ur],qr[Ur]=null}var Mr=null,Br=null,ue=!1,dn=null;function um(i,a){var u=Xr(5,null,null,0);u.elementType="DELETED",u.stateNode=a,u.return=i,a=i.deletions,a===null?(i.deletions=[u],i.flags|=16):a.push(u)}function hm(i,a){switch(i.tag){case 5:var u=i.type;return a=a.nodeType!==1||u.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(i.stateNode=a,Mr=i,Br=pi(a.firstChild),!0):!1;case 6:return a=i.pendingProps===""||a.nodeType!==3?null:a,a!==null?(i.stateNode=a,Mr=i,Br=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(u=Vi!==null?{id:Un,overflow:Gn}:null,i.memoizedState={dehydrated:a,treeContext:u,retryLane:1073741824},u=Xr(18,null,null,0),u.stateNode=a,u.return=i,i.child=u,Mr=i,Br=null,!0):!1;default:return!1}}function Oh(i){return(i.mode&1)!==0&&(i.flags&128)===0}function zh(i){if(ue){var a=Br;if(a){var u=a;if(!hm(i,a)){if(Oh(i))throw Error(r(418));a=pi(u.nextSibling);var p=Mr;a&&hm(i,a)?um(p,u):(i.flags=i.flags&-4097|2,ue=!1,Mr=i)}}else{if(Oh(i))throw Error(r(418));i.flags=i.flags&-4097|2,ue=!1,Mr=i}}}function dm(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Mr=i}function Il(i){if(i!==Mr)return!1;if(!ue)return dm(i),ue=!0,!1;var a;if((a=i.tag!==3)&&!(a=i.tag!==5)&&(a=i.type,a=a!=="head"&&a!=="body"&&!Bh(i.type,i.memoizedProps)),a&&(a=Br)){if(Oh(i))throw fm(),Error(r(418));for(;a;)um(i,a),a=pi(a.nextSibling)}if(dm(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));t:{for(i=i.nextSibling,a=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"){if(a===0){Br=pi(i.nextSibling);break t}a--}else u!=="$"&&u!=="$!"&&u!=="$?"||a++}i=i.nextSibling}Br=null}}else Br=Mr?pi(i.stateNode.nextSibling):null;return!0}function fm(){for(var i=Br;i;)i=pi(i.nextSibling)}function Ns(){Br=Mr=null,ue=!1}function jh(i){dn===null?dn=[i]:dn.push(i)}var ok=L.ReactCurrentBatchConfig;function Qa(i,a,u){if(i=u.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(u._owner){if(u=u._owner,u){if(u.tag!==1)throw Error(r(309));var p=u.stateNode}if(!p)throw Error(r(147,i));var x=p,S=""+i;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===S?a.ref:(a=function(M){var R=x.refs;M===null?delete R[S]:R[S]=M},a._stringRef=S,a)}if(typeof i!="string")throw Error(r(284));if(!u._owner)throw Error(r(290,i))}return i}function Pl(i,a){throw i=Object.prototype.toString.call(a),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":i))}function pm(i){var a=i._init;return a(i._payload)}function gm(i){function a(V,j){if(i){var Q=V.deletions;Q===null?(V.deletions=[j],V.flags|=16):Q.push(j)}}function u(V,j){if(!i)return null;for(;j!==null;)a(V,j),j=j.sibling;return null}function p(V,j){for(V=new Map;j!==null;)j.key!==null?V.set(j.key,j):V.set(j.index,j),j=j.sibling;return V}function x(V,j){return V=_i(V,j),V.index=0,V.sibling=null,V}function S(V,j,Q){return V.index=Q,i?(Q=V.alternate,Q!==null?(Q=Q.index,Q<j?(V.flags|=2,j):Q):(V.flags|=2,j)):(V.flags|=1048576,j)}function M(V){return i&&V.alternate===null&&(V.flags|=2),V}function R(V,j,Q,ut){return j===null||j.tag!==6?(j=Ad(Q,V.mode,ut),j.return=V,j):(j=x(j,Q),j.return=V,j)}function D(V,j,Q,ut){var Mt=Q.type;return Mt===$?at(V,j,Q.props.children,ut,Q.key):j!==null&&(j.elementType===Mt||typeof Mt=="object"&&Mt!==null&&Mt.$$typeof===N&&pm(Mt)===j.type)?(ut=x(j,Q.props),ut.ref=Qa(V,j,Q),ut.return=V,ut):(ut=ac(Q.type,Q.key,Q.props,null,V.mode,ut),ut.ref=Qa(V,j,Q),ut.return=V,ut)}function J(V,j,Q,ut){return j===null||j.tag!==4||j.stateNode.containerInfo!==Q.containerInfo||j.stateNode.implementation!==Q.implementation?(j=$d(Q,V.mode,ut),j.return=V,j):(j=x(j,Q.children||[]),j.return=V,j)}function at(V,j,Q,ut,Mt){return j===null||j.tag!==7?(j=rs(Q,V.mode,ut,Mt),j.return=V,j):(j=x(j,Q),j.return=V,j)}function ot(V,j,Q){if(typeof j=="string"&&j!==""||typeof j=="number")return j=Ad(""+j,V.mode,Q),j.return=V,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case A:return Q=ac(j.type,j.key,j.props,null,V.mode,Q),Q.ref=Qa(V,null,j),Q.return=V,Q;case E:return j=$d(j,V.mode,Q),j.return=V,j;case N:var ut=j._init;return ot(V,ut(j._payload),Q)}if(zr(j)||K(j))return j=rs(j,V.mode,Q,null),j.return=V,j;Pl(V,j)}return null}function st(V,j,Q,ut){var Mt=j!==null?j.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Mt!==null?null:R(V,j,""+Q,ut);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case A:return Q.key===Mt?D(V,j,Q,ut):null;case E:return Q.key===Mt?J(V,j,Q,ut):null;case N:return Mt=Q._init,st(V,j,Mt(Q._payload),ut)}if(zr(Q)||K(Q))return Mt!==null?null:at(V,j,Q,ut,null);Pl(V,Q)}return null}function xt(V,j,Q,ut,Mt){if(typeof ut=="string"&&ut!==""||typeof ut=="number")return V=V.get(Q)||null,R(j,V,""+ut,Mt);if(typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case A:return V=V.get(ut.key===null?Q:ut.key)||null,D(j,V,ut,Mt);case E:return V=V.get(ut.key===null?Q:ut.key)||null,J(j,V,ut,Mt);case N:var It=ut._init;return xt(V,j,Q,It(ut._payload),Mt)}if(zr(ut)||K(ut))return V=V.get(Q)||null,at(j,V,ut,Mt,null);Pl(j,ut)}return null}function St(V,j,Q,ut){for(var Mt=null,It=null,Pt=j,zt=j=0,Re=null;Pt!==null&&zt<Q.length;zt++){Pt.index>zt?(Re=Pt,Pt=null):Re=Pt.sibling;var Yt=st(V,Pt,Q[zt],ut);if(Yt===null){Pt===null&&(Pt=Re);break}i&&Pt&&Yt.alternate===null&&a(V,Pt),j=S(Yt,j,zt),It===null?Mt=Yt:It.sibling=Yt,It=Yt,Pt=Re}if(zt===Q.length)return u(V,Pt),ue&&Yi(V,zt),Mt;if(Pt===null){for(;zt<Q.length;zt++)Pt=ot(V,Q[zt],ut),Pt!==null&&(j=S(Pt,j,zt),It===null?Mt=Pt:It.sibling=Pt,It=Pt);return ue&&Yi(V,zt),Mt}for(Pt=p(V,Pt);zt<Q.length;zt++)Re=xt(Pt,V,zt,Q[zt],ut),Re!==null&&(i&&Re.alternate!==null&&Pt.delete(Re.key===null?zt:Re.key),j=S(Re,j,zt),It===null?Mt=Re:It.sibling=Re,It=Re);return i&&Pt.forEach(function(Ti){return a(V,Ti)}),ue&&Yi(V,zt),Mt}function Et(V,j,Q,ut){var Mt=K(Q);if(typeof Mt!="function")throw Error(r(150));if(Q=Mt.call(Q),Q==null)throw Error(r(151));for(var It=Mt=null,Pt=j,zt=j=0,Re=null,Yt=Q.next();Pt!==null&&!Yt.done;zt++,Yt=Q.next()){Pt.index>zt?(Re=Pt,Pt=null):Re=Pt.sibling;var Ti=st(V,Pt,Yt.value,ut);if(Ti===null){Pt===null&&(Pt=Re);break}i&&Pt&&Ti.alternate===null&&a(V,Pt),j=S(Ti,j,zt),It===null?Mt=Ti:It.sibling=Ti,It=Ti,Pt=Re}if(Yt.done)return u(V,Pt),ue&&Yi(V,zt),Mt;if(Pt===null){for(;!Yt.done;zt++,Yt=Q.next())Yt=ot(V,Yt.value,ut),Yt!==null&&(j=S(Yt,j,zt),It===null?Mt=Yt:It.sibling=Yt,It=Yt);return ue&&Yi(V,zt),Mt}for(Pt=p(V,Pt);!Yt.done;zt++,Yt=Q.next())Yt=xt(Pt,V,zt,Yt.value,ut),Yt!==null&&(i&&Yt.alternate!==null&&Pt.delete(Yt.key===null?zt:Yt.key),j=S(Yt,j,zt),It===null?Mt=Yt:It.sibling=Yt,It=Yt);return i&&Pt.forEach(function(jk){return a(V,jk)}),ue&&Yi(V,zt),Mt}function ye(V,j,Q,ut){if(typeof Q=="object"&&Q!==null&&Q.type===$&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case A:t:{for(var Mt=Q.key,It=j;It!==null;){if(It.key===Mt){if(Mt=Q.type,Mt===$){if(It.tag===7){u(V,It.sibling),j=x(It,Q.props.children),j.return=V,V=j;break t}}else if(It.elementType===Mt||typeof Mt=="object"&&Mt!==null&&Mt.$$typeof===N&&pm(Mt)===It.type){u(V,It.sibling),j=x(It,Q.props),j.ref=Qa(V,It,Q),j.return=V,V=j;break t}u(V,It);break}else a(V,It);It=It.sibling}Q.type===$?(j=rs(Q.props.children,V.mode,ut,Q.key),j.return=V,V=j):(ut=ac(Q.type,Q.key,Q.props,null,V.mode,ut),ut.ref=Qa(V,j,Q),ut.return=V,V=ut)}return M(V);case E:t:{for(It=Q.key;j!==null;){if(j.key===It)if(j.tag===4&&j.stateNode.containerInfo===Q.containerInfo&&j.stateNode.implementation===Q.implementation){u(V,j.sibling),j=x(j,Q.children||[]),j.return=V,V=j;break t}else{u(V,j);break}else a(V,j);j=j.sibling}j=$d(Q,V.mode,ut),j.return=V,V=j}return M(V);case N:return It=Q._init,ye(V,j,It(Q._payload),ut)}if(zr(Q))return St(V,j,Q,ut);if(K(Q))return Et(V,j,Q,ut);Pl(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"?(Q=""+Q,j!==null&&j.tag===6?(u(V,j.sibling),j=x(j,Q),j.return=V,V=j):(u(V,j),j=Ad(Q,V.mode,ut),j.return=V,V=j),M(V)):u(V,j)}return ye}var Ws=gm(!0),mm=gm(!1),Dl=gi(null),Ol=null,Hs=null,Nh=null;function Wh(){Nh=Hs=Ol=null}function Hh(i){var a=Dl.current;le(Dl),i._currentValue=a}function qh(i,a,u){for(;i!==null;){var p=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,p!==null&&(p.childLanes|=a)):p!==null&&(p.childLanes&a)!==a&&(p.childLanes|=a),i===u)break;i=i.return}}function qs(i,a){Ol=i,Nh=Hs=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&a)!==0&&(mr=!0),i.firstContext=null)}function Gr(i){var a=i._currentValue;if(Nh!==i)if(i={context:i,memoizedValue:a,next:null},Hs===null){if(Ol===null)throw Error(r(308));Hs=i,Ol.dependencies={lanes:0,firstContext:i}}else Hs=Hs.next=i;return a}var Xi=null;function Uh(i){Xi===null?Xi=[i]:Xi.push(i)}function ym(i,a,u,p){var x=a.interleaved;return x===null?(u.next=u,Uh(a)):(u.next=x.next,x.next=u),a.interleaved=u,Vn(i,p)}function Vn(i,a){i.lanes|=a;var u=i.alternate;for(u!==null&&(u.lanes|=a),u=i,i=i.return;i!==null;)i.childLanes|=a,u=i.alternate,u!==null&&(u.childLanes|=a),u=i,i=i.return;return u.tag===3?u.stateNode:null}var xi=!1;function Gh(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xm(i,a){i=i.updateQueue,a.updateQueue===i&&(a.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Yn(i,a){return{eventTime:i,lane:a,tag:0,payload:null,callback:null,next:null}}function vi(i,a,u){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(Vt&2)!==0){var x=p.pending;return x===null?a.next=a:(a.next=x.next,x.next=a),p.pending=a,Vn(i,u)}return x=p.interleaved,x===null?(a.next=a,Uh(p)):(a.next=x.next,x.next=a),p.interleaved=a,Vn(i,u)}function zl(i,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194240)!==0)){var p=a.lanes;p&=i.pendingLanes,u|=p,a.lanes=u,ah(i,u)}}function vm(i,a){var u=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var x=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var M={eventTime:u.eventTime,lane:u.lane,tag:u.tag,payload:u.payload,callback:u.callback,next:null};S===null?x=S=M:S=S.next=M,u=u.next}while(u!==null);S===null?x=S=a:S=S.next=a}else x=S=a;u={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:S,shared:p.shared,effects:p.effects},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=a:i.next=a,u.lastBaseUpdate=a}function jl(i,a,u,p){var x=i.updateQueue;xi=!1;var S=x.firstBaseUpdate,M=x.lastBaseUpdate,R=x.shared.pending;if(R!==null){x.shared.pending=null;var D=R,J=D.next;D.next=null,M===null?S=J:M.next=J,M=D;var at=i.alternate;at!==null&&(at=at.updateQueue,R=at.lastBaseUpdate,R!==M&&(R===null?at.firstBaseUpdate=J:R.next=J,at.lastBaseUpdate=D))}if(S!==null){var ot=x.baseState;M=0,at=J=D=null,R=S;do{var st=R.lane,xt=R.eventTime;if((p&st)===st){at!==null&&(at=at.next={eventTime:xt,lane:0,tag:R.tag,payload:R.payload,callback:R.callback,next:null});t:{var St=i,Et=R;switch(st=a,xt=u,Et.tag){case 1:if(St=Et.payload,typeof St=="function"){ot=St.call(xt,ot,st);break t}ot=St;break t;case 3:St.flags=St.flags&-65537|128;case 0:if(St=Et.payload,st=typeof St=="function"?St.call(xt,ot,st):St,st==null)break t;ot=et({},ot,st);break t;case 2:xi=!0}}R.callback!==null&&R.lane!==0&&(i.flags|=64,st=x.effects,st===null?x.effects=[R]:st.push(R))}else xt={eventTime:xt,lane:st,tag:R.tag,payload:R.payload,callback:R.callback,next:null},at===null?(J=at=xt,D=ot):at=at.next=xt,M|=st;if(R=R.next,R===null){if(R=x.shared.pending,R===null)break;st=R,R=st.next,st.next=null,x.lastBaseUpdate=st,x.shared.pending=null}}while(!0);if(at===null&&(D=ot),x.baseState=D,x.firstBaseUpdate=J,x.lastBaseUpdate=at,a=x.shared.interleaved,a!==null){x=a;do M|=x.lane,x=x.next;while(x!==a)}else S===null&&(x.shared.lanes=0);Zi|=M,i.lanes=M,i.memoizedState=ot}}function bm(i,a,u){if(i=a.effects,a.effects=null,i!==null)for(a=0;a<i.length;a++){var p=i[a],x=p.callback;if(x!==null){if(p.callback=null,p=u,typeof x!="function")throw Error(r(191,x));x.call(p)}}}var Ka={},Mn=gi(Ka),Za=gi(Ka),Ja=gi(Ka);function Qi(i){if(i===Ka)throw Error(r(174));return i}function Vh(i,a){switch(ae(Ja,a),ae(Za,i),ae(Mn,Ka),i=a.nodeType,i){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:je(null,"");break;default:i=i===8?a.parentNode:a,a=i.namespaceURI||null,i=i.tagName,a=je(a,i)}le(Mn),ae(Mn,a)}function Us(){le(Mn),le(Za),le(Ja)}function Sm(i){Qi(Ja.current);var a=Qi(Mn.current),u=je(a,i.type);a!==u&&(ae(Za,i),ae(Mn,u))}function Yh(i){Za.current===i&&(le(Mn),le(Za))}var fe=gi(0);function Nl(i){for(var a=i;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||u.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Xh=[];function Qh(){for(var i=0;i<Xh.length;i++)Xh[i]._workInProgressVersionPrimary=null;Xh.length=0}var Wl=L.ReactCurrentDispatcher,Kh=L.ReactCurrentBatchConfig,Ki=0,pe=null,we=null,Ae=null,Hl=!1,to=!1,eo=0,lk=0;function qe(){throw Error(r(321))}function Zh(i,a){if(a===null)return!1;for(var u=0;u<a.length&&u<i.length;u++)if(!hn(i[u],a[u]))return!1;return!0}function Jh(i,a,u,p,x,S){if(Ki=S,pe=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Wl.current=i===null||i.memoizedState===null?dk:fk,i=u(p,x),to){S=0;do{if(to=!1,eo=0,25<=S)throw Error(r(301));S+=1,Ae=we=null,a.updateQueue=null,Wl.current=pk,i=u(p,x)}while(to)}if(Wl.current=Gl,a=we!==null&&we.next!==null,Ki=0,Ae=we=pe=null,Hl=!1,a)throw Error(r(300));return i}function td(){var i=eo!==0;return eo=0,i}function Bn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ae===null?pe.memoizedState=Ae=i:Ae=Ae.next=i,Ae}function Vr(){if(we===null){var i=pe.alternate;i=i!==null?i.memoizedState:null}else i=we.next;var a=Ae===null?pe.memoizedState:Ae.next;if(a!==null)Ae=a,we=i;else{if(i===null)throw Error(r(310));we=i,i={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Ae===null?pe.memoizedState=Ae=i:Ae=Ae.next=i}return Ae}function ro(i,a){return typeof a=="function"?a(i):a}function ed(i){var a=Vr(),u=a.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var p=we,x=p.baseQueue,S=u.pending;if(S!==null){if(x!==null){var M=x.next;x.next=S.next,S.next=M}p.baseQueue=x=S,u.pending=null}if(x!==null){S=x.next,p=p.baseState;var R=M=null,D=null,J=S;do{var at=J.lane;if((Ki&at)===at)D!==null&&(D=D.next={lane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),p=J.hasEagerState?J.eagerState:i(p,J.action);else{var ot={lane:at,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null};D===null?(R=D=ot,M=p):D=D.next=ot,pe.lanes|=at,Zi|=at}J=J.next}while(J!==null&&J!==S);D===null?M=p:D.next=R,hn(p,a.memoizedState)||(mr=!0),a.memoizedState=p,a.baseState=M,a.baseQueue=D,u.lastRenderedState=p}if(i=u.interleaved,i!==null){x=i;do S=x.lane,pe.lanes|=S,Zi|=S,x=x.next;while(x!==i)}else x===null&&(u.lanes=0);return[a.memoizedState,u.dispatch]}function rd(i){var a=Vr(),u=a.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var p=u.dispatch,x=u.pending,S=a.memoizedState;if(x!==null){u.pending=null;var M=x=x.next;do S=i(S,M.action),M=M.next;while(M!==x);hn(S,a.memoizedState)||(mr=!0),a.memoizedState=S,a.baseQueue===null&&(a.baseState=S),u.lastRenderedState=S}return[S,p]}function Cm(){}function wm(i,a){var u=pe,p=Vr(),x=a(),S=!hn(p.memoizedState,x);if(S&&(p.memoizedState=x,mr=!0),p=p.queue,nd(Tm.bind(null,u,p,i),[i]),p.getSnapshot!==a||S||Ae!==null&&Ae.memoizedState.tag&1){if(u.flags|=2048,no(9,_m.bind(null,u,p,x,a),void 0,null),$e===null)throw Error(r(349));(Ki&30)!==0||km(u,a,x)}return x}function km(i,a,u){i.flags|=16384,i={getSnapshot:a,value:u},a=pe.updateQueue,a===null?(a={lastEffect:null,stores:null},pe.updateQueue=a,a.stores=[i]):(u=a.stores,u===null?a.stores=[i]:u.push(i))}function _m(i,a,u,p){a.value=u,a.getSnapshot=p,Em(a)&&Lm(i)}function Tm(i,a,u){return u(function(){Em(a)&&Lm(i)})}function Em(i){var a=i.getSnapshot;i=i.value;try{var u=a();return!hn(i,u)}catch{return!0}}function Lm(i){var a=Vn(i,1);a!==null&&mn(a,i,1,-1)}function Mm(i){var a=Bn();return typeof i=="function"&&(i=i()),a.memoizedState=a.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ro,lastRenderedState:i},a.queue=i,i=i.dispatch=hk.bind(null,pe,i),[a.memoizedState,i]}function no(i,a,u,p){return i={tag:i,create:a,destroy:u,deps:p,next:null},a=pe.updateQueue,a===null?(a={lastEffect:null,stores:null},pe.updateQueue=a,a.lastEffect=i.next=i):(u=a.lastEffect,u===null?a.lastEffect=i.next=i:(p=u.next,u.next=i,i.next=p,a.lastEffect=i)),i}function Bm(){return Vr().memoizedState}function ql(i,a,u,p){var x=Bn();pe.flags|=i,x.memoizedState=no(1|a,u,void 0,p===void 0?null:p)}function Ul(i,a,u,p){var x=Vr();p=p===void 0?null:p;var S=void 0;if(we!==null){var M=we.memoizedState;if(S=M.destroy,p!==null&&Zh(p,M.deps)){x.memoizedState=no(a,u,S,p);return}}pe.flags|=i,x.memoizedState=no(1|a,u,S,p)}function Am(i,a){return ql(8390656,8,i,a)}function nd(i,a){return Ul(2048,8,i,a)}function $m(i,a){return Ul(4,2,i,a)}function Rm(i,a){return Ul(4,4,i,a)}function Fm(i,a){if(typeof a=="function")return i=i(),a(i),function(){a(null)};if(a!=null)return i=i(),a.current=i,function(){a.current=null}}function Im(i,a,u){return u=u!=null?u.concat([i]):null,Ul(4,4,Fm.bind(null,a,i),u)}function id(){}function Pm(i,a){var u=Vr();a=a===void 0?null:a;var p=u.memoizedState;return p!==null&&a!==null&&Zh(a,p[1])?p[0]:(u.memoizedState=[i,a],i)}function Dm(i,a){var u=Vr();a=a===void 0?null:a;var p=u.memoizedState;return p!==null&&a!==null&&Zh(a,p[1])?p[0]:(i=i(),u.memoizedState=[i,a],i)}function Om(i,a,u){return(Ki&21)===0?(i.baseState&&(i.baseState=!1,mr=!0),i.memoizedState=u):(hn(u,a)||(u=pg(),pe.lanes|=u,Zi|=u,i.baseState=!0),a)}function ck(i,a){var u=te;te=u!==0&&4>u?u:4,i(!0);var p=Kh.transition;Kh.transition={};try{i(!1),a()}finally{te=u,Kh.transition=p}}function zm(){return Vr().memoizedState}function uk(i,a,u){var p=wi(i);if(u={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null},jm(i))Nm(a,u);else if(u=ym(i,a,u,p),u!==null){var x=er();mn(u,i,p,x),Wm(u,a,p)}}function hk(i,a,u){var p=wi(i),x={lane:p,action:u,hasEagerState:!1,eagerState:null,next:null};if(jm(i))Nm(a,x);else{var S=i.alternate;if(i.lanes===0&&(S===null||S.lanes===0)&&(S=a.lastRenderedReducer,S!==null))try{var M=a.lastRenderedState,R=S(M,u);if(x.hasEagerState=!0,x.eagerState=R,hn(R,M)){var D=a.interleaved;D===null?(x.next=x,Uh(a)):(x.next=D.next,D.next=x),a.interleaved=x;return}}catch{}finally{}u=ym(i,a,x,p),u!==null&&(x=er(),mn(u,i,p,x),Wm(u,a,p))}}function jm(i){var a=i.alternate;return i===pe||a!==null&&a===pe}function Nm(i,a){to=Hl=!0;var u=i.pending;u===null?a.next=a:(a.next=u.next,u.next=a),i.pending=a}function Wm(i,a,u){if((u&4194240)!==0){var p=a.lanes;p&=i.pendingLanes,u|=p,a.lanes=u,ah(i,u)}}var Gl={readContext:Gr,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useInsertionEffect:qe,useLayoutEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useMutableSource:qe,useSyncExternalStore:qe,useId:qe,unstable_isNewReconciler:!1},dk={readContext:Gr,useCallback:function(i,a){return Bn().memoizedState=[i,a===void 0?null:a],i},useContext:Gr,useEffect:Am,useImperativeHandle:function(i,a,u){return u=u!=null?u.concat([i]):null,ql(4194308,4,Fm.bind(null,a,i),u)},useLayoutEffect:function(i,a){return ql(4194308,4,i,a)},useInsertionEffect:function(i,a){return ql(4,2,i,a)},useMemo:function(i,a){var u=Bn();return a=a===void 0?null:a,i=i(),u.memoizedState=[i,a],i},useReducer:function(i,a,u){var p=Bn();return a=u!==void 0?u(a):a,p.memoizedState=p.baseState=a,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:a},p.queue=i,i=i.dispatch=uk.bind(null,pe,i),[p.memoizedState,i]},useRef:function(i){var a=Bn();return i={current:i},a.memoizedState=i},useState:Mm,useDebugValue:id,useDeferredValue:function(i){return Bn().memoizedState=i},useTransition:function(){var i=Mm(!1),a=i[0];return i=ck.bind(null,i[1]),Bn().memoizedState=i,[a,i]},useMutableSource:function(){},useSyncExternalStore:function(i,a,u){var p=pe,x=Bn();if(ue){if(u===void 0)throw Error(r(407));u=u()}else{if(u=a(),$e===null)throw Error(r(349));(Ki&30)!==0||km(p,a,u)}x.memoizedState=u;var S={value:u,getSnapshot:a};return x.queue=S,Am(Tm.bind(null,p,S,i),[i]),p.flags|=2048,no(9,_m.bind(null,p,S,u,a),void 0,null),u},useId:function(){var i=Bn(),a=$e.identifierPrefix;if(ue){var u=Gn,p=Un;u=(p&~(1<<32-un(p)-1)).toString(32)+u,a=":"+a+"R"+u,u=eo++,0<u&&(a+="H"+u.toString(32)),a+=":"}else u=lk++,a=":"+a+"r"+u.toString(32)+":";return i.memoizedState=a},unstable_isNewReconciler:!1},fk={readContext:Gr,useCallback:Pm,useContext:Gr,useEffect:nd,useImperativeHandle:Im,useInsertionEffect:$m,useLayoutEffect:Rm,useMemo:Dm,useReducer:ed,useRef:Bm,useState:function(){return ed(ro)},useDebugValue:id,useDeferredValue:function(i){var a=Vr();return Om(a,we.memoizedState,i)},useTransition:function(){var i=ed(ro)[0],a=Vr().memoizedState;return[i,a]},useMutableSource:Cm,useSyncExternalStore:wm,useId:zm,unstable_isNewReconciler:!1},pk={readContext:Gr,useCallback:Pm,useContext:Gr,useEffect:nd,useImperativeHandle:Im,useInsertionEffect:$m,useLayoutEffect:Rm,useMemo:Dm,useReducer:rd,useRef:Bm,useState:function(){return rd(ro)},useDebugValue:id,useDeferredValue:function(i){var a=Vr();return we===null?a.memoizedState=i:Om(a,we.memoizedState,i)},useTransition:function(){var i=rd(ro)[0],a=Vr().memoizedState;return[i,a]},useMutableSource:Cm,useSyncExternalStore:wm,useId:zm,unstable_isNewReconciler:!1};function fn(i,a){if(i&&i.defaultProps){a=et({},a),i=i.defaultProps;for(var u in i)a[u]===void 0&&(a[u]=i[u]);return a}return a}function sd(i,a,u,p){a=i.memoizedState,u=u(p,a),u=u==null?a:et({},a,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Vl={isMounted:function(i){return(i=i._reactInternals)?En(i)===i:!1},enqueueSetState:function(i,a,u){i=i._reactInternals;var p=er(),x=wi(i),S=Yn(p,x);S.payload=a,u!=null&&(S.callback=u),a=vi(i,S,x),a!==null&&(mn(a,i,x,p),zl(a,i,x))},enqueueReplaceState:function(i,a,u){i=i._reactInternals;var p=er(),x=wi(i),S=Yn(p,x);S.tag=1,S.payload=a,u!=null&&(S.callback=u),a=vi(i,S,x),a!==null&&(mn(a,i,x,p),zl(a,i,x))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var u=er(),p=wi(i),x=Yn(u,p);x.tag=2,a!=null&&(x.callback=a),a=vi(i,x,p),a!==null&&(mn(a,i,p,u),zl(a,i,p))}};function Hm(i,a,u,p,x,S,M){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,S,M):a.prototype&&a.prototype.isPureReactComponent?!Ha(u,p)||!Ha(x,S):!0}function qm(i,a,u){var p=!1,x=mi,S=a.contextType;return typeof S=="object"&&S!==null?S=Gr(S):(x=gr(a)?Gi:He.current,p=a.contextTypes,S=(p=p!=null)?Os(i,x):mi),a=new a(u,S),i.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vl,i.stateNode=a,a._reactInternals=i,p&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=x,i.__reactInternalMemoizedMaskedChildContext=S),a}function Um(i,a,u,p){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,p),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,p),a.state!==i&&Vl.enqueueReplaceState(a,a.state,null)}function ad(i,a,u,p){var x=i.stateNode;x.props=u,x.state=i.memoizedState,x.refs={},Gh(i);var S=a.contextType;typeof S=="object"&&S!==null?x.context=Gr(S):(S=gr(a)?Gi:He.current,x.context=Os(i,S)),x.state=i.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(sd(i,a,S,u),x.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(a=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),a!==x.state&&Vl.enqueueReplaceState(x,x.state,null),jl(i,u,x,p),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308)}function Gs(i,a){try{var u="",p=a;do u+=dt(p),p=p.return;while(p);var x=u}catch(S){x=`
40
+ Error generating stack: `+S.message+`
41
+ `+S.stack}return{value:i,source:a,stack:x,digest:null}}function od(i,a,u){return{value:i,source:null,stack:u??null,digest:a??null}}function ld(i,a){try{console.error(a.value)}catch(u){setTimeout(function(){throw u})}}var gk=typeof WeakMap=="function"?WeakMap:Map;function Gm(i,a,u){u=Yn(-1,u),u.tag=3,u.payload={element:null};var p=a.value;return u.callback=function(){tc||(tc=!0,wd=p),ld(i,a)},u}function Vm(i,a,u){u=Yn(-1,u),u.tag=3;var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var x=a.value;u.payload=function(){return p(x)},u.callback=function(){ld(i,a)}}var S=i.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(u.callback=function(){ld(i,a),typeof p!="function"&&(Si===null?Si=new Set([this]):Si.add(this));var M=a.stack;this.componentDidCatch(a.value,{componentStack:M!==null?M:""})}),u}function Ym(i,a,u){var p=i.pingCache;if(p===null){p=i.pingCache=new gk;var x=new Set;p.set(a,x)}else x=p.get(a),x===void 0&&(x=new Set,p.set(a,x));x.has(u)||(x.add(u),i=Mk.bind(null,i,a,u),a.then(i,i))}function Xm(i){do{var a;if((a=i.tag===13)&&(a=i.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return i;i=i.return}while(i!==null);return null}function Qm(i,a,u,p,x){return(i.mode&1)===0?(i===a?i.flags|=65536:(i.flags|=128,u.flags|=131072,u.flags&=-52805,u.tag===1&&(u.alternate===null?u.tag=17:(a=Yn(-1,1),a.tag=2,vi(u,a,1))),u.lanes|=1),i):(i.flags|=65536,i.lanes=x,i)}var mk=L.ReactCurrentOwner,mr=!1;function tr(i,a,u,p){a.child=i===null?mm(a,null,u,p):Ws(a,i.child,u,p)}function Km(i,a,u,p,x){u=u.render;var S=a.ref;return qs(a,x),p=Jh(i,a,u,p,S,x),u=td(),i!==null&&!mr?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~x,Xn(i,a,x)):(ue&&u&&Ph(a),a.flags|=1,tr(i,a,p,x),a.child)}function Zm(i,a,u,p,x){if(i===null){var S=u.type;return typeof S=="function"&&!Bd(S)&&S.defaultProps===void 0&&u.compare===null&&u.defaultProps===void 0?(a.tag=15,a.type=S,Jm(i,a,S,p,x)):(i=ac(u.type,null,p,a,a.mode,x),i.ref=a.ref,i.return=a,a.child=i)}if(S=i.child,(i.lanes&x)===0){var M=S.memoizedProps;if(u=u.compare,u=u!==null?u:Ha,u(M,p)&&i.ref===a.ref)return Xn(i,a,x)}return a.flags|=1,i=_i(S,p),i.ref=a.ref,i.return=a,a.child=i}function Jm(i,a,u,p,x){if(i!==null){var S=i.memoizedProps;if(Ha(S,p)&&i.ref===a.ref)if(mr=!1,a.pendingProps=p=S,(i.lanes&x)!==0)(i.flags&131072)!==0&&(mr=!0);else return a.lanes=i.lanes,Xn(i,a,x)}return cd(i,a,u,p,x)}function ty(i,a,u){var p=a.pendingProps,x=p.children,S=i!==null?i.memoizedState:null;if(p.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},ae(Ys,Ar),Ar|=u;else{if((u&1073741824)===0)return i=S!==null?S.baseLanes|u:u,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:i,cachePool:null,transitions:null},a.updateQueue=null,ae(Ys,Ar),Ar|=i,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},p=S!==null?S.baseLanes:u,ae(Ys,Ar),Ar|=p}else S!==null?(p=S.baseLanes|u,a.memoizedState=null):p=u,ae(Ys,Ar),Ar|=p;return tr(i,a,x,u),a.child}function ey(i,a){var u=a.ref;(i===null&&u!==null||i!==null&&i.ref!==u)&&(a.flags|=512,a.flags|=2097152)}function cd(i,a,u,p,x){var S=gr(u)?Gi:He.current;return S=Os(a,S),qs(a,x),u=Jh(i,a,u,p,S,x),p=td(),i!==null&&!mr?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~x,Xn(i,a,x)):(ue&&p&&Ph(a),a.flags|=1,tr(i,a,u,x),a.child)}function ry(i,a,u,p,x){if(gr(u)){var S=!0;Al(a)}else S=!1;if(qs(a,x),a.stateNode===null)Xl(i,a),qm(a,u,p),ad(a,u,p,x),p=!0;else if(i===null){var M=a.stateNode,R=a.memoizedProps;M.props=R;var D=M.context,J=u.contextType;typeof J=="object"&&J!==null?J=Gr(J):(J=gr(u)?Gi:He.current,J=Os(a,J));var at=u.getDerivedStateFromProps,ot=typeof at=="function"||typeof M.getSnapshotBeforeUpdate=="function";ot||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(R!==p||D!==J)&&Um(a,M,p,J),xi=!1;var st=a.memoizedState;M.state=st,jl(a,p,M,x),D=a.memoizedState,R!==p||st!==D||pr.current||xi?(typeof at=="function"&&(sd(a,u,at,p),D=a.memoizedState),(R=xi||Hm(a,u,R,p,st,D,J))?(ot||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(a.flags|=4194308)):(typeof M.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=p,a.memoizedState=D),M.props=p,M.state=D,M.context=J,p=R):(typeof M.componentDidMount=="function"&&(a.flags|=4194308),p=!1)}else{M=a.stateNode,xm(i,a),R=a.memoizedProps,J=a.type===a.elementType?R:fn(a.type,R),M.props=J,ot=a.pendingProps,st=M.context,D=u.contextType,typeof D=="object"&&D!==null?D=Gr(D):(D=gr(u)?Gi:He.current,D=Os(a,D));var xt=u.getDerivedStateFromProps;(at=typeof xt=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(R!==ot||st!==D)&&Um(a,M,p,D),xi=!1,st=a.memoizedState,M.state=st,jl(a,p,M,x);var St=a.memoizedState;R!==ot||st!==St||pr.current||xi?(typeof xt=="function"&&(sd(a,u,xt,p),St=a.memoizedState),(J=xi||Hm(a,u,J,p,st,St,D)||!1)?(at||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(p,St,D),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(p,St,D)),typeof M.componentDidUpdate=="function"&&(a.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof M.componentDidUpdate!="function"||R===i.memoizedProps&&st===i.memoizedState||(a.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||R===i.memoizedProps&&st===i.memoizedState||(a.flags|=1024),a.memoizedProps=p,a.memoizedState=St),M.props=p,M.state=St,M.context=D,p=J):(typeof M.componentDidUpdate!="function"||R===i.memoizedProps&&st===i.memoizedState||(a.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||R===i.memoizedProps&&st===i.memoizedState||(a.flags|=1024),p=!1)}return ud(i,a,u,p,S,x)}function ud(i,a,u,p,x,S){ey(i,a);var M=(a.flags&128)!==0;if(!p&&!M)return x&&om(a,u,!1),Xn(i,a,S);p=a.stateNode,mk.current=a;var R=M&&typeof u.getDerivedStateFromError!="function"?null:p.render();return a.flags|=1,i!==null&&M?(a.child=Ws(a,i.child,null,S),a.child=Ws(a,null,R,S)):tr(i,a,R,S),a.memoizedState=p.state,x&&om(a,u,!0),a.child}function ny(i){var a=i.stateNode;a.pendingContext?sm(i,a.pendingContext,a.pendingContext!==a.context):a.context&&sm(i,a.context,!1),Vh(i,a.containerInfo)}function iy(i,a,u,p,x){return Ns(),jh(x),a.flags|=256,tr(i,a,u,p),a.child}var hd={dehydrated:null,treeContext:null,retryLane:0};function dd(i){return{baseLanes:i,cachePool:null,transitions:null}}function sy(i,a,u){var p=a.pendingProps,x=fe.current,S=!1,M=(a.flags&128)!==0,R;if((R=M)||(R=i!==null&&i.memoizedState===null?!1:(x&2)!==0),R?(S=!0,a.flags&=-129):(i===null||i.memoizedState!==null)&&(x|=1),ae(fe,x&1),i===null)return zh(a),i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((a.mode&1)===0?a.lanes=1:i.data==="$!"?a.lanes=8:a.lanes=1073741824,null):(M=p.children,i=p.fallback,S?(p=a.mode,S=a.child,M={mode:"hidden",children:M},(p&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=M):S=oc(M,p,0,null),i=rs(i,p,u,null),S.return=a,i.return=a,S.sibling=i,a.child=S,a.child.memoizedState=dd(u),a.memoizedState=hd,i):fd(a,M));if(x=i.memoizedState,x!==null&&(R=x.dehydrated,R!==null))return yk(i,a,M,p,R,x,u);if(S){S=p.fallback,M=a.mode,x=i.child,R=x.sibling;var D={mode:"hidden",children:p.children};return(M&1)===0&&a.child!==x?(p=a.child,p.childLanes=0,p.pendingProps=D,a.deletions=null):(p=_i(x,D),p.subtreeFlags=x.subtreeFlags&14680064),R!==null?S=_i(R,S):(S=rs(S,M,u,null),S.flags|=2),S.return=a,p.return=a,p.sibling=S,a.child=p,p=S,S=a.child,M=i.child.memoizedState,M=M===null?dd(u):{baseLanes:M.baseLanes|u,cachePool:null,transitions:M.transitions},S.memoizedState=M,S.childLanes=i.childLanes&~u,a.memoizedState=hd,p}return S=i.child,i=S.sibling,p=_i(S,{mode:"visible",children:p.children}),(a.mode&1)===0&&(p.lanes=u),p.return=a,p.sibling=null,i!==null&&(u=a.deletions,u===null?(a.deletions=[i],a.flags|=16):u.push(i)),a.child=p,a.memoizedState=null,p}function fd(i,a){return a=oc({mode:"visible",children:a},i.mode,0,null),a.return=i,i.child=a}function Yl(i,a,u,p){return p!==null&&jh(p),Ws(a,i.child,null,u),i=fd(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function yk(i,a,u,p,x,S,M){if(u)return a.flags&256?(a.flags&=-257,p=od(Error(r(422))),Yl(i,a,M,p)):a.memoizedState!==null?(a.child=i.child,a.flags|=128,null):(S=p.fallback,x=a.mode,p=oc({mode:"visible",children:p.children},x,0,null),S=rs(S,x,M,null),S.flags|=2,p.return=a,S.return=a,p.sibling=S,a.child=p,(a.mode&1)!==0&&Ws(a,i.child,null,M),a.child.memoizedState=dd(M),a.memoizedState=hd,S);if((a.mode&1)===0)return Yl(i,a,M,null);if(x.data==="$!"){if(p=x.nextSibling&&x.nextSibling.dataset,p)var R=p.dgst;return p=R,S=Error(r(419)),p=od(S,p,void 0),Yl(i,a,M,p)}if(R=(M&i.childLanes)!==0,mr||R){if(p=$e,p!==null){switch(M&-M){case 4:x=2;break;case 16:x=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:x=32;break;case 536870912:x=268435456;break;default:x=0}x=(x&(p.suspendedLanes|M))!==0?0:x,x!==0&&x!==S.retryLane&&(S.retryLane=x,Vn(i,x),mn(p,i,x,-1))}return Md(),p=od(Error(r(421))),Yl(i,a,M,p)}return x.data==="$?"?(a.flags|=128,a.child=i.child,a=Bk.bind(null,i),x._reactRetry=a,null):(i=S.treeContext,Br=pi(x.nextSibling),Mr=a,ue=!0,dn=null,i!==null&&(qr[Ur++]=Un,qr[Ur++]=Gn,qr[Ur++]=Vi,Un=i.id,Gn=i.overflow,Vi=a),a=fd(a,p.children),a.flags|=4096,a)}function ay(i,a,u){i.lanes|=a;var p=i.alternate;p!==null&&(p.lanes|=a),qh(i.return,a,u)}function pd(i,a,u,p,x){var S=i.memoizedState;S===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:x}:(S.isBackwards=a,S.rendering=null,S.renderingStartTime=0,S.last=p,S.tail=u,S.tailMode=x)}function oy(i,a,u){var p=a.pendingProps,x=p.revealOrder,S=p.tail;if(tr(i,a,p.children,u),p=fe.current,(p&2)!==0)p=p&1|2,a.flags|=128;else{if(i!==null&&(i.flags&128)!==0)t:for(i=a.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&ay(i,u,a);else if(i.tag===19)ay(i,u,a);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break t;for(;i.sibling===null;){if(i.return===null||i.return===a)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}p&=1}if(ae(fe,p),(a.mode&1)===0)a.memoizedState=null;else switch(x){case"forwards":for(u=a.child,x=null;u!==null;)i=u.alternate,i!==null&&Nl(i)===null&&(x=u),u=u.sibling;u=x,u===null?(x=a.child,a.child=null):(x=u.sibling,u.sibling=null),pd(a,!1,x,u,S);break;case"backwards":for(u=null,x=a.child,a.child=null;x!==null;){if(i=x.alternate,i!==null&&Nl(i)===null){a.child=x;break}i=x.sibling,x.sibling=u,u=x,x=i}pd(a,!0,u,null,S);break;case"together":pd(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Xl(i,a){(a.mode&1)===0&&i!==null&&(i.alternate=null,a.alternate=null,a.flags|=2)}function Xn(i,a,u){if(i!==null&&(a.dependencies=i.dependencies),Zi|=a.lanes,(u&a.childLanes)===0)return null;if(i!==null&&a.child!==i.child)throw Error(r(153));if(a.child!==null){for(i=a.child,u=_i(i,i.pendingProps),a.child=u,u.return=a;i.sibling!==null;)i=i.sibling,u=u.sibling=_i(i,i.pendingProps),u.return=a;u.sibling=null}return a.child}function xk(i,a,u){switch(a.tag){case 3:ny(a),Ns();break;case 5:Sm(a);break;case 1:gr(a.type)&&Al(a);break;case 4:Vh(a,a.stateNode.containerInfo);break;case 10:var p=a.type._context,x=a.memoizedProps.value;ae(Dl,p._currentValue),p._currentValue=x;break;case 13:if(p=a.memoizedState,p!==null)return p.dehydrated!==null?(ae(fe,fe.current&1),a.flags|=128,null):(u&a.child.childLanes)!==0?sy(i,a,u):(ae(fe,fe.current&1),i=Xn(i,a,u),i!==null?i.sibling:null);ae(fe,fe.current&1);break;case 19:if(p=(u&a.childLanes)!==0,(i.flags&128)!==0){if(p)return oy(i,a,u);a.flags|=128}if(x=a.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),ae(fe,fe.current),p)break;return null;case 22:case 23:return a.lanes=0,ty(i,a,u)}return Xn(i,a,u)}var ly,gd,cy,uy;ly=function(i,a){for(var u=a.child;u!==null;){if(u.tag===5||u.tag===6)i.appendChild(u.stateNode);else if(u.tag!==4&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return;u=u.return}u.sibling.return=u.return,u=u.sibling}},gd=function(){},cy=function(i,a,u,p){var x=i.memoizedProps;if(x!==p){i=a.stateNode,Qi(Mn.current);var S=null;switch(u){case"input":x=cr(i,x),p=cr(i,p),S=[];break;case"select":x=et({},x,{value:void 0}),p=et({},p,{value:void 0}),S=[];break;case"textarea":x=jr(i,x),p=jr(i,p),S=[];break;default:typeof x.onClick!="function"&&typeof p.onClick=="function"&&(i.onclick=Ll)}Ne(u,p);var M;u=null;for(J in x)if(!p.hasOwnProperty(J)&&x.hasOwnProperty(J)&&x[J]!=null)if(J==="style"){var R=x[J];for(M in R)R.hasOwnProperty(M)&&(u||(u={}),u[M]="")}else J!=="dangerouslySetInnerHTML"&&J!=="children"&&J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&J!=="autoFocus"&&(s.hasOwnProperty(J)?S||(S=[]):(S=S||[]).push(J,null));for(J in p){var D=p[J];if(R=x!=null?x[J]:void 0,p.hasOwnProperty(J)&&D!==R&&(D!=null||R!=null))if(J==="style")if(R){for(M in R)!R.hasOwnProperty(M)||D&&D.hasOwnProperty(M)||(u||(u={}),u[M]="");for(M in D)D.hasOwnProperty(M)&&R[M]!==D[M]&&(u||(u={}),u[M]=D[M])}else u||(S||(S=[]),S.push(J,u)),u=D;else J==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,R=R?R.__html:void 0,D!=null&&R!==D&&(S=S||[]).push(J,D)):J==="children"?typeof D!="string"&&typeof D!="number"||(S=S||[]).push(J,""+D):J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&(s.hasOwnProperty(J)?(D!=null&&J==="onScroll"&&oe("scroll",i),S||R===D||(S=[])):(S=S||[]).push(J,D))}u&&(S=S||[]).push("style",u);var J=S;(a.updateQueue=J)&&(a.flags|=4)}},uy=function(i,a,u,p){u!==p&&(a.flags|=4)};function io(i,a){if(!ue)switch(i.tailMode){case"hidden":a=i.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function Ue(i){var a=i.alternate!==null&&i.alternate.child===i.child,u=0,p=0;if(a)for(var x=i.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags&14680064,p|=x.flags&14680064,x.return=i,x=x.sibling;else for(x=i.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags,p|=x.flags,x.return=i,x=x.sibling;return i.subtreeFlags|=p,i.childLanes=u,a}function vk(i,a,u){var p=a.pendingProps;switch(Dh(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(a),null;case 1:return gr(a.type)&&Bl(),Ue(a),null;case 3:return p=a.stateNode,Us(),le(pr),le(He),Qh(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(i===null||i.child===null)&&(Il(a)?a.flags|=4:i===null||i.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,dn!==null&&(Td(dn),dn=null))),gd(i,a),Ue(a),null;case 5:Yh(a);var x=Qi(Ja.current);if(u=a.type,i!==null&&a.stateNode!=null)cy(i,a,u,p,x),i.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!p){if(a.stateNode===null)throw Error(r(166));return Ue(a),null}if(i=Qi(Mn.current),Il(a)){p=a.stateNode,u=a.type;var S=a.memoizedProps;switch(p[Ln]=a,p[Ya]=S,i=(a.mode&1)!==0,u){case"dialog":oe("cancel",p),oe("close",p);break;case"iframe":case"object":case"embed":oe("load",p);break;case"video":case"audio":for(x=0;x<Ua.length;x++)oe(Ua[x],p);break;case"source":oe("error",p);break;case"img":case"image":case"link":oe("error",p),oe("load",p);break;case"details":oe("toggle",p);break;case"input":Dr(p,S),oe("invalid",p);break;case"select":p._wrapperState={wasMultiple:!!S.multiple},oe("invalid",p);break;case"textarea":Ts(p,S),oe("invalid",p)}Ne(u,S),x=null;for(var M in S)if(S.hasOwnProperty(M)){var R=S[M];M==="children"?typeof R=="string"?p.textContent!==R&&(S.suppressHydrationWarning!==!0&&El(p.textContent,R,i),x=["children",R]):typeof R=="number"&&p.textContent!==""+R&&(S.suppressHydrationWarning!==!0&&El(p.textContent,R,i),x=["children",""+R]):s.hasOwnProperty(M)&&R!=null&&M==="onScroll"&&oe("scroll",p)}switch(u){case"input":ie(p),ur(p,S,!0);break;case"textarea":ie(p),kn(p);break;case"select":case"option":break;default:typeof S.onClick=="function"&&(p.onclick=Ll)}p=x,a.updateQueue=p,p!==null&&(a.flags|=4)}else{M=x.nodeType===9?x:x.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=rn(u)),i==="http://www.w3.org/1999/xhtml"?u==="script"?(i=M.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof p.is=="string"?i=M.createElement(u,{is:p.is}):(i=M.createElement(u),u==="select"&&(M=i,p.multiple?M.multiple=!0:p.size&&(M.size=p.size))):i=M.createElementNS(i,u),i[Ln]=a,i[Ya]=p,ly(i,a,!1,!1),a.stateNode=i;t:{switch(M=_r(u,p),u){case"dialog":oe("cancel",i),oe("close",i),x=p;break;case"iframe":case"object":case"embed":oe("load",i),x=p;break;case"video":case"audio":for(x=0;x<Ua.length;x++)oe(Ua[x],i);x=p;break;case"source":oe("error",i),x=p;break;case"img":case"image":case"link":oe("error",i),oe("load",i),x=p;break;case"details":oe("toggle",i),x=p;break;case"input":Dr(i,p),x=cr(i,p),oe("invalid",i);break;case"option":x=p;break;case"select":i._wrapperState={wasMultiple:!!p.multiple},x=et({},p,{value:void 0}),oe("invalid",i);break;case"textarea":Ts(i,p),x=jr(i,p),oe("invalid",i);break;default:x=p}Ne(u,x),R=x;for(S in R)if(R.hasOwnProperty(S)){var D=R[S];S==="style"?kr(i,D):S==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,D!=null&&hr(i,D)):S==="children"?typeof D=="string"?(u!=="textarea"||D!=="")&&nn(i,D):typeof D=="number"&&nn(i,""+D):S!=="suppressContentEditableWarning"&&S!=="suppressHydrationWarning"&&S!=="autoFocus"&&(s.hasOwnProperty(S)?D!=null&&S==="onScroll"&&oe("scroll",i):D!=null&&B(i,S,D,M))}switch(u){case"input":ie(i),ur(i,p,!1);break;case"textarea":ie(i),kn(i);break;case"option":p.value!=null&&i.setAttribute("value",""+ft(p.value));break;case"select":i.multiple=!!p.multiple,S=p.value,S!=null?en(i,!!p.multiple,S,!1):p.defaultValue!=null&&en(i,!!p.multiple,p.defaultValue,!0);break;default:typeof x.onClick=="function"&&(i.onclick=Ll)}switch(u){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break t;case"img":p=!0;break t;default:p=!1}}p&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return Ue(a),null;case 6:if(i&&a.stateNode!=null)uy(i,a,i.memoizedProps,p);else{if(typeof p!="string"&&a.stateNode===null)throw Error(r(166));if(u=Qi(Ja.current),Qi(Mn.current),Il(a)){if(p=a.stateNode,u=a.memoizedProps,p[Ln]=a,(S=p.nodeValue!==u)&&(i=Mr,i!==null))switch(i.tag){case 3:El(p.nodeValue,u,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&El(p.nodeValue,u,(i.mode&1)!==0)}S&&(a.flags|=4)}else p=(u.nodeType===9?u:u.ownerDocument).createTextNode(p),p[Ln]=a,a.stateNode=p}return Ue(a),null;case 13:if(le(fe),p=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(ue&&Br!==null&&(a.mode&1)!==0&&(a.flags&128)===0)fm(),Ns(),a.flags|=98560,S=!1;else if(S=Il(a),p!==null&&p.dehydrated!==null){if(i===null){if(!S)throw Error(r(318));if(S=a.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[Ln]=a}else Ns(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Ue(a),S=!1}else dn!==null&&(Td(dn),dn=null),S=!0;if(!S)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=u,a):(p=p!==null,p!==(i!==null&&i.memoizedState!==null)&&p&&(a.child.flags|=8192,(a.mode&1)!==0&&(i===null||(fe.current&1)!==0?ke===0&&(ke=3):Md())),a.updateQueue!==null&&(a.flags|=4),Ue(a),null);case 4:return Us(),gd(i,a),i===null&&Ga(a.stateNode.containerInfo),Ue(a),null;case 10:return Hh(a.type._context),Ue(a),null;case 17:return gr(a.type)&&Bl(),Ue(a),null;case 19:if(le(fe),S=a.memoizedState,S===null)return Ue(a),null;if(p=(a.flags&128)!==0,M=S.rendering,M===null)if(p)io(S,!1);else{if(ke!==0||i!==null&&(i.flags&128)!==0)for(i=a.child;i!==null;){if(M=Nl(i),M!==null){for(a.flags|=128,io(S,!1),p=M.updateQueue,p!==null&&(a.updateQueue=p,a.flags|=4),a.subtreeFlags=0,p=u,u=a.child;u!==null;)S=u,i=p,S.flags&=14680066,M=S.alternate,M===null?(S.childLanes=0,S.lanes=i,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=M.childLanes,S.lanes=M.lanes,S.child=M.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=M.memoizedProps,S.memoizedState=M.memoizedState,S.updateQueue=M.updateQueue,S.type=M.type,i=M.dependencies,S.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),u=u.sibling;return ae(fe,fe.current&1|2),a.child}i=i.sibling}S.tail!==null&&Nt()>Xs&&(a.flags|=128,p=!0,io(S,!1),a.lanes=4194304)}else{if(!p)if(i=Nl(M),i!==null){if(a.flags|=128,p=!0,u=i.updateQueue,u!==null&&(a.updateQueue=u,a.flags|=4),io(S,!0),S.tail===null&&S.tailMode==="hidden"&&!M.alternate&&!ue)return Ue(a),null}else 2*Nt()-S.renderingStartTime>Xs&&u!==1073741824&&(a.flags|=128,p=!0,io(S,!1),a.lanes=4194304);S.isBackwards?(M.sibling=a.child,a.child=M):(u=S.last,u!==null?u.sibling=M:a.child=M,S.last=M)}return S.tail!==null?(a=S.tail,S.rendering=a,S.tail=a.sibling,S.renderingStartTime=Nt(),a.sibling=null,u=fe.current,ae(fe,p?u&1|2:u&1),a):(Ue(a),null);case 22:case 23:return Ld(),p=a.memoizedState!==null,i!==null&&i.memoizedState!==null!==p&&(a.flags|=8192),p&&(a.mode&1)!==0?(Ar&1073741824)!==0&&(Ue(a),a.subtreeFlags&6&&(a.flags|=8192)):Ue(a),null;case 24:return null;case 25:return null}throw Error(r(156,a.tag))}function bk(i,a){switch(Dh(a),a.tag){case 1:return gr(a.type)&&Bl(),i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 3:return Us(),le(pr),le(He),Qh(),i=a.flags,(i&65536)!==0&&(i&128)===0?(a.flags=i&-65537|128,a):null;case 5:return Yh(a),null;case 13:if(le(fe),i=a.memoizedState,i!==null&&i.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Ns()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 19:return le(fe),null;case 4:return Us(),null;case 10:return Hh(a.type._context),null;case 22:case 23:return Ld(),null;case 24:return null;default:return null}}var Ql=!1,Ge=!1,Sk=typeof WeakSet=="function"?WeakSet:Set,bt=null;function Vs(i,a){var u=i.ref;if(u!==null)if(typeof u=="function")try{u(null)}catch(p){me(i,a,p)}else u.current=null}function md(i,a,u){try{u()}catch(p){me(i,a,p)}}var hy=!1;function Ck(i,a){if(Lh=ml,i=Hg(),bh(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else t:{u=(u=i.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var x=p.anchorOffset,S=p.focusNode;p=p.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break t}var M=0,R=-1,D=-1,J=0,at=0,ot=i,st=null;e:for(;;){for(var xt;ot!==u||x!==0&&ot.nodeType!==3||(R=M+x),ot!==S||p!==0&&ot.nodeType!==3||(D=M+p),ot.nodeType===3&&(M+=ot.nodeValue.length),(xt=ot.firstChild)!==null;)st=ot,ot=xt;for(;;){if(ot===i)break e;if(st===u&&++J===x&&(R=M),st===S&&++at===p&&(D=M),(xt=ot.nextSibling)!==null)break;ot=st,st=ot.parentNode}ot=xt}u=R===-1||D===-1?null:{start:R,end:D}}else u=null}u=u||{start:0,end:0}}else u=null;for(Mh={focusedElem:i,selectionRange:u},ml=!1,bt=a;bt!==null;)if(a=bt,i=a.child,(a.subtreeFlags&1028)!==0&&i!==null)i.return=a,bt=i;else for(;bt!==null;){a=bt;try{var St=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(St!==null){var Et=St.memoizedProps,ye=St.memoizedState,V=a.stateNode,j=V.getSnapshotBeforeUpdate(a.elementType===a.type?Et:fn(a.type,Et),ye);V.__reactInternalSnapshotBeforeUpdate=j}break;case 3:var Q=a.stateNode.containerInfo;Q.nodeType===1?Q.textContent="":Q.nodeType===9&&Q.documentElement&&Q.removeChild(Q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ut){me(a,a.return,ut)}if(i=a.sibling,i!==null){i.return=a.return,bt=i;break}bt=a.return}return St=hy,hy=!1,St}function so(i,a,u){var p=a.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var x=p=p.next;do{if((x.tag&i)===i){var S=x.destroy;x.destroy=void 0,S!==void 0&&md(a,u,S)}x=x.next}while(x!==p)}}function Kl(i,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var u=a=a.next;do{if((u.tag&i)===i){var p=u.create;u.destroy=p()}u=u.next}while(u!==a)}}function yd(i){var a=i.ref;if(a!==null){var u=i.stateNode;switch(i.tag){case 5:i=u;break;default:i=u}typeof a=="function"?a(i):a.current=i}}function dy(i){var a=i.alternate;a!==null&&(i.alternate=null,dy(a)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(a=i.stateNode,a!==null&&(delete a[Ln],delete a[Ya],delete a[Rh],delete a[ik],delete a[sk])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function fy(i){return i.tag===5||i.tag===3||i.tag===4}function py(i){t:for(;;){for(;i.sibling===null;){if(i.return===null||fy(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue t;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function xd(i,a,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,a?u.nodeType===8?u.parentNode.insertBefore(i,a):u.insertBefore(i,a):(u.nodeType===8?(a=u.parentNode,a.insertBefore(i,u)):(a=u,a.appendChild(i)),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=Ll));else if(p!==4&&(i=i.child,i!==null))for(xd(i,a,u),i=i.sibling;i!==null;)xd(i,a,u),i=i.sibling}function vd(i,a,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,a?u.insertBefore(i,a):u.appendChild(i);else if(p!==4&&(i=i.child,i!==null))for(vd(i,a,u),i=i.sibling;i!==null;)vd(i,a,u),i=i.sibling}var Ie=null,pn=!1;function bi(i,a,u){for(u=u.child;u!==null;)gy(i,a,u),u=u.sibling}function gy(i,a,u){if(Er&&typeof Er.onCommitFiberUnmount=="function")try{Er.onCommitFiberUnmount(qi,u)}catch{}switch(u.tag){case 5:Ge||Vs(u,a);case 6:var p=Ie,x=pn;Ie=null,bi(i,a,u),Ie=p,pn=x,Ie!==null&&(pn?(i=Ie,u=u.stateNode,i.nodeType===8?i.parentNode.removeChild(u):i.removeChild(u)):Ie.removeChild(u.stateNode));break;case 18:Ie!==null&&(pn?(i=Ie,u=u.stateNode,i.nodeType===8?$h(i.parentNode,u):i.nodeType===1&&$h(i,u),Da(i)):$h(Ie,u.stateNode));break;case 4:p=Ie,x=pn,Ie=u.stateNode.containerInfo,pn=!0,bi(i,a,u),Ie=p,pn=x;break;case 0:case 11:case 14:case 15:if(!Ge&&(p=u.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){x=p=p.next;do{var S=x,M=S.destroy;S=S.tag,M!==void 0&&((S&2)!==0||(S&4)!==0)&&md(u,a,M),x=x.next}while(x!==p)}bi(i,a,u);break;case 1:if(!Ge&&(Vs(u,a),p=u.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=u.memoizedProps,p.state=u.memoizedState,p.componentWillUnmount()}catch(R){me(u,a,R)}bi(i,a,u);break;case 21:bi(i,a,u);break;case 22:u.mode&1?(Ge=(p=Ge)||u.memoizedState!==null,bi(i,a,u),Ge=p):bi(i,a,u);break;default:bi(i,a,u)}}function my(i){var a=i.updateQueue;if(a!==null){i.updateQueue=null;var u=i.stateNode;u===null&&(u=i.stateNode=new Sk),a.forEach(function(p){var x=Ak.bind(null,i,p);u.has(p)||(u.add(p),p.then(x,x))})}}function gn(i,a){var u=a.deletions;if(u!==null)for(var p=0;p<u.length;p++){var x=u[p];try{var S=i,M=a,R=M;t:for(;R!==null;){switch(R.tag){case 5:Ie=R.stateNode,pn=!1;break t;case 3:Ie=R.stateNode.containerInfo,pn=!0;break t;case 4:Ie=R.stateNode.containerInfo,pn=!0;break t}R=R.return}if(Ie===null)throw Error(r(160));gy(S,M,x),Ie=null,pn=!1;var D=x.alternate;D!==null&&(D.return=null),x.return=null}catch(J){me(x,a,J)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)yy(a,i),a=a.sibling}function yy(i,a){var u=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(gn(a,i),An(i),p&4){try{so(3,i,i.return),Kl(3,i)}catch(Et){me(i,i.return,Et)}try{so(5,i,i.return)}catch(Et){me(i,i.return,Et)}}break;case 1:gn(a,i),An(i),p&512&&u!==null&&Vs(u,u.return);break;case 5:if(gn(a,i),An(i),p&512&&u!==null&&Vs(u,u.return),i.flags&32){var x=i.stateNode;try{nn(x,"")}catch(Et){me(i,i.return,Et)}}if(p&4&&(x=i.stateNode,x!=null)){var S=i.memoizedProps,M=u!==null?u.memoizedProps:S,R=i.type,D=i.updateQueue;if(i.updateQueue=null,D!==null)try{R==="input"&&S.type==="radio"&&S.name!=null&&tn(x,S),_r(R,M);var J=_r(R,S);for(M=0;M<D.length;M+=2){var at=D[M],ot=D[M+1];at==="style"?kr(x,ot):at==="dangerouslySetInnerHTML"?hr(x,ot):at==="children"?nn(x,ot):B(x,at,ot,J)}switch(R){case"input":Je(x,S);break;case"textarea":Wn(x,S);break;case"select":var st=x._wrapperState.wasMultiple;x._wrapperState.wasMultiple=!!S.multiple;var xt=S.value;xt!=null?en(x,!!S.multiple,xt,!1):st!==!!S.multiple&&(S.defaultValue!=null?en(x,!!S.multiple,S.defaultValue,!0):en(x,!!S.multiple,S.multiple?[]:"",!1))}x[Ya]=S}catch(Et){me(i,i.return,Et)}}break;case 6:if(gn(a,i),An(i),p&4){if(i.stateNode===null)throw Error(r(162));x=i.stateNode,S=i.memoizedProps;try{x.nodeValue=S}catch(Et){me(i,i.return,Et)}}break;case 3:if(gn(a,i),An(i),p&4&&u!==null&&u.memoizedState.isDehydrated)try{Da(a.containerInfo)}catch(Et){me(i,i.return,Et)}break;case 4:gn(a,i),An(i);break;case 13:gn(a,i),An(i),x=i.child,x.flags&8192&&(S=x.memoizedState!==null,x.stateNode.isHidden=S,!S||x.alternate!==null&&x.alternate.memoizedState!==null||(Cd=Nt())),p&4&&my(i);break;case 22:if(at=u!==null&&u.memoizedState!==null,i.mode&1?(Ge=(J=Ge)||at,gn(a,i),Ge=J):gn(a,i),An(i),p&8192){if(J=i.memoizedState!==null,(i.stateNode.isHidden=J)&&!at&&(i.mode&1)!==0)for(bt=i,at=i.child;at!==null;){for(ot=bt=at;bt!==null;){switch(st=bt,xt=st.child,st.tag){case 0:case 11:case 14:case 15:so(4,st,st.return);break;case 1:Vs(st,st.return);var St=st.stateNode;if(typeof St.componentWillUnmount=="function"){p=st,u=st.return;try{a=p,St.props=a.memoizedProps,St.state=a.memoizedState,St.componentWillUnmount()}catch(Et){me(p,u,Et)}}break;case 5:Vs(st,st.return);break;case 22:if(st.memoizedState!==null){by(ot);continue}}xt!==null?(xt.return=st,bt=xt):by(ot)}at=at.sibling}t:for(at=null,ot=i;;){if(ot.tag===5){if(at===null){at=ot;try{x=ot.stateNode,J?(S=x.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none"):(R=ot.stateNode,D=ot.memoizedProps.style,M=D!=null&&D.hasOwnProperty("display")?D.display:null,R.style.display=Nr("display",M))}catch(Et){me(i,i.return,Et)}}}else if(ot.tag===6){if(at===null)try{ot.stateNode.nodeValue=J?"":ot.memoizedProps}catch(Et){me(i,i.return,Et)}}else if((ot.tag!==22&&ot.tag!==23||ot.memoizedState===null||ot===i)&&ot.child!==null){ot.child.return=ot,ot=ot.child;continue}if(ot===i)break t;for(;ot.sibling===null;){if(ot.return===null||ot.return===i)break t;at===ot&&(at=null),ot=ot.return}at===ot&&(at=null),ot.sibling.return=ot.return,ot=ot.sibling}}break;case 19:gn(a,i),An(i),p&4&&my(i);break;case 21:break;default:gn(a,i),An(i)}}function An(i){var a=i.flags;if(a&2){try{t:{for(var u=i.return;u!==null;){if(fy(u)){var p=u;break t}u=u.return}throw Error(r(160))}switch(p.tag){case 5:var x=p.stateNode;p.flags&32&&(nn(x,""),p.flags&=-33);var S=py(i);vd(i,S,x);break;case 3:case 4:var M=p.stateNode.containerInfo,R=py(i);xd(i,R,M);break;default:throw Error(r(161))}}catch(D){me(i,i.return,D)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function wk(i,a,u){bt=i,xy(i)}function xy(i,a,u){for(var p=(i.mode&1)!==0;bt!==null;){var x=bt,S=x.child;if(x.tag===22&&p){var M=x.memoizedState!==null||Ql;if(!M){var R=x.alternate,D=R!==null&&R.memoizedState!==null||Ge;R=Ql;var J=Ge;if(Ql=M,(Ge=D)&&!J)for(bt=x;bt!==null;)M=bt,D=M.child,M.tag===22&&M.memoizedState!==null?Sy(x):D!==null?(D.return=M,bt=D):Sy(x);for(;S!==null;)bt=S,xy(S),S=S.sibling;bt=x,Ql=R,Ge=J}vy(i)}else(x.subtreeFlags&8772)!==0&&S!==null?(S.return=x,bt=S):vy(i)}}function vy(i){for(;bt!==null;){var a=bt;if((a.flags&8772)!==0){var u=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:Ge||Kl(5,a);break;case 1:var p=a.stateNode;if(a.flags&4&&!Ge)if(u===null)p.componentDidMount();else{var x=a.elementType===a.type?u.memoizedProps:fn(a.type,u.memoizedProps);p.componentDidUpdate(x,u.memoizedState,p.__reactInternalSnapshotBeforeUpdate)}var S=a.updateQueue;S!==null&&bm(a,S,p);break;case 3:var M=a.updateQueue;if(M!==null){if(u=null,a.child!==null)switch(a.child.tag){case 5:u=a.child.stateNode;break;case 1:u=a.child.stateNode}bm(a,M,u)}break;case 5:var R=a.stateNode;if(u===null&&a.flags&4){u=R;var D=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":D.autoFocus&&u.focus();break;case"img":D.src&&(u.src=D.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var J=a.alternate;if(J!==null){var at=J.memoizedState;if(at!==null){var ot=at.dehydrated;ot!==null&&Da(ot)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Ge||a.flags&512&&yd(a)}catch(st){me(a,a.return,st)}}if(a===i){bt=null;break}if(u=a.sibling,u!==null){u.return=a.return,bt=u;break}bt=a.return}}function by(i){for(;bt!==null;){var a=bt;if(a===i){bt=null;break}var u=a.sibling;if(u!==null){u.return=a.return,bt=u;break}bt=a.return}}function Sy(i){for(;bt!==null;){var a=bt;try{switch(a.tag){case 0:case 11:case 15:var u=a.return;try{Kl(4,a)}catch(D){me(a,u,D)}break;case 1:var p=a.stateNode;if(typeof p.componentDidMount=="function"){var x=a.return;try{p.componentDidMount()}catch(D){me(a,x,D)}}var S=a.return;try{yd(a)}catch(D){me(a,S,D)}break;case 5:var M=a.return;try{yd(a)}catch(D){me(a,M,D)}}}catch(D){me(a,a.return,D)}if(a===i){bt=null;break}var R=a.sibling;if(R!==null){R.return=a.return,bt=R;break}bt=a.return}}var kk=Math.ceil,Zl=L.ReactCurrentDispatcher,bd=L.ReactCurrentOwner,Yr=L.ReactCurrentBatchConfig,Vt=0,$e=null,Se=null,Pe=0,Ar=0,Ys=gi(0),ke=0,ao=null,Zi=0,Jl=0,Sd=0,oo=null,yr=null,Cd=0,Xs=1/0,Qn=null,tc=!1,wd=null,Si=null,ec=!1,Ci=null,rc=0,lo=0,kd=null,nc=-1,ic=0;function er(){return(Vt&6)!==0?Nt():nc!==-1?nc:nc=Nt()}function wi(i){return(i.mode&1)===0?1:(Vt&2)!==0&&Pe!==0?Pe&-Pe:ok.transition!==null?(ic===0&&(ic=pg()),ic):(i=te,i!==0||(i=window.event,i=i===void 0?16:wg(i.type)),i)}function mn(i,a,u,p){if(50<lo)throw lo=0,kd=null,Error(r(185));$a(i,u,p),((Vt&2)===0||i!==$e)&&(i===$e&&((Vt&2)===0&&(Jl|=u),ke===4&&ki(i,Pe)),xr(i,p),u===1&&Vt===0&&(a.mode&1)===0&&(Xs=Nt()+500,$l&&yi()))}function xr(i,a){var u=i.callbackNode;ow(i,a);var p=fl(i,i===$e?Pe:0);if(p===0)u!==null&&lt(u),i.callbackNode=null,i.callbackPriority=0;else if(a=p&-p,i.callbackPriority!==a){if(u!=null&&lt(u),a===1)i.tag===0?ak(wy.bind(null,i)):lm(wy.bind(null,i)),rk(function(){(Vt&6)===0&&yi()}),u=null;else{switch(gg(p)){case 1:u=Be;break;case 4:u=Hr;break;case 16:u=cn;break;case 536870912:u=be;break;default:u=cn}u=Ay(u,Cy.bind(null,i))}i.callbackPriority=a,i.callbackNode=u}}function Cy(i,a){if(nc=-1,ic=0,(Vt&6)!==0)throw Error(r(327));var u=i.callbackNode;if(Qs()&&i.callbackNode!==u)return null;var p=fl(i,i===$e?Pe:0);if(p===0)return null;if((p&30)!==0||(p&i.expiredLanes)!==0||a)a=sc(i,p);else{a=p;var x=Vt;Vt|=2;var S=_y();($e!==i||Pe!==a)&&(Qn=null,Xs=Nt()+500,ts(i,a));do try{Ek();break}catch(R){ky(i,R)}while(!0);Wh(),Zl.current=S,Vt=x,Se!==null?a=0:($e=null,Pe=0,a=ke)}if(a!==0){if(a===2&&(x=ih(i),x!==0&&(p=x,a=_d(i,x))),a===1)throw u=ao,ts(i,0),ki(i,p),xr(i,Nt()),u;if(a===6)ki(i,p);else{if(x=i.current.alternate,(p&30)===0&&!_k(x)&&(a=sc(i,p),a===2&&(S=ih(i),S!==0&&(p=S,a=_d(i,S))),a===1))throw u=ao,ts(i,0),ki(i,p),xr(i,Nt()),u;switch(i.finishedWork=x,i.finishedLanes=p,a){case 0:case 1:throw Error(r(345));case 2:es(i,yr,Qn);break;case 3:if(ki(i,p),(p&130023424)===p&&(a=Cd+500-Nt(),10<a)){if(fl(i,0)!==0)break;if(x=i.suspendedLanes,(x&p)!==p){er(),i.pingedLanes|=i.suspendedLanes&x;break}i.timeoutHandle=Ah(es.bind(null,i,yr,Qn),a);break}es(i,yr,Qn);break;case 4:if(ki(i,p),(p&4194240)===p)break;for(a=i.eventTimes,x=-1;0<p;){var M=31-un(p);S=1<<M,M=a[M],M>x&&(x=M),p&=~S}if(p=x,p=Nt()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*kk(p/1960))-p,10<p){i.timeoutHandle=Ah(es.bind(null,i,yr,Qn),p);break}es(i,yr,Qn);break;case 5:es(i,yr,Qn);break;default:throw Error(r(329))}}}return xr(i,Nt()),i.callbackNode===u?Cy.bind(null,i):null}function _d(i,a){var u=oo;return i.current.memoizedState.isDehydrated&&(ts(i,a).flags|=256),i=sc(i,a),i!==2&&(a=yr,yr=u,a!==null&&Td(a)),i}function Td(i){yr===null?yr=i:yr.push.apply(yr,i)}function _k(i){for(var a=i;;){if(a.flags&16384){var u=a.updateQueue;if(u!==null&&(u=u.stores,u!==null))for(var p=0;p<u.length;p++){var x=u[p],S=x.getSnapshot;x=x.value;try{if(!hn(S(),x))return!1}catch{return!1}}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function ki(i,a){for(a&=~Sd,a&=~Jl,i.suspendedLanes|=a,i.pingedLanes&=~a,i=i.expirationTimes;0<a;){var u=31-un(a),p=1<<u;i[u]=-1,a&=~p}}function wy(i){if((Vt&6)!==0)throw Error(r(327));Qs();var a=fl(i,0);if((a&1)===0)return xr(i,Nt()),null;var u=sc(i,a);if(i.tag!==0&&u===2){var p=ih(i);p!==0&&(a=p,u=_d(i,p))}if(u===1)throw u=ao,ts(i,0),ki(i,a),xr(i,Nt()),u;if(u===6)throw Error(r(345));return i.finishedWork=i.current.alternate,i.finishedLanes=a,es(i,yr,Qn),xr(i,Nt()),null}function Ed(i,a){var u=Vt;Vt|=1;try{return i(a)}finally{Vt=u,Vt===0&&(Xs=Nt()+500,$l&&yi())}}function Ji(i){Ci!==null&&Ci.tag===0&&(Vt&6)===0&&Qs();var a=Vt;Vt|=1;var u=Yr.transition,p=te;try{if(Yr.transition=null,te=1,i)return i()}finally{te=p,Yr.transition=u,Vt=a,(Vt&6)===0&&yi()}}function Ld(){Ar=Ys.current,le(Ys)}function ts(i,a){i.finishedWork=null,i.finishedLanes=0;var u=i.timeoutHandle;if(u!==-1&&(i.timeoutHandle=-1,ek(u)),Se!==null)for(u=Se.return;u!==null;){var p=u;switch(Dh(p),p.tag){case 1:p=p.type.childContextTypes,p!=null&&Bl();break;case 3:Us(),le(pr),le(He),Qh();break;case 5:Yh(p);break;case 4:Us();break;case 13:le(fe);break;case 19:le(fe);break;case 10:Hh(p.type._context);break;case 22:case 23:Ld()}u=u.return}if($e=i,Se=i=_i(i.current,null),Pe=Ar=a,ke=0,ao=null,Sd=Jl=Zi=0,yr=oo=null,Xi!==null){for(a=0;a<Xi.length;a++)if(u=Xi[a],p=u.interleaved,p!==null){u.interleaved=null;var x=p.next,S=u.pending;if(S!==null){var M=S.next;S.next=x,p.next=M}u.pending=p}Xi=null}return i}function ky(i,a){do{var u=Se;try{if(Wh(),Wl.current=Gl,Hl){for(var p=pe.memoizedState;p!==null;){var x=p.queue;x!==null&&(x.pending=null),p=p.next}Hl=!1}if(Ki=0,Ae=we=pe=null,to=!1,eo=0,bd.current=null,u===null||u.return===null){ke=1,ao=a,Se=null;break}t:{var S=i,M=u.return,R=u,D=a;if(a=Pe,R.flags|=32768,D!==null&&typeof D=="object"&&typeof D.then=="function"){var J=D,at=R,ot=at.tag;if((at.mode&1)===0&&(ot===0||ot===11||ot===15)){var st=at.alternate;st?(at.updateQueue=st.updateQueue,at.memoizedState=st.memoizedState,at.lanes=st.lanes):(at.updateQueue=null,at.memoizedState=null)}var xt=Xm(M);if(xt!==null){xt.flags&=-257,Qm(xt,M,R,S,a),xt.mode&1&&Ym(S,J,a),a=xt,D=J;var St=a.updateQueue;if(St===null){var Et=new Set;Et.add(D),a.updateQueue=Et}else St.add(D);break t}else{if((a&1)===0){Ym(S,J,a),Md();break t}D=Error(r(426))}}else if(ue&&R.mode&1){var ye=Xm(M);if(ye!==null){(ye.flags&65536)===0&&(ye.flags|=256),Qm(ye,M,R,S,a),jh(Gs(D,R));break t}}S=D=Gs(D,R),ke!==4&&(ke=2),oo===null?oo=[S]:oo.push(S),S=M;do{switch(S.tag){case 3:S.flags|=65536,a&=-a,S.lanes|=a;var V=Gm(S,D,a);vm(S,V);break t;case 1:R=D;var j=S.type,Q=S.stateNode;if((S.flags&128)===0&&(typeof j.getDerivedStateFromError=="function"||Q!==null&&typeof Q.componentDidCatch=="function"&&(Si===null||!Si.has(Q)))){S.flags|=65536,a&=-a,S.lanes|=a;var ut=Vm(S,R,a);vm(S,ut);break t}}S=S.return}while(S!==null)}Ey(u)}catch(Mt){a=Mt,Se===u&&u!==null&&(Se=u=u.return);continue}break}while(!0)}function _y(){var i=Zl.current;return Zl.current=Gl,i===null?Gl:i}function Md(){(ke===0||ke===3||ke===2)&&(ke=4),$e===null||(Zi&268435455)===0&&(Jl&268435455)===0||ki($e,Pe)}function sc(i,a){var u=Vt;Vt|=2;var p=_y();($e!==i||Pe!==a)&&(Qn=null,ts(i,a));do try{Tk();break}catch(x){ky(i,x)}while(!0);if(Wh(),Vt=u,Zl.current=p,Se!==null)throw Error(r(261));return $e=null,Pe=0,ke}function Tk(){for(;Se!==null;)Ty(Se)}function Ek(){for(;Se!==null&&!kt();)Ty(Se)}function Ty(i){var a=By(i.alternate,i,Ar);i.memoizedProps=i.pendingProps,a===null?Ey(i):Se=a,bd.current=null}function Ey(i){var a=i;do{var u=a.alternate;if(i=a.return,(a.flags&32768)===0){if(u=vk(u,a,Ar),u!==null){Se=u;return}}else{if(u=bk(u,a),u!==null){u.flags&=32767,Se=u;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{ke=6,Se=null;return}}if(a=a.sibling,a!==null){Se=a;return}Se=a=i}while(a!==null);ke===0&&(ke=5)}function es(i,a,u){var p=te,x=Yr.transition;try{Yr.transition=null,te=1,Lk(i,a,u,p)}finally{Yr.transition=x,te=p}return null}function Lk(i,a,u,p){do Qs();while(Ci!==null);if((Vt&6)!==0)throw Error(r(327));u=i.finishedWork;var x=i.finishedLanes;if(u===null)return null;if(i.finishedWork=null,i.finishedLanes=0,u===i.current)throw Error(r(177));i.callbackNode=null,i.callbackPriority=0;var S=u.lanes|u.childLanes;if(lw(i,S),i===$e&&(Se=$e=null,Pe=0),(u.subtreeFlags&2064)===0&&(u.flags&2064)===0||ec||(ec=!0,Ay(cn,function(){return Qs(),null})),S=(u.flags&15990)!==0,(u.subtreeFlags&15990)!==0||S){S=Yr.transition,Yr.transition=null;var M=te;te=1;var R=Vt;Vt|=4,bd.current=null,Ck(i,u),yy(u,i),Yw(Mh),ml=!!Lh,Mh=Lh=null,i.current=u,wk(u),se(),Vt=R,te=M,Yr.transition=S}else i.current=u;if(ec&&(ec=!1,Ci=i,rc=x),S=i.pendingLanes,S===0&&(Si=null),rw(u.stateNode),xr(i,Nt()),a!==null)for(p=i.onRecoverableError,u=0;u<a.length;u++)x=a[u],p(x.value,{componentStack:x.stack,digest:x.digest});if(tc)throw tc=!1,i=wd,wd=null,i;return(rc&1)!==0&&i.tag!==0&&Qs(),S=i.pendingLanes,(S&1)!==0?i===kd?lo++:(lo=0,kd=i):lo=0,yi(),null}function Qs(){if(Ci!==null){var i=gg(rc),a=Yr.transition,u=te;try{if(Yr.transition=null,te=16>i?16:i,Ci===null)var p=!1;else{if(i=Ci,Ci=null,rc=0,(Vt&6)!==0)throw Error(r(331));var x=Vt;for(Vt|=4,bt=i.current;bt!==null;){var S=bt,M=S.child;if((bt.flags&16)!==0){var R=S.deletions;if(R!==null){for(var D=0;D<R.length;D++){var J=R[D];for(bt=J;bt!==null;){var at=bt;switch(at.tag){case 0:case 11:case 15:so(8,at,S)}var ot=at.child;if(ot!==null)ot.return=at,bt=ot;else for(;bt!==null;){at=bt;var st=at.sibling,xt=at.return;if(dy(at),at===J){bt=null;break}if(st!==null){st.return=xt,bt=st;break}bt=xt}}}var St=S.alternate;if(St!==null){var Et=St.child;if(Et!==null){St.child=null;do{var ye=Et.sibling;Et.sibling=null,Et=ye}while(Et!==null)}}bt=S}}if((S.subtreeFlags&2064)!==0&&M!==null)M.return=S,bt=M;else t:for(;bt!==null;){if(S=bt,(S.flags&2048)!==0)switch(S.tag){case 0:case 11:case 15:so(9,S,S.return)}var V=S.sibling;if(V!==null){V.return=S.return,bt=V;break t}bt=S.return}}var j=i.current;for(bt=j;bt!==null;){M=bt;var Q=M.child;if((M.subtreeFlags&2064)!==0&&Q!==null)Q.return=M,bt=Q;else t:for(M=j;bt!==null;){if(R=bt,(R.flags&2048)!==0)try{switch(R.tag){case 0:case 11:case 15:Kl(9,R)}}catch(Mt){me(R,R.return,Mt)}if(R===M){bt=null;break t}var ut=R.sibling;if(ut!==null){ut.return=R.return,bt=ut;break t}bt=R.return}}if(Vt=x,yi(),Er&&typeof Er.onPostCommitFiberRoot=="function")try{Er.onPostCommitFiberRoot(qi,i)}catch{}p=!0}return p}finally{te=u,Yr.transition=a}}return!1}function Ly(i,a,u){a=Gs(u,a),a=Gm(i,a,1),i=vi(i,a,1),a=er(),i!==null&&($a(i,1,a),xr(i,a))}function me(i,a,u){if(i.tag===3)Ly(i,i,u);else for(;a!==null;){if(a.tag===3){Ly(a,i,u);break}else if(a.tag===1){var p=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Si===null||!Si.has(p))){i=Gs(u,i),i=Vm(a,i,1),a=vi(a,i,1),i=er(),a!==null&&($a(a,1,i),xr(a,i));break}}a=a.return}}function Mk(i,a,u){var p=i.pingCache;p!==null&&p.delete(a),a=er(),i.pingedLanes|=i.suspendedLanes&u,$e===i&&(Pe&u)===u&&(ke===4||ke===3&&(Pe&130023424)===Pe&&500>Nt()-Cd?ts(i,0):Sd|=u),xr(i,a)}function My(i,a){a===0&&((i.mode&1)===0?a=1:(a=dl,dl<<=1,(dl&130023424)===0&&(dl=4194304)));var u=er();i=Vn(i,a),i!==null&&($a(i,a,u),xr(i,u))}function Bk(i){var a=i.memoizedState,u=0;a!==null&&(u=a.retryLane),My(i,u)}function Ak(i,a){var u=0;switch(i.tag){case 13:var p=i.stateNode,x=i.memoizedState;x!==null&&(u=x.retryLane);break;case 19:p=i.stateNode;break;default:throw Error(r(314))}p!==null&&p.delete(a),My(i,u)}var By;By=function(i,a,u){if(i!==null)if(i.memoizedProps!==a.pendingProps||pr.current)mr=!0;else{if((i.lanes&u)===0&&(a.flags&128)===0)return mr=!1,xk(i,a,u);mr=(i.flags&131072)!==0}else mr=!1,ue&&(a.flags&1048576)!==0&&cm(a,Fl,a.index);switch(a.lanes=0,a.tag){case 2:var p=a.type;Xl(i,a),i=a.pendingProps;var x=Os(a,He.current);qs(a,u),x=Jh(null,a,p,i,x,u);var S=td();return a.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,gr(p)?(S=!0,Al(a)):S=!1,a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,Gh(a),x.updater=Vl,a.stateNode=x,x._reactInternals=a,ad(a,p,i,u),a=ud(null,a,p,!0,S,u)):(a.tag=0,ue&&S&&Ph(a),tr(null,a,x,u),a=a.child),a;case 16:p=a.elementType;t:{switch(Xl(i,a),i=a.pendingProps,x=p._init,p=x(p._payload),a.type=p,x=a.tag=Rk(p),i=fn(p,i),x){case 0:a=cd(null,a,p,i,u);break t;case 1:a=ry(null,a,p,i,u);break t;case 11:a=Km(null,a,p,i,u);break t;case 14:a=Zm(null,a,p,fn(p.type,i),u);break t}throw Error(r(306,p,""))}return a;case 0:return p=a.type,x=a.pendingProps,x=a.elementType===p?x:fn(p,x),cd(i,a,p,x,u);case 1:return p=a.type,x=a.pendingProps,x=a.elementType===p?x:fn(p,x),ry(i,a,p,x,u);case 3:t:{if(ny(a),i===null)throw Error(r(387));p=a.pendingProps,S=a.memoizedState,x=S.element,xm(i,a),jl(a,p,null,u);var M=a.memoizedState;if(p=M.element,S.isDehydrated)if(S={element:p,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},a.updateQueue.baseState=S,a.memoizedState=S,a.flags&256){x=Gs(Error(r(423)),a),a=iy(i,a,p,u,x);break t}else if(p!==x){x=Gs(Error(r(424)),a),a=iy(i,a,p,u,x);break t}else for(Br=pi(a.stateNode.containerInfo.firstChild),Mr=a,ue=!0,dn=null,u=mm(a,null,p,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Ns(),p===x){a=Xn(i,a,u);break t}tr(i,a,p,u)}a=a.child}return a;case 5:return Sm(a),i===null&&zh(a),p=a.type,x=a.pendingProps,S=i!==null?i.memoizedProps:null,M=x.children,Bh(p,x)?M=null:S!==null&&Bh(p,S)&&(a.flags|=32),ey(i,a),tr(i,a,M,u),a.child;case 6:return i===null&&zh(a),null;case 13:return sy(i,a,u);case 4:return Vh(a,a.stateNode.containerInfo),p=a.pendingProps,i===null?a.child=Ws(a,null,p,u):tr(i,a,p,u),a.child;case 11:return p=a.type,x=a.pendingProps,x=a.elementType===p?x:fn(p,x),Km(i,a,p,x,u);case 7:return tr(i,a,a.pendingProps,u),a.child;case 8:return tr(i,a,a.pendingProps.children,u),a.child;case 12:return tr(i,a,a.pendingProps.children,u),a.child;case 10:t:{if(p=a.type._context,x=a.pendingProps,S=a.memoizedProps,M=x.value,ae(Dl,p._currentValue),p._currentValue=M,S!==null)if(hn(S.value,M)){if(S.children===x.children&&!pr.current){a=Xn(i,a,u);break t}}else for(S=a.child,S!==null&&(S.return=a);S!==null;){var R=S.dependencies;if(R!==null){M=S.child;for(var D=R.firstContext;D!==null;){if(D.context===p){if(S.tag===1){D=Yn(-1,u&-u),D.tag=2;var J=S.updateQueue;if(J!==null){J=J.shared;var at=J.pending;at===null?D.next=D:(D.next=at.next,at.next=D),J.pending=D}}S.lanes|=u,D=S.alternate,D!==null&&(D.lanes|=u),qh(S.return,u,a),R.lanes|=u;break}D=D.next}}else if(S.tag===10)M=S.type===a.type?null:S.child;else if(S.tag===18){if(M=S.return,M===null)throw Error(r(341));M.lanes|=u,R=M.alternate,R!==null&&(R.lanes|=u),qh(M,u,a),M=S.sibling}else M=S.child;if(M!==null)M.return=S;else for(M=S;M!==null;){if(M===a){M=null;break}if(S=M.sibling,S!==null){S.return=M.return,M=S;break}M=M.return}S=M}tr(i,a,x.children,u),a=a.child}return a;case 9:return x=a.type,p=a.pendingProps.children,qs(a,u),x=Gr(x),p=p(x),a.flags|=1,tr(i,a,p,u),a.child;case 14:return p=a.type,x=fn(p,a.pendingProps),x=fn(p.type,x),Zm(i,a,p,x,u);case 15:return Jm(i,a,a.type,a.pendingProps,u);case 17:return p=a.type,x=a.pendingProps,x=a.elementType===p?x:fn(p,x),Xl(i,a),a.tag=1,gr(p)?(i=!0,Al(a)):i=!1,qs(a,u),qm(a,p,x),ad(a,p,x,u),ud(null,a,p,!0,i,u);case 19:return oy(i,a,u);case 22:return ty(i,a,u)}throw Error(r(156,a.tag))};function Ay(i,a){return O(i,a)}function $k(i,a,u,p){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xr(i,a,u,p){return new $k(i,a,u,p)}function Bd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Rk(i){if(typeof i=="function")return Bd(i)?1:0;if(i!=null){if(i=i.$$typeof,i===it)return 11;if(i===q)return 14}return 2}function _i(i,a){var u=i.alternate;return u===null?(u=Xr(i.tag,a,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=a,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&14680064,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,a=i.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u}function ac(i,a,u,p,x,S){var M=2;if(p=i,typeof i=="function")Bd(i)&&(M=1);else if(typeof i=="string")M=5;else t:switch(i){case $:return rs(u.children,x,S,a);case z:M=8,x|=8;break;case Z:return i=Xr(12,u,a,x|2),i.elementType=Z,i.lanes=S,i;case rt:return i=Xr(13,u,a,x),i.elementType=rt,i.lanes=S,i;case H:return i=Xr(19,u,a,x),i.elementType=H,i.lanes=S,i;case Y:return oc(u,x,S,a);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case W:M=10;break t;case G:M=9;break t;case it:M=11;break t;case q:M=14;break t;case N:M=16,p=null;break t}throw Error(r(130,i==null?i:typeof i,""))}return a=Xr(M,u,a,x),a.elementType=i,a.type=p,a.lanes=S,a}function rs(i,a,u,p){return i=Xr(7,i,p,a),i.lanes=u,i}function oc(i,a,u,p){return i=Xr(22,i,p,a),i.elementType=Y,i.lanes=u,i.stateNode={isHidden:!1},i}function Ad(i,a,u){return i=Xr(6,i,null,a),i.lanes=u,i}function $d(i,a,u){return a=Xr(4,i.children!==null?i.children:[],i.key,a),a.lanes=u,a.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},a}function Fk(i,a,u,p,x){this.tag=a,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sh(0),this.expirationTimes=sh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sh(0),this.identifierPrefix=p,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function Rd(i,a,u,p,x,S,M,R,D){return i=new Fk(i,a,u,R,D),a===1?(a=1,S===!0&&(a|=8)):a=0,S=Xr(3,null,null,a),i.current=S,S.stateNode=i,S.memoizedState={element:p,isDehydrated:u,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gh(S),i}function Ik(i,a,u){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:E,key:p==null?null:""+p,children:i,containerInfo:a,implementation:u}}function $y(i){if(!i)return mi;i=i._reactInternals;t:{if(En(i)!==i||i.tag!==1)throw Error(r(170));var a=i;do{switch(a.tag){case 3:a=a.stateNode.context;break t;case 1:if(gr(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break t}}a=a.return}while(a!==null);throw Error(r(171))}if(i.tag===1){var u=i.type;if(gr(u))return am(i,u,a)}return a}function Ry(i,a,u,p,x,S,M,R,D){return i=Rd(u,p,!0,i,x,S,M,R,D),i.context=$y(null),u=i.current,p=er(),x=wi(u),S=Yn(p,x),S.callback=a??null,vi(u,S,x),i.current.lanes=x,$a(i,x,p),xr(i,p),i}function lc(i,a,u,p){var x=a.current,S=er(),M=wi(x);return u=$y(u),a.context===null?a.context=u:a.pendingContext=u,a=Yn(S,M),a.payload={element:i},p=p===void 0?null:p,p!==null&&(a.callback=p),i=vi(x,a,M),i!==null&&(mn(i,x,M,S),zl(i,x,M)),M}function cc(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function Fy(i,a){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<a?u:a}}function Fd(i,a){Fy(i,a),(i=i.alternate)&&Fy(i,a)}function Pk(){return null}var Iy=typeof reportError=="function"?reportError:function(i){console.error(i)};function Id(i){this._internalRoot=i}uc.prototype.render=Id.prototype.render=function(i){var a=this._internalRoot;if(a===null)throw Error(r(409));lc(i,a,null,null)},uc.prototype.unmount=Id.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var a=i.containerInfo;Ji(function(){lc(null,i,null,null)}),a[Hn]=null}};function uc(i){this._internalRoot=i}uc.prototype.unstable_scheduleHydration=function(i){if(i){var a=xg();i={blockedOn:null,target:i,priority:a};for(var u=0;u<hi.length&&a!==0&&a<hi[u].priority;u++);hi.splice(u,0,i),u===0&&Sg(i)}};function Pd(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function hc(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function Py(){}function Dk(i,a,u,p,x){if(x){if(typeof p=="function"){var S=p;p=function(){var J=cc(M);S.call(J)}}var M=Ry(a,p,i,0,null,!1,!1,"",Py);return i._reactRootContainer=M,i[Hn]=M.current,Ga(i.nodeType===8?i.parentNode:i),Ji(),M}for(;x=i.lastChild;)i.removeChild(x);if(typeof p=="function"){var R=p;p=function(){var J=cc(D);R.call(J)}}var D=Rd(i,0,!1,null,null,!1,!1,"",Py);return i._reactRootContainer=D,i[Hn]=D.current,Ga(i.nodeType===8?i.parentNode:i),Ji(function(){lc(a,D,u,p)}),D}function dc(i,a,u,p,x){var S=u._reactRootContainer;if(S){var M=S;if(typeof x=="function"){var R=x;x=function(){var D=cc(M);R.call(D)}}lc(a,M,i,x)}else M=Dk(u,a,i,x,p);return cc(M)}mg=function(i){switch(i.tag){case 3:var a=i.stateNode;if(a.current.memoizedState.isDehydrated){var u=Aa(a.pendingLanes);u!==0&&(ah(a,u|1),xr(a,Nt()),(Vt&6)===0&&(Xs=Nt()+500,yi()))}break;case 13:Ji(function(){var p=Vn(i,1);if(p!==null){var x=er();mn(p,i,1,x)}}),Fd(i,1)}},oh=function(i){if(i.tag===13){var a=Vn(i,134217728);if(a!==null){var u=er();mn(a,i,134217728,u)}Fd(i,134217728)}},yg=function(i){if(i.tag===13){var a=wi(i),u=Vn(i,a);if(u!==null){var p=er();mn(u,i,a,p)}Fd(i,a)}},xg=function(){return te},vg=function(i,a){var u=te;try{return te=i,a()}finally{te=u}},sn=function(i,a,u){switch(a){case"input":if(Je(i,u),a=u.name,u.type==="radio"&&a!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<u.length;a++){var p=u[a];if(p!==i&&p.form===i.form){var x=Ml(p);if(!x)throw Error(r(90));ze(p),Je(p,x)}}}break;case"textarea":Wn(i,u);break;case"select":a=u.value,a!=null&&en(i,!!u.multiple,a,!1)}},Kt=Ed,de=Ji;var Ok={usingClientEntryPoint:!1,Events:[Xa,Ps,Ml,Ni,Wi,Ed]},co={findFiberByHostInstance:Ui,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zk={bundleType:co.bundleType,version:co.version,rendererPackageName:co.rendererPackageName,rendererConfig:co.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:L.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=ul(i),i===null?null:i.stateNode},findFiberByHostInstance:co.findFiberByHostInstance||Pk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fc.isDisabled&&fc.supportsFiber)try{qi=fc.inject(zk),Er=fc}catch{}}return vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ok,vr.createPortal=function(i,a){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Pd(a))throw Error(r(200));return Ik(i,a,null,u)},vr.createRoot=function(i,a){if(!Pd(i))throw Error(r(299));var u=!1,p="",x=Iy;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onRecoverableError!==void 0&&(x=a.onRecoverableError)),a=Rd(i,1,!1,null,null,u,!1,p,x),i[Hn]=a.current,Ga(i.nodeType===8?i.parentNode:i),new Id(a)},vr.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var a=i._reactInternals;if(a===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=ul(a),i=i===null?null:i.stateNode,i},vr.flushSync=function(i){return Ji(i)},vr.hydrate=function(i,a,u){if(!hc(a))throw Error(r(200));return dc(null,i,a,!0,u)},vr.hydrateRoot=function(i,a,u){if(!Pd(i))throw Error(r(405));var p=u!=null&&u.hydratedSources||null,x=!1,S="",M=Iy;if(u!=null&&(u.unstable_strictMode===!0&&(x=!0),u.identifierPrefix!==void 0&&(S=u.identifierPrefix),u.onRecoverableError!==void 0&&(M=u.onRecoverableError)),a=Ry(a,null,i,1,u??null,x,!1,S,M),i[Hn]=a.current,Ga(i),p)for(i=0;i<p.length;i++)u=p[i],x=u._getVersion,x=x(u._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[u,x]:a.mutableSourceEagerHydrationData.push(u,x);return new uc(a)},vr.render=function(i,a,u){if(!hc(a))throw Error(r(200));return dc(null,i,a,!1,u)},vr.unmountComponentAtNode=function(i){if(!hc(i))throw Error(r(40));return i._reactRootContainer?(Ji(function(){dc(null,null,i,!1,function(){i._reactRootContainer=null,i[Hn]=null})}),!0):!1},vr.unstable_batchedUpdates=Ed,vr.unstable_renderSubtreeIntoContainer=function(i,a,u,p){if(!hc(u))throw Error(r(200));if(i==null||i._reactInternals===void 0)throw Error(r(38));return dc(i,a,u,!1,p)},vr.version="18.3.1-next-f1338f8080-20240426",vr}var qy;function Qk(){if(qy)return zd.exports;qy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zd.exports=Xk(),zd.exports}var Uy;function Kk(){if(Uy)return pc;Uy=1;var e=Qk();return pc.createRoot=e.createRoot,pc.hydrateRoot=e.hydrateRoot,pc}var Zk=Kk();const Jk=up(Zk),t_="ws://localhost:3456/ws",e_="http://localhost:3456/sse",Gy="http://localhost:3456/api";function r_(e){const[t,r]=F.useState("disconnected"),[n,s]=F.useState(null),[o,c]=F.useState(null),l=F.useRef(null),h=F.useRef(null),d=F.useRef(0),f=F.useRef(null),g=F.useRef(!0),m=F.useRef(e);F.useEffect(()=>{m.current=e},[e]);const y=F.useCallback(()=>{l.current&&(l.current.onopen=null,l.current.onclose=null,l.current.onerror=null,l.current.onmessage=null,(l.current.readyState===WebSocket.OPEN||l.current.readyState===WebSocket.CONNECTING)&&l.current.close(),l.current=null),h.current&&(h.current.close(),h.current=null),f.current&&(clearTimeout(f.current),f.current=null)},[]),v=F.useCallback(E=>{var $;try{const z=typeof E=="string"?JSON.parse(E):E;z.type==="sys:connect"&&z.source==="bridge"&&(($=z.payload)!=null&&$.clientId)&&c(z.payload.clientId),m.current&&m.current(z)}catch(z){console.warn("[useConnection] Failed to parse message:",z)}},[]),b=F.useCallback(E=>{var z;const $={v:1,type:"sys:connect",payload:{clientType:"canvas",protocolVersion:1,capabilities:["dashboard","canvas","quiz","playground"]},source:"canvas",timestamp:Date.now()};E==="ws"&&((z=l.current)==null?void 0:z.readyState)===WebSocket.OPEN?l.current.send(JSON.stringify($)):E==="sse"&&fetch(`${Gy}/event`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)}).catch(Z=>{console.warn("[useConnection] Failed to send connect handshake via REST:",Z)})},[]),k=F.useCallback(()=>{if(!g.current)return;const E=Math.min(1e3*Math.pow(2,d.current),3e4);d.current+=1,console.log(`[useConnection] Reconnecting in ${E}ms (attempt ${d.current})`),r("disconnected"),f.current=setTimeout(()=>{g.current&&_()},E)},[]),T=F.useCallback(()=>{if(g.current){console.log("[useConnection] Falling back to SSE"),r("connecting");try{const E=new EventSource(e_);h.current=E,E.onopen=()=>{g.current&&(console.log("[useConnection] SSE connected"),r("connected"),s("sse"),d.current=0,b("sse"))},E.onmessage=$=>{g.current&&v($.data)},E.onerror=()=>{g.current&&(console.warn("[useConnection] SSE error"),E.close(),h.current=null,s(null),k())}}catch(E){console.warn("[useConnection] SSE failed to connect:",E),s(null),k()}}},[v,b,k]),_=F.useCallback(()=>{if(g.current){y(),r("connecting");try{const E=new WebSocket(t_);l.current=E,E.onopen=()=>{g.current&&(console.log("[useConnection] WebSocket connected"),r("connected"),s("ws"),d.current=0,b("ws"))},E.onmessage=$=>{g.current&&v($.data)},E.onclose=$=>{g.current&&(console.log("[useConnection] WebSocket closed:",$.code,$.reason),l.current=null,s(null),$.code===1e3||d.current===0?T():k())},E.onerror=()=>{g.current&&(console.warn("[useConnection] WebSocket error — will try SSE"),d.current===0&&(l.current=null,s(null),T()))}}catch(E){console.warn("[useConnection] WebSocket failed:",E),T()}}},[y,v,b,T,k]),B=F.useCallback((E,$)=>{var Z;const z={v:1,type:E,payload:$,source:"canvas",timestamp:Date.now()};n==="ws"&&((Z=l.current)==null?void 0:Z.readyState)===WebSocket.OPEN?l.current.send(JSON.stringify(z)):fetch(`${Gy}/event`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(z)}).catch(W=>{console.warn("[useConnection] Failed to send event via REST:",W)})},[n]);F.useEffect(()=>(g.current=!0,_(),()=>{g.current=!1,y()}),[]);const L=F.useCallback((E,$)=>{B("chat:send",{text:E,sessionId:$})},[B]),A=F.useCallback(E=>{B("chat:stop",{sessionId:E})},[B]);return{status:t,transport:n,clientId:o,sendEvent:B,sendChatMessage:L,stopChatGeneration:A}}const Mi={blue:{dark:"#58a6ff",light:"#0969da"},green:{dark:"#3fb950",light:"#1a7f37"},purple:{dark:"#bc8cff",light:"#8250df"},orange:{dark:"#f0883e",light:"#bc4c00"},red:{dark:"#f85149",light:"#cf222e"},yellow:{dark:"#d29922",light:"#9a6700"}},n_={id:"dark",bgPrimary:"#0d1117",bgSecondary:"#161b22",bgTertiary:"#21262d",border:"#30363d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#484f58",textBright:"#e6edf3",accent:"#58a6ff",success:"#3fb950",error:"#f85149",warning:"#d29922",purple:"#bc8cff",orange:"#f0883e",userBubble:"#1f6feb",errorBg:"#3d1416",errorButton:"#da3633"},i_={id:"light",bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgTertiary:"#eaeef2",border:"#d1d5db",textPrimary:"#1f2328",textSecondary:"#656d76",textMuted:"#8b949e",textBright:"#1f2328",accent:"#0969da",success:"#1a7f37",error:"#cf222e",warning:"#9a6700",purple:"#8250df",orange:"#bc4c00",userBubble:"#0969da",errorBg:"#ffebe9",errorButton:"#cf222e"},wo={dark:n_,light:i_};function s_(e,t){const r=Mi[t];return r?{...e,accent:r[e.id]||r.dark}:e}function a_(e){var t;return e==="light"?wo.light:e==="dark"?wo.dark:typeof window<"u"&&((t=window.matchMedia)!=null&&t.call(window,"(prefers-color-scheme: light)").matches)?wo.light:wo.dark}const Px=F.createContext(null);function o_(e){const t=document.documentElement;t.setAttribute("data-theme",e.id),t.style.setProperty("--bg-primary",e.bgPrimary),t.style.setProperty("--bg-secondary",e.bgSecondary),t.style.setProperty("--border",e.border),t.style.setProperty("--text-primary",e.textPrimary),t.style.setProperty("--accent",e.accent),t.style.setProperty("--scrollbar-thumb",e.bgTertiary),t.style.setProperty("--scrollbar-track",e.bgPrimary)}function l_({children:e}){const[t,r]=F.useState("dark"),[n,s]=F.useState("blue"),o=F.useMemo(()=>a_(t),[t]),c=F.useMemo(()=>s_(o,n),[o,n]);F.useEffect(()=>{o_(c)},[c]),F.useEffect(()=>{if(t!=="system")return;const f=window.matchMedia("(prefers-color-scheme: light)"),g=()=>{r("system")};return f.addEventListener("change",g),()=>f.removeEventListener("change",g)},[t]),F.useEffect(()=>{fetch("http://localhost:3456/api/settings").then(f=>f.ok?f.json():null).then(f=>{f&&(f.theme&&["dark","light","system"].includes(f.theme)&&r(f.theme),f.accent&&Mi[f.accent]&&s(f.accent))}).catch(()=>{})},[]);const l=F.useCallback(f=>{r(f),fetch("http://localhost:3456/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:f})}).catch(()=>{})},[]),h=F.useCallback(f=>{Mi[f]&&(s(f),fetch("http://localhost:3456/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accent:f})}).catch(()=>{}))},[]),d=F.useMemo(()=>({theme:c,preference:t,accentName:n,setThemePreference:l,setAccent:h}),[c,t,n,l,h]);return C.jsx(Px.Provider,{value:d,children:e})}function lr(){const e=F.useContext(Px);return e||{theme:wo.dark,preference:"dark",accentName:"blue",setThemePreference:()=>{},setAccent:()=>{}}}function dp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ss=dp();function Dx(e){Ss=e}var Ro={exec:()=>null};function Qt(e,t=""){let r=typeof e=="string"?e:e.source,n={replace:(s,o)=>{let c=typeof o=="string"?o:o.source;return c=c.replace(nr.caret,"$1"),r=r.replace(s,c),n},getRegex:()=>new RegExp(r,t)};return n}var c_=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),nr={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")},u_=/^(?:[ \t]*(?:\n|$))+/,h_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,d_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,f_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fp=/(?:[*+-]|\d{1,9}[.)])/,Ox=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zx=Qt(Ox).replace(/bull/g,fp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),p_=Qt(Ox).replace(/bull/g,fp).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(),pp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,g_=/^[^\n]+/,gp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,m_=Qt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",gp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),y_=Qt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fp).getRegex(),Bu="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",mp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,x_=Qt("^ {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",mp).replace("tag",Bu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jx=Qt(pp).replace("hr",Zo).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",Bu).getRegex(),v_=Qt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",jx).getRegex(),yp={blockquote:v_,code:h_,def:m_,fences:d_,heading:f_,hr:Zo,html:x_,lheading:zx,list:y_,newline:u_,paragraph:jx,table:Ro,text:g_},Vy=Qt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Zo).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",Bu).getRegex(),b_={...yp,lheading:p_,table:Vy,paragraph:Qt(pp).replace("hr",Zo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Vy).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",Bu).getRegex()},S_={...yp,html:Qt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",mp).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:Ro,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Qt(pp).replace("hr",Zo).replace("heading",` *#{1,6} *[^
42
+ ]`).replace("lheading",zx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},C_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,w_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Nx=/^( {2,}|\\)\n(?!\s*$)/,k_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Au=/[\p{P}\p{S}]/u,xp=/[\s\p{P}\p{S}]/u,Wx=/[^\s\p{P}\p{S}]/u,__=Qt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xp).getRegex(),Hx=/(?!~)[\p{P}\p{S}]/u,T_=/(?!~)[\s\p{P}\p{S}]/u,E_=/(?:[^\s\p{P}\p{S}]|~)/u,L_=Qt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",c_?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),qx=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,M_=Qt(qx,"u").replace(/punct/g,Au).getRegex(),B_=Qt(qx,"u").replace(/punct/g,Hx).getRegex(),Ux="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",A_=Qt(Ux,"gu").replace(/notPunctSpace/g,Wx).replace(/punctSpace/g,xp).replace(/punct/g,Au).getRegex(),$_=Qt(Ux,"gu").replace(/notPunctSpace/g,E_).replace(/punctSpace/g,T_).replace(/punct/g,Hx).getRegex(),R_=Qt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Wx).replace(/punctSpace/g,xp).replace(/punct/g,Au).getRegex(),F_=Qt(/\\(punct)/,"gu").replace(/punct/g,Au).getRegex(),I_=Qt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),P_=Qt(mp).replace("(?:-->|$)","-->").getRegex(),D_=Qt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",P_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Vc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,O_=Qt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Vc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Gx=Qt(/^!?\[(label)\]\[(ref)\]/).replace("label",Vc).replace("ref",gp).getRegex(),Vx=Qt(/^!?\[(ref)\](?:\[\])?/).replace("ref",gp).getRegex(),z_=Qt("reflink|nolink(?!\\()","g").replace("reflink",Gx).replace("nolink",Vx).getRegex(),Yy=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,vp={_backpedal:Ro,anyPunctuation:F_,autolink:I_,blockSkip:L_,br:Nx,code:w_,del:Ro,emStrongLDelim:M_,emStrongRDelimAst:A_,emStrongRDelimUnd:R_,escape:C_,link:O_,nolink:Vx,punctuation:__,reflink:Gx,reflinkSearch:z_,tag:D_,text:k_,url:Ro},j_={...vp,link:Qt(/^!?\[(label)\]\((.*?)\)/).replace("label",Vc).getRegex(),reflink:Qt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Vc).getRegex()},df={...vp,emStrongRDelimAst:$_,emStrongLDelim:B_,url:Qt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Yy).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:Qt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Yy).getRegex()},N_={...df,br:Qt(Nx).replace("{2,}","*").getRegex(),text:Qt(df.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},gc={normal:yp,gfm:b_,pedantic:S_},ho={normal:vp,gfm:df,breaks:N_,pedantic:j_},W_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xy=e=>W_[e];function Rn(e,t){if(t){if(nr.escapeTest.test(e))return e.replace(nr.escapeReplace,Xy)}else if(nr.escapeTestNoEncode.test(e))return e.replace(nr.escapeReplaceNoEncode,Xy);return e}function Qy(e){try{e=encodeURI(e).replace(nr.percentDecode,"%")}catch{return null}return e}function Ky(e,t){var o;let r=e.replace(nr.findPipe,(c,l,h)=>{let d=!1,f=l;for(;--f>=0&&h[f]==="\\";)d=!d;return d?"|":" |"}),n=r.split(nr.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!((o=n.at(-1))!=null&&o.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(nr.slashPipe,"|");return n}function fo(e,t,r){let n=e.length;if(n===0)return"";let s=0;for(;s<n&&e.charAt(n-s-1)===t;)s++;return e.slice(0,n-s)}function H_(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function Zy(e,t,r,n,s){let o=t.href,c=t.title||null,l=e[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let h={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:o,title:c,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,h}function q_(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(n===null)return t;let s=n[1];return t.split(`
43
+ `).map(o=>{let c=o.match(r.other.beginningSpace);if(c===null)return o;let[l]=c;return l.length>=s.length?o.slice(s.length):o}).join(`
44
+ `)}var Yc=class{constructor(t){ne(this,"options");ne(this,"rules");ne(this,"lexer");this.options=t||Ss}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let n=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:fo(n,`
45
+ `)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let n=r[0],s=q_(n,r[3]||"",this.rules);return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:s}}}heading(t){let r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(this.rules.other.endingHash.test(n)){let s=fo(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:fo(r[0],`
46
+ `)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let n=fo(r[0],`
47
+ `).split(`
48
+ `),s="",o="",c=[];for(;n.length>0;){let l=!1,h=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))h.push(n[d]),l=!0;else if(!l)h.push(n[d]);else break;n=n.slice(d);let f=h.join(`
49
+ `),g=f.replace(this.rules.other.blockquoteSetextReplace,`
50
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
51
+ ${f}`:f,o=o?`${o}
52
+ ${g}`:g;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,c,!0),this.lexer.state.top=m,n.length===0)break;let y=c.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let v=y,b=v.raw+`
53
+ `+n.join(`
54
+ `),k=this.blockquote(b);c[c.length-1]=k,s=s.substring(0,s.length-v.raw.length)+k.raw,o=o.substring(0,o.length-v.text.length)+k.text;break}else if((y==null?void 0:y.type)==="list"){let v=y,b=v.raw+`
55
+ `+n.join(`
56
+ `),k=this.list(b);c[c.length-1]=k,s=s.substring(0,s.length-y.raw.length)+k.raw,o=o.substring(0,o.length-v.raw.length)+k.raw,n=b.substring(c.at(-1).raw.length).split(`
57
+ `);continue}}return{type:"blockquote",raw:s,tokens:c,text:o}}}list(t){let r=this.rules.block.list.exec(t);if(r){let n=r[1].trim(),s=n.length>1,o={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let c=this.rules.other.listItemRegex(n),l=!1;for(;t;){let d=!1,f="",g="";if(!(r=c.exec(t))||this.rules.block.hr.test(t))break;f=r[0],t=t.substring(f.length);let m=r[2].split(`
58
+ `,1)[0].replace(this.rules.other.listReplaceTabs,_=>" ".repeat(3*_.length)),y=t.split(`
59
+ `,1)[0],v=!m.trim(),b=0;if(this.options.pedantic?(b=2,g=m.trimStart()):v?b=r[1].length+1:(b=r[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,g=m.slice(b),b+=r[1].length),v&&this.rules.other.blankLine.test(y)&&(f+=y+`
60
+ `,t=t.substring(y.length+1),d=!0),!d){let _=this.rules.other.nextBulletRegex(b),B=this.rules.other.hrRegex(b),L=this.rules.other.fencesBeginRegex(b),A=this.rules.other.headingBeginRegex(b),E=this.rules.other.htmlBeginRegex(b);for(;t;){let $=t.split(`
61
+ `,1)[0],z;if(y=$,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),z=y):z=y.replace(this.rules.other.tabCharGlobal," "),L.test(y)||A.test(y)||E.test(y)||_.test(y)||B.test(y))break;if(z.search(this.rules.other.nonSpaceChar)>=b||!y.trim())g+=`
62
+ `+z.slice(b);else{if(v||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||L.test(m)||A.test(m)||B.test(m))break;g+=`
63
+ `+y}!v&&!y.trim()&&(v=!0),f+=$+`
64
+ `,t=t.substring($.length+1),m=z.slice(b)}}o.loose||(l?o.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(l=!0));let k=null,T;this.options.gfm&&(k=this.rules.other.listIsTask.exec(g),k&&(T=k[0]!=="[ ] ",g=g.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:f,task:!!k,checked:T,loose:!1,text:g,tokens:[]}),o.raw+=f}let h=o.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let d=0;d<o.items.length;d++)if(this.lexer.state.top=!1,o.items[d].tokens=this.lexer.blockTokens(o.items[d].text,[]),!o.loose){let f=o.items[d].tokens.filter(m=>m.type==="space"),g=f.length>0&&f.some(m=>this.rules.other.anyLine.test(m.raw));o.loose=g}if(o.loose)for(let d=0;d<o.items.length;d++)o.items[d].loose=!0;return o}}html(t){let r=this.rules.block.html.exec(t);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(t){let r=this.rules.block.def.exec(t);if(r){let n=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:n,raw:r[0],href:s,title:o}}}table(t){var l;let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let n=Ky(r[1]),s=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(l=r[3])!=null&&l.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
65
+ `):[],c={type:"table",raw:r[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let h of s)this.rules.other.tableAlignRight.test(h)?c.align.push("right"):this.rules.other.tableAlignCenter.test(h)?c.align.push("center"):this.rules.other.tableAlignLeft.test(h)?c.align.push("left"):c.align.push(null);for(let h=0;h<n.length;h++)c.header.push({text:n[h],tokens:this.lexer.inline(n[h]),header:!0,align:c.align[h]});for(let h of o)c.rows.push(Ky(h,c.header.length).map((d,f)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:c.align[f]})));return c}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let n=r[1].charAt(r[1].length-1)===`
66
+ `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let n=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let c=fo(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=H_(r[2],"()");if(c===-2)return;if(c>-1){let l=(r[0].indexOf("!")===0?5:4)+r[1].length+c;r[2]=r[2].substring(0,c),r[0]=r[0].substring(0,l).trim(),r[3]=""}}let s=r[2],o="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(s);c&&(s=c[1],o=c[3])}else o=r[3]?r[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),Zy(r,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(t,r){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=r[s.toLowerCase()];if(!o){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return Zy(n,o,n[0],this.lexer,this.rules)}}emStrong(t,r,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!n||this.rules.inline.punctuation.exec(n))){let o=[...s[0]].length-1,c,l,h=o,d=0,f=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,r=r.slice(-1*t.length+o);(s=f.exec(r))!=null;){if(c=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!c)continue;if(l=[...c].length,s[3]||s[4]){h+=l;continue}else if((s[5]||s[6])&&o%3&&!((o+l)%3)){d+=l;continue}if(h-=l,h>0)continue;l=Math.min(l,l+h+d);let g=[...s[0]][0].length,m=t.slice(0,o+s.index+g+l);if(Math.min(o,l)%2){let v=m.slice(1,-1);return{type:"em",raw:m,text:v,tokens:this.lexer.inlineTokens(v)}}let y=m.slice(2,-2);return{type:"strong",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(t){let r=this.rules.inline.code.exec(t);if(r){let n=r[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:r[0],text:n}}}br(t){let r=this.rules.inline.br.exec(t);if(r)return{type:"br",raw:r[0]}}del(t){let r=this.rules.inline.del.exec(t);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(t){let r=this.rules.inline.autolink.exec(t);if(r){let n,s;return r[2]==="@"?(n=r[1],s="mailto:"+n):(n=r[1],s=n),{type:"link",raw:r[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let r;if(r=this.rules.inline.url.exec(t)){let s,o;if(r[2]==="@")s=r[0],o="mailto:"+s;else{let c;do c=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(c!==r[0]);s=r[0],r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let r=this.rules.inline.text.exec(t);if(r){let n=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:n}}}},yn=class ff{constructor(t){ne(this,"tokens");ne(this,"options");ne(this,"state");ne(this,"tokenizer");ne(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ss,this.options.tokenizer=this.options.tokenizer||new Yc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:nr,block:gc.normal,inline:ho.normal};this.options.pedantic?(r.block=gc.pedantic,r.inline=ho.pedantic):this.options.gfm&&(r.block=gc.gfm,this.options.breaks?r.inline=ho.breaks:r.inline=ho.gfm),this.tokenizer.rules=r}static get rules(){return{block:gc,inline:ho}}static lex(t,r){return new ff(r).lex(t)}static lexInline(t,r){return new ff(r).inlineTokens(t)}lex(t){t=t.replace(nr.carriageReturn,`
67
+ `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){var s,o,c;for(this.options.pedantic&&(t=t.replace(nr.tabCharGlobal," ").replace(nr.spaceLine,""));t;){let l;if((o=(s=this.options.extensions)==null?void 0:s.block)!=null&&o.some(d=>(l=d.call({lexer:this},t,r))?(t=t.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);let d=r.at(-1);l.raw.length===1&&d!==void 0?d.raw+=`
68
+ `:r.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let d=r.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
69
+ `)?"":`
70
+ `)+l.raw,d.text+=`
71
+ `+l.text,this.inlineQueue.at(-1).src=d.text):r.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);let d=r.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
72
+ `)?"":`
73
+ `)+l.raw,d.text+=`
74
+ `+l.raw,this.inlineQueue.at(-1).src=d.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},r.push(l));continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),r.push(l);continue}let h=t;if((c=this.options.extensions)!=null&&c.startBlock){let d=1/0,f=t.slice(1),g;this.options.extensions.startBlock.forEach(m=>{g=m.call({lexer:this},f),typeof g=="number"&&g>=0&&(d=Math.min(d,g))}),d<1/0&&d>=0&&(h=t.substring(0,d+1))}if(this.state.top&&(l=this.tokenizer.paragraph(h))){let d=r.at(-1);n&&(d==null?void 0:d.type)==="paragraph"?(d.raw+=(d.raw.endsWith(`
75
+ `)?"":`
76
+ `)+l.raw,d.text+=`
77
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):r.push(l),n=h.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);let d=r.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
78
+ `)?"":`
79
+ `)+l.raw,d.text+=`
80
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):r.push(l);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var h,d,f,g,m;let n=t,s=null;if(this.tokens.links){let y=Object.keys(this.tokens.links);if(y.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)y.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)o=s[2]?s[2].length:0,n=n.slice(0,s.index+o)+"["+"a".repeat(s[0].length-o-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((d=(h=this.options.hooks)==null?void 0:h.emStrongMask)==null?void 0:d.call({lexer:this},n))??n;let c=!1,l="";for(;t;){c||(l=""),c=!1;let y;if((g=(f=this.options.extensions)==null?void 0:f.inline)!=null&&g.some(b=>(y=b.call({lexer:this},t,r))?(t=t.substring(y.raw.length),r.push(y),!0):!1))continue;if(y=this.tokenizer.escape(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.tag(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.link(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(y.raw.length);let b=r.at(-1);y.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=y.raw,b.text+=y.text):r.push(y);continue}if(y=this.tokenizer.emStrong(t,n,l)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.codespan(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.br(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.del(t)){t=t.substring(y.raw.length),r.push(y);continue}if(y=this.tokenizer.autolink(t)){t=t.substring(y.raw.length),r.push(y);continue}if(!this.state.inLink&&(y=this.tokenizer.url(t))){t=t.substring(y.raw.length),r.push(y);continue}let v=t;if((m=this.options.extensions)!=null&&m.startInline){let b=1/0,k=t.slice(1),T;this.options.extensions.startInline.forEach(_=>{T=_.call({lexer:this},k),typeof T=="number"&&T>=0&&(b=Math.min(b,T))}),b<1/0&&b>=0&&(v=t.substring(0,b+1))}if(y=this.tokenizer.inlineText(v)){t=t.substring(y.raw.length),y.raw.slice(-1)!=="_"&&(l=y.raw.slice(-1)),c=!0;let b=r.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=y.raw,b.text+=y.text):r.push(y);continue}if(t){let b="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return r}},Xc=class{constructor(t){ne(this,"options");ne(this,"parser");this.options=t||Ss}space(t){return""}code({text:t,lang:r,escaped:n}){var c;let s=(c=(r||"").match(nr.notSpaceStart))==null?void 0:c[0],o=t.replace(nr.endingNewline,"")+`
81
+ `;return s?'<pre><code class="language-'+Rn(s)+'">'+(n?o:Rn(o,!0))+`</code></pre>
82
+ `:"<pre><code>"+(n?o:Rn(o,!0))+`</code></pre>
83
+ `}blockquote({tokens:t}){return`<blockquote>
84
+ ${this.parser.parse(t)}</blockquote>
85
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
86
+ `}hr(t){return`<hr>
87
+ `}list(t){let r=t.ordered,n=t.start,s="";for(let l=0;l<t.items.length;l++){let h=t.items[l];s+=this.listitem(h)}let o=r?"ol":"ul",c=r&&n!==1?' start="'+n+'"':"";return"<"+o+c+`>
88
+ `+s+"</"+o+`>
89
+ `}listitem(t){var n;let r="";if(t.task){let s=this.checkbox({checked:!!t.checked});t.loose?((n=t.tokens[0])==null?void 0:n.type)==="paragraph"?(t.tokens[0].text=s+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=s+" "+Rn(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):r+=s+" "}return r+=this.parser.parse(t.tokens,!!t.loose),`<li>${r}</li>
90
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
91
+ `}table(t){let r="",n="";for(let o=0;o<t.header.length;o++)n+=this.tablecell(t.header[o]);r+=this.tablerow({text:n});let s="";for(let o=0;o<t.rows.length;o++){let c=t.rows[o];n="";for(let l=0;l<c.length;l++)n+=this.tablecell(c[l]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
92
+ <thead>
93
+ `+r+`</thead>
94
+ `+s+`</table>
95
+ `}tablerow({text:t}){return`<tr>
96
+ ${t}</tr>
97
+ `}tablecell(t){let r=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+r+`</${n}>
98
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Rn(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:n}){let s=this.parser.parseInline(n),o=Qy(t);if(o===null)return s;t=o;let c='<a href="'+t+'"';return r&&(c+=' title="'+Rn(r)+'"'),c+=">"+s+"</a>",c}image({href:t,title:r,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let o=Qy(t);if(o===null)return Rn(n);t=o;let c=`<img src="${t}" alt="${n}"`;return r&&(c+=` title="${Rn(r)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Rn(t.text)}},bp=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},xn=class pf{constructor(t){ne(this,"options");ne(this,"renderer");ne(this,"textRenderer");this.options=t||Ss,this.options.renderer=this.options.renderer||new Xc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new bp}static parse(t,r){return new pf(r).parse(t)}static parseInline(t,r){return new pf(r).parseInline(t)}parse(t,r=!0){var s,o;let n="";for(let c=0;c<t.length;c++){let l=t[c];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[l.type]){let d=l,f=this.options.extensions.renderers[d.type].call({parser:this},d);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=f||"";continue}}let h=l;switch(h.type){case"space":{n+=this.renderer.space(h);continue}case"hr":{n+=this.renderer.hr(h);continue}case"heading":{n+=this.renderer.heading(h);continue}case"code":{n+=this.renderer.code(h);continue}case"table":{n+=this.renderer.table(h);continue}case"blockquote":{n+=this.renderer.blockquote(h);continue}case"list":{n+=this.renderer.list(h);continue}case"html":{n+=this.renderer.html(h);continue}case"def":{n+=this.renderer.def(h);continue}case"paragraph":{n+=this.renderer.paragraph(h);continue}case"text":{let d=h,f=this.renderer.text(d);for(;c+1<t.length&&t[c+1].type==="text";)d=t[++c],f+=`
99
+ `+this.renderer.text(d);r?n+=this.renderer.paragraph({type:"paragraph",raw:f,text:f,tokens:[{type:"text",raw:f,text:f,escaped:!0}]}):n+=f;continue}default:{let d='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(t,r=this.renderer){var s,o;let n="";for(let c=0;c<t.length;c++){let l=t[c];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[l.type]){let d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=d||"";continue}}let h=l;switch(h.type){case"escape":{n+=r.text(h);break}case"html":{n+=r.html(h);break}case"link":{n+=r.link(h);break}case"image":{n+=r.image(h);break}case"strong":{n+=r.strong(h);break}case"em":{n+=r.em(h);break}case"codespan":{n+=r.codespan(h);break}case"br":{n+=r.br(h);break}case"del":{n+=r.del(h);break}case"text":{n+=r.text(h);break}default:{let d='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}},Bc,ko=(Bc=class{constructor(t){ne(this,"options");ne(this,"block");this.options=t||Ss}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?yn.lex:yn.lexInline}provideParser(){return this.block?xn.parse:xn.parseInline}},ne(Bc,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),ne(Bc,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Bc),U_=class{constructor(...t){ne(this,"defaults",dp());ne(this,"options",this.setOptions);ne(this,"parse",this.parseMarkdown(!0));ne(this,"parseInline",this.parseMarkdown(!1));ne(this,"Parser",xn);ne(this,"Renderer",Xc);ne(this,"TextRenderer",bp);ne(this,"Lexer",yn);ne(this,"Tokenizer",Yc);ne(this,"Hooks",ko);this.use(...t)}walkTokens(t,r){var s,o;let n=[];for(let c of t)switch(n=n.concat(r.call(this,c)),c.type){case"table":{let l=c;for(let h of l.header)n=n.concat(this.walkTokens(h.tokens,r));for(let h of l.rows)for(let d of h)n=n.concat(this.walkTokens(d.tokens,r));break}case"list":{let l=c;n=n.concat(this.walkTokens(l.items,r));break}default:{let l=c;(o=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&o[l.type]?this.defaults.extensions.childTokens[l.type].forEach(h=>{let d=l[h].flat(1/0);n=n.concat(this.walkTokens(d,r))}):l.tokens&&(n=n.concat(this.walkTokens(l.tokens,r)))}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let c=r.renderers[o.name];c?r.renderers[o.name]=function(...l){let h=o.renderer.apply(this,l);return h===!1&&(h=c.apply(this,l)),h}:r.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let c=r[o.level];c?c.unshift(o.tokenizer):r[o.level]=[o.tokenizer],o.start&&(o.level==="block"?r.startBlock?r.startBlock.push(o.start):r.startBlock=[o.start]:o.level==="inline"&&(r.startInline?r.startInline.push(o.start):r.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(r.childTokens[o.name]=o.childTokens)}),s.extensions=r),n.renderer){let o=this.defaults.renderer||new Xc(this.defaults);for(let c in n.renderer){if(!(c in o))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;let l=c,h=n.renderer[l],d=o[l];o[l]=(...f)=>{let g=h.apply(o,f);return g===!1&&(g=d.apply(o,f)),g||""}}s.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new Yc(this.defaults);for(let c in n.tokenizer){if(!(c in o))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;let l=c,h=n.tokenizer[l],d=o[l];o[l]=(...f)=>{let g=h.apply(o,f);return g===!1&&(g=d.apply(o,f)),g}}s.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new ko;for(let c in n.hooks){if(!(c in o))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;let l=c,h=n.hooks[l],d=o[l];ko.passThroughHooks.has(c)?o[l]=f=>{if(this.defaults.async&&ko.passThroughHooksRespectAsync.has(c))return(async()=>{let m=await h.call(o,f);return d.call(o,m)})();let g=h.call(o,f);return d.call(o,g)}:o[l]=(...f)=>{if(this.defaults.async)return(async()=>{let m=await h.apply(o,f);return m===!1&&(m=await d.apply(o,f)),m})();let g=h.apply(o,f);return g===!1&&(g=d.apply(o,f)),g}}s.hooks=o}if(n.walkTokens){let o=this.defaults.walkTokens,c=n.walkTokens;s.walkTokens=function(l){let h=[];return h.push(c.call(this,l)),o&&(h=h.concat(o.call(this,l))),h}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return yn.lex(t,r??this.defaults)}parser(t,r){return xn.parse(t,r??this.defaults)}parseMarkdown(t){return(r,n)=>{let s={...n},o={...this.defaults,...s},c=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return c(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let l=o.hooks?await o.hooks.preprocess(r):r,h=await(o.hooks?await o.hooks.provideLexer():t?yn.lex:yn.lexInline)(l,o),d=o.hooks?await o.hooks.processAllTokens(h):h;o.walkTokens&&await Promise.all(this.walkTokens(d,o.walkTokens));let f=await(o.hooks?await o.hooks.provideParser():t?xn.parse:xn.parseInline)(d,o);return o.hooks?await o.hooks.postprocess(f):f})().catch(c);try{o.hooks&&(r=o.hooks.preprocess(r));let l=(o.hooks?o.hooks.provideLexer():t?yn.lex:yn.lexInline)(r,o);o.hooks&&(l=o.hooks.processAllTokens(l)),o.walkTokens&&this.walkTokens(l,o.walkTokens);let h=(o.hooks?o.hooks.provideParser():t?xn.parse:xn.parseInline)(l,o);return o.hooks&&(h=o.hooks.postprocess(h)),h}catch(l){return c(l)}}}onError(t,r){return n=>{if(n.message+=`
100
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+Rn(n.message+"",!0)+"</pre>";return r?Promise.resolve(s):s}if(r)return Promise.reject(n);throw n}}},ps=new U_;function Xt(e,t){return ps.parse(e,t)}Xt.options=Xt.setOptions=function(e){return ps.setOptions(e),Xt.defaults=ps.defaults,Dx(Xt.defaults),Xt};Xt.getDefaults=dp;Xt.defaults=Ss;Xt.use=function(...e){return ps.use(...e),Xt.defaults=ps.defaults,Dx(Xt.defaults),Xt};Xt.walkTokens=function(e,t){return ps.walkTokens(e,t)};Xt.parseInline=ps.parseInline;Xt.Parser=xn;Xt.parser=xn.parse;Xt.Renderer=Xc;Xt.TextRenderer=bp;Xt.Lexer=yn;Xt.lexer=yn.lex;Xt.Tokenizer=Yc;Xt.Hooks=ko;Xt.parse=Xt;Xt.options;Xt.setOptions;Xt.use;Xt.walkTokens;Xt.parseInline;xn.parse;yn.lex;/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:Yx,setPrototypeOf:Jy,isFrozen:G_,getPrototypeOf:V_,getOwnPropertyDescriptor:Y_}=Object;let{freeze:ar,seal:Kr,create:Ac}=Object,{apply:gf,construct:mf}=typeof Reflect<"u"&&Reflect;ar||(ar=function(t){return t});Kr||(Kr=function(t){return t});gf||(gf=function(t,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),o=2;o<n;o++)s[o-2]=arguments[o];return t.apply(r,s)});mf||(mf=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return new t(...n)});const mc=or(Array.prototype.forEach),X_=or(Array.prototype.lastIndexOf),t0=or(Array.prototype.pop),po=or(Array.prototype.push),Q_=or(Array.prototype.splice),$c=or(String.prototype.toLowerCase),Wd=or(String.prototype.toString),Hd=or(String.prototype.match),go=or(String.prototype.replace),K_=or(String.prototype.indexOf),Z_=or(String.prototype.trim),Fr=or(Object.prototype.hasOwnProperty),rr=or(RegExp.prototype.test),mo=J_(TypeError);function or(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return gf(e,t,n)}}function J_(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return mf(e,r)}}function Ht(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$c;Jy&&Jy(e,null);let n=t.length;for(;n--;){let s=t[n];if(typeof s=="string"){const o=r(s);o!==s&&(G_(t)||(t[n]=o),s=o)}e[s]=!0}return e}function tT(e){for(let t=0;t<e.length;t++)Fr(e,t)||(e[t]=null);return e}function Fn(e){const t=Ac(null);for(const[r,n]of Yx(e))Fr(e,r)&&(Array.isArray(n)?t[r]=tT(n):n&&typeof n=="object"&&n.constructor===Object?t[r]=Fn(n):t[r]=n);return t}function yo(e,t){for(;e!==null;){const n=Y_(e,t);if(n){if(n.get)return or(n.get);if(typeof n.value=="function")return or(n.value)}e=V_(e)}function r(){return null}return r}const e0=ar(["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"]),qd=ar(["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"]),Ud=ar(["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"]),eT=ar(["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"]),Gd=ar(["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"]),rT=ar(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),r0=ar(["#text"]),n0=ar(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),Vd=ar(["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","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","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-rendering","textlength","type","u1","u2","unicode","values","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"]),i0=ar(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),yc=ar(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),nT=Kr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),iT=Kr(/<%[\w\W]*|[\w\W]*%>/gm),sT=Kr(/\$\{[\w\W]*/gm),aT=Kr(/^data-[\-\w.\u00B7-\uFFFF]+$/),oT=Kr(/^aria-[\-\w]+$/),Xx=Kr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lT=Kr(/^(?:\w+script|data):/i),cT=Kr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qx=Kr(/^html$/i),uT=Kr(/^[a-z][.\w]*(-[.\w]+)+$/i);var s0=Object.freeze({__proto__:null,ARIA_ATTR:oT,ATTR_WHITESPACE:cT,CUSTOM_ELEMENT:uT,DATA_ATTR:aT,DOCTYPE_NAME:Qx,ERB_EXPR:iT,IS_ALLOWED_URI:Xx,IS_SCRIPT_OR_DATA:lT,MUSTACHE_EXPR:nT,TMPLIT_EXPR:sT});const xo={element:1,text:3,progressingInstruction:7,comment:8,document:9},hT=function(){return typeof window>"u"?null:window},dT=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";r&&r.hasAttribute(s)&&(n=r.getAttribute(s));const o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},a0=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Kx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hT();const t=Bt=>Kx(Bt);if(t.version="3.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==xo.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e;const n=r,s=n.currentScript,{DocumentFragment:o,HTMLTemplateElement:c,Node:l,Element:h,NodeFilter:d,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:g,DOMParser:m,trustedTypes:y}=e,v=h.prototype,b=yo(v,"cloneNode"),k=yo(v,"remove"),T=yo(v,"nextSibling"),_=yo(v,"childNodes"),B=yo(v,"parentNode");if(typeof c=="function"){const Bt=r.createElement("template");Bt.content&&Bt.content.ownerDocument&&(r=Bt.content.ownerDocument)}let L,A="";const{implementation:E,createNodeIterator:$,createDocumentFragment:z,getElementsByTagName:Z}=r,{importNode:W}=n;let G=a0();t.isSupported=typeof Yx=="function"&&typeof B=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:it,ERB_EXPR:rt,TMPLIT_EXPR:H,DATA_ATTR:q,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:Y,ATTR_WHITESPACE:P,CUSTOM_ELEMENT:K}=s0;let{IS_ALLOWED_URI:et}=s0,I=null;const tt=Ht({},[...e0,...qd,...Ud,...Gd,...r0]);let ct=null;const mt=Ht({},[...n0,...Vd,...i0,...yc]);let dt=Object.seal(Ac(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}})),ht=null,X=null;const ft=Object.seal(Ac(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let vt=!0,Ft=!0,ie=!1,ze=!0,ee=!1,cr=!0,Dr=!1,tn=!1,Je=!1,ur=!1,Or=!1,zr=!1,en=!0,jr=!1;const Ts="user-content-";let Wn=!0,kn=!1,rn={},je=null;const _n=Ht({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let hr=null;const nn=Ht({},["audio","video","img","source","image","track"]);let pt=null;const re=Ht({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Nr="http://www.w3.org/1998/Math/MathML",kr="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml";let Ne=Fe,_r=!1,dr=null;const Tn=Ht({},[Nr,kr,Fe],Wd);let sn=Ht({},["mi","mo","mn","ms","mtext"]),fr=Ht({},["annotation-xml"]);const an=Ht({},["title","style","font","a","script"]);let on=null;const Ni=["application/xhtml+xml","text/html"],Wi="text/html";let Kt=null,de=null;const Me=r.createElement("form"),ai=function(O){return O instanceof RegExp||O instanceof Function},Tr=function(){let O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(de&&de===O)){if((!O||typeof O!="object")&&(O={}),O=Fn(O),on=Ni.indexOf(O.PARSER_MEDIA_TYPE)===-1?Wi:O.PARSER_MEDIA_TYPE,Kt=on==="application/xhtml+xml"?Wd:$c,I=Fr(O,"ALLOWED_TAGS")?Ht({},O.ALLOWED_TAGS,Kt):tt,ct=Fr(O,"ALLOWED_ATTR")?Ht({},O.ALLOWED_ATTR,Kt):mt,dr=Fr(O,"ALLOWED_NAMESPACES")?Ht({},O.ALLOWED_NAMESPACES,Wd):Tn,pt=Fr(O,"ADD_URI_SAFE_ATTR")?Ht(Fn(re),O.ADD_URI_SAFE_ATTR,Kt):re,hr=Fr(O,"ADD_DATA_URI_TAGS")?Ht(Fn(nn),O.ADD_DATA_URI_TAGS,Kt):nn,je=Fr(O,"FORBID_CONTENTS")?Ht({},O.FORBID_CONTENTS,Kt):_n,ht=Fr(O,"FORBID_TAGS")?Ht({},O.FORBID_TAGS,Kt):Fn({}),X=Fr(O,"FORBID_ATTR")?Ht({},O.FORBID_ATTR,Kt):Fn({}),rn=Fr(O,"USE_PROFILES")?O.USE_PROFILES:!1,vt=O.ALLOW_ARIA_ATTR!==!1,Ft=O.ALLOW_DATA_ATTR!==!1,ie=O.ALLOW_UNKNOWN_PROTOCOLS||!1,ze=O.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ee=O.SAFE_FOR_TEMPLATES||!1,cr=O.SAFE_FOR_XML!==!1,Dr=O.WHOLE_DOCUMENT||!1,ur=O.RETURN_DOM||!1,Or=O.RETURN_DOM_FRAGMENT||!1,zr=O.RETURN_TRUSTED_TYPE||!1,Je=O.FORCE_BODY||!1,en=O.SANITIZE_DOM!==!1,jr=O.SANITIZE_NAMED_PROPS||!1,Wn=O.KEEP_CONTENT!==!1,kn=O.IN_PLACE||!1,et=O.ALLOWED_URI_REGEXP||Xx,Ne=O.NAMESPACE||Fe,sn=O.MATHML_TEXT_INTEGRATION_POINTS||sn,fr=O.HTML_INTEGRATION_POINTS||fr,dt=O.CUSTOM_ELEMENT_HANDLING||{},O.CUSTOM_ELEMENT_HANDLING&&ai(O.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(dt.tagNameCheck=O.CUSTOM_ELEMENT_HANDLING.tagNameCheck),O.CUSTOM_ELEMENT_HANDLING&&ai(O.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(dt.attributeNameCheck=O.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),O.CUSTOM_ELEMENT_HANDLING&&typeof O.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(dt.allowCustomizedBuiltInElements=O.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ee&&(Ft=!1),Or&&(ur=!0),rn&&(I=Ht({},r0),ct=Ac(null),rn.html===!0&&(Ht(I,e0),Ht(ct,n0)),rn.svg===!0&&(Ht(I,qd),Ht(ct,Vd),Ht(ct,yc)),rn.svgFilters===!0&&(Ht(I,Ud),Ht(ct,Vd),Ht(ct,yc)),rn.mathMl===!0&&(Ht(I,Gd),Ht(ct,i0),Ht(ct,yc))),Fr(O,"ADD_TAGS")||(ft.tagCheck=null),Fr(O,"ADD_ATTR")||(ft.attributeCheck=null),O.ADD_TAGS&&(typeof O.ADD_TAGS=="function"?ft.tagCheck=O.ADD_TAGS:(I===tt&&(I=Fn(I)),Ht(I,O.ADD_TAGS,Kt))),O.ADD_ATTR&&(typeof O.ADD_ATTR=="function"?ft.attributeCheck=O.ADD_ATTR:(ct===mt&&(ct=Fn(ct)),Ht(ct,O.ADD_ATTR,Kt))),O.ADD_URI_SAFE_ATTR&&Ht(pt,O.ADD_URI_SAFE_ATTR,Kt),O.FORBID_CONTENTS&&(je===_n&&(je=Fn(je)),Ht(je,O.FORBID_CONTENTS,Kt)),O.ADD_FORBID_CONTENTS&&(je===_n&&(je=Fn(je)),Ht(je,O.ADD_FORBID_CONTENTS,Kt)),Wn&&(I["#text"]=!0),Dr&&Ht(I,["html","head","body"]),I.table&&(Ht(I,["tbody"]),delete ht.tbody),O.TRUSTED_TYPES_POLICY){if(typeof O.TRUSTED_TYPES_POLICY.createHTML!="function")throw mo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof O.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw mo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');L=O.TRUSTED_TYPES_POLICY,A=L.createHTML("")}else L===void 0&&(L=dT(y,s)),L!==null&&typeof A=="string"&&(A=L.createHTML(""));ar&&ar(O),de=O}},Es=Ht({},[...qd,...Ud,...eT]),oi=Ht({},[...Gd,...rT]),nh=function(O){let lt=B(O);(!lt||!lt.tagName)&&(lt={namespaceURI:Ne,tagName:"template"});const kt=$c(O.tagName),se=$c(lt.tagName);return dr[O.namespaceURI]?O.namespaceURI===kr?lt.namespaceURI===Fe?kt==="svg":lt.namespaceURI===Nr?kt==="svg"&&(se==="annotation-xml"||sn[se]):!!Es[kt]:O.namespaceURI===Nr?lt.namespaceURI===Fe?kt==="math":lt.namespaceURI===kr?kt==="math"&&fr[se]:!!oi[kt]:O.namespaceURI===Fe?lt.namespaceURI===kr&&!fr[se]||lt.namespaceURI===Nr&&!sn[se]?!1:!oi[kt]&&(an[kt]||!Es[kt]):!!(on==="application/xhtml+xml"&&dr[O.namespaceURI]):!1},We=function(O){po(t.removed,{element:O});try{B(O).removeChild(O)}catch{k(O)}},Wr=function(O,lt){try{po(t.removed,{attribute:lt.getAttributeNode(O),from:lt})}catch{po(t.removed,{attribute:null,from:lt})}if(lt.removeAttribute(O),O==="is")if(ur||Or)try{We(lt)}catch{}else try{lt.setAttribute(O,"")}catch{}},Hi=function(O){let lt=null,kt=null;if(Je)O="<remove></remove>"+O;else{const ge=Hd(O,/^[\r\n\t ]+/);kt=ge&&ge[0]}on==="application/xhtml+xml"&&Ne===Fe&&(O='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+O+"</body></html>");const se=L?L.createHTML(O):O;if(Ne===Fe)try{lt=new m().parseFromString(se,on)}catch{}if(!lt||!lt.documentElement){lt=E.createDocument(Ne,"template",null);try{lt.documentElement.innerHTML=_r?A:se}catch{}}const Nt=lt.body||lt.documentElement;return O&&kt&&Nt.insertBefore(r.createTextNode(kt),Nt.childNodes[0]||null),Ne===Fe?Z.call(lt,Dr?"html":"body")[0]:Dr?lt.documentElement:Nt},Ls=function(O){return $.call(O.ownerDocument||O,O,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Ea=function(O){return O instanceof g&&(typeof O.nodeName!="string"||typeof O.textContent!="string"||typeof O.removeChild!="function"||!(O.attributes instanceof f)||typeof O.removeAttribute!="function"||typeof O.setAttribute!="function"||typeof O.namespaceURI!="string"||typeof O.insertBefore!="function"||typeof O.hasChildNodes!="function")},ll=function(O){return typeof l=="function"&&O instanceof l};function ln(Bt,O,lt){mc(Bt,kt=>{kt.call(t,O,lt,de)})}const En=function(O){let lt=null;if(ln(G.beforeSanitizeElements,O,null),Ea(O))return We(O),!0;const kt=Kt(O.nodeName);if(ln(G.uponSanitizeElement,O,{tagName:kt,allowedTags:I}),cr&&O.hasChildNodes()&&!ll(O.firstElementChild)&&rr(/<[/\w!]/g,O.innerHTML)&&rr(/<[/\w!]/g,O.textContent)||O.nodeType===xo.progressingInstruction||cr&&O.nodeType===xo.comment&&rr(/<[/\w]/g,O.data))return We(O),!0;if(!(ft.tagCheck instanceof Function&&ft.tagCheck(kt))&&(!I[kt]||ht[kt])){if(!ht[kt]&&Ma(kt)&&(dt.tagNameCheck instanceof RegExp&&rr(dt.tagNameCheck,kt)||dt.tagNameCheck instanceof Function&&dt.tagNameCheck(kt)))return!1;if(Wn&&!je[kt]){const se=B(O)||O.parentNode,Nt=_(O)||O.childNodes;if(Nt&&se){const ge=Nt.length;for(let Be=ge-1;Be>=0;--Be){const Hr=b(Nt[Be],!0);Hr.__removalCount=(O.__removalCount||0)+1,se.insertBefore(Hr,T(O))}}}return We(O),!0}return O instanceof h&&!nh(O)||(kt==="noscript"||kt==="noembed"||kt==="noframes")&&rr(/<\/no(script|embed|frames)/i,O.innerHTML)?(We(O),!0):(ee&&O.nodeType===xo.text&&(lt=O.textContent,mc([it,rt,H],se=>{lt=go(lt,se," ")}),O.textContent!==lt&&(po(t.removed,{element:O.cloneNode()}),O.textContent=lt)),ln(G.afterSanitizeElements,O,null),!1)},La=function(O,lt,kt){if(X[lt]||en&&(lt==="id"||lt==="name")&&(kt in r||kt in Me))return!1;if(!(Ft&&!X[lt]&&rr(q,lt))){if(!(vt&&rr(N,lt))){if(!(ft.attributeCheck instanceof Function&&ft.attributeCheck(lt,O))){if(!ct[lt]||X[lt]){if(!(Ma(O)&&(dt.tagNameCheck instanceof RegExp&&rr(dt.tagNameCheck,O)||dt.tagNameCheck instanceof Function&&dt.tagNameCheck(O))&&(dt.attributeNameCheck instanceof RegExp&&rr(dt.attributeNameCheck,lt)||dt.attributeNameCheck instanceof Function&&dt.attributeNameCheck(lt,O))||lt==="is"&&dt.allowCustomizedBuiltInElements&&(dt.tagNameCheck instanceof RegExp&&rr(dt.tagNameCheck,kt)||dt.tagNameCheck instanceof Function&&dt.tagNameCheck(kt))))return!1}else if(!pt[lt]){if(!rr(et,go(kt,P,""))){if(!((lt==="src"||lt==="xlink:href"||lt==="href")&&O!=="script"&&K_(kt,"data:")===0&&hr[O])){if(!(ie&&!rr(Y,go(kt,P,"")))){if(kt)return!1}}}}}}}return!0},Ma=function(O){return O!=="annotation-xml"&&Hd(O,K)},cl=function(O){ln(G.beforeSanitizeAttributes,O,null);const{attributes:lt}=O;if(!lt||Ea(O))return;const kt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ct,forceKeepAttr:void 0};let se=lt.length;for(;se--;){const Nt=lt[se],{name:ge,namespaceURI:Be,value:Hr}=Nt,cn=Kt(ge),Ba=Hr;let be=ge==="value"?Ba:Z_(Ba);if(kt.attrName=cn,kt.attrValue=be,kt.keepAttr=!0,kt.forceKeepAttr=void 0,ln(G.uponSanitizeAttribute,O,kt),be=kt.attrValue,jr&&(cn==="id"||cn==="name")&&(Wr(ge,O),be=Ts+be),cr&&rr(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,be)){Wr(ge,O);continue}if(cn==="attributename"&&Hd(be,"href")){Wr(ge,O);continue}if(kt.forceKeepAttr)continue;if(!kt.keepAttr){Wr(ge,O);continue}if(!ze&&rr(/\/>/i,be)){Wr(ge,O);continue}ee&&mc([it,rt,H],Er=>{be=go(be,Er," ")});const qi=Kt(O.nodeName);if(!La(qi,cn,be)){Wr(ge,O);continue}if(L&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!Be)switch(y.getAttributeType(qi,cn)){case"TrustedHTML":{be=L.createHTML(be);break}case"TrustedScriptURL":{be=L.createScriptURL(be);break}}if(be!==Ba)try{Be?O.setAttributeNS(Be,ge,be):O.setAttribute(ge,be),Ea(O)?We(O):t0(t.removed)}catch{Wr(ge,O)}}ln(G.afterSanitizeAttributes,O,null)},ul=function Bt(O){let lt=null;const kt=Ls(O);for(ln(G.beforeSanitizeShadowDOM,O,null);lt=kt.nextNode();)ln(G.uponSanitizeShadowNode,lt,null),En(lt),cl(lt),lt.content instanceof o&&Bt(lt.content);ln(G.afterSanitizeShadowDOM,O,null)};return t.sanitize=function(Bt){let O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},lt=null,kt=null,se=null,Nt=null;if(_r=!Bt,_r&&(Bt="<!-->"),typeof Bt!="string"&&!ll(Bt))if(typeof Bt.toString=="function"){if(Bt=Bt.toString(),typeof Bt!="string")throw mo("dirty is not a string, aborting")}else throw mo("toString is not a function");if(!t.isSupported)return Bt;if(tn||Tr(O),t.removed=[],typeof Bt=="string"&&(kn=!1),kn){if(Bt.nodeName){const Hr=Kt(Bt.nodeName);if(!I[Hr]||ht[Hr])throw mo("root node is forbidden and cannot be sanitized in-place")}}else if(Bt instanceof l)lt=Hi("<!---->"),kt=lt.ownerDocument.importNode(Bt,!0),kt.nodeType===xo.element&&kt.nodeName==="BODY"||kt.nodeName==="HTML"?lt=kt:lt.appendChild(kt);else{if(!ur&&!ee&&!Dr&&Bt.indexOf("<")===-1)return L&&zr?L.createHTML(Bt):Bt;if(lt=Hi(Bt),!lt)return ur?null:zr?A:""}lt&&Je&&We(lt.firstChild);const ge=Ls(kn?Bt:lt);for(;se=ge.nextNode();)En(se),cl(se),se.content instanceof o&&ul(se.content);if(kn)return Bt;if(ur){if(Or)for(Nt=z.call(lt.ownerDocument);lt.firstChild;)Nt.appendChild(lt.firstChild);else Nt=lt;return(ct.shadowroot||ct.shadowrootmode)&&(Nt=W.call(n,Nt,!0)),Nt}let Be=Dr?lt.outerHTML:lt.innerHTML;return Dr&&I["!doctype"]&&lt.ownerDocument&&lt.ownerDocument.doctype&&lt.ownerDocument.doctype.name&&rr(Qx,lt.ownerDocument.doctype.name)&&(Be="<!DOCTYPE "+lt.ownerDocument.doctype.name+`>
101
+ `+Be),ee&&mc([it,rt,H],Hr=>{Be=go(Be,Hr," ")}),L&&zr?L.createHTML(Be):Be},t.setConfig=function(){let Bt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tr(Bt),tn=!0},t.clearConfig=function(){de=null,tn=!1},t.isValidAttribute=function(Bt,O,lt){de||Tr({});const kt=Kt(Bt),se=Kt(O);return La(kt,se,lt)},t.addHook=function(Bt,O){typeof O=="function"&&po(G[Bt],O)},t.removeHook=function(Bt,O){if(O!==void 0){const lt=X_(G[Bt],O);return lt===-1?void 0:Q_(G[Bt],lt,1)[0]}return t0(G[Bt])},t.removeHooks=function(Bt){G[Bt]=[]},t.removeAllHooks=function(){G=a0()},t}var $i=Kx();Xt.setOptions({breaks:!0,gfm:!0});function o0(e){try{return{__html:$i.sanitize(Xt.parse(e))}}catch{return{__html:$i.sanitize(e)}}}const fT=[{label:"▶ Continue lesson",text:"/teach"},{label:"🎮 Quick game",text:"/teach --game"},{label:"📝 Quiz me",text:"/teach --quiz-only"},{label:"📖 Learn something new",text:"/learn"}];function l0({tool:e,theme:t}){const[r,n]=F.useState(!1),s=typeof e.input=="string"?e.input:JSON.stringify(e.input,null,2);return C.jsxs("div",{style:{maxWidth:"90%",border:`1px solid ${t.border}`,borderRadius:8,overflow:"hidden",marginTop:4},children:[C.jsxs("button",{style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"6px 12px",fontSize:12,color:t.textSecondary,backgroundColor:t.bgPrimary,border:"none",cursor:"pointer",textAlign:"left"},onClick:()=>n(!r),children:[C.jsx("span",{style:{fontSize:10,width:12},children:r?"▼":"▶"}),C.jsx("span",{style:{fontFamily:"monospace",color:t.purple},children:e.toolName}),e.output!==void 0&&C.jsx("span",{style:{color:t.success,marginLeft:"auto"},children:"✓"})]}),r&&C.jsxs("div",{style:{padding:"8px 12px",backgroundColor:t.bgPrimary,borderTop:`1px solid ${t.bgTertiary}`},children:[s&&C.jsx("pre",{style:{margin:0,padding:8,fontSize:12,fontFamily:"monospace",color:t.textPrimary,backgroundColor:t.bgSecondary,borderRadius:4,overflow:"auto",maxHeight:200,whiteSpace:"pre-wrap",wordBreak:"break-all"},children:s}),e.output!==void 0&&C.jsxs(C.Fragment,{children:[C.jsx("div",{style:{fontSize:11,color:t.textSecondary,marginTop:8,marginBottom:4},children:"Output"}),C.jsx("pre",{style:{margin:0,padding:8,fontSize:12,fontFamily:"monospace",color:t.textPrimary,backgroundColor:t.bgSecondary,borderRadius:4,overflow:"auto",maxHeight:200,whiteSpace:"pre-wrap",wordBreak:"break-all"},children:typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2)})]})]})]})}function pT({messages:e,streamingText:t,tools:r,chatStatus:n,onSend:s,onStop:o,onNewChat:c,onResume:l,sessions:h,sessionId:d,compact:f}){const{theme:g}=lr(),m=F.useMemo(()=>gT(g),[g]),[y,v]=F.useState(""),b=F.useRef(null),k=F.useRef(null),T=F.useCallback(()=>{var $;($=b.current)==null||$.scrollIntoView({behavior:"smooth"})},[]);F.useEffect(()=>{T()},[e,t,T]);const _=F.useCallback(()=>{const $=y.trim();!$||n==="thinking"||(s($),v(""))},[y,n,s]),B=F.useCallback($=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),_())},[_]),L=F.useCallback($=>{n==="thinking"||n==="streaming"||s($)},[n,s]),A=n==="thinking"||n==="streaming",E=e.length===0&&!t;return C.jsxs("div",{style:m.container,children:[C.jsxs("div",{style:m.messageList,children:[E&&C.jsxs("div",{style:m.welcome,children:[C.jsx("div",{style:m.welcomeTitle,children:"ClaudeTeach"}),C.jsx("div",{style:m.welcomeSubtitle,children:"Ask me anything, or try a command:"}),C.jsx("div",{style:m.welcomeCommands,children:["/teach git","/learn react","/stats"].map($=>C.jsx("button",{style:m.commandChip,onClick:()=>{var z;v($),(z=k.current)==null||z.focus()},children:$},$))})]}),e.map(($,z)=>{var Z;return C.jsxs("div",{style:$.role==="user"?m.userRow:m.assistantRow,children:[!f&&C.jsx("div",{style:m.roleLabel,children:$.role==="user"?"You":"Claude"}),$.role==="user"?C.jsx("div",{style:m.userBubble,children:$.text}):C.jsx("div",{style:m.assistantBubble,children:C.jsx("div",{style:m.markdown,dangerouslySetInnerHTML:o0($.text)})}),(Z=$.tools)==null?void 0:Z.map((W,G)=>C.jsx(l0,{tool:W,theme:g},G))]},z)}),t&&C.jsxs("div",{style:m.assistantRow,children:[!f&&C.jsx("div",{style:m.roleLabel,children:"Claude"}),C.jsxs("div",{style:m.assistantBubble,children:[C.jsx("div",{style:m.markdown,dangerouslySetInnerHTML:o0(t)}),C.jsx("span",{style:m.cursor,children:"|"})]})]}),r.filter($=>$.output===void 0).map(($,z)=>C.jsx(l0,{tool:$,theme:g},`active-${z}`)),n==="thinking"&&!t&&C.jsxs("div",{style:m.statusRow,children:[C.jsx("span",{style:m.statusDot}),"Thinking..."]}),C.jsx("div",{ref:b})]}),E&&!f&&C.jsx("div",{style:m.quickActions,children:fT.map($=>C.jsx("button",{style:m.quickActionChip,onClick:()=>L($.text),disabled:!d,children:$.label},$.text))}),C.jsxs("div",{style:m.inputArea,children:[C.jsx("textarea",{ref:k,value:y,onChange:$=>v($.target.value),onKeyDown:B,placeholder:"Type a message...",style:m.textarea,rows:1,disabled:!d}),A?C.jsx("button",{style:m.stopButton,onClick:o,children:"Stop"}):C.jsx("button",{style:{...m.sendButton,opacity:y.trim()&&d?1:.4},onClick:_,disabled:!y.trim()||!d,children:"Send"})]})]})}function gT(e){return{container:{display:"flex",flexDirection:"column",height:"100%",minWidth:0},messageList:{flex:1,overflowY:"auto",padding:"16px 20px",display:"flex",flexDirection:"column",gap:16},welcome:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flex:1,gap:12,paddingTop:80},welcomeTitle:{fontSize:28,fontWeight:700,color:e.accent},welcomeSubtitle:{fontSize:15,color:e.textSecondary},welcomeCommands:{display:"flex",gap:8,marginTop:8,flexWrap:"wrap",justifyContent:"center"},commandChip:{padding:"6px 14px",fontSize:13,color:e.accent,backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:16,cursor:"pointer",fontFamily:"inherit"},userRow:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4},assistantRow:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4},roleLabel:{fontSize:11,fontWeight:600,color:e.textSecondary,textTransform:"uppercase",letterSpacing:"0.04em"},userBubble:{maxWidth:"80%",padding:"10px 14px",backgroundColor:e.userBubble,color:"#fff",borderRadius:"16px 16px 4px 16px",fontSize:14,lineHeight:1.5,whiteSpace:"pre-wrap",wordBreak:"break-word"},assistantBubble:{maxWidth:"90%",padding:"10px 14px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:"16px 16px 16px 4px",fontSize:14,lineHeight:1.6},markdown:{color:e.textPrimary,wordBreak:"break-word"},cursor:{color:e.accent,animation:"blink 1s step-end infinite"},statusRow:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:e.textSecondary,padding:"4px 0"},statusDot:{width:8,height:8,borderRadius:"50%",backgroundColor:e.warning,animation:"pulse 1.5s ease-in-out infinite"},quickActions:{display:"flex",gap:6,padding:"8px 20px",flexWrap:"wrap"},quickActionChip:{padding:"6px 12px",fontSize:12,color:e.accent,backgroundColor:`${e.accent}11`,border:`1px solid ${e.accent}33`,borderRadius:16,cursor:"pointer",fontFamily:"inherit",transition:"background-color 0.15s ease"},inputArea:{display:"flex",alignItems:"flex-end",gap:8,padding:"12px 20px",borderTop:`1px solid ${e.border}`,backgroundColor:e.bgPrimary},textarea:{flex:1,padding:"10px 14px",fontSize:14,color:e.textPrimary,backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,resize:"none",outline:"none",fontFamily:"inherit",lineHeight:1.5,maxHeight:120,overflow:"auto"},sendButton:{padding:"10px 20px",fontSize:14,fontWeight:600,color:"#fff",backgroundColor:e.userBubble,border:"none",borderRadius:12,cursor:"pointer",flexShrink:0},stopButton:{padding:"10px 20px",fontSize:14,fontWeight:600,color:"#fff",backgroundColor:e.errorButton,border:"none",borderRadius:12,cursor:"pointer",flexShrink:0}}}function mT({data:e,getBelt:t,getNextBelt:r,BELTS:n}){var B;const{theme:s}=lr(),o=F.useMemo(()=>vT(s),[s]),c=(e==null?void 0:e.progress)||{xp:0,modules:[],streak:0},l=(e==null?void 0:e.achievements)||{unlocked:[],near:[]},h=c.xp||0,d=c.streak||0,f=F.useMemo(()=>t(h),[h,t]),g=F.useMemo(()=>r(h),[h,r]),m=c.modules||[],y=c.continueModule||null,v=m.filter(L=>L.status==="completed").length,b=c.totalCount||m.length||0,k=F.useMemo(()=>{if(!g)return 100;const L=f.minXP,A=g.minXP;return Math.min(100,Math.max(0,(h-L)/(A-L)*100))},[h,f,g]),T=((B=l.unlocked)==null?void 0:B.slice(-3).reverse())||[],_=(l.near||[]).slice(0,4);return C.jsxs("div",{style:o.container,children:[C.jsxs("div",{style:o.heroSection,children:[C.jsxs("div",{style:{...o.beltCard,background:`linear-gradient(135deg, ${f.color}15, ${f.color}08)`,border:`1px solid ${f.color}33`},children:[C.jsx("div",{style:{...o.beltIcon,borderColor:f.color,boxShadow:`0 0 20px ${f.color}25`},children:C.jsx("span",{style:o.beltEmoji,children:f.badge})}),C.jsxs("div",{style:o.beltInfo,children:[C.jsxs("h2",{style:o.beltName,children:[f.name," Belt"]}),C.jsxs("p",{style:o.xpText,children:[h.toLocaleString()," XP"]})]}),C.jsx("span",{style:{...o.beltWatermark,color:f.color},children:f.badge})]}),C.jsxs("div",{style:o.progressCard,children:[C.jsxs("div",{style:o.progressHeader,children:[C.jsx("span",{style:o.progressLabel,children:g?`Next: ${g.badge} ${g.name} Belt`:"Max Level!"}),C.jsx("span",{style:o.progressValue,children:g?`${(g.minXP-h).toLocaleString()} XP to go`:""})]}),C.jsx("div",{style:o.progressBar,children:C.jsx("div",{style:{...o.progressFill,width:`${k}%`,background:`linear-gradient(90deg, ${f.color}, ${(g==null?void 0:g.color)||f.color})`}})}),C.jsxs("div",{style:o.statsRow,children:[C.jsxs("div",{style:o.statItem,children:[C.jsx("span",{style:{color:s.success,fontWeight:700},children:v}),C.jsx("span",{style:{color:s.textSecondary,fontSize:11},children:"Completed"})]}),C.jsxs("div",{style:o.statItem,children:[C.jsx("span",{style:{color:s.accent,fontWeight:700},children:b}),C.jsx("span",{style:{color:s.textSecondary,fontSize:11},children:"Total"})]})]})]}),C.jsxs("div",{style:o.streakCard,children:[C.jsx("span",{style:o.streakIcon,children:d>0?"🔥":"❄️"}),C.jsxs("div",{children:[C.jsxs("p",{style:o.streakCount,children:[d," day streak"]}),C.jsx("p",{style:o.streakSubtext,children:d>0?"Keep it going!":"Start learning today!"})]})]})]}),y&&C.jsx("div",{style:o.section,children:C.jsxs("div",{style:o.continueCard,children:[C.jsx("span",{style:o.continueIcon,children:y.icon||"📖"}),C.jsxs("div",{style:o.continueInfo,children:[C.jsx("h4",{style:o.continueTitle,children:y.title||y.slug}),C.jsxs("p",{style:o.continueStep,children:["Step ",y.step," of ",y.totalSteps]}),C.jsx("div",{style:o.continueProgressBar,children:C.jsx("div",{style:{...o.continueProgressFill,width:`${y.step/y.totalSteps*100}%`}})})]}),C.jsx("div",{style:o.continueCta,children:"Continue →"})]})}),C.jsxs("div",{style:o.section,children:[C.jsx("div",{style:o.sectionHeader,children:C.jsx("h3",{style:o.sectionTitle,children:"Achievements"})}),T.length>0?C.jsxs("div",{style:o.achievementGrid,children:[T.map(L=>C.jsx(c0,{achievement:L,state:"unlocked",theme:s},L.id)),_.map(L=>C.jsx(c0,{achievement:L,state:"near",theme:s},L.id))]}):C.jsxs("div",{style:o.achievementEmpty,children:[C.jsx("span",{style:{fontSize:32,opacity:.4},children:"🏆"}),C.jsx("p",{style:{color:s.textSecondary,fontSize:13,margin:0},children:"Complete activities to earn achievements"})]})]}),C.jsxs("div",{style:o.section,children:[C.jsx("h3",{style:o.sectionTitle,children:"Belt Roadmap"}),C.jsx("div",{style:o.roadmap,children:n.map((L,A)=>{const E=h>=L.minXP,$=f.name===L.name;return C.jsxs("div",{style:{...o.roadmapItem,opacity:E?1:.35},children:[C.jsx("div",{style:{...o.roadmapDot,backgroundColor:E?`${L.color}22`:s.bgTertiary,border:$?`2px solid ${L.color}`:`2px solid ${E?L.color+"66":s.border}`,boxShadow:$?`0 0 12px ${L.color}40`:"none"},children:C.jsx("span",{style:{fontSize:14},children:L.badge})}),C.jsx("span",{style:{...o.roadmapLabel,color:$?s.textPrimary:s.textSecondary,fontWeight:$?600:400},children:L.name}),C.jsxs("span",{style:o.roadmapXP,children:[L.minXP," XP"]}),A<n.length-1&&C.jsx("div",{style:{...o.roadmapLine,backgroundColor:h>=n[A+1].minXP?L.color:s.border}})]},L.name)})})]}),C.jsxs("div",{style:o.section,children:[C.jsx("h3",{style:o.sectionTitle,children:"Modules"}),m.length===0?C.jsxs("div",{style:o.emptyState,children:[C.jsx("p",{style:o.emptyTitle,children:"No modules yet"}),C.jsxs("p",{style:o.emptySubtext,children:["Start a lesson with ",C.jsx("code",{style:o.code,children:"/teach"})," to begin learning"]})]}):C.jsx("div",{style:o.moduleGrid,children:m.map(L=>C.jsx(yT,{module:L,theme:s},L.slug))})]})]})}function c0({achievement:e,state:t,theme:r}){const n=t==="unlocked",s=t==="near",o=xT(e.category,r),c=n?{background:`linear-gradient(135deg, ${o}22, ${o}11)`,border:`1px solid ${o}44`}:{background:r.bgSecondary,border:`1px solid ${r.border}`};return C.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,padding:"14px 10px",borderRadius:12,textAlign:"center",position:"relative",...c},children:[C.jsx("span",{style:{fontSize:28,filter:n?"none":"grayscale(100%)",opacity:n?1:.4},children:e.icon}),C.jsx("span",{style:{fontSize:11,fontWeight:600,color:n?r.textPrimary:r.textSecondary},children:e.name}),n&&e.isNew&&C.jsx("span",{style:{position:"absolute",top:6,right:6,fontSize:9,fontWeight:700,color:r.warning,backgroundColor:`${r.warning}22`,padding:"1px 5px",borderRadius:4},children:"NEW"}),s&&e.current!==void 0&&C.jsxs("div",{style:{width:"80%"},children:[C.jsx("div",{style:{height:3,backgroundColor:r.bgTertiary,borderRadius:2,overflow:"hidden"},children:C.jsx("div",{style:{height:"100%",width:`${Math.min(100,e.current/e.target*100)}%`,backgroundColor:o,borderRadius:2}})}),C.jsxs("span",{style:{fontSize:9,color:r.textMuted},children:[e.current,"/",e.target]})]}),e.rare&&C.jsx("span",{style:{position:"absolute",top:6,left:6,fontSize:8,fontWeight:700,color:r.purple,backgroundColor:`${r.purple}22`,padding:"1px 4px",borderRadius:3},children:"RARE"})]})}function yT({module:e,theme:t}){const{slug:r,title:n,status:s,xp_earned:o,quiz_score:c,walkthrough_step:l}=e,h=s==="completed",d=s==="in-progress",f=s==="locked",g=h?t.success:d?t.accent:t.border;return C.jsxs("div",{style:{padding:"16px 20px",backgroundColor:t.bgSecondary,border:`2px solid ${g}`,borderRadius:10,display:"flex",flexDirection:"column",gap:10,opacity:f?.5:1},children:[C.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[C.jsx("span",{style:{fontSize:16},children:h?"✅":d?"🟦":"🔒"}),C.jsx("h4",{style:{fontSize:14,fontWeight:600,color:t.textPrimary,margin:0},children:n||r})]}),C.jsxs("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[o>0&&C.jsxs("span",{style:{fontSize:12,color:t.accent,backgroundColor:`${t.accent}18`,padding:"2px 8px",borderRadius:4},children:[o," XP"]}),c&&C.jsxs("span",{style:{fontSize:12,color:t.success,backgroundColor:`${t.success}18`,padding:"2px 8px",borderRadius:4},children:["Quiz: ",c]}),d&&l&&C.jsxs("span",{style:{fontSize:12,color:t.warning,backgroundColor:`${t.warning}18`,padding:"2px 8px",borderRadius:4},children:["Step ",l]})]}),f&&C.jsx("p",{style:{fontSize:12,color:t.textMuted,fontStyle:"italic",margin:0},children:"Complete prerequisites to unlock"})]})}function xT(e,t){switch(e){case"learning":return t.success;case"quizzes-games":return t.accent;case"streaks":return t.orange;case"belts":return t.purple;default:return t.accent}}function vT(e){return{container:{maxWidth:900,margin:"0 auto",display:"flex",flexDirection:"column",gap:28},heroSection:{display:"flex",gap:16,flexWrap:"wrap"},beltCard:{display:"flex",alignItems:"center",gap:16,padding:"20px 24px",borderRadius:12,flex:"1 1 200px",position:"relative",overflow:"hidden"},beltIcon:{width:56,height:56,borderRadius:"50%",border:"3px solid",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.bgTertiary,flexShrink:0},beltEmoji:{fontSize:28},beltInfo:{display:"flex",flexDirection:"column",gap:4,zIndex:1},beltWatermark:{position:"absolute",right:12,bottom:-8,fontSize:64,opacity:.08,pointerEvents:"none"},beltName:{fontSize:20,fontWeight:700,color:e.textPrimary,margin:0},xpText:{fontSize:14,color:e.textSecondary,margin:0},progressCard:{flex:"2 1 300px",padding:"20px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,display:"flex",flexDirection:"column",justifyContent:"center",gap:10},progressHeader:{display:"flex",justifyContent:"space-between",alignItems:"center"},progressLabel:{fontSize:14,color:e.textPrimary,fontWeight:500},progressValue:{fontSize:13,color:e.textSecondary},progressBar:{height:10,backgroundColor:e.bgTertiary,borderRadius:5,overflow:"hidden"},progressFill:{height:"100%",borderRadius:5,transition:"width 0.6s cubic-bezier(0.22, 1, 0.36, 1)"},statsRow:{display:"flex",gap:20,marginTop:2},statItem:{display:"flex",gap:4,alignItems:"center",fontSize:13},streakCard:{display:"flex",alignItems:"center",gap:12,padding:"20px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,flex:"0 1 180px"},streakIcon:{fontSize:28},streakCount:{fontSize:16,fontWeight:700,color:e.textPrimary,margin:0},streakSubtext:{fontSize:12,color:e.textSecondary,margin:0},section:{display:"flex",flexDirection:"column",gap:12},sectionHeader:{display:"flex",justifyContent:"space-between",alignItems:"center"},sectionTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:0},continueCard:{display:"flex",alignItems:"center",gap:16,padding:"16px 20px",backgroundColor:e.bgSecondary,border:`1px solid ${e.accent}44`,borderRadius:12},continueIcon:{fontSize:32,flexShrink:0},continueInfo:{flex:1,display:"flex",flexDirection:"column",gap:4},continueTitle:{fontSize:15,fontWeight:600,color:e.textPrimary,margin:0},continueStep:{fontSize:12,color:e.textSecondary,margin:0},continueProgressBar:{height:4,backgroundColor:e.bgTertiary,borderRadius:2,overflow:"hidden",marginTop:4},continueProgressFill:{height:"100%",backgroundColor:e.accent,borderRadius:2,transition:"width 0.3s ease"},continueCta:{fontSize:14,fontWeight:600,color:e.accent,flexShrink:0},achievementGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(110px, 1fr))",gap:10},achievementEmpty:{display:"flex",flexDirection:"column",alignItems:"center",gap:8,padding:"32px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12},roadmap:{display:"flex",gap:0,padding:"16px 0",overflowX:"auto"},roadmapItem:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,position:"relative",flex:"1 1 0",minWidth:70},roadmapDot:{width:36,height:36,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1},roadmapLabel:{fontSize:12},roadmapXP:{fontSize:10,color:e.textMuted},roadmapLine:{position:"absolute",top:18,left:"55%",right:"-45%",height:2,zIndex:0},moduleGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:12},emptyState:{textAlign:"center",padding:"48px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12},emptyTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:"0 0 8px"},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0},code:{backgroundColor:e.bgTertiary,padding:"2px 6px",borderRadius:4,fontSize:13,fontFamily:"monospace",color:e.accent}}}const bT="modulepreload",ST=function(e){return"/"+e},u0={},Zt=function(t,r,n){let s=Promise.resolve();if(r&&r.length>0){let c=function(d){return Promise.all(d.map(f=>Promise.resolve(f).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),h=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=c(r.map(d=>{if(d=ST(d),d in u0)return;u0[d]=!0;const f=d.endsWith(".css"),g=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${g}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":bT,f||(m.as="script"),m.crossOrigin="",m.href=d,h&&m.setAttribute("nonce",h),document.head.appendChild(m),f)return new Promise((y,v)=>{m.addEventListener("load",y),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(c){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=c,window.dispatchEvent(l),!l.defaultPrevented)throw c}return s.then(c=>{for(const l of c||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};var h0={name:"mermaid",version:"11.12.3",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",type:"module",module:"./dist/mermaid.core.mjs",types:"./dist/mermaid.d.ts",exports:{".":{types:"./dist/mermaid.d.ts",import:"./dist/mermaid.core.mjs",default:"./dist/mermaid.core.mjs"},"./*":"./*"},keywords:["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph","mindmap","packet diagram","c4 diagram","er diagram","pie chart","pie diagram","quadrant chart","requirement diagram","graph"],scripts:{clean:"rimraf dist",dev:"pnpm -w dev","docs:code":"typedoc src/defaultConfig.ts src/config.ts src/mermaid.ts && prettier --write ./src/docs/config/setup","docs:build":"rimraf ../../docs && pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts","docs:verify":"pnpm docs:code && pnpm docs:spellcheck && tsx scripts/docs.cli.mts --verify","docs:pre:vitepress":"pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && tsx scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts","docs:build:vitepress":"pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing","docs:dev":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:dev:docker":'pnpm docs:pre:vitepress && concurrently "pnpm --filter ./src/vitepress dev:docker" "tsx scripts/docs.cli.mts --watch --vitepress"',"docs:serve":"pnpm docs:build:vitepress && vitepress serve src/vitepress","docs:spellcheck":'cspell "src/docs/**/*.md"',"docs:release-version":"tsx scripts/update-release-version.mts","docs:verify-version":"tsx scripts/update-release-version.mts --verify","types:build-config":"tsx scripts/create-types-from-json-schema.mts","types:verify-config":"tsx scripts/create-types-from-json-schema.mts --verify",checkCircle:"npx madge --circular ./src",prepublishOnly:"pnpm docs:verify-version"},repository:{type:"git",url:"https://github.com/mermaid-js/mermaid"},author:"Knut Sveidqvist",license:"MIT",standard:{ignore:["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],globals:["page"]},dependencies:{"@braintree/sanitize-url":"^7.1.1","@iconify/utils":"^3.0.1","@mermaid-js/parser":"workspace:^","@types/d3":"^7.4.3",cytoscape:"^3.29.3","cytoscape-cose-bilkent":"^4.1.0","cytoscape-fcose":"^2.2.0",d3:"^7.9.0","d3-sankey":"^0.12.3","dagre-d3-es":"7.0.13",dayjs:"^1.11.18",dompurify:"^3.2.5",katex:"^0.16.22",khroma:"^2.1.0","lodash-es":"^4.17.23",marked:"^16.2.1",roughjs:"^4.6.6",stylis:"^4.3.6","ts-dedent":"^2.2.0",uuid:"^11.1.0"},devDependencies:{"@adobe/jsonschema2md":"^8.0.5","@iconify/types":"^2.0.0","@types/cytoscape":"^3.21.9","@types/cytoscape-fcose":"^2.2.4","@types/d3-sankey":"^0.12.4","@types/d3-scale":"^4.0.9","@types/d3-scale-chromatic":"^3.1.0","@types/d3-selection":"^3.0.11","@types/d3-shape":"^3.1.7","@types/jsdom":"^21.1.7","@types/katex":"^0.16.7","@types/lodash-es":"^4.17.12","@types/micromatch":"^4.0.9","@types/stylis":"^4.2.7","@types/uuid":"^10.0.0",ajv:"^8.17.1",canvas:"^3.1.2",chokidar:"3.6.0",concurrently:"^9.1.2","csstree-validator":"^4.0.1",globby:"^14.1.0",jison:"^0.4.18","js-base64":"^3.7.8",jsdom:"^26.1.0","json-schema-to-typescript":"^15.0.4",micromatch:"^4.0.8","path-browserify":"^1.0.1",prettier:"^3.5.3",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-gfm":"^4.0.1",rimraf:"^6.0.1","start-server-and-test":"^2.0.13","type-fest":"^4.35.0",typedoc:"^0.28.12","typedoc-plugin-markdown":"^4.8.1",typescript:"~5.7.3","unist-util-flatmap":"^1.0.0","unist-util-visit":"^5.0.0",vitepress:"^1.6.4","vitepress-plugin-search":"1.0.4-alpha.22"},files:["dist/","README.md"],publishConfig:{access:"public"}},Rc={exports:{}},CT=Rc.exports,d0;function wT(){return d0||(d0=1,(function(e,t){(function(r,n){e.exports=n()})(CT,(function(){var r=1e3,n=6e4,s=36e5,o="millisecond",c="second",l="minute",h="hour",d="day",f="week",g="month",m="quarter",y="year",v="date",b="Invalid Date",k=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|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,_={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(H){var q=["th","st","nd","rd"],N=H%100;return"["+H+(q[(N-20)%10]||q[N]||q[0])+"]"}},B=function(H,q,N){var Y=String(H);return!Y||Y.length>=q?H:""+Array(q+1-Y.length).join(N)+H},L={s:B,z:function(H){var q=-H.utcOffset(),N=Math.abs(q),Y=Math.floor(N/60),P=N%60;return(q<=0?"+":"-")+B(Y,2,"0")+":"+B(P,2,"0")},m:function H(q,N){if(q.date()<N.date())return-H(N,q);var Y=12*(N.year()-q.year())+(N.month()-q.month()),P=q.clone().add(Y,g),K=N-P<0,et=q.clone().add(Y+(K?-1:1),g);return+(-(Y+(N-P)/(K?P-et:et-P))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:g,y,w:f,d,D:v,h,m:l,s:c,ms:o,Q:m}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},A="en",E={};E[A]=_;var $="$isDayjsObject",z=function(H){return H instanceof it||!(!H||!H[$])},Z=function H(q,N,Y){var P;if(!q)return A;if(typeof q=="string"){var K=q.toLowerCase();E[K]&&(P=K),N&&(E[K]=N,P=K);var et=q.split("-");if(!P&&et.length>1)return H(et[0])}else{var I=q.name;E[I]=q,P=I}return!Y&&P&&(A=P),P||!Y&&A},W=function(H,q){if(z(H))return H.clone();var N=typeof q=="object"?q:{};return N.date=H,N.args=arguments,new it(N)},G=L;G.l=Z,G.i=z,G.w=function(H,q){return W(H,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var it=(function(){function H(N){this.$L=Z(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[$]=!0}var q=H.prototype;return q.parse=function(N){this.$d=(function(Y){var P=Y.date,K=Y.utc;if(P===null)return new Date(NaN);if(G.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var et=P.match(k);if(et){var I=et[2]-1||0,tt=(et[7]||"0").substring(0,3);return K?new Date(Date.UTC(et[1],I,et[3]||1,et[4]||0,et[5]||0,et[6]||0,tt)):new Date(et[1],I,et[3]||1,et[4]||0,et[5]||0,et[6]||0,tt)}}return new Date(P)})(N),this.init()},q.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},q.$utils=function(){return G},q.isValid=function(){return this.$d.toString()!==b},q.isSame=function(N,Y){var P=W(N);return this.startOf(Y)<=P&&P<=this.endOf(Y)},q.isAfter=function(N,Y){return W(N)<this.startOf(Y)},q.isBefore=function(N,Y){return this.endOf(Y)<W(N)},q.$g=function(N,Y,P){return G.u(N)?this[Y]:this.set(P,N)},q.unix=function(){return Math.floor(this.valueOf()/1e3)},q.valueOf=function(){return this.$d.getTime()},q.startOf=function(N,Y){var P=this,K=!!G.u(Y)||Y,et=G.p(N),I=function(vt,Ft){var ie=G.w(P.$u?Date.UTC(P.$y,Ft,vt):new Date(P.$y,Ft,vt),P);return K?ie:ie.endOf(d)},tt=function(vt,Ft){return G.w(P.toDate()[vt].apply(P.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice(Ft)),P)},ct=this.$W,mt=this.$M,dt=this.$D,ht="set"+(this.$u?"UTC":"");switch(et){case y:return K?I(1,0):I(31,11);case g:return K?I(1,mt):I(0,mt+1);case f:var X=this.$locale().weekStart||0,ft=(ct<X?ct+7:ct)-X;return I(K?dt-ft:dt+(6-ft),mt);case d:case v:return tt(ht+"Hours",0);case h:return tt(ht+"Minutes",1);case l:return tt(ht+"Seconds",2);case c:return tt(ht+"Milliseconds",3);default:return this.clone()}},q.endOf=function(N){return this.startOf(N,!1)},q.$set=function(N,Y){var P,K=G.p(N),et="set"+(this.$u?"UTC":""),I=(P={},P[d]=et+"Date",P[v]=et+"Date",P[g]=et+"Month",P[y]=et+"FullYear",P[h]=et+"Hours",P[l]=et+"Minutes",P[c]=et+"Seconds",P[o]=et+"Milliseconds",P)[K],tt=K===d?this.$D+(Y-this.$W):Y;if(K===g||K===y){var ct=this.clone().set(v,1);ct.$d[I](tt),ct.init(),this.$d=ct.set(v,Math.min(this.$D,ct.daysInMonth())).$d}else I&&this.$d[I](tt);return this.init(),this},q.set=function(N,Y){return this.clone().$set(N,Y)},q.get=function(N){return this[G.p(N)]()},q.add=function(N,Y){var P,K=this;N=Number(N);var et=G.p(Y),I=function(mt){var dt=W(K);return G.w(dt.date(dt.date()+Math.round(mt*N)),K)};if(et===g)return this.set(g,this.$M+N);if(et===y)return this.set(y,this.$y+N);if(et===d)return I(1);if(et===f)return I(7);var tt=(P={},P[l]=n,P[h]=s,P[c]=r,P)[et]||1,ct=this.$d.getTime()+N*tt;return G.w(ct,this)},q.subtract=function(N,Y){return this.add(-1*N,Y)},q.format=function(N){var Y=this,P=this.$locale();if(!this.isValid())return P.invalidDate||b;var K=N||"YYYY-MM-DDTHH:mm:ssZ",et=G.z(this),I=this.$H,tt=this.$m,ct=this.$M,mt=P.weekdays,dt=P.months,ht=P.meridiem,X=function(Ft,ie,ze,ee){return Ft&&(Ft[ie]||Ft(Y,K))||ze[ie].slice(0,ee)},ft=function(Ft){return G.s(I%12||12,Ft,"0")},vt=ht||function(Ft,ie,ze){var ee=Ft<12?"AM":"PM";return ze?ee.toLowerCase():ee};return K.replace(T,(function(Ft,ie){return ie||(function(ze){switch(ze){case"YY":return String(Y.$y).slice(-2);case"YYYY":return G.s(Y.$y,4,"0");case"M":return ct+1;case"MM":return G.s(ct+1,2,"0");case"MMM":return X(P.monthsShort,ct,dt,3);case"MMMM":return X(dt,ct);case"D":return Y.$D;case"DD":return G.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return X(P.weekdaysMin,Y.$W,mt,2);case"ddd":return X(P.weekdaysShort,Y.$W,mt,3);case"dddd":return mt[Y.$W];case"H":return String(I);case"HH":return G.s(I,2,"0");case"h":return ft(1);case"hh":return ft(2);case"a":return vt(I,tt,!0);case"A":return vt(I,tt,!1);case"m":return String(tt);case"mm":return G.s(tt,2,"0");case"s":return String(Y.$s);case"ss":return G.s(Y.$s,2,"0");case"SSS":return G.s(Y.$ms,3,"0");case"Z":return et}return null})(Ft)||et.replace(":","")}))},q.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},q.diff=function(N,Y,P){var K,et=this,I=G.p(Y),tt=W(N),ct=(tt.utcOffset()-this.utcOffset())*n,mt=this-tt,dt=function(){return G.m(et,tt)};switch(I){case y:K=dt()/12;break;case g:K=dt();break;case m:K=dt()/3;break;case f:K=(mt-ct)/6048e5;break;case d:K=(mt-ct)/864e5;break;case h:K=mt/s;break;case l:K=mt/n;break;case c:K=mt/r;break;default:K=mt}return P?K:G.a(K)},q.daysInMonth=function(){return this.endOf(g).$D},q.$locale=function(){return E[this.$L]},q.locale=function(N,Y){if(!N)return this.$L;var P=this.clone(),K=Z(N,Y,!0);return K&&(P.$L=K),P},q.clone=function(){return G.w(this.$d,this)},q.toDate=function(){return new Date(this.valueOf())},q.toJSON=function(){return this.isValid()?this.toISOString():null},q.toISOString=function(){return this.$d.toISOString()},q.toString=function(){return this.$d.toUTCString()},H})(),rt=it.prototype;return W.prototype=rt,[["$ms",o],["$s",c],["$m",l],["$H",h],["$W",d],["$M",g],["$y",y],["$D",v]].forEach((function(H){rt[H[1]]=function(q){return this.$g(q,H[0],H[1])}})),W.extend=function(H,q){return H.$i||(H(q,it,W),H.$i=!0),W},W.locale=Z,W.isDayjs=z,W.unix=function(H){return W(1e3*H)},W.en=E[A],W.Ls=E,W.p={},W}))})(Rc)),Rc.exports}var kT=wT();const _T=up(kT);var Zx=Object.defineProperty,w=(e,t)=>Zx(e,"name",{value:t,configurable:!0}),TT=(e,t)=>{for(var r in t)Zx(e,r,{get:t[r],enumerable:!0})},Kn={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},nt={trace:w((...e)=>{},"trace"),debug:w((...e)=>{},"debug"),info:w((...e)=>{},"info"),warn:w((...e)=>{},"warn"),error:w((...e)=>{},"error"),fatal:w((...e)=>{},"fatal")},Sp=w(function(e="fatal"){let t=Kn.fatal;typeof e=="string"?e.toLowerCase()in Kn&&(t=Kn[e]):typeof e=="number"&&(t=e),nt.trace=()=>{},nt.debug=()=>{},nt.info=()=>{},nt.warn=()=>{},nt.error=()=>{},nt.fatal=()=>{},t<=Kn.fatal&&(nt.fatal=console.error?console.error.bind(console,Qr("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",Qr("FATAL"))),t<=Kn.error&&(nt.error=console.error?console.error.bind(console,Qr("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",Qr("ERROR"))),t<=Kn.warn&&(nt.warn=console.warn?console.warn.bind(console,Qr("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",Qr("WARN"))),t<=Kn.info&&(nt.info=console.info?console.info.bind(console,Qr("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",Qr("INFO"))),t<=Kn.debug&&(nt.debug=console.debug?console.debug.bind(console,Qr("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Qr("DEBUG"))),t<=Kn.trace&&(nt.trace=console.debug?console.debug.bind(console,Qr("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",Qr("TRACE")))},"setLogLevel"),Qr=w(e=>`%c${_T().format("ss.SSS")} : ${e} : `,"format");const Fc={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},n)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const s=r<.5?r*(1+t):r+t-r*t,o=2*r-s;switch(n){case"r":return Fc.hue2rgb(o,s,e+1/3)*255;case"g":return Fc.hue2rgb(o,s,e)*255;case"b":return Fc.hue2rgb(o,s,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},n)=>{e/=255,t/=255,r/=255;const s=Math.max(e,t,r),o=Math.min(e,t,r),c=(s+o)/2;if(n==="l")return c*100;if(s===o)return 0;const l=s-o,h=c>.5?l/(2-s-o):l/(s+o);if(n==="s")return h*100;switch(s){case e:return((t-r)/l+(t<r?6:0))*60;case t:return((r-e)/l+2)*60;case r:return((e-t)/l+4)*60;default:return-1}}},ET={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},LT={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},jt={channel:Fc,lang:ET,unit:LT},Ei={};for(let e=0;e<=255;e++)Ei[e]=jt.unit.dec2hex(e);const Ve={ALL:0,RGB:1,HSL:2};class MT{constructor(){this.type=Ve.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=Ve.ALL}is(t){return this.type===t}}class BT{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new MT}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=Ve.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:n,l:s}=t;r===void 0&&(t.h=jt.channel.rgb2hsl(t,"h")),n===void 0&&(t.s=jt.channel.rgb2hsl(t,"s")),s===void 0&&(t.l=jt.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:n,b:s}=t;r===void 0&&(t.r=jt.channel.hsl2rgb(t,"r")),n===void 0&&(t.g=jt.channel.hsl2rgb(t,"g")),s===void 0&&(t.b=jt.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(Ve.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(Ve.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(Ve.HSL)&&r!==void 0?r:(this._ensureHSL(),jt.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(Ve.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(Ve.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(Ve.RGB)&&r!==void 0?r:(this._ensureRGB(),jt.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(Ve.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(Ve.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(Ve.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(Ve.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(Ve.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(Ve.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const $u=new BT({r:0,g:0,b:0,a:0},"transparent"),ra={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(ra.re);if(!t)return;const r=t[1],n=parseInt(r,16),s=r.length,o=s%4===0,c=s>4,l=c?1:17,h=c?8:4,d=o?0:-1,f=c?255:15;return $u.set({r:(n>>h*(d+3)&f)*l,g:(n>>h*(d+2)&f)*l,b:(n>>h*(d+1)&f)*l,a:o?(n&f)*l/255:1},e)},stringify:e=>{const{r:t,g:r,b:n,a:s}=e;return s<1?`#${Ei[Math.round(t)]}${Ei[Math.round(r)]}${Ei[Math.round(n)]}${Ei[Math.round(s*255)]}`:`#${Ei[Math.round(t)]}${Ei[Math.round(r)]}${Ei[Math.round(n)]}`}},os={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(os.hueRe);if(t){const[,r,n]=t;switch(n){case"grad":return jt.channel.clamp.h(parseFloat(r)*.9);case"rad":return jt.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return jt.channel.clamp.h(parseFloat(r)*360)}}return jt.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(os.re);if(!r)return;const[,n,s,o,c,l]=r;return $u.set({h:os._hue2deg(n),s:jt.channel.clamp.s(parseFloat(s)),l:jt.channel.clamp.l(parseFloat(o)),a:c?jt.channel.clamp.a(l?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{h:t,s:r,l:n,a:s}=e;return s<1?`hsla(${jt.lang.round(t)}, ${jt.lang.round(r)}%, ${jt.lang.round(n)}%, ${s})`:`hsl(${jt.lang.round(t)}, ${jt.lang.round(r)}%, ${jt.lang.round(n)}%)`}},Fo={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=Fo.colors[e];if(t)return ra.parse(t)},stringify:e=>{const t=ra.stringify(e);for(const r in Fo.colors)if(Fo.colors[r]===t)return r}},_o={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(_o.re);if(!r)return;const[,n,s,o,c,l,h,d,f]=r;return $u.set({r:jt.channel.clamp.r(s?parseFloat(n)*2.55:parseFloat(n)),g:jt.channel.clamp.g(c?parseFloat(o)*2.55:parseFloat(o)),b:jt.channel.clamp.b(h?parseFloat(l)*2.55:parseFloat(l)),a:d?jt.channel.clamp.a(f?parseFloat(d)/100:parseFloat(d)):1},e)},stringify:e=>{const{r:t,g:r,b:n,a:s}=e;return s<1?`rgba(${jt.lang.round(t)}, ${jt.lang.round(r)}, ${jt.lang.round(n)}, ${jt.lang.round(s)})`:`rgb(${jt.lang.round(t)}, ${jt.lang.round(r)}, ${jt.lang.round(n)})`}},On={format:{keyword:Fo,hex:ra,rgb:_o,rgba:_o,hsl:os,hsla:os},parse:e=>{if(typeof e!="string")return e;const t=ra.parse(e)||_o.parse(e)||os.parse(e)||Fo.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(Ve.HSL)||e.data.r===void 0?os.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?_o.stringify(e):ra.stringify(e)},Jx=(e,t)=>{const r=On.parse(e);for(const n in t)r[n]=jt.channel.clamp[n](t[n]);return On.stringify(r)},Io=(e,t,r=0,n=1)=>{if(typeof e!="number")return Jx(e,{a:t});const s=$u.set({r:jt.channel.clamp.r(e),g:jt.channel.clamp.g(t),b:jt.channel.clamp.b(r),a:jt.channel.clamp.a(n)});return On.stringify(s)},AT=e=>{const{r:t,g:r,b:n}=On.parse(e),s=.2126*jt.channel.toLinear(t)+.7152*jt.channel.toLinear(r)+.0722*jt.channel.toLinear(n);return jt.lang.round(s)},$T=e=>AT(e)>=.5,Jo=e=>!$T(e),t1=(e,t,r)=>{const n=On.parse(e),s=n[t],o=jt.channel.clamp[t](s+r);return s!==o&&(n[t]=o),On.stringify(n)},Ct=(e,t)=>t1(e,"l",t),$t=(e,t)=>t1(e,"l",-t),U=(e,t)=>{const r=On.parse(e),n={};for(const s in t)t[s]&&(n[s]=r[s]+t[s]);return Jx(e,n)},RT=(e,t,r=50)=>{const{r:n,g:s,b:o,a:c}=On.parse(e),{r:l,g:h,b:d,a:f}=On.parse(t),g=r/100,m=g*2-1,y=c-f,b=((m*y===-1?m:(m+y)/(1+m*y))+1)/2,k=1-b,T=n*b+l*k,_=s*b+h*k,B=o*b+d*k,L=c*g+f*(1-g);return Io(T,_,B,L)},gt=(e,t=100)=>{const r=On.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,RT(r,e,t)};var e1=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,Po=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,FT=/\s*%%.*\n/gm,sa,r1=(sa=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},w(sa,"UnknownDiagramError"),sa),gs={},Cp=w(function(e,t){e=e.replace(e1,"").replace(Po,"").replace(FT,`
102
+ `);for(const[r,{detector:n}]of Object.entries(gs))if(n(e,t))return r;throw new r1(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),yf=w((...e)=>{for(const{id:t,detector:r,loader:n}of e)n1(t,r,n)},"registerLazyLoadedDiagrams"),n1=w((e,t,r)=>{gs[e]&&nt.warn(`Detector with key ${e} already exists. Overwriting.`),gs[e]={detector:t,loader:r},nt.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),IT=w(e=>gs[e].loader,"getDiagramLoader"),xf=w((e,t,{depth:r=2,clobber:n=!1}={})=>{const s={depth:r,clobber:n};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(o=>xf(e,o,s)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(o=>{e.includes(o)||e.push(o)}),e):e===void 0||r<=0?e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t:(t!==void 0&&typeof e=="object"&&typeof t=="object"&&Object.keys(t).forEach(o=>{typeof t[o]=="object"&&(e[o]===void 0||typeof e[o]=="object")?(e[o]===void 0&&(e[o]=Array.isArray(t[o])?[]:{}),e[o]=xf(e[o],t[o],{depth:r-1,clobber:n})):(n||typeof e[o]!="object"&&typeof t[o]!="object")&&(e[o]=t[o])}),e)},"assignWithDepth"),Te=xf,Ru="#ffffff",Fu="#f2f2f2",ir=w((e,t)=>t?U(e,{s:-40,l:10}):U(e,{s:-40,l:-10}),"mkBorder"),aa,PT=(aa=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px"}updateColors(){var r,n,s,o,c,l,h,d,f,g,m,y,v,b,k,T,_,B,L,A,E;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||U(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||U(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ir(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ir(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ir(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ir(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||gt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||gt(this.tertiaryColor),this.lineColor=this.lineColor||gt(this.background),this.arrowheadColor=this.arrowheadColor||gt(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?$t(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||$t(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||gt(this.lineColor),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||Ct(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.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||$t(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||$t(this.mainBkg,10)):(this.rowOdd=this.rowOdd||Ct(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Ct(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||U(this.primaryColor,{h:30}),this.cScale4=this.cScale4||U(this.primaryColor,{h:60}),this.cScale5=this.cScale5||U(this.primaryColor,{h:90}),this.cScale6=this.cScale6||U(this.primaryColor,{h:120}),this.cScale7=this.cScale7||U(this.primaryColor,{h:150}),this.cScale8=this.cScale8||U(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||U(this.primaryColor,{h:270}),this.cScale10=this.cScale10||U(this.primaryColor,{h:300}),this.cScale11=this.cScale11||U(this.primaryColor,{h:330}),this.darkMode)for(let $=0;$<this.THEME_COLOR_LIMIT;$++)this["cScale"+$]=$t(this["cScale"+$],75);else for(let $=0;$<this.THEME_COLOR_LIMIT;$++)this["cScale"+$]=$t(this["cScale"+$],25);for(let $=0;$<this.THEME_COLOR_LIMIT;$++)this["cScaleInv"+$]=this["cScaleInv"+$]||gt(this["cScale"+$]);for(let $=0;$<this.THEME_COLOR_LIMIT;$++)this.darkMode?this["cScalePeer"+$]=this["cScalePeer"+$]||Ct(this["cScale"+$],10):this["cScalePeer"+$]=this["cScalePeer"+$]||$t(this["cScale"+$],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let $=0;$<this.THEME_COLOR_LIMIT;$++)this["cScaleLabel"+$]=this["cScaleLabel"+$]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let $=0;$<5;$++)this["surface"+$]=this["surface"+$]||U(this.mainBkg,{h:180,s:-15,l:t*(5+$*3)}),this["surfacePeer"+$]=this["surfacePeer"+$]||U(this.mainBkg,{h:180,s:-15,l:t*(8+$*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||U(this.primaryColor,{h:64}),this.fillType3=this.fillType3||U(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||U(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||U(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||U(this.primaryColor,{h:128}),this.fillType7=this.fillType7||U(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||U(this.primaryColor,{l:-10}),this.pie5=this.pie5||U(this.secondaryColor,{l:-10}),this.pie6=this.pie6||U(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||U(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||U(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||U(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||U(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||U(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||U(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.radar={axisColor:((r=this.radar)==null?void 0:r.axisColor)||this.lineColor,axisStrokeWidth:((n=this.radar)==null?void 0:n.axisStrokeWidth)||2,axisLabelFontSize:((s=this.radar)==null?void 0:s.axisLabelFontSize)||12,curveOpacity:((o=this.radar)==null?void 0:o.curveOpacity)||.5,curveStrokeWidth:((c=this.radar)==null?void 0:c.curveStrokeWidth)||2,graticuleColor:((l=this.radar)==null?void 0:l.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((h=this.radar)==null?void 0:h.graticuleStrokeWidth)||1,graticuleOpacity:((d=this.radar)==null?void 0:d.graticuleOpacity)||.3,legendBoxSize:((f=this.radar)==null?void 0:f.legendBoxSize)||12,legendFontSize:((g=this.radar)==null?void 0:g.legendFontSize)||12},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||U(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||U(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||U(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||U(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||U(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||U(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Jo(this.quadrant1Fill)?Ct(this.quadrant1Fill):$t(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:((m=this.xyChart)==null?void 0:m.backgroundColor)||this.background,titleColor:((y=this.xyChart)==null?void 0:y.titleColor)||this.primaryTextColor,xAxisTitleColor:((v=this.xyChart)==null?void 0:v.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((b=this.xyChart)==null?void 0:b.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((k=this.xyChart)==null?void 0:k.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((T=this.xyChart)==null?void 0:T.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((_=this.xyChart)==null?void 0:_.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((B=this.xyChart)==null?void 0:B.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((L=this.xyChart)==null?void 0:L.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((A=this.xyChart)==null?void 0:A.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((E=this.xyChart)==null?void 0:E.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?$t(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||U(this.primaryColor,{h:-30}),this.git4=this.git4||U(this.primaryColor,{h:-60}),this.git5=this.git5||U(this.primaryColor,{h:-90}),this.git6=this.git6||U(this.primaryColor,{h:60}),this.git7=this.git7||U(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ct(this.git0,25),this.git1=Ct(this.git1,25),this.git2=Ct(this.git2,25),this.git3=Ct(this.git3,25),this.git4=Ct(this.git4,25),this.git5=Ct(this.git5,25),this.git6=Ct(this.git6,25),this.git7=Ct(this.git7,25)):(this.git0=$t(this.git0,25),this.git1=$t(this.git1,25),this.git2=$t(this.git2,25),this.git3=$t(this.git3,25),this.git4=$t(this.git4,25),this.git5=$t(this.git5,25),this.git6=$t(this.git6,25),this.git7=$t(this.git7,25)),this.gitInv0=this.gitInv0||gt(this.git0),this.gitInv1=this.gitInv1||gt(this.git1),this.gitInv2=this.gitInv2||gt(this.git2),this.gitInv3=this.gitInv3||gt(this.git3),this.gitInv4=this.gitInv4||gt(this.git4),this.gitInv5=this.gitInv5||gt(this.git5),this.gitInv6=this.gitInv6||gt(this.git6),this.gitInv7=this.gitInv7||gt(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||Ru,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Fu}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},w(aa,"Theme"),aa),DT=w(e=>{const t=new PT;return t.calculate(e),t},"getThemeVariables"),oa,OT=(oa=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=Ct(this.primaryColor,16),this.tertiaryColor=U(this.primaryColor,{h:-160}),this.primaryBorderColor=gt(this.background),this.secondaryBorderColor=ir(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ir(this.tertiaryColor,this.darkMode),this.primaryTextColor=gt(this.primaryColor),this.secondaryTextColor=gt(this.secondaryColor),this.tertiaryTextColor=gt(this.tertiaryColor),this.lineColor=gt(this.background),this.textColor=gt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=Ct(gt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Io(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.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.sectionBkgColor=$t("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=$t(this.sectionBkgColor,10),this.taskBorderColor=Io(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Io(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||Ct(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||$t(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd"}updateColors(){var t,r,n,s,o,c,l,h,d,f,g,m,y,v,b,k,T,_,B,L,A;this.secondBkg=Ct(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=Ct(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=Ct(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=this.darkTextColor,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=U(this.primaryColor,{h:64}),this.fillType3=U(this.secondaryColor,{h:64}),this.fillType4=U(this.primaryColor,{h:-64}),this.fillType5=U(this.secondaryColor,{h:-64}),this.fillType6=U(this.primaryColor,{h:128}),this.fillType7=U(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||U(this.primaryColor,{h:30}),this.cScale4=this.cScale4||U(this.primaryColor,{h:60}),this.cScale5=this.cScale5||U(this.primaryColor,{h:90}),this.cScale6=this.cScale6||U(this.primaryColor,{h:120}),this.cScale7=this.cScale7||U(this.primaryColor,{h:150}),this.cScale8=this.cScale8||U(this.primaryColor,{h:210}),this.cScale9=this.cScale9||U(this.primaryColor,{h:270}),this.cScale10=this.cScale10||U(this.primaryColor,{h:300}),this.cScale11=this.cScale11||U(this.primaryColor,{h:330});for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleInv"+E]=this["cScaleInv"+E]||gt(this["cScale"+E]);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScalePeer"+E]=this["cScalePeer"+E]||Ct(this["cScale"+E],10);for(let E=0;E<5;E++)this["surface"+E]=this["surface"+E]||U(this.mainBkg,{h:30,s:-30,l:-(-10+E*4)}),this["surfacePeer"+E]=this["surfacePeer"+E]||U(this.mainBkg,{h:30,s:-30,l:-(-7+E*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleLabel"+E]=this["cScaleLabel"+E]||this.scaleLabelColor;for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["pie"+E]=this["cScale"+E];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.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||U(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||U(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||U(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||U(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||U(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||U(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Jo(this.quadrant1Fill)?Ct(this.quadrant1Fill):$t(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:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((n=this.xyChart)==null?void 0:n.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((s=this.xyChart)==null?void 0:s.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((o=this.xyChart)==null?void 0:o.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((c=this.xyChart)==null?void 0:c.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((l=this.xyChart)==null?void 0:l.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((h=this.xyChart)==null?void 0:h.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((f=this.xyChart)==null?void 0:f.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((g=this.xyChart)==null?void 0:g.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:((m=this.radar)==null?void 0:m.axisColor)||this.lineColor,axisStrokeWidth:((y=this.radar)==null?void 0:y.axisStrokeWidth)||2,axisLabelFontSize:((v=this.radar)==null?void 0:v.axisLabelFontSize)||12,curveOpacity:((b=this.radar)==null?void 0:b.curveOpacity)||.5,curveStrokeWidth:((k=this.radar)==null?void 0:k.curveStrokeWidth)||2,graticuleColor:((T=this.radar)==null?void 0:T.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((_=this.radar)==null?void 0:_.graticuleStrokeWidth)||1,graticuleOpacity:((B=this.radar)==null?void 0:B.graticuleOpacity)||.3,legendBoxSize:((L=this.radar)==null?void 0:L.legendBoxSize)||12,legendFontSize:((A=this.radar)==null?void 0:A.legendFontSize)||12},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?$t(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=Ct(this.secondaryColor,20),this.git1=Ct(this.pie2||this.secondaryColor,20),this.git2=Ct(this.pie3||this.tertiaryColor,20),this.git3=Ct(this.pie4||U(this.primaryColor,{h:-30}),20),this.git4=Ct(this.pie5||U(this.primaryColor,{h:-60}),20),this.git5=Ct(this.pie6||U(this.primaryColor,{h:-90}),10),this.git6=Ct(this.pie7||U(this.primaryColor,{h:60}),10),this.git7=Ct(this.pie8||U(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||gt(this.git0),this.gitInv1=this.gitInv1||gt(this.git1),this.gitInv2=this.gitInv2||gt(this.git2),this.gitInv3=this.gitInv3||gt(this.git3),this.gitInv4=this.gitInv4||gt(this.git4),this.gitInv5=this.gitInv5||gt(this.git5),this.gitInv6=this.gitInv6||gt(this.git6),this.gitInv7=this.gitInv7||gt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||gt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||gt(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.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ct(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Ct(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},w(oa,"Theme"),oa),zT=w(e=>{const t=new OT;return t.calculate(e),t},"getThemeVariables"),la,jT=(la=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=U(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=U(this.primaryColor,{h:-160}),this.primaryBorderColor=ir(this.primaryColor,this.darkMode),this.secondaryBorderColor=ir(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ir(this.tertiaryColor,this.darkMode),this.primaryTextColor=gt(this.primaryColor),this.secondaryTextColor=gt(this.secondaryColor),this.tertiaryTextColor=gt(this.tertiaryColor),this.lineColor=gt(this.background),this.textColor=gt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",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.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.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=Io(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.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.updateColors()}updateColors(){var t,r,n,s,o,c,l,h,d,f,g,m,y,v,b,k,T,_,B,L,A;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||U(this.primaryColor,{h:30}),this.cScale4=this.cScale4||U(this.primaryColor,{h:60}),this.cScale5=this.cScale5||U(this.primaryColor,{h:90}),this.cScale6=this.cScale6||U(this.primaryColor,{h:120}),this.cScale7=this.cScale7||U(this.primaryColor,{h:150}),this.cScale8=this.cScale8||U(this.primaryColor,{h:210}),this.cScale9=this.cScale9||U(this.primaryColor,{h:270}),this.cScale10=this.cScale10||U(this.primaryColor,{h:300}),this.cScale11=this.cScale11||U(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||$t(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||$t(this.tertiaryColor,40);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScale"+E]=$t(this["cScale"+E],10),this["cScalePeer"+E]=this["cScalePeer"+E]||$t(this["cScale"+E],25);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleInv"+E]=this["cScaleInv"+E]||U(this["cScale"+E],{h:180});for(let E=0;E<5;E++)this["surface"+E]=this["surface"+E]||U(this.mainBkg,{h:30,l:-(5+E*5)}),this["surfacePeer"+E]=this["surfacePeer"+E]||U(this.mainBkg,{h:30,l:-(7+E*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||gt(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||gt(this.labelTextColor);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleLabel"+E]=this["cScaleLabel"+E]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=Ct(this.border1,23),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.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Ct(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||Ct(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=U(this.primaryColor,{h:64}),this.fillType3=U(this.secondaryColor,{h:64}),this.fillType4=U(this.primaryColor,{h:-64}),this.fillType5=U(this.secondaryColor,{h:-64}),this.fillType6=U(this.primaryColor,{h:128}),this.fillType7=U(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||U(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||U(this.primaryColor,{l:-10}),this.pie5=this.pie5||U(this.secondaryColor,{l:-30}),this.pie6=this.pie6||U(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||U(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||U(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||U(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||U(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||U(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||U(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.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||U(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||U(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||U(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||U(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||U(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||U(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Jo(this.quadrant1Fill)?Ct(this.quadrant1Fill):$t(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:((t=this.radar)==null?void 0:t.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((n=this.radar)==null?void 0:n.axisLabelFontSize)||12,curveOpacity:((s=this.radar)==null?void 0:s.curveOpacity)||.5,curveStrokeWidth:((o=this.radar)==null?void 0:o.curveStrokeWidth)||2,graticuleColor:((c=this.radar)==null?void 0:c.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((l=this.radar)==null?void 0:l.graticuleStrokeWidth)||1,graticuleOpacity:((h=this.radar)==null?void 0:h.graticuleOpacity)||.3,legendBoxSize:((d=this.radar)==null?void 0:d.legendBoxSize)||12,legendFontSize:((f=this.radar)==null?void 0:f.legendFontSize)||12},this.xyChart={backgroundColor:((g=this.xyChart)==null?void 0:g.backgroundColor)||this.background,titleColor:((m=this.xyChart)==null?void 0:m.titleColor)||this.primaryTextColor,xAxisTitleColor:((y=this.xyChart)==null?void 0:y.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((v=this.xyChart)==null?void 0:v.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((b=this.xyChart)==null?void 0:b.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((k=this.xyChart)==null?void 0:k.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((T=this.xyChart)==null?void 0:T.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((_=this.xyChart)==null?void 0:_.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((B=this.xyChart)==null?void 0:B.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((L=this.xyChart)==null?void 0:L.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((A=this.xyChart)==null?void 0:A.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||U(this.primaryColor,{h:-30}),this.git4=this.git4||U(this.primaryColor,{h:-60}),this.git5=this.git5||U(this.primaryColor,{h:-90}),this.git6=this.git6||U(this.primaryColor,{h:60}),this.git7=this.git7||U(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ct(this.git0,25),this.git1=Ct(this.git1,25),this.git2=Ct(this.git2,25),this.git3=Ct(this.git3,25),this.git4=Ct(this.git4,25),this.git5=Ct(this.git5,25),this.git6=Ct(this.git6,25),this.git7=Ct(this.git7,25)):(this.git0=$t(this.git0,25),this.git1=$t(this.git1,25),this.git2=$t(this.git2,25),this.git3=$t(this.git3,25),this.git4=$t(this.git4,25),this.git5=$t(this.git5,25),this.git6=$t(this.git6,25),this.git7=$t(this.git7,25)),this.gitInv0=this.gitInv0||$t(gt(this.git0),25),this.gitInv1=this.gitInv1||gt(this.git1),this.gitInv2=this.gitInv2||gt(this.git2),this.gitInv3=this.gitInv3||gt(this.git3),this.gitInv4=this.gitInv4||gt(this.git4),this.gitInv5=this.gitInv5||gt(this.git5),this.gitInv6=this.gitInv6||gt(this.git6),this.gitInv7=this.gitInv7||gt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||gt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||gt(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.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ru,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Fu}calculate(t){if(Object.keys(this).forEach(n=>{this[n]==="calculated"&&(this[n]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},w(la,"Theme"),la),NT=w(e=>{const t=new jT;return t.calculate(e),t},"getThemeVariables"),ca,WT=(ca=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=Ct("#cde498",10),this.primaryBorderColor=ir(this.primaryColor,this.darkMode),this.secondaryBorderColor=ir(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ir(this.tertiaryColor,this.darkMode),this.primaryTextColor=gt(this.primaryColor),this.secondaryTextColor=gt(this.secondaryColor),this.tertiaryTextColor=gt(this.primaryColor),this.lineColor=gt(this.background),this.textColor=gt(this.background),this.THEME_COLOR_LIMIT=12,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.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,n,s,o,c,l,h,d,f,g,m,y,v,b,k,T,_,B,L,A;this.actorBorder=$t(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.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||U(this.primaryColor,{h:30}),this.cScale4=this.cScale4||U(this.primaryColor,{h:60}),this.cScale5=this.cScale5||U(this.primaryColor,{h:90}),this.cScale6=this.cScale6||U(this.primaryColor,{h:120}),this.cScale7=this.cScale7||U(this.primaryColor,{h:150}),this.cScale8=this.cScale8||U(this.primaryColor,{h:210}),this.cScale9=this.cScale9||U(this.primaryColor,{h:270}),this.cScale10=this.cScale10||U(this.primaryColor,{h:300}),this.cScale11=this.cScale11||U(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||$t(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||$t(this.tertiaryColor,40);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScale"+E]=$t(this["cScale"+E],10),this["cScalePeer"+E]=this["cScalePeer"+E]||$t(this["cScale"+E],25);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleInv"+E]=this["cScaleInv"+E]||U(this["cScale"+E],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleLabel"+E]=this["cScaleLabel"+E]||this.scaleLabelColor;for(let E=0;E<5;E++)this["surface"+E]=this["surface"+E]||U(this.mainBkg,{h:30,s:-30,l:-(5+E*5)}),this["surfacePeer"+E]=this["surfacePeer"+E]||U(this.mainBkg,{h:30,s:-30,l:-(8+E*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||Ct(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||Ct(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=U(this.primaryColor,{h:64}),this.fillType3=U(this.secondaryColor,{h:64}),this.fillType4=U(this.primaryColor,{h:-64}),this.fillType5=U(this.secondaryColor,{h:-64}),this.fillType6=U(this.primaryColor,{h:128}),this.fillType7=U(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||U(this.primaryColor,{l:-30}),this.pie5=this.pie5||U(this.secondaryColor,{l:-30}),this.pie6=this.pie6||U(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||U(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||U(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||U(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||U(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||U(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||U(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.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||U(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||U(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||U(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||U(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||U(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||U(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Jo(this.quadrant1Fill)?Ct(this.quadrant1Fill):$t(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:((t=this.radar)==null?void 0:t.axisColor)||this.lineColor,axisStrokeWidth:((r=this.radar)==null?void 0:r.axisStrokeWidth)||2,axisLabelFontSize:((n=this.radar)==null?void 0:n.axisLabelFontSize)||12,curveOpacity:((s=this.radar)==null?void 0:s.curveOpacity)||.5,curveStrokeWidth:((o=this.radar)==null?void 0:o.curveStrokeWidth)||2,graticuleColor:((c=this.radar)==null?void 0:c.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((l=this.radar)==null?void 0:l.graticuleStrokeWidth)||1,graticuleOpacity:((h=this.radar)==null?void 0:h.graticuleOpacity)||.3,legendBoxSize:((d=this.radar)==null?void 0:d.legendBoxSize)||12,legendFontSize:((f=this.radar)==null?void 0:f.legendFontSize)||12},this.xyChart={backgroundColor:((g=this.xyChart)==null?void 0:g.backgroundColor)||this.background,titleColor:((m=this.xyChart)==null?void 0:m.titleColor)||this.primaryTextColor,xAxisTitleColor:((y=this.xyChart)==null?void 0:y.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((v=this.xyChart)==null?void 0:v.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((b=this.xyChart)==null?void 0:b.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((k=this.xyChart)==null?void 0:k.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((T=this.xyChart)==null?void 0:T.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((_=this.xyChart)==null?void 0:_.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((B=this.xyChart)==null?void 0:B.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((L=this.xyChart)==null?void 0:L.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((A=this.xyChart)==null?void 0:A.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||U(this.primaryColor,{h:-30}),this.git4=this.git4||U(this.primaryColor,{h:-60}),this.git5=this.git5||U(this.primaryColor,{h:-90}),this.git6=this.git6||U(this.primaryColor,{h:60}),this.git7=this.git7||U(this.primaryColor,{h:120}),this.darkMode?(this.git0=Ct(this.git0,25),this.git1=Ct(this.git1,25),this.git2=Ct(this.git2,25),this.git3=Ct(this.git3,25),this.git4=Ct(this.git4,25),this.git5=Ct(this.git5,25),this.git6=Ct(this.git6,25),this.git7=Ct(this.git7,25)):(this.git0=$t(this.git0,25),this.git1=$t(this.git1,25),this.git2=$t(this.git2,25),this.git3=$t(this.git3,25),this.git4=$t(this.git4,25),this.git5=$t(this.git5,25),this.git6=$t(this.git6,25),this.git7=$t(this.git7,25)),this.gitInv0=this.gitInv0||gt(this.git0),this.gitInv1=this.gitInv1||gt(this.git1),this.gitInv2=this.gitInv2||gt(this.git2),this.gitInv3=this.gitInv3||gt(this.git3),this.gitInv4=this.gitInv4||gt(this.git4),this.gitInv5=this.gitInv5||gt(this.git5),this.gitInv6=this.gitInv6||gt(this.git6),this.gitInv7=this.gitInv7||gt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||gt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||gt(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.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ru,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Fu}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},w(ca,"Theme"),ca),HT=w(e=>{const t=new WT;return t.calculate(e),t},"getThemeVariables"),ua,qT=(ua=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=Ct(this.contrast,55),this.background="#ffffff",this.tertiaryColor=U(this.primaryColor,{h:-160}),this.primaryBorderColor=ir(this.primaryColor,this.darkMode),this.secondaryBorderColor=ir(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ir(this.tertiaryColor,this.darkMode),this.primaryTextColor=gt(this.primaryColor),this.secondaryTextColor=gt(this.secondaryColor),this.tertiaryTextColor=gt(this.tertiaryColor),this.lineColor=gt(this.background),this.textColor=gt(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.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.rowOdd=this.rowOdd||Ct(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222"}updateColors(){var t,r,n,s,o,c,l,h,d,f,g,m,y,v,b,k,T,_,B,L,A;this.secondBkg=Ct(this.contrast,55),this.border2=this.contrast,this.actorBorder=Ct(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,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 E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleInv"+E]=this["cScaleInv"+E]||gt(this["cScale"+E]);for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this.darkMode?this["cScalePeer"+E]=this["cScalePeer"+E]||Ct(this["cScale"+E],10):this["cScalePeer"+E]=this["cScalePeer"+E]||$t(this["cScale"+E],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["cScaleLabel"+E]=this["cScaleLabel"+E]||this.scaleLabelColor;for(let E=0;E<5;E++)this["surface"+E]=this["surface"+E]||U(this.mainBkg,{l:-(5+E*5)}),this["surfacePeer"+E]=this["surfacePeer"+E]||U(this.mainBkg,{l:-(8+E*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=Ct(this.contrast,30),this.sectionBkgColor2=Ct(this.contrast,30),this.taskBorderColor=$t(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=Ct(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=$t(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=U(this.primaryColor,{h:64}),this.fillType3=U(this.secondaryColor,{h:64}),this.fillType4=U(this.primaryColor,{h:-64}),this.fillType5=U(this.secondaryColor,{h:-64}),this.fillType6=U(this.primaryColor,{h:128}),this.fillType7=U(this.secondaryColor,{h:128});for(let E=0;E<this.THEME_COLOR_LIMIT;E++)this["pie"+E]=this["cScale"+E];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",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||U(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||U(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||U(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||U(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||U(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||U(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Jo(this.quadrant1Fill)?Ct(this.quadrant1Fill):$t(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:((t=this.xyChart)==null?void 0:t.backgroundColor)||this.background,titleColor:((r=this.xyChart)==null?void 0:r.titleColor)||this.primaryTextColor,xAxisTitleColor:((n=this.xyChart)==null?void 0:n.xAxisTitleColor)||this.primaryTextColor,xAxisLabelColor:((s=this.xyChart)==null?void 0:s.xAxisLabelColor)||this.primaryTextColor,xAxisTickColor:((o=this.xyChart)==null?void 0:o.xAxisTickColor)||this.primaryTextColor,xAxisLineColor:((c=this.xyChart)==null?void 0:c.xAxisLineColor)||this.primaryTextColor,yAxisTitleColor:((l=this.xyChart)==null?void 0:l.yAxisTitleColor)||this.primaryTextColor,yAxisLabelColor:((h=this.xyChart)==null?void 0:h.yAxisLabelColor)||this.primaryTextColor,yAxisTickColor:((d=this.xyChart)==null?void 0:d.yAxisTickColor)||this.primaryTextColor,yAxisLineColor:((f=this.xyChart)==null?void 0:f.yAxisLineColor)||this.primaryTextColor,plotColorPalette:((g=this.xyChart)==null?void 0:g.plotColorPalette)||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:((m=this.radar)==null?void 0:m.axisColor)||this.lineColor,axisStrokeWidth:((y=this.radar)==null?void 0:y.axisStrokeWidth)||2,axisLabelFontSize:((v=this.radar)==null?void 0:v.axisLabelFontSize)||12,curveOpacity:((b=this.radar)==null?void 0:b.curveOpacity)||.5,curveStrokeWidth:((k=this.radar)==null?void 0:k.curveStrokeWidth)||2,graticuleColor:((T=this.radar)==null?void 0:T.graticuleColor)||"#DEDEDE",graticuleStrokeWidth:((_=this.radar)==null?void 0:_.graticuleStrokeWidth)||1,graticuleOpacity:((B=this.radar)==null?void 0:B.graticuleOpacity)||.3,legendBoxSize:((L=this.radar)==null?void 0:L.legendBoxSize)||12,legendFontSize:((A=this.radar)==null?void 0:A.legendFontSize)||12},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=$t(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||U(this.primaryColor,{h:-30}),this.git4=this.pie5||U(this.primaryColor,{h:-60}),this.git5=this.pie6||U(this.primaryColor,{h:-90}),this.git6=this.pie7||U(this.primaryColor,{h:60}),this.git7=this.pie8||U(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||gt(this.git0),this.gitInv1=this.gitInv1||gt(this.git1),this.gitInv2=this.gitInv2||gt(this.git2),this.gitInv3=this.gitInv3||gt(this.git3),this.gitInv4=this.gitInv4||gt(this.git4),this.gitInv5=this.gitInv5||gt(this.git5),this.gitInv6=this.gitInv6||gt(this.git6),this.gitInv7=this.gitInv7||gt(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.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||Ru,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||Fu}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(n=>{this[n]=t[n]}),this.updateColors(),r.forEach(n=>{this[n]=t[n]})}},w(ua,"Theme"),ua),UT=w(e=>{const t=new qT;return t.calculate(e),t},"getThemeVariables"),ei={base:{getThemeVariables:DT},dark:{getThemeVariables:zT},default:{getThemeVariables:NT},forest:{getThemeVariables:HT},neutral:{getThemeVariables:UT}},$n={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:!0,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},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,showTitle:!0,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},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},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},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:""},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},theme:"default",look:"classic",handDrawnSeed:0,layout:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},i1={...$n,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:ei.default.getThemeVariables(),sequence:{...$n.sequence,messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:w(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:w(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1},gantt:{...$n.gantt,tickInterval:void 0,useWidth:void 0},c4:{...$n.c4,useWidth:void 0,personFont:w(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...$n.flowchart,inheritDir:!1},external_personFont:w(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:w(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:w(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:w(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:w(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:w(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:w(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:w(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:w(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:w(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:w(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:w(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:w(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:w(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:w(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:w(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:w(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:w(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:w(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:w(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...$n.pie,useWidth:984},xyChart:{...$n.xyChart,useWidth:void 0},requirement:{...$n.requirement,useWidth:void 0},packet:{...$n.packet},radar:{...$n.radar},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","}},s1=w((e,t="")=>Object.keys(e).reduce((r,n)=>Array.isArray(e[n])?r:typeof e[n]=="object"&&e[n]!==null?[...r,t+n,...s1(e[n],"")]:[...r,t+n],[]),"keyify"),GT=new Set(s1(i1,"")),a1=i1,Qc=w(e=>{if(nt.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>Qc(t));return}for(const t of Object.keys(e)){if(nt.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!GT.has(t)||e[t]==null){nt.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){nt.debug("sanitizing object",t),Qc(e[t]);continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)t.includes(n)&&(nt.debug("sanitizing css option",t),e[t]=VT(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r!=null&&r.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}nt.debug("After sanitization",e)}},"sanitizeDirective"),VT=w(e=>{let t=0,r=0;for(const n of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";n==="{"?t++:n==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),fa=Object.freeze(a1),Sr=Te({},fa),Kc,ms=[],Do=Te({},fa),Iu=w((e,t)=>{let r=Te({},e),n={};for(const s of t)c1(s),n=Te(n,s);if(r=Te(r,n),n.theme&&n.theme in ei){const s=Te({},Kc),o=Te(s.themeVariables||{},n.themeVariables);r.theme&&r.theme in ei&&(r.themeVariables=ei[r.theme].getThemeVariables(o))}return Do=r,u1(Do),Do},"updateCurrentConfig"),YT=w(e=>(Sr=Te({},fa),Sr=Te(Sr,e),e.theme&&ei[e.theme]&&(Sr.themeVariables=ei[e.theme].getThemeVariables(e.themeVariables)),Iu(Sr,ms),Sr),"setSiteConfig"),XT=w(e=>{Kc=Te({},e)},"saveConfigFromInitialize"),QT=w(e=>(Sr=Te(Sr,e),Iu(Sr,ms),Sr),"updateSiteConfig"),o1=w(()=>Te({},Sr),"getSiteConfig"),l1=w(e=>(u1(e),Te(Do,e),Xe()),"setConfig"),Xe=w(()=>Te({},Do),"getConfig"),c1=w(e=>{e&&(["secure",...Sr.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(nt.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"&&c1(e[t])}))},"sanitize"),KT=w(e=>{var t;Qc(e),e.fontFamily&&!((t=e.themeVariables)!=null&&t.fontFamily)&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),ms.push(e),Iu(Sr,ms)},"addDirective"),Zc=w((e=Sr)=>{ms=[],Iu(e,ms)},"reset"),ZT={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead."},f0={},JT=w(e=>{f0[e]||(nt.warn(ZT[e]),f0[e]=!0)},"issueWarning"),u1=w(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&JT("LAZY_LOAD_DEPRECATED")},"checkConfig"),GO=w(()=>{let e={};Kc&&(e=Te(e,Kc));for(const t of ms)e=Te(e,t);return e},"getUserDefinedConfig"),tl=/<br\s*\/?>/gi,tE=w(e=>e?f1(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),eE=(()=>{let e=!1;return()=>{e||(h1(),e=!0)}})();function h1(){const e="data-temp-href-target";$i.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),$i.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}w(h1,"setupDompurifyHooks");var d1=w(e=>(eE(),$i.sanitize(e)),"removeScript"),p0=w((e,t)=>{var r;if(((r=t.flowchart)==null?void 0:r.htmlLabels)!==!1){const n=t.securityLevel;n==="antiscript"||n==="strict"?e=d1(e):n!=="loose"&&(e=f1(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=sE(e))}return e},"sanitizeMore"),Zr=w((e,t)=>e&&(t.dompurifyConfig?e=$i.sanitize(p0(e,t),t.dompurifyConfig).toString():e=$i.sanitize(p0(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),rE=w((e,t)=>typeof e=="string"?Zr(e,t):e.flat().map(r=>Zr(r,t)),"sanitizeTextOrArray"),nE=w(e=>tl.test(e),"hasBreaks"),iE=w(e=>e.split(tl),"splitBreaks"),sE=w(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),f1=w(e=>e.replace(tl,"#br#"),"breakToPlaceholder"),aE=w(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),Le=w(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),oE=w(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),lE=w(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),g0=w(function(e){const t=e.split(/(,)/),r=[];for(let n=0;n<t.length;n++){let s=t[n];if(s===","&&n>0&&n+1<t.length){const o=t[n-1],c=t[n+1];cE(o,c)&&(s=o+","+c,n++,r.pop())}r.push(uE(s))}return r.join("")},"parseGenericTypes"),vf=w((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),cE=w((e,t)=>{const r=vf(e,"~"),n=vf(t,"~");return r===1&&n===1},"shouldCombineSets"),uE=w(e=>{const t=vf(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const n=[...e];let s=n.indexOf("~"),o=n.lastIndexOf("~");for(;s!==-1&&o!==-1&&s!==o;)n[s]="<",n[o]=">",s=n.indexOf("~"),o=n.lastIndexOf("~");return r&&n.unshift("~"),n.join("")},"processSet"),m0=w(()=>window.MathMLElement!==void 0,"isMathMLSupported"),bf=/\$\$(.*)\$\$/g,pa=w(e=>{var t;return(((t=e.match(bf))==null?void 0:t.length)??0)>0},"hasKatex"),VO=w(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await wp(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0";const n=document.querySelector("body");n==null||n.insertAdjacentElement("beforeend",r);const s={width:r.clientWidth,height:r.clientHeight};return r.remove(),s},"calculateMathMLDimensions"),hE=w(async(e,t)=>{if(!pa(e))return e;if(!(m0()||t.legacyMathML||t.forceLegacyMathML))return e.replace(bf,"MathML is unsupported in this environment.");{const{default:r}=await Zt(async()=>{const{default:s}=await import("./katex-BlHpptmG.js");return{default:s}},[]),n=t.forceLegacyMathML||!m0()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(tl).map(s=>pa(s)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${s}</div>`:`<div>${s}</div>`).join("").replace(bf,(s,o)=>r.renderToString(o,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),wp=w(async(e,t)=>Zr(await hE(e,t),t),"renderKatexSanitized"),Sa={getRows:tE,sanitizeText:Zr,sanitizeTextOrArray:rE,hasBreaks:nE,splitBreaks:iE,lineBreakRegex:tl,removeScript:d1,getUrl:aE,evaluate:Le,getMax:oE,getMin:lE},dE=w(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),fE=w(function(e,t,r){let n=new Map;return r?(n.set("width","100%"),n.set("style",`max-width: ${t}px;`)):(n.set("height",e),n.set("width",t)),n},"calculateSvgSizeAttrs"),p1=w(function(e,t,r,n){const s=fE(t,r,n);dE(e,s)},"configureSvgSize"),pE=w(function(e,t,r,n){const s=t.node().getBBox(),o=s.width,c=s.height;nt.info(`SVG bounds: ${o}x${c}`,s);let l=0,h=0;nt.info(`Graph bounds: ${l}x${h}`,e),l=o+r*2,h=c+r*2,nt.info(`Calculated bounds: ${l}x${h}`),p1(t,h,l,n);const d=`${s.x-r} ${s.y-r} ${s.width+2*r} ${s.height+2*r}`;t.attr("viewBox",d)},"setupGraphViewbox"),Ic={},gE=w((e,t,r)=>{let n="";return e in Ic&&Ic[e]?n=Ic[e](r):nt.warn(`No theme found for ${e}`),` & {
103
+ font-family: ${r.fontFamily};
104
+ font-size: ${r.fontSize};
105
+ fill: ${r.textColor}
106
+ }
107
+ @keyframes edge-animation-frame {
108
+ from {
109
+ stroke-dashoffset: 0;
110
+ }
111
+ }
112
+ @keyframes dash {
113
+ to {
114
+ stroke-dashoffset: 0;
115
+ }
116
+ }
117
+ & .edge-animation-slow {
118
+ stroke-dasharray: 9,5 !important;
119
+ stroke-dashoffset: 900;
120
+ animation: dash 50s linear infinite;
121
+ stroke-linecap: round;
122
+ }
123
+ & .edge-animation-fast {
124
+ stroke-dasharray: 9,5 !important;
125
+ stroke-dashoffset: 900;
126
+ animation: dash 20s linear infinite;
127
+ stroke-linecap: round;
128
+ }
129
+ /* Classes common for multiple diagrams */
130
+
131
+ & .error-icon {
132
+ fill: ${r.errorBkgColor};
133
+ }
134
+ & .error-text {
135
+ fill: ${r.errorTextColor};
136
+ stroke: ${r.errorTextColor};
137
+ }
138
+
139
+ & .edge-thickness-normal {
140
+ stroke-width: 1px;
141
+ }
142
+ & .edge-thickness-thick {
143
+ stroke-width: 3.5px
144
+ }
145
+ & .edge-pattern-solid {
146
+ stroke-dasharray: 0;
147
+ }
148
+ & .edge-thickness-invisible {
149
+ stroke-width: 0;
150
+ fill: none;
151
+ }
152
+ & .edge-pattern-dashed{
153
+ stroke-dasharray: 3;
154
+ }
155
+ .edge-pattern-dotted {
156
+ stroke-dasharray: 2;
157
+ }
158
+
159
+ & .marker {
160
+ fill: ${r.lineColor};
161
+ stroke: ${r.lineColor};
162
+ }
163
+ & .marker.cross {
164
+ stroke: ${r.lineColor};
165
+ }
166
+
167
+ & svg {
168
+ font-family: ${r.fontFamily};
169
+ font-size: ${r.fontSize};
170
+ }
171
+ & p {
172
+ margin: 0
173
+ }
174
+
175
+ ${n}
176
+
177
+ ${t}
178
+ `},"getStyles"),mE=w((e,t)=>{t!==void 0&&(Ic[e]=t)},"addStylesForDiagram"),yE=gE,g1={};TT(g1,{clear:()=>xE,getAccDescription:()=>CE,getAccTitle:()=>bE,getDiagramTitle:()=>kE,setAccDescription:()=>SE,setAccTitle:()=>vE,setDiagramTitle:()=>wE});var kp="",_p="",Tp="",Ep=w(e=>Zr(e,Xe()),"sanitizeText"),xE=w(()=>{kp="",Tp="",_p=""},"clear"),vE=w(e=>{kp=Ep(e).replace(/^\s+/g,"")},"setAccTitle"),bE=w(()=>kp,"getAccTitle"),SE=w(e=>{Tp=Ep(e).replace(/\n\s+/g,`
179
+ `)},"setAccDescription"),CE=w(()=>Tp,"getAccDescription"),wE=w(e=>{_p=Ep(e)},"setDiagramTitle"),kE=w(()=>_p,"getDiagramTitle"),y0=nt,_E=Sp,Jt=Xe,YO=l1,XO=fa,Lp=w(e=>Zr(e,Jt()),"sanitizeText"),TE=pE,EE=w(()=>g1,"getCommonDb"),Jc={},tu=w((e,t,r)=>{var n;Jc[e]&&y0.warn(`Diagram with id ${e} already registered. Overwriting.`),Jc[e]=t,r&&n1(e,r),mE(e,t.styles),(n=t.injectUtils)==null||n.call(t,y0,_E,Jt,Lp,TE,EE(),()=>{})},"registerDiagram"),Sf=w(e=>{if(e in Jc)return Jc[e];throw new LE(e)},"getDiagram"),ha,LE=(ha=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},w(ha,"DiagramNotFoundError"),ha),ME={value:()=>{}};function m1(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Pc(r)}function Pc(e){this._=e}function BE(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",s=r.indexOf(".");if(s>=0&&(n=r.slice(s+1),r=r.slice(0,s)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Pc.prototype=m1.prototype={constructor:Pc,on:function(e,t){var r=this._,n=BE(e+"",r),s,o=-1,c=n.length;if(arguments.length<2){for(;++o<c;)if((s=(e=n[o]).type)&&(s=AE(r[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<c;)if(s=(e=n[o]).type)r[s]=x0(r[s],e.name,t);else if(t==null)for(s in r)r[s]=x0(r[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Pc(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var r=new Array(s),n=0,s,o;n<s;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],n=0,s=o.length;n<s;++n)o[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],s=0,o=n.length;s<o;++s)n[s].value.apply(t,r)}};function AE(e,t){for(var r=0,n=e.length,s;r<n;++r)if((s=e[r]).name===t)return s.value}function x0(e,t,r){for(var n=0,s=e.length;n<s;++n)if(e[n].name===t){e[n]=ME,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var Cf="http://www.w3.org/1999/xhtml";const v0={svg:"http://www.w3.org/2000/svg",xhtml:Cf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Pu(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),v0.hasOwnProperty(t)?{space:v0[t],local:e}:e}function $E(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Cf&&t.documentElement.namespaceURI===Cf?t.createElement(e):t.createElementNS(r,e)}}function RE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function y1(e){var t=Pu(e);return(t.local?RE:$E)(t)}function FE(){}function Mp(e){return e==null?FE:function(){return this.querySelector(e)}}function IE(e){typeof e!="function"&&(e=Mp(e));for(var t=this._groups,r=t.length,n=new Array(r),s=0;s<r;++s)for(var o=t[s],c=o.length,l=n[s]=new Array(c),h,d,f=0;f<c;++f)(h=o[f])&&(d=e.call(h,h.__data__,f,o))&&("__data__"in h&&(d.__data__=h.__data__),l[f]=d);return new Pr(n,this._parents)}function PE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function DE(){return[]}function x1(e){return e==null?DE:function(){return this.querySelectorAll(e)}}function OE(e){return function(){return PE(e.apply(this,arguments))}}function zE(e){typeof e=="function"?e=OE(e):e=x1(e);for(var t=this._groups,r=t.length,n=[],s=[],o=0;o<r;++o)for(var c=t[o],l=c.length,h,d=0;d<l;++d)(h=c[d])&&(n.push(e.call(h,h.__data__,d,c)),s.push(h));return new Pr(n,s)}function v1(e){return function(){return this.matches(e)}}function b1(e){return function(t){return t.matches(e)}}var jE=Array.prototype.find;function NE(e){return function(){return jE.call(this.children,e)}}function WE(){return this.firstElementChild}function HE(e){return this.select(e==null?WE:NE(typeof e=="function"?e:b1(e)))}var qE=Array.prototype.filter;function UE(){return Array.from(this.children)}function GE(e){return function(){return qE.call(this.children,e)}}function VE(e){return this.selectAll(e==null?UE:GE(typeof e=="function"?e:b1(e)))}function YE(e){typeof e!="function"&&(e=v1(e));for(var t=this._groups,r=t.length,n=new Array(r),s=0;s<r;++s)for(var o=t[s],c=o.length,l=n[s]=[],h,d=0;d<c;++d)(h=o[d])&&e.call(h,h.__data__,d,o)&&l.push(h);return new Pr(n,this._parents)}function S1(e){return new Array(e.length)}function XE(){return new Pr(this._enter||this._groups.map(S1),this._parents)}function eu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}eu.prototype={constructor:eu,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 QE(e){return function(){return e}}function KE(e,t,r,n,s,o){for(var c=0,l,h=t.length,d=o.length;c<d;++c)(l=t[c])?(l.__data__=o[c],n[c]=l):r[c]=new eu(e,o[c]);for(;c<h;++c)(l=t[c])&&(s[c]=l)}function ZE(e,t,r,n,s,o,c){var l,h,d=new Map,f=t.length,g=o.length,m=new Array(f),y;for(l=0;l<f;++l)(h=t[l])&&(m[l]=y=c.call(h,h.__data__,l,t)+"",d.has(y)?s[l]=h:d.set(y,h));for(l=0;l<g;++l)y=c.call(e,o[l],l,o)+"",(h=d.get(y))?(n[l]=h,h.__data__=o[l],d.delete(y)):r[l]=new eu(e,o[l]);for(l=0;l<f;++l)(h=t[l])&&d.get(m[l])===h&&(s[l]=h)}function JE(e){return e.__data__}function tL(e,t){if(!arguments.length)return Array.from(this,JE);var r=t?ZE:KE,n=this._parents,s=this._groups;typeof e!="function"&&(e=QE(e));for(var o=s.length,c=new Array(o),l=new Array(o),h=new Array(o),d=0;d<o;++d){var f=n[d],g=s[d],m=g.length,y=eL(e.call(f,f&&f.__data__,d,n)),v=y.length,b=l[d]=new Array(v),k=c[d]=new Array(v),T=h[d]=new Array(m);r(f,g,b,k,T,y,t);for(var _=0,B=0,L,A;_<v;++_)if(L=b[_]){for(_>=B&&(B=_+1);!(A=k[B])&&++B<v;);L._next=A||null}}return c=new Pr(c,n),c._enter=l,c._exit=h,c}function eL(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rL(){return new Pr(this._exit||this._groups.map(S1),this._parents)}function nL(e,t,r){var n=this.enter(),s=this,o=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),r==null?o.remove():r(o),n&&s?n.merge(s).order():s}function iL(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,s=r.length,o=n.length,c=Math.min(s,o),l=new Array(s),h=0;h<c;++h)for(var d=r[h],f=n[h],g=d.length,m=l[h]=new Array(g),y,v=0;v<g;++v)(y=d[v]||f[v])&&(m[v]=y);for(;h<s;++h)l[h]=r[h];return new Pr(l,this._parents)}function sL(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],s=n.length-1,o=n[s],c;--s>=0;)(c=n[s])&&(o&&c.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(c,o),o=c);return this}function aL(e){e||(e=oL);function t(g,m){return g&&m?e(g.__data__,m.__data__):!g-!m}for(var r=this._groups,n=r.length,s=new Array(n),o=0;o<n;++o){for(var c=r[o],l=c.length,h=s[o]=new Array(l),d,f=0;f<l;++f)(d=c[f])&&(h[f]=d);h.sort(t)}return new Pr(s,this._parents).order()}function oL(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function lL(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cL(){return Array.from(this)}function uL(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],s=0,o=n.length;s<o;++s){var c=n[s];if(c)return c}return null}function hL(){let e=0;for(const t of this)++e;return e}function dL(){return!this.node()}function fL(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var s=t[r],o=0,c=s.length,l;o<c;++o)(l=s[o])&&e.call(l,l.__data__,o,s);return this}function pL(e){return function(){this.removeAttribute(e)}}function gL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mL(e,t){return function(){this.setAttribute(e,t)}}function yL(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function xL(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function vL(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function bL(e,t){var r=Pu(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?gL:pL:typeof t=="function"?r.local?vL:xL:r.local?yL:mL)(r,t))}function C1(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function SL(e){return function(){this.style.removeProperty(e)}}function CL(e,t,r){return function(){this.style.setProperty(e,t,r)}}function wL(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function kL(e,t,r){return arguments.length>1?this.each((t==null?SL:typeof t=="function"?wL:CL)(e,t,r??"")):ga(this.node(),e)}function ga(e,t){return e.style.getPropertyValue(t)||C1(e).getComputedStyle(e,null).getPropertyValue(t)}function _L(e){return function(){delete this[e]}}function TL(e,t){return function(){this[e]=t}}function EL(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function LL(e,t){return arguments.length>1?this.each((t==null?_L:typeof t=="function"?EL:TL)(e,t)):this.node()[e]}function w1(e){return e.trim().split(/^|\s+/)}function Bp(e){return e.classList||new k1(e)}function k1(e){this._node=e,this._names=w1(e.getAttribute("class")||"")}k1.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 _1(e,t){for(var r=Bp(e),n=-1,s=t.length;++n<s;)r.add(t[n])}function T1(e,t){for(var r=Bp(e),n=-1,s=t.length;++n<s;)r.remove(t[n])}function ML(e){return function(){_1(this,e)}}function BL(e){return function(){T1(this,e)}}function AL(e,t){return function(){(t.apply(this,arguments)?_1:T1)(this,e)}}function $L(e,t){var r=w1(e+"");if(arguments.length<2){for(var n=Bp(this.node()),s=-1,o=r.length;++s<o;)if(!n.contains(r[s]))return!1;return!0}return this.each((typeof t=="function"?AL:t?ML:BL)(r,t))}function RL(){this.textContent=""}function FL(e){return function(){this.textContent=e}}function IL(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function PL(e){return arguments.length?this.each(e==null?RL:(typeof e=="function"?IL:FL)(e)):this.node().textContent}function DL(){this.innerHTML=""}function OL(e){return function(){this.innerHTML=e}}function zL(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function jL(e){return arguments.length?this.each(e==null?DL:(typeof e=="function"?zL:OL)(e)):this.node().innerHTML}function NL(){this.nextSibling&&this.parentNode.appendChild(this)}function WL(){return this.each(NL)}function HL(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qL(){return this.each(HL)}function UL(e){var t=typeof e=="function"?e:y1(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function GL(){return null}function VL(e,t){var r=typeof e=="function"?e:y1(e),n=t==null?GL:typeof t=="function"?t:Mp(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function YL(){var e=this.parentNode;e&&e.removeChild(this)}function XL(){return this.each(YL)}function QL(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KL(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ZL(e){return this.select(e?KL:QL)}function JL(e){return arguments.length?this.property("__data__",e):this.node().__data__}function tM(e){return function(t){e.call(this,t,this.__data__)}}function eM(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function rM(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,s=t.length,o;r<s;++r)o=t[r],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++n]=o;++n?t.length=n:delete this.__on}}}function nM(e,t,r){return function(){var n=this.__on,s,o=tM(t);if(n){for(var c=0,l=n.length;c<l;++c)if((s=n[c]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=r),s.value=t;return}}this.addEventListener(e.type,o,r),s={type:e.type,name:e.name,value:t,listener:o,options:r},n?n.push(s):this.__on=[s]}}function iM(e,t,r){var n=eM(e+""),s,o=n.length,c;if(arguments.length<2){var l=this.node().__on;if(l){for(var h=0,d=l.length,f;h<d;++h)for(s=0,f=l[h];s<o;++s)if((c=n[s]).type===f.type&&c.name===f.name)return f.value}return}for(l=t?nM:rM,s=0;s<o;++s)this.each(l(n[s],t,r));return this}function E1(e,t,r){var n=C1(e),s=n.CustomEvent;typeof s=="function"?s=new s(t,r):(s=n.document.createEvent("Event"),r?(s.initEvent(t,r.bubbles,r.cancelable),s.detail=r.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function sM(e,t){return function(){return E1(this,e,t)}}function aM(e,t){return function(){return E1(this,e,t.apply(this,arguments))}}function oM(e,t){return this.each((typeof t=="function"?aM:sM)(e,t))}function*lM(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],s=0,o=n.length,c;s<o;++s)(c=n[s])&&(yield c)}var L1=[null];function Pr(e,t){this._groups=e,this._parents=t}function el(){return new Pr([[document.documentElement]],L1)}function cM(){return this}Pr.prototype=el.prototype={constructor:Pr,select:IE,selectAll:zE,selectChild:HE,selectChildren:VE,filter:YE,data:tL,enter:XE,exit:rL,join:nL,merge:iL,selection:cM,order:sL,sort:aL,call:lL,nodes:cL,node:uL,size:hL,empty:dL,each:fL,attr:bL,style:kL,property:LL,classed:$L,text:PL,html:jL,raise:WL,lower:qL,append:UL,insert:VL,remove:XL,clone:ZL,datum:JL,on:iM,dispatch:oM,[Symbol.iterator]:lM};function Gt(e){return typeof e=="string"?new Pr([[document.querySelector(e)]],[document.documentElement]):new Pr([[e]],L1)}function Ap(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function M1(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function rl(){}var zo=.7,ru=1/zo,na="\\s*([+-]?\\d+)\\s*",jo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uM=/^#([0-9a-f]{3,8})$/,hM=new RegExp(`^rgb\\(${na},${na},${na}\\)$`),dM=new RegExp(`^rgb\\(${Dn},${Dn},${Dn}\\)$`),fM=new RegExp(`^rgba\\(${na},${na},${na},${jo}\\)$`),pM=new RegExp(`^rgba\\(${Dn},${Dn},${Dn},${jo}\\)$`),gM=new RegExp(`^hsl\\(${jo},${Dn},${Dn}\\)$`),mM=new RegExp(`^hsla\\(${jo},${Dn},${Dn},${jo}\\)$`),b0={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};Ap(rl,No,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:S0,formatHex:S0,formatHex8:yM,formatHsl:xM,formatRgb:C0,toString:C0});function S0(){return this.rgb().formatHex()}function yM(){return this.rgb().formatHex8()}function xM(){return B1(this).formatHsl()}function C0(){return this.rgb().formatRgb()}function No(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=uM.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?w0(t):r===3?new wr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?xc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?xc(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=hM.exec(e))?new wr(t[1],t[2],t[3],1):(t=dM.exec(e))?new wr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=fM.exec(e))?xc(t[1],t[2],t[3],t[4]):(t=pM.exec(e))?xc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=gM.exec(e))?T0(t[1],t[2]/100,t[3]/100,1):(t=mM.exec(e))?T0(t[1],t[2]/100,t[3]/100,t[4]):b0.hasOwnProperty(e)?w0(b0[e]):e==="transparent"?new wr(NaN,NaN,NaN,0):null}function w0(e){return new wr(e>>16&255,e>>8&255,e&255,1)}function xc(e,t,r,n){return n<=0&&(e=t=r=NaN),new wr(e,t,r,n)}function vM(e){return e instanceof rl||(e=No(e)),e?(e=e.rgb(),new wr(e.r,e.g,e.b,e.opacity)):new wr}function wf(e,t,r,n){return arguments.length===1?vM(e):new wr(e,t,r,n??1)}function wr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Ap(wr,wf,M1(rl,{brighter(e){return e=e==null?ru:Math.pow(ru,e),new wr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zo:Math.pow(zo,e),new wr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new wr(ds(this.r),ds(this.g),ds(this.b),nu(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:k0,formatHex:k0,formatHex8:bM,formatRgb:_0,toString:_0}));function k0(){return`#${ls(this.r)}${ls(this.g)}${ls(this.b)}`}function bM(){return`#${ls(this.r)}${ls(this.g)}${ls(this.b)}${ls((isNaN(this.opacity)?1:this.opacity)*255)}`}function _0(){const e=nu(this.opacity);return`${e===1?"rgb(":"rgba("}${ds(this.r)}, ${ds(this.g)}, ${ds(this.b)}${e===1?")":`, ${e})`}`}function nu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ds(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ls(e){return e=ds(e),(e<16?"0":"")+e.toString(16)}function T0(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new vn(e,t,r,n)}function B1(e){if(e instanceof vn)return new vn(e.h,e.s,e.l,e.opacity);if(e instanceof rl||(e=No(e)),!e)return new vn;if(e instanceof vn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,s=Math.min(t,r,n),o=Math.max(t,r,n),c=NaN,l=o-s,h=(o+s)/2;return l?(t===o?c=(r-n)/l+(r<n)*6:r===o?c=(n-t)/l+2:c=(t-r)/l+4,l/=h<.5?o+s:2-o-s,c*=60):l=h>0&&h<1?0:c,new vn(c,l,h,e.opacity)}function SM(e,t,r,n){return arguments.length===1?B1(e):new vn(e,t,r,n??1)}function vn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Ap(vn,SM,M1(rl,{brighter(e){return e=e==null?ru:Math.pow(ru,e),new vn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zo:Math.pow(zo,e),new vn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,s=2*r-n;return new wr(Yd(e>=240?e-240:e+120,s,n),Yd(e,s,n),Yd(e<120?e+240:e-120,s,n),this.opacity)},clamp(){return new vn(E0(this.h),vc(this.s),vc(this.l),nu(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=nu(this.opacity);return`${e===1?"hsl(":"hsla("}${E0(this.h)}, ${vc(this.s)*100}%, ${vc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function E0(e){return e=(e||0)%360,e<0?e+360:e}function vc(e){return Math.max(0,Math.min(1,e||0))}function Yd(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const $p=e=>()=>e;function A1(e,t){return function(r){return e+r*t}}function CM(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function QO(e,t){var r=t-e;return r?A1(e,r>180||r<-180?r-360*Math.round(r/360):r):$p(isNaN(e)?t:e)}function wM(e){return(e=+e)==1?$1:function(t,r){return r-t?CM(t,r,e):$p(isNaN(t)?r:t)}}function $1(e,t){var r=t-e;return r?A1(e,r):$p(isNaN(e)?t:e)}const L0=(function e(t){var r=wM(t);function n(s,o){var c=r((s=wf(s)).r,(o=wf(o)).r),l=r(s.g,o.g),h=r(s.b,o.b),d=$1(s.opacity,o.opacity);return function(f){return s.r=c(f),s.g=l(f),s.b=h(f),s.opacity=d(f),s+""}}return n.gamma=e,n})(1);function Li(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var kf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xd=new RegExp(kf.source,"g");function kM(e){return function(){return e}}function _M(e){return function(t){return e(t)+""}}function TM(e,t){var r=kf.lastIndex=Xd.lastIndex=0,n,s,o,c=-1,l=[],h=[];for(e=e+"",t=t+"";(n=kf.exec(e))&&(s=Xd.exec(t));)(o=s.index)>r&&(o=t.slice(r,o),l[c]?l[c]+=o:l[++c]=o),(n=n[0])===(s=s[0])?l[c]?l[c]+=s:l[++c]=s:(l[++c]=null,h.push({i:c,x:Li(n,s)})),r=Xd.lastIndex;return r<t.length&&(o=t.slice(r),l[c]?l[c]+=o:l[++c]=o),l.length<2?h[0]?_M(h[0].x):kM(t):(t=h.length,function(d){for(var f=0,g;f<t;++f)l[(g=h[f]).i]=g.x(d);return l.join("")})}var M0=180/Math.PI,_f={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function R1(e,t,r,n,s,o){var c,l,h;return(c=Math.sqrt(e*e+t*t))&&(e/=c,t/=c),(h=e*r+t*n)&&(r-=e*h,n-=t*h),(l=Math.sqrt(r*r+n*n))&&(r/=l,n/=l,h/=l),e*n<t*r&&(e=-e,t=-t,h=-h,c=-c),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*M0,skewX:Math.atan(h)*M0,scaleX:c,scaleY:l}}var bc;function EM(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?_f:R1(t.a,t.b,t.c,t.d,t.e,t.f)}function LM(e){return e==null||(bc||(bc=document.createElementNS("http://www.w3.org/2000/svg","g")),bc.setAttribute("transform",e),!(e=bc.transform.baseVal.consolidate()))?_f:(e=e.matrix,R1(e.a,e.b,e.c,e.d,e.e,e.f))}function F1(e,t,r,n){function s(d){return d.length?d.pop()+" ":""}function o(d,f,g,m,y,v){if(d!==g||f!==m){var b=y.push("translate(",null,t,null,r);v.push({i:b-4,x:Li(d,g)},{i:b-2,x:Li(f,m)})}else(g||m)&&y.push("translate("+g+t+m+r)}function c(d,f,g,m){d!==f?(d-f>180?f+=360:f-d>180&&(d+=360),m.push({i:g.push(s(g)+"rotate(",null,n)-2,x:Li(d,f)})):f&&g.push(s(g)+"rotate("+f+n)}function l(d,f,g,m){d!==f?m.push({i:g.push(s(g)+"skewX(",null,n)-2,x:Li(d,f)}):f&&g.push(s(g)+"skewX("+f+n)}function h(d,f,g,m,y,v){if(d!==g||f!==m){var b=y.push(s(y)+"scale(",null,",",null,")");v.push({i:b-4,x:Li(d,g)},{i:b-2,x:Li(f,m)})}else(g!==1||m!==1)&&y.push(s(y)+"scale("+g+","+m+")")}return function(d,f){var g=[],m=[];return d=e(d),f=e(f),o(d.translateX,d.translateY,f.translateX,f.translateY,g,m),c(d.rotate,f.rotate,g,m),l(d.skewX,f.skewX,g,m),h(d.scaleX,d.scaleY,f.scaleX,f.scaleY,g,m),d=f=null,function(y){for(var v=-1,b=m.length,k;++v<b;)g[(k=m[v]).i]=k.x(y);return g.join("")}}}var MM=F1(EM,"px, ","px)","deg)"),BM=F1(LM,", ",")",")"),ma=0,To=0,vo=0,I1=1e3,iu,Eo,su=0,ys=0,Du=0,Wo=typeof performance=="object"&&performance.now?performance:Date,P1=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Rp(){return ys||(P1(AM),ys=Wo.now()+Du)}function AM(){ys=0}function au(){this._call=this._time=this._next=null}au.prototype=D1.prototype={constructor:au,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Rp():+r)+(t==null?0:+t),!this._next&&Eo!==this&&(Eo?Eo._next=this:iu=this,Eo=this),this._call=e,this._time=r,Tf()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tf())}};function D1(e,t,r){var n=new au;return n.restart(e,t,r),n}function $M(){Rp(),++ma;for(var e=iu,t;e;)(t=ys-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ma}function B0(){ys=(su=Wo.now())+Du,ma=To=0;try{$M()}finally{ma=0,FM(),ys=0}}function RM(){var e=Wo.now(),t=e-su;t>I1&&(Du-=t,su=e)}function FM(){for(var e,t=iu,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:iu=r);Eo=e,Tf(n)}function Tf(e){if(!ma){To&&(To=clearTimeout(To));var t=e-ys;t>24?(e<1/0&&(To=setTimeout(B0,e-Wo.now()-Du)),vo&&(vo=clearInterval(vo))):(vo||(su=Wo.now(),vo=setInterval(RM,I1)),ma=1,P1(B0))}}function A0(e,t,r){var n=new au;return t=t==null?0:+t,n.restart(s=>{n.stop(),e(s+t)},t,r),n}var IM=m1("start","end","cancel","interrupt"),PM=[],O1=0,$0=1,Ef=2,Dc=3,R0=4,Lf=5,Oc=6;function Ou(e,t,r,n,s,o){var c=e.__transition;if(!c)e.__transition={};else if(r in c)return;DM(e,r,{name:t,index:n,group:s,on:IM,tween:PM,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:O1})}function Fp(e,t){var r=wn(e,t);if(r.state>O1)throw new Error("too late; already scheduled");return r}function jn(e,t){var r=wn(e,t);if(r.state>Dc)throw new Error("too late; already running");return r}function wn(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function DM(e,t,r){var n=e.__transition,s;n[t]=r,r.timer=D1(o,0,r.time);function o(d){r.state=$0,r.timer.restart(c,r.delay,r.time),r.delay<=d&&c(d-r.delay)}function c(d){var f,g,m,y;if(r.state!==$0)return h();for(f in n)if(y=n[f],y.name===r.name){if(y.state===Dc)return A0(c);y.state===R0?(y.state=Oc,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete n[f]):+f<t&&(y.state=Oc,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete n[f])}if(A0(function(){r.state===Dc&&(r.state=R0,r.timer.restart(l,r.delay,r.time),l(d))}),r.state=Ef,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Ef){for(r.state=Dc,s=new Array(m=r.tween.length),f=0,g=-1;f<m;++f)(y=r.tween[f].value.call(e,e.__data__,r.index,r.group))&&(s[++g]=y);s.length=g+1}}function l(d){for(var f=d<r.duration?r.ease.call(null,d/r.duration):(r.timer.restart(h),r.state=Lf,1),g=-1,m=s.length;++g<m;)s[g].call(e,f);r.state===Lf&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=Oc,r.timer.stop(),delete n[t];for(var d in n)return;delete e.__transition}}function OM(e,t){var r=e.__transition,n,s,o=!0,c;if(r){t=t==null?null:t+"";for(c in r){if((n=r[c]).name!==t){o=!1;continue}s=n.state>Ef&&n.state<Lf,n.state=Oc,n.timer.stop(),n.on.call(s?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[c]}o&&delete e.__transition}}function zM(e){return this.each(function(){OM(this,e)})}function jM(e,t){var r,n;return function(){var s=jn(this,e),o=s.tween;if(o!==r){n=r=o;for(var c=0,l=n.length;c<l;++c)if(n[c].name===t){n=n.slice(),n.splice(c,1);break}}s.tween=n}}function NM(e,t,r){var n,s;if(typeof r!="function")throw new Error;return function(){var o=jn(this,e),c=o.tween;if(c!==n){s=(n=c).slice();for(var l={name:t,value:r},h=0,d=s.length;h<d;++h)if(s[h].name===t){s[h]=l;break}h===d&&s.push(l)}o.tween=s}}function WM(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=wn(this.node(),r).tween,s=0,o=n.length,c;s<o;++s)if((c=n[s]).name===e)return c.value;return null}return this.each((t==null?jM:NM)(r,e,t))}function Ip(e,t,r){var n=e._id;return e.each(function(){var s=jn(this,n);(s.value||(s.value={}))[t]=r.apply(this,arguments)}),function(s){return wn(s,n).value[t]}}function z1(e,t){var r;return(typeof t=="number"?Li:t instanceof No?L0:(r=No(t))?(t=r,L0):TM)(e,t)}function HM(e){return function(){this.removeAttribute(e)}}function qM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function UM(e,t,r){var n,s=r+"",o;return function(){var c=this.getAttribute(e);return c===s?null:c===n?o:o=t(n=c,r)}}function GM(e,t,r){var n,s=r+"",o;return function(){var c=this.getAttributeNS(e.space,e.local);return c===s?null:c===n?o:o=t(n=c,r)}}function VM(e,t,r){var n,s,o;return function(){var c,l=r(this),h;return l==null?void this.removeAttribute(e):(c=this.getAttribute(e),h=l+"",c===h?null:c===n&&h===s?o:(s=h,o=t(n=c,l)))}}function YM(e,t,r){var n,s,o;return function(){var c,l=r(this),h;return l==null?void this.removeAttributeNS(e.space,e.local):(c=this.getAttributeNS(e.space,e.local),h=l+"",c===h?null:c===n&&h===s?o:(s=h,o=t(n=c,l)))}}function XM(e,t){var r=Pu(e),n=r==="transform"?BM:z1;return this.attrTween(e,typeof t=="function"?(r.local?YM:VM)(r,n,Ip(this,"attr."+e,t)):t==null?(r.local?qM:HM)(r):(r.local?GM:UM)(r,n,t))}function QM(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function KM(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function ZM(e,t){var r,n;function s(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&KM(e,o)),r}return s._value=t,s}function JM(e,t){var r,n;function s(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&QM(e,o)),r}return s._value=t,s}function tB(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=Pu(e);return this.tween(r,(n.local?ZM:JM)(n,t))}function eB(e,t){return function(){Fp(this,e).delay=+t.apply(this,arguments)}}function rB(e,t){return t=+t,function(){Fp(this,e).delay=t}}function nB(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?eB:rB)(t,e)):wn(this.node(),t).delay}function iB(e,t){return function(){jn(this,e).duration=+t.apply(this,arguments)}}function sB(e,t){return t=+t,function(){jn(this,e).duration=t}}function aB(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?iB:sB)(t,e)):wn(this.node(),t).duration}function oB(e,t){if(typeof t!="function")throw new Error;return function(){jn(this,e).ease=t}}function lB(e){var t=this._id;return arguments.length?this.each(oB(t,e)):wn(this.node(),t).ease}function cB(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;jn(this,e).ease=r}}function uB(e){if(typeof e!="function")throw new Error;return this.each(cB(this._id,e))}function hB(e){typeof e!="function"&&(e=v1(e));for(var t=this._groups,r=t.length,n=new Array(r),s=0;s<r;++s)for(var o=t[s],c=o.length,l=n[s]=[],h,d=0;d<c;++d)(h=o[d])&&e.call(h,h.__data__,d,o)&&l.push(h);return new ni(n,this._parents,this._name,this._id)}function dB(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,s=r.length,o=Math.min(n,s),c=new Array(n),l=0;l<o;++l)for(var h=t[l],d=r[l],f=h.length,g=c[l]=new Array(f),m,y=0;y<f;++y)(m=h[y]||d[y])&&(g[y]=m);for(;l<n;++l)c[l]=t[l];return new ni(c,this._parents,this._name,this._id)}function fB(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function pB(e,t,r){var n,s,o=fB(t)?Fp:jn;return function(){var c=o(this,e),l=c.on;l!==n&&(s=(n=l).copy()).on(t,r),c.on=s}}function gB(e,t){var r=this._id;return arguments.length<2?wn(this.node(),r).on.on(e):this.each(pB(r,e,t))}function mB(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function yB(){return this.on("end.remove",mB(this._id))}function xB(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Mp(e));for(var n=this._groups,s=n.length,o=new Array(s),c=0;c<s;++c)for(var l=n[c],h=l.length,d=o[c]=new Array(h),f,g,m=0;m<h;++m)(f=l[m])&&(g=e.call(f,f.__data__,m,l))&&("__data__"in f&&(g.__data__=f.__data__),d[m]=g,Ou(d[m],t,r,m,d,wn(f,r)));return new ni(o,this._parents,t,r)}function vB(e){var t=this._name,r=this._id;typeof e!="function"&&(e=x1(e));for(var n=this._groups,s=n.length,o=[],c=[],l=0;l<s;++l)for(var h=n[l],d=h.length,f,g=0;g<d;++g)if(f=h[g]){for(var m=e.call(f,f.__data__,g,h),y,v=wn(f,r),b=0,k=m.length;b<k;++b)(y=m[b])&&Ou(y,t,r,b,m,v);o.push(m),c.push(f)}return new ni(o,c,t,r)}var bB=el.prototype.constructor;function SB(){return new bB(this._groups,this._parents)}function CB(e,t){var r,n,s;return function(){var o=ga(this,e),c=(this.style.removeProperty(e),ga(this,e));return o===c?null:o===r&&c===n?s:s=t(r=o,n=c)}}function j1(e){return function(){this.style.removeProperty(e)}}function wB(e,t,r){var n,s=r+"",o;return function(){var c=ga(this,e);return c===s?null:c===n?o:o=t(n=c,r)}}function kB(e,t,r){var n,s,o;return function(){var c=ga(this,e),l=r(this),h=l+"";return l==null&&(h=l=(this.style.removeProperty(e),ga(this,e))),c===h?null:c===n&&h===s?o:(s=h,o=t(n=c,l))}}function _B(e,t){var r,n,s,o="style."+t,c="end."+o,l;return function(){var h=jn(this,e),d=h.on,f=h.value[o]==null?l||(l=j1(t)):void 0;(d!==r||s!==f)&&(n=(r=d).copy()).on(c,s=f),h.on=n}}function TB(e,t,r){var n=(e+="")=="transform"?MM:z1;return t==null?this.styleTween(e,CB(e,n)).on("end.style."+e,j1(e)):typeof t=="function"?this.styleTween(e,kB(e,n,Ip(this,"style."+e,t))).each(_B(this._id,e)):this.styleTween(e,wB(e,n,t),r).on("end.style."+e,null)}function EB(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function LB(e,t,r){var n,s;function o(){var c=t.apply(this,arguments);return c!==s&&(n=(s=c)&&EB(e,c,r)),n}return o._value=t,o}function MB(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,LB(e,t,r??""))}function BB(e){return function(){this.textContent=e}}function AB(e){return function(){var t=e(this);this.textContent=t??""}}function $B(e){return this.tween("text",typeof e=="function"?AB(Ip(this,"text",e)):BB(e==null?"":e+""))}function RB(e){return function(t){this.textContent=e.call(this,t)}}function FB(e){var t,r;function n(){var s=e.apply(this,arguments);return s!==r&&(t=(r=s)&&RB(s)),t}return n._value=e,n}function IB(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,FB(e))}function PB(){for(var e=this._name,t=this._id,r=N1(),n=this._groups,s=n.length,o=0;o<s;++o)for(var c=n[o],l=c.length,h,d=0;d<l;++d)if(h=c[d]){var f=wn(h,t);Ou(h,e,r,d,c,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new ni(n,this._parents,e,r)}function DB(){var e,t,r=this,n=r._id,s=r.size();return new Promise(function(o,c){var l={value:c},h={value:function(){--s===0&&o()}};r.each(function(){var d=jn(this,n),f=d.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(h)),d.on=t}),s===0&&o()})}var OB=0;function ni(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function N1(){return++OB}var Zn=el.prototype;ni.prototype={constructor:ni,select:xB,selectAll:vB,selectChild:Zn.selectChild,selectChildren:Zn.selectChildren,filter:hB,merge:dB,selection:SB,transition:PB,call:Zn.call,nodes:Zn.nodes,node:Zn.node,size:Zn.size,empty:Zn.empty,each:Zn.each,on:gB,attr:XM,attrTween:tB,style:TB,styleTween:MB,text:$B,textTween:IB,remove:yB,tween:WM,delay:nB,duration:aB,ease:lB,easeVarying:uB,end:DB,[Symbol.iterator]:Zn[Symbol.iterator]};function zB(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var jB={time:null,delay:0,duration:250,ease:zB};function NB(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function WB(e){var t,r;e instanceof ni?(t=e._id,e=e._name):(t=N1(),(r=jB).time=Rp(),e=e==null?null:e+"");for(var n=this._groups,s=n.length,o=0;o<s;++o)for(var c=n[o],l=c.length,h,d=0;d<l;++d)(h=c[d])&&Ou(h,e,t,d,c,r||NB(h,t));return new ni(n,this._parents,e,t)}el.prototype.interrupt=zM;el.prototype.transition=WB;const Mf=Math.PI,Bf=2*Mf,is=1e-6,HB=Bf-is;function W1(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function qB(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return W1;const r=10**t;return function(n){this._+=n[0];for(let s=1,o=n.length;s<o;++s)this._+=Math.round(arguments[s]*r)/r+n[s]}}class UB{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?W1:qB(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,s){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+s}`}bezierCurveTo(t,r,n,s,o,c){this._append`C${+t},${+r},${+n},${+s},${this._x1=+o},${this._y1=+c}`}arcTo(t,r,n,s,o){if(t=+t,r=+r,n=+n,s=+s,o=+o,o<0)throw new Error(`negative radius: ${o}`);let c=this._x1,l=this._y1,h=n-t,d=s-r,f=c-t,g=l-r,m=f*f+g*g;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(m>is)if(!(Math.abs(g*h-d*f)>is)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let y=n-c,v=s-l,b=h*h+d*d,k=y*y+v*v,T=Math.sqrt(b),_=Math.sqrt(m),B=o*Math.tan((Mf-Math.acos((b+m-k)/(2*T*_)))/2),L=B/_,A=B/T;Math.abs(L-1)>is&&this._append`L${t+L*f},${r+L*g}`,this._append`A${o},${o},0,0,${+(g*y>f*v)},${this._x1=t+A*h},${this._y1=r+A*d}`}}arc(t,r,n,s,o,c){if(t=+t,r=+r,n=+n,c=!!c,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(s),h=n*Math.sin(s),d=t+l,f=r+h,g=1^c,m=c?s-o:o-s;this._x1===null?this._append`M${d},${f}`:(Math.abs(this._x1-d)>is||Math.abs(this._y1-f)>is)&&this._append`L${d},${f}`,n&&(m<0&&(m=m%Bf+Bf),m>HB?this._append`A${n},${n},0,1,${g},${t-l},${r-h}A${n},${n},0,1,${g},${this._x1=d},${this._y1=f}`:m>is&&this._append`A${n},${n},0,${+(m>=Mf)},${g},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+s}h${-n}Z`}toString(){return this._}}function Ks(e){return function(){return e}}const KO=Math.abs,ZO=Math.atan2,JO=Math.cos,t6=Math.max,e6=Math.min,r6=Math.sin,n6=Math.sqrt,F0=1e-12,Pp=Math.PI,I0=Pp/2,i6=2*Pp;function s6(e){return e>1?0:e<-1?Pp:Math.acos(e)}function a6(e){return e>=1?I0:e<=-1?-I0:Math.asin(e)}function GB(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new UB(t)}function VB(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function H1(e){this._context=e}H1.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 ou(e){return new H1(e)}function YB(e){return e[0]}function XB(e){return e[1]}function QB(e,t){var r=Ks(!0),n=null,s=ou,o=null,c=GB(l);e=typeof e=="function"?e:e===void 0?YB:Ks(e),t=typeof t=="function"?t:t===void 0?XB:Ks(t);function l(h){var d,f=(h=VB(h)).length,g,m=!1,y;for(n==null&&(o=s(y=c())),d=0;d<=f;++d)!(d<f&&r(g=h[d],d,h))===m&&((m=!m)?o.lineStart():o.lineEnd()),m&&o.point(+e(g,d,h),+t(g,d,h));if(y)return o=null,y+""||null}return l.x=function(h){return arguments.length?(e=typeof h=="function"?h:Ks(+h),l):e},l.y=function(h){return arguments.length?(t=typeof h=="function"?h:Ks(+h),l):t},l.defined=function(h){return arguments.length?(r=typeof h=="function"?h:Ks(!!h),l):r},l.curve=function(h){return arguments.length?(s=h,n!=null&&(o=s(n)),l):s},l.context=function(h){return arguments.length?(h==null?n=o=null:o=s(n=h),l):n},l}class q1{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function U1(e){return new q1(e,!0)}function G1(e){return new q1(e,!1)}function Ri(){}function lu(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function zu(e){this._context=e}zu.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:lu(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:lu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zc(e){return new zu(e)}function V1(e){this._context=e}V1.prototype={areaStart:Ri,areaEnd:Ri,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:lu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function KB(e){return new V1(e)}function Y1(e){this._context=e}Y1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:lu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ZB(e){return new Y1(e)}function X1(e,t){this._basis=new zu(e),this._beta=t}X1.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],s=t[0],o=e[r]-n,c=t[r]-s,l=-1,h;++l<=r;)h=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(n+h*o),this._beta*t[l]+(1-this._beta)*(s+h*c));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const JB=(function e(t){function r(n){return t===1?new zu(n):new X1(n,t)}return r.beta=function(n){return e(+n)},r})(.85);function cu(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Dp(e,t){this._context=e,this._k=(1-t)/6}Dp.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:cu(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:cu(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 Q1=(function e(t){function r(n){return new Dp(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Op(e,t){this._context=e,this._k=(1-t)/6}Op.prototype={areaStart:Ri,areaEnd:Ri,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:cu(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 tA=(function e(t){function r(n){return new Op(n,t)}return r.tension=function(n){return e(+n)},r})(0);function zp(e,t){this._context=e,this._k=(1-t)/6}zp.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:cu(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 eA=(function e(t){function r(n){return new zp(n,t)}return r.tension=function(n){return e(+n)},r})(0);function jp(e,t,r){var n=e._x1,s=e._y1,o=e._x2,c=e._y2;if(e._l01_a>F0){var l=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,h=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*l-e._x0*e._l12_2a+e._x2*e._l01_2a)/h,s=(s*l-e._y0*e._l12_2a+e._y2*e._l01_2a)/h}if(e._l23_a>F0){var d=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,f=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*d+e._x1*e._l23_2a-t*e._l12_2a)/f,c=(c*d+e._y1*e._l23_2a-r*e._l12_2a)/f}e._context.bezierCurveTo(n,s,o,c,e._x2,e._y2)}function K1(e,t){this._context=e,this._alpha=t}K1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:jp(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 Z1=(function e(t){function r(n){return t?new K1(n,t):new Dp(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function J1(e,t){this._context=e,this._alpha=t}J1.prototype={areaStart:Ri,areaEnd:Ri,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:jp(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 rA=(function e(t){function r(n){return t?new J1(n,t):new Op(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function tv(e,t){this._context=e,this._alpha=t}tv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,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:jp(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 nA=(function e(t){function r(n){return t?new tv(n,t):new zp(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function ev(e){this._context=e}ev.prototype={areaStart:Ri,areaEnd:Ri,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 iA(e){return new ev(e)}function P0(e){return e<0?-1:1}function D0(e,t,r){var n=e._x1-e._x0,s=t-e._x1,o=(e._y1-e._y0)/(n||s<0&&-0),c=(r-e._y1)/(s||n<0&&-0),l=(o*s+c*n)/(n+s);return(P0(o)+P0(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(l))||0}function O0(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Qd(e,t,r){var n=e._x0,s=e._y0,o=e._x1,c=e._y1,l=(o-n)/3;e._context.bezierCurveTo(n+l,s+l*t,o-l,c-l*r,o,c)}function uu(e){this._context=e}uu.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:Qd(this,this._t0,O0(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Qd(this,O0(this,r=D0(this,e,t)),r);break;default:Qd(this,this._t0,r=D0(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function rv(e){this._context=new nv(e)}(rv.prototype=Object.create(uu.prototype)).point=function(e,t){uu.prototype.point.call(this,t,e)};function nv(e){this._context=e}nv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,s,o){this._context.bezierCurveTo(t,e,n,r,o,s)}};function iv(e){return new uu(e)}function sv(e){return new rv(e)}function av(e){this._context=e}av.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=z0(e),s=z0(t),o=0,c=1;c<r;++o,++c)this._context.bezierCurveTo(n[0][o],s[0][o],n[1][o],s[1][o],e[c],t[c]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function z0(e){var t,r=e.length-1,n,s=new Array(r),o=new Array(r),c=new Array(r);for(s[0]=0,o[0]=2,c[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,o[t]=4,c[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,o[r-1]=7,c[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=s[t]/o[t-1],o[t]-=n,c[t]-=n*c[t-1];for(s[r-1]=c[r-1]/o[r-1],t=r-2;t>=0;--t)s[t]=(c[t]-s[t+1])/o[t];for(o[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-s[t+1];return[s,o]}function ov(e){return new av(e)}function ju(e,t){this._context=e,this._t=t}ju.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function lv(e){return new ju(e,.5)}function cv(e){return new ju(e,0)}function uv(e){return new ju(e,1)}function Lo(e,t,r){this.k=e,this.x=t,this.y=r}Lo.prototype={constructor:Lo,scale:function(e){return e===1?this:new Lo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Lo(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+")"}};Lo.prototype;var sA=w(e=>{var s;const{securityLevel:t}=Jt();let r=Gt("body");if(t==="sandbox"){const c=((s=Gt(`#i${e}`).node())==null?void 0:s.contentDocument)??document;r=Gt(c.body)}return r.select(`#${e}`)},"selectSvgElement");function Np(e){return typeof e>"u"||e===null}w(Np,"isNothing");function hv(e){return typeof e=="object"&&e!==null}w(hv,"isObject");function dv(e){return Array.isArray(e)?e:Np(e)?[]:[e]}w(dv,"toArray");function fv(e,t){var r,n,s,o;if(t)for(o=Object.keys(t),r=0,n=o.length;r<n;r+=1)s=o[r],e[s]=t[s];return e}w(fv,"extend");function pv(e,t){var r="",n;for(n=0;n<t;n+=1)r+=e;return r}w(pv,"repeat");function gv(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}w(gv,"isNegativeZero");var aA=Np,oA=hv,lA=dv,cA=pv,uA=gv,hA=fv,Ee={isNothing:aA,isObject:oA,toArray:lA,repeat:cA,isNegativeZero:uA,extend:hA};function Wp(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
180
+
181
+ `+e.mark.snippet),n+" "+r):n}w(Wp,"formatError");function ya(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Wp(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}w(ya,"YAMLException$1");ya.prototype=Object.create(Error.prototype);ya.prototype.constructor=ya;ya.prototype.toString=w(function(t){return this.name+": "+Wp(this,t)},"toString");var Cr=ya;function jc(e,t,r,n,s){var o="",c="",l=Math.floor(s/2)-1;return n-t>l&&(o=" ... ",t=n-l+o.length),r-n>l&&(c=" ...",r=n+l-c.length),{str:o+e.slice(t,r).replace(/\t/g,"→")+c,pos:n-t+o.length}}w(jc,"getLine");function Nc(e,t){return Ee.repeat(" ",t-e.length)+e}w(Nc,"padStart");function mv(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],s=[],o,c=-1;o=r.exec(e.buffer);)s.push(o.index),n.push(o.index+o[0].length),e.position<=o.index&&c<0&&(c=n.length-2);c<0&&(c=n.length-1);var l="",h,d,f=Math.min(e.line+t.linesAfter,s.length).toString().length,g=t.maxLength-(t.indent+f+3);for(h=1;h<=t.linesBefore&&!(c-h<0);h++)d=jc(e.buffer,n[c-h],s[c-h],e.position-(n[c]-n[c-h]),g),l=Ee.repeat(" ",t.indent)+Nc((e.line-h+1).toString(),f)+" | "+d.str+`
182
+ `+l;for(d=jc(e.buffer,n[c],s[c],e.position,g),l+=Ee.repeat(" ",t.indent)+Nc((e.line+1).toString(),f)+" | "+d.str+`
183
+ `,l+=Ee.repeat("-",t.indent+f+3+d.pos)+`^
184
+ `,h=1;h<=t.linesAfter&&!(c+h>=s.length);h++)d=jc(e.buffer,n[c+h],s[c+h],e.position-(n[c]-n[c+h]),g),l+=Ee.repeat(" ",t.indent)+Nc((e.line+h+1).toString(),f)+" | "+d.str+`
185
+ `;return l.replace(/\n$/,"")}w(mv,"makeSnippet");var dA=mv,fA=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],pA=["scalar","sequence","mapping"];function yv(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(n){t[String(n)]=r})}),t}w(yv,"compileStyleAliases");function xv(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(fA.indexOf(r)===-1)throw new Cr('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=yv(t.styleAliases||null),pA.indexOf(this.kind)===-1)throw new Cr('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}w(xv,"Type$1");var Qe=xv;function Af(e,t){var r=[];return e[t].forEach(function(n){var s=r.length;r.forEach(function(o,c){o.tag===n.tag&&o.kind===n.kind&&o.multi===n.multi&&(s=c)}),r[s]=n}),r}w(Af,"compileList");function vv(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function n(s){s.multi?(e.multi[s.kind].push(s),e.multi.fallback.push(s)):e[s.kind][s.tag]=e.fallback[s.tag]=s}for(w(n,"collectType"),t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(n);return e}w(vv,"compileMap");function hu(e){return this.extend(e)}w(hu,"Schema$1");hu.prototype.extend=w(function(t){var r=[],n=[];if(t instanceof Qe)n.push(t);else if(Array.isArray(t))n=n.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(r=r.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit));else throw new Cr("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(o){if(!(o instanceof Qe))throw new Cr("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Cr("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Cr("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(o){if(!(o instanceof Qe))throw new Cr("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var s=Object.create(hu.prototype);return s.implicit=(this.implicit||[]).concat(r),s.explicit=(this.explicit||[]).concat(n),s.compiledImplicit=Af(s,"implicit"),s.compiledExplicit=Af(s,"explicit"),s.compiledTypeMap=vv(s.compiledImplicit,s.compiledExplicit),s},"extend");var gA=hu,mA=new Qe("tag:yaml.org,2002:str",{kind:"scalar",construct:w(function(e){return e!==null?e:""},"construct")}),yA=new Qe("tag:yaml.org,2002:seq",{kind:"sequence",construct:w(function(e){return e!==null?e:[]},"construct")}),xA=new Qe("tag:yaml.org,2002:map",{kind:"mapping",construct:w(function(e){return e!==null?e:{}},"construct")}),vA=new gA({explicit:[mA,yA,xA]});function bv(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}w(bv,"resolveYamlNull");function Sv(){return null}w(Sv,"constructYamlNull");function Cv(e){return e===null}w(Cv,"isNull");var bA=new Qe("tag:yaml.org,2002:null",{kind:"scalar",resolve:bv,construct:Sv,predicate:Cv,represent:{canonical:w(function(){return"~"},"canonical"),lowercase:w(function(){return"null"},"lowercase"),uppercase:w(function(){return"NULL"},"uppercase"),camelcase:w(function(){return"Null"},"camelcase"),empty:w(function(){return""},"empty")},defaultStyle:"lowercase"});function wv(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}w(wv,"resolveYamlBoolean");function kv(e){return e==="true"||e==="True"||e==="TRUE"}w(kv,"constructYamlBoolean");function _v(e){return Object.prototype.toString.call(e)==="[object Boolean]"}w(_v,"isBoolean");var SA=new Qe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:wv,construct:kv,predicate:_v,represent:{lowercase:w(function(e){return e?"true":"false"},"lowercase"),uppercase:w(function(e){return e?"TRUE":"FALSE"},"uppercase"),camelcase:w(function(e){return e?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function Tv(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}w(Tv,"isHexCode");function Ev(e){return 48<=e&&e<=55}w(Ev,"isOctCode");function Lv(e){return 48<=e&&e<=57}w(Lv,"isDecCode");function Mv(e){if(e===null)return!1;var t=e.length,r=0,n=!1,s;if(!t)return!1;if(s=e[r],(s==="-"||s==="+")&&(s=e[++r]),s==="0"){if(r+1===t)return!0;if(s=e[++r],s==="b"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(s!=="0"&&s!=="1")return!1;n=!0}return n&&s!=="_"}if(s==="x"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!Tv(e.charCodeAt(r)))return!1;n=!0}return n&&s!=="_"}if(s==="o"){for(r++;r<t;r++)if(s=e[r],s!=="_"){if(!Ev(e.charCodeAt(r)))return!1;n=!0}return n&&s!=="_"}}if(s==="_")return!1;for(;r<t;r++)if(s=e[r],s!=="_"){if(!Lv(e.charCodeAt(r)))return!1;n=!0}return!(!n||s==="_")}w(Mv,"resolveYamlInteger");function Bv(e){var t=e,r=1,n;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),n=t[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),t=t.slice(1),n=t[0]),t==="0")return 0;if(n==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}w(Bv,"constructYamlInteger");function Av(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ee.isNegativeZero(e)}w(Av,"isInteger");var CA=new Qe("tag:yaml.org,2002:int",{kind:"scalar",resolve:Mv,construct:Bv,predicate:Av,represent:{binary:w(function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},"binary"),octal:w(function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},"octal"),decimal:w(function(e){return e.toString(10)},"decimal"),hexadecimal:w(function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),wA=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function $v(e){return!(e===null||!wA.test(e)||e[e.length-1]==="_")}w($v,"resolveYamlFloat");function Rv(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}w(Rv,"constructYamlFloat");var kA=/^[-+]?[0-9]+e/;function Fv(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ee.isNegativeZero(e))return"-0.0";return r=e.toString(10),kA.test(r)?r.replace("e",".e"):r}w(Fv,"representYamlFloat");function Iv(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ee.isNegativeZero(e))}w(Iv,"isFloat");var _A=new Qe("tag:yaml.org,2002:float",{kind:"scalar",resolve:$v,construct:Rv,predicate:Iv,represent:Fv,defaultStyle:"lowercase"}),Pv=vA.extend({implicit:[bA,SA,CA,_A]}),TA=Pv,Dv=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ov=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function zv(e){return e===null?!1:Dv.exec(e)!==null||Ov.exec(e)!==null}w(zv,"resolveYamlTimestamp");function jv(e){var t,r,n,s,o,c,l,h=0,d=null,f,g,m;if(t=Dv.exec(e),t===null&&(t=Ov.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,s=+t[3],!t[4])return new Date(Date.UTC(r,n,s));if(o=+t[4],c=+t[5],l=+t[6],t[7]){for(h=t[7].slice(0,3);h.length<3;)h+="0";h=+h}return t[9]&&(f=+t[10],g=+(t[11]||0),d=(f*60+g)*6e4,t[9]==="-"&&(d=-d)),m=new Date(Date.UTC(r,n,s,o,c,l,h)),d&&m.setTime(m.getTime()-d),m}w(jv,"constructYamlTimestamp");function Nv(e){return e.toISOString()}w(Nv,"representYamlTimestamp");var EA=new Qe("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:zv,construct:jv,instanceOf:Date,represent:Nv});function Wv(e){return e==="<<"||e===null}w(Wv,"resolveYamlMerge");var LA=new Qe("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Wv}),Hp=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
186
+ \r`;function Hv(e){if(e===null)return!1;var t,r,n=0,s=e.length,o=Hp;for(r=0;r<s;r++)if(t=o.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;n+=6}return n%8===0}w(Hv,"resolveYamlBinary");function qv(e){var t,r,n=e.replace(/[\r\n=]/g,""),s=n.length,o=Hp,c=0,l=[];for(t=0;t<s;t++)t%4===0&&t&&(l.push(c>>16&255),l.push(c>>8&255),l.push(c&255)),c=c<<6|o.indexOf(n.charAt(t));return r=s%4*6,r===0?(l.push(c>>16&255),l.push(c>>8&255),l.push(c&255)):r===18?(l.push(c>>10&255),l.push(c>>2&255)):r===12&&l.push(c>>4&255),new Uint8Array(l)}w(qv,"constructYamlBinary");function Uv(e){var t="",r=0,n,s,o=e.length,c=Hp;for(n=0;n<o;n++)n%3===0&&n&&(t+=c[r>>18&63],t+=c[r>>12&63],t+=c[r>>6&63],t+=c[r&63]),r=(r<<8)+e[n];return s=o%3,s===0?(t+=c[r>>18&63],t+=c[r>>12&63],t+=c[r>>6&63],t+=c[r&63]):s===2?(t+=c[r>>10&63],t+=c[r>>4&63],t+=c[r<<2&63],t+=c[64]):s===1&&(t+=c[r>>2&63],t+=c[r<<4&63],t+=c[64],t+=c[64]),t}w(Uv,"representYamlBinary");function Gv(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}w(Gv,"isBinary");var MA=new Qe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Hv,construct:qv,predicate:Gv,represent:Uv}),BA=Object.prototype.hasOwnProperty,AA=Object.prototype.toString;function Vv(e){if(e===null)return!0;var t=[],r,n,s,o,c,l=e;for(r=0,n=l.length;r<n;r+=1){if(s=l[r],c=!1,AA.call(s)!=="[object Object]")return!1;for(o in s)if(BA.call(s,o))if(!c)c=!0;else return!1;if(!c)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}w(Vv,"resolveYamlOmap");function Yv(e){return e!==null?e:[]}w(Yv,"constructYamlOmap");var $A=new Qe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Vv,construct:Yv}),RA=Object.prototype.toString;function Xv(e){if(e===null)return!0;var t,r,n,s,o,c=e;for(o=new Array(c.length),t=0,r=c.length;t<r;t+=1){if(n=c[t],RA.call(n)!=="[object Object]"||(s=Object.keys(n),s.length!==1))return!1;o[t]=[s[0],n[s[0]]]}return!0}w(Xv,"resolveYamlPairs");function Qv(e){if(e===null)return[];var t,r,n,s,o,c=e;for(o=new Array(c.length),t=0,r=c.length;t<r;t+=1)n=c[t],s=Object.keys(n),o[t]=[s[0],n[s[0]]];return o}w(Qv,"constructYamlPairs");var FA=new Qe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Xv,construct:Qv}),IA=Object.prototype.hasOwnProperty;function Kv(e){if(e===null)return!0;var t,r=e;for(t in r)if(IA.call(r,t)&&r[t]!==null)return!1;return!0}w(Kv,"resolveYamlSet");function Zv(e){return e!==null?e:{}}w(Zv,"constructYamlSet");var PA=new Qe("tag:yaml.org,2002:set",{kind:"mapping",resolve:Kv,construct:Zv}),Jv=TA.extend({implicit:[EA,LA],explicit:[MA,$A,FA,PA]}),Fi=Object.prototype.hasOwnProperty,du=1,tb=2,eb=3,fu=4,Kd=1,DA=2,j0=3,OA=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,zA=/[\x85\u2028\u2029]/,jA=/[,\[\]\{\}]/,rb=/^(?:!|!!|![a-z\-]+!)$/i,nb=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function $f(e){return Object.prototype.toString.call(e)}w($f,"_class");function Sn(e){return e===10||e===13}w(Sn,"is_EOL");function Ai(e){return e===9||e===32}w(Ai,"is_WHITE_SPACE");function sr(e){return e===9||e===32||e===10||e===13}w(sr,"is_WS_OR_EOL");function cs(e){return e===44||e===91||e===93||e===123||e===125}w(cs,"is_FLOW_INDICATOR");function ib(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}w(ib,"fromHexCode");function sb(e){return e===120?2:e===117?4:e===85?8:0}w(sb,"escapedHexLen");function ab(e){return 48<=e&&e<=57?e-48:-1}w(ab,"fromDecimalCode");function Rf(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
187
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}w(Rf,"simpleEscapeSequence");function ob(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}w(ob,"charFromCodepoint");var lb=new Array(256),cb=new Array(256);for(ns=0;ns<256;ns++)lb[ns]=Rf(ns)?1:0,cb[ns]=Rf(ns);var ns;function ub(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Jv,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}w(ub,"State$1");function qp(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=dA(r),new Cr(t,r)}w(qp,"generateError");function At(e,t){throw qp(e,t)}w(At,"throwError");function Ho(e,t){e.onWarning&&e.onWarning.call(null,qp(e,t))}w(Ho,"throwWarning");var N0={YAML:w(function(t,r,n){var s,o,c;t.version!==null&&At(t,"duplication of %YAML directive"),n.length!==1&&At(t,"YAML directive accepts exactly one argument"),s=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),s===null&&At(t,"ill-formed argument of the YAML directive"),o=parseInt(s[1],10),c=parseInt(s[2],10),o!==1&&At(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=c<2,c!==1&&c!==2&&Ho(t,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:w(function(t,r,n){var s,o;n.length!==2&&At(t,"TAG directive accepts exactly two arguments"),s=n[0],o=n[1],rb.test(s)||At(t,"ill-formed tag handle (first argument) of the TAG directive"),Fi.call(t.tagMap,s)&&At(t,'there is a previously declared suffix for "'+s+'" tag handle'),nb.test(o)||At(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{At(t,"tag prefix is malformed: "+o)}t.tagMap[s]=o},"handleTagDirective")};function ri(e,t,r,n){var s,o,c,l;if(t<r){if(l=e.input.slice(t,r),n)for(s=0,o=l.length;s<o;s+=1)c=l.charCodeAt(s),c===9||32<=c&&c<=1114111||At(e,"expected valid JSON character");else OA.test(l)&&At(e,"the stream contains non-printable characters");e.result+=l}}w(ri,"captureSegment");function Ff(e,t,r,n){var s,o,c,l;for(Ee.isObject(r)||At(e,"cannot merge mappings; the provided source object is unacceptable"),s=Object.keys(r),c=0,l=s.length;c<l;c+=1)o=s[c],Fi.call(t,o)||(t[o]=r[o],n[o]=!0)}w(Ff,"mergeMappings");function us(e,t,r,n,s,o,c,l,h){var d,f;if(Array.isArray(s))for(s=Array.prototype.slice.call(s),d=0,f=s.length;d<f;d+=1)Array.isArray(s[d])&&At(e,"nested arrays are not supported inside keys"),typeof s=="object"&&$f(s[d])==="[object Object]"&&(s[d]="[object Object]");if(typeof s=="object"&&$f(s)==="[object Object]"&&(s="[object Object]"),s=String(s),t===null&&(t={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(d=0,f=o.length;d<f;d+=1)Ff(e,t,o[d],r);else Ff(e,t,o,r);else!e.json&&!Fi.call(r,s)&&Fi.call(t,s)&&(e.line=c||e.line,e.lineStart=l||e.lineStart,e.position=h||e.position,At(e,"duplicated mapping key")),s==="__proto__"?Object.defineProperty(t,s,{configurable:!0,enumerable:!0,writable:!0,value:o}):t[s]=o,delete r[s];return t}w(us,"storeMappingPair");function Nu(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):At(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}w(Nu,"readLineBreak");function ve(e,t,r){for(var n=0,s=e.input.charCodeAt(e.position);s!==0;){for(;Ai(s);)s===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),s=e.input.charCodeAt(++e.position);if(t&&s===35)do s=e.input.charCodeAt(++e.position);while(s!==10&&s!==13&&s!==0);if(Sn(s))for(Nu(e),s=e.input.charCodeAt(e.position),n++,e.lineIndent=0;s===32;)e.lineIndent++,s=e.input.charCodeAt(++e.position);else break}return r!==-1&&n!==0&&e.lineIndent<r&&Ho(e,"deficient indentation"),n}w(ve,"skipSeparationSpace");function nl(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||sr(r)))}w(nl,"testDocumentSeparator");function Wu(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ee.repeat(`
188
+ `,t-1))}w(Wu,"writeFoldedLines");function hb(e,t,r){var n,s,o,c,l,h,d,f,g=e.kind,m=e.result,y;if(y=e.input.charCodeAt(e.position),sr(y)||cs(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(s=e.input.charCodeAt(e.position+1),sr(s)||r&&cs(s)))return!1;for(e.kind="scalar",e.result="",o=c=e.position,l=!1;y!==0;){if(y===58){if(s=e.input.charCodeAt(e.position+1),sr(s)||r&&cs(s))break}else if(y===35){if(n=e.input.charCodeAt(e.position-1),sr(n))break}else{if(e.position===e.lineStart&&nl(e)||r&&cs(y))break;if(Sn(y))if(h=e.line,d=e.lineStart,f=e.lineIndent,ve(e,!1,-1),e.lineIndent>=t){l=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=c,e.line=h,e.lineStart=d,e.lineIndent=f;break}}l&&(ri(e,o,c,!1),Wu(e,e.line-h),o=c=e.position,l=!1),Ai(y)||(c=e.position+1),y=e.input.charCodeAt(++e.position)}return ri(e,o,c,!1),e.result?!0:(e.kind=g,e.result=m,!1)}w(hb,"readPlainScalar");function db(e,t){var r,n,s;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,n=s=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(ri(e,n,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)n=e.position,e.position++,s=e.position;else return!0;else Sn(r)?(ri(e,n,s,!0),Wu(e,ve(e,!1,t)),n=s=e.position):e.position===e.lineStart&&nl(e)?At(e,"unexpected end of the document within a single quoted scalar"):(e.position++,s=e.position);At(e,"unexpected end of the stream within a single quoted scalar")}w(db,"readSingleQuotedScalar");function fb(e,t){var r,n,s,o,c,l;if(l=e.input.charCodeAt(e.position),l!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;(l=e.input.charCodeAt(e.position))!==0;){if(l===34)return ri(e,r,e.position,!0),e.position++,!0;if(l===92){if(ri(e,r,e.position,!0),l=e.input.charCodeAt(++e.position),Sn(l))ve(e,!1,t);else if(l<256&&lb[l])e.result+=cb[l],e.position++;else if((c=sb(l))>0){for(s=c,o=0;s>0;s--)l=e.input.charCodeAt(++e.position),(c=ib(l))>=0?o=(o<<4)+c:At(e,"expected hexadecimal character");e.result+=ob(o),e.position++}else At(e,"unknown escape sequence");r=n=e.position}else Sn(l)?(ri(e,r,n,!0),Wu(e,ve(e,!1,t)),r=n=e.position):e.position===e.lineStart&&nl(e)?At(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}At(e,"unexpected end of the stream within a double quoted scalar")}w(fb,"readDoubleQuotedScalar");function pb(e,t){var r=!0,n,s,o,c=e.tag,l,h=e.anchor,d,f,g,m,y,v=Object.create(null),b,k,T,_;if(_=e.input.charCodeAt(e.position),_===91)f=93,y=!1,l=[];else if(_===123)f=125,y=!0,l={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),_=e.input.charCodeAt(++e.position);_!==0;){if(ve(e,!0,t),_=e.input.charCodeAt(e.position),_===f)return e.position++,e.tag=c,e.anchor=h,e.kind=y?"mapping":"sequence",e.result=l,!0;r?_===44&&At(e,"expected the node content, but found ','"):At(e,"missed comma between flow collection entries"),k=b=T=null,g=m=!1,_===63&&(d=e.input.charCodeAt(e.position+1),sr(d)&&(g=m=!0,e.position++,ve(e,!0,t))),n=e.line,s=e.lineStart,o=e.position,xs(e,t,du,!1,!0),k=e.tag,b=e.result,ve(e,!0,t),_=e.input.charCodeAt(e.position),(m||e.line===n)&&_===58&&(g=!0,_=e.input.charCodeAt(++e.position),ve(e,!0,t),xs(e,t,du,!1,!0),T=e.result),y?us(e,l,v,k,b,T,n,s,o):g?l.push(us(e,null,v,k,b,T,n,s,o)):l.push(b),ve(e,!0,t),_=e.input.charCodeAt(e.position),_===44?(r=!0,_=e.input.charCodeAt(++e.position)):r=!1}At(e,"unexpected end of the stream within a flow collection")}w(pb,"readFlowCollection");function gb(e,t){var r,n,s=Kd,o=!1,c=!1,l=t,h=0,d=!1,f,g;if(g=e.input.charCodeAt(e.position),g===124)n=!1;else if(g===62)n=!0;else return!1;for(e.kind="scalar",e.result="";g!==0;)if(g=e.input.charCodeAt(++e.position),g===43||g===45)Kd===s?s=g===43?j0:DA:At(e,"repeat of a chomping mode identifier");else if((f=ab(g))>=0)f===0?At(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?At(e,"repeat of an indentation width identifier"):(l=t+f-1,c=!0);else break;if(Ai(g)){do g=e.input.charCodeAt(++e.position);while(Ai(g));if(g===35)do g=e.input.charCodeAt(++e.position);while(!Sn(g)&&g!==0)}for(;g!==0;){for(Nu(e),e.lineIndent=0,g=e.input.charCodeAt(e.position);(!c||e.lineIndent<l)&&g===32;)e.lineIndent++,g=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>l&&(l=e.lineIndent),Sn(g)){h++;continue}if(e.lineIndent<l){s===j0?e.result+=Ee.repeat(`
189
+ `,o?1+h:h):s===Kd&&o&&(e.result+=`
190
+ `);break}for(n?Ai(g)?(d=!0,e.result+=Ee.repeat(`
191
+ `,o?1+h:h)):d?(d=!1,e.result+=Ee.repeat(`
192
+ `,h+1)):h===0?o&&(e.result+=" "):e.result+=Ee.repeat(`
193
+ `,h):e.result+=Ee.repeat(`
194
+ `,o?1+h:h),o=!0,c=!0,h=0,r=e.position;!Sn(g)&&g!==0;)g=e.input.charCodeAt(++e.position);ri(e,r,e.position,!1)}return!0}w(gb,"readBlockScalar");function If(e,t){var r,n=e.tag,s=e.anchor,o=[],c,l=!1,h;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),h=e.input.charCodeAt(e.position);h!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,At(e,"tab characters must not be used in indentation")),!(h!==45||(c=e.input.charCodeAt(e.position+1),!sr(c))));){if(l=!0,e.position++,ve(e,!0,-1)&&e.lineIndent<=t){o.push(null),h=e.input.charCodeAt(e.position);continue}if(r=e.line,xs(e,t,eb,!1,!0),o.push(e.result),ve(e,!0,-1),h=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&h!==0)At(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return l?(e.tag=n,e.anchor=s,e.kind="sequence",e.result=o,!0):!1}w(If,"readBlockSequence");function mb(e,t,r){var n,s,o,c,l,h,d=e.tag,f=e.anchor,g={},m=Object.create(null),y=null,v=null,b=null,k=!1,T=!1,_;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=g),_=e.input.charCodeAt(e.position);_!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,At(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),o=e.line,(_===63||_===58)&&sr(n))_===63?(k&&(us(e,g,m,y,v,null,c,l,h),y=v=b=null),T=!0,k=!0,s=!0):k?(k=!1,s=!0):At(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,_=n;else{if(c=e.line,l=e.lineStart,h=e.position,!xs(e,r,tb,!1,!0))break;if(e.line===o){for(_=e.input.charCodeAt(e.position);Ai(_);)_=e.input.charCodeAt(++e.position);if(_===58)_=e.input.charCodeAt(++e.position),sr(_)||At(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(us(e,g,m,y,v,null,c,l,h),y=v=b=null),T=!0,k=!1,s=!1,y=e.tag,v=e.result;else if(T)At(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=f,!0}else if(T)At(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=f,!0}if((e.line===o||e.lineIndent>t)&&(k&&(c=e.line,l=e.lineStart,h=e.position),xs(e,t,fu,!0,s)&&(k?v=e.result:b=e.result),k||(us(e,g,m,y,v,b,c,l,h),y=v=b=null),ve(e,!0,-1),_=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&_!==0)At(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&us(e,g,m,y,v,null,c,l,h),T&&(e.tag=d,e.anchor=f,e.kind="mapping",e.result=g),T}w(mb,"readBlockMapping");function yb(e){var t,r=!1,n=!1,s,o,c;if(c=e.input.charCodeAt(e.position),c!==33)return!1;if(e.tag!==null&&At(e,"duplication of a tag property"),c=e.input.charCodeAt(++e.position),c===60?(r=!0,c=e.input.charCodeAt(++e.position)):c===33?(n=!0,s="!!",c=e.input.charCodeAt(++e.position)):s="!",t=e.position,r){do c=e.input.charCodeAt(++e.position);while(c!==0&&c!==62);e.position<e.length?(o=e.input.slice(t,e.position),c=e.input.charCodeAt(++e.position)):At(e,"unexpected end of the stream within a verbatim tag")}else{for(;c!==0&&!sr(c);)c===33&&(n?At(e,"tag suffix cannot contain exclamation marks"):(s=e.input.slice(t-1,e.position+1),rb.test(s)||At(e,"named tag handle cannot contain such characters"),n=!0,t=e.position+1)),c=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),jA.test(o)&&At(e,"tag suffix cannot contain flow indicator characters")}o&&!nb.test(o)&&At(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{At(e,"tag name is malformed: "+o)}return r?e.tag=o:Fi.call(e.tagMap,s)?e.tag=e.tagMap[s]+o:s==="!"?e.tag="!"+o:s==="!!"?e.tag="tag:yaml.org,2002:"+o:At(e,'undeclared tag handle "'+s+'"'),!0}w(yb,"readTagProperty");function xb(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&At(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!sr(r)&&!cs(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&At(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}w(xb,"readAnchorProperty");function vb(e){var t,r,n;if(n=e.input.charCodeAt(e.position),n!==42)return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!sr(n)&&!cs(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&At(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Fi.call(e.anchorMap,r)||At(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],ve(e,!0,-1),!0}w(vb,"readAlias");function xs(e,t,r,n,s){var o,c,l,h=1,d=!1,f=!1,g,m,y,v,b,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=c=l=fu===r||eb===r,n&&ve(e,!0,-1)&&(d=!0,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)),h===1)for(;yb(e)||xb(e);)ve(e,!0,-1)?(d=!0,l=o,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)):l=!1;if(l&&(l=d||s),(h===1||fu===r)&&(du===r||tb===r?b=t:b=t+1,k=e.position-e.lineStart,h===1?l&&(If(e,k)||mb(e,k,b))||pb(e,b)?f=!0:(c&&gb(e,b)||db(e,b)||fb(e,b)?f=!0:vb(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&At(e,"alias node should not have any properties")):hb(e,b,du===r)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):h===0&&(f=l&&If(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&At(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),g=0,m=e.implicitTypes.length;g<m;g+=1)if(v=e.implicitTypes[g],v.resolve(e.result)){e.result=v.construct(e.result),e.tag=v.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Fi.call(e.typeMap[e.kind||"fallback"],e.tag))v=e.typeMap[e.kind||"fallback"][e.tag];else for(v=null,y=e.typeMap.multi[e.kind||"fallback"],g=0,m=y.length;g<m;g+=1)if(e.tag.slice(0,y[g].tag.length)===y[g].tag){v=y[g];break}v||At(e,"unknown tag !<"+e.tag+">"),e.result!==null&&v.kind!==e.kind&&At(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+v.kind+'", not "'+e.kind+'"'),v.resolve(e.result,e.tag)?(e.result=v.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):At(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}w(xs,"composeNode");function bb(e){var t=e.position,r,n,s,o=!1,c;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(c=e.input.charCodeAt(e.position))!==0&&(ve(e,!0,-1),c=e.input.charCodeAt(e.position),!(e.lineIndent>0||c!==37));){for(o=!0,c=e.input.charCodeAt(++e.position),r=e.position;c!==0&&!sr(c);)c=e.input.charCodeAt(++e.position);for(n=e.input.slice(r,e.position),s=[],n.length<1&&At(e,"directive name must not be less than one character in length");c!==0;){for(;Ai(c);)c=e.input.charCodeAt(++e.position);if(c===35){do c=e.input.charCodeAt(++e.position);while(c!==0&&!Sn(c));break}if(Sn(c))break;for(r=e.position;c!==0&&!sr(c);)c=e.input.charCodeAt(++e.position);s.push(e.input.slice(r,e.position))}c!==0&&Nu(e),Fi.call(N0,n)?N0[n](e,n,s):Ho(e,'unknown document directive "'+n+'"')}if(ve(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ve(e,!0,-1)):o&&At(e,"directives end mark is expected"),xs(e,e.lineIndent-1,fu,!1,!0),ve(e,!0,-1),e.checkLineBreaks&&zA.test(e.input.slice(t,e.position))&&Ho(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&nl(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ve(e,!0,-1));return}if(e.position<e.length-1)At(e,"end of the stream or a document separator is expected");else return}w(bb,"readDocument");function Up(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
195
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new ub(e,t),n=e.indexOf("\0");for(n!==-1&&(r.position=n,At(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)bb(r);return r.documents}w(Up,"loadDocuments");function NA(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var n=Up(e,r);if(typeof t!="function")return n;for(var s=0,o=n.length;s<o;s+=1)t(n[s])}w(NA,"loadAll$1");function Sb(e,t){var r=Up(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Cr("expected a single document in the stream, but found more")}}w(Sb,"load$1");var WA=Sb,HA={load:WA},Cb=Object.prototype.toString,wb=Object.prototype.hasOwnProperty,Gp=65279,qA=9,qo=10,UA=13,GA=32,VA=33,YA=34,Pf=35,XA=37,QA=38,KA=39,ZA=42,kb=44,JA=45,pu=58,t3=61,e3=62,r3=63,n3=64,_b=91,Tb=93,i3=96,Eb=123,s3=124,Lb=125,Ze={};Ze[0]="\\0";Ze[7]="\\a";Ze[8]="\\b";Ze[9]="\\t";Ze[10]="\\n";Ze[11]="\\v";Ze[12]="\\f";Ze[13]="\\r";Ze[27]="\\e";Ze[34]='\\"';Ze[92]="\\\\";Ze[133]="\\N";Ze[160]="\\_";Ze[8232]="\\L";Ze[8233]="\\P";var a3=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],o3=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Mb(e,t){var r,n,s,o,c,l,h;if(t===null)return{};for(r={},n=Object.keys(t),s=0,o=n.length;s<o;s+=1)c=n[s],l=String(t[c]),c.slice(0,2)==="!!"&&(c="tag:yaml.org,2002:"+c.slice(2)),h=e.compiledTypeMap.fallback[c],h&&wb.call(h.styleAliases,l)&&(l=h.styleAliases[l]),r[c]=l;return r}w(Mb,"compileStyleMap");function Bb(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else if(e<=4294967295)r="U",n=8;else throw new Cr("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Ee.repeat("0",n-t.length)+t}w(Bb,"encodeHex");var l3=1,Uo=2;function Ab(e){this.schema=e.schema||Jv,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ee.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Mb(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Uo:l3,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}w(Ab,"State");function Df(e,t){for(var r=Ee.repeat(" ",t),n=0,s=-1,o="",c,l=e.length;n<l;)s=e.indexOf(`
196
+ `,n),s===-1?(c=e.slice(n),n=l):(c=e.slice(n,s+1),n=s+1),c.length&&c!==`
197
+ `&&(o+=r),o+=c;return o}w(Df,"indentString");function gu(e,t){return`
198
+ `+Ee.repeat(" ",e.indent*t)}w(gu,"generateNextLine");function $b(e,t){var r,n,s;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(s=e.implicitTypes[r],s.resolve(t))return!0;return!1}w($b,"testImplicitResolving");function Go(e){return e===GA||e===qA}w(Go,"isWhitespace");function xa(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Gp||65536<=e&&e<=1114111}w(xa,"isPrintable");function Of(e){return xa(e)&&e!==Gp&&e!==UA&&e!==qo}w(Of,"isNsCharOrWhitespace");function zf(e,t,r){var n=Of(e),s=n&&!Go(e);return(r?n:n&&e!==kb&&e!==_b&&e!==Tb&&e!==Eb&&e!==Lb)&&e!==Pf&&!(t===pu&&!s)||Of(t)&&!Go(t)&&e===Pf||t===pu&&s}w(zf,"isPlainSafe");function Rb(e){return xa(e)&&e!==Gp&&!Go(e)&&e!==JA&&e!==r3&&e!==pu&&e!==kb&&e!==_b&&e!==Tb&&e!==Eb&&e!==Lb&&e!==Pf&&e!==QA&&e!==ZA&&e!==VA&&e!==s3&&e!==t3&&e!==e3&&e!==KA&&e!==YA&&e!==XA&&e!==n3&&e!==i3}w(Rb,"isPlainSafeFirst");function Fb(e){return!Go(e)&&e!==pu}w(Fb,"isPlainSafeLast");function ea(e,t){var r=e.charCodeAt(t),n;return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}w(ea,"codePointAt");function Vp(e){var t=/^\n* /;return t.test(e)}w(Vp,"needIndentIndicator");var Ib=1,jf=2,Pb=3,Db=4,Js=5;function Ob(e,t,r,n,s,o,c,l){var h,d=0,f=null,g=!1,m=!1,y=n!==-1,v=-1,b=Rb(ea(e,0))&&Fb(ea(e,e.length-1));if(t||c)for(h=0;h<e.length;d>=65536?h+=2:h++){if(d=ea(e,h),!xa(d))return Js;b=b&&zf(d,f,l),f=d}else{for(h=0;h<e.length;d>=65536?h+=2:h++){if(d=ea(e,h),d===qo)g=!0,y&&(m=m||h-v-1>n&&e[v+1]!==" ",v=h);else if(!xa(d))return Js;b=b&&zf(d,f,l),f=d}m=m||y&&h-v-1>n&&e[v+1]!==" "}return!g&&!m?b&&!c&&!s(e)?Ib:o===Uo?Js:jf:r>9&&Vp(e)?Js:c?o===Uo?Js:jf:m?Db:Pb}w(Ob,"chooseScalarStyle");function zb(e,t,r,n,s){e.dump=(function(){if(t.length===0)return e.quotingType===Uo?'""':"''";if(!e.noCompatMode&&(a3.indexOf(t)!==-1||o3.test(t)))return e.quotingType===Uo?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,r),c=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),l=n||e.flowLevel>-1&&r>=e.flowLevel;function h(d){return $b(e,d)}switch(w(h,"testAmbiguity"),Ob(t,l,e.indent,c,h,e.quotingType,e.forceQuotes&&!n,s)){case Ib:return t;case jf:return"'"+t.replace(/'/g,"''")+"'";case Pb:return"|"+Nf(t,e.indent)+Wf(Df(t,o));case Db:return">"+Nf(t,e.indent)+Wf(Df(jb(t,c),o));case Js:return'"'+Nb(t)+'"';default:throw new Cr("impossible error: invalid scalar style")}})()}w(zb,"writeScalar");function Nf(e,t){var r=Vp(e)?String(t):"",n=e[e.length-1]===`
199
+ `,s=n&&(e[e.length-2]===`
200
+ `||e===`
201
+ `),o=s?"+":n?"":"-";return r+o+`
202
+ `}w(Nf,"blockHeader");function Wf(e){return e[e.length-1]===`
203
+ `?e.slice(0,-1):e}w(Wf,"dropEndingNewline");function jb(e,t){for(var r=/(\n+)([^\n]*)/g,n=(function(){var d=e.indexOf(`
204
+ `);return d=d!==-1?d:e.length,r.lastIndex=d,Hf(e.slice(0,d),t)})(),s=e[0]===`
205
+ `||e[0]===" ",o,c;c=r.exec(e);){var l=c[1],h=c[2];o=h[0]===" ",n+=l+(!s&&!o&&h!==""?`
206
+ `:"")+Hf(h,t),s=o}return n}w(jb,"foldString");function Hf(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,n,s=0,o,c=0,l=0,h="";n=r.exec(e);)l=n.index,l-s>t&&(o=c>s?c:l,h+=`
207
+ `+e.slice(s,o),s=o+1),c=l;return h+=`
208
+ `,e.length-s>t&&c>s?h+=e.slice(s,c)+`
209
+ `+e.slice(c+1):h+=e.slice(s),h.slice(1)}w(Hf,"foldLine");function Nb(e){for(var t="",r=0,n,s=0;s<e.length;r>=65536?s+=2:s++)r=ea(e,s),n=Ze[r],!n&&xa(r)?(t+=e[s],r>=65536&&(t+=e[s+1])):t+=n||Bb(r);return t}w(Nb,"escapeString");function Wb(e,t,r){var n="",s=e.tag,o,c,l;for(o=0,c=r.length;o<c;o+=1)l=r[o],e.replacer&&(l=e.replacer.call(r,String(o),l)),(zn(e,t,l,!1,!1)||typeof l>"u"&&zn(e,t,null,!1,!1))&&(n!==""&&(n+=","+(e.condenseFlow?"":" ")),n+=e.dump);e.tag=s,e.dump="["+n+"]"}w(Wb,"writeFlowSequence");function qf(e,t,r,n){var s="",o=e.tag,c,l,h;for(c=0,l=r.length;c<l;c+=1)h=r[c],e.replacer&&(h=e.replacer.call(r,String(c),h)),(zn(e,t+1,h,!0,!0,!1,!0)||typeof h>"u"&&zn(e,t+1,null,!0,!0,!1,!0))&&((!n||s!=="")&&(s+=gu(e,t)),e.dump&&qo===e.dump.charCodeAt(0)?s+="-":s+="- ",s+=e.dump);e.tag=o,e.dump=s||"[]"}w(qf,"writeBlockSequence");function Hb(e,t,r){var n="",s=e.tag,o=Object.keys(r),c,l,h,d,f;for(c=0,l=o.length;c<l;c+=1)f="",n!==""&&(f+=", "),e.condenseFlow&&(f+='"'),h=o[c],d=r[h],e.replacer&&(d=e.replacer.call(r,h,d)),zn(e,t,h,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),zn(e,t,d,!1,!1)&&(f+=e.dump,n+=f));e.tag=s,e.dump="{"+n+"}"}w(Hb,"writeFlowMapping");function qb(e,t,r,n){var s="",o=e.tag,c=Object.keys(r),l,h,d,f,g,m;if(e.sortKeys===!0)c.sort();else if(typeof e.sortKeys=="function")c.sort(e.sortKeys);else if(e.sortKeys)throw new Cr("sortKeys must be a boolean or a function");for(l=0,h=c.length;l<h;l+=1)m="",(!n||s!=="")&&(m+=gu(e,t)),d=c[l],f=r[d],e.replacer&&(f=e.replacer.call(r,d,f)),zn(e,t+1,d,!0,!0,!0)&&(g=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,g&&(e.dump&&qo===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,g&&(m+=gu(e,t)),zn(e,t+1,f,!0,g)&&(e.dump&&qo===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,s+=m));e.tag=o,e.dump=s||"{}"}w(qb,"writeBlockMapping");function Uf(e,t,r){var n,s,o,c,l,h;for(s=r?e.explicitTypes:e.implicitTypes,o=0,c=s.length;o<c;o+=1)if(l=s[o],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof t=="object"&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(r?l.multi&&l.representName?e.tag=l.representName(t):e.tag=l.tag:e.tag="?",l.represent){if(h=e.styleMap[l.tag]||l.defaultStyle,Cb.call(l.represent)==="[object Function]")n=l.represent(t,h);else if(wb.call(l.represent,h))n=l.represent[h](t,h);else throw new Cr("!<"+l.tag+'> tag resolver accepts not "'+h+'" style');e.dump=n}return!0}return!1}w(Uf,"detectType");function zn(e,t,r,n,s,o,c){e.tag=null,e.dump=r,Uf(e,r,!1)||Uf(e,r,!0);var l=Cb.call(e.dump),h=n,d;n&&(n=e.flowLevel<0||e.flowLevel>t);var f=l==="[object Object]"||l==="[object Array]",g,m;if(f&&(g=e.duplicates.indexOf(r),m=g!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&t>0)&&(s=!1),m&&e.usedDuplicates[g])e.dump="*ref_"+g;else{if(f&&m&&!e.usedDuplicates[g]&&(e.usedDuplicates[g]=!0),l==="[object Object]")n&&Object.keys(e.dump).length!==0?(qb(e,t,e.dump,s),m&&(e.dump="&ref_"+g+e.dump)):(Hb(e,t,e.dump),m&&(e.dump="&ref_"+g+" "+e.dump));else if(l==="[object Array]")n&&e.dump.length!==0?(e.noArrayIndent&&!c&&t>0?qf(e,t-1,e.dump,s):qf(e,t,e.dump,s),m&&(e.dump="&ref_"+g+e.dump)):(Wb(e,t,e.dump),m&&(e.dump="&ref_"+g+" "+e.dump));else if(l==="[object String]")e.tag!=="?"&&zb(e,e.dump,t,o,h);else{if(l==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Cr("unacceptable kind of an object to dump "+l)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}w(zn,"writeNode");function Ub(e,t){var r=[],n=[],s,o;for(mu(e,r,n),s=0,o=n.length;s<o;s+=1)t.duplicates.push(r[n[s]]);t.usedDuplicates=new Array(o)}w(Ub,"getDuplicateReferences");function mu(e,t,r){var n,s,o;if(e!==null&&typeof e=="object")if(s=t.indexOf(e),s!==-1)r.indexOf(s)===-1&&r.push(s);else if(t.push(e),Array.isArray(e))for(s=0,o=e.length;s<o;s+=1)mu(e[s],t,r);else for(n=Object.keys(e),s=0,o=n.length;s<o;s+=1)mu(e[n[s]],t,r)}w(mu,"inspectNode");function c3(e,t){t=t||{};var r=new Ab(t);r.noRefs||Ub(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),zn(r,0,n,!0,!0)?r.dump+`
210
+ `:""}w(c3,"dump$1");function u3(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}w(u3,"renamed");var h3=Pv,d3=HA.load;/*! Bundled license information:
211
+
212
+ js-yaml/dist/js-yaml.mjs:
213
+ (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
214
+ */var Ye={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4},W0={arrow_point:9,arrow_cross:12.5,arrow_circle:12.5};function Mo(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=he(e),t=he(t);const[r,n]=[e.x,e.y],[s,o]=[t.x,t.y],c=s-r,l=o-n;return{angle:Math.atan(l/c),deltaX:c,deltaY:l}}w(Mo,"calculateDeltaAndAngle");var he=w(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),f3=w(e=>({x:w(function(t,r,n){let s=0;const o=he(n[0]).x<he(n[n.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Ye,e.arrowTypeStart)){const{angle:y,deltaX:v}=Mo(n[0],n[1]);s=Ye[e.arrowTypeStart]*Math.cos(y)*(v>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Ye,e.arrowTypeEnd)){const{angle:y,deltaX:v}=Mo(n[n.length-1],n[n.length-2]);s=Ye[e.arrowTypeEnd]*Math.cos(y)*(v>=0?1:-1)}const c=Math.abs(he(t).x-he(n[n.length-1]).x),l=Math.abs(he(t).y-he(n[n.length-1]).y),h=Math.abs(he(t).x-he(n[0]).x),d=Math.abs(he(t).y-he(n[0]).y),f=Ye[e.arrowTypeStart],g=Ye[e.arrowTypeEnd],m=1;if(c<g&&c>0&&l<g){let y=g+m-c;y*=o==="right"?-1:1,s-=y}if(h<f&&h>0&&d<f){let y=f+m-h;y*=o==="right"?-1:1,s+=y}return he(t).x+s},"x"),y:w(function(t,r,n){let s=0;const o=he(n[0]).y<he(n[n.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Ye,e.arrowTypeStart)){const{angle:y,deltaY:v}=Mo(n[0],n[1]);s=Ye[e.arrowTypeStart]*Math.abs(Math.sin(y))*(v>=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(Ye,e.arrowTypeEnd)){const{angle:y,deltaY:v}=Mo(n[n.length-1],n[n.length-2]);s=Ye[e.arrowTypeEnd]*Math.abs(Math.sin(y))*(v>=0?1:-1)}const c=Math.abs(he(t).y-he(n[n.length-1]).y),l=Math.abs(he(t).x-he(n[n.length-1]).x),h=Math.abs(he(t).y-he(n[0]).y),d=Math.abs(he(t).x-he(n[0]).x),f=Ye[e.arrowTypeStart],g=Ye[e.arrowTypeEnd],m=1;if(c<g&&c>0&&l<g){let y=g+m-c;y*=o==="up"?-1:1,s-=y}if(h<f&&h>0&&d<f){let y=f+m-h;y*=o==="up"?-1:1,s+=y}return he(t).y+s},"y")}),"getLineFunctionsWithOffset"),Yp=w(({flowchart:e})=>{var s,o;const t=((s=e==null?void 0:e.subGraphTitleMargin)==null?void 0:s.top)??0,r=((o=e==null?void 0:e.subGraphTitleMargin)==null?void 0:o.bottom)??0,n=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:n}},"getSubGraphTitleMargins"),p3=w(e=>{const{handDrawnSeed:t}=Jt();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Ca=w(e=>{const t=g3([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),g3=w(e=>{const t=new Map;return e.forEach(r=>{const[n,s]=r.split(":");t.set(n.trim(),s==null?void 0:s.trim())}),t},"styles2Map"),Gb=w(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"),Tt=w(e=>{const{stylesArray:t}=Ca(e),r=[],n=[],s=[],o=[];return t.forEach(c=>{const l=c[0];Gb(l)?r.push(c.join(":")+" !important"):(n.push(c.join(":")+" !important"),l.includes("stroke")&&s.push(c.join(":")+" !important"),l==="fill"&&o.push(c.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:t,borderStyles:s,backgroundStyles:o}},"styles2String"),_t=w((e,t)=>{var h;const{themeVariables:r,handDrawnSeed:n}=Jt(),{nodeBorder:s,mainBkg:o}=r,{stylesMap:c}=Ca(e);return Object.assign({roughness:.7,fill:c.get("fill")||o,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:c.get("stroke")||s,seed:n,strokeWidth:((h=c.get("stroke-width"))==null?void 0:h.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:m3(c.get("stroke-dasharray"))},t)},"userNodeOverrides"),m3=w(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const s=isNaN(t[0])?0:t[0];return[s,s]}const r=isNaN(t[0])?0:t[0],n=isNaN(t[1])?0:t[1];return[r,n]},"getStrokeDashArray"),Sc={},_e={},H0;function y3(){return H0||(H0=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.BLANK_URL=_e.relativeFirstCharacters=_e.whitespaceEscapeCharsRegex=_e.urlSchemeRegex=_e.ctrlCharactersRegex=_e.htmlCtrlEntityRegex=_e.htmlEntitiesRegex=_e.invalidProtocolRegex=void 0,_e.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,_e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,_e.htmlCtrlEntityRegex=/&(newline|tab);/gi,_e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,_e.urlSchemeRegex=/^.+(:|&colon;)/gim,_e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,_e.relativeFirstCharacters=[".","/"],_e.BLANK_URL="about:blank"),_e}var q0;function x3(){if(q0)return Sc;q0=1,Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.sanitizeUrl=o;var e=y3();function t(c){return e.relativeFirstCharacters.indexOf(c[0])>-1}function r(c){var l=c.replace(e.ctrlCharactersRegex,"");return l.replace(e.htmlEntitiesRegex,function(h,d){return String.fromCharCode(d)})}function n(c){return URL.canParse(c)}function s(c){try{return decodeURIComponent(c)}catch{return c}}function o(c){if(!c)return e.BLANK_URL;var l,h=s(c.trim());do h=r(h).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),h=s(h),l=h.match(e.ctrlCharactersRegex)||h.match(e.htmlEntitiesRegex)||h.match(e.htmlCtrlEntityRegex)||h.match(e.whitespaceEscapeCharsRegex);while(l&&l.length>0);var d=h;if(!d)return e.BLANK_URL;if(t(d))return d;var f=d.trimStart(),g=f.match(e.urlSchemeRegex);if(!g)return d;var m=g[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(m))return e.BLANK_URL;var y=f.replace(/\\/g,"/");if(m==="mailto:"||m.includes("://"))return y;if(m==="http:"||m==="https:"){if(!n(y))return e.BLANK_URL;var v=new URL(y);return v.protocol=v.protocol.toLowerCase(),v.hostname=v.hostname.toLowerCase(),v.toString()}return y}return Sc}var v3=x3(),Vb=typeof global=="object"&&global&&global.Object===Object&&global,b3=typeof self=="object"&&self&&self.Object===Object&&self,Nn=Vb||b3||Function("return this")(),yu=Nn.Symbol,Yb=Object.prototype,S3=Yb.hasOwnProperty,C3=Yb.toString,bo=yu?yu.toStringTag:void 0;function w3(e){var t=S3.call(e,bo),r=e[bo];try{e[bo]=void 0;var n=!0}catch{}var s=C3.call(e);return n&&(t?e[bo]=r:delete e[bo]),s}var k3=Object.prototype,_3=k3.toString;function T3(e){return _3.call(e)}var E3="[object Null]",L3="[object Undefined]",U0=yu?yu.toStringTag:void 0;function wa(e){return e==null?e===void 0?L3:E3:U0&&U0 in Object(e)?w3(e):T3(e)}function Cs(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var M3="[object AsyncFunction]",B3="[object Function]",A3="[object GeneratorFunction]",$3="[object Proxy]";function Xp(e){if(!Cs(e))return!1;var t=wa(e);return t==B3||t==A3||t==M3||t==$3}var Zd=Nn["__core-js_shared__"],G0=(function(){var e=/[^.]+$/.exec(Zd&&Zd.keys&&Zd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function R3(e){return!!G0&&G0 in e}var F3=Function.prototype,I3=F3.toString;function ws(e){if(e!=null){try{return I3.call(e)}catch{}try{return e+""}catch{}}return""}var P3=/[\\^$.*+?()[\]{}|]/g,D3=/^\[object .+?Constructor\]$/,O3=Function.prototype,z3=Object.prototype,j3=O3.toString,N3=z3.hasOwnProperty,W3=RegExp("^"+j3.call(N3).replace(P3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function H3(e){if(!Cs(e)||R3(e))return!1;var t=Xp(e)?W3:D3;return t.test(ws(e))}function q3(e,t){return e==null?void 0:e[t]}function ks(e,t){var r=q3(e,t);return H3(r)?r:void 0}var Vo=ks(Object,"create");function U3(){this.__data__=Vo?Vo(null):{},this.size=0}function G3(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var V3="__lodash_hash_undefined__",Y3=Object.prototype,X3=Y3.hasOwnProperty;function Q3(e){var t=this.__data__;if(Vo){var r=t[e];return r===V3?void 0:r}return X3.call(t,e)?t[e]:void 0}var K3=Object.prototype,Z3=K3.hasOwnProperty;function J3(e){var t=this.__data__;return Vo?t[e]!==void 0:Z3.call(t,e)}var t$="__lodash_hash_undefined__";function e$(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Vo&&t===void 0?t$:t,this}function vs(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}vs.prototype.clear=U3;vs.prototype.delete=G3;vs.prototype.get=Q3;vs.prototype.has=J3;vs.prototype.set=e$;function r$(){this.__data__=[],this.size=0}function Hu(e,t){return e===t||e!==e&&t!==t}function qu(e,t){for(var r=e.length;r--;)if(Hu(e[r][0],t))return r;return-1}var n$=Array.prototype,i$=n$.splice;function s$(e){var t=this.__data__,r=qu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():i$.call(t,r,1),--this.size,!0}function a$(e){var t=this.__data__,r=qu(t,e);return r<0?void 0:t[r][1]}function o$(e){return qu(this.__data__,e)>-1}function l$(e,t){var r=this.__data__,n=qu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function si(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}si.prototype.clear=r$;si.prototype.delete=s$;si.prototype.get=a$;si.prototype.has=o$;si.prototype.set=l$;var Yo=ks(Nn,"Map");function c$(){this.size=0,this.__data__={hash:new vs,map:new(Yo||si),string:new vs}}function u$(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Uu(e,t){var r=e.__data__;return u$(t)?r[typeof t=="string"?"string":"hash"]:r.map}function h$(e){var t=Uu(this,e).delete(e);return this.size-=t?1:0,t}function d$(e){return Uu(this,e).get(e)}function f$(e){return Uu(this,e).has(e)}function p$(e,t){var r=Uu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function Di(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Di.prototype.clear=c$;Di.prototype.delete=h$;Di.prototype.get=d$;Di.prototype.has=f$;Di.prototype.set=p$;var g$="Expected a function";function il(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(g$);var r=function(){var n=arguments,s=t?t.apply(this,n):n[0],o=r.cache;if(o.has(s))return o.get(s);var c=e.apply(this,n);return r.cache=o.set(s,c)||o,c};return r.cache=new(il.Cache||Di),r}il.Cache=Di;function m$(){this.__data__=new si,this.size=0}function y$(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function x$(e){return this.__data__.get(e)}function v$(e){return this.__data__.has(e)}var b$=200;function S$(e,t){var r=this.__data__;if(r instanceof si){var n=r.__data__;if(!Yo||n.length<b$-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Di(n)}return r.set(e,t),this.size=r.size,this}function ka(e){var t=this.__data__=new si(e);this.size=t.size}ka.prototype.clear=m$;ka.prototype.delete=y$;ka.prototype.get=x$;ka.prototype.has=v$;ka.prototype.set=S$;var xu=(function(){try{var e=ks(Object,"defineProperty");return e({},"",{}),e}catch{}})();function Qp(e,t,r){t=="__proto__"&&xu?xu(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Gf(e,t,r){(r!==void 0&&!Hu(e[t],r)||r===void 0&&!(t in e))&&Qp(e,t,r)}function C$(e){return function(t,r,n){for(var s=-1,o=Object(t),c=n(t),l=c.length;l--;){var h=c[++s];if(r(o[h],h,o)===!1)break}return t}}var w$=C$(),Xb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,V0=Xb&&typeof module=="object"&&module&&!module.nodeType&&module,k$=V0&&V0.exports===Xb,Y0=k$?Nn.Buffer:void 0,X0=Y0?Y0.allocUnsafe:void 0;function _$(e,t){if(t)return e.slice();var r=e.length,n=X0?X0(r):new e.constructor(r);return e.copy(n),n}var Q0=Nn.Uint8Array;function T$(e){var t=new e.constructor(e.byteLength);return new Q0(t).set(new Q0(e)),t}function E$(e,t){var r=t?T$(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function L$(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var K0=Object.create,M$=(function(){function e(){}return function(t){if(!Cs(t))return{};if(K0)return K0(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();function Qb(e,t){return function(r){return e(t(r))}}var Kb=Qb(Object.getPrototypeOf,Object),B$=Object.prototype;function Gu(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||B$;return e===r}function A$(e){return typeof e.constructor=="function"&&!Gu(e)?M$(Kb(e)):{}}function sl(e){return e!=null&&typeof e=="object"}var $$="[object Arguments]";function Z0(e){return sl(e)&&wa(e)==$$}var Zb=Object.prototype,R$=Zb.hasOwnProperty,F$=Zb.propertyIsEnumerable,vu=Z0((function(){return arguments})())?Z0:function(e){return sl(e)&&R$.call(e,"callee")&&!F$.call(e,"callee")},bu=Array.isArray,I$=9007199254740991;function Jb(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=I$}function Vu(e){return e!=null&&Jb(e.length)&&!Xp(e)}function P$(e){return sl(e)&&Vu(e)}function D$(){return!1}var t2=typeof exports=="object"&&exports&&!exports.nodeType&&exports,J0=t2&&typeof module=="object"&&module&&!module.nodeType&&module,O$=J0&&J0.exports===t2,tx=O$?Nn.Buffer:void 0,z$=tx?tx.isBuffer:void 0,Kp=z$||D$,j$="[object Object]",N$=Function.prototype,W$=Object.prototype,e2=N$.toString,H$=W$.hasOwnProperty,q$=e2.call(Object);function U$(e){if(!sl(e)||wa(e)!=j$)return!1;var t=Kb(e);if(t===null)return!0;var r=H$.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&e2.call(r)==q$}var G$="[object Arguments]",V$="[object Array]",Y$="[object Boolean]",X$="[object Date]",Q$="[object Error]",K$="[object Function]",Z$="[object Map]",J$="[object Number]",tR="[object Object]",eR="[object RegExp]",rR="[object Set]",nR="[object String]",iR="[object WeakMap]",sR="[object ArrayBuffer]",aR="[object DataView]",oR="[object Float32Array]",lR="[object Float64Array]",cR="[object Int8Array]",uR="[object Int16Array]",hR="[object Int32Array]",dR="[object Uint8Array]",fR="[object Uint8ClampedArray]",pR="[object Uint16Array]",gR="[object Uint32Array]",ce={};ce[oR]=ce[lR]=ce[cR]=ce[uR]=ce[hR]=ce[dR]=ce[fR]=ce[pR]=ce[gR]=!0;ce[G$]=ce[V$]=ce[sR]=ce[Y$]=ce[aR]=ce[X$]=ce[Q$]=ce[K$]=ce[Z$]=ce[J$]=ce[tR]=ce[eR]=ce[rR]=ce[nR]=ce[iR]=!1;function mR(e){return sl(e)&&Jb(e.length)&&!!ce[wa(e)]}function yR(e){return function(t){return e(t)}}var r2=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Oo=r2&&typeof module=="object"&&module&&!module.nodeType&&module,xR=Oo&&Oo.exports===r2,Jd=xR&&Vb.process,ex=(function(){try{var e=Oo&&Oo.require&&Oo.require("util").types;return e||Jd&&Jd.binding&&Jd.binding("util")}catch{}})(),rx=ex&&ex.isTypedArray,Zp=rx?yR(rx):mR;function Vf(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var vR=Object.prototype,bR=vR.hasOwnProperty;function SR(e,t,r){var n=e[t];(!(bR.call(e,t)&&Hu(n,r))||r===void 0&&!(t in e))&&Qp(e,t,r)}function CR(e,t,r,n){var s=!r;r||(r={});for(var o=-1,c=t.length;++o<c;){var l=t[o],h=void 0;h===void 0&&(h=e[l]),s?Qp(r,l,h):SR(r,l,h)}return r}function wR(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var kR=9007199254740991,_R=/^(?:0|[1-9]\d*)$/;function n2(e,t){var r=typeof e;return t=t??kR,!!t&&(r=="number"||r!="symbol"&&_R.test(e))&&e>-1&&e%1==0&&e<t}var TR=Object.prototype,ER=TR.hasOwnProperty;function LR(e,t){var r=bu(e),n=!r&&vu(e),s=!r&&!n&&Kp(e),o=!r&&!n&&!s&&Zp(e),c=r||n||s||o,l=c?wR(e.length,String):[],h=l.length;for(var d in e)(t||ER.call(e,d))&&!(c&&(d=="length"||s&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||n2(d,h)))&&l.push(d);return l}function MR(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var BR=Object.prototype,AR=BR.hasOwnProperty;function $R(e){if(!Cs(e))return MR(e);var t=Gu(e),r=[];for(var n in e)n=="constructor"&&(t||!AR.call(e,n))||r.push(n);return r}function i2(e){return Vu(e)?LR(e,!0):$R(e)}function RR(e){return CR(e,i2(e))}function FR(e,t,r,n,s,o,c){var l=Vf(e,r),h=Vf(t,r),d=c.get(h);if(d){Gf(e,r,d);return}var f=o?o(l,h,r+"",e,t,c):void 0,g=f===void 0;if(g){var m=bu(h),y=!m&&Kp(h),v=!m&&!y&&Zp(h);f=h,m||y||v?bu(l)?f=l:P$(l)?f=L$(l):y?(g=!1,f=_$(h,!0)):v?(g=!1,f=E$(h,!0)):f=[]:U$(h)||vu(h)?(f=l,vu(l)?f=RR(l):(!Cs(l)||Xp(l))&&(f=A$(h))):g=!1}g&&(c.set(h,f),s(f,h,n,o,c),c.delete(h)),Gf(e,r,f)}function s2(e,t,r,n,s){e!==t&&w$(t,function(o,c){if(s||(s=new ka),Cs(o))FR(e,t,c,r,s2,n,s);else{var l=n?n(Vf(e,c),o,c+"",e,t,s):void 0;l===void 0&&(l=o),Gf(e,c,l)}},i2)}function a2(e){return e}function IR(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var nx=Math.max;function PR(e,t,r){return t=nx(t===void 0?e.length-1:t,0),function(){for(var n=arguments,s=-1,o=nx(n.length-t,0),c=Array(o);++s<o;)c[s]=n[t+s];s=-1;for(var l=Array(t+1);++s<t;)l[s]=n[s];return l[t]=r(c),IR(e,this,l)}}function DR(e){return function(){return e}}var OR=xu?function(e,t){return xu(e,"toString",{configurable:!0,enumerable:!1,value:DR(t),writable:!0})}:a2,zR=800,jR=16,NR=Date.now;function WR(e){var t=0,r=0;return function(){var n=NR(),s=jR-(n-r);if(r=n,s>0){if(++t>=zR)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var HR=WR(OR);function qR(e,t){return HR(PR(e,t,a2),e+"")}function UR(e,t,r){if(!Cs(r))return!1;var n=typeof t;return(n=="number"?Vu(r)&&n2(t,r.length):n=="string"&&t in r)?Hu(r[t],e):!1}function GR(e){return qR(function(t,r){var n=-1,s=r.length,o=s>1?r[s-1]:void 0,c=s>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(s--,o):void 0,c&&UR(r[0],r[1],c)&&(o=s<3?void 0:o,s=1),t=Object(t);++n<s;){var l=r[n];l&&e(t,l,n,o)}return t})}var VR=GR(function(e,t,r){s2(e,t,r)}),YR="​",XR={curveBasis:zc,curveBasisClosed:KB,curveBasisOpen:ZB,curveBumpX:U1,curveBumpY:G1,curveBundle:JB,curveCardinalClosed:tA,curveCardinalOpen:eA,curveCardinal:Q1,curveCatmullRomClosed:rA,curveCatmullRomOpen:nA,curveCatmullRom:Z1,curveLinear:ou,curveLinearClosed:iA,curveMonotoneX:iv,curveMonotoneY:sv,curveNatural:ov,curveStep:lv,curveStepAfter:uv,curveStepBefore:cv},QR=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,KR=w(function(e,t){const r=o2(e,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const c=r.map(l=>l.args);Qc(c),n=Te(n,[...c])}else n=r.args;if(!n)return;let s=Cp(e,t);const o="config";return n[o]!==void 0&&(s==="flowchart-v2"&&(s="flowchart"),n[s]=n[o],delete n[o]),n},"detectInit"),o2=w(function(e,t=null){var r,n;try{const s=new RegExp(`[%]{2}(?![{]${QR.source})(?=[}][%]{2}).*
215
+ `,"ig");e=e.trim().replace(s,"").replace(/'/gm,'"'),nt.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let o;const c=[];for(;(o=Po.exec(e))!==null;)if(o.index===Po.lastIndex&&Po.lastIndex++,o&&!t||t&&((r=o[1])!=null&&r.match(t))||t&&((n=o[2])!=null&&n.match(t))){const l=o[1]?o[1]:o[2],h=o[3]?o[3].trim():o[4]?JSON.parse(o[4].trim()):null;c.push({type:l,args:h})}return c.length===0?{type:e,args:null}:c.length===1?c[0]:c}catch(s){return nt.error(`ERROR: ${s.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),ZR=w(function(e){return e.replace(Po,"")},"removeDirectives"),JR=w(function(e,t){for(const[r,n]of t.entries())if(n.match(e))return r;return-1},"isSubstringInArray");function Jp(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return XR[r]??t}w(Jp,"interpolateToCurve");function l2(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?v3.sanitizeUrl(r):r}w(l2,"formatUrl");var t5=w((e,...t)=>{const r=e.split("."),n=r.length-1,s=r[n];let o=window;for(let c=0;c<n;c++)if(o=o[r[c]],!o){nt.error(`Function name: ${e} not found in window`);return}o[s](...t)},"runFunc");function tg(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}w(tg,"distance");function c2(e){let t,r=0;e.forEach(s=>{r+=tg(s,t),t=s});const n=r/2;return eg(e,n)}w(c2,"traverseEdge");function u2(e){return e.length===1?e[0]:c2(e)}w(u2,"calcLabelPosition");var ix=w((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),eg=w((e,t)=>{let r,n=t;for(const s of e){if(r){const o=tg(s,r);if(o===0)return r;if(o<n)n-=o;else{const c=n/o;if(c<=0)return r;if(c>=1)return{x:s.x,y:s.y};if(c>0&&c<1)return{x:ix((1-c)*r.x+c*s.x,5),y:ix((1-c)*r.y+c*s.y,5)}}}r=s}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),e5=w((e,t,r)=>{nt.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const s=eg(t,25),o=e?10:5,c=Math.atan2(t[0].y-s.y,t[0].x-s.x),l={x:0,y:0};return l.x=Math.sin(c)*o+(t[0].x+s.x)/2,l.y=-Math.cos(c)*o+(t[0].y+s.y)/2,l},"calcCardinalityPosition");function h2(e,t,r){const n=structuredClone(r);nt.info("our points",n),t!=="start_left"&&t!=="start_right"&&n.reverse();const s=25+e,o=eg(n,s),c=10+e*.5,l=Math.atan2(n[0].y-o.y,n[0].x-o.x),h={x:0,y:0};return t==="start_left"?(h.x=Math.sin(l+Math.PI)*c+(n[0].x+o.x)/2,h.y=-Math.cos(l+Math.PI)*c+(n[0].y+o.y)/2):t==="end_right"?(h.x=Math.sin(l-Math.PI)*c+(n[0].x+o.x)/2-5,h.y=-Math.cos(l-Math.PI)*c+(n[0].y+o.y)/2-5):t==="end_left"?(h.x=Math.sin(l)*c+(n[0].x+o.x)/2-5,h.y=-Math.cos(l)*c+(n[0].y+o.y)/2-5):(h.x=Math.sin(l)*c+(n[0].x+o.x)/2,h.y=-Math.cos(l)*c+(n[0].y+o.y)/2),h}w(h2,"calcTerminalLabelPosition");function d2(e){let t="",r="";for(const n of e)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":t=t+n+";");return{style:t,labelStyle:r}}w(d2,"getStylesFromArray");var sx=0,r5=w(()=>(sx++,"id-"+Math.random().toString(36).substr(2,12)+"-"+sx),"generateId");function f2(e){let t="";const r="0123456789abcdef",n=r.length;for(let s=0;s<e;s++)t+=r.charAt(Math.floor(Math.random()*n));return t}w(f2,"makeRandomHex");var n5=w(e=>f2(e.length),"random"),i5=w(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"),s5=w(function(e,t){const r=t.text.replace(Sa.lineBreakRegex," "),[,n]=Yu(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",n),s.style("font-weight",t.fontWeight),s.attr("fill",t.fill),t.class!==void 0&&s.attr("class",t.class);const o=s.append("tspan");return o.attr("x",t.x+t.textMargin*2),o.attr("fill",t.fill),o.text(r),s},"drawSimpleText"),a5=il((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Sa.lineBreakRegex.test(e)))return e;const n=e.split(" ").filter(Boolean),s=[];let o="";return n.forEach((c,l)=>{const h=ii(`${c} `,r),d=ii(o,r);if(h>t){const{hyphenatedStrings:m,remainingWord:y}=o5(c,t,"-",r);s.push(o,...m),o=y}else d+h>=t?(s.push(o),o=c):o=[o,c].filter(Boolean).join(" ");l+1===n.length&&s.push(o)}),s.filter(c=>c!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),o5=il((e,t,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const s=[...e],o=[];let c="";return s.forEach((l,h)=>{const d=`${c}${l}`;if(ii(d,n)>=t){const g=h+1,m=s.length===g,y=`${d}${r}`;o.push(m?d:y),c=""}else c=d}),{hyphenatedStrings:o,remainingWord:c}},(e,t,r="-",n)=>`${e}${t}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function p2(e,t){return rg(e,t).height}w(p2,"calculateTextHeight");function ii(e,t){return rg(e,t).width}w(ii,"calculateTextWidth");var rg=il((e,t)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:s=400}=t;if(!e)return{width:0,height:0};const[,o]=Yu(r),c=["sans-serif",n],l=e.split(Sa.lineBreakRegex),h=[],d=Gt("body");if(!d.remove)return{width:0,height:0,lineHeight:0};const f=d.append("svg");for(const m of c){let y=0;const v={width:0,height:0,lineHeight:0};for(const b of l){const k=i5();k.text=b||YR;const T=s5(f,k).style("font-size",o).style("font-weight",s).style("font-family",m),_=(T._groups||T)[0][0].getBBox();if(_.width===0&&_.height===0)throw new Error("svg element not in render tree");v.width=Math.round(Math.max(v.width,_.width)),y=Math.round(_.height),v.height+=y,v.lineHeight=Math.round(Math.max(v.lineHeight,y))}h.push(v)}f.remove();const g=isNaN(h[1].height)||isNaN(h[1].width)||isNaN(h[1].lineHeight)||h[0].height>h[1].height&&h[0].width>h[1].width&&h[0].lineHeight>h[1].lineHeight?0:1;return h[g]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),da,l5=(da=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},w(da,"InitIDGenerator"),da),Cc,c5=w(function(e){return Cc=Cc||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Cc.innerHTML=e,unescape(Cc.textContent)},"entityDecode");function ng(e){return"str"in e}w(ng,"isDetailedError");var u5=w((e,t,r,n)=>{var o;if(!n)return;const s=(o=e.node())==null?void 0:o.getBBox();s&&e.append("text").text(n).attr("text-anchor","middle").attr("x",s.x+s.width/2).attr("y",-r).attr("class",t)},"insertTitle"),Yu=w(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 ig(e,t){return VR({},e,t)}w(ig,"cleanAndMerge");var bn={assignWithDepth:Te,wrapLabel:a5,calculateTextHeight:p2,calculateTextWidth:ii,calculateTextDimensions:rg,cleanAndMerge:ig,detectInit:KR,detectDirective:o2,isSubstringInArray:JR,interpolateToCurve:Jp,calcLabelPosition:u2,calcCardinalityPosition:e5,calcTerminalLabelPosition:h2,formatUrl:l2,getStylesFromArray:d2,generateId:r5,random:n5,runFunc:t5,entityDecode:c5,insertTitle:u5,isLabelCoordinateInPath:g2,parseFontSize:Yu,InitIDGenerator:l5},h5=w(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const n=r.substring(1,r.length-1);return/^\+?\d+$/.test(n)?"fl°°"+n+"¶ß":"fl°"+n+"¶ß"}),t},"encodeEntities"),_s=w(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),o6=w((e,t,{counter:r=0,prefix:n,suffix:s},o)=>o||`${n?`${n}_`:""}${e}_${t}_${r}${s?`_${s}`:""}`,"getEdgeId");function Ke(e){return e??null}w(Ke,"handleUndefinedAttr");function g2(e,t){const r=Math.round(e.x),n=Math.round(e.y),s=t.replace(/(\d+\.\d+)/g,o=>Math.round(parseFloat(o)).toString());return s.includes(r.toString())||s.includes(n.toString())}w(g2,"isLabelCoordinateInPath");const d5=Object.freeze({left:0,top:0,width:16,height:16}),Su=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),m2=Object.freeze({...d5,...Su}),f5=Object.freeze({...m2,body:"",hidden:!1}),p5=Object.freeze({width:null,height:null}),g5=Object.freeze({...p5,...Su}),m5=(e,t,r,n="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;n=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const l=s.pop(),h=s.pop(),d={provider:s.length>0?s[0]:n,prefix:h,name:l};return tf(d)?d:null}const o=s[0],c=o.split("-");if(c.length>1){const l={provider:n,prefix:c.shift(),name:c.join("-")};return tf(l)?l:null}if(r&&n===""){const l={provider:n,prefix:"",name:o};return tf(l,r)?l:null}return null},tf=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function y5(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(r.rotate=n),r}function ax(e,t){const r=y5(e,t);for(const n in f5)n in Su?n in e&&!(n in r)&&(r[n]=Su[n]):n in t?r[n]=t[n]:n in e&&(r[n]=e[n]);return r}function x5(e,t){const r=e.icons,n=e.aliases||Object.create(null),s=Object.create(null);function o(c){if(r[c])return s[c]=[];if(!(c in s)){s[c]=null;const l=n[c]&&n[c].parent,h=l&&o(l);h&&(s[c]=[l].concat(h))}return s[c]}return(t||Object.keys(r).concat(Object.keys(n))).forEach(o),s}function ox(e,t,r){const n=e.icons,s=e.aliases||Object.create(null);let o={};function c(l){o=ax(n[l]||s[l],o)}return c(t),r.forEach(c),ax(e,o)}function v5(e,t){if(e.icons[t])return ox(e,t,[]);const r=x5(e,[t])[t];return r?ox(e,t,r):null}const b5=/(-?[0-9.]*[0-9]+[0-9.]*)/g,S5=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function lx(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const n=e.split(b5);if(n===null||!n.length)return e;const s=[];let o=n.shift(),c=S5.test(o);for(;;){if(c){const l=parseFloat(o);isNaN(l)?s.push(o):s.push(Math.ceil(l*t*r)/r)}else s.push(o);if(o=n.shift(),o===void 0)return s.join("");c=!c}}function C5(e,t="defs"){let r="";const n=e.indexOf("<"+t);for(;n>=0;){const s=e.indexOf(">",n),o=e.indexOf("</"+t);if(s===-1||o===-1)break;const c=e.indexOf(">",o);if(c===-1)break;r+=e.slice(s+1,o).trim(),e=e.slice(0,n).trim()+e.slice(c+1)}return{defs:r,content:e}}function w5(e,t){return e?"<defs>"+e+"</defs>"+t:t}function k5(e,t,r){const n=C5(e);return w5(n.defs,t+n.content+r)}const _5=e=>e==="unset"||e==="undefined"||e==="none";function T5(e,t){const r={...m2,...e},n={...g5,...t},s={left:r.left,top:r.top,width:r.width,height:r.height};let o=r.body;[r,n].forEach(b=>{const k=[],T=b.hFlip,_=b.vFlip;let B=b.rotate;T?_?B+=2:(k.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),k.push("scale(-1 1)"),s.top=s.left=0):_&&(k.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),k.push("scale(1 -1)"),s.top=s.left=0);let L;switch(B<0&&(B-=Math.floor(B/4)*4),B=B%4,B){case 1:L=s.height/2+s.top,k.unshift("rotate(90 "+L.toString()+" "+L.toString()+")");break;case 2:k.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:L=s.width/2+s.left,k.unshift("rotate(-90 "+L.toString()+" "+L.toString()+")");break}B%2===1&&(s.left!==s.top&&(L=s.left,s.left=s.top,s.top=L),s.width!==s.height&&(L=s.width,s.width=s.height,s.height=L)),k.length&&(o=k5(o,'<g transform="'+k.join(" ")+'">',"</g>"))});const c=n.width,l=n.height,h=s.width,d=s.height;let f,g;c===null?(g=l===null?"1em":l==="auto"?d:l,f=lx(g,h/d)):(f=c==="auto"?h:c,g=l===null?lx(f,d/h):l==="auto"?d:l);const m={},y=(b,k)=>{_5(k)||(m[b]=k.toString())};y("width",f),y("height",g);const v=[s.left,s.top,h,d];return m.viewBox=v.join(" "),{attributes:m,viewBox:v,body:o}}const E5=/\sid="(\S+)"/g,cx=new Map;function L5(e){e=e.replace(/[0-9]+$/,"")||"a";const t=cx.get(e)||0;return cx.set(e,t+1),t?`${e}${t}`:e}function M5(e){const t=[];let r;for(;r=E5.exec(e);)t.push(r[1]);if(!t.length)return e;const n="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(s=>{const o=L5(s),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+o+n+"$3")}),e=e.replace(new RegExp(n,"g"),""),e}function B5(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in t)r+=" "+n+'="'+t[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}function y2(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=Array.from(typeof e=="string"?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,"");var s=n.reduce(function(l,h){var d=h.match(/\n([\t ]+|(?!\s).)/g);return d?l.concat(d.map(function(f){var g,m;return(m=(g=f.match(/[\t ]/g))===null||g===void 0?void 0:g.length)!==null&&m!==void 0?m:0})):l},[]);if(s.length){var o=new RegExp(`
216
+ [ ]{`+Math.min.apply(Math,s)+"}","g");n=n.map(function(l){return l.replace(o,`
217
+ `)})}n[0]=n[0].replace(/^\r?\n/,"");var c=n[0];return t.forEach(function(l,h){var d=c.match(/(?:^|\n)( *)$/),f=d?d[1]:"",g=l;typeof l=="string"&&l.includes(`
218
+ `)&&(g=String(l).split(`
219
+ `).map(function(m,y){return y===0?m:""+f+m}).join(`
220
+ `)),c+=g+n[h+1]}),c}var A5={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},Yf=new Map,x2=new Map,$5=w(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(nt.debug("Registering icon pack:",t.name),"loader"in t)x2.set(t.name,t.loader);else if("icons"in t)Yf.set(t.name,t.icons);else throw nt.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),v2=w(async(e,t)=>{const r=m5(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const n=r.prefix||t;if(!n)throw new Error(`Icon name must contain a prefix: ${e}`);let s=Yf.get(n);if(!s){const c=x2.get(n);if(!c)throw new Error(`Icon set not found: ${r.prefix}`);try{s={...await c(),prefix:n},Yf.set(n,s)}catch(l){throw nt.error(l),new Error(`Failed to load icon set: ${r.prefix}`)}}const o=v5(s,r.name);if(!o)throw new Error(`Icon not found: ${e}`);return o},"getRegisteredIconData"),R5=w(async e=>{try{return await v2(e),!0}catch{return!1}},"isIconAvailable"),al=w(async(e,t,r)=>{let n;try{n=await v2(e,t==null?void 0:t.fallbackPrefix)}catch(c){nt.error(c),n=A5}const s=T5(n,t),o=B5(M5(s.body),{...s.attributes,...r});return Zr(o,Xe())},"getIconSVG");function b2(e,{markdownAutoWrap:t}){const n=e.replace(/<br\/>/g,`
221
+ `).replace(/\n{2,}/g,`
222
+ `),s=y2(n);return t===!1?s.replace(/ /g,"&nbsp;"):s}w(b2,"preprocessMarkdown");function S2(e,t={}){const r=b2(e,t),n=Xt.lexer(r),s=[[]];let o=0;function c(l,h="normal"){l.type==="text"?l.text.split(`
223
+ `).forEach((f,g)=>{g!==0&&(o++,s.push([])),f.split(" ").forEach(m=>{m=m.replace(/&#39;/g,"'"),m&&s[o].push({content:m,type:h})})}):l.type==="strong"||l.type==="em"?l.tokens.forEach(d=>{c(d,l.type)}):l.type==="html"&&s[o].push({content:l.text,type:"normal"})}return w(c,"processNode"),n.forEach(l=>{var h;l.type==="paragraph"?(h=l.tokens)==null||h.forEach(d=>{c(d)}):l.type==="html"?s[o].push({content:l.text,type:"normal"}):s[o].push({content:l.raw,type:"normal"})}),s}w(S2,"markdownToLines");function C2(e,{markdownAutoWrap:t}={}){const r=Xt.lexer(e);function n(s){var o,c,l;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>${(o=s.tokens)==null?void 0:o.map(n).join("")}</strong>`:s.type==="em"?`<em>${(c=s.tokens)==null?void 0:c.map(n).join("")}</em>`:s.type==="paragraph"?`<p>${(l=s.tokens)==null?void 0:l.map(n).join("")}</p>`:s.type==="space"?"":s.type==="html"?`${s.text}`:s.type==="escape"?s.text:(nt.warn(`Unsupported markdown: ${s.type}`),s.raw)}return w(n,"output"),r.map(n).join("")}w(C2,"markdownToHTML");function w2(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}w(w2,"splitTextToChars");function k2(e,t){const r=w2(t.content);return sg(e,[],r,t.type)}w(k2,"splitWordToFitWidth");function sg(e,t,r,n){if(r.length===0)return[{content:t.join(""),type:n},{content:"",type:n}];const[s,...o]=r,c=[...t,s];return e([{content:c.join(""),type:n}])?sg(e,c,o,n):(t.length===0&&s&&(t.push(s),r.shift()),[{content:t.join(""),type:n},{content:r.join(""),type:n}])}w(sg,"splitWordToFitWidthRecursion");function _2(e,t){if(e.some(({content:r})=>r.includes(`
224
+ `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Cu(e,t)}w(_2,"splitLineToFitWidth");function Cu(e,t,r=[],n=[]){if(e.length===0)return n.length>0&&r.push(n),r.length>0?r:[];let s="";e[0].content===" "&&(s=" ",e.shift());const o=e.shift()??{content:" ",type:"normal"},c=[...n];if(s!==""&&c.push({content:s,type:"normal"}),c.push(o),t(c))return Cu(e,t,r,c);if(n.length>0)r.push(n),e.unshift(o);else if(o.content){const[l,h]=k2(t,o);r.push([l]),h.content&&e.unshift(h)}return Cu(e,t,r)}w(Cu,"splitLineToFitWidthRecursion");function Xf(e,t){t&&e.attr("style",t)}w(Xf,"applyStyle");async function T2(e,t,r,n,s=!1,o=Xe()){const c=e.append("foreignObject");c.attr("width",`${10*r}px`),c.attr("height",`${10*r}px`);const l=c.append("xhtml:div"),h=pa(t.label)?await wp(t.label.replace(Sa.lineBreakRegex,`
225
+ `),o):Zr(t.label,o),d=t.isNode?"nodeLabel":"edgeLabel",f=l.append("span");f.html(h),Xf(f,t.labelStyle),f.attr("class",`${d} ${n}`),Xf(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),l.style("max-width",r+"px"),l.style("text-align","center"),l.attr("xmlns","http://www.w3.org/1999/xhtml"),s&&l.attr("class","labelBkg");let g=l.node().getBoundingClientRect();return g.width===r&&(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px"),g=l.node().getBoundingClientRect()),c.node()}w(T2,"addHtmlSpan");function Xu(e,t,r){return e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em")}w(Xu,"createTspan");function E2(e,t,r){const n=e.append("text"),s=Xu(n,1,t);Qu(s,r);const o=s.node().getComputedTextLength();return n.remove(),o}w(E2,"computeWidthOfText");function F5(e,t,r){var c;const n=e.append("text"),s=Xu(n,1,t);Qu(s,[{content:r,type:"normal"}]);const o=(c=s.node())==null?void 0:c.getBoundingClientRect();return o&&n.remove(),o}w(F5,"computeDimensionOfText");function L2(e,t,r,n=!1){const o=t.append("g"),c=o.insert("rect").attr("class","background").attr("style","stroke: none"),l=o.append("text").attr("y","-10.1");let h=0;for(const d of r){const f=w(m=>E2(o,1.1,m)<=e,"checkWidth"),g=f(d)?[d]:_2(d,f);for(const m of g){const y=Xu(l,h,1.1);Qu(y,m),h++}}if(n){const d=l.node().getBBox(),f=2;return c.attr("x",d.x-f).attr("y",d.y-f).attr("width",d.width+2*f).attr("height",d.height+2*f),o.node()}else return l.node()}w(L2,"createFormattedText");function Qu(e,t){e.text(""),t.forEach((r,n)=>{const s=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");n===0?s.text(r.content):s.text(" "+r.content)})}w(Qu,"updateTextContentAndStyles");async function M2(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(s,o,c)=>(r.push((async()=>{const l=`${o}:${c}`;return await R5(l)?await al(l,void 0,{class:"label-icon"}):`<i class='${Zr(s,t).replace(":"," ")}'></i>`})()),s));const n=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}w(M2,"replaceIconSubstring");var Oi=w(async(e,t="",{style:r="",isTitle:n=!1,classes:s="",useHtmlLabels:o=!0,isNode:c=!0,width:l=200,addSvgBackground:h=!1}={},d)=>{if(nt.debug("XYZ createText",t,r,n,s,o,c,"addSvgBackground: ",h),o){const f=C2(t,d),g=await M2(_s(f),d),m=t.replace(/\\\\/g,"\\"),y={isNode:c,label:pa(t)?m:g,labelStyle:r.replace("fill:","color:")};return await T2(e,y,l,s,h,d)}else{const f=t.replace(/<br\s*\/?>/g,"<br/>"),g=S2(f.replace("<br>","<br/>"),d),m=L2(l,e,g,t?h:!1);if(c){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Gt(m).attr("style",y)}else{const y=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Gt(m).select("rect").attr("style",y.replace(/background:/g,"fill:"));const v=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Gt(m).select("text").attr("style",v)}return m}},"createText");function ef(e,t,r){if(e&&e.length){const[n,s]=t,o=Math.PI/180*r,c=Math.cos(o),l=Math.sin(o);for(const h of e){const[d,f]=h;h[0]=(d-n)*c-(f-s)*l+n,h[1]=(d-n)*l+(f-s)*c+s}}}function I5(e,t){return e[0]===t[0]&&e[1]===t[1]}function P5(e,t,r,n=1){const s=r,o=Math.max(t,.1),c=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,l=[0,0];if(s)for(const d of c)ef(d,l,s);const h=(function(d,f,g){const m=[];for(const _ of d){const B=[..._];I5(B[0],B[B.length-1])||B.push([B[0][0],B[0][1]]),B.length>2&&m.push(B)}const y=[];f=Math.max(f,.1);const v=[];for(const _ of m)for(let B=0;B<_.length-1;B++){const L=_[B],A=_[B+1];if(L[1]!==A[1]){const E=Math.min(L[1],A[1]);v.push({ymin:E,ymax:Math.max(L[1],A[1]),x:E===L[1]?L[0]:A[0],islope:(A[0]-L[0])/(A[1]-L[1])})}}if(v.sort(((_,B)=>_.ymin<B.ymin?-1:_.ymin>B.ymin?1:_.x<B.x?-1:_.x>B.x?1:_.ymax===B.ymax?0:(_.ymax-B.ymax)/Math.abs(_.ymax-B.ymax))),!v.length)return y;let b=[],k=v[0].ymin,T=0;for(;b.length||v.length;){if(v.length){let _=-1;for(let B=0;B<v.length&&!(v[B].ymin>k);B++)_=B;v.splice(0,_+1).forEach((B=>{b.push({s:k,edge:B})}))}if(b=b.filter((_=>!(_.edge.ymax<=k))),b.sort(((_,B)=>_.edge.x===B.edge.x?0:(_.edge.x-B.edge.x)/Math.abs(_.edge.x-B.edge.x))),(g!==1||T%f==0)&&b.length>1)for(let _=0;_<b.length;_+=2){const B=_+1;if(B>=b.length)break;const L=b[_].edge,A=b[B].edge;y.push([[Math.round(L.x),k],[Math.round(A.x),k]])}k+=g,b.forEach((_=>{_.edge.x=_.edge.x+g*_.edge.islope})),T++}return y})(c,o,n);if(s){for(const d of c)ef(d,l,-s);(function(d,f,g){const m=[];d.forEach((y=>m.push(...y))),ef(m,f,g)})(h,l,-s)}return h}function ol(e,t){var r;const n=t.hachureAngle+90;let s=t.hachureGap;s<0&&(s=4*t.strokeWidth),s=Math.round(Math.max(s,.1));let o=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(o=s),P5(e,s,n,o||1)}class ag{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const n=ol(t,r);return{type:"fillSketch",ops:this.renderLines(n,r)}}renderLines(t,r){const n=[];for(const s of t)n.push(...this.helper.doubleLineOps(s[0][0],s[0][1],s[1][0],s[1][1],r));return n}}function Ku(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class D5 extends ag{fillPolygons(t,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const s=ol(t,Object.assign({},r,{hachureGap:n})),o=Math.PI/180*r.hachureAngle,c=[],l=.5*n*Math.cos(o),h=.5*n*Math.sin(o);for(const[d,f]of s)Ku([d,f])&&c.push([[d[0]-l,d[1]+h],[...f]],[[d[0]+l,d[1]-h],[...f]]);return{type:"fillSketch",ops:this.renderLines(c,r)}}}class O5 extends ag{fillPolygons(t,r){const n=this._fillPolygons(t,r),s=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),o=this._fillPolygons(t,s);return n.ops=n.ops.concat(o.ops),n}}class z5{constructor(t){this.helper=t}fillPolygons(t,r){const n=ol(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(n,r)}dotsOnLines(t,r){const n=[];let s=r.hachureGap;s<0&&(s=4*r.strokeWidth),s=Math.max(s,.1);let o=r.fillWeight;o<0&&(o=r.strokeWidth/2);const c=s/4;for(const l of t){const h=Ku(l),d=h/s,f=Math.ceil(d)-1,g=h-f*s,m=(l[0][0]+l[1][0])/2-s/4,y=Math.min(l[0][1],l[1][1]);for(let v=0;v<f;v++){const b=y+g+v*s,k=m-c+2*Math.random()*c,T=b-c+2*Math.random()*c,_=this.helper.ellipse(k,T,o,o,r);n.push(..._.ops)}}return{type:"fillSketch",ops:n}}}class j5{constructor(t){this.helper=t}fillPolygons(t,r){const n=ol(t,r);return{type:"fillSketch",ops:this.dashedLine(n,r)}}dashedLine(t,r){const n=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,s=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,o=[];return t.forEach((c=>{const l=Ku(c),h=Math.floor(l/(n+s)),d=(l+s-h*(n+s))/2;let f=c[0],g=c[1];f[0]>g[0]&&(f=c[1],g=c[0]);const m=Math.atan((g[1]-f[1])/(g[0]-f[0]));for(let y=0;y<h;y++){const v=y*(n+s),b=v+n,k=[f[0]+v*Math.cos(m)+d*Math.cos(m),f[1]+v*Math.sin(m)+d*Math.sin(m)],T=[f[0]+b*Math.cos(m)+d*Math.cos(m),f[1]+b*Math.sin(m)+d*Math.sin(m)];o.push(...this.helper.doubleLineOps(k[0],k[1],T[0],T[1],r))}})),o}}class N5{constructor(t){this.helper=t}fillPolygons(t,r){const n=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,s=r.zigzagOffset<0?n:r.zigzagOffset,o=ol(t,r=Object.assign({},r,{hachureGap:n+s}));return{type:"fillSketch",ops:this.zigzagLines(o,s,r)}}zigzagLines(t,r,n){const s=[];return t.forEach((o=>{const c=Ku(o),l=Math.round(c/(2*r));let h=o[0],d=o[1];h[0]>d[0]&&(h=o[1],d=o[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let g=0;g<l;g++){const m=2*g*r,y=2*(g+1)*r,v=Math.sqrt(2*Math.pow(r,2)),b=[h[0]+m*Math.cos(f),h[1]+m*Math.sin(f)],k=[h[0]+y*Math.cos(f),h[1]+y*Math.sin(f)],T=[b[0]+v*Math.cos(f+Math.PI/4),b[1]+v*Math.sin(f+Math.PI/4)];s.push(...this.helper.doubleLineOps(b[0],b[1],T[0],T[1],n),...this.helper.doubleLineOps(T[0],T[1],k[0],k[1],n))}})),s}}const br={};class W5{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const H5=0,rf=1,ux=2,wc={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 nf(e,t){return e.type===t}function og(e){const t=[],r=(function(c){const l=new Array;for(;c!=="";)if(c.match(/^([ \t\r\n,]+)/))c=c.substr(RegExp.$1.length);else if(c.match(/^([aAcChHlLmMqQsStTvVzZ])/))l[l.length]={type:H5,text:RegExp.$1},c=c.substr(RegExp.$1.length);else{if(!c.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];l[l.length]={type:rf,text:`${parseFloat(RegExp.$1)}`},c=c.substr(RegExp.$1.length)}return l[l.length]={type:ux,text:""},l})(e);let n="BOD",s=0,o=r[s];for(;!nf(o,ux);){let c=0;const l=[];if(n==="BOD"){if(o.text!=="M"&&o.text!=="m")return og("M0,0"+e);s++,c=wc[o.text],n=o.text}else nf(o,rf)?c=wc[n]:(s++,c=wc[o.text],n=o.text);if(!(s+c<r.length))throw new Error("Path data ended short");for(let h=s;h<s+c;h++){const d=r[h];if(!nf(d,rf))throw new Error("Param not a number: "+n+","+d.text);l[l.length]=+d.text}if(typeof wc[n]!="number")throw new Error("Bad segment: "+n);{const h={key:n,data:l};t.push(h),s+=c,o=r[s],n==="M"&&(n="L"),n==="m"&&(n="l")}}return t}function B2(e){let t=0,r=0,n=0,s=0;const o=[];for(const{key:c,data:l}of e)switch(c){case"M":o.push({key:"M",data:[...l]}),[t,r]=l,[n,s]=l;break;case"m":t+=l[0],r+=l[1],o.push({key:"M",data:[t,r]}),n=t,s=r;break;case"L":o.push({key:"L",data:[...l]}),[t,r]=l;break;case"l":t+=l[0],r+=l[1],o.push({key:"L",data:[t,r]});break;case"C":o.push({key:"C",data:[...l]}),t=l[4],r=l[5];break;case"c":{const h=l.map(((d,f)=>f%2?d+r:d+t));o.push({key:"C",data:h}),t=h[4],r=h[5];break}case"Q":o.push({key:"Q",data:[...l]}),t=l[2],r=l[3];break;case"q":{const h=l.map(((d,f)=>f%2?d+r:d+t));o.push({key:"Q",data:h}),t=h[2],r=h[3];break}case"A":o.push({key:"A",data:[...l]}),t=l[5],r=l[6];break;case"a":t+=l[5],r+=l[6],o.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],t,r]});break;case"H":o.push({key:"H",data:[...l]}),t=l[0];break;case"h":t+=l[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...l]}),r=l[0];break;case"v":r+=l[0],o.push({key:"V",data:[r]});break;case"S":o.push({key:"S",data:[...l]}),t=l[2],r=l[3];break;case"s":{const h=l.map(((d,f)=>f%2?d+r:d+t));o.push({key:"S",data:h}),t=h[2],r=h[3];break}case"T":o.push({key:"T",data:[...l]}),t=l[0],r=l[1];break;case"t":t+=l[0],r+=l[1],o.push({key:"T",data:[t,r]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=n,r=s}return o}function A2(e){const t=[];let r="",n=0,s=0,o=0,c=0,l=0,h=0;for(const{key:d,data:f}of e){switch(d){case"M":t.push({key:"M",data:[...f]}),[n,s]=f,[o,c]=f;break;case"C":t.push({key:"C",data:[...f]}),n=f[4],s=f[5],l=f[2],h=f[3];break;case"L":t.push({key:"L",data:[...f]}),[n,s]=f;break;case"H":n=f[0],t.push({key:"L",data:[n,s]});break;case"V":s=f[0],t.push({key:"L",data:[n,s]});break;case"S":{let g=0,m=0;r==="C"||r==="S"?(g=n+(n-l),m=s+(s-h)):(g=n,m=s),t.push({key:"C",data:[g,m,...f]}),l=f[0],h=f[1],n=f[2],s=f[3];break}case"T":{const[g,m]=f;let y=0,v=0;r==="Q"||r==="T"?(y=n+(n-l),v=s+(s-h)):(y=n,v=s);const b=n+2*(y-n)/3,k=s+2*(v-s)/3,T=g+2*(y-g)/3,_=m+2*(v-m)/3;t.push({key:"C",data:[b,k,T,_,g,m]}),l=y,h=v,n=g,s=m;break}case"Q":{const[g,m,y,v]=f,b=n+2*(g-n)/3,k=s+2*(m-s)/3,T=y+2*(g-y)/3,_=v+2*(m-v)/3;t.push({key:"C",data:[b,k,T,_,y,v]}),l=g,h=m,n=y,s=v;break}case"A":{const g=Math.abs(f[0]),m=Math.abs(f[1]),y=f[2],v=f[3],b=f[4],k=f[5],T=f[6];g===0||m===0?(t.push({key:"C",data:[n,s,k,T,k,T]}),n=k,s=T):(n!==k||s!==T)&&($2(n,s,k,T,g,m,y,v,b).forEach((function(_){t.push({key:"C",data:_})})),n=k,s=T);break}case"Z":t.push({key:"Z",data:[]}),n=o,s=c}r=d}return t}function So(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function $2(e,t,r,n,s,o,c,l,h,d){const f=(g=c,Math.PI*g/180);var g;let m=[],y=0,v=0,b=0,k=0;if(d)[y,v,b,k]=d;else{[e,t]=So(e,t,-f),[r,n]=So(r,n,-f);const rt=(e-r)/2,H=(t-n)/2;let q=rt*rt/(s*s)+H*H/(o*o);q>1&&(q=Math.sqrt(q),s*=q,o*=q);const N=s*s,Y=o*o,P=N*Y-N*H*H-Y*rt*rt,K=N*H*H+Y*rt*rt,et=(l===h?-1:1)*Math.sqrt(Math.abs(P/K));b=et*s*H/o+(e+r)/2,k=et*-o*rt/s+(t+n)/2,y=Math.asin(parseFloat(((t-k)/o).toFixed(9))),v=Math.asin(parseFloat(((n-k)/o).toFixed(9))),e<b&&(y=Math.PI-y),r<b&&(v=Math.PI-v),y<0&&(y=2*Math.PI+y),v<0&&(v=2*Math.PI+v),h&&y>v&&(y-=2*Math.PI),!h&&v>y&&(v-=2*Math.PI)}let T=v-y;if(Math.abs(T)>120*Math.PI/180){const rt=v,H=r,q=n;v=h&&v>y?y+120*Math.PI/180*1:y+120*Math.PI/180*-1,m=$2(r=b+s*Math.cos(v),n=k+o*Math.sin(v),H,q,s,o,c,0,h,[v,rt,b,k])}T=v-y;const _=Math.cos(y),B=Math.sin(y),L=Math.cos(v),A=Math.sin(v),E=Math.tan(T/4),$=4/3*s*E,z=4/3*o*E,Z=[e,t],W=[e+$*B,t-z*_],G=[r+$*A,n-z*L],it=[r,n];if(W[0]=2*Z[0]-W[0],W[1]=2*Z[1]-W[1],d)return[W,G,it].concat(m);{m=[W,G,it].concat(m);const rt=[];for(let H=0;H<m.length;H+=3){const q=So(m[H][0],m[H][1],f),N=So(m[H+1][0],m[H+1][1],f),Y=So(m[H+2][0],m[H+2][1],f);rt.push([q[0],q[1],N[0],N[1],Y[0],Y[1]])}return rt}}const q5={randOffset:function(e,t){return Ot(e,t)},randOffsetWithRange:function(e,t,r){return wu(e,t,r)},ellipse:function(e,t,r,n,s){const o=F2(r,n,s);return Qf(e,t,s,o).opset},doubleLineOps:function(e,t,r,n,s){return Ii(e,t,r,n,s,!0)}};function R2(e,t,r,n,s){return{type:"path",ops:Ii(e,t,r,n,s)}}function Wc(e,t,r){const n=(e||[]).length;if(n>2){const s=[];for(let o=0;o<n-1;o++)s.push(...Ii(e[o][0],e[o][1],e[o+1][0],e[o+1][1],r));return t&&s.push(...Ii(e[n-1][0],e[n-1][1],e[0][0],e[0][1],r)),{type:"path",ops:s}}return n===2?R2(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function U5(e,t,r,n,s){return(function(o,c){return Wc(o,!0,c)})([[e,t],[e+r,t],[e+r,t+n],[e,t+n]],s)}function hx(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,n=kc(r[0],1*(1+.2*t.roughness),t),s=t.disableMultiStroke?[]:kc(r[0],1.5*(1+.22*t.roughness),px(t));for(let o=1;o<r.length;o++){const c=r[o];if(c.length){const l=kc(c,1*(1+.2*t.roughness),t),h=t.disableMultiStroke?[]:kc(c,1.5*(1+.22*t.roughness),px(t));for(const d of l)d.op!=="move"&&n.push(d);for(const d of h)d.op!=="move"&&s.push(d)}}return{type:"path",ops:n.concat(s)}}return{type:"path",ops:[]}}function F2(e,t,r){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),s=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*n)),o=2*Math.PI/s;let c=Math.abs(e/2),l=Math.abs(t/2);const h=1-r.curveFitting;return c+=Ot(c*h,r),l+=Ot(l*h,r),{increment:o,rx:c,ry:l}}function Qf(e,t,r,n){const[s,o]=gx(n.increment,e,t,n.rx,n.ry,1,n.increment*wu(.1,wu(.4,1,r),r),r);let c=ku(s,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[l]=gx(n.increment,e,t,n.rx,n.ry,1.5,0,r),h=ku(l,null,r);c=c.concat(h)}return{estimatedPoints:o,opset:{type:"path",ops:c}}}function dx(e,t,r,n,s,o,c,l,h){const d=e,f=t;let g=Math.abs(r/2),m=Math.abs(n/2);g+=Ot(.01*g,h),m+=Ot(.01*m,h);let y=s,v=o;for(;y<0;)y+=2*Math.PI,v+=2*Math.PI;v-y>2*Math.PI&&(y=0,v=2*Math.PI);const b=2*Math.PI/h.curveStepCount,k=Math.min(b/2,(v-y)/2),T=mx(k,d,f,g,m,y,v,1,h);if(!h.disableMultiStroke){const _=mx(k,d,f,g,m,y,v,1.5,h);T.push(..._)}return c&&(l?T.push(...Ii(d,f,d+g*Math.cos(y),f+m*Math.sin(y),h),...Ii(d,f,d+g*Math.cos(v),f+m*Math.sin(v),h)):T.push({op:"lineTo",data:[d,f]},{op:"lineTo",data:[d+g*Math.cos(y),f+m*Math.sin(y)]})),{type:"path",ops:T}}function fx(e,t){const r=A2(B2(og(e))),n=[];let s=[0,0],o=[0,0];for(const{key:c,data:l}of r)switch(c){case"M":o=[l[0],l[1]],s=[l[0],l[1]];break;case"L":n.push(...Ii(o[0],o[1],l[0],l[1],t)),o=[l[0],l[1]];break;case"C":{const[h,d,f,g,m,y]=l;n.push(...G5(h,d,f,g,m,y,o,t)),o=[m,y];break}case"Z":n.push(...Ii(o[0],o[1],s[0],s[1],t)),o=[s[0],s[1]]}return{type:"path",ops:n}}function sf(e,t){const r=[];for(const n of e)if(n.length){const s=t.maxRandomnessOffset||0,o=n.length;if(o>2){r.push({op:"move",data:[n[0][0]+Ot(s,t),n[0][1]+Ot(s,t)]});for(let c=1;c<o;c++)r.push({op:"lineTo",data:[n[c][0]+Ot(s,t),n[c][1]+Ot(s,t)]})}}return{type:"fillPath",ops:r}}function Zs(e,t){return(function(r,n){let s=r.fillStyle||"hachure";if(!br[s])switch(s){case"zigzag":br[s]||(br[s]=new D5(n));break;case"cross-hatch":br[s]||(br[s]=new O5(n));break;case"dots":br[s]||(br[s]=new z5(n));break;case"dashed":br[s]||(br[s]=new j5(n));break;case"zigzag-line":br[s]||(br[s]=new N5(n));break;default:s="hachure",br[s]||(br[s]=new ag(n))}return br[s]})(t,q5).fillPolygons(e,t)}function px(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function I2(e){return e.randomizer||(e.randomizer=new W5(e.seed||0)),e.randomizer.next()}function wu(e,t,r,n=1){return r.roughness*n*(I2(r)*(t-e)+e)}function Ot(e,t,r=1){return wu(-e,e,t,r)}function Ii(e,t,r,n,s,o=!1){const c=o?s.disableMultiStrokeFill:s.disableMultiStroke,l=Kf(e,t,r,n,s,!0,!1);if(c)return l;const h=Kf(e,t,r,n,s,!0,!0);return l.concat(h)}function Kf(e,t,r,n,s,o,c){const l=Math.pow(e-r,2)+Math.pow(t-n,2),h=Math.sqrt(l);let d=1;d=h<200?1:h>500?.4:-.0016668*h+1.233334;let f=s.maxRandomnessOffset||0;f*f*100>l&&(f=h/10);const g=f/2,m=.2+.2*I2(s);let y=s.bowing*s.maxRandomnessOffset*(n-t)/200,v=s.bowing*s.maxRandomnessOffset*(e-r)/200;y=Ot(y,s,d),v=Ot(v,s,d);const b=[],k=()=>Ot(g,s,d),T=()=>Ot(f,s,d),_=s.preserveVertices;return c?b.push({op:"move",data:[e+(_?0:k()),t+(_?0:k())]}):b.push({op:"move",data:[e+(_?0:Ot(f,s,d)),t+(_?0:Ot(f,s,d))]}),c?b.push({op:"bcurveTo",data:[y+e+(r-e)*m+k(),v+t+(n-t)*m+k(),y+e+2*(r-e)*m+k(),v+t+2*(n-t)*m+k(),r+(_?0:k()),n+(_?0:k())]}):b.push({op:"bcurveTo",data:[y+e+(r-e)*m+T(),v+t+(n-t)*m+T(),y+e+2*(r-e)*m+T(),v+t+2*(n-t)*m+T(),r+(_?0:T()),n+(_?0:T())]}),b}function kc(e,t,r){if(!e.length)return[];const n=[];n.push([e[0][0]+Ot(t,r),e[0][1]+Ot(t,r)]),n.push([e[0][0]+Ot(t,r),e[0][1]+Ot(t,r)]);for(let s=1;s<e.length;s++)n.push([e[s][0]+Ot(t,r),e[s][1]+Ot(t,r)]),s===e.length-1&&n.push([e[s][0]+Ot(t,r),e[s][1]+Ot(t,r)]);return ku(n,null,r)}function ku(e,t,r){const n=e.length,s=[];if(n>3){const o=[],c=1-r.curveTightness;s.push({op:"move",data:[e[1][0],e[1][1]]});for(let l=1;l+2<n;l++){const h=e[l];o[0]=[h[0],h[1]],o[1]=[h[0]+(c*e[l+1][0]-c*e[l-1][0])/6,h[1]+(c*e[l+1][1]-c*e[l-1][1])/6],o[2]=[e[l+1][0]+(c*e[l][0]-c*e[l+2][0])/6,e[l+1][1]+(c*e[l][1]-c*e[l+2][1])/6],o[3]=[e[l+1][0],e[l+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 n===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]]})):n===2&&s.push(...Kf(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return s}function gx(e,t,r,n,s,o,c,l){const h=[],d=[];if(l.roughness===0){e/=4,d.push([t+n*Math.cos(-e),r+s*Math.sin(-e)]);for(let f=0;f<=2*Math.PI;f+=e){const g=[t+n*Math.cos(f),r+s*Math.sin(f)];h.push(g),d.push(g)}d.push([t+n*Math.cos(0),r+s*Math.sin(0)]),d.push([t+n*Math.cos(e),r+s*Math.sin(e)])}else{const f=Ot(.5,l)-Math.PI/2;d.push([Ot(o,l)+t+.9*n*Math.cos(f-e),Ot(o,l)+r+.9*s*Math.sin(f-e)]);const g=2*Math.PI+f-.01;for(let m=f;m<g;m+=e){const y=[Ot(o,l)+t+n*Math.cos(m),Ot(o,l)+r+s*Math.sin(m)];h.push(y),d.push(y)}d.push([Ot(o,l)+t+n*Math.cos(f+2*Math.PI+.5*c),Ot(o,l)+r+s*Math.sin(f+2*Math.PI+.5*c)]),d.push([Ot(o,l)+t+.98*n*Math.cos(f+c),Ot(o,l)+r+.98*s*Math.sin(f+c)]),d.push([Ot(o,l)+t+.9*n*Math.cos(f+.5*c),Ot(o,l)+r+.9*s*Math.sin(f+.5*c)])}return[d,h]}function mx(e,t,r,n,s,o,c,l,h){const d=o+Ot(.1,h),f=[];f.push([Ot(l,h)+t+.9*n*Math.cos(d-e),Ot(l,h)+r+.9*s*Math.sin(d-e)]);for(let g=d;g<=c;g+=e)f.push([Ot(l,h)+t+n*Math.cos(g),Ot(l,h)+r+s*Math.sin(g)]);return f.push([t+n*Math.cos(c),r+s*Math.sin(c)]),f.push([t+n*Math.cos(c),r+s*Math.sin(c)]),ku(f,null,h)}function G5(e,t,r,n,s,o,c,l){const h=[],d=[l.maxRandomnessOffset||1,(l.maxRandomnessOffset||1)+.3];let f=[0,0];const g=l.disableMultiStroke?1:2,m=l.preserveVertices;for(let y=0;y<g;y++)y===0?h.push({op:"move",data:[c[0],c[1]]}):h.push({op:"move",data:[c[0]+(m?0:Ot(d[0],l)),c[1]+(m?0:Ot(d[0],l))]}),f=m?[s,o]:[s+Ot(d[y],l),o+Ot(d[y],l)],h.push({op:"bcurveTo",data:[e+Ot(d[y],l),t+Ot(d[y],l),r+Ot(d[y],l),n+Ot(d[y],l),f[0],f[1]]});return h}function Co(e){return[...e]}function yx(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const n=[];if(r===3)n.push(Co(e[0]),Co(e[1]),Co(e[2]),Co(e[2]));else{const s=[];s.push(e[0],e[0]);for(let l=1;l<e.length;l++)s.push(e[l]),l===e.length-1&&s.push(e[l]);const o=[],c=1-t;n.push(Co(s[0]));for(let l=1;l+2<s.length;l++){const h=s[l];o[0]=[h[0],h[1]],o[1]=[h[0]+(c*s[l+1][0]-c*s[l-1][0])/6,h[1]+(c*s[l+1][1]-c*s[l-1][1])/6],o[2]=[s[l+1][0]+(c*s[l][0]-c*s[l+2][0])/6,s[l+1][1]+(c*s[l][1]-c*s[l+2][1])/6],o[3]=[s[l+1][0],s[l+1][1]],n.push(o[1],o[2],o[3])}}return n}function Hc(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function V5(e,t,r){const n=Hc(t,r);if(n===0)return Hc(e,t);let s=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/n;return s=Math.max(0,Math.min(1,s)),Hc(e,ss(t,r,s))}function ss(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Zf(e,t,r,n){const s=n||[];if((function(l,h){const d=l[h+0],f=l[h+1],g=l[h+2],m=l[h+3];let y=3*f[0]-2*d[0]-m[0];y*=y;let v=3*f[1]-2*d[1]-m[1];v*=v;let b=3*g[0]-2*m[0]-d[0];b*=b;let k=3*g[1]-2*m[1]-d[1];return k*=k,y<b&&(y=b),v<k&&(v=k),y+v})(e,t)<r){const l=e[t+0];s.length?(o=s[s.length-1],c=l,Math.sqrt(Hc(o,c))>1&&s.push(l)):s.push(l),s.push(e[t+3])}else{const h=e[t+0],d=e[t+1],f=e[t+2],g=e[t+3],m=ss(h,d,.5),y=ss(d,f,.5),v=ss(f,g,.5),b=ss(m,y,.5),k=ss(y,v,.5),T=ss(b,k,.5);Zf([h,m,b,T],0,r,s),Zf([T,k,v,g],0,r,s)}var o,c;return s}function Y5(e,t){return _u(e,0,e.length,t)}function _u(e,t,r,n,s){const o=s||[],c=e[t],l=e[r-1];let h=0,d=1;for(let f=t+1;f<r-1;++f){const g=V5(e[f],c,l);g>h&&(h=g,d=f)}return Math.sqrt(h)>n?(_u(e,t,d+1,n,o),_u(e,d,r,n,o)):(o.length||o.push(c),o.push(l)),o}function af(e,t=.15,r){const n=[],s=(e.length-1)/3;for(let o=0;o<s;o++)Zf(e,3*o,t,n);return r&&r>0?_u(n,0,n.length,r):n}const $r="none";class Tu{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,n){return{shape:t,sets:r||[],options:n||this.defaultOptions}}line(t,r,n,s,o){const c=this._o(o);return this._d("line",[R2(t,r,n,s,c)],c)}rectangle(t,r,n,s,o){const c=this._o(o),l=[],h=U5(t,r,n,s,c);if(c.fill){const d=[[t,r],[t+n,r],[t+n,r+s],[t,r+s]];c.fillStyle==="solid"?l.push(sf([d],c)):l.push(Zs([d],c))}return c.stroke!==$r&&l.push(h),this._d("rectangle",l,c)}ellipse(t,r,n,s,o){const c=this._o(o),l=[],h=F2(n,s,c),d=Qf(t,r,c,h);if(c.fill)if(c.fillStyle==="solid"){const f=Qf(t,r,c,h).opset;f.type="fillPath",l.push(f)}else l.push(Zs([d.estimatedPoints],c));return c.stroke!==$r&&l.push(d.opset),this._d("ellipse",l,c)}circle(t,r,n,s){const o=this.ellipse(t,r,n,n,s);return o.shape="circle",o}linearPath(t,r){const n=this._o(r);return this._d("linearPath",[Wc(t,!1,n)],n)}arc(t,r,n,s,o,c,l=!1,h){const d=this._o(h),f=[],g=dx(t,r,n,s,o,c,l,!0,d);if(l&&d.fill)if(d.fillStyle==="solid"){const m=Object.assign({},d);m.disableMultiStroke=!0;const y=dx(t,r,n,s,o,c,!0,!1,m);y.type="fillPath",f.push(y)}else f.push((function(m,y,v,b,k,T,_){const B=m,L=y;let A=Math.abs(v/2),E=Math.abs(b/2);A+=Ot(.01*A,_),E+=Ot(.01*E,_);let $=k,z=T;for(;$<0;)$+=2*Math.PI,z+=2*Math.PI;z-$>2*Math.PI&&($=0,z=2*Math.PI);const Z=(z-$)/_.curveStepCount,W=[];for(let G=$;G<=z;G+=Z)W.push([B+A*Math.cos(G),L+E*Math.sin(G)]);return W.push([B+A*Math.cos(z),L+E*Math.sin(z)]),W.push([B,L]),Zs([W],_)})(t,r,n,s,o,c,d));return d.stroke!==$r&&f.push(g),this._d("arc",f,d)}curve(t,r){const n=this._o(r),s=[],o=hx(t,n);if(n.fill&&n.fill!==$r)if(n.fillStyle==="solid"){const c=hx(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(c.ops)})}else{const c=[],l=t;if(l.length){const h=typeof l[0][0]=="number"?[l]:l;for(const d of h)d.length<3?c.push(...d):d.length===3?c.push(...af(yx([d[0],d[0],d[1],d[2]]),10,(1+n.roughness)/2)):c.push(...af(yx(d),10,(1+n.roughness)/2))}c.length&&s.push(Zs([c],n))}return n.stroke!==$r&&s.push(o),this._d("curve",s,n)}polygon(t,r){const n=this._o(r),s=[],o=Wc(t,!0,n);return n.fill&&(n.fillStyle==="solid"?s.push(sf([t],n)):s.push(Zs([t],n))),n.stroke!==$r&&s.push(o),this._d("polygon",s,n)}path(t,r){const n=this._o(r),s=[];if(!t)return this._d("path",s,n);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=n.fill&&n.fill!=="transparent"&&n.fill!==$r,c=n.stroke!==$r,l=!!(n.simplification&&n.simplification<1),h=(function(f,g,m){const y=A2(B2(og(f))),v=[];let b=[],k=[0,0],T=[];const _=()=>{T.length>=4&&b.push(...af(T,g)),T=[]},B=()=>{_(),b.length&&(v.push(b),b=[])};for(const{key:A,data:E}of y)switch(A){case"M":B(),k=[E[0],E[1]],b.push(k);break;case"L":_(),b.push([E[0],E[1]]);break;case"C":if(!T.length){const $=b.length?b[b.length-1]:k;T.push([$[0],$[1]])}T.push([E[0],E[1]]),T.push([E[2],E[3]]),T.push([E[4],E[5]]);break;case"Z":_(),b.push([k[0],k[1]])}if(B(),!m)return v;const L=[];for(const A of v){const E=Y5(A,m);E.length&&L.push(E)}return L})(t,1,l?4-4*(n.simplification||1):(1+n.roughness)/2),d=fx(t,n);if(o)if(n.fillStyle==="solid")if(h.length===1){const f=fx(t,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));s.push({type:"fillPath",ops:this._mergedShape(f.ops)})}else s.push(sf(h,n));else s.push(Zs(h,n));return c&&(l?h.forEach((f=>{s.push(Wc(f,!1,n))})):s.push(d)),this._d("path",s,n)}opsToPath(t,r){let n="";for(const s of t.ops){const o=typeof r=="number"&&r>=0?s.data.map((c=>+c.toFixed(r))):s.data;switch(s.op){case"move":n+=`M${o[0]} ${o[1]} `;break;case"bcurveTo":n+=`C${o[0]} ${o[1]}, ${o[2]} ${o[3]}, ${o[4]} ${o[5]} `;break;case"lineTo":n+=`L${o[0]} ${o[1]} `}}return n.trim()}toPaths(t){const r=t.sets||[],n=t.options||this.defaultOptions,s=[];for(const o of r){let c=null;switch(o.type){case"path":c={d:this.opsToPath(o),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:$r};break;case"fillPath":c={d:this.opsToPath(o),stroke:$r,strokeWidth:0,fill:n.fill||$r};break;case"fillSketch":c=this.fillSketch(o,n)}c&&s.push(c)}return s}fillSketch(t,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||$r,strokeWidth:n,fill:$r}}_mergedShape(t){return t.filter(((r,n)=>n===0||r.op!=="move"))}}class X5{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Tu(r)}draw(t){const r=t.sets||[],n=t.options||this.getDefaultOptions(),s=this.ctx,o=t.options.fixedDecimalPlaceDigits;for(const c of r)switch(c.type){case"path":s.save(),s.strokeStyle=n.stroke==="none"?"transparent":n.stroke,s.lineWidth=n.strokeWidth,n.strokeLineDash&&s.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(s.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(s,c,o),s.restore();break;case"fillPath":{s.save(),s.fillStyle=n.fill||"";const l=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(s,c,o,l),s.restore();break}case"fillSketch":this.fillSketch(s,c,n)}}fillSketch(t,r,n){let s=n.fillWeight;s<0&&(s=n.strokeWidth/2),t.save(),n.fillLineDash&&t.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(t.lineDashOffset=n.fillLineDashOffset),t.strokeStyle=n.fill||"",t.lineWidth=s,this._drawToContext(t,r,n.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,n,s="nonzero"){t.beginPath();for(const o of r.ops){const c=typeof n=="number"&&n>=0?o.data.map((l=>+l.toFixed(n))):o.data;switch(o.op){case"move":t.moveTo(c[0],c[1]);break;case"bcurveTo":t.bezierCurveTo(c[0],c[1],c[2],c[3],c[4],c[5]);break;case"lineTo":t.lineTo(c[0],c[1])}}r.type==="fillPath"?t.fill(s):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,n,s,o){const c=this.gen.line(t,r,n,s,o);return this.draw(c),c}rectangle(t,r,n,s,o){const c=this.gen.rectangle(t,r,n,s,o);return this.draw(c),c}ellipse(t,r,n,s,o){const c=this.gen.ellipse(t,r,n,s,o);return this.draw(c),c}circle(t,r,n,s){const o=this.gen.circle(t,r,n,s);return this.draw(o),o}linearPath(t,r){const n=this.gen.linearPath(t,r);return this.draw(n),n}polygon(t,r){const n=this.gen.polygon(t,r);return this.draw(n),n}arc(t,r,n,s,o,c,l=!1,h){const d=this.gen.arc(t,r,n,s,o,c,l,h);return this.draw(d),d}curve(t,r){const n=this.gen.curve(t,r);return this.draw(n),n}path(t,r){const n=this.gen.path(t,r);return this.draw(n),n}}const _c="http://www.w3.org/2000/svg";class Q5{constructor(t,r){this.svg=t,this.gen=new Tu(r)}draw(t){const r=t.sets||[],n=t.options||this.getDefaultOptions(),s=this.svg.ownerDocument||window.document,o=s.createElementNS(_c,"g"),c=t.options.fixedDecimalPlaceDigits;for(const l of r){let h=null;switch(l.type){case"path":h=s.createElementNS(_c,"path"),h.setAttribute("d",this.opsToPath(l,c)),h.setAttribute("stroke",n.stroke),h.setAttribute("stroke-width",n.strokeWidth+""),h.setAttribute("fill","none"),n.strokeLineDash&&h.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&h.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":h=s.createElementNS(_c,"path"),h.setAttribute("d",this.opsToPath(l,c)),h.setAttribute("stroke","none"),h.setAttribute("stroke-width","0"),h.setAttribute("fill",n.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||h.setAttribute("fill-rule","evenodd");break;case"fillSketch":h=this.fillSketch(s,l,n)}h&&o.appendChild(h)}return o}fillSketch(t,r,n){let s=n.fillWeight;s<0&&(s=n.strokeWidth/2);const o=t.createElementNS(_c,"path");return o.setAttribute("d",this.opsToPath(r,n.fixedDecimalPlaceDigits)),o.setAttribute("stroke",n.fill||""),o.setAttribute("stroke-width",s+""),o.setAttribute("fill","none"),n.fillLineDash&&o.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,n,s,o){const c=this.gen.line(t,r,n,s,o);return this.draw(c)}rectangle(t,r,n,s,o){const c=this.gen.rectangle(t,r,n,s,o);return this.draw(c)}ellipse(t,r,n,s,o){const c=this.gen.ellipse(t,r,n,s,o);return this.draw(c)}circle(t,r,n,s){const o=this.gen.circle(t,r,n,s);return this.draw(o)}linearPath(t,r){const n=this.gen.linearPath(t,r);return this.draw(n)}polygon(t,r){const n=this.gen.polygon(t,r);return this.draw(n)}arc(t,r,n,s,o,c,l=!1,h){const d=this.gen.arc(t,r,n,s,o,c,l,h);return this.draw(d)}curve(t,r){const n=this.gen.curve(t,r);return this.draw(n)}path(t,r){const n=this.gen.path(t,r);return this.draw(n)}}var wt={canvas:(e,t)=>new X5(e,t),svg:(e,t)=>new Q5(e,t),generator:e=>new Tu(e),newSeed:()=>Tu.newSeed()},Dt=w(async(e,t,r)=>{var g,m;let n;const s=t.useHtmlLabels||Le((g=Jt())==null?void 0:g.htmlLabels);r?n=r:n="node default";const o=e.insert("g").attr("class",n).attr("id",t.domId||t.id),c=o.insert("g").attr("class","label").attr("style",Ke(t.labelStyle));let l;t.label===void 0?l="":l=typeof t.label=="string"?t.label:t.label[0];const h=await Oi(c,Zr(_s(l),Jt()),{useHtmlLabels:s,width:t.width||((m=Jt().flowchart)==null?void 0:m.wrappingWidth),cssClasses:"markdown-node-label",style:t.labelStyle,addSvgBackground:!!t.icon||!!t.img});let d=h.getBBox();const f=((t==null?void 0:t.padding)??0)/2;if(s){const y=h.children[0],v=Gt(h),b=y.getElementsByTagName("img");if(b){const k=l.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...b].map(T=>new Promise(_=>{function B(){if(T.style.display="flex",T.style.flexDirection="column",k){const L=Jt().fontSize?Jt().fontSize:window.getComputedStyle(document.body).fontSize,A=5,[E=a1.fontSize]=Yu(L),$=E*A+"px";T.style.minWidth=$,T.style.maxWidth=$}else T.style.width="100%";_(T)}w(B,"setupImage"),setTimeout(()=>{T.complete&&B()}),T.addEventListener("error",B),T.addEventListener("load",B)})))}d=y.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height)}return s?c.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):c.attr("transform","translate(0, "+-d.height/2+")"),t.centerLabel&&c.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:o,bbox:d,halfPadding:f,label:c}},"labelHelper"),of=w(async(e,t,r)=>{var h,d,f,g,m,y;const n=r.useHtmlLabels||Le((d=(h=Jt())==null?void 0:h.flowchart)==null?void 0:d.htmlLabels),s=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),o=await Oi(s,Zr(_s(t),Jt()),{useHtmlLabels:n,width:r.width||((g=(f=Jt())==null?void 0:f.flowchart)==null?void 0:g.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let c=o.getBBox();const l=r.padding/2;if(Le((y=(m=Jt())==null?void 0:m.flowchart)==null?void 0:y.htmlLabels)){const v=o.children[0],b=Gt(o);c=v.getBoundingClientRect(),b.attr("width",c.width),b.attr("height",c.height)}return n?s.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"):s.attr("transform","translate(0, "+-c.height/2+")"),r.centerLabel&&s.attr("transform","translate("+-c.width/2+", "+-c.height/2+")"),s.insert("rect",":first-child"),{shapeSvg:e,bbox:c,halfPadding:l,label:s}},"insertLabel"),Lt=w((e,t)=>{const r=t.node().getBBox();e.width=r.width,e.height=r.height},"updateNodeBounds"),Rt=w((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function Ut(e){const t=e.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}w(Ut,"createPathFromPoints");function Pi(e,t,r,n,s,o){const c=[],h=r-e,d=n-t,f=h/o,g=2*Math.PI/f,m=t+d/2;for(let y=0;y<=50;y++){const v=y/50,b=e+v*h,k=m+s*Math.sin(g*(b-e));c.push({x:b,y:k})}return c}w(Pi,"generateFullSineWavePoints");function Xo(e,t,r,n,s,o){const c=[],l=s*Math.PI/180,f=(o*Math.PI/180-l)/(n-1);for(let g=0;g<n;g++){const m=l+g*f,y=e+r*Math.cos(m),v=t+r*Math.sin(m);c.push({x:-y,y:-v})}return c}w(Xo,"generateCirclePoints");var K5=w((e,t)=>{var r=e.x,n=e.y,s=t.x-r,o=t.y-n,c=e.width/2,l=e.height/2,h,d;return Math.abs(o)*c>Math.abs(s)*l?(o<0&&(l=-l),h=o===0?0:l*s/o,d=l):(s<0&&(c=-c),h=c,d=s===0?0:c*o/s),{x:r+h,y:n+d}},"intersectRect"),_a=K5;function P2(e,t){t&&e.attr("style",t)}w(P2,"applyStyle");async function D2(e){const t=Gt(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),r=t.append("xhtml:div"),n=Jt();let s=e.label;e.label&&pa(e.label)&&(s=await wp(e.label.replace(Sa.lineBreakRegex,`
226
+ `),n));const c='<span class="'+(e.isNode?"nodeLabel":"edgeLabel")+'" '+(e.labelStyle?'style="'+e.labelStyle+'"':"")+">"+s+"</span>";return r.html(Zr(c,n)),P2(r,e.labelStyle),r.style("display","inline-block"),r.style("padding-right","1px"),r.style("white-space","nowrap"),r.attr("xmlns","http://www.w3.org/1999/xhtml"),t.node()}w(D2,"addHtmlLabel");var Z5=w(async(e,t,r,n)=>{let s=e||"";if(typeof s=="object"&&(s=s[0]),Le(Jt().flowchart.htmlLabels)){s=s.replace(/\\n|\n/g,"<br />"),nt.info("vertexText"+s);const o={isNode:n,label:_s(s).replace(/fa[blrs]?:fa-[\w-]+/g,l=>`<i class='${l.replace(":"," ")}'></i>`),labelStyle:t&&t.replace("fill:","color:")};return await D2(o)}else{const o=document.createElementNS("http://www.w3.org/2000/svg","text");o.setAttribute("style",t.replace("color:","fill:"));let c=[];typeof s=="string"?c=s.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(s)?c=s:c=[];for(const l of c){const h=document.createElementNS("http://www.w3.org/2000/svg","tspan");h.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),h.setAttribute("dy","1em"),h.setAttribute("x","0"),r?h.setAttribute("class","title-row"):h.setAttribute("class","row"),h.textContent=l.trim(),o.appendChild(h)}return o}},"createLabel"),hs=Z5,zi=w((e,t,r,n,s)=>["M",e+s,t,"H",e+r-s,"A",s,s,0,0,1,e+r,t+s,"V",t+n-s,"A",s,s,0,0,1,e+r-s,t+n,"H",e+s,"A",s,s,0,0,1,e,t+n-s,"V",t+s,"A",s,s,0,0,1,e+s,t,"Z"].join(" "),"createRoundedRectPathD"),O2=w(async(e,t)=>{nt.info("Creating subgraph rect for ",t.id,t);const r=Jt(),{themeVariables:n,handDrawnSeed:s}=r,{clusterBkg:o,clusterBorder:c}=n,{labelStyles:l,nodeStyles:h,borderStyles:d,backgroundStyles:f}=Tt(t),g=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),m=Le(r.flowchart.htmlLabels),y=g.insert("g").attr("class","cluster-label "),v=await Oi(y,t.label,{style:t.labelStyle,useHtmlLabels:m,isNode:!0});let b=v.getBBox();if(Le(r.flowchart.htmlLabels)){const $=v.children[0],z=Gt(v);b=$.getBoundingClientRect(),z.attr("width",b.width),z.attr("height",b.height)}const k=t.width<=b.width+t.padding?b.width+t.padding:t.width;t.width<=b.width+t.padding?t.diff=(k-t.width)/2-t.padding:t.diff=-t.padding;const T=t.height,_=t.x-k/2,B=t.y-T/2;nt.trace("Data ",t,JSON.stringify(t));let L;if(t.look==="handDrawn"){const $=wt.svg(g),z=_t(t,{roughness:.7,fill:o,stroke:c,fillWeight:3,seed:s}),Z=$.path(zi(_,B,k,T,0),z);L=g.insert(()=>(nt.debug("Rough node insert CXC",Z),Z),":first-child"),L.select("path:nth-child(2)").attr("style",d.join(";")),L.select("path").attr("style",f.join(";").replace("fill","stroke"))}else L=g.insert("rect",":first-child"),L.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",_).attr("y",B).attr("width",k).attr("height",T);const{subGraphTitleTopMargin:A}=Yp(r);if(y.attr("transform",`translate(${t.x-b.width/2}, ${t.y-t.height/2+A})`),l){const $=y.select("span");$&&$.attr("style",l)}const E=L.node().getBBox();return t.offsetX=0,t.width=E.width,t.height=E.height,t.offsetY=b.height-t.padding/2,t.intersect=function($){return _a(t,$)},{cluster:g,labelBBox:b}},"rect"),J5=w((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.id),n=r.insert("rect",":first-child"),s=0*t.padding,o=s/2;n.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 c=n.node().getBBox();return t.width=c.width,t.height=c.height,t.intersect=function(l){return _a(t,l)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),t4=w(async(e,t)=>{const r=Jt(),{themeVariables:n,handDrawnSeed:s}=r,{altBackground:o,compositeBackground:c,compositeTitleBackground:l,nodeBorder:h}=n,d=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-id",t.id).attr("data-look",t.look),f=d.insert("g",":first-child"),g=d.insert("g").attr("class","cluster-label");let m=d.append("rect");const y=g.node().appendChild(await hs(t.label,t.labelStyle,void 0,!0));let v=y.getBBox();if(Le(r.flowchart.htmlLabels)){const Z=y.children[0],W=Gt(y);v=Z.getBoundingClientRect(),W.attr("width",v.width),W.attr("height",v.height)}const b=0*t.padding,k=b/2,T=(t.width<=v.width+t.padding?v.width+t.padding:t.width)+b;t.width<=v.width+t.padding?t.diff=(T-t.width)/2-t.padding:t.diff=-t.padding;const _=t.height+b,B=t.height+b-v.height-6,L=t.x-T/2,A=t.y-_/2;t.width=T;const E=t.y-t.height/2-k+v.height+2;let $;if(t.look==="handDrawn"){const Z=t.cssClasses.includes("statediagram-cluster-alt"),W=wt.svg(d),G=t.rx||t.ry?W.path(zi(L,A,T,_,10),{roughness:.7,fill:l,fillStyle:"solid",stroke:h,seed:s}):W.rectangle(L,A,T,_,{seed:s});$=d.insert(()=>G,":first-child");const it=W.rectangle(L,E,T,B,{fill:Z?o:c,fillStyle:Z?"hachure":"solid",stroke:h,seed:s});$=d.insert(()=>G,":first-child"),m=d.insert(()=>it)}else $=f.insert("rect",":first-child"),$.attr("class","outer").attr("x",L).attr("y",A).attr("width",T).attr("height",_).attr("data-look",t.look),m.attr("class","inner").attr("x",L).attr("y",E).attr("width",T).attr("height",B);g.attr("transform",`translate(${t.x-v.width/2}, ${A+1-(Le(r.flowchart.htmlLabels)?0:3)})`);const z=$.node().getBBox();return t.height=z.height,t.offsetX=0,t.offsetY=v.height-t.padding/2,t.labelBBox=v,t.intersect=function(Z){return _a(t,Z)},{cluster:d,labelBBox:v}},"roundedWithTitle"),e4=w(async(e,t)=>{nt.info("Creating subgraph rect for ",t.id,t);const r=Jt(),{themeVariables:n,handDrawnSeed:s}=r,{clusterBkg:o,clusterBorder:c}=n,{labelStyles:l,nodeStyles:h,borderStyles:d,backgroundStyles:f}=Tt(t),g=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.id).attr("data-look",t.look),m=Le(r.flowchart.htmlLabels),y=g.insert("g").attr("class","cluster-label "),v=await Oi(y,t.label,{style:t.labelStyle,useHtmlLabels:m,isNode:!0,width:t.width});let b=v.getBBox();if(Le(r.flowchart.htmlLabels)){const $=v.children[0],z=Gt(v);b=$.getBoundingClientRect(),z.attr("width",b.width),z.attr("height",b.height)}const k=t.width<=b.width+t.padding?b.width+t.padding:t.width;t.width<=b.width+t.padding?t.diff=(k-t.width)/2-t.padding:t.diff=-t.padding;const T=t.height,_=t.x-k/2,B=t.y-T/2;nt.trace("Data ",t,JSON.stringify(t));let L;if(t.look==="handDrawn"){const $=wt.svg(g),z=_t(t,{roughness:.7,fill:o,stroke:c,fillWeight:4,seed:s}),Z=$.path(zi(_,B,k,T,t.rx),z);L=g.insert(()=>(nt.debug("Rough node insert CXC",Z),Z),":first-child"),L.select("path:nth-child(2)").attr("style",d.join(";")),L.select("path").attr("style",f.join(";").replace("fill","stroke"))}else L=g.insert("rect",":first-child"),L.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",_).attr("y",B).attr("width",k).attr("height",T);const{subGraphTitleTopMargin:A}=Yp(r);if(y.attr("transform",`translate(${t.x-b.width/2}, ${t.y-t.height/2+A})`),l){const $=y.select("span");$&&$.attr("style",l)}const E=L.node().getBBox();return t.offsetX=0,t.width=E.width,t.height=E.height,t.offsetY=b.height-t.padding/2,t.intersect=function($){return _a(t,$)},{cluster:g,labelBBox:b}},"kanbanSection"),r4=w((e,t)=>{const r=Jt(),{themeVariables:n,handDrawnSeed:s}=r,{nodeBorder:o}=n,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.id).attr("data-look",t.look),l=c.insert("g",":first-child"),h=0*t.padding,d=t.width+h;t.diff=-t.padding;const f=t.height+h,g=t.x-d/2,m=t.y-f/2;t.width=d;let y;if(t.look==="handDrawn"){const k=wt.svg(c).rectangle(g,m,d,f,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:o,seed:s});y=c.insert(()=>k,":first-child")}else y=l.insert("rect",":first-child"),y.attr("class","divider").attr("x",g).attr("y",m).attr("width",d).attr("height",f).attr("data-look",t.look);const v=y.node().getBBox();return t.height=v.height,t.offsetX=0,t.offsetY=0,t.intersect=function(b){return _a(t,b)},{cluster:c,labelBBox:{}}},"divider"),n4=O2,i4={rect:O2,squareRect:n4,roundedWithTitle:t4,noteGroup:J5,divider:r4,kanbanSection:e4},z2=new Map,s4=w(async(e,t)=>{const r=t.shape||"rect",n=await i4[r](e,t);return z2.set(t.id,n),n},"insertCluster"),l6=w(()=>{z2=new Map},"clear");function j2(e,t){return e.intersect(t)}w(j2,"intersectNode");var a4=j2;function N2(e,t,r,n){var s=e.x,o=e.y,c=s-n.x,l=o-n.y,h=Math.sqrt(t*t*l*l+r*r*c*c),d=Math.abs(t*r*c/h);n.x<s&&(d=-d);var f=Math.abs(t*r*l/h);return n.y<o&&(f=-f),{x:s+d,y:o+f}}w(N2,"intersectEllipse");var W2=N2;function H2(e,t,r){return W2(e,t,t,r)}w(H2,"intersectCircle");var o4=H2;function q2(e,t,r,n){{const s=t.y-e.y,o=e.x-t.x,c=t.x*e.y-e.x*t.y,l=s*r.x+o*r.y+c,h=s*n.x+o*n.y+c,d=1e-6;if(l!==0&&h!==0&&Jf(l,h))return;const f=n.y-r.y,g=r.x-n.x,m=n.x*r.y-r.x*n.y,y=f*e.x+g*e.y+m,v=f*t.x+g*t.y+m;if(Math.abs(y)<d&&Math.abs(v)<d&&Jf(y,v))return;const b=s*g-f*o;if(b===0)return;const k=Math.abs(b/2);let T=o*m-g*c;const _=T<0?(T-k)/b:(T+k)/b;T=f*c-s*m;const B=T<0?(T-k)/b:(T+k)/b;return{x:_,y:B}}}w(q2,"intersectLine");function Jf(e,t){return e*t>0}w(Jf,"sameSign");var l4=q2;function U2(e,t,r){let n=e.x,s=e.y,o=[],c=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(f){c=Math.min(c,f.x),l=Math.min(l,f.y)}):(c=Math.min(c,t.x),l=Math.min(l,t.y));let h=n-e.width/2-c,d=s-e.height/2-l;for(let f=0;f<t.length;f++){let g=t[f],m=t[f<t.length-1?f+1:0],y=l4(e,r,{x:h+g.x,y:d+g.y},{x:h+m.x,y:d+m.y});y&&o.push(y)}return o.length?(o.length>1&&o.sort(function(f,g){let m=f.x-r.x,y=f.y-r.y,v=Math.sqrt(m*m+y*y),b=g.x-r.x,k=g.y-r.y,T=Math.sqrt(b*b+k*k);return v<T?-1:v===T?0:1}),o[0]):e}w(U2,"intersectPolygon");var c4=U2,yt={node:a4,circle:o4,ellipse:W2,polygon:c4,rect:_a};function G2(e,t){const{labelStyles:r}=Tt(t);t.labelStyle=r;const n=Rt(t);let s=n;n||(s="anchor");const o=e.insert("g").attr("class",s).attr("id",t.domId||t.id),c=1,{cssStyles:l}=t,h=wt.svg(o),d=_t(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(d.roughness=0);const f=h.circle(0,0,c*2,d),g=o.insert(()=>f,":first-child");return g.attr("class","anchor").attr("style",Ke(l)),Lt(t,g),t.intersect=function(m){return nt.info("Circle intersect",t,c,m),yt.circle(t,c,m)},o}w(G2,"anchor");function tp(e,t,r,n,s,o,c){const h=(e+r)/2,d=(t+n)/2,f=Math.atan2(n-t,r-e),g=(r-e)/2,m=(n-t)/2,y=g/s,v=m/o,b=Math.sqrt(y**2+v**2);if(b>1)throw new Error("The given radii are too small to create an arc between the points.");const k=Math.sqrt(1-b**2),T=h+k*o*Math.sin(f)*(c?-1:1),_=d-k*s*Math.cos(f)*(c?-1:1),B=Math.atan2((t-_)/o,(e-T)/s);let A=Math.atan2((n-_)/o,(r-T)/s)-B;c&&A<0&&(A+=2*Math.PI),!c&&A>0&&(A-=2*Math.PI);const E=[];for(let $=0;$<20;$++){const z=$/19,Z=B+z*A,W=T+s*Math.cos(Z),G=_+o*Math.sin(Z);E.push({x:W,y:G})}return E}w(tp,"generateArcPoints");async function V2(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=o.width+t.padding+20,l=o.height+t.padding,h=l/2,d=h/(2.5+l/50),{cssStyles:f}=t,g=[{x:c/2,y:-l/2},{x:-c/2,y:-l/2},...tp(-c/2,-l/2,-c/2,l/2,d,h,!1),{x:c/2,y:l/2},...tp(c/2,l/2,c/2,-l/2,d,h,!0)],m=wt.svg(s),y=_t(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Ut(g),b=m.path(v,y),k=s.insert(()=>b,":first-child");return k.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(${d/2}, 0)`),Lt(t,k),t.intersect=function(T){return yt.polygon(t,g,T)},s}w(V2,"bowTieRect");function ji(e,t,r,n){return e.insert("polygon",":first-child").attr("points",n.map(function(s){return s.x+","+s.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}w(ji,"insertPolygonShape");async function Y2(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=o.height+t.padding,l=12,h=o.width+t.padding+l,d=0,f=h,g=-c,m=0,y=[{x:d+l,y:g},{x:f,y:g},{x:f,y:m},{x:d,y:m},{x:d,y:g+l},{x:d+l,y:g}];let v;const{cssStyles:b}=t;if(t.look==="handDrawn"){const k=wt.svg(s),T=_t(t,{}),_=Ut(y),B=k.path(_,T);v=s.insert(()=>B,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),b&&v.attr("style",b)}else v=ji(s,h,c,y);return n&&v.attr("style",n),Lt(t,v),t.intersect=function(k){return yt.polygon(t,y,k)},s}w(Y2,"card");function X2(e,t){const{nodeStyles:r}=Tt(t);t.label="";const n=e.insert("g").attr("class",Rt(t)).attr("id",t.domId??t.id),{cssStyles:s}=t,o=Math.max(28,t.width??0),c=[{x:0,y:o/2},{x:o/2,y:0},{x:0,y:-o/2},{x:-o/2,y:0}],l=wt.svg(n),h=_t(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const d=Ut(c),f=l.path(d,h),g=n.insert(()=>f,":first-child");return s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),r&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(m){return yt.polygon(t,c,m)},n}w(X2,"choice");async function lg(e,t,r){const{labelStyles:n,nodeStyles:s}=Tt(t);t.labelStyle=n;const{shapeSvg:o,bbox:c,halfPadding:l}=await Dt(e,t,Rt(t)),h=(r==null?void 0:r.padding)??l,d=c.width/2+h;let f;const{cssStyles:g}=t;if(t.look==="handDrawn"){const m=wt.svg(o),y=_t(t,{}),v=m.circle(0,0,d*2,y);f=o.insert(()=>v,":first-child"),f.attr("class","basic label-container").attr("style",Ke(g))}else f=o.insert("circle",":first-child").attr("class","basic label-container").attr("style",s).attr("r",d).attr("cx",0).attr("cy",0);return Lt(t,f),t.calcIntersect=function(m,y){const v=m.width/2;return yt.circle(m,v,y)},t.intersect=function(m){return nt.info("Circle intersect",t,d,m),yt.circle(t,d,m)},o}w(lg,"circle");function Q2(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),n=e*2,s={x:n/2*t,y:n/2*r},o={x:-(n/2)*t,y:n/2*r},c={x:-(n/2)*t,y:-(n/2)*r},l={x:n/2*t,y:-(n/2)*r};return`M ${o.x},${o.y} L ${l.x},${l.y}
227
+ M ${s.x},${s.y} L ${c.x},${c.y}`}w(Q2,"createLine");function K2(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r,t.label="";const s=e.insert("g").attr("class",Rt(t)).attr("id",t.domId??t.id),o=Math.max(30,(t==null?void 0:t.width)??0),{cssStyles:c}=t,l=wt.svg(s),h=_t(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");const d=l.circle(0,0,o*2,h),f=Q2(o),g=l.path(f,h),m=s.insert(()=>d,":first-child");return m.insert(()=>g),c&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",c),n&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",n),Lt(t,m),t.intersect=function(y){return nt.info("crossedCircle intersect",t,{radius:o,point:y}),yt.circle(t,o,y)},s}w(K2,"crossedCircle");function Jn(e,t,r,n=100,s=0,o=180){const c=[],l=s*Math.PI/180,f=(o*Math.PI/180-l)/(n-1);for(let g=0;g<n;g++){const m=l+g*f,y=e+r*Math.cos(m),v=t+r*Math.sin(m);c.push({x:-y,y:-v})}return c}w(Jn,"generateCirclePoints");async function Z2(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=o.width+(t.padding??0),h=o.height+(t.padding??0),d=Math.max(5,h*.1),{cssStyles:f}=t,g=[...Jn(l/2,-h/2,d,30,-90,0),{x:-l/2-d,y:d},...Jn(l/2+d*2,-d,d,20,-180,-270),...Jn(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-h/2},...Jn(l/2,h/2,d,20,0,90)],m=[{x:l/2,y:-h/2-d},{x:-l/2,y:-h/2-d},...Jn(l/2,-h/2,d,20,-90,0),{x:-l/2-d,y:-d},...Jn(l/2+l*.1,-d,d,20,-180,-270),...Jn(l/2+l*.1,d,d,20,-90,-180),{x:-l/2-d,y:h/2},...Jn(l/2,h/2,d,20,0,90),{x:-l/2,y:h/2+d},{x:l/2,y:h/2+d}],y=wt.svg(s),v=_t(t,{fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const k=Ut(g).replace("Z",""),T=y.path(k,v),_=Ut(m),B=y.path(_,{...v}),L=s.insert("g",":first-child");return L.insert(()=>B,":first-child").attr("stroke-opacity",0),L.insert(()=>T,":first-child"),L.attr("class","text"),f&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",n),L.attr("transform",`translate(${d}, 0)`),c.attr("transform",`translate(${-l/2+d-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),Lt(t,L),t.intersect=function(A){return yt.polygon(t,m,A)},s}w(Z2,"curlyBraceLeft");function ti(e,t,r,n=100,s=0,o=180){const c=[],l=s*Math.PI/180,f=(o*Math.PI/180-l)/(n-1);for(let g=0;g<n;g++){const m=l+g*f,y=e+r*Math.cos(m),v=t+r*Math.sin(m);c.push({x:y,y:v})}return c}w(ti,"generateCirclePoints");async function J2(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=o.width+(t.padding??0),h=o.height+(t.padding??0),d=Math.max(5,h*.1),{cssStyles:f}=t,g=[...ti(l/2,-h/2,d,20,-90,0),{x:l/2+d,y:-d},...ti(l/2+d*2,-d,d,20,-180,-270),...ti(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:h/2},...ti(l/2,h/2,d,20,0,90)],m=[{x:-l/2,y:-h/2-d},{x:l/2,y:-h/2-d},...ti(l/2,-h/2,d,20,-90,0),{x:l/2+d,y:-d},...ti(l/2+d*2,-d,d,20,-180,-270),...ti(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:h/2},...ti(l/2,h/2,d,20,0,90),{x:l/2,y:h/2+d},{x:-l/2,y:h/2+d}],y=wt.svg(s),v=_t(t,{fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const k=Ut(g).replace("Z",""),T=y.path(k,v),_=Ut(m),B=y.path(_,{...v}),L=s.insert("g",":first-child");return L.insert(()=>B,":first-child").attr("stroke-opacity",0),L.insert(()=>T,":first-child"),L.attr("class","text"),f&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",n),L.attr("transform",`translate(${-d}, 0)`),c.attr("transform",`translate(${-l/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),Lt(t,L),t.intersect=function(A){return yt.polygon(t,m,A)},s}w(J2,"curlyBraceRight");function De(e,t,r,n=100,s=0,o=180){const c=[],l=s*Math.PI/180,f=(o*Math.PI/180-l)/(n-1);for(let g=0;g<n;g++){const m=l+g*f,y=e+r*Math.cos(m),v=t+r*Math.sin(m);c.push({x:-y,y:-v})}return c}w(De,"generateCirclePoints");async function tS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=o.width+(t.padding??0),h=o.height+(t.padding??0),d=Math.max(5,h*.1),{cssStyles:f}=t,g=[...De(l/2,-h/2,d,30,-90,0),{x:-l/2-d,y:d},...De(l/2+d*2,-d,d,20,-180,-270),...De(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-h/2},...De(l/2,h/2,d,20,0,90)],m=[...De(-l/2+d+d/2,-h/2,d,20,-90,-180),{x:l/2-d/2,y:d},...De(-l/2-d/2,-d,d,20,0,90),...De(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...De(-l/2+d+d/2,h/2,d,30,-180,-270)],y=[{x:l/2,y:-h/2-d},{x:-l/2,y:-h/2-d},...De(l/2,-h/2,d,20,-90,0),{x:-l/2-d,y:-d},...De(l/2+d*2,-d,d,20,-180,-270),...De(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:h/2},...De(l/2,h/2,d,20,0,90),{x:-l/2,y:h/2+d},{x:l/2-d-d/2,y:h/2+d},...De(-l/2+d+d/2,-h/2,d,20,-90,-180),{x:l/2-d/2,y:d},...De(-l/2-d/2,-d,d,20,0,90),...De(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...De(-l/2+d+d/2,h/2,d,30,-180,-270)],v=wt.svg(s),b=_t(t,{fill:"none"});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const T=Ut(g).replace("Z",""),_=v.path(T,b),L=Ut(m).replace("Z",""),A=v.path(L,b),E=Ut(y),$=v.path(E,{...b}),z=s.insert("g",":first-child");return z.insert(()=>$,":first-child").attr("stroke-opacity",0),z.insert(()=>_,":first-child"),z.insert(()=>A,":first-child"),z.attr("class","text"),f&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",f),n&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",n),z.attr("transform",`translate(${d-d/4}, 0)`),c.attr("transform",`translate(${-l/2+(t.padding??0)/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)/2-(o.y-(o.top??0))})`),Lt(t,z),t.intersect=function(Z){return yt.polygon(t,y,Z)},s}w(tS,"curlyBraces");async function eS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=80,l=20,h=Math.max(c,(o.width+(t.padding??0)*2)*1.25,(t==null?void 0:t.width)??0),d=Math.max(l,o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),f=d/2,{cssStyles:g}=t,m=wt.svg(s),y=_t(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=h,b=d,k=v-f,T=b/4,_=[{x:k,y:0},{x:T,y:0},{x:0,y:b/2},{x:T,y:b},{x:k,y:b},...Xo(-k,-b/2,f,50,270,90)],B=Ut(_),L=m.path(B,y),A=s.insert(()=>L,":first-child");return A.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&A.selectChildren("path").attr("style",g),n&&t.look!=="handDrawn"&&A.selectChildren("path").attr("style",n),A.attr("transform",`translate(${-h/2}, ${-d/2})`),Lt(t,A),t.intersect=function(E){return yt.polygon(t,_,E)},s}w(eS,"curvedTrapezoid");var u4=w((e,t,r,n,s,o)=>[`M${e},${t+o}`,`a${s},${o} 0,0,0 ${r},0`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${n}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createCylinderPathD"),h4=w((e,t,r,n,s,o)=>[`M${e},${t+o}`,`M${e+r},${t+o}`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${n}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-n}`].join(" "),"createOuterCylinderPathD"),d4=w((e,t,r,n,s,o)=>[`M${e-r/2},${-n/2}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function rS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=Math.max(o.width+t.padding,t.width??0),h=l/2,d=h/(2.5+l/50),f=Math.max(o.height+d+t.padding,t.height??0);let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=wt.svg(s),v=h4(0,0,l,f,h,d),b=d4(0,d,l,f,h,d),k=y.path(v,_t(t,{})),T=y.path(b,_t(t,{fill:"none"}));g=s.insert(()=>T,":first-child"),g=s.insert(()=>k,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=u4(0,0,l,f,h,d);g=s.insert("path",":first-child").attr("d",y).attr("class","basic label-container").attr("style",Ke(m)).attr("style",n)}return g.attr("label-offset-y",d),g.attr("transform",`translate(${-l/2}, ${-(f/2+d)})`),Lt(t,g),c.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${-(o.height/2)+(t.padding??0)/1.5-(o.y-(o.top??0))})`),t.intersect=function(y){const v=yt.rect(t,y),b=v.x-(t.x??0);if(h!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(v.y-(t.y??0))>(t.height??0)/2-d)){let k=d*d*(1-b*b/(h*h));k>0&&(k=Math.sqrt(k)),k=d-k,y.y-(t.y??0)>0&&(k=-k),v.y+=k}return v},s}w(rS,"cylinder");async function nS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=o.width+t.padding,h=o.height+t.padding,d=h*.2,f=-l/2,g=-h/2-d/2,{cssStyles:m}=t,y=wt.svg(s),v=_t(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const b=[{x:f,y:g+d},{x:-f,y:g+d},{x:-f,y:-g},{x:f,y:-g},{x:f,y:g},{x:-f,y:g},{x:-f,y:g+d}],k=y.polygon(b.map(_=>[_.x,_.y]),v),T=s.insert(()=>k,":first-child");return T.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",n),c.attr("transform",`translate(${f+(t.padding??0)/2-(o.x-(o.left??0))}, ${g+d+(t.padding??0)/2-(o.y-(o.top??0))})`),Lt(t,T),t.intersect=function(_){return yt.rect(t,_)},s}w(nS,"dividedRectangle");async function iS(e,t){var m,y;const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:c}=await Dt(e,t,Rt(t)),h=o.width/2+c+5,d=o.width/2+c;let f;const{cssStyles:g}=t;if(t.look==="handDrawn"){const v=wt.svg(s),b=_t(t,{roughness:.2,strokeWidth:2.5}),k=_t(t,{roughness:.2,strokeWidth:1.5}),T=v.circle(0,0,h*2,b),_=v.circle(0,0,d*2,k);f=s.insert("g",":first-child"),f.attr("class",Ke(t.cssClasses)).attr("style",Ke(g)),(m=f.node())==null||m.appendChild(T),(y=f.node())==null||y.appendChild(_)}else{f=s.insert("g",":first-child");const v=f.insert("circle",":first-child"),b=f.insert("circle");f.attr("class","basic label-container").attr("style",n),v.attr("class","outer-circle").attr("style",n).attr("r",h).attr("cx",0).attr("cy",0),b.attr("class","inner-circle").attr("style",n).attr("r",d).attr("cx",0).attr("cy",0)}return Lt(t,f),t.intersect=function(v){return nt.info("DoubleCircle intersect",t,h,v),yt.circle(t,h,v)},s}w(iS,"doublecircle");function sS(e,t,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:s}=Tt(t);t.label="",t.labelStyle=n;const o=e.insert("g").attr("class",Rt(t)).attr("id",t.domId??t.id),c=7,{cssStyles:l}=t,h=wt.svg(o),{nodeBorder:d}=r,f=_t(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(f.roughness=0);const g=h.circle(0,0,c*2,f),m=o.insert(()=>g,":first-child");return m.selectAll("path").attr("style",`fill: ${d} !important;`),l&&l.length>0&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",l),s&&t.look!=="handDrawn"&&m.selectAll("path").attr("style",s),Lt(t,m),t.intersect=function(y){return nt.info("filledCircle intersect",t,{radius:c,point:y}),yt.circle(t,c,y)},o}w(sS,"filledCircle");async function aS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=o.width+(t.padding??0),h=l+o.height,d=l+o.height,f=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:g}=t,m=wt.svg(s),y=_t(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=Ut(f),b=m.path(v,y),k=s.insert(()=>b,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`);return g&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",g),n&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",n),t.width=l,t.height=h,Lt(t,k),c.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${-h/2+(t.padding??0)/2+(o.y-(o.top??0))})`),t.intersect=function(T){return nt.info("Triangle intersect",t,f,T),yt.polygon(t,f,T)},s}w(aS,"flippedTriangle");function oS(e,t,{dir:r,config:{state:n,themeVariables:s}}){const{nodeStyles:o}=Tt(t);t.label="";const c=e.insert("g").attr("class",Rt(t)).attr("id",t.domId??t.id),{cssStyles:l}=t;let h=Math.max(70,(t==null?void 0:t.width)??0),d=Math.max(10,(t==null?void 0:t.height)??0);r==="LR"&&(h=Math.max(10,(t==null?void 0:t.width)??0),d=Math.max(70,(t==null?void 0:t.height)??0));const f=-1*h/2,g=-1*d/2,m=wt.svg(c),y=_t(t,{stroke:s.lineColor,fill:s.lineColor});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=m.rectangle(f,g,h,d,y),b=c.insert(()=>v,":first-child");l&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",l),o&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",o),Lt(t,b);const k=(n==null?void 0:n.padding)??0;return t.width&&t.height&&(t.width+=k/2||0,t.height+=k/2||0),t.intersect=function(T){return yt.rect(t,T)},c}w(oS,"forkJoin");async function lS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const s=80,o=50,{shapeSvg:c,bbox:l}=await Dt(e,t,Rt(t)),h=Math.max(s,l.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),d=Math.max(o,l.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),f=d/2,{cssStyles:g}=t,m=wt.svg(c),y=_t(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-h/2,y:-d/2},{x:h/2-f,y:-d/2},...Xo(-h/2+f,0,f,50,90,270),{x:h/2-f,y:d/2},{x:-h/2,y:d/2}],b=Ut(v),k=m.path(b,y),T=c.insert(()=>k,":first-child");return T.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",g),n&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),Lt(t,T),t.intersect=function(_){return nt.info("Pill intersect",t,{radius:f,point:_}),yt.polygon(t,v,_)},c}w(lS,"halfRoundedRectangle");async function cS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=o.height+(t.padding??0),l=o.width+(t.padding??0)*2.5,{cssStyles:h}=t,d=wt.svg(s),f=_t(t,{});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");let g=l/2;const m=g/6;g=g+m;const y=c/2,v=y/2,b=g-v,k=[{x:-b,y:-y},{x:0,y:-y},{x:b,y:-y},{x:g,y:0},{x:b,y},{x:0,y},{x:-b,y},{x:-g,y:0}],T=Ut(k),_=d.path(T,f),B=s.insert(()=>_,":first-child");return B.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",h),n&&t.look!=="handDrawn"&&B.selectChildren("path").attr("style",n),t.width=l,t.height=c,Lt(t,B),t.intersect=function(L){return yt.polygon(t,k,L)},s}w(cS,"hexagon");async function uS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.label="",t.labelStyle=r;const{shapeSvg:s}=await Dt(e,t,Rt(t)),o=Math.max(30,(t==null?void 0:t.width)??0),c=Math.max(30,(t==null?void 0:t.height)??0),{cssStyles:l}=t,h=wt.svg(s),d=_t(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=[{x:0,y:0},{x:o,y:0},{x:0,y:c},{x:o,y:c}],g=Ut(f),m=h.path(g,d),y=s.insert(()=>m,":first-child");return y.attr("class","basic label-container"),l&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",l),n&&t.look!=="handDrawn"&&y.selectChildren("path").attr("style",n),y.attr("transform",`translate(${-o/2}, ${-c/2})`),Lt(t,y),t.intersect=function(v){return nt.info("Pill intersect",t,{points:f}),yt.polygon(t,f,v)},s}w(uS,"hourglass");async function hS(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:s}=Tt(t);t.labelStyle=s;const o=t.assetHeight??48,c=t.assetWidth??48,l=Math.max(o,c),h=n==null?void 0:n.wrappingWidth;t.width=Math.max(l,h??0);const{shapeSvg:d,bbox:f,label:g}=await Dt(e,t,"icon-shape default"),m=t.pos==="t",y=l,v=l,{nodeBorder:b}=r,{stylesMap:k}=Ca(t),T=-v/2,_=-y/2,B=t.label?8:0,L=wt.svg(d),A=_t(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const E=L.rectangle(T,_,v,y,A),$=Math.max(v,f.width),z=y+f.height+B,Z=L.rectangle(-$/2,-z/2,$,z,{...A,fill:"transparent",stroke:"none"}),W=d.insert(()=>E,":first-child"),G=d.insert(()=>Z);if(t.icon){const it=d.append("g");it.html(`<g>${await al(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);const rt=it.node().getBBox(),H=rt.width,q=rt.height,N=rt.x,Y=rt.y;it.attr("transform",`translate(${-H/2-N},${m?f.height/2+B/2-q/2-Y:-f.height/2-B/2-q/2-Y})`),it.attr("style",`color: ${k.get("stroke")??b};`)}return g.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${m?-z/2:z/2-f.height})`),W.attr("transform",`translate(0,${m?f.height/2+B/2:-f.height/2-B/2})`),Lt(t,G),t.intersect=function(it){if(nt.info("iconSquare intersect",t,it),!t.label)return yt.rect(t,it);const rt=t.x??0,H=t.y??0,q=t.height??0;let N=[];return m?N=[{x:rt-f.width/2,y:H-q/2},{x:rt+f.width/2,y:H-q/2},{x:rt+f.width/2,y:H-q/2+f.height+B},{x:rt+v/2,y:H-q/2+f.height+B},{x:rt+v/2,y:H+q/2},{x:rt-v/2,y:H+q/2},{x:rt-v/2,y:H-q/2+f.height+B},{x:rt-f.width/2,y:H-q/2+f.height+B}]:N=[{x:rt-v/2,y:H-q/2},{x:rt+v/2,y:H-q/2},{x:rt+v/2,y:H-q/2+y},{x:rt+f.width/2,y:H-q/2+y},{x:rt+f.width/2/2,y:H+q/2},{x:rt-f.width/2,y:H+q/2},{x:rt-f.width/2,y:H-q/2+y},{x:rt-v/2,y:H-q/2+y}],yt.polygon(t,N,it)},d}w(hS,"icon");async function dS(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:s}=Tt(t);t.labelStyle=s;const o=t.assetHeight??48,c=t.assetWidth??48,l=Math.max(o,c),h=n==null?void 0:n.wrappingWidth;t.width=Math.max(l,h??0);const{shapeSvg:d,bbox:f,label:g}=await Dt(e,t,"icon-shape default"),m=20,y=t.label?8:0,v=t.pos==="t",{nodeBorder:b,mainBkg:k}=r,{stylesMap:T}=Ca(t),_=wt.svg(d),B=_t(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const L=T.get("fill");B.stroke=L??k;const A=d.append("g");t.icon&&A.html(`<g>${await al(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);const E=A.node().getBBox(),$=E.width,z=E.height,Z=E.x,W=E.y,G=Math.max($,z)*Math.SQRT2+m*2,it=_.circle(0,0,G,B),rt=Math.max(G,f.width),H=G+f.height+y,q=_.rectangle(-rt/2,-H/2,rt,H,{...B,fill:"transparent",stroke:"none"}),N=d.insert(()=>it,":first-child"),Y=d.insert(()=>q);return A.attr("transform",`translate(${-$/2-Z},${v?f.height/2+y/2-z/2-W:-f.height/2-y/2-z/2-W})`),A.attr("style",`color: ${T.get("stroke")??b};`),g.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${v?-H/2:H/2-f.height})`),N.attr("transform",`translate(0,${v?f.height/2+y/2:-f.height/2-y/2})`),Lt(t,Y),t.intersect=function(P){return nt.info("iconSquare intersect",t,P),yt.rect(t,P)},d}w(dS,"iconCircle");async function fS(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:s}=Tt(t);t.labelStyle=s;const o=t.assetHeight??48,c=t.assetWidth??48,l=Math.max(o,c),h=n==null?void 0:n.wrappingWidth;t.width=Math.max(l,h??0);const{shapeSvg:d,bbox:f,halfPadding:g,label:m}=await Dt(e,t,"icon-shape default"),y=t.pos==="t",v=l+g*2,b=l+g*2,{nodeBorder:k,mainBkg:T}=r,{stylesMap:_}=Ca(t),B=-b/2,L=-v/2,A=t.label?8:0,E=wt.svg(d),$=_t(t,{});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");const z=_.get("fill");$.stroke=z??T;const Z=E.path(zi(B,L,b,v,5),$),W=Math.max(b,f.width),G=v+f.height+A,it=E.rectangle(-W/2,-G/2,W,G,{...$,fill:"transparent",stroke:"none"}),rt=d.insert(()=>Z,":first-child").attr("class","icon-shape2"),H=d.insert(()=>it);if(t.icon){const q=d.append("g");q.html(`<g>${await al(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);const N=q.node().getBBox(),Y=N.width,P=N.height,K=N.x,et=N.y;q.attr("transform",`translate(${-Y/2-K},${y?f.height/2+A/2-P/2-et:-f.height/2-A/2-P/2-et})`),q.attr("style",`color: ${_.get("stroke")??k};`)}return m.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${y?-G/2:G/2-f.height})`),rt.attr("transform",`translate(0,${y?f.height/2+A/2:-f.height/2-A/2})`),Lt(t,H),t.intersect=function(q){if(nt.info("iconSquare intersect",t,q),!t.label)return yt.rect(t,q);const N=t.x??0,Y=t.y??0,P=t.height??0;let K=[];return y?K=[{x:N-f.width/2,y:Y-P/2},{x:N+f.width/2,y:Y-P/2},{x:N+f.width/2,y:Y-P/2+f.height+A},{x:N+b/2,y:Y-P/2+f.height+A},{x:N+b/2,y:Y+P/2},{x:N-b/2,y:Y+P/2},{x:N-b/2,y:Y-P/2+f.height+A},{x:N-f.width/2,y:Y-P/2+f.height+A}]:K=[{x:N-b/2,y:Y-P/2},{x:N+b/2,y:Y-P/2},{x:N+b/2,y:Y-P/2+v},{x:N+f.width/2,y:Y-P/2+v},{x:N+f.width/2/2,y:Y+P/2},{x:N-f.width/2,y:Y+P/2},{x:N-f.width/2,y:Y-P/2+v},{x:N-b/2,y:Y-P/2+v}],yt.polygon(t,K,q)},d}w(fS,"iconRounded");async function pS(e,t,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:s}=Tt(t);t.labelStyle=s;const o=t.assetHeight??48,c=t.assetWidth??48,l=Math.max(o,c),h=n==null?void 0:n.wrappingWidth;t.width=Math.max(l,h??0);const{shapeSvg:d,bbox:f,halfPadding:g,label:m}=await Dt(e,t,"icon-shape default"),y=t.pos==="t",v=l+g*2,b=l+g*2,{nodeBorder:k,mainBkg:T}=r,{stylesMap:_}=Ca(t),B=-b/2,L=-v/2,A=t.label?8:0,E=wt.svg(d),$=_t(t,{});t.look!=="handDrawn"&&($.roughness=0,$.fillStyle="solid");const z=_.get("fill");$.stroke=z??T;const Z=E.path(zi(B,L,b,v,.1),$),W=Math.max(b,f.width),G=v+f.height+A,it=E.rectangle(-W/2,-G/2,W,G,{...$,fill:"transparent",stroke:"none"}),rt=d.insert(()=>Z,":first-child"),H=d.insert(()=>it);if(t.icon){const q=d.append("g");q.html(`<g>${await al(t.icon,{height:l,width:l,fallbackPrefix:""})}</g>`);const N=q.node().getBBox(),Y=N.width,P=N.height,K=N.x,et=N.y;q.attr("transform",`translate(${-Y/2-K},${y?f.height/2+A/2-P/2-et:-f.height/2-A/2-P/2-et})`),q.attr("style",`color: ${_.get("stroke")??k};`)}return m.attr("transform",`translate(${-f.width/2-(f.x-(f.left??0))},${y?-G/2:G/2-f.height})`),rt.attr("transform",`translate(0,${y?f.height/2+A/2:-f.height/2-A/2})`),Lt(t,H),t.intersect=function(q){if(nt.info("iconSquare intersect",t,q),!t.label)return yt.rect(t,q);const N=t.x??0,Y=t.y??0,P=t.height??0;let K=[];return y?K=[{x:N-f.width/2,y:Y-P/2},{x:N+f.width/2,y:Y-P/2},{x:N+f.width/2,y:Y-P/2+f.height+A},{x:N+b/2,y:Y-P/2+f.height+A},{x:N+b/2,y:Y+P/2},{x:N-b/2,y:Y+P/2},{x:N-b/2,y:Y-P/2+f.height+A},{x:N-f.width/2,y:Y-P/2+f.height+A}]:K=[{x:N-b/2,y:Y-P/2},{x:N+b/2,y:Y-P/2},{x:N+b/2,y:Y-P/2+v},{x:N+f.width/2,y:Y-P/2+v},{x:N+f.width/2/2,y:Y+P/2},{x:N-f.width/2,y:Y+P/2},{x:N-f.width/2,y:Y-P/2+v},{x:N-b/2,y:Y-P/2+v}],yt.polygon(t,K,q)},d}w(pS,"iconSquare");async function gS(e,t,{config:{flowchart:r}}){const n=new Image;n.src=(t==null?void 0:t.img)??"",await n.decode();const s=Number(n.naturalWidth.toString().replace("px","")),o=Number(n.naturalHeight.toString().replace("px",""));t.imageAspectRatio=s/o;const{labelStyles:c}=Tt(t);t.labelStyle=c;const l=r==null?void 0:r.wrappingWidth;t.defaultWidth=r==null?void 0:r.wrappingWidth;const h=Math.max(t.label?l??0:0,(t==null?void 0:t.assetWidth)??s),d=t.constraint==="on"&&t!=null&&t.assetHeight?t.assetHeight*t.imageAspectRatio:h,f=t.constraint==="on"?d/t.imageAspectRatio:(t==null?void 0:t.assetHeight)??o;t.width=Math.max(d,l??0);const{shapeSvg:g,bbox:m,label:y}=await Dt(e,t,"image-shape default"),v=t.pos==="t",b=-d/2,k=-f/2,T=t.label?8:0,_=wt.svg(g),B=_t(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const L=_.rectangle(b,k,d,f,B),A=Math.max(d,m.width),E=f+m.height+T,$=_.rectangle(-A/2,-E/2,A,E,{...B,fill:"none",stroke:"none"}),z=g.insert(()=>L,":first-child"),Z=g.insert(()=>$);if(t.img){const W=g.append("image");W.attr("href",t.img),W.attr("width",d),W.attr("height",f),W.attr("preserveAspectRatio","none"),W.attr("transform",`translate(${-d/2},${v?E/2-f:-E/2})`)}return y.attr("transform",`translate(${-m.width/2-(m.x-(m.left??0))},${v?-f/2-m.height/2-T/2:f/2-m.height/2+T/2})`),z.attr("transform",`translate(0,${v?m.height/2+T/2:-m.height/2-T/2})`),Lt(t,Z),t.intersect=function(W){if(nt.info("iconSquare intersect",t,W),!t.label)return yt.rect(t,W);const G=t.x??0,it=t.y??0,rt=t.height??0;let H=[];return v?H=[{x:G-m.width/2,y:it-rt/2},{x:G+m.width/2,y:it-rt/2},{x:G+m.width/2,y:it-rt/2+m.height+T},{x:G+d/2,y:it-rt/2+m.height+T},{x:G+d/2,y:it+rt/2},{x:G-d/2,y:it+rt/2},{x:G-d/2,y:it-rt/2+m.height+T},{x:G-m.width/2,y:it-rt/2+m.height+T}]:H=[{x:G-d/2,y:it-rt/2},{x:G+d/2,y:it-rt/2},{x:G+d/2,y:it-rt/2+f},{x:G+m.width/2,y:it-rt/2+f},{x:G+m.width/2/2,y:it+rt/2},{x:G-m.width/2,y:it+rt/2},{x:G-m.width/2,y:it-rt/2+f},{x:G-d/2,y:it-rt/2+f}],yt.polygon(t,H,W)},g}w(gS,"imageSquare");async function mS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=[{x:0,y:0},{x:c,y:0},{x:c+3*l/6,y:-l},{x:-3*l/6,y:-l}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=wt.svg(s),m=_t(t,{}),y=Ut(h),v=g.path(y,m);d=s.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${l/2})`),f&&d.attr("style",f)}else d=ji(s,c,l,h);return n&&d.attr("style",n),t.width=c,t.height=l,Lt(t,d),t.intersect=function(g){return yt.polygon(t,h,g)},s}w(mS,"inv_trapezoid");async function Zu(e,t,r){const{labelStyles:n,nodeStyles:s}=Tt(t);t.labelStyle=n;const{shapeSvg:o,bbox:c}=await Dt(e,t,Rt(t)),l=Math.max(c.width+r.labelPaddingX*2,(t==null?void 0:t.width)||0),h=Math.max(c.height+r.labelPaddingY*2,(t==null?void 0:t.height)||0),d=-l/2,f=-h/2;let g,{rx:m,ry:y}=t;const{cssStyles:v}=t;if(r!=null&&r.rx&&r.ry&&(m=r.rx,y=r.ry),t.look==="handDrawn"){const b=wt.svg(o),k=_t(t,{}),T=m||y?b.path(zi(d,f,l,h,m||0),k):b.rectangle(d,f,l,h,k);g=o.insert(()=>T,":first-child"),g.attr("class","basic label-container").attr("style",Ke(v))}else g=o.insert("rect",":first-child"),g.attr("class","basic label-container").attr("style",s).attr("rx",Ke(m)).attr("ry",Ke(y)).attr("x",d).attr("y",f).attr("width",l).attr("height",h);return Lt(t,g),t.calcIntersect=function(b,k){return yt.rect(b,k)},t.intersect=function(b){return yt.rect(t,b)},o}w(Zu,"drawRect");async function yS(e,t){const{shapeSvg:r,bbox:n,label:s}=await Dt(e,t,"label"),o=r.insert("rect",":first-child");return o.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),s.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),Lt(t,o),t.intersect=function(h){return yt.rect(t,h)},r}w(yS,"labelRect");async function xS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=Math.max(o.width+(t.padding??0),(t==null?void 0:t.width)??0),l=Math.max(o.height+(t.padding??0),(t==null?void 0:t.height)??0),h=[{x:0,y:0},{x:c+3*l/6,y:0},{x:c,y:-l},{x:-(3*l)/6,y:-l}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=wt.svg(s),m=_t(t,{}),y=Ut(h),v=g.path(y,m);d=s.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${l/2})`),f&&d.attr("style",f)}else d=ji(s,c,l,h);return n&&d.attr("style",n),t.width=c,t.height=l,Lt(t,d),t.intersect=function(g){return yt.polygon(t,h,g)},s}w(xS,"lean_left");async function vS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=Math.max(o.width+(t.padding??0),(t==null?void 0:t.width)??0),l=Math.max(o.height+(t.padding??0),(t==null?void 0:t.height)??0),h=[{x:-3*l/6,y:0},{x:c,y:0},{x:c+3*l/6,y:-l},{x:0,y:-l}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=wt.svg(s),m=_t(t,{}),y=Ut(h),v=g.path(y,m);d=s.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${l/2})`),f&&d.attr("style",f)}else d=ji(s,c,l,h);return n&&d.attr("style",n),t.width=c,t.height=l,Lt(t,d),t.intersect=function(g){return yt.polygon(t,h,g)},s}w(vS,"lean_right");function bS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.label="",t.labelStyle=r;const s=e.insert("g").attr("class",Rt(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,c=Math.max(35,(t==null?void 0:t.width)??0),l=Math.max(35,(t==null?void 0:t.height)??0),h=7,d=[{x:c,y:0},{x:0,y:l+h/2},{x:c-2*h,y:l+h/2},{x:0,y:2*l},{x:c,y:l-h/2},{x:2*h,y:l-h/2}],f=wt.svg(s),g=_t(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=Ut(d),y=f.path(m,g),v=s.insert(()=>y,":first-child");return o&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",o),n&&t.look!=="handDrawn"&&v.selectAll("path").attr("style",n),v.attr("transform",`translate(-${c/2},${-l})`),Lt(t,v),t.intersect=function(b){return nt.info("lightningBolt intersect",t,b),yt.polygon(t,d,b)},s}w(bS,"lightningBolt");var f4=w((e,t,r,n,s,o,c)=>[`M${e},${t+o}`,`a${s},${o} 0,0,0 ${r},0`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${n}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-n}`,`M${e},${t+o+c}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),p4=w((e,t,r,n,s,o,c)=>[`M${e},${t+o}`,`M${e+r},${t+o}`,`a${s},${o} 0,0,0 ${-r},0`,`l0,${n}`,`a${s},${o} 0,0,0 ${r},0`,`l0,${-n}`,`M${e},${t+o+c}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),g4=w((e,t,r,n,s,o)=>[`M${e-r/2},${-n/2}`,`a${s},${o} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD");async function SS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=Math.max(o.width+(t.padding??0),t.width??0),h=l/2,d=h/(2.5+l/50),f=Math.max(o.height+d+(t.padding??0),t.height??0),g=f*.1;let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const v=wt.svg(s),b=p4(0,0,l,f,h,d,g),k=g4(0,d,l,f,h,d),T=_t(t,{}),_=v.path(b,T),B=v.path(k,T);s.insert(()=>B,":first-child").attr("class","line"),m=s.insert(()=>_,":first-child"),m.attr("class","basic label-container"),y&&m.attr("style",y)}else{const v=f4(0,0,l,f,h,d,g);m=s.insert("path",":first-child").attr("d",v).attr("class","basic label-container").attr("style",Ke(y)).attr("style",n)}return m.attr("label-offset-y",d),m.attr("transform",`translate(${-l/2}, ${-(f/2+d)})`),Lt(t,m),c.attr("transform",`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${-(o.height/2)+d-(o.y-(o.top??0))})`),t.intersect=function(v){const b=yt.rect(t,v),k=b.x-(t.x??0);if(h!=0&&(Math.abs(k)<(t.width??0)/2||Math.abs(k)==(t.width??0)/2&&Math.abs(b.y-(t.y??0))>(t.height??0)/2-d)){let T=d*d*(1-k*k/(h*h));T>0&&(T=Math.sqrt(T)),T=d-T,v.y-(t.y??0)>0&&(T=-T),b.y+=T}return b},s}w(SS,"linedCylinder");async function CS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=h/4,f=h+d,{cssStyles:g}=t,m=wt.svg(s),y=_t(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:-l/2-l/2*.1,y:-f/2},{x:-l/2-l/2*.1,y:f/2},...Pi(-l/2-l/2*.1,f/2,l/2+l/2*.1,f/2,d,.8),{x:l/2+l/2*.1,y:-f/2},{x:-l/2-l/2*.1,y:-f/2},{x:-l/2,y:-f/2},{x:-l/2,y:f/2*1.1},{x:-l/2,y:-f/2}],b=m.polygon(v.map(T=>[T.x,T.y]),y),k=s.insert(()=>b,":first-child");return k.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",n),k.attr("transform",`translate(0,${-d/2})`),c.attr("transform",`translate(${-l/2+(t.padding??0)+l/2*.1/2-(o.x-(o.left??0))},${-h/2+(t.padding??0)-d/2-(o.y-(o.top??0))})`),Lt(t,k),t.intersect=function(T){return yt.polygon(t,v,T)},s}w(CS,"linedWaveEdgedRect");async function wS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=5,f=-l/2,g=-h/2,{cssStyles:m}=t,y=wt.svg(s),v=_t(t,{}),b=[{x:f-d,y:g+d},{x:f-d,y:g+h+d},{x:f+l-d,y:g+h+d},{x:f+l-d,y:g+h},{x:f+l,y:g+h},{x:f+l,y:g+h-d},{x:f+l+d,y:g+h-d},{x:f+l+d,y:g-d},{x:f+d,y:g-d},{x:f+d,y:g},{x:f,y:g},{x:f,y:g+d}],k=[{x:f,y:g+d},{x:f+l-d,y:g+d},{x:f+l-d,y:g+h},{x:f+l,y:g+h},{x:f+l,y:g},{x:f,y:g}];t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=Ut(b),_=y.path(T,v),B=Ut(k),L=y.path(B,{...v,fill:"none"}),A=s.insert(()=>L,":first-child");return A.insert(()=>_,":first-child"),A.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",n),c.attr("transform",`translate(${-(o.width/2)-d-(o.x-(o.left??0))}, ${-(o.height/2)+d-(o.y-(o.top??0))})`),Lt(t,A),t.intersect=function(E){return yt.polygon(t,b,E)},s}w(wS,"multiRect");async function kS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=h/4,f=h+d,g=-l/2,m=-f/2,y=5,{cssStyles:v}=t,b=Pi(g-y,m+f+y,g+l-y,m+f+y,d,.8),k=b==null?void 0:b[b.length-1],T=[{x:g-y,y:m+y},{x:g-y,y:m+f+y},...b,{x:g+l-y,y:k.y-y},{x:g+l,y:k.y-y},{x:g+l,y:k.y-2*y},{x:g+l+y,y:k.y-2*y},{x:g+l+y,y:m-y},{x:g+y,y:m-y},{x:g+y,y:m},{x:g,y:m},{x:g,y:m+y}],_=[{x:g,y:m+y},{x:g+l-y,y:m+y},{x:g+l-y,y:k.y-y},{x:g+l,y:k.y-y},{x:g+l,y:m},{x:g,y:m}],B=wt.svg(s),L=_t(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const A=Ut(T),E=B.path(A,L),$=Ut(_),z=B.path($,L),Z=s.insert(()=>E,":first-child");return Z.insert(()=>z),Z.attr("class","basic label-container"),v&&t.look!=="handDrawn"&&Z.selectAll("path").attr("style",v),n&&t.look!=="handDrawn"&&Z.selectAll("path").attr("style",n),Z.attr("transform",`translate(0,${-d/2})`),c.attr("transform",`translate(${-(o.width/2)-y-(o.x-(o.left??0))}, ${-(o.height/2)+y-d/2-(o.y-(o.top??0))})`),Lt(t,Z),t.intersect=function(W){return yt.polygon(t,T,W)},s}w(kS,"multiWaveEdgedRectangle");async function _S(e,t,{config:{themeVariables:r}}){var _;const{labelStyles:n,nodeStyles:s}=Tt(t);t.labelStyle=n,t.useHtmlLabels||((_=Xe().flowchart)==null?void 0:_.htmlLabels)!==!1||(t.centerLabel=!0);const{shapeSvg:c,bbox:l,label:h}=await Dt(e,t,Rt(t)),d=Math.max(l.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),f=Math.max(l.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),g=-d/2,m=-f/2,{cssStyles:y}=t,v=wt.svg(c),b=_t(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=v.rectangle(g,m,d,f,b),T=c.insert(()=>k,":first-child");return T.attr("class","basic label-container"),y&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",y),s&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",s),h.attr("transform",`translate(${-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),Lt(t,T),t.intersect=function(B){return yt.rect(t,B)},c}w(_S,"note");var m4=w((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function TS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=o.width+t.padding,l=o.height+t.padding,h=c+l,d=.5,f=[{x:h/2,y:0},{x:h,y:-h/2},{x:h/2,y:-h},{x:0,y:-h/2}];let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=wt.svg(s),v=_t(t,{}),b=m4(0,0,h),k=y.path(b,v);g=s.insert(()=>k,":first-child").attr("transform",`translate(${-h/2+d}, ${h/2})`),m&&g.attr("style",m)}else g=ji(s,h,h,f),g.attr("transform",`translate(${-h/2+d}, ${h/2})`);return n&&g.attr("style",n),Lt(t,g),t.calcIntersect=function(y,v){const b=y.width,k=[{x:b/2,y:0},{x:b,y:-b/2},{x:b/2,y:-b},{x:0,y:-b/2}],T=yt.polygon(y,k,v);return{x:T.x-.5,y:T.y-.5}},t.intersect=function(y){return this.calcIntersect(t,y)},s}w(TS,"question");async function ES(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=Math.max(o.width+(t.padding??0),(t==null?void 0:t.width)??0),h=Math.max(o.height+(t.padding??0),(t==null?void 0:t.height)??0),d=-l/2,f=-h/2,g=f/2,m=[{x:d+g,y:f},{x:d,y:0},{x:d+g,y:-f},{x:-d,y:-f},{x:-d,y:f}],{cssStyles:y}=t,v=wt.svg(s),b=_t(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=Ut(m),T=v.path(k,b),_=s.insert(()=>T,":first-child");return _.attr("class","basic label-container"),y&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",y),n&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",n),_.attr("transform",`translate(${-g/2},0)`),c.attr("transform",`translate(${-g/2-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Lt(t,_),t.intersect=function(B){return yt.polygon(t,m,B)},s}w(ES,"rect_left_inv_arrow");async function LS(e,t){var z,Z;const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;let s;t.cssClasses?s="node "+t.cssClasses:s="node default";const o=e.insert("g").attr("class",s).attr("id",t.domId||t.id),c=o.insert("g"),l=o.insert("g").attr("class","label").attr("style",n),h=t.description,d=t.label,f=l.node().appendChild(await hs(d,t.labelStyle,!0,!0));let g={width:0,height:0};if(Le((Z=(z=Jt())==null?void 0:z.flowchart)==null?void 0:Z.htmlLabels)){const W=f.children[0],G=Gt(f);g=W.getBoundingClientRect(),G.attr("width",g.width),G.attr("height",g.height)}nt.info("Text 2",h);const m=h||[],y=f.getBBox(),v=l.node().appendChild(await hs(m.join?m.join("<br/>"):m,t.labelStyle,!0,!0)),b=v.children[0],k=Gt(v);g=b.getBoundingClientRect(),k.attr("width",g.width),k.attr("height",g.height);const T=(t.padding||0)/2;Gt(v).attr("transform","translate( "+(g.width>y.width?0:(y.width-g.width)/2)+", "+(y.height+T+5)+")"),Gt(f).attr("transform","translate( "+(g.width<y.width?0:-(y.width-g.width)/2)+", 0)"),g=l.node().getBBox(),l.attr("transform","translate("+-g.width/2+", "+(-g.height/2-T+3)+")");const _=g.width+(t.padding||0),B=g.height+(t.padding||0),L=-g.width/2-T,A=-g.height/2-T;let E,$;if(t.look==="handDrawn"){const W=wt.svg(o),G=_t(t,{}),it=W.path(zi(L,A,_,B,t.rx||0),G),rt=W.line(-g.width/2-T,-g.height/2-T+y.height+T,g.width/2+T,-g.height/2-T+y.height+T,G);$=o.insert(()=>(nt.debug("Rough node insert CXC",it),rt),":first-child"),E=o.insert(()=>(nt.debug("Rough node insert CXC",it),it),":first-child")}else E=c.insert("rect",":first-child"),$=c.insert("line"),E.attr("class","outer title-state").attr("style",n).attr("x",-g.width/2-T).attr("y",-g.height/2-T).attr("width",g.width+(t.padding||0)).attr("height",g.height+(t.padding||0)),$.attr("class","divider").attr("x1",-g.width/2-T).attr("x2",g.width/2+T).attr("y1",-g.height/2-T+y.height+T).attr("y2",-g.height/2-T+y.height+T);return Lt(t,E),t.intersect=function(W){return yt.rect(t,W)},o}w(LS,"rectWithTitle");function Bo(e,t,r,n,s,o,c){const h=(e+r)/2,d=(t+n)/2,f=Math.atan2(n-t,r-e),g=(r-e)/2,m=(n-t)/2,y=g/s,v=m/o,b=Math.sqrt(y**2+v**2);if(b>1)throw new Error("The given radii are too small to create an arc between the points.");const k=Math.sqrt(1-b**2),T=h+k*o*Math.sin(f)*(c?-1:1),_=d-k*s*Math.cos(f)*(c?-1:1),B=Math.atan2((t-_)/o,(e-T)/s);let A=Math.atan2((n-_)/o,(r-T)/s)-B;c&&A<0&&(A+=2*Math.PI),!c&&A>0&&(A-=2*Math.PI);const E=[];for(let $=0;$<20;$++){const z=$/19,Z=B+z*A,W=T+s*Math.cos(Z),G=_+o*Math.sin(Z);E.push({x:W,y:G})}return E}w(Bo,"generateArcPoints");async function MS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=(t==null?void 0:t.padding)??0,l=(t==null?void 0:t.padding)??0,h=(t!=null&&t.width?t==null?void 0:t.width:o.width)+c*2,d=(t!=null&&t.height?t==null?void 0:t.height:o.height)+l*2,f=t.radius||5,g=t.taper||5,{cssStyles:m}=t,y=wt.svg(s),v=_t(t,{});t.stroke&&(v.stroke=t.stroke),t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const b=[{x:-h/2+g,y:-d/2},{x:h/2-g,y:-d/2},...Bo(h/2-g,-d/2,h/2,-d/2+g,f,f,!0),{x:h/2,y:-d/2+g},{x:h/2,y:d/2-g},...Bo(h/2,d/2-g,h/2-g,d/2,f,f,!0),{x:h/2-g,y:d/2},{x:-h/2+g,y:d/2},...Bo(-h/2+g,d/2,-h/2,d/2-g,f,f,!0),{x:-h/2,y:d/2-g},{x:-h/2,y:-d/2+g},...Bo(-h/2,-d/2+g,-h/2+g,-d/2,f,f,!0)],k=Ut(b),T=y.path(k,v),_=s.insert(()=>T,":first-child");return _.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&_.selectChildren("path").attr("style",n),Lt(t,_),t.intersect=function(B){return yt.polygon(t,b,B)},s}w(MS,"roundedRect");async function BS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=(t==null?void 0:t.padding)??0,h=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),d=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),f=-o.width/2-l,g=-o.height/2-l,{cssStyles:m}=t,y=wt.svg(s),v=_t(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const b=[{x:f,y:g},{x:f+h+8,y:g},{x:f+h+8,y:g+d},{x:f-8,y:g+d},{x:f-8,y:g},{x:f,y:g},{x:f,y:g+d}],k=y.polygon(b.map(_=>[_.x,_.y]),v),T=s.insert(()=>k,":first-child");return T.attr("class","basic label-container").attr("style",Ke(m)),n&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",n),m&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",n),c.attr("transform",`translate(${-h/2+4+(t.padding??0)-(o.x-(o.left??0))},${-d/2+(t.padding??0)-(o.y-(o.top??0))})`),Lt(t,T),t.intersect=function(_){return yt.rect(t,_)},s}w(BS,"shadedProcess");async function AS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=-l/2,f=-h/2,{cssStyles:g}=t,m=wt.svg(s),y=_t(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const v=[{x:d,y:f},{x:d,y:f+h},{x:d+l,y:f+h},{x:d+l,y:f-h/2}],b=Ut(v),k=m.path(b,y),T=s.insert(()=>k,":first-child");return T.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",g),n&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),T.attr("transform",`translate(0, ${h/4})`),c.attr("transform",`translate(${-l/2+(t.padding??0)-(o.x-(o.left??0))}, ${-h/4+(t.padding??0)-(o.y-(o.top??0))})`),Lt(t,T),t.intersect=function(_){return yt.polygon(t,v,_)},s}w(AS,"slopedRect");async function $S(e,t){const r={rx:0,ry:0,labelPaddingX:t.labelPaddingX??((t==null?void 0:t.padding)||0)*2,labelPaddingY:((t==null?void 0:t.padding)||0)*1};return Zu(e,t,r)}w($S,"squareRect");async function RS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=o.height+t.padding,l=o.width+c/4+t.padding,h=c/2,{cssStyles:d}=t,f=wt.svg(s),g=_t(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-l/2+h,y:-c/2},{x:l/2-h,y:-c/2},...Xo(-l/2+h,0,h,50,90,270),{x:l/2-h,y:c/2},...Xo(l/2-h,0,h,50,270,450)],y=Ut(m),v=f.path(y,g),b=s.insert(()=>v,":first-child");return b.attr("class","basic label-container outer-path"),d&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",d),n&&t.look!=="handDrawn"&&b.selectChildren("path").attr("style",n),Lt(t,b),t.intersect=function(k){return yt.polygon(t,m,k)},s}w(RS,"stadium");async function FS(e,t){return Zu(e,t,{rx:5,ry:5})}w(FS,"state");function IS(e,t,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:s}=Tt(t);t.labelStyle=n;const{cssStyles:o}=t,{lineColor:c,stateBorder:l,nodeBorder:h}=r,d=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),f=wt.svg(d),g=_t(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=f.circle(0,0,14,{...g,stroke:c,strokeWidth:2}),y=l??h,v=f.circle(0,0,5,{...g,fill:y,stroke:y,strokeWidth:2,fillStyle:"solid"}),b=d.insert(()=>m,":first-child");return b.insert(()=>v),o&&b.selectAll("path").attr("style",o),s&&b.selectAll("path").attr("style",s),Lt(t,b),t.intersect=function(k){return yt.circle(t,7,k)},d}w(IS,"stateEnd");function PS(e,t,{config:{themeVariables:r}}){const{lineColor:n}=r,s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let o;if(t.look==="handDrawn"){const l=wt.svg(s).circle(0,0,14,p3(n));o=s.insert(()=>l),o.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14)}else o=s.insert("circle",":first-child"),o.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14);return Lt(t,o),t.intersect=function(c){return yt.circle(t,7,c)},s}w(PS,"stateStart");async function DS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=((t==null?void 0:t.padding)||0)/2,l=o.width+t.padding,h=o.height+t.padding,d=-o.width/2-c,f=-o.height/2-c,g=[{x:0,y:0},{x:l,y:0},{x:l,y:-h},{x:0,y:-h},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-h},{x:-8,y:-h},{x:-8,y:0}];if(t.look==="handDrawn"){const m=wt.svg(s),y=_t(t,{}),v=m.rectangle(d-8,f,l+16,h,y),b=m.line(d,f,d,f+h,y),k=m.line(d+l,f,d+l,f+h,y);s.insert(()=>b,":first-child"),s.insert(()=>k,":first-child");const T=s.insert(()=>v,":first-child"),{cssStyles:_}=t;T.attr("class","basic label-container").attr("style",Ke(_)),Lt(t,T)}else{const m=ji(s,l,h,g);n&&m.attr("style",n),Lt(t,m)}return t.intersect=function(m){return yt.polygon(t,g,m)},s}w(DS,"subroutine");async function OS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),l=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),h=-c/2,d=-l/2,f=.2*l,g=.2*l,{cssStyles:m}=t,y=wt.svg(s),v=_t(t,{}),b=[{x:h-f/2,y:d},{x:h+c+f/2,y:d},{x:h+c+f/2,y:d+l},{x:h-f/2,y:d+l}],k=[{x:h+c-f/2,y:d+l},{x:h+c+f/2,y:d+l},{x:h+c+f/2,y:d+l-g}];t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=Ut(b),_=y.path(T,v),B=Ut(k),L=y.path(B,{...v,fillStyle:"solid"}),A=s.insert(()=>L,":first-child");return A.insert(()=>_,":first-child"),A.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",n),Lt(t,A),t.intersect=function(E){return yt.polygon(t,b,E)},s}w(OS,"taggedRect");async function zS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=h/4,f=.2*l,g=.2*h,m=h+d,{cssStyles:y}=t,v=wt.svg(s),b=_t(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=[{x:-l/2-l/2*.1,y:m/2},...Pi(-l/2-l/2*.1,m/2,l/2+l/2*.1,m/2,d,.8),{x:l/2+l/2*.1,y:-m/2},{x:-l/2-l/2*.1,y:-m/2}],T=-l/2+l/2*.1,_=-m/2-g*.4,B=[{x:T+l-f,y:(_+h)*1.4},{x:T+l,y:_+h-g},{x:T+l,y:(_+h)*.9},...Pi(T+l,(_+h)*1.3,T+l-f,(_+h)*1.5,-h*.03,.5)],L=Ut(k),A=v.path(L,b),E=Ut(B),$=v.path(E,{...b,fillStyle:"solid"}),z=s.insert(()=>$,":first-child");return z.insert(()=>A,":first-child"),z.attr("class","basic label-container"),y&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",y),n&&t.look!=="handDrawn"&&z.selectAll("path").attr("style",n),z.attr("transform",`translate(0,${-d/2})`),c.attr("transform",`translate(${-l/2+(t.padding??0)-(o.x-(o.left??0))},${-h/2+(t.padding??0)-d/2-(o.y-(o.top??0))})`),Lt(t,z),t.intersect=function(Z){return yt.polygon(t,k,Z)},s}w(zS,"taggedWaveEdgedRectangle");async function jS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=Math.max(o.width+t.padding,(t==null?void 0:t.width)||0),l=Math.max(o.height+t.padding,(t==null?void 0:t.height)||0),h=-c/2,d=-l/2,f=s.insert("rect",":first-child");return f.attr("class","text").attr("style",n).attr("rx",0).attr("ry",0).attr("x",h).attr("y",d).attr("width",c).attr("height",l),Lt(t,f),t.intersect=function(g){return yt.rect(t,g)},s}w(jS,"text");var y4=w((e,t,r,n,s,o)=>`M${e},${t}
228
+ a${s},${o} 0,0,1 0,${-n}
229
+ l${r},0
230
+ a${s},${o} 0,0,1 0,${n}
231
+ M${r},${-n}
232
+ a${s},${o} 0,0,0 0,${n}
233
+ l${-r},0`,"createCylinderPathD"),x4=w((e,t,r,n,s,o)=>[`M${e},${t}`,`M${e+r},${t}`,`a${s},${o} 0,0,0 0,${-n}`,`l${-r},0`,`a${s},${o} 0,0,0 0,${n}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),v4=w((e,t,r,n,s,o)=>[`M${e+r/2},${-n/2}`,`a${s},${o} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD");async function NS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c,halfPadding:l}=await Dt(e,t,Rt(t)),h=t.look==="neo"?l*2:l,d=o.height+h,f=d/2,g=f/(2.5+d/50),m=o.width+g+h,{cssStyles:y}=t;let v;if(t.look==="handDrawn"){const b=wt.svg(s),k=x4(0,0,m,d,g,f),T=v4(0,0,m,d,g,f),_=b.path(k,_t(t,{})),B=b.path(T,_t(t,{fill:"none"}));v=s.insert(()=>B,":first-child"),v=s.insert(()=>_,":first-child"),v.attr("class","basic label-container"),y&&v.attr("style",y)}else{const b=y4(0,0,m,d,g,f);v=s.insert("path",":first-child").attr("d",b).attr("class","basic label-container").attr("style",Ke(y)).attr("style",n),v.attr("class","basic label-container"),y&&v.selectAll("path").attr("style",y),n&&v.selectAll("path").attr("style",n)}return v.attr("label-offset-x",g),v.attr("transform",`translate(${-m/2}, ${d/2} )`),c.attr("transform",`translate(${-(o.width/2)-g-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Lt(t,v),t.intersect=function(b){const k=yt.rect(t,b),T=k.y-(t.y??0);if(f!=0&&(Math.abs(T)<(t.height??0)/2||Math.abs(T)==(t.height??0)/2&&Math.abs(k.x-(t.x??0))>(t.width??0)/2-g)){let _=g*g*(1-T*T/(f*f));_!=0&&(_=Math.sqrt(Math.abs(_))),_=g-_,b.x-(t.x??0)>0&&(_=-_),k.x+=_}return k},s}w(NS,"tiltedCylinder");async function WS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=o.width+t.padding,l=o.height+t.padding,h=[{x:-3*l/6,y:0},{x:c+3*l/6,y:0},{x:c,y:-l},{x:0,y:-l}];let d;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=wt.svg(s),m=_t(t,{}),y=Ut(h),v=g.path(y,m);d=s.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${l/2})`),f&&d.attr("style",f)}else d=ji(s,c,l,h);return n&&d.attr("style",n),t.width=c,t.height=l,Lt(t,d),t.intersect=function(g){return yt.polygon(t,h,g)},s}w(WS,"trapezoid");async function HS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=60,l=20,h=Math.max(c,o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),d=Math.max(l,o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),{cssStyles:f}=t,g=wt.svg(s),m=_t(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2*.8,y:-d/2},{x:h/2*.8,y:-d/2},{x:h/2,y:-d/2*.6},{x:h/2,y:d/2},{x:-h/2,y:d/2},{x:-h/2,y:-d/2*.6}],v=Ut(y),b=g.path(v,m),k=s.insert(()=>b,":first-child");return k.attr("class","basic label-container"),f&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",f),n&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",n),Lt(t,k),t.intersect=function(T){return yt.polygon(t,y,T)},s}w(HS,"trapezoidalPentagon");async function qS(e,t){var _;const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=Le((_=Jt().flowchart)==null?void 0:_.htmlLabels),h=o.width+(t.padding??0),d=h+o.height,f=h+o.height,g=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-d}],{cssStyles:m}=t,y=wt.svg(s),v=_t(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const b=Ut(g),k=y.path(b,v),T=s.insert(()=>k,":first-child").attr("transform",`translate(${-d/2}, ${d/2})`);return m&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),n&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",n),t.width=h,t.height=d,Lt(t,T),c.attr("transform",`translate(${-o.width/2-(o.x-(o.left??0))}, ${d/2-(o.height+(t.padding??0)/(l?2:1)-(o.y-(o.top??0)))})`),t.intersect=function(B){return nt.info("Triangle intersect",t,g,B),yt.polygon(t,g,B)},s}w(qS,"triangle");async function US(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=h/8,f=h+d,{cssStyles:g}=t,y=70-l,v=y>0?y/2:0,b=wt.svg(s),k=_t(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const T=[{x:-l/2-v,y:f/2},...Pi(-l/2-v,f/2,l/2+v,f/2,d,.8),{x:l/2+v,y:-f/2},{x:-l/2-v,y:-f/2}],_=Ut(T),B=b.path(_,k),L=s.insert(()=>B,":first-child");return L.attr("class","basic label-container"),g&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",g),n&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",n),L.attr("transform",`translate(0,${-d/2})`),c.attr("transform",`translate(${-l/2+(t.padding??0)-(o.x-(o.left??0))},${-h/2+(t.padding??0)-d-(o.y-(o.top??0))})`),Lt(t,L),t.intersect=function(A){return yt.polygon(t,T,A)},s}w(US,"waveEdgedRectangle");async function GS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o}=await Dt(e,t,Rt(t)),c=100,l=50,h=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),d=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),f=h/d;let g=h,m=d;g>m*f?m=g/f:g=m*f,g=Math.max(g,c),m=Math.max(m,l);const y=Math.min(m*.2,m/4),v=m+y*2,{cssStyles:b}=t,k=wt.svg(s),T=_t(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const _=[{x:-g/2,y:v/2},...Pi(-g/2,v/2,g/2,v/2,y,1),{x:g/2,y:-v/2},...Pi(g/2,-v/2,-g/2,-v/2,y,-1)],B=Ut(_),L=k.path(B,T),A=s.insert(()=>L,":first-child");return A.attr("class","basic label-container"),b&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",b),n&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",n),Lt(t,A),t.intersect=function(E){return yt.polygon(t,_,E)},s}w(GS,"waveRectangle");async function VS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,label:c}=await Dt(e,t,Rt(t)),l=Math.max(o.width+(t.padding??0)*2,(t==null?void 0:t.width)??0),h=Math.max(o.height+(t.padding??0)*2,(t==null?void 0:t.height)??0),d=5,f=-l/2,g=-h/2,{cssStyles:m}=t,y=wt.svg(s),v=_t(t,{}),b=[{x:f-d,y:g-d},{x:f-d,y:g+h},{x:f+l,y:g+h},{x:f+l,y:g-d}],k=`M${f-d},${g-d} L${f+l},${g-d} L${f+l},${g+h} L${f-d},${g+h} L${f-d},${g-d}
234
+ M${f-d},${g} L${f+l},${g}
235
+ M${f},${g-d} L${f},${g+h}`;t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=y.path(k,v),_=s.insert(()=>T,":first-child");return _.attr("transform",`translate(${d/2}, ${d/2})`),_.attr("class","basic label-container"),m&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",m),n&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",n),c.attr("transform",`translate(${-(o.width/2)+d/2-(o.x-(o.left??0))}, ${-(o.height/2)+d/2-(o.y-(o.top??0))})`),Lt(t,_),t.intersect=function(B){return yt.polygon(t,b,B)},s}w(VS,"windowPane");async function cg(e,t){var tt,ct,mt,dt;const r=t;if(r.alias&&(t.label=r.alias),t.look==="handDrawn"){const{themeVariables:ht}=Xe(),{background:X}=ht,ft={...t,id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${X}`]};await cg(e,ft)}const n=Xe();t.useHtmlLabels=n.htmlLabels;let s=((tt=n.er)==null?void 0:tt.diagramPadding)??10,o=((ct=n.er)==null?void 0:ct.entityPadding)??6;const{cssStyles:c}=t,{labelStyles:l,nodeStyles:h}=Tt(t);if(r.attributes.length===0&&t.label){const ht={rx:0,ry:0,labelPaddingX:s,labelPaddingY:s*1.5};ii(t.label,n)+ht.labelPaddingX*2<n.er.minEntityWidth&&(t.width=n.er.minEntityWidth);const X=await Zu(e,t,ht);if(!Le(n.htmlLabels)){const ft=X.select("text"),vt=(mt=ft.node())==null?void 0:mt.getBBox();ft.attr("transform",`translate(${-vt.width/2}, 0)`)}return X}n.htmlLabels||(s*=1.25,o*=1.25);let d=Rt(t);d||(d="node default");const f=e.insert("g").attr("class",d).attr("id",t.domId||t.id),g=await ta(f,t.label??"",n,0,0,["name"],l);g.height+=o;let m=0;const y=[],v=[];let b=0,k=0,T=0,_=0,B=!0,L=!0;for(const ht of r.attributes){const X=await ta(f,ht.type,n,0,m,["attribute-type"],l);b=Math.max(b,X.width+s);const ft=await ta(f,ht.name,n,0,m,["attribute-name"],l);k=Math.max(k,ft.width+s);const vt=await ta(f,ht.keys.join(),n,0,m,["attribute-keys"],l);T=Math.max(T,vt.width+s);const Ft=await ta(f,ht.comment,n,0,m,["attribute-comment"],l);_=Math.max(_,Ft.width+s);const ie=Math.max(X.height,ft.height,vt.height,Ft.height)+o;v.push({yOffset:m,rowHeight:ie}),m+=ie}let A=4;T<=s&&(B=!1,T=0,A--),_<=s&&(L=!1,_=0,A--);const E=f.node().getBBox();if(g.width+s*2-(b+k+T+_)>0){const ht=g.width+s*2-(b+k+T+_);b+=ht/A,k+=ht/A,T>0&&(T+=ht/A),_>0&&(_+=ht/A)}const $=b+k+T+_,z=wt.svg(f),Z=_t(t,{});t.look!=="handDrawn"&&(Z.roughness=0,Z.fillStyle="solid");let W=0;v.length>0&&(W=v.reduce((ht,X)=>ht+((X==null?void 0:X.rowHeight)??0),0));const G=Math.max(E.width+s*2,(t==null?void 0:t.width)||0,$),it=Math.max((W??0)+g.height,(t==null?void 0:t.height)||0),rt=-G/2,H=-it/2;f.selectAll("g:not(:first-child)").each((ht,X,ft)=>{const vt=Gt(ft[X]),Ft=vt.attr("transform");let ie=0,ze=0;if(Ft){const cr=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Ft);cr&&(ie=parseFloat(cr[1]),ze=parseFloat(cr[2]),vt.attr("class").includes("attribute-name")?ie+=b:vt.attr("class").includes("attribute-keys")?ie+=b+k:vt.attr("class").includes("attribute-comment")&&(ie+=b+k+T))}vt.attr("transform",`translate(${rt+s/2+ie}, ${ze+H+g.height+o/2})`)}),f.select(".name").attr("transform","translate("+-g.width/2+", "+(H+o/2)+")");const q=z.rectangle(rt,H,G,it,Z),N=f.insert(()=>q,":first-child").attr("style",c.join("")),{themeVariables:Y}=Xe(),{rowEven:P,rowOdd:K,nodeBorder:et}=Y;y.push(0);for(const[ht,X]of v.entries()){const vt=(ht+1)%2===0&&X.yOffset!==0,Ft=z.rectangle(rt,g.height+H+(X==null?void 0:X.yOffset),G,X==null?void 0:X.rowHeight,{...Z,fill:vt?P:K,stroke:et});f.insert(()=>Ft,"g.label").attr("style",c.join("")).attr("class",`row-rect-${vt?"even":"odd"}`)}let I=z.line(rt,g.height+H,G+rt,g.height+H,Z);f.insert(()=>I).attr("class","divider"),I=z.line(b+rt,g.height+H,b+rt,it+H,Z),f.insert(()=>I).attr("class","divider"),B&&(I=z.line(b+k+rt,g.height+H,b+k+rt,it+H,Z),f.insert(()=>I).attr("class","divider")),L&&(I=z.line(b+k+T+rt,g.height+H,b+k+T+rt,it+H,Z),f.insert(()=>I).attr("class","divider"));for(const ht of y)I=z.line(rt,g.height+H+ht,G+rt,g.height+H+ht,Z),f.insert(()=>I).attr("class","divider");if(Lt(t,N),h&&t.look!=="handDrawn"){const ht=h.split(";"),X=(dt=ht==null?void 0:ht.filter(ft=>ft.includes("stroke")))==null?void 0:dt.map(ft=>`${ft}`).join("; ");f.selectAll("path").attr("style",X??""),f.selectAll(".row-rect-even path").attr("style",h)}return t.intersect=function(ht){return yt.rect(t,ht)},f}w(cg,"erBox");async function ta(e,t,r,n=0,s=0,o=[],c=""){const l=e.insert("g").attr("class",`label ${o.join(" ")}`).attr("transform",`translate(${n}, ${s})`).attr("style",c);t!==g0(t)&&(t=g0(t),t=t.replaceAll("<","&lt;").replaceAll(">","&gt;"));const h=l.node().appendChild(await Oi(l,t,{width:ii(t,r)+100,style:c,useHtmlLabels:r.htmlLabels},r));if(t.includes("&lt;")||t.includes("&gt;")){let f=h.children[0];for(f.textContent=f.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">");f.childNodes[0];)f=f.childNodes[0],f.textContent=f.textContent.replaceAll("&lt;","<").replaceAll("&gt;",">")}let d=h.getBBox();if(Le(r.htmlLabels)){const f=h.children[0];f.style.textAlign="start";const g=Gt(h);d=f.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return d}w(ta,"addText");async function YS(e,t,r,n,s=r.class.padding??12){const o=n?0:3,c=e.insert("g").attr("class",Rt(t)).attr("id",t.domId||t.id);let l=null,h=null,d=null,f=null,g=0,m=0,y=0;if(l=c.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const _=t.annotations[0];await Ao(l,{text:`«${_}»`},0),g=l.node().getBBox().height}h=c.insert("g").attr("class","label-group text"),await Ao(h,t,0,["font-weight: bolder"]);const v=h.node().getBBox();m=v.height,d=c.insert("g").attr("class","members-group text");let b=0;for(const _ of t.members){const B=await Ao(d,_,b,[_.parseClassifier()]);b+=B+o}y=d.node().getBBox().height,y<=0&&(y=s/2),f=c.insert("g").attr("class","methods-group text");let k=0;for(const _ of t.methods){const B=await Ao(f,_,k,[_.parseClassifier()]);k+=B+o}let T=c.node().getBBox();if(l!==null){const _=l.node().getBBox();l.attr("transform",`translate(${-_.width/2})`)}return h.attr("transform",`translate(${-v.width/2}, ${g})`),T=c.node().getBBox(),d.attr("transform",`translate(0, ${g+m+s*2})`),T=c.node().getBBox(),f.attr("transform",`translate(0, ${g+m+(y?y+s*4:s*2)})`),T=c.node().getBBox(),{shapeSvg:c,bbox:T}}w(YS,"textHelper");async function Ao(e,t,r,n=[]){const s=e.insert("g").attr("class","label").attr("style",n.join("; ")),o=Xe();let c="useHtmlLabels"in t?t.useHtmlLabels:Le(o.htmlLabels)??!0,l="";"text"in t?l=t.text:l=t.label,!c&&l.startsWith("\\")&&(l=l.substring(1)),pa(l)&&(c=!0);const h=await Oi(s,Lp(_s(l)),{width:ii(l,o)+50,classes:"markdown-node-label",useHtmlLabels:c},o);let d,f=1;if(c){const g=h.children[0],m=Gt(h);f=g.innerHTML.split("<br>").length,g.innerHTML.includes("</math>")&&(f+=g.innerHTML.split("<mrow>").length-1);const y=g.getElementsByTagName("img");if(y){const v=l.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...y].map(b=>new Promise(k=>{function T(){var _;if(b.style.display="flex",b.style.flexDirection="column",v){const B=((_=o.fontSize)==null?void 0:_.toString())??window.getComputedStyle(document.body).fontSize,A=parseInt(B,10)*5+"px";b.style.minWidth=A,b.style.maxWidth=A}else b.style.width="100%";k(b)}w(T,"setupImage"),setTimeout(()=>{b.complete&&T()}),b.addEventListener("error",T),b.addEventListener("load",T)})))}d=g.getBoundingClientRect(),m.attr("width",d.width),m.attr("height",d.height)}else{n.includes("font-weight: bolder")&&Gt(h).selectAll("tspan").attr("font-weight",""),f=h.children.length;const g=h.children[0];(h.textContent===""||h.textContent.includes("&gt"))&&(g.textContent=l[0]+l.substring(1).replaceAll("&gt;",">").replaceAll("&lt;","<").trim(),l[1]===" "&&(g.textContent=g.textContent[0]+" "+g.textContent.substring(1))),g.textContent==="undefined"&&(g.textContent=""),d=h.getBBox()}return s.attr("transform","translate(0,"+(-d.height/(2*f)+r)+")"),d.height}w(Ao,"addText");async function XS(e,t){var Z,W;const r=Jt(),n=r.class.padding??12,s=n,o=t.useHtmlLabels??Le(r.htmlLabels)??!0,c=t;c.annotations=c.annotations??[],c.members=c.members??[],c.methods=c.methods??[];const{shapeSvg:l,bbox:h}=await YS(e,t,r,o,s),{labelStyles:d,nodeStyles:f}=Tt(t);t.labelStyle=d,t.cssStyles=c.styles||"";const g=((Z=c.styles)==null?void 0:Z.join(";"))||f||"";t.cssStyles||(t.cssStyles=g.replaceAll("!important","").split(";"));const m=c.members.length===0&&c.methods.length===0&&!((W=r.class)!=null&&W.hideEmptyMembersBox),y=wt.svg(l),v=_t(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const b=h.width;let k=h.height;c.members.length===0&&c.methods.length===0?k+=s:c.members.length>0&&c.methods.length===0&&(k+=s*2);const T=-b/2,_=-k/2,B=y.rectangle(T-n,_-n-(m?n:c.members.length===0&&c.methods.length===0?-n/2:0),b+2*n,k+2*n+(m?n*2:c.members.length===0&&c.methods.length===0?-n:0),v),L=l.insert(()=>B,":first-child");L.attr("class","basic label-container");const A=L.node().getBBox();l.selectAll(".text").each((G,it,rt)=>{var K;const H=Gt(rt[it]),q=H.attr("transform");let N=0;if(q){const I=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(q);I&&(N=parseFloat(I[2]))}let Y=N+_+n-(m?n:c.members.length===0&&c.methods.length===0?-n/2:0);o||(Y-=4);let P=T;(H.attr("class").includes("label-group")||H.attr("class").includes("annotation-group"))&&(P=-((K=H.node())==null?void 0:K.getBBox().width)/2||0,l.selectAll("text").each(function(et,I,tt){window.getComputedStyle(tt[I]).textAnchor==="middle"&&(P=0)})),H.attr("transform",`translate(${P}, ${Y})`)});const E=l.select(".annotation-group").node().getBBox().height-(m?n/2:0)||0,$=l.select(".label-group").node().getBBox().height-(m?n/2:0)||0,z=l.select(".members-group").node().getBBox().height-(m?n/2:0)||0;if(c.members.length>0||c.methods.length>0||m){const G=y.line(A.x,E+$+_+n,A.x+A.width,E+$+_+n,v);l.insert(()=>G).attr("class","divider").attr("style",g)}if(m||c.members.length>0||c.methods.length>0){const G=y.line(A.x,E+$+z+_+s*2+n,A.x+A.width,E+$+z+_+n+s*2,v);l.insert(()=>G).attr("class","divider").attr("style",g)}if(c.look!=="handDrawn"&&l.selectAll("path").attr("style",g),L.select(":nth-child(2)").attr("style",g),l.selectAll(".divider").select("path").attr("style",g),t.labelStyle?l.selectAll("span").attr("style",t.labelStyle):l.selectAll("span").attr("style",g),!o){const G=RegExp(/color\s*:\s*([^;]*)/),it=G.exec(g);if(it){const rt=it[0].replace("color","fill");l.selectAll("tspan").attr("style",rt)}else if(d){const rt=G.exec(d);if(rt){const H=rt[0].replace("color","fill");l.selectAll("tspan").attr("style",H)}}}return Lt(t,L),t.intersect=function(G){return yt.rect(t,G)},l}w(XS,"classBox");async function QS(e,t){var E,$;const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const s=t,o=t,c=20,l=20,h="verifyMethod"in t,d=Rt(t),f=e.insert("g").attr("class",d).attr("id",t.domId??t.id);let g;h?g=await In(f,`&lt;&lt;${s.type}&gt;&gt;`,0,t.labelStyle):g=await In(f,"&lt;&lt;Element&gt;&gt;",0,t.labelStyle);let m=g;const y=await In(f,s.name,m,t.labelStyle+"; font-weight: bold;");if(m+=y+l,h){const z=await In(f,`${s.requirementId?`ID: ${s.requirementId}`:""}`,m,t.labelStyle);m+=z;const Z=await In(f,`${s.text?`Text: ${s.text}`:""}`,m,t.labelStyle);m+=Z;const W=await In(f,`${s.risk?`Risk: ${s.risk}`:""}`,m,t.labelStyle);m+=W,await In(f,`${s.verifyMethod?`Verification: ${s.verifyMethod}`:""}`,m,t.labelStyle)}else{const z=await In(f,`${o.type?`Type: ${o.type}`:""}`,m,t.labelStyle);m+=z,await In(f,`${o.docRef?`Doc Ref: ${o.docRef}`:""}`,m,t.labelStyle)}const v=(((E=f.node())==null?void 0:E.getBBox().width)??200)+c,b=((($=f.node())==null?void 0:$.getBBox().height)??200)+c,k=-v/2,T=-b/2,_=wt.svg(f),B=_t(t,{});t.look!=="handDrawn"&&(B.roughness=0,B.fillStyle="solid");const L=_.rectangle(k,T,v,b,B),A=f.insert(()=>L,":first-child");if(A.attr("class","basic label-container").attr("style",n),f.selectAll(".label").each((z,Z,W)=>{const G=Gt(W[Z]),it=G.attr("transform");let rt=0,H=0;if(it){const P=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(it);P&&(rt=parseFloat(P[1]),H=parseFloat(P[2]))}const q=H-b/2;let N=k+c/2;(Z===0||Z===1)&&(N=rt),G.attr("transform",`translate(${N}, ${q+c})`)}),m>g+y+l){const z=_.line(k,T+g+y+l,k+v,T+g+y+l,B);f.insert(()=>z).attr("style",n)}return Lt(t,A),t.intersect=function(z){return yt.rect(t,z)},f}w(QS,"requirementBox");async function In(e,t,r,n=""){if(t==="")return 0;const s=e.insert("g").attr("class","label").attr("style",n),o=Jt(),c=o.htmlLabels??!0,l=await Oi(s,Lp(_s(t)),{width:ii(t,o)+50,classes:"markdown-node-label",useHtmlLabels:c,style:n},o);let h;if(c){const d=l.children[0],f=Gt(l);h=d.getBoundingClientRect(),f.attr("width",h.width),f.attr("height",h.height)}else{const d=l.children[0];for(const f of d.children)f.textContent=f.textContent.replaceAll("&gt;",">").replaceAll("&lt;","<"),n&&f.setAttribute("style",n);h=l.getBBox(),h.height+=6}return s.attr("transform",`translate(${-h.width/2},${-h.height/2+r})`),h.height}w(In,"addText");var b4=w(e=>{switch(e){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function KS(e,t,{config:r}){var it,rt;const{labelStyles:n,nodeStyles:s}=Tt(t);t.labelStyle=n||"";const o=10,c=t.width;t.width=(t.width??200)-10;const{shapeSvg:l,bbox:h,label:d}=await Dt(e,t,Rt(t)),f=t.padding||10;let g="",m;"ticket"in t&&t.ticket&&((it=r==null?void 0:r.kanban)!=null&&it.ticketBaseUrl)&&(g=(rt=r==null?void 0:r.kanban)==null?void 0:rt.ticketBaseUrl.replace("#TICKET#",t.ticket),m=l.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",g).attr("target","_blank"));const y={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1};let v,b;m?{label:v,bbox:b}=await of(m,"ticket"in t&&t.ticket||"",y):{label:v,bbox:b}=await of(l,"ticket"in t&&t.ticket||"",y);const{label:k,bbox:T}=await of(l,"assigned"in t&&t.assigned||"",y);t.width=c;const _=10,B=(t==null?void 0:t.width)||0,L=Math.max(b.height,T.height)/2,A=Math.max(h.height+_*2,(t==null?void 0:t.height)||0)+L,E=-B/2,$=-A/2;d.attr("transform","translate("+(f-B/2)+", "+(-L-h.height/2)+")"),v.attr("transform","translate("+(f-B/2)+", "+(-L+h.height/2)+")"),k.attr("transform","translate("+(f+B/2-T.width-2*o)+", "+(-L+h.height/2)+")");let z;const{rx:Z,ry:W}=t,{cssStyles:G}=t;if(t.look==="handDrawn"){const H=wt.svg(l),q=_t(t,{}),N=Z||W?H.path(zi(E,$,B,A,Z||0),q):H.rectangle(E,$,B,A,q);z=l.insert(()=>N,":first-child"),z.attr("class","basic label-container").attr("style",G||null)}else{z=l.insert("rect",":first-child"),z.attr("class","basic label-container __APA__").attr("style",s).attr("rx",Z??5).attr("ry",W??5).attr("x",E).attr("y",$).attr("width",B).attr("height",A);const H="priority"in t&&t.priority;if(H){const q=l.append("line"),N=E+2,Y=$+Math.floor((Z??0)/2),P=$+A-Math.floor((Z??0)/2);q.attr("x1",N).attr("y1",Y).attr("x2",N).attr("y2",P).attr("stroke-width","4").attr("stroke",b4(H))}}return Lt(t,z),t.height=A,t.intersect=function(H){return yt.rect(t,H)},l}w(KS,"kanbanItem");async function ZS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:c,label:l}=await Dt(e,t,Rt(t)),h=o.width+10*c,d=o.height+8*c,f=.15*h,{cssStyles:g}=t,m=o.width+20,y=o.height+20,v=Math.max(h,m),b=Math.max(d,y);l.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`);let k;const T=`M0 0
236
+ a${f},${f} 1 0,0 ${v*.25},${-1*b*.1}
237
+ a${f},${f} 1 0,0 ${v*.25},0
238
+ a${f},${f} 1 0,0 ${v*.25},0
239
+ a${f},${f} 1 0,0 ${v*.25},${b*.1}
240
+
241
+ a${f},${f} 1 0,0 ${v*.15},${b*.33}
242
+ a${f*.8},${f*.8} 1 0,0 0,${b*.34}
243
+ a${f},${f} 1 0,0 ${-1*v*.15},${b*.33}
244
+
245
+ a${f},${f} 1 0,0 ${-1*v*.25},${b*.15}
246
+ a${f},${f} 1 0,0 ${-1*v*.25},0
247
+ a${f},${f} 1 0,0 ${-1*v*.25},0
248
+ a${f},${f} 1 0,0 ${-1*v*.25},${-1*b*.15}
249
+
250
+ a${f},${f} 1 0,0 ${-1*v*.1},${-1*b*.33}
251
+ a${f*.8},${f*.8} 1 0,0 0,${-1*b*.34}
252
+ a${f},${f} 1 0,0 ${v*.1},${-1*b*.33}
253
+ H0 V0 Z`;if(t.look==="handDrawn"){const _=wt.svg(s),B=_t(t,{}),L=_.path(T,B);k=s.insert(()=>L,":first-child"),k.attr("class","basic label-container").attr("style",Ke(g))}else k=s.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",T);return k.attr("transform",`translate(${-v/2}, ${-b/2})`),Lt(t,k),t.calcIntersect=function(_,B){return yt.rect(_,B)},t.intersect=function(_){return nt.info("Bang intersect",t,_),yt.rect(t,_)},s}w(ZS,"bang");async function JS(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:c,label:l}=await Dt(e,t,Rt(t)),h=o.width+2*c,d=o.height+2*c,f=.15*h,g=.25*h,m=.35*h,y=.2*h,{cssStyles:v}=t;let b;const k=`M0 0
254
+ a${f},${f} 0 0,1 ${h*.25},${-1*h*.1}
255
+ a${m},${m} 1 0,1 ${h*.4},${-1*h*.1}
256
+ a${g},${g} 1 0,1 ${h*.35},${h*.2}
257
+
258
+ a${f},${f} 1 0,1 ${h*.15},${d*.35}
259
+ a${y},${y} 1 0,1 ${-1*h*.15},${d*.65}
260
+
261
+ a${g},${f} 1 0,1 ${-1*h*.25},${h*.15}
262
+ a${m},${m} 1 0,1 ${-1*h*.5},0
263
+ a${f},${f} 1 0,1 ${-1*h*.25},${-1*h*.15}
264
+
265
+ a${f},${f} 1 0,1 ${-1*h*.1},${-1*d*.35}
266
+ a${y},${y} 1 0,1 ${h*.1},${-1*d*.65}
267
+ H0 V0 Z`;if(t.look==="handDrawn"){const T=wt.svg(s),_=_t(t,{}),B=T.path(k,_);b=s.insert(()=>B,":first-child"),b.attr("class","basic label-container").attr("style",Ke(v))}else b=s.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",k);return l.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),b.attr("transform",`translate(${-h/2}, ${-d/2})`),Lt(t,b),t.calcIntersect=function(T,_){return yt.rect(T,_)},t.intersect=function(T){return nt.info("Cloud intersect",t,T),yt.rect(t,T)},s}w(JS,"cloud");async function tC(e,t){const{labelStyles:r,nodeStyles:n}=Tt(t);t.labelStyle=r;const{shapeSvg:s,bbox:o,halfPadding:c,label:l}=await Dt(e,t,Rt(t)),h=o.width+8*c,d=o.height+2*c,f=5,g=`
268
+ M${-h/2} ${d/2-f}
269
+ v${-d+2*f}
270
+ q0,-${f} ${f},-${f}
271
+ h${h-2*f}
272
+ q${f},0 ${f},${f}
273
+ v${d-2*f}
274
+ q0,${f} -${f},${f}
275
+ h${-h+2*f}
276
+ q-${f},0 -${f},-${f}
277
+ Z
278
+ `,m=s.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("style",n).attr("d",g);return s.append("line").attr("class","node-line-").attr("x1",-h/2).attr("y1",d/2).attr("x2",h/2).attr("y2",d/2),l.attr("transform",`translate(${-o.width/2}, ${-o.height/2})`),s.append(()=>l.node()),Lt(t,m),t.calcIntersect=function(y,v){return yt.rect(y,v)},t.intersect=function(y){return yt.rect(t,y)},s}w(tC,"defaultMindmapNode");async function eC(e,t){const r={padding:t.padding??0};return lg(e,t,r)}w(eC,"mindmapCircle");var S4=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:$S},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:MS},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:RS},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:DS},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:rS},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:lg},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:ZS},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:JS},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:TS},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:cS},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:vS},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:xS},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:WS},{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:mS},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:iS},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:jS},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Y2},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:BS},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:PS},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:IS},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:oS},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:uS},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Z2},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:J2},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:tS},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:bS},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:US},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:lS},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:NS},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:SS},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:eS},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:nS},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:qS},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:VS},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:sS},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:HS},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:aS},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:AS},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:kS},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:wS},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:V2},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:K2},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:zS},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:OS},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:GS},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:ES},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:CS}],C4=w(()=>{const t=[...Object.entries({state:FS,choice:X2,note:_S,rectWithTitle:LS,labelRect:yS,iconSquare:pS,iconCircle:dS,icon:hS,iconRounded:fS,imageSquare:gS,anchor:G2,kanbanItem:KS,mindmapCircle:eC,defaultMindmapNode:tC,classBox:XS,erBox:cg,requirementBox:QS}),...S4.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(s=>[s,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),rC=C4();function w4(e){return e in rC}w(w4,"isValidShape");var Ju=new Map;async function nC(e,t,r){let n,s;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const o=t.shape?rC[t.shape]:void 0;if(!o)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let c;r.config.securityLevel==="sandbox"?c="_top":t.linkTarget&&(c=t.linkTarget||"_blank"),n=e.insert("svg:a").attr("xlink:href",t.link).attr("target",c??null),s=await o(n,t,r)}else s=await o(e,t,r),n=s;return t.tooltip&&s.attr("title",t.tooltip),Ju.set(t.id,n),t.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}w(nC,"insertNode");var c6=w((e,t)=>{Ju.set(t.id,e)},"setNodeElem"),u6=w(()=>{Ju.clear()},"clear"),h6=w(e=>{const t=Ju.get(e.id);nt.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,n=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+n-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),n},"positionNode"),k4=w((e,t,r,n,s,o)=>{t.arrowTypeStart&&xx(e,"start",t.arrowTypeStart,r,n,s,o),t.arrowTypeEnd&&xx(e,"end",t.arrowTypeEnd,r,n,s,o)},"addEdgeMarkers"),_4={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},xx=w((e,t,r,n,s,o,c)=>{var g;const l=_4[r];if(!l){nt.warn(`Unknown arrow type: ${r}`);return}const h=l.type,f=`${s}_${o}-${h}${t==="start"?"Start":"End"}`;if(c&&c.trim()!==""){const m=c.replace(/[^\dA-Za-z]/g,"_"),y=`${f}_${m}`;if(!document.getElementById(y)){const v=document.getElementById(f);if(v){const b=v.cloneNode(!0);b.id=y,b.querySelectorAll("path, circle, line").forEach(T=>{T.setAttribute("stroke",c),l.fill&&T.setAttribute("fill",c)}),(g=v.parentNode)==null||g.appendChild(b)}}e.attr(`marker-${t}`,`url(${n}#${y})`)}else e.attr(`marker-${t}`,`url(${n}#${f})`)},"addEdgeMarker"),Eu=new Map,Oe=new Map,d6=w(()=>{Eu.clear(),Oe.clear()},"clear"),Tc=w(e=>e?e.reduce((r,n)=>r+";"+n,""):"","getLabelStyles"),T4=w(async(e,t)=>{let r=Le(Jt().flowchart.htmlLabels);const{labelStyles:n}=Tt(t);t.labelStyle=n;const s=await Oi(e,t.label,{style:t.labelStyle,useHtmlLabels:r,addSvgBackground:!0,isNode:!1});nt.info("abc82",t,t.labelType);const o=e.insert("g").attr("class","edgeLabel"),c=o.insert("g").attr("class","label").attr("data-id",t.id);c.node().appendChild(s);let l=s.getBBox();if(r){const d=s.children[0],f=Gt(s);l=d.getBoundingClientRect(),f.attr("width",l.width),f.attr("height",l.height)}c.attr("transform","translate("+-l.width/2+", "+-l.height/2+")"),Eu.set(t.id,o),t.width=l.width,t.height=l.height;let h;if(t.startLabelLeft){const d=await hs(t.startLabelLeft,Tc(t.labelStyle)),f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner");h=g.node().appendChild(d);const m=d.getBBox();g.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),Oe.get(t.id)||Oe.set(t.id,{}),Oe.get(t.id).startLeft=f,$o(h,t.startLabelLeft)}if(t.startLabelRight){const d=await hs(t.startLabelRight,Tc(t.labelStyle)),f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner");h=f.node().appendChild(d),g.node().appendChild(d);const m=d.getBBox();g.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),Oe.get(t.id)||Oe.set(t.id,{}),Oe.get(t.id).startRight=f,$o(h,t.startLabelRight)}if(t.endLabelLeft){const d=await hs(t.endLabelLeft,Tc(t.labelStyle)),f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner");h=g.node().appendChild(d);const m=d.getBBox();g.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),f.node().appendChild(d),Oe.get(t.id)||Oe.set(t.id,{}),Oe.get(t.id).endLeft=f,$o(h,t.endLabelLeft)}if(t.endLabelRight){const d=await hs(t.endLabelRight,Tc(t.labelStyle)),f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner");h=g.node().appendChild(d);const m=d.getBBox();g.attr("transform","translate("+-m.width/2+", "+-m.height/2+")"),f.node().appendChild(d),Oe.get(t.id)||Oe.set(t.id,{}),Oe.get(t.id).endRight=f,$o(h,t.endLabelRight)}return s},"insertEdgeLabel");function $o(e,t){Jt().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}w($o,"setTerminalWidth");var E4=w((e,t)=>{nt.debug("Moving label abc88 ",e.id,e.label,Eu.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const n=Jt(),{subGraphTitleTotalMargin:s}=Yp(n);if(e.label){const o=Eu.get(e.id);let c=e.x,l=e.y;if(r){const h=bn.calcLabelPosition(r);nt.debug("Moving label "+e.label+" from (",c,",",l,") to (",h.x,",",h.y,") abc88"),t.updatedPath&&(c=h.x,l=h.y)}o.attr("transform",`translate(${c}, ${l+s/2})`)}if(e.startLabelLeft){const o=Oe.get(e.id).startLeft;let c=e.x,l=e.y;if(r){const h=bn.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);c=h.x,l=h.y}o.attr("transform",`translate(${c}, ${l})`)}if(e.startLabelRight){const o=Oe.get(e.id).startRight;let c=e.x,l=e.y;if(r){const h=bn.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);c=h.x,l=h.y}o.attr("transform",`translate(${c}, ${l})`)}if(e.endLabelLeft){const o=Oe.get(e.id).endLeft;let c=e.x,l=e.y;if(r){const h=bn.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);c=h.x,l=h.y}o.attr("transform",`translate(${c}, ${l})`)}if(e.endLabelRight){const o=Oe.get(e.id).endRight;let c=e.x,l=e.y;if(r){const h=bn.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);c=h.x,l=h.y}o.attr("transform",`translate(${c}, ${l})`)}},"positionEdgeLabel"),L4=w((e,t)=>{const r=e.x,n=e.y,s=Math.abs(t.x-r),o=Math.abs(t.y-n),c=e.width/2,l=e.height/2;return s>=c||o>=l},"outsideNode"),M4=w((e,t,r)=>{nt.debug(`intersection calc abc89:
279
+ outsidePoint: ${JSON.stringify(t)}
280
+ insidePoint : ${JSON.stringify(r)}
281
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const n=e.x,s=e.y,o=Math.abs(n-r.x),c=e.width/2;let l=r.x<t.x?c-o:c+o;const h=e.height/2,d=Math.abs(t.y-r.y),f=Math.abs(t.x-r.x);if(Math.abs(s-t.y)*c>Math.abs(n-t.x)*h){let g=r.y<t.y?t.y-h-s:s-h-t.y;l=f*g/d;const m={x:r.x<t.x?r.x+l:r.x-f+l,y:r.y<t.y?r.y+d-g:r.y-d+g};return l===0&&(m.x=t.x,m.y=t.y),f===0&&(m.x=t.x),d===0&&(m.y=t.y),nt.debug(`abc89 top/bottom calc, Q ${d}, q ${g}, R ${f}, r ${l}`,m),m}else{r.x<t.x?l=t.x-c-n:l=n-c-t.x;let g=d*l/f,m=r.x<t.x?r.x+f-l:r.x-f+l,y=r.y<t.y?r.y+g:r.y-g;return nt.debug(`sides calc abc89, Q ${d}, q ${g}, R ${f}, r ${l}`,{_x:m,_y:y}),l===0&&(m=t.x,y=t.y),f===0&&(m=t.x),d===0&&(y=t.y),{x:m,y}}},"intersection"),vx=w((e,t)=>{nt.warn("abc88 cutPathAtIntersect",e,t);let r=[],n=e[0],s=!1;return e.forEach(o=>{if(nt.info("abc88 checking point",o,t),!L4(t,o)&&!s){const c=M4(t,n,o);nt.debug("abc88 inside",o,n,c),nt.debug("abc88 intersection",c,t);let l=!1;r.forEach(h=>{l=l||h.x===c.x&&h.y===c.y}),r.some(h=>h.x===c.x&&h.y===c.y)?nt.warn("abc88 no intersect",c,r):r.push(c),s=!0}else nt.warn("abc88 outside",o,n),n=o,s||r.push(o)}),nt.debug("returning points",r),r},"cutPathAtIntersect");function iC(e){const t=[],r=[];for(let n=1;n<e.length-1;n++){const s=e[n-1],o=e[n],c=e[n+1];(s.x===o.x&&o.y===c.y&&Math.abs(o.x-c.x)>5&&Math.abs(o.y-s.y)>5||s.y===o.y&&o.x===c.x&&Math.abs(o.x-s.x)>5&&Math.abs(o.y-c.y)>5)&&(t.push(o),r.push(n))}return{cornerPoints:t,cornerPointPositions:r}}w(iC,"extractCornerPoints");var bx=w(function(e,t,r){const n=t.x-e.x,s=t.y-e.y,o=Math.sqrt(n*n+s*s),c=r/o;return{x:t.x-c*n,y:t.y-c*s}},"findAdjacentPoint"),B4=w(function(e){const{cornerPointPositions:t}=iC(e),r=[];for(let n=0;n<e.length;n++)if(t.includes(n)){const s=e[n-1],o=e[n+1],c=e[n],l=bx(s,c,5),h=bx(o,c,5),d=h.x-l.x,f=h.y-l.y;r.push(l);const g=Math.sqrt(2)*2;let m={x:c.x,y:c.y};if(Math.abs(o.x-s.x)>10&&Math.abs(o.y-s.y)>=10){nt.debug("Corner point fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));const y=5;c.x===l.x?m={x:d<0?l.x-y+g:l.x+y-g,y:f<0?l.y-g:l.y+g}:m={x:d<0?l.x-g:l.x+g,y:f<0?l.y-y+g:l.y+y-g}}else nt.debug("Corner point skipping fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));r.push(m,h)}else r.push(e[n]);return r},"fixCorners"),A4=w((e,t,r)=>{const n=e-t-r,s=2,o=2,c=s+o,l=Math.floor(n/c),h=Array(l).fill(`${s} ${o}`).join(" ");return`0 ${t} ${h} ${r}`},"generateDashArray"),$4=w(function(e,t,r,n,s,o,c,l=!1){var H;const{handDrawnSeed:h}=Jt();let d=t.points,f=!1;const g=s;var m=o;const y=[];for(const q in t.cssCompiledStyles)Gb(q)||y.push(t.cssCompiledStyles[q]);nt.debug("UIO intersect check",t.points,m.x,g.x),m.intersect&&g.intersect&&!l&&(d=d.slice(1,t.points.length-1),d.unshift(g.intersect(d[0])),nt.debug("Last point UIO",t.start,"-->",t.end,d[d.length-1],m,m.intersect(d[d.length-1])),d.push(m.intersect(d[d.length-1])));const v=btoa(JSON.stringify(d));t.toCluster&&(nt.info("to cluster abc88",r.get(t.toCluster)),d=vx(t.points,r.get(t.toCluster).node),f=!0),t.fromCluster&&(nt.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(d,null,2)),d=vx(d.reverse(),r.get(t.fromCluster).node).reverse(),f=!0);let b=d.filter(q=>!Number.isNaN(q.y));b=B4(b);let k=zc;switch(k=ou,t.curve){case"linear":k=ou;break;case"basis":k=zc;break;case"cardinal":k=Q1;break;case"bumpX":k=U1;break;case"bumpY":k=G1;break;case"catmullRom":k=Z1;break;case"monotoneX":k=iv;break;case"monotoneY":k=sv;break;case"natural":k=ov;break;case"step":k=lv;break;case"stepAfter":k=uv;break;case"stepBefore":k=cv;break;default:k=zc}const{x:T,y:_}=f3(t),B=QB().x(T).y(_).curve(k);let L;switch(t.thickness){case"normal":L="edge-thickness-normal";break;case"thick":L="edge-thickness-thick";break;case"invisible":L="edge-thickness-invisible";break;default:L="edge-thickness-normal"}switch(t.pattern){case"solid":L+=" edge-pattern-solid";break;case"dotted":L+=" edge-pattern-dotted";break;case"dashed":L+=" edge-pattern-dashed";break;default:L+=" edge-pattern-solid"}let A,E=t.curve==="rounded"?sC(aC(b,t),5):B(b);const $=Array.isArray(t.style)?t.style:[t.style];let z=$.find(q=>q==null?void 0:q.startsWith("stroke:")),Z=!1;if(t.look==="handDrawn"){const q=wt.svg(e);Object.assign([],b);const N=q.path(E,{roughness:.3,seed:h});L+=" transition",A=Gt(N).select("path").attr("id",t.id).attr("class"," "+L+(t.classes?" "+t.classes:"")).attr("style",$?$.reduce((P,K)=>P+";"+K,""):"");let Y=A.attr("d");A.attr("d",Y),e.node().appendChild(A.node())}else{const q=y.join(";"),N=$?$.reduce((ct,mt)=>ct+mt+";",""):"";let Y="";t.animate&&(Y=" edge-animation-fast"),t.animation&&(Y=" edge-animation-"+t.animation);const P=(q?q+";"+N+";":N)+";"+($?$.reduce((ct,mt)=>ct+";"+mt,""):"");A=e.append("path").attr("d",E).attr("id",t.id).attr("class"," "+L+(t.classes?" "+t.classes:"")+(Y??"")).attr("style",P),z=(H=P.match(/stroke:([^;]+)/))==null?void 0:H[1],Z=t.animate===!0||!!t.animation||q.includes("animation");const K=A.node(),et=typeof K.getTotalLength=="function"?K.getTotalLength():0,I=W0[t.arrowTypeStart]||0,tt=W0[t.arrowTypeEnd]||0;if(t.look==="neo"&&!Z){const mt=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?A4(et,I,tt):`0 ${I} ${et-I-tt} ${tt}`}; stroke-dashoffset: 0;`;A.attr("style",mt+A.attr("style"))}}A.attr("data-edge",!0),A.attr("data-et","edge"),A.attr("data-id",t.id),A.attr("data-points",v),t.showPoints&&b.forEach(q=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",q.x).attr("cy",q.y)});let W="";(Jt().flowchart.arrowMarkerAbsolute||Jt().state.arrowMarkerAbsolute)&&(W=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,W=W.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),nt.info("arrowTypeStart",t.arrowTypeStart),nt.info("arrowTypeEnd",t.arrowTypeEnd),k4(A,t,W,c,n,z);const G=Math.floor(d.length/2),it=d[G];bn.isLabelCoordinateInPath(it,A.attr("d"))||(f=!0);let rt={};return f&&(rt.updatedPath=d),rt.originalPath=t.points,rt},"insertEdge");function sC(e,t){if(e.length<2)return"";let r="";const n=e.length,s=1e-5;for(let o=0;o<n;o++){const c=e[o],l=e[o-1],h=e[o+1];if(o===0)r+=`M${c.x},${c.y}`;else if(o===n-1)r+=`L${c.x},${c.y}`;else{const d=c.x-l.x,f=c.y-l.y,g=h.x-c.x,m=h.y-c.y,y=Math.hypot(d,f),v=Math.hypot(g,m);if(y<s||v<s){r+=`L${c.x},${c.y}`;continue}const b=d/y,k=f/y,T=g/v,_=m/v,B=b*T+k*_,L=Math.max(-1,Math.min(1,B)),A=Math.acos(L);if(A<s||Math.abs(Math.PI-A)<s){r+=`L${c.x},${c.y}`;continue}const E=Math.min(t/Math.sin(A/2),y/2,v/2),$=c.x-b*E,z=c.y-k*E,Z=c.x+T*E,W=c.y+_*E;r+=`L${$},${z}`,r+=`Q${c.x},${c.y} ${Z},${W}`}}return r}w(sC,"generateRoundedPath");function ep(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,n=t.y-e.y;return{angle:Math.atan2(n,r),deltaX:r,deltaY:n}}w(ep,"calculateDeltaAndAngle");function aC(e,t){const r=e.map(s=>({...s}));if(e.length>=2&&Ye[t.arrowTypeStart]){const s=Ye[t.arrowTypeStart],o=e[0],c=e[1],{angle:l}=ep(o,c),h=s*Math.cos(l),d=s*Math.sin(l);r[0].x=o.x+h,r[0].y=o.y+d}const n=e.length;if(n>=2&&Ye[t.arrowTypeEnd]){const s=Ye[t.arrowTypeEnd],o=e[n-1],c=e[n-2],{angle:l}=ep(c,o),h=s*Math.cos(l),d=s*Math.sin(l);r[n-1].x=o.x-h,r[n-1].y=o.y-d}return r}w(aC,"applyMarkerOffsetsToPoints");var R4=w((e,t,r,n)=>{t.forEach(s=>{X4[s](e,r,n)})},"insertMarkers"),F4=w((e,t,r)=>{nt.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),I4=w((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),P4=w((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),D4=w((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),O4=w((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),z4=w((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),j4=w((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),N4=w((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),W4=w((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),H4=w((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),q4=w((e,t,r)=>{const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),n.append("path").attr("d","M9,0 L9,18");const s=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),s.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),U4=w((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),G4=w((e,t,r)=>{const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");n.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const s=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),s.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),V4=w((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
282
+ L20,10
283
+ M20,10
284
+ L0,20`)},"requirement_arrow"),Y4=w((e,t,r)=>{const n=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),X4={extension:F4,composition:I4,aggregation:P4,dependency:D4,lollipop:O4,point:z4,circle:j4,cross:N4,barb:W4,only_one:H4,zero_or_one:q4,one_or_more:U4,zero_or_more:G4,requirement_arrow:V4,requirement_contains:Y4},Q4=R4,K4={common:Sa,getConfig:Xe,insertCluster:s4,insertEdge:$4,insertEdgeLabel:T4,insertMarkers:Q4,insertNode:nC,interpolateToCurve:Jp,labelHelper:Dt,log:nt,positionEdgeLabel:E4},Qo={},oC=w(e=>{for(const t of e)Qo[t.name]=t},"registerLayoutLoaders"),Z4=w(()=>{oC([{name:"dagre",loader:w(async()=>await Zt(()=>import("./dagre-6UL2VRFP-gRmGLrEW.js"),__vite__mapDeps([0,1,2,3,4,5])),"loader")},{name:"cose-bilkent",loader:w(async()=>await Zt(()=>import("./cose-bilkent-S5V4N54A-2O2oovOj.js"),__vite__mapDeps([6,7])),"loader")}])},"registerDefaultLayoutLoaders");Z4();var f6=w(async(e,t)=>{if(!(e.layoutAlgorithm in Qo))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const r=Qo[e.layoutAlgorithm];return(await r.loader()).render(e,t,K4,{algorithm:r.algorithm})},"render"),p6=w((e="",{fallback:t="dagre"}={})=>{if(e in Qo)return e;if(t in Qo)return nt.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),lC="comm",cC="rule",uC="decl",J4="@import",tF="@namespace",eF="@keyframes",rF="@layer",hC=Math.abs,ug=String.fromCharCode;function dC(e){return e.trim()}function qc(e,t,r){return e.replace(t,r)}function nF(e,t,r){return e.indexOf(t,r)}function ia(e,t){return e.charCodeAt(t)|0}function va(e,t,r){return e.slice(t,r)}function Pn(e){return e.length}function iF(e){return e.length}function Ec(e,t){return t.push(e),e}var th=1,ba=1,fC=0,Jr=0,Ce=0,Ta="";function hg(e,t,r,n,s,o,c,l){return{value:e,root:t,parent:r,type:n,props:s,children:o,line:th,column:ba,length:c,return:"",siblings:l}}function sF(){return Ce}function aF(){return Ce=Jr>0?ia(Ta,--Jr):0,ba--,Ce===10&&(ba=1,th--),Ce}function Cn(){return Ce=Jr<fC?ia(Ta,Jr++):0,ba++,Ce===10&&(ba=1,th++),Ce}function Bi(){return ia(Ta,Jr)}function Uc(){return Jr}function eh(e,t){return va(Ta,e,t)}function Ko(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 oF(e){return th=ba=1,fC=Pn(Ta=e),Jr=0,[]}function lF(e){return Ta="",e}function lf(e){return dC(eh(Jr-1,rp(e===91?e+2:e===40?e+1:e)))}function cF(e){for(;(Ce=Bi())&&Ce<33;)Cn();return Ko(e)>2||Ko(Ce)>3?"":" "}function uF(e,t){for(;--t&&Cn()&&!(Ce<48||Ce>102||Ce>57&&Ce<65||Ce>70&&Ce<97););return eh(e,Uc()+(t<6&&Bi()==32&&Cn()==32))}function rp(e){for(;Cn();)switch(Ce){case e:return Jr;case 34:case 39:e!==34&&e!==39&&rp(Ce);break;case 40:e===41&&rp(e);break;case 92:Cn();break}return Jr}function hF(e,t){for(;Cn()&&e+Ce!==57;)if(e+Ce===84&&Bi()===47)break;return"/*"+eh(t,Jr-1)+"*"+ug(e===47?e:Cn())}function dF(e){for(;!Ko(Bi());)Cn();return eh(e,Jr)}function fF(e){return lF(Gc("",null,null,null,[""],e=oF(e),0,[0],e))}function Gc(e,t,r,n,s,o,c,l,h){for(var d=0,f=0,g=c,m=0,y=0,v=0,b=1,k=1,T=1,_=0,B="",L=s,A=o,E=n,$=B;k;)switch(v=_,_=Cn()){case 40:if(v!=108&&ia($,g-1)==58){nF($+=qc(lf(_),"&","&\f"),"&\f",hC(d?l[d-1]:0))!=-1&&(T=-1);break}case 34:case 39:case 91:$+=lf(_);break;case 9:case 10:case 13:case 32:$+=cF(v);break;case 92:$+=uF(Uc()-1,7);continue;case 47:switch(Bi()){case 42:case 47:Ec(pF(hF(Cn(),Uc()),t,r,h),h),(Ko(v||1)==5||Ko(Bi()||1)==5)&&Pn($)&&va($,-1,void 0)!==" "&&($+=" ");break;default:$+="/"}break;case 123*b:l[d++]=Pn($)*T;case 125*b:case 59:case 0:switch(_){case 0:case 125:k=0;case 59+f:T==-1&&($=qc($,/\f/g,"")),y>0&&(Pn($)-g||b===0&&v===47)&&Ec(y>32?Cx($+";",n,r,g-1,h):Cx(qc($," ","")+";",n,r,g-2,h),h);break;case 59:$+=";";default:if(Ec(E=Sx($,t,r,d,f,s,l,B,L=[],A=[],g,o),o),_===123)if(f===0)Gc($,t,E,E,L,o,g,l,A);else{switch(m){case 99:if(ia($,3)===110)break;case 108:if(ia($,2)===97)break;default:f=0;case 100:case 109:case 115:}f?Gc(e,E,E,n&&Ec(Sx(e,E,E,0,0,s,l,B,s,L=[],g,A),A),s,A,g,l,n?L:A):Gc($,E,E,E,[""],A,0,l,A)}}d=f=y=0,b=T=1,B=$="",g=c;break;case 58:g=1+Pn($),y=v;default:if(b<1){if(_==123)--b;else if(_==125&&b++==0&&aF()==125)continue}switch($+=ug(_),_*b){case 38:T=f>0?1:($+="\f",-1);break;case 44:l[d++]=(Pn($)-1)*T,T=1;break;case 64:Bi()===45&&($+=lf(Cn())),m=Bi(),f=g=Pn(B=$+=dF(Uc())),_++;break;case 45:v===45&&Pn($)==2&&(b=0)}}return o}function Sx(e,t,r,n,s,o,c,l,h,d,f,g){for(var m=s-1,y=s===0?o:[""],v=iF(y),b=0,k=0,T=0;b<n;++b)for(var _=0,B=va(e,m+1,m=hC(k=c[b])),L=e;_<v;++_)(L=dC(k>0?y[_]+" "+B:qc(B,/&\f/g,y[_])))&&(h[T++]=L);return hg(e,t,r,s===0?cC:l,h,d,f,g)}function pF(e,t,r,n){return hg(e,t,r,lC,ug(sF()),va(e,2,-2),0,n)}function Cx(e,t,r,n,s){return hg(e,t,r,uC,va(e,0,n),va(e,n+1,-1),n,s)}function np(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function gF(e,t,r,n){switch(e.type){case rF:if(e.children.length)break;case J4:case tF:case uC:return e.return=e.return||e.value;case lC:return"";case eF:return e.return=e.value+"{"+np(e.children,n)+"}";case cC:if(!Pn(e.value=e.props.join(",")))return""}return Pn(r=np(e.children,n))?e.return=e.value+"{"+r+"}":""}var mF=Qb(Object.keys,Object),yF=Object.prototype,xF=yF.hasOwnProperty;function vF(e){if(!Gu(e))return mF(e);var t=[];for(var r in Object(e))xF.call(e,r)&&r!="constructor"&&t.push(r);return t}var ip=ks(Nn,"DataView"),sp=ks(Nn,"Promise"),ap=ks(Nn,"Set"),op=ks(Nn,"WeakMap"),wx="[object Map]",bF="[object Object]",kx="[object Promise]",_x="[object Set]",Tx="[object WeakMap]",Ex="[object DataView]",SF=ws(ip),CF=ws(Yo),wF=ws(sp),kF=ws(ap),_F=ws(op),as=wa;(ip&&as(new ip(new ArrayBuffer(1)))!=Ex||Yo&&as(new Yo)!=wx||sp&&as(sp.resolve())!=kx||ap&&as(new ap)!=_x||op&&as(new op)!=Tx)&&(as=function(e){var t=wa(e),r=t==bF?e.constructor:void 0,n=r?ws(r):"";if(n)switch(n){case SF:return Ex;case CF:return wx;case wF:return kx;case kF:return _x;case _F:return Tx}return t});var TF="[object Map]",EF="[object Set]",LF=Object.prototype,MF=LF.hasOwnProperty;function Lx(e){if(e==null)return!0;if(Vu(e)&&(bu(e)||typeof e=="string"||typeof e.splice=="function"||Kp(e)||Zp(e)||vu(e)))return!e.length;var t=as(e);if(t==TF||t==EF)return!e.size;if(Gu(e))return!vF(e).length;for(var r in e)if(MF.call(e,r))return!1;return!0}var pC="c4",BF=w(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),AF=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./c4Diagram-YG6GDRKO-rIpnAud9.js");return{diagram:t}},__vite__mapDeps([8,9]));return{id:pC,diagram:e}},"loader"),$F={id:pC,detector:BF,loader:AF},RF=$F,gC="flowchart",FF=w((e,t)=>{var r,n;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-wrapper"||((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),IF=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-CBzCj5D6.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]));return{id:gC,diagram:e}},"loader"),PF={id:gC,detector:FF,loader:IF},DF=PF,mC="flowchart-v2",OF=w((e,t)=>{var r,n,s;return((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="dagre-d3"?!1:(((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((s=t==null?void 0:t.flowchart)==null?void 0:s.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),zF=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-CBzCj5D6.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]));return{id:mC,diagram:e}},"loader"),jF={id:mC,detector:OF,loader:zF},NF=jF,yC="er",WF=w(e=>/^\s*erDiagram/.test(e),"detector"),HF=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./erDiagram-Q2GNP2WA-CG7dqzk3.js");return{diagram:t}},__vite__mapDeps([15,12,13,14]));return{id:yC,diagram:e}},"loader"),qF={id:yC,detector:WF,loader:HF},UF=qF,xC="gitGraph",GF=w(e=>/^\s*gitGraph/.test(e),"detector"),VF=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./gitGraphDiagram-V2S2FVAM-Dqrc4wUs.js");return{diagram:t}},__vite__mapDeps([16,17,18,19,2,4,5]));return{id:xC,diagram:e}},"loader"),YF={id:xC,detector:GF,loader:VF},XF=YF,vC="gantt",QF=w(e=>/^\s*gantt/.test(e),"detector"),KF=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./ganttDiagram-JELNMOA3-CHw-4qJC.js");return{diagram:t}},__vite__mapDeps([20,21,22,23]));return{id:vC,diagram:e}},"loader"),ZF={id:vC,detector:QF,loader:KF},JF=ZF,bC="info",tI=w(e=>/^\s*info/.test(e),"detector"),eI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./infoDiagram-HS3SLOUP-CflnZPsm.js");return{diagram:t}},__vite__mapDeps([24,19,2,4,5]));return{id:bC,diagram:e}},"loader"),rI={id:bC,detector:tI,loader:eI},SC="pie",nI=w(e=>/^\s*pie/.test(e),"detector"),iI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./pieDiagram-ADFJNKIX-B_lYaGFj.js");return{diagram:t}},__vite__mapDeps([25,17,19,2,4,5,26,27,22]));return{id:SC,diagram:e}},"loader"),sI={id:SC,detector:nI,loader:iI},CC="quadrantChart",aI=w(e=>/^\s*quadrantChart/.test(e),"detector"),oI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./quadrantDiagram-AYHSOK5B-DLZLTJe3.js");return{diagram:t}},__vite__mapDeps([28,21,22,23]));return{id:CC,diagram:e}},"loader"),lI={id:CC,detector:aI,loader:oI},cI=lI,wC="xychart",uI=w(e=>/^\s*xychart(-beta)?/.test(e),"detector"),hI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./xychartDiagram-PRI3JC2R-DkBhUy_D.js");return{diagram:t}},__vite__mapDeps([29,22,27,21,23]));return{id:wC,diagram:e}},"loader"),dI={id:wC,detector:uI,loader:hI},fI=dI,kC="requirement",pI=w(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),gI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./requirementDiagram-UZGBJVZJ-CZE26rhL.js");return{diagram:t}},__vite__mapDeps([30,12,13]));return{id:kC,diagram:e}},"loader"),mI={id:kC,detector:pI,loader:gI},yI=mI,_C="sequence",xI=w(e=>/^\s*sequenceDiagram/.test(e),"detector"),vI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./sequenceDiagram-WL72ISMW-BY723FEn.js");return{diagram:t}},__vite__mapDeps([31,9,18]));return{id:_C,diagram:e}},"loader"),bI={id:_C,detector:xI,loader:vI},SI=bI,TC="class",CI=w((e,t)=>{var r;return((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),wI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./classDiagram-2ON5EDUG-BTs-zEmB.js");return{diagram:t}},__vite__mapDeps([32,33,11,12,13]));return{id:TC,diagram:e}},"loader"),kI={id:TC,detector:CI,loader:wI},_I=kI,EC="classDiagram",TI=w((e,t)=>{var r;return/^\s*classDiagram/.test(e)&&((r=t==null?void 0:t.class)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),EI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./classDiagram-v2-WZHVMYZB-BTs-zEmB.js");return{diagram:t}},__vite__mapDeps([34,33,11,12,13]));return{id:EC,diagram:e}},"loader"),LI={id:EC,detector:TI,loader:EI},MI=LI,LC="state",BI=w((e,t)=>{var r;return((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),AI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./stateDiagram-FKZM4ZOC-C_UdOFhy.js");return{diagram:t}},__vite__mapDeps([35,36,12,13,1,2,3,4]));return{id:LC,diagram:e}},"loader"),$I={id:LC,detector:BI,loader:AI},RI=$I,MC="stateDiagram",FI=w((e,t)=>{var r;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((r=t==null?void 0:t.state)==null?void 0:r.defaultRenderer)==="dagre-wrapper")},"detector"),II=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./stateDiagram-v2-4FDKWEC3-DXIiFh0L.js");return{diagram:t}},__vite__mapDeps([37,36,12,13]));return{id:MC,diagram:e}},"loader"),PI={id:MC,detector:FI,loader:II},DI=PI,BC="journey",OI=w(e=>/^\s*journey/.test(e),"detector"),zI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./journeyDiagram-XKPGCS4Q-D2gkCipQ.js");return{diagram:t}},__vite__mapDeps([38,9,11,26]));return{id:BC,diagram:e}},"loader"),jI={id:BC,detector:OI,loader:zI},NI=jI,WI=w((e,t,r)=>{nt.debug(`rendering svg for syntax error
285
+ `);const n=sA(t),s=n.append("g");n.attr("viewBox","0 0 2412 512"),p1(n,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),AC={draw:WI},HI=AC,qI={db:{},renderer:AC,parser:{parse:w(()=>{},"parse")}},UI=qI,$C="flowchart-elk",GI=w((e,t={})=>{var r;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),VI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./flowDiagram-NV44I4VS-CBzCj5D6.js");return{diagram:t}},__vite__mapDeps([10,11,12,13,14]));return{id:$C,diagram:e}},"loader"),YI={id:$C,detector:GI,loader:VI},XI=YI,RC="timeline",QI=w(e=>/^\s*timeline/.test(e),"detector"),KI=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./timeline-definition-IT6M3QCI-DkrJqww0.js");return{diagram:t}},__vite__mapDeps([39,26]));return{id:RC,diagram:e}},"loader"),ZI={id:RC,detector:QI,loader:KI},JI=ZI,FC="mindmap",tP=w(e=>/^\s*mindmap/.test(e),"detector"),eP=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./mindmap-definition-VGOIOE7T-DSgjVg-P.js");return{diagram:t}},__vite__mapDeps([40,12,13]));return{id:FC,diagram:e}},"loader"),rP={id:FC,detector:tP,loader:eP},nP=rP,IC="kanban",iP=w(e=>/^\s*kanban/.test(e),"detector"),sP=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./kanban-definition-3W4ZIXB7-CtLLz4o8.js");return{diagram:t}},__vite__mapDeps([41,11]));return{id:IC,diagram:e}},"loader"),aP={id:IC,detector:iP,loader:sP},oP=aP,PC="sankey",lP=w(e=>/^\s*sankey(-beta)?/.test(e),"detector"),cP=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./sankeyDiagram-TZEHDZUN-DQMRJAPV.js");return{diagram:t}},__vite__mapDeps([42,27,22]));return{id:PC,diagram:e}},"loader"),uP={id:PC,detector:lP,loader:cP},hP=uP,DC="packet",dP=w(e=>/^\s*packet(-beta)?/.test(e),"detector"),fP=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./diagram-S2PKOQOG-NcK-KHaA.js");return{diagram:t}},__vite__mapDeps([43,17,19,2,4,5]));return{id:DC,diagram:e}},"loader"),pP={id:DC,detector:dP,loader:fP},OC="radar",gP=w(e=>/^\s*radar-beta/.test(e),"detector"),mP=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./diagram-QEK2KX5R-B_NNUAm3.js");return{diagram:t}},__vite__mapDeps([44,17,19,2,4,5]));return{id:OC,diagram:e}},"loader"),yP={id:OC,detector:gP,loader:mP},zC="block",xP=w(e=>/^\s*block(-beta)?/.test(e),"detector"),vP=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./blockDiagram-VD42YOAC-C2e_j6ry.js");return{diagram:t}},__vite__mapDeps([45,11,5,2,1,14]));return{id:zC,diagram:e}},"loader"),bP={id:zC,detector:xP,loader:vP},SP=bP,jC="architecture",CP=w(e=>/^\s*architecture/.test(e),"detector"),wP=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./architectureDiagram-VXUJARFQ-CegbV-RR.js");return{diagram:t}},__vite__mapDeps([46,17,19,2,4,5,7]));return{id:jC,diagram:e}},"loader"),kP={id:jC,detector:CP,loader:wP},_P=kP,NC="treemap",TP=w(e=>/^\s*treemap/.test(e),"detector"),EP=w(async()=>{const{diagram:e}=await Zt(async()=>{const{diagram:t}=await import("./diagram-PSM6KHXK-B7Li-xxw.js");return{diagram:t}},__vite__mapDeps([47,13,17,19,2,4,5,23,27,22]));return{id:NC,diagram:e}},"loader"),LP={id:NC,detector:TP,loader:EP},Mx=!1,rh=w(()=>{Mx||(Mx=!0,tu("error",UI,e=>e.toLowerCase().trim()==="error"),tu("---",{db:{clear:w(()=>{},"clear")},styles:{},renderer:{draw:w(()=>{},"draw")},parser:{parse:w(()=>{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:w(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),yf(XI,nP,_P),yf(RF,oP,MI,_I,UF,JF,rI,sI,yI,SI,NF,DF,JI,XF,DI,RI,NI,cI,hP,pP,fI,SP,yP,LP))},"addDiagrams"),MP=w(async()=>{nt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(gs).map(async([r,{detector:n,loader:s}])=>{if(s)try{Sf(r)}catch{try{const{diagram:o,id:c}=await s();tu(c,o,n)}catch(o){throw nt.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete gs[r],o}}}))).filter(r=>r.status==="rejected");if(t.length>0){nt.error(`Failed to load ${t.length} external diagrams`);for(const r of t)nt.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),BP="graphics-document document";function WC(e,t){e.attr("role",BP),t!==""&&e.attr("aria-roledescription",t)}w(WC,"setA11yDiagramInfo");function HC(e,t,r,n){if(e.insert!==void 0){if(r){const s=`chart-desc-${n}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(r)}if(t){const s=`chart-title-${n}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(t)}}}w(HC,"addSVGa11yTitleDescription");var fs,lp=(fs=class{constructor(t,r,n,s,o){this.type=t,this.text=r,this.db=n,this.parser=s,this.renderer=o}static async fromText(t,r={}){var d,f;const n=Xe(),s=Cp(t,n);t=h5(t)+`
286
+ `;try{Sf(s)}catch{const g=IT(s);if(!g)throw new r1(`Diagram ${s} not found.`);const{id:m,diagram:y}=await g();tu(m,y)}const{db:o,parser:c,renderer:l,init:h}=Sf(s);return c.parser&&(c.parser.yy=o),(d=o.clear)==null||d.call(o),h==null||h(n),r.title&&((f=o.setDiagramTitle)==null||f.call(o,r.title)),await c.parse(t),new fs(s,t,o,c,l)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},w(fs,"Diagram"),fs),Bx=[],AP=w(()=>{Bx.forEach(e=>{e()}),Bx=[]},"attachFunctions"),$P=w(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function qC(e){const t=e.match(e1);if(!t)return{text:e,metadata:{}};let r=d3(t[1],{schema:h3})??{};r=typeof r=="object"&&!Array.isArray(r)?r:{};const n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:e.slice(t[0].length),metadata:n}}w(qC,"extractFrontMatter");var RP=w(e=>e.replace(/\r\n?/g,`
287
+ `).replace(/<(\w+)([^>]*)>/g,(t,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),FP=w(e=>{const{text:t,metadata:r}=qC(e),{displayMode:n,title:s,config:o={}}=r;return n&&(o.gantt||(o.gantt={}),o.gantt.displayMode=n),{title:s,config:o,text:t}},"processFrontmatter"),IP=w(e=>{const t=bn.detectInit(e)??{},r=bn.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(t.wrap=!0),{text:ZR(e),directive:t}},"processDirectives");function dg(e){const t=RP(e),r=FP(t),n=IP(r.text),s=ig(r.config,n.directive);return e=$P(n.text),{code:e,title:r.title,config:s}}w(dg,"preprocessDiagram");function UC(e){const t=new TextEncoder().encode(e),r=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(r)}w(UC,"toBase64");var PP=5e4,DP="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",OP="sandbox",zP="loose",jP="http://www.w3.org/2000/svg",NP="http://www.w3.org/1999/xlink",WP="http://www.w3.org/1999/xhtml",HP="100%",qP="100%",UP="border:0;margin:0;",GP="margin:0",VP="allow-top-navigation-by-user-activation allow-popups",YP='The "iframe" tag is not supported by your browser.',XP=["foreignobject"],QP=["dominant-baseline"];function fg(e){const t=dg(e);return Zc(),KT(t.config??{}),t}w(fg,"processAndSetConfigs");async function GC(e,t){rh();try{const{code:r,config:n}=fg(e);return{diagramType:(await YC(r)).type,config:n}}catch(r){if(t!=null&&t.suppressErrors)return!1;throw r}}w(GC,"parse");var Ax=w((e,t,r=[])=>`
288
+ .${e} ${t} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),KP=w((e,t=new Map)=>{var n;let r="";if(e.themeCSS!==void 0&&(r+=`
289
+ ${e.themeCSS}`),e.fontFamily!==void 0&&(r+=`
290
+ :root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(r+=`
291
+ :root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){const l=e.htmlLabels??((n=e.flowchart)==null?void 0:n.htmlLabels)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(h=>{Lx(h.styles)||l.forEach(d=>{r+=Ax(h.id,d,h.styles)}),Lx(h.textStyles)||(r+=Ax(h.id,"tspan",((h==null?void 0:h.textStyles)||[]).map(d=>d.replace("color","fill"))))})}return r},"createCssStyles"),ZP=w((e,t,r,n)=>{const s=KP(e,r),o=yE(t,s,e.themeVariables);return np(fF(`${n}{${o}}`),gF)},"createUserStyles"),JP=w((e="",t,r)=>{let n=e;return!r&&!t&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=_s(n),n=n.replace(/<br>/g,"<br/>"),n},"cleanUpSvgCode"),tD=w((e="",t)=>{var s,o;const r=(o=(s=t==null?void 0:t.viewBox)==null?void 0:s.baseVal)!=null&&o.height?t.viewBox.baseVal.height+"px":qP,n=UC(`<body style="${GP}">${e}</body>`);return`<iframe style="width:${HP};height:${r};${UP}" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="${VP}">
292
+ ${YP}
293
+ </iframe>`},"putIntoIFrame"),$x=w((e,t,r,n,s)=>{const o=e.append("div");o.attr("id",r),n&&o.attr("style",n);const c=o.append("svg").attr("id",t).attr("width","100%").attr("xmlns",jP);return s&&c.attr("xmlns:xlink",s),c.append("g"),e},"appendDivSvgG");function cp(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}w(cp,"sandboxedIframe");var eD=w((e,t,r,n)=>{var s,o,c;(s=e.getElementById(t))==null||s.remove(),(o=e.getElementById(r))==null||o.remove(),(c=e.getElementById(n))==null||c.remove()},"removeExistingElements"),rD=w(async function(e,t,r){var it,rt,H,q,N,Y;rh();const n=fg(t);t=n.code;const s=Xe();nt.debug(s),t.length>((s==null?void 0:s.maxTextSize)??PP)&&(t=DP);const o="#"+e,c="i"+e,l="#"+c,h="d"+e,d="#"+h,f=w(()=>{const K=Gt(m?l:d).node();K&&"remove"in K&&K.remove()},"removeTempElements");let g=Gt("body");const m=s.securityLevel===OP,y=s.securityLevel===zP,v=s.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),m){const P=cp(Gt(r),c);g=Gt(P.nodes()[0].contentDocument.body),g.node().style.margin=0}else g=Gt(r);$x(g,e,h,`font-family: ${v}`,NP)}else{if(eD(document,e,h,c),m){const P=cp(Gt("body"),c);g=Gt(P.nodes()[0].contentDocument.body),g.node().style.margin=0}else g=Gt("body");$x(g,e,h)}let b,k;try{b=await lp.fromText(t,{title:n.title})}catch(P){if(s.suppressErrorRendering)throw f(),P;b=await lp.fromText("error"),k=P}const T=g.select(d).node(),_=b.type,B=T.firstChild,L=B.firstChild,A=(rt=(it=b.renderer).getClasses)==null?void 0:rt.call(it,t,b),E=ZP(s,_,A,o),$=document.createElement("style");$.innerHTML=E,B.insertBefore($,L);try{await b.renderer.draw(t,e,h0.version,b)}catch(P){throw s.suppressErrorRendering?f():HI.draw(t,e,h0.version),P}const z=g.select(`${d} svg`),Z=(q=(H=b.db).getAccTitle)==null?void 0:q.call(H),W=(Y=(N=b.db).getAccDescription)==null?void 0:Y.call(N);XC(_,z,Z,W),g.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",WP);let G=g.select(d).node().innerHTML;if(nt.debug("config.arrowMarkerAbsolute",s.arrowMarkerAbsolute),G=JP(G,m,Le(s.arrowMarkerAbsolute)),m){const P=g.select(d+" svg").node();G=tD(G,P)}else y||(G=$i.sanitize(G,{ADD_TAGS:XP,ADD_ATTR:QP,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(AP(),k)throw k;return f(),{diagramType:_,svg:G,bindFunctions:b.db.bindFunctions}},"render");function VC(e={}){var n;const t=Te({},e);t!=null&&t.fontFamily&&!((n=t.themeVariables)!=null&&n.fontFamily)&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),XT(t),t!=null&&t.theme&&t.theme in ei?t.themeVariables=ei[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=ei.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?YT(t):o1();Sp(r.logLevel),rh()}w(VC,"initialize");var YC=w((e,t={})=>{const{code:r}=dg(e);return lp.fromText(r,t)},"getDiagramFromText");function XC(e,t,r,n){WC(t,e),HC(t,r,n,t.attr("id"))}w(XC,"addA11yInfo");var bs=Object.freeze({render:rD,parse:GC,getDiagramFromText:YC,initialize:VC,getConfig:Xe,setConfig:l1,getSiteConfig:o1,updateSiteConfig:QT,reset:w(()=>{Zc()},"reset"),globalReset:w(()=>{Zc(fa)},"globalReset"),defaultConfig:fa});Sp(Xe().logLevel);Zc(Xe());var nD=w((e,t,r)=>{nt.warn(e),ng(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),QC=w(async function(e={querySelector:".mermaid"}){try{await iD(e)}catch(t){if(ng(t)&&nt.error(t.str),Ir.parseError&&Ir.parseError(t),!e.suppressErrors)throw nt.error("Use the suppressErrors option to suppress these errors"),t}},"run"),iD=w(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const n=bs.getConfig();nt.debug(`${e?"":"No "}Callback function found`);let s;if(r)s=r;else if(t)s=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");nt.debug(`Found ${s.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(nt.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),bs.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const o=new bn.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let c;const l=[];for(const h of Array.from(s)){if(nt.info("Rendering diagram: "+h.id),h.getAttribute("data-processed"))continue;h.setAttribute("data-processed","true");const d=`mermaid-${o.next()}`;c=h.innerHTML,c=y2(bn.entityDecode(c)).trim().replace(/<br\s*\/?>/gi,"<br/>");const f=bn.detectInit(c);f&&nt.debug("Detected early reinit: ",f);try{const{svg:g,bindFunctions:m}=await tw(d,c,h);h.innerHTML=g,e&&await e(d),m&&m(h)}catch(g){nD(g,l,Ir.parseError)}}if(l.length>0)throw l[0]},"runThrowsErrors"),KC=w(function(e){bs.initialize(e)},"initialize"),sD=w(async function(e,t,r){nt.warn("mermaid.init is deprecated. Please use run instead."),e&&KC(e);const n={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?n.querySelector=t:t&&(t instanceof HTMLElement?n.nodes=[t]:n.nodes=t),await QC(n)},"init"),aD=w(async(e,{lazyLoad:t=!0}={})=>{rh(),yf(...e),t===!1&&await MP()},"registerExternalDiagrams"),ZC=w(function(){if(Ir.startOnLoad){const{startOnLoad:e}=bs.getConfig();e&&Ir.run().catch(t=>nt.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",ZC,!1);var oD=w(function(e){Ir.parseError=e},"setParseErrorHandler"),Lu=[],cf=!1,JC=w(async()=>{if(!cf){for(cf=!0;Lu.length>0;){const e=Lu.shift();if(e)try{await e()}catch(t){nt.error("Error executing queue",t)}}cf=!1}},"executeQueue"),lD=w(async(e,t)=>new Promise((r,n)=>{const s=w(()=>new Promise((o,c)=>{bs.parse(e,t).then(l=>{o(l),r(l)},l=>{var h;nt.error("Error parsing",l),(h=Ir.parseError)==null||h.call(Ir,l),c(l),n(l)})}),"performCall");Lu.push(s),JC().catch(n)}),"parse"),tw=w((e,t,r)=>new Promise((n,s)=>{const o=w(()=>new Promise((c,l)=>{bs.render(e,t,r).then(h=>{c(h),n(h)},h=>{var d;nt.error("Error parsing",h),(d=Ir.parseError)==null||d.call(Ir,h),l(h),s(h)})}),"performCall");Lu.push(o),JC().catch(s)}),"render"),cD=w(()=>Object.keys(gs).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Ir={startOnLoad:!0,mermaidAPI:bs,parse:lD,render:tw,init:sD,run:QC,registerExternalDiagrams:aD,registerLayoutLoaders:oC,initialize:KC,parseError:void 0,contentLoaded:ZC,setParseErrorHandler:oD,detectType:Cp,registerIconPacks:$5,getRegisteredDiagramsMetadata:cD},Rx=Ir;/*! Check if previously processed *//*!
294
+ * Wait for document loaded before starting the execution
295
+ */let uD=0;function hD({data:e}){const{theme:t}=lr(),r=F.useMemo(()=>dD(t),[t]),n=F.useRef(null),[s,o]=F.useState(0),[c,l]=F.useState(!1),[h,d]=F.useState(null),f=(e==null?void 0:e.format)||"mermaid",g=(e==null?void 0:e.content)||"",m=(e==null?void 0:e.steps)||[],y=(e==null?void 0:e.animate)&&m.length>0,v=(e==null?void 0:e.module)||null,b=(e==null?void 0:e.step)||null;F.useEffect(()=>{Rx.initialize({startOnLoad:!1,theme:"dark",themeVariables:{darkMode:t.id==="dark",background:t.bgSecondary,primaryColor:t.bgTertiary,primaryTextColor:t.textPrimary,primaryBorderColor:t.border,lineColor:t.accent,secondaryColor:t.bgTertiary,tertiaryColor:t.bgSecondary,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',fontSize:"14px",nodeBorder:t.accent,mainBkg:t.bgTertiary,nodeTextColor:t.textPrimary,edgeLabelBackground:t.bgSecondary},flowchart:{htmlLabels:!0,curve:"basis"}})},[t]),F.useEffect(()=>{!g&&m.length===0||(d(null),o(0),y?B():k(g,f))},[g,f,m.length]);async function k(A,E){const $=n.current;if($)try{E==="mermaid"?await T($,A):E==="svg"?_($,A):E==="d3"?$.innerHTML=`
296
+ <div style="text-align:center; padding:40px; color:${t.textSecondary};">
297
+ <p>D3 visualization support coming soon</p>
298
+ </div>
299
+ `:d(`Unsupported diagram format: ${E}`)}catch(z){console.error("[Canvas] Render error:",z),d(z.message||"Failed to render diagram")}}async function T(A,E){A.innerHTML="";const $=`mermaid-${++uD}`;try{const{svg:z}=await Rx.render($,E);A.innerHTML=`<div class="mermaid-output" style="display:flex;justify-content:center;align-items:center;min-height:200px;">${z}</div>`}catch(z){const Z=document.getElementById($);throw Z&&Z.remove(),z}}function _(A,E){A.innerHTML=`<div style="display:flex;justify-content:center;align-items:center;min-height:200px;">${E}</div>`}async function B(){l(!0);for(let A=0;A<m.length;A++){o(A);const E=m[A],$=E.content||E,z=E.format||f;if(await k($,z),A<m.length-1){const Z=E.delay||1500;await new Promise(W=>setTimeout(W,Z))}}l(!1)}function L(A){if(c||A<0||A>=m.length)return;o(A);const E=m[A],$=E.content||E,z=E.format||f;k($,z)}return e?C.jsxs("div",{style:r.container,children:[(v||b)&&C.jsxs("div",{style:r.breadcrumb,children:[v&&C.jsx("span",{style:r.breadcrumbModule,children:v}),v&&b&&C.jsx("span",{style:r.breadcrumbSep,children:"/"}),b&&C.jsx("span",{style:r.breadcrumbStep,children:b})]}),C.jsx("div",{style:r.diagramWrapper,children:h?C.jsxs("div",{style:r.errorBox,children:[C.jsx("p",{style:r.errorTitle,children:"Render Error"}),C.jsx("pre",{style:r.errorMessage,children:h}),C.jsx("p",{style:r.errorHint,children:"The diagram syntax may be invalid."})]}):C.jsx("div",{ref:n,style:r.diagram})}),m.length>0&&C.jsxs("div",{style:r.stepControls,children:[C.jsxs("button",{onClick:()=>L(s-1),disabled:s===0||c,style:{...r.stepButton,opacity:s===0||c?.4:1},children:["◀"," Prev"]}),C.jsx("div",{style:r.stepIndicators,children:m.map((A,E)=>C.jsx("button",{onClick:()=>L(E),disabled:c,style:{...r.stepDot,backgroundColor:E===s?t.accent:t.border}},E))}),C.jsx("span",{style:r.stepLabel,children:c?"Animating...":`Step ${s+1} of ${m.length}`}),C.jsxs("button",{onClick:()=>L(s+1),disabled:s>=m.length-1||c,style:{...r.stepButton,opacity:s>=m.length-1||c?.4:1},children:["Next ","▶"]})]}),(e==null?void 0:e.awaitingAnswer)&&C.jsxs("div",{style:r.answerPrompt,children:[C.jsx("span",{style:r.promptIcon,children:"💬"}),C.jsx("span",{children:"Answer in the terminal"})]})]}):C.jsxs("div",{style:r.empty,children:[C.jsx("div",{style:r.emptyIcon,children:"🎨"}),C.jsx("p",{style:r.emptyTitle,children:"Canvas Ready"}),C.jsx("p",{style:r.emptySubtext,children:"Diagrams and visualizations will appear here during lessons."})]})}function dD(e){return{container:{display:"flex",flexDirection:"column",gap:16,maxWidth:1e3,margin:"0 auto"},breadcrumb:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:e.textSecondary},breadcrumbModule:{color:e.accent,fontWeight:500},breadcrumbSep:{color:e.textMuted},breadcrumbStep:{color:e.textPrimary},diagramWrapper:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,padding:24,minHeight:300,display:"flex",alignItems:"center",justifyContent:"center",overflow:"auto"},diagram:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center"},stepControls:{display:"flex",alignItems:"center",justifyContent:"center",gap:16,padding:"12px 0"},stepButton:{padding:"6px 14px",fontSize:13,fontWeight:500,color:e.textPrimary,backgroundColor:e.bgTertiary,border:`1px solid ${e.border}`,borderRadius:6,cursor:"pointer",transition:"opacity 0.15s ease"},stepIndicators:{display:"flex",gap:6},stepDot:{width:10,height:10,borderRadius:"50%",border:"none",cursor:"pointer",transition:"background-color 0.2s ease"},stepLabel:{fontSize:12,color:e.textSecondary,minWidth:100,textAlign:"center"},answerPrompt:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"14px 20px",backgroundColor:e.bgTertiary,border:`1px solid ${e.border}`,borderRadius:10,fontSize:14,color:e.textPrimary,animation:"pulse 2s infinite"},promptIcon:{fontSize:18},errorBox:{textAlign:"center",padding:24,color:e.error},errorTitle:{fontSize:16,fontWeight:600,margin:"0 0 8px"},errorMessage:{fontSize:13,fontFamily:"monospace",backgroundColor:e.bgTertiary,padding:"8px 12px",borderRadius:6,margin:"0 0 8px",whiteSpace:"pre-wrap",textAlign:"left",color:e.error},errorHint:{fontSize:13,color:e.textSecondary,margin:0},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0}}}function fD({data:e,sendEvent:t}){const{theme:r}=lr(),n=F.useMemo(()=>xD(r),[r]);if(!e)return C.jsxs("div",{style:n.empty,children:[C.jsx("div",{style:n.emptyIcon,children:"🧠"}),C.jsx("p",{style:n.emptyTitle,children:"Quiz Mode"}),C.jsx("p",{style:n.emptySubtext,children:"Interactive quizzes will appear here during lessons."})]});const{quizType:s,question:o,items:c,timeLimit:l,options:h,pairs:d,code:f,blanks:g}=e;switch(s){case"drag-order":return C.jsx(pD,{question:o,items:c||[],sendEvent:t,theme:r,s:n});case"timed-choice":return C.jsx(gD,{question:o,options:h||c||[],timeLimit:l||30,sendEvent:t,theme:r,s:n});case"matching":return C.jsx(mD,{question:o,pairs:d||c||[],sendEvent:t,theme:r,s:n});case"fill-blank":return C.jsx(yD,{question:o,code:f||"",blanks:g||[],sendEvent:t,theme:r,s:n});default:return C.jsx("div",{style:n.errorBox,children:C.jsxs("p",{children:["Unknown quiz type: ",s]})})}}function pD({question:e,items:t,sendEvent:r,theme:n,s}){const[o,c]=F.useState(t),[l,h]=F.useState(null),[d,f]=F.useState(null),[g,m]=F.useState(!1),[y,v]=F.useState(null);F.useEffect(()=>{c(t),m(!1),v(null)},[t]);function b(L,A){h(A),L.dataTransfer.effectAllowed="move",L.dataTransfer.setData("text/plain",A.toString()),L.target&&(L.target.style.opacity="0.5")}function k(L){L.target&&(L.target.style.opacity="1"),h(null),f(null)}function T(L,A){L.preventDefault(),L.dataTransfer.dropEffect="move",A!==d&&f(A)}function _(L,A){L.preventDefault();const E=l;if(E===null||E===A)return;const $=[...o],[z]=$.splice(E,1);$.splice(A,0,z),c($),h(null),f(null)}function B(){m(!0);const L=o.map(A=>typeof A=="string"?A:A.id||A.label);r("event:quiz-answer",{quizType:"drag-order",answer:L}),v("pending")}return C.jsxs("div",{style:s.quizContainer,children:[C.jsx("h2",{style:s.question,children:e}),C.jsx("p",{style:s.hint,children:"Drag items to reorder them"}),C.jsx("div",{style:s.dragList,children:o.map((L,A)=>{const E=typeof L=="string"?L:L.label||L.text||L.id,$=d===A,z=l===A;return C.jsxs("div",{draggable:!g,onDragStart:Z=>b(Z,A),onDragEnd:k,onDragOver:Z=>T(Z,A),onDrop:Z=>_(Z,A),style:{...s.dragItem,borderColor:$?n.accent:n.border,backgroundColor:z?n.bgTertiary:n.bgSecondary,transform:$?"scale(1.01)":"scale(1)",opacity:g?.7:1,cursor:g?"default":"grab"},children:[C.jsx("span",{style:s.dragHandle,children:"☰"}),C.jsx("span",{style:s.dragIndex,children:A+1}),C.jsx("span",{style:s.dragLabel,children:E})]},`${E}-${A}`)})}),!g&&C.jsx("button",{onClick:B,style:s.submitButton,children:"Submit Order"}),g&&y==="pending"&&C.jsx("div",{style:s.pendingResult,children:"Checking your answer..."})]})}function gD({question:e,options:t,timeLimit:r,sendEvent:n,theme:s,s:o}){const[c,l]=F.useState(null),[h,d]=F.useState(!1),[f,g]=F.useState(r),[m,y]=F.useState(null),v=F.useRef(null);F.useEffect(()=>(l(null),d(!1),g(r),y(null),v.current=setInterval(()=>{g(_=>_<=1?(clearInterval(v.current),0):_-1)},1e3),()=>{v.current&&clearInterval(v.current)}),[e,r]),F.useEffect(()=>{f===0&&!h&&b(null)},[f,h]);function b(_){if(h)return;d(!0),l(_),v.current&&clearInterval(v.current);const B=_!==null?typeof _=="string"?_:_.id||_.label||_:null;n("event:quiz-answer",{quizType:"timed-choice",answer:B,timeMs:(r-f)*1e3})}const k=f/r*100,T=f>r*.5?s.success:f>r*.2?s.warning:s.error;return C.jsxs("div",{style:o.quizContainer,children:[C.jsx("div",{style:o.timerBar,children:C.jsx("div",{style:{...o.timerFill,width:`${k}%`,backgroundColor:T}})}),C.jsx("div",{style:o.timerLabel,children:C.jsxs("span",{children:["⏱"," ",f,"s"]})}),C.jsx("h2",{style:o.question,children:e}),C.jsx("div",{style:o.choiceGrid,children:t.map((_,B)=>{const L=typeof _=="string"?_:_.label||_.text,A=typeof _=="string"?_:_.id||_.label,E=c!==null&&(typeof c=="string"?c:c.id||c.label)===A;return C.jsxs("button",{onClick:()=>!h&&b(_),disabled:h,style:{...o.choiceButton,borderColor:E?s.accent:s.border,backgroundColor:E?`${s.accent}18`:s.bgSecondary,cursor:h?"default":"pointer",opacity:h&&!E?.5:1},children:[C.jsx("span",{style:o.choiceLetter,children:String.fromCharCode(65+B)}),C.jsx("span",{style:o.choiceText,children:L})]},`${A}-${B}`)})}),h&&C.jsx("div",{style:o.pendingResult,children:f===0&&c===null?"Time's up! No answer submitted.":"Checking your answer..."})]})}function mD({question:e,pairs:t,sendEvent:r,theme:n,s}){const[o]=F.useState(()=>t.map(_=>_.left||_.a||_.term)),[c]=F.useState(()=>[...t.map(B=>B.right||B.b||B.definition)].sort(()=>Math.random()-.5)),[l,h]=F.useState({}),[d,f]=F.useState(null),[g,m]=F.useState(!1);F.useEffect(()=>{h({}),f(null),m(!1)},[e]);function y(_){g||f(d===_?null:_)}function v(_){if(g||!d)return;const B={...l};delete B[d];for(const[L,A]of Object.entries(B))A===_&&delete B[L];B[d]=_,h(B),f(null)}function b(){m(!0),r("event:quiz-answer",{quizType:"matching",answer:l})}const k=Object.keys(l).length===o.length,T=new Set(Object.values(l));return C.jsxs("div",{style:s.quizContainer,children:[C.jsx("h2",{style:s.question,children:e}),C.jsx("p",{style:s.hint,children:"Click a left item, then click its match on the right"}),C.jsxs("div",{style:s.matchingContainer,children:[C.jsx("div",{style:s.matchingColumn,children:o.map((_,B)=>{const L=d===_,A=_ in l;return C.jsxs("button",{onClick:()=>y(_),disabled:g,style:{...s.matchItem,borderColor:L?n.accent:A?n.success:n.border,backgroundColor:L?`${n.accent}18`:A?`${n.success}10`:n.bgSecondary,cursor:g?"default":"pointer"},children:[_,A&&C.jsx("span",{style:s.matchCheck,children:"✔"})]},`left-${B}`)})}),C.jsx("div",{style:s.matchingArrows,children:o.map((_,B)=>C.jsx("div",{style:s.arrowRow,children:l[_]?C.jsx("span",{style:s.arrowConnected,children:"──▶"}):C.jsx("span",{style:s.arrowEmpty,children:"···"})},B))}),C.jsx("div",{style:s.matchingColumn,children:c.map((_,B)=>{const L=T.has(_);return C.jsx("button",{onClick:()=>v(_),disabled:g||!d,style:{...s.matchItem,borderColor:L?n.success:n.border,backgroundColor:L?`${n.success}10`:n.bgSecondary,cursor:g||!d?"default":"pointer",opacity:g&&!L?.5:1},children:_},`right-${B}`)})})]}),!g&&C.jsx("button",{onClick:b,disabled:!k,style:{...s.submitButton,opacity:k?1:.5,cursor:k?"pointer":"not-allowed"},children:"Submit Matches"}),g&&C.jsx("div",{style:s.pendingResult,children:"Checking your matches..."})]})}function yD({question:e,code:t,blanks:r,sendEvent:n,theme:s,s:o}){const[c,l]=F.useState(()=>r.map(()=>"")),[h,d]=F.useState(!1);F.useEffect(()=>{l(r.map(()=>"")),d(!1)},[e,t]);function f(v,b){if(h)return;const k=[...c];k[v]=b,l(k)}function g(){d(!0),n("event:quiz-answer",{quizType:"fill-blank",answer:c})}function m(){return t.split(/(___\d+___)/g).map((b,k)=>{var _,B;const T=b.match(/___(\d+)___/);if(T){const L=parseInt(T[1],10),A=r[L]||{};return C.jsx("input",{type:"text",value:c[L]||"",onChange:E=>f(L,E.target.value),disabled:h,placeholder:A.placeholder||"...",style:{...o.blankInput,width:Math.max(80,(((_=c[L])==null?void 0:_.length)||((B=A.placeholder)==null?void 0:B.length)||3)*9+20)}},`blank-${k}`)}return C.jsx("span",{children:b},`code-${k}`)})}const y=c.every(v=>v.trim().length>0);return C.jsxs("div",{style:o.quizContainer,children:[C.jsx("h2",{style:o.question,children:e}),C.jsx("pre",{style:o.codeBlock,children:C.jsx("code",{children:m()})}),!h&&C.jsx("button",{onClick:g,disabled:!y,style:{...o.submitButton,opacity:y?1:.5,cursor:y?"pointer":"not-allowed"},children:"Submit Answer"}),h&&C.jsx("div",{style:o.pendingResult,children:"Checking your answer..."})]})}function xD(e){return{quizContainer:{maxWidth:700,margin:"0 auto",display:"flex",flexDirection:"column",gap:20},question:{fontSize:22,fontWeight:700,color:e.textBright,margin:0,lineHeight:1.4},hint:{fontSize:13,color:e.textSecondary,margin:0},submitButton:{alignSelf:"center",padding:"10px 28px",fontSize:14,fontWeight:600,color:"#ffffff",backgroundColor:e.success,border:`1px solid ${e.success}`,borderRadius:8,cursor:"pointer",transition:"background-color 0.15s ease"},pendingResult:{textAlign:"center",padding:"12px 20px",backgroundColor:e.bgTertiary,borderRadius:8,fontSize:14,color:e.textSecondary},errorBox:{textAlign:"center",padding:40,color:e.error,fontSize:16},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0},dragList:{display:"flex",flexDirection:"column",gap:8},dragItem:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid",borderRadius:8,transition:"border-color 0.15s ease, transform 0.1s ease, background-color 0.15s ease",userSelect:"none"},dragHandle:{fontSize:16,color:e.textMuted,cursor:"grab"},dragIndex:{width:24,height:24,borderRadius:"50%",backgroundColor:e.bgTertiary,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,color:e.textSecondary,flexShrink:0},dragLabel:{fontSize:14,color:e.textPrimary},timerBar:{height:4,backgroundColor:e.bgTertiary,borderRadius:2,overflow:"hidden"},timerFill:{height:"100%",borderRadius:2,transition:"width 1s linear, background-color 0.3s ease"},timerLabel:{textAlign:"right",fontSize:13,color:e.textSecondary},choiceGrid:{display:"flex",flexDirection:"column",gap:10},choiceButton:{display:"flex",alignItems:"center",gap:14,padding:"14px 18px",border:"1px solid",borderRadius:10,textAlign:"left",transition:"border-color 0.15s ease, background-color 0.15s ease",width:"100%",fontSize:14,color:e.textPrimary,fontFamily:"inherit"},choiceLetter:{width:28,height:28,borderRadius:"50%",backgroundColor:e.bgTertiary,display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,color:e.textSecondary,flexShrink:0},choiceText:{flex:1},matchingContainer:{display:"flex",gap:16,alignItems:"flex-start"},matchingColumn:{flex:1,display:"flex",flexDirection:"column",gap:8},matchingArrows:{display:"flex",flexDirection:"column",gap:8,justifyContent:"flex-start",paddingTop:0},arrowRow:{height:46,display:"flex",alignItems:"center",justifyContent:"center"},arrowConnected:{color:e.success,fontFamily:"monospace",fontSize:14},arrowEmpty:{color:e.border,fontFamily:"monospace",fontSize:14},matchItem:{padding:"10px 16px",border:"1px solid",borderRadius:8,fontSize:14,color:e.textPrimary,backgroundColor:e.bgSecondary,fontFamily:"inherit",width:"100%",textAlign:"left",transition:"border-color 0.15s ease, background-color 0.15s ease",display:"flex",alignItems:"center",justifyContent:"space-between"},matchCheck:{color:e.success,marginLeft:8},codeBlock:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10,padding:"20px 24px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:14,lineHeight:1.7,color:e.textPrimary,overflow:"auto",whiteSpace:"pre-wrap"},blankInput:{display:"inline-block",padding:"2px 8px",fontSize:14,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',color:e.accent,backgroundColor:e.bgPrimary,border:`1px solid ${e.accent}`,borderRadius:4,outline:"none",verticalAlign:"baseline"}}}const vD=F.lazy(()=>Zt(()=>import("./index-BQFKo-II.js"),[]));function bD({data:e,sendEvent:t}){const{theme:r}=lr(),n=F.useMemo(()=>CD(r),[r]),[s,o]=F.useState(""),[c,l]=F.useState(""),[h,d]=F.useState(""),[f,g]=F.useState(!1),[m,y]=F.useState("javascript");F.useEffect(()=>{if(!e)return;const B=e.starter||"";l(B),o(B),d(""),y(e.language||"javascript"),g(!1)},[e]);const v=F.useCallback(()=>{f||(g(!0),d("Running..."),t("event:code-run",{code:s,language:m}),setTimeout(()=>{g(!1),d(B=>B==="Running..."?"Waiting for execution result from server...":B)},5e3))},[s,m,f,t]),b=F.useCallback(()=>{o(c),d("")},[c]),k=F.useCallback(()=>{t("event:click",{element:"hint",data:{language:m,code:s}})},[m,s,t]),T={bash:"shell",sh:"shell",javascript:"javascript",js:"javascript",python:"python",py:"python",typescript:"typescript",ts:"typescript"}[m]||m,_=r.id==="light"?"light":"vs-dark";return e?C.jsxs("div",{style:n.container,children:[C.jsxs("div",{style:n.header,children:[C.jsxs("div",{style:n.headerLeft,children:[C.jsx("span",{style:n.langBadge,children:m}),e.instructions&&C.jsx("span",{style:n.instructions,children:e.instructions})]}),C.jsxs("div",{style:n.headerRight,children:[C.jsxs("button",{onClick:k,style:n.hintButton,children:["💡"," Hint"]}),C.jsxs("button",{onClick:b,style:n.resetButton,children:["↺"," Reset"]}),C.jsx("button",{onClick:v,disabled:f,style:{...n.runButton,opacity:f?.7:1},children:f?"⏳ Running...":"▶ Run"})]})]}),C.jsx("div",{style:n.editorContainer,children:C.jsx(F.Suspense,{fallback:C.jsx(SD,{code:s,onChange:o,theme:r,s:n}),children:C.jsx(vD,{height:"350px",language:T,value:s,onChange:B=>o(B||""),theme:_,options:{minimap:{enabled:!1},fontSize:14,lineNumbers:"on",scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",padding:{top:12},renderLineHighlight:"none",overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8}}})})}),C.jsxs("div",{style:n.outputContainer,children:[C.jsxs("div",{style:n.outputHeader,children:[C.jsx("span",{style:n.outputTitle,children:"Output"}),h&&C.jsx("button",{onClick:()=>d(""),style:n.clearButton,children:"Clear"})]}),C.jsx("pre",{style:n.outputContent,children:h||"Run your code to see output here."})]})]}):C.jsxs("div",{style:n.empty,children:[C.jsx("div",{style:n.emptyIcon,children:"💻"}),C.jsx("p",{style:n.emptyTitle,children:"Code Playground"}),C.jsx("p",{style:n.emptySubtext,children:"Interactive code exercises will appear here during lessons."})]})}function SD({code:e,onChange:t,theme:r,s:n}){return C.jsxs("div",{style:n.fallbackContainer,children:[C.jsx("div",{style:n.fallbackLoading,children:"Loading editor..."}),C.jsx("textarea",{value:e,onChange:s=>t(s.target.value),style:n.fallbackTextarea,spellCheck:!1})]})}function CD(e){return{container:{display:"flex",flexDirection:"column",gap:0,maxWidth:900,margin:"0 auto",border:`1px solid ${e.border}`,borderRadius:12,overflow:"hidden"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.border}`,flexWrap:"wrap",gap:8},headerLeft:{display:"flex",alignItems:"center",gap:12},langBadge:{fontSize:12,fontWeight:600,color:e.textPrimary,backgroundColor:e.bgTertiary,padding:"3px 10px",borderRadius:12,textTransform:"uppercase",letterSpacing:"0.05em"},instructions:{fontSize:13,color:e.textSecondary},headerRight:{display:"flex",alignItems:"center",gap:8},hintButton:{padding:"5px 12px",fontSize:13,color:e.warning,backgroundColor:"transparent",border:`1px solid ${e.warning}40`,borderRadius:6,cursor:"pointer",transition:"background-color 0.15s ease"},resetButton:{padding:"5px 12px",fontSize:13,color:e.textSecondary,backgroundColor:"transparent",border:`1px solid ${e.border}`,borderRadius:6,cursor:"pointer",transition:"background-color 0.15s ease"},runButton:{padding:"5px 16px",fontSize:13,fontWeight:600,color:"#ffffff",backgroundColor:e.success,border:`1px solid ${e.success}`,borderRadius:6,cursor:"pointer",transition:"opacity 0.15s ease"},editorContainer:{backgroundColor:e.id==="light"?"#ffffff":"#1e1e1e",minHeight:350},outputContainer:{backgroundColor:e.bgPrimary,borderTop:`1px solid ${e.border}`},outputHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderBottom:`1px solid ${e.bgTertiary}`},outputTitle:{fontSize:12,fontWeight:600,color:e.textSecondary,textTransform:"uppercase",letterSpacing:"0.05em"},clearButton:{fontSize:11,color:e.textMuted,backgroundColor:"transparent",border:"none",cursor:"pointer"},outputContent:{padding:"12px 16px",margin:0,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:13,lineHeight:1.6,color:e.textSecondary,minHeight:80,maxHeight:200,overflow:"auto",whiteSpace:"pre-wrap"},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0},fallbackContainer:{position:"relative",height:350},fallbackLoading:{position:"absolute",top:12,right:16,fontSize:12,color:e.textMuted,zIndex:1},fallbackTextarea:{width:"100%",height:"100%",padding:"12px 16px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:14,lineHeight:1.6,color:e.textPrimary,backgroundColor:e.id==="light"?"#ffffff":"#1e1e1e",border:"none",outline:"none",resize:"none"}}}const wD="http://localhost:3456";function kD({data:e,sendEvent:t}){const{theme:r}=lr(),n=F.useMemo(()=>TD(r),[r]),[s,o]=F.useState([]),[c,l]=F.useState("~"),[h,d]=F.useState(""),[f,g]=F.useState(!1),[m,y]=F.useState(null),[v,b]=F.useState([]),[k,T]=F.useState(-1),_=F.useRef(null),B=F.useRef(null);F.useEffect(()=>{e&&(e.cwd&&l(e.cwd),e.resetHistory&&(o([]),y(null),b([]),T(-1)))},[e]),F.useEffect(()=>{_.current&&typeof _.current.scrollIntoView=="function"&&_.current.scrollIntoView({behavior:"smooth"})},[s]),F.useEffect(()=>{var W;f||(W=B.current)==null||W.focus()},[f,e]);const L=F.useCallback(async W=>{if(W.trim()){g(!0),o(G=>[...G,{type:"command",cwd:c,text:W}]),b(G=>[...G,W]),T(-1);try{const it=await(await fetch(`${wD}/api/terminal/exec`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:W,sessionId:m,cwd:e==null?void 0:e.cwd})})).json();!m&&it.sessionId&&y(it.sessionId),it.cwd&&l(it.cwd),it.output&&o(rt=>[...rt,{type:"output",text:it.output,exitCode:it.exitCode}])}catch{o(it=>[...it,{type:"output",text:"Error: Could not connect to bridge server. Is it running?",exitCode:1}])}finally{g(!1)}}},[c,m,e==null?void 0:e.cwd]),A=F.useCallback(W=>{if(W.key==="Enter"&&!f){W.preventDefault();const G=h.trim();G&&(L(G),d(""))}else if(W.key==="ArrowUp"){if(W.preventDefault(),v.length===0)return;const G=k===-1?v.length-1:Math.max(0,k-1);T(G),d(v[G])}else if(W.key==="ArrowDown"){if(W.preventDefault(),k===-1)return;const G=k+1;G>=v.length?(T(-1),d("")):(T(G),d(v[G]))}else W.key==="l"&&W.ctrlKey&&(W.preventDefault(),o([]))},[h,f,L,v,k]),E=Fx(c);if(!e)return C.jsxs("div",{style:n.empty,children:[C.jsx("div",{style:n.emptyIcon,children:">_"}),C.jsx("p",{style:n.emptyTitle,children:"Practice Terminal"}),C.jsx("p",{style:n.emptySubtext,children:"A hands-on terminal will appear here during lessons."})]});const $=e.validations||[],z=$.filter(W=>W.passed).length,Z=$.length>0&&z===$.length;return C.jsxs("div",{style:n.container,children:[C.jsxs("div",{style:n.taskPanel,children:[C.jsxs("div",{style:n.taskHeader,children:[C.jsx("span",{style:n.taskLabel,children:"Task"}),e.module&&C.jsx("span",{style:n.moduleBadge,children:e.module}),$.length>0&&C.jsxs("span",{style:{...n.progressBadge,color:Z?r.success:r.warning},children:[z,"/",$.length]})]}),C.jsx("p",{style:n.taskText,children:e.task}),$.length>0&&C.jsx("div",{style:n.validations,children:$.map((W,G)=>C.jsxs("div",{style:n.validationRow,children:[C.jsx("span",{style:{...n.validationCheck,color:W.passed?r.success:r.textMuted},children:W.passed?"✓":"○"}),C.jsx("span",{style:{...n.validationLabel,color:W.passed?r.textSecondary:r.textPrimary,textDecoration:W.passed?"line-through":"none"},children:W.label})]},G))}),e.feedback&&C.jsxs("div",{style:n.feedbackBox,children:[C.jsx("span",{style:n.feedbackIcon,children:Z?"✓":"→"}),C.jsx("span",{style:n.feedbackText,children:e.feedback})]}),e.hints&&e.hints.length>0&&C.jsx(_D,{hints:e.hints,theme:r,s:n})]}),C.jsxs("div",{style:n.terminalArea,onClick:()=>{var W;return(W=B.current)==null?void 0:W.focus()},children:[C.jsxs("div",{style:n.terminalHeader,children:[C.jsxs("div",{style:n.terminalDots,children:[C.jsx("span",{style:{...n.dot,backgroundColor:r.error}}),C.jsx("span",{style:{...n.dot,backgroundColor:r.warning}}),C.jsx("span",{style:{...n.dot,backgroundColor:r.success}})]}),C.jsx("span",{style:n.terminalTitle,children:E})]}),C.jsxs("div",{style:n.terminalBody,children:[s.map((W,G)=>C.jsx("div",{children:W.type==="command"?C.jsxs("div",{style:n.cmdLine,children:[C.jsxs("span",{style:n.prompt,children:[Fx(W.cwd)," $"]}),C.jsx("span",{style:n.cmdText,children:W.text})]}):C.jsx("pre",{style:{...n.outputText,color:W.exitCode!==0?r.error:r.textSecondary},children:W.text})},G)),C.jsxs("div",{style:n.cmdLine,children:[C.jsxs("span",{style:n.prompt,children:[E," $"]}),C.jsx("input",{ref:B,type:"text",value:h,onChange:W=>d(W.target.value),onKeyDown:A,disabled:f,style:n.cmdInput,spellCheck:!1,autoComplete:"off",placeholder:f?"Running...":"Type a command..."})]}),C.jsx("div",{ref:_})]})]})]})}function _D({hints:e,theme:t,s:r}){const[n,s]=F.useState(!1),[o,c]=F.useState(0);return C.jsx("div",{style:r.hintSection,children:n?C.jsxs("div",{children:[C.jsx("p",{style:r.hintText,children:e[o]}),C.jsx("div",{style:r.hintNav,children:o<e.length-1&&C.jsxs("button",{onClick:()=>c(l=>l+1),style:r.hintButton,children:["Next hint (",o+1,"/",e.length,")"]})})]}):C.jsx("button",{onClick:()=>s(!0),style:r.hintButton,children:"Show hint"})})}function Fx(e){if(!e)return"~";const t=e.replace(/^\/Users\/[^/]+/,"~").replace(/^\/home\/[^/]+/,"~"),r=t.split("/");return r.length<=3?t:r[0]+"/.../"+r.slice(-2).join("/")}function TD(e){return{container:{display:"flex",flexDirection:"column",gap:0,maxWidth:900,margin:"0 auto",border:`1px solid ${e.border}`,borderRadius:12,overflow:"hidden",height:"calc(100vh - 120px)"},taskPanel:{padding:"16px 20px",backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.border}`,flexShrink:0},taskHeader:{display:"flex",alignItems:"center",gap:10,marginBottom:8},taskLabel:{fontSize:11,fontWeight:700,color:e.accent,textTransform:"uppercase",letterSpacing:"0.08em"},moduleBadge:{fontSize:11,color:e.textSecondary,backgroundColor:e.bgTertiary,padding:"2px 8px",borderRadius:8},progressBadge:{fontSize:11,fontWeight:600,marginLeft:"auto"},taskText:{fontSize:14,lineHeight:1.6,color:e.textBright,margin:0},validations:{marginTop:12,display:"flex",flexDirection:"column",gap:4},validationRow:{display:"flex",alignItems:"center",gap:8},validationCheck:{fontSize:14,fontWeight:700,width:18,textAlign:"center"},validationLabel:{fontSize:13},feedbackBox:{marginTop:12,padding:"10px 14px",backgroundColor:e.bgPrimary,border:`1px solid ${e.border}`,borderRadius:8,display:"flex",alignItems:"flex-start",gap:10},feedbackIcon:{color:e.accent,fontSize:14,fontWeight:700,flexShrink:0,marginTop:1},feedbackText:{fontSize:13,lineHeight:1.5,color:e.textPrimary},hintSection:{marginTop:10},hintButton:{fontSize:12,color:e.warning,backgroundColor:"transparent",border:`1px solid ${e.warning}40`,borderRadius:6,padding:"4px 10px",cursor:"pointer"},hintText:{fontSize:13,color:e.warning,margin:"6px 0",lineHeight:1.5},hintNav:{display:"flex",gap:8},terminalArea:{flex:1,display:"flex",flexDirection:"column",backgroundColor:e.bgPrimary,overflow:"hidden",cursor:"text"},terminalHeader:{display:"flex",alignItems:"center",gap:10,padding:"8px 14px",backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.bgTertiary}`,flexShrink:0},terminalDots:{display:"flex",gap:6},dot:{width:10,height:10,borderRadius:"50%"},terminalTitle:{fontSize:12,color:e.textMuted,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace'},terminalBody:{flex:1,overflow:"auto",padding:"12px 14px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:13,lineHeight:1.6},cmdLine:{display:"flex",alignItems:"baseline",gap:8,minHeight:22},prompt:{color:e.success,fontWeight:600,whiteSpace:"nowrap",flexShrink:0},cmdText:{color:e.textBright},outputText:{margin:"2px 0 8px 0",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",whiteSpace:"pre-wrap",wordBreak:"break-word"},cmdInput:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",color:e.textBright,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:13,lineHeight:1.6,padding:0,caretColor:e.accent},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',color:e.success},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0}}}function ED({data:e,getBelt:t}){const{theme:r}=lr(),n=F.useMemo(()=>LD(r),[r]),[s,o]=F.useState(!1),[c,l]=F.useState([]),h=(e==null?void 0:e.type)||"xp",d=(e==null?void 0:e.xpAwarded)||0,f=(e==null?void 0:e.newBelt)||null;F.useMemo(()=>f&&t?t(f==="string"?0:99999):null,[f,t]);const g={white:{badge:"⬜",color:"#e6e6e6"},yellow:{badge:"🟨",color:"#f0c040"},green:{badge:"🟩",color:r.success},blue:{badge:"🟦",color:r.accent},purple:{badge:"🟪",color:r.purple},brown:{badge:"🟫",color:"#a0522d"},black:{badge:"⬛",color:r.textMuted}},m=f&&g[f.toLowerCase()]||null;return F.useEffect(()=>{o(!0);const y=[r.accent,r.success,r.warning,r.purple,r.error,r.orange,r.textBright],b=Array.from({length:h==="perfect-score"?80:h==="level-up"?60:40},(k,T)=>({id:T,x:Math.random()*100,delay:Math.random()*.8,duration:1.5+Math.random()*2,color:y[Math.floor(Math.random()*y.length)],size:4+Math.random()*8,shape:Math.random()>.5?"square":"circle",rotation:Math.random()*360,drift:(Math.random()-.5)*40}));l(b)},[h]),C.jsxs("div",{style:{...n.overlay,opacity:s?1:0},children:[C.jsx("div",{style:n.confettiContainer,children:c.map(y=>C.jsx("div",{style:{position:"absolute",left:`${y.x}%`,top:"-10px",width:y.size,height:y.shape==="circle"?y.size:y.size*1.5,backgroundColor:y.color,borderRadius:y.shape==="circle"?"50%":"2px",transform:`rotate(${y.rotation}deg)`,animation:`confettiFall ${y.duration}s ${y.delay}s ease-in forwards`,opacity:0}},y.id))}),C.jsxs("div",{style:n.content,children:[d>0&&C.jsxs("div",{style:n.xpAward,children:["+",d," XP"]},`xp-${d}`),h==="level-up"&&m&&C.jsxs("div",{style:n.levelUp,children:[C.jsx("div",{style:{...n.beltGlow,boxShadow:`0 0 40px ${m.color}60, 0 0 80px ${m.color}30`,borderColor:m.color},children:C.jsx("span",{style:n.beltEmoji,children:m.badge})}),C.jsxs("h2",{style:n.levelUpTitle,children:["You earned ",f.charAt(0).toUpperCase()+f.slice(1)," Belt!"]})]}),h==="perfect-score"&&C.jsxs("div",{style:n.perfectScore,children:[C.jsx("span",{style:n.perfectIcon,children:"⭐"}),C.jsx("h2",{style:n.perfectTitle,children:"Perfect Score!"})]}),h==="xp"&&!f&&C.jsx("div",{style:n.simpleXP,children:C.jsx("span",{style:n.checkIcon,children:"✅"})})]}),C.jsx("style",{children:`
300
+ @keyframes confettiFall {
301
+ 0% {
302
+ opacity: 1;
303
+ transform: translateY(0) rotate(0deg);
304
+ }
305
+ 100% {
306
+ opacity: 0;
307
+ transform: translateY(100vh) rotate(720deg);
308
+ }
309
+ }
310
+ @keyframes floatUp {
311
+ 0% {
312
+ opacity: 0;
313
+ transform: translateY(20px) scale(0.8);
314
+ }
315
+ 20% {
316
+ opacity: 1;
317
+ transform: translateY(0) scale(1.1);
318
+ }
319
+ 40% {
320
+ transform: translateY(-10px) scale(1);
321
+ }
322
+ 100% {
323
+ opacity: 0;
324
+ transform: translateY(-60px) scale(0.9);
325
+ }
326
+ }
327
+ @keyframes pulseGlow {
328
+ 0%, 100% {
329
+ transform: scale(1);
330
+ }
331
+ 50% {
332
+ transform: scale(1.1);
333
+ }
334
+ }
335
+ @keyframes bounceIn {
336
+ 0% {
337
+ opacity: 0;
338
+ transform: scale(0.3);
339
+ }
340
+ 50% {
341
+ opacity: 1;
342
+ transform: scale(1.05);
343
+ }
344
+ 70% {
345
+ transform: scale(0.95);
346
+ }
347
+ 100% {
348
+ transform: scale(1);
349
+ }
350
+ }
351
+ `})]})}function LD(e){return{overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:`${e.bgPrimary}bf`,display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,transition:"opacity 0.3s ease",pointerEvents:"none"},confettiContainer:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",pointerEvents:"none"},content:{display:"flex",flexDirection:"column",alignItems:"center",gap:20,zIndex:1},xpAward:{fontSize:48,fontWeight:800,color:e.success,textShadow:`0 0 20px ${e.success}60`,animation:"floatUp 2.5s ease-out forwards"},levelUp:{display:"flex",flexDirection:"column",alignItems:"center",gap:16,animation:"bounceIn 0.6s ease-out"},beltGlow:{width:100,height:100,borderRadius:"50%",border:"3px solid",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.bgTertiary,animation:"pulseGlow 1.5s ease-in-out infinite"},beltEmoji:{fontSize:48},levelUpTitle:{fontSize:28,fontWeight:800,color:e.textBright,margin:0,textAlign:"center"},perfectScore:{display:"flex",flexDirection:"column",alignItems:"center",gap:12,animation:"bounceIn 0.6s ease-out"},perfectIcon:{fontSize:64,animation:"pulseGlow 1s ease-in-out infinite"},perfectTitle:{fontSize:28,fontWeight:800,color:e.warning,margin:0,textShadow:`0 0 20px ${e.warning}60`},simpleXP:{animation:"bounceIn 0.5s ease-out"},checkIcon:{fontSize:64}}}function MD({data:e}){const{theme:t}=lr(),r=F.useMemo(()=>BD(t),[t]),n=F.useRef(null),[s,o]=F.useState(300),c=(e==null?void 0:e.html)||"",l=(e==null?void 0:e.title)||"",h=(e==null?void 0:e.module)||null,d=`<!DOCTYPE html>
352
+ <html>
353
+ <head>
354
+ <meta charset="utf-8">
355
+ <style>
356
+ *, *::before, *::after { box-sizing: border-box; }
357
+ body {
358
+ margin: 0;
359
+ padding: 16px;
360
+ background: ${t.bgPrimary};
361
+ color: ${t.textPrimary};
362
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
363
+ font-size: 14px;
364
+ line-height: 1.6;
365
+ overflow-x: hidden;
366
+ }
367
+ img {
368
+ max-width: 100%;
369
+ height: auto;
370
+ border-radius: 8px;
371
+ }
372
+ video, audio {
373
+ max-width: 100%;
374
+ border-radius: 8px;
375
+ }
376
+ iframe {
377
+ border: 0;
378
+ border-radius: 8px;
379
+ }
380
+ a {
381
+ color: ${t.accent};
382
+ text-decoration: none;
383
+ }
384
+ a:hover {
385
+ text-decoration: underline;
386
+ }
387
+ h1, h2, h3 {
388
+ color: ${t.textBright};
389
+ margin-top: 0;
390
+ }
391
+ p {
392
+ margin: 8px 0;
393
+ }
394
+ .card {
395
+ background: ${t.bgSecondary};
396
+ border: 1px solid ${t.border};
397
+ border-radius: 10px;
398
+ padding: 16px;
399
+ margin: 8px 0;
400
+ }
401
+ .caption {
402
+ color: ${t.textSecondary};
403
+ font-size: 13px;
404
+ margin-top: 8px;
405
+ text-align: center;
406
+ }
407
+ </style>
408
+ </head>
409
+ <body>
410
+ ${c}
411
+ <script>
412
+ // Send height to parent for auto-resize
413
+ function sendHeight() {
414
+ const h = document.documentElement.scrollHeight;
415
+ window.parent.postMessage({ type: 'iframe-resize', height: h }, '*');
416
+ }
417
+ // Observe size changes
418
+ const ro = new ResizeObserver(sendHeight);
419
+ ro.observe(document.body);
420
+ // Also send on load (for images/iframes)
421
+ window.addEventListener('load', sendHeight);
422
+ sendHeight();
423
+ <\/script>
424
+ </body>
425
+ </html>`;return F.useEffect(()=>{function f(g){var m;((m=g.data)==null?void 0:m.type)==="iframe-resize"&&typeof g.data.height=="number"&&o(Math.max(100,Math.min(g.data.height+32,2e3)))}return window.addEventListener("message",f),()=>window.removeEventListener("message",f)},[]),e?C.jsxs("div",{style:r.container,children:[(h||l)&&C.jsxs("div",{style:r.breadcrumb,children:[h&&C.jsx("span",{style:r.breadcrumbModule,children:h}),h&&l&&C.jsx("span",{style:r.breadcrumbSep,children:"/"}),l&&C.jsx("span",{style:r.breadcrumbTitle,children:l})]}),C.jsx("div",{style:r.iframeWrapper,children:C.jsx("iframe",{ref:n,srcDoc:d,sandbox:"allow-scripts allow-same-origin",style:{...r.iframe,height:s},title:l||"Rich content"})})]}):C.jsxs("div",{style:r.empty,children:[C.jsx("div",{style:r.emptyIcon,children:"</>"}),C.jsx("p",{style:r.emptyTitle,children:"HTML Content"}),C.jsx("p",{style:r.emptySubtext,children:"Rich media and custom content will appear here during lessons."})]})}function BD(e){return{container:{display:"flex",flexDirection:"column",gap:16,maxWidth:1e3,margin:"0 auto"},breadcrumb:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:e.textSecondary},breadcrumbModule:{color:e.accent,fontWeight:500},breadcrumbSep:{color:e.textMuted},breadcrumbTitle:{color:e.textPrimary},iframeWrapper:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,overflow:"hidden"},iframe:{width:"100%",border:"none",display:"block",transition:"height 0.2s ease"},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',color:e.accent},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0}}}function AD({data:e,sendEvent:t}){const{theme:r}=lr(),n=F.useMemo(()=>zD(r),[r]),[s,o]=F.useState(!1),[c,l]=F.useState(null);F.useEffect(()=>{o(!1),l(null)},[e]);const h=F.useCallback(g=>{const m=g.accuracy>=1?3:g.accuracy>=.7?2:g.accuracy>=.4?1:0,y={...g,stars:m};l(y),o(!0),t("event:game-result",y)},[t]),d=F.useCallback(()=>{o(!1),l(null)},[]);if(!e)return C.jsxs("div",{style:n.empty,children:[C.jsx("div",{style:n.emptyIcon,children:"🎮"}),C.jsx("p",{style:n.emptyTitle,children:"Game Mode"}),C.jsx("p",{style:n.emptySubtext,children:"Interactive games will appear here to practice module topics."})]});if(s&&c)return C.jsx(OD,{result:c,gameTitle:e.title,onPlayAgain:d,theme:r,s:n});const{gameType:f}=e;switch(f){case"speed-round":return C.jsx($D,{data:e,onEnd:h,theme:r,s:n});case"bug-hunt":return C.jsx(RD,{data:e,onEnd:h,theme:r,s:n});case"classify":return C.jsx(FD,{data:e,onEnd:h,theme:r,s:n});case"scenario":return C.jsx(ID,{data:e,onEnd:h,theme:r,s:n});case"command-sprint":return C.jsx(PD,{data:e,onEnd:h,theme:r,s:n});case"memory-match":return C.jsx(DD,{data:e,onEnd:h,theme:r,s:n});default:return C.jsx("div",{style:n.errorBox,children:C.jsxs("p",{children:["Unknown game type: ",f]})})}}function $D({data:e,onEnd:t,theme:r,s:n}){var it;const{rounds:s=[],title:o}=e,[c,l]=F.useState(0),[h,d]=F.useState(3),[f,g]=F.useState(0),[m,y]=F.useState(0),[v,b]=F.useState(0),[k,T]=F.useState(((it=s[0])==null?void 0:it.timeLimit)||15),[_,B]=F.useState(null),[L,A]=F.useState(null),[E]=F.useState(Date.now()),$=F.useRef(null),z=s[c];F.useEffect(()=>{if(!(!z||h<=0))return T(z.timeLimit||15),B(null),A(null),$.current=setInterval(()=>{T(rt=>rt<=1?(clearInterval($.current),0):rt-1)},1e3),()=>clearInterval($.current)},[c,z,h]),F.useEffect(()=>{k===0&&_===null&&z&&Z(-1)},[k]);function Z(rt){if(_!==null)return;B(rt),clearInterval($.current);const H=rt===z.answer;A(H?"correct":"wrong");const q=H?m+1:0,N=q>=5?3:q>=3?2:1,Y=H?100*N:0,P=H?h:h-1;g(K=>K+Y),y(q),b(K=>Math.max(K,q)),d(P),setTimeout(()=>{if(P<=0){const K=c+(H?1:0);t({gameType:"speed-round",score:f+Y,maxScore:s.length*300,accuracy:K/s.length,timeMs:Date.now()-E,streakMax:Math.max(v,q),correct:K,total:s.length});return}if(c+1>=s.length){const K=c+(H?1:0);t({gameType:"speed-round",score:f+Y,maxScore:s.length*300,accuracy:K/s.length,timeMs:Date.now()-E,streakMax:Math.max(v,q),correct:K,total:s.length});return}l(K=>K+1)},800)}if(!z)return null;const W=k/(z.timeLimit||15)*100,G=k>10?r.success:k>5?r.warning:r.error;return C.jsxs("div",{style:n.gameContainer,children:[C.jsxs("div",{style:n.gameHeader,children:[C.jsx("span",{style:n.gameTitle,children:o||"Speed Round"}),C.jsxs("span",{style:n.roundCounter,children:[c+1," / ",s.length]})]}),C.jsxs("div",{style:n.statusBar,children:[C.jsx("div",{style:n.livesDisplay,children:Array.from({length:3},(rt,H)=>C.jsx("span",{style:{opacity:H<h?1:.2,fontSize:20},children:"❤️"},H))}),m>=3&&C.jsxs("span",{style:n.streakBadge,children:[m>=5?"3x":"2x"," streak!"]}),C.jsxs("span",{style:n.scoreDisplay,children:[f," pts"]})]}),C.jsx("div",{style:n.timerBar,children:C.jsx("div",{style:{...n.timerFill,width:`${W}%`,backgroundColor:G}})}),C.jsx("h2",{style:n.question,children:z.question}),C.jsx("div",{style:n.choiceGrid,children:(z.options||[]).map((rt,H)=>{const q=typeof rt=="string"?rt:rt.label,N=_===H,Y=H===z.answer,P=_!==null;let K=r.border,et=r.bgSecondary;return P&&Y?(K=r.success,et=`${r.success}18`):P&&N&&!Y?(K=r.error,et=`${r.error}18`):N&&(K=r.accent),C.jsxs("button",{onClick:()=>Z(H),disabled:_!==null,style:{...n.choiceButton,borderColor:K,backgroundColor:et,cursor:_!==null?"default":"pointer",opacity:P&&!N&&!Y?.4:1,animation:P&&N&&!Y?"shake 0.3s ease":void 0},children:[C.jsx("span",{style:n.choiceLetter,children:String.fromCharCode(65+H)}),C.jsx("span",{style:n.choiceText,children:q})]},H)})})]})}function RD({data:e,onEnd:t,theme:r,s:n}){const{snippets:s=[],title:o}=e,[c,l]=F.useState(0),[h,d]=F.useState(null),[f,g]=F.useState(!1),[m,y]=F.useState(!1),v=F.useRef(0),[b]=F.useState(Date.now()),k=s[c];function T(L){h===null&&(d(L),L===k.bugLine&&(v.current+=1),g(!0))}function _(){const L=v.current;if(c+1>=s.length){t({gameType:"bug-hunt",score:L,maxScore:s.length,accuracy:L/s.length,timeMs:Date.now()-b,streakMax:0,correct:L,total:s.length});return}l(A=>A+1),d(null),g(!1),y(!1)}if(!k)return null;const B=k.code.split(`
426
+ `);return C.jsxs("div",{style:n.gameContainer,children:[C.jsxs("div",{style:n.gameHeader,children:[C.jsx("span",{style:n.gameTitle,children:o||"Bug Hunt"}),C.jsxs("span",{style:n.roundCounter,children:[c+1," / ",s.length]})]}),C.jsx("p",{style:n.hint,children:"Find the buggy line. Click to select."}),!m&&h===null&&k.hint&&C.jsx("button",{onClick:()=>y(!0),style:n.hintButton,children:"Show Hint"}),m&&h===null&&C.jsx("div",{style:n.hintBox,children:C.jsx("p",{style:n.hintText,children:k.hint})}),C.jsx("div",{style:n.codeBlock,children:B.map((L,A)=>{const E=A+1,$=h===E,z=E===k.bugLine,Z=h!==null;let W="transparent";return Z&&z?W=`${r.success}20`:Z&&$&&!z&&(W=`${r.error}20`),C.jsxs("div",{onClick:()=>T(E),style:{...n.codeLine,backgroundColor:W,cursor:h!==null?"default":"pointer",borderLeft:$?"3px solid "+(z?r.success:r.error):Z&&z?`3px solid ${r.success}`:"3px solid transparent"},children:[C.jsx("span",{style:n.lineNumber,children:E}),C.jsx("span",{style:n.lineContent,children:L||" "})]},A)})}),f&&C.jsxs("div",{style:{...n.explanationBox,borderColor:h===k.bugLine?r.success:r.error},children:[C.jsx("p",{style:n.explanationLabel,children:h===k.bugLine?"Correct!":`Wrong — the bug is on line ${k.bugLine}`}),C.jsx("p",{style:n.explanationText,children:k.explanation}),C.jsx("button",{onClick:_,style:n.nextButton,children:c+1>=s.length?"See Results":"Next Snippet"})]})]})}function FD({data:e,onEnd:t,theme:r,s:n}){const{categories:s=[],items:o=[],title:c}=e,[l]=F.useState(()=>[...o].sort(()=>Math.random()-.5)),[h,d]=F.useState(0),[f,g]=F.useState(3),[m,y]=F.useState(0),[v,b]=F.useState(null),[k]=F.useState(Date.now()),T=l[h];function _(L){if(!T||v)return;const A=T.category===L;b({category:L,correct:A}),A?y(E=>E+1):g(E=>E-1),setTimeout(()=>{if(b(null),(A?f:f-1)<=0||h+1>=l.length){const $=m+(A?1:0);t({gameType:"classify",score:$,maxScore:l.length,accuracy:$/l.length,timeMs:Date.now()-k,streakMax:0,correct:$,total:l.length});return}d($=>$+1)},600)}if(!T)return null;const B=[r.accent,r.success,r.warning,r.purple];return C.jsxs("div",{style:n.gameContainer,children:[C.jsxs("div",{style:n.gameHeader,children:[C.jsx("span",{style:n.gameTitle,children:c||"Classify"}),C.jsxs("span",{style:n.roundCounter,children:[h+1," / ",l.length]})]}),C.jsxs("div",{style:n.statusBar,children:[C.jsx("div",{style:n.livesDisplay,children:Array.from({length:3},(L,A)=>C.jsx("span",{style:{opacity:A<f?1:.2,fontSize:20},children:"❤️"},A))}),C.jsxs("span",{style:n.scoreDisplay,children:[m," / ",l.length]})]}),C.jsx("div",{style:n.bucketsRow,children:s.map((L,A)=>{const E=typeof L=="string"?L:L.name,$=typeof L=="object"&&L.color||B[A%B.length],z=v&&v.category===E,Z=z?v.correct?`${r.success}30`:`${r.error}30`:`${$}10`;return C.jsx("button",{onClick:()=>_(E),style:{...n.bucket,borderColor:$,backgroundColor:Z,transform:z&&!v.correct?"translateX(4px)":"none",transition:"all 0.2s ease"},children:C.jsx("span",{style:{color:$,fontWeight:700,fontSize:14},children:E})},E)})}),C.jsx("div",{style:n.itemCard,children:C.jsx("p",{style:n.itemText,children:T.text})})]})}function ID({data:e,onEnd:t,theme:r,s:n}){var E;const{steps:s=[],title:o,startHealth:c=5}=e,[l,h]=F.useState(((E=s[0])==null?void 0:E.id)||0),[d,f]=F.useState(c),[g,m]=F.useState(null),[y,v]=F.useState(0),[b,k]=F.useState(0),[T]=F.useState(Date.now()),_=s.find($=>$.id===l)||s[y];function B($,z){if(g!==null)return;m(z);const Z=Math.max(0,d+($.health||0));f(Z),$.health>=0&&k(W=>W+1),setTimeout(()=>{if(Z<=0||!$.next||$.next==="end"){const W=y+1;t({gameType:"scenario",score:b+($.health>=0?1:0),maxScore:W,accuracy:(b+($.health>=0?1:0))/W,timeMs:Date.now()-T,streakMax:0,correct:b+($.health>=0?1:0),total:W,healthRemaining:Z});return}h($.next),v(W=>W+1),m(null)},1800)}if(!_)return null;const L=d/c*100,A=L>60?r.success:L>30?r.warning:r.error;return C.jsxs("div",{style:n.gameContainer,children:[C.jsxs("div",{style:n.gameHeader,children:[C.jsx("span",{style:n.gameTitle,children:o||"Scenario"}),C.jsxs("span",{style:n.roundCounter,children:["Step ",y+1]})]}),C.jsx("div",{style:n.healthBarOuter,children:C.jsx("div",{style:{...n.healthBarInner,width:`${L}%`,backgroundColor:A}})}),C.jsxs("div",{style:{textAlign:"right",fontSize:12,color:r.textSecondary,marginBottom:16},children:["Health: ",d," / ",c]}),C.jsx("div",{style:n.scenarioPanel,children:C.jsx("p",{style:n.situationText,children:_.situation})}),C.jsx("div",{style:n.choiceGrid,children:(_.choices||[]).map(($,z)=>{const Z=g===z;return C.jsxs("div",{children:[C.jsx("button",{onClick:()=>B($,z),disabled:g!==null,style:{...n.scenarioChoice,borderColor:Z?r.accent:r.border,backgroundColor:Z?`${r.accent}18`:r.bgSecondary,cursor:g!==null?"default":"pointer",opacity:g!==null&&!Z?.4:1},children:$.text}),Z&&C.jsxs("div",{style:{...n.consequenceBox,borderColor:$.health>=0?r.success:r.error},children:[C.jsx("p",{style:n.consequenceText,children:$.consequence}),$.health!==0&&C.jsxs("span",{style:{color:$.health>0?r.success:r.error,fontWeight:700,fontSize:13},children:[$.health>0?"+":"",$.health," health"]})]})]},z)})})]})}function PD({data:e,onEnd:t,theme:r,s:n}){var A;const{challenges:s=[],title:o}=e,[c,l]=F.useState(0),[h,d]=F.useState(""),[f,g]=F.useState(null),[m,y]=F.useState(0),[v]=F.useState(Date.now()),[b,k]=F.useState(((A=s[0])==null?void 0:A.timeLimit)||30),T=F.useRef(null),_=F.useRef(null),B=s[c];F.useEffect(()=>(d(""),g(null),k((B==null?void 0:B.timeLimit)||30),T.current&&T.current.focus(),_.current=setInterval(()=>{k(E=>E<=1?(clearInterval(_.current),0):E-1)},1e3),()=>clearInterval(_.current)),[c]),F.useEffect(()=>{b===0&&f===null&&B&&(clearInterval(_.current),g("wrong"),setTimeout(()=>{if(c+1>=s.length){t({gameType:"command-sprint",score:m,maxScore:s.length,accuracy:m/s.length,timeMs:Date.now()-v,streakMax:0,correct:m,total:s.length});return}l(E=>E+1)},1e3))},[b]);function L(E){if(E.preventDefault(),f!==null||!B)return;clearInterval(_.current);const $=h.trim(),Z=[B.answer,...B.alternates||[]].some(W=>W.toLowerCase()===$.toLowerCase());g(Z?"correct":"wrong"),Z&&y(W=>W+1),setTimeout(()=>{if(c+1>=s.length){const W=m+(Z?1:0);t({gameType:"command-sprint",score:W,maxScore:s.length,accuracy:W/s.length,timeMs:Date.now()-v,streakMax:0,correct:W,total:s.length});return}l(W=>W+1)},1e3)}return B?C.jsxs("div",{style:n.gameContainer,children:[C.jsxs("div",{style:n.gameHeader,children:[C.jsx("span",{style:n.gameTitle,children:o||"Command Sprint"}),C.jsxs("span",{style:n.roundCounter,children:[c+1," / ",s.length]})]}),C.jsx("div",{style:n.timerBar,children:C.jsx("div",{style:{...n.timerFill,width:`${b/(B.timeLimit||30)*100}%`,backgroundColor:b>10?r.success:b>5?r.warning:r.error}})}),C.jsx("div",{style:n.sprintPrompt,children:C.jsx("p",{style:n.sprintTask,children:B.prompt})}),C.jsxs("form",{onSubmit:L,style:n.sprintForm,children:[C.jsxs("div",{style:{...n.sprintInputWrapper,borderColor:f==="correct"?r.success:f==="wrong"?r.error:r.accent},children:[C.jsx("span",{style:n.sprintCaret,children:">"}),C.jsx("input",{ref:T,type:"text",value:h,onChange:E=>d(E.target.value),disabled:f!==null,placeholder:"Type your command...",autoComplete:"off",autoCapitalize:"off",spellCheck:!1,style:n.sprintInput})]}),f===null&&C.jsx("button",{type:"submit",style:n.submitButton,children:"Submit"})]}),f==="wrong"&&C.jsxs("div",{style:n.sprintAnswer,children:[C.jsx("span",{style:{color:r.error},children:"Expected: "}),C.jsx("code",{style:n.sprintCode,children:B.answer})]}),f==="correct"&&C.jsx("div",{style:{...n.sprintAnswer,borderColor:r.success},children:C.jsx("span",{style:{color:r.success},children:"Correct!"})})]}):null}function DD({data:e,onEnd:t,theme:r,s:n}){const{pairs:s=[],title:o}=e,[c,l]=F.useState([]),[h,d]=F.useState([]),[f,g]=F.useState(new Set),[m,y]=F.useState(0),[v]=F.useState(Date.now()),b=F.useRef(!1);F.useEffect(()=>{const _=[];s.forEach((B,L)=>{_.push({id:`t-${L}`,pairId:L,text:B.term,side:"term"}),_.push({id:`d-${L}`,pairId:L,text:B.definition,side:"def"})});for(let B=_.length-1;B>0;B--){const L=Math.floor(Math.random()*(B+1));[_[B],_[L]]=[_[L],_[B]]}l(_),d([]),g(new Set),y(0)},[s]);function k(_){if(b.current||h.includes(_)||f.has(c[_].pairId))return;const B=[...h,_];if(d(B),B.length===2){y(E=>E+1),b.current=!0;const[L,A]=B;if(c[L].pairId===c[A].pairId){const E=new Set(f);E.add(c[L].pairId),setTimeout(()=>{if(g(E),d([]),b.current=!1,E.size===s.length){const $=m+1,z=s.length;t({gameType:"memory-match",score:Math.max(0,z*2-$),maxScore:z,accuracy:Math.min(1,z/$),timeMs:Date.now()-v,streakMax:0,correct:E.size,total:s.length,moves:$})}},500)}else setTimeout(()=>{d([]),b.current=!1},800)}}const T=c.length<=12?4:6;return C.jsxs("div",{style:n.gameContainer,children:[C.jsxs("div",{style:n.gameHeader,children:[C.jsx("span",{style:n.gameTitle,children:o||"Memory Match"}),C.jsxs("span",{style:n.roundCounter,children:["Moves: ",m]})]}),C.jsx("p",{style:n.hint,children:"Flip cards to find matching term-definition pairs"}),C.jsx("div",{style:{...n.cardGrid,gridTemplateColumns:`repeat(${T}, 1fr)`},children:c.map((_,B)=>{const L=h.includes(B),A=f.has(_.pairId),E=L||A;return C.jsx("button",{onClick:()=>k(B),disabled:A,style:{...n.memoryCard,backgroundColor:A?`${r.success}15`:E?r.bgSecondary:r.bgTertiary,borderColor:A?r.success:E?r.accent:r.border,cursor:A?"default":"pointer",transform:"rotateY(0deg)"},children:E?C.jsx("span",{style:{...n.cardText,color:_.side==="term"?r.accent:r.textPrimary,fontSize:_.text.length>30?11:13},children:_.text}):C.jsx("span",{style:n.cardBack,children:"?"})},_.id)})}),C.jsxs("div",{style:{textAlign:"center",marginTop:16,fontSize:13,color:r.textSecondary},children:[f.size," / ",s.length," pairs found"]})]})}function OD({result:e,gameTitle:t,onPlayAgain:r,theme:n,s}){const{score:o=0,maxScore:c=1,accuracy:l=0,timeMs:h=0,streakMax:d=0,stars:f=0,correct:g=0,total:m=0,moves:y}=e,v=Math.round(h/1e3),b=Math.floor(v/60),k=v%60,T=b>0?`${b}m ${k}s`:`${k}s`,_=Math.round(l*100),B=Array.from({length:3},(L,A)=>A<f?"⭐":"☆").join(" ");return C.jsx("div",{style:s.gameContainer,children:C.jsxs("div",{style:s.resultsCard,children:[C.jsx("h2",{style:s.resultsTitle,children:t||"Game Complete"}),C.jsx("div",{style:s.starsRow,children:B}),C.jsxs("div",{style:s.resultsGrid,children:[C.jsxs("div",{style:s.resultStat,children:[C.jsxs("span",{style:s.resultValue,children:[_,"%"]}),C.jsx("span",{style:s.resultLabel,children:"Accuracy"})]}),C.jsxs("div",{style:s.resultStat,children:[C.jsxs("span",{style:s.resultValue,children:[g,"/",m]}),C.jsx("span",{style:s.resultLabel,children:"Correct"})]}),C.jsxs("div",{style:s.resultStat,children:[C.jsx("span",{style:s.resultValue,children:T}),C.jsx("span",{style:s.resultLabel,children:"Time"})]}),d>0&&C.jsxs("div",{style:s.resultStat,children:[C.jsx("span",{style:s.resultValue,children:d}),C.jsx("span",{style:s.resultLabel,children:"Best Streak"})]}),y!==void 0&&C.jsxs("div",{style:s.resultStat,children:[C.jsx("span",{style:s.resultValue,children:y}),C.jsx("span",{style:s.resultLabel,children:"Moves"})]})]}),C.jsxs("div",{style:s.xpEarned,children:["+",f===3?40:25," XP"]}),C.jsx("button",{onClick:r,style:s.playAgainButton,children:"Play Again"})]})})}function zD(e){return{gameContainer:{maxWidth:700,margin:"0 auto",display:"flex",flexDirection:"column",gap:16},gameHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},gameTitle:{fontSize:20,fontWeight:700,color:e.textBright},roundCounter:{fontSize:14,color:e.textSecondary,padding:"4px 10px",backgroundColor:e.bgTertiary,borderRadius:6},statusBar:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},livesDisplay:{display:"flex",gap:4},streakBadge:{fontSize:13,fontWeight:700,color:e.warning,padding:"2px 8px",backgroundColor:`${e.warning}18`,borderRadius:4},scoreDisplay:{fontSize:16,fontWeight:700,color:e.accent},timerBar:{height:4,backgroundColor:e.bgTertiary,borderRadius:2,overflow:"hidden"},timerFill:{height:"100%",borderRadius:2,transition:"width 1s linear, background-color 0.3s ease"},question:{fontSize:20,fontWeight:700,color:e.textBright,margin:0,lineHeight:1.4},hint:{fontSize:13,color:e.textSecondary,margin:0},choiceGrid:{display:"flex",flexDirection:"column",gap:10},choiceButton:{display:"flex",alignItems:"center",gap:14,padding:"14px 18px",border:"1px solid",borderRadius:10,textAlign:"left",transition:"border-color 0.15s ease, background-color 0.15s ease, opacity 0.3s ease",width:"100%",fontSize:14,color:e.textPrimary,fontFamily:"inherit",cursor:"pointer"},choiceLetter:{width:28,height:28,borderRadius:"50%",backgroundColor:e.bgTertiary,display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:700,color:e.textSecondary,flexShrink:0},choiceText:{flex:1},submitButton:{alignSelf:"center",padding:"10px 28px",fontSize:14,fontWeight:600,color:"#ffffff",backgroundColor:e.success,border:`1px solid ${e.success}`,borderRadius:8,cursor:"pointer"},nextButton:{padding:"8px 20px",fontSize:13,fontWeight:600,color:"#ffffff",backgroundColor:e.success,border:`1px solid ${e.success}`,borderRadius:6,cursor:"pointer",marginTop:8},errorBox:{textAlign:"center",padding:40,color:e.error,fontSize:16},empty:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:400,gap:12},emptyIcon:{fontSize:48,opacity:.5},emptyTitle:{fontSize:18,fontWeight:600,color:e.textBright,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0},hintButton:{alignSelf:"flex-start",padding:"6px 14px",fontSize:13,fontWeight:600,color:e.warning,backgroundColor:"transparent",border:`1px solid ${e.warning}`,borderRadius:6,cursor:"pointer",fontFamily:"inherit"},hintBox:{padding:"12px 16px",border:`1px solid ${e.warning}`,borderRadius:8,backgroundColor:`${e.warning}10`},hintText:{color:e.warning,fontSize:14,margin:0,lineHeight:1.5},codeBlock:{backgroundColor:e.bgPrimary,border:`1px solid ${e.border}`,borderRadius:10,overflow:"hidden",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:14,lineHeight:1.6},codeLine:{display:"flex",alignItems:"flex-start",padding:"2px 12px 2px 0",transition:"background-color 0.15s ease"},lineNumber:{width:40,textAlign:"right",paddingRight:12,color:e.textMuted,userSelect:"none",flexShrink:0},lineContent:{color:e.textPrimary,whiteSpace:"pre"},explanationBox:{padding:"16px 20px",border:"1px solid",borderRadius:8,backgroundColor:e.bgSecondary},explanationLabel:{fontSize:15,fontWeight:700,color:e.textBright,margin:"0 0 8px 0"},explanationText:{fontSize:14,color:e.textSecondary,margin:0,lineHeight:1.5},bucketsRow:{display:"flex",gap:10,justifyContent:"center",flexWrap:"wrap"},bucket:{flex:"1 1 120px",maxWidth:200,padding:"16px 12px",border:"2px solid",borderRadius:10,backgroundColor:"transparent",cursor:"pointer",textAlign:"center",fontFamily:"inherit",transition:"all 0.2s ease"},itemCard:{padding:"24px 20px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10,textAlign:"center"},itemText:{fontSize:16,color:e.textBright,margin:0,lineHeight:1.5},healthBarOuter:{height:8,backgroundColor:e.bgTertiary,borderRadius:4,overflow:"hidden"},healthBarInner:{height:"100%",borderRadius:4,transition:"width 0.5s ease, background-color 0.3s ease"},scenarioPanel:{padding:"24px 20px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10},situationText:{fontSize:16,color:e.textBright,margin:0,lineHeight:1.6},scenarioChoice:{display:"block",width:"100%",padding:"14px 18px",border:"1px solid",borderRadius:10,fontSize:14,color:e.textPrimary,fontFamily:"inherit",textAlign:"left",transition:"border-color 0.15s ease, background-color 0.15s ease, opacity 0.3s ease"},consequenceBox:{margin:"8px 0 0 16px",padding:"12px 16px",border:"1px solid",borderRadius:8,backgroundColor:e.bgPrimary},consequenceText:{fontSize:14,color:e.textPrimary,margin:0,lineHeight:1.5},sprintPrompt:{padding:"20px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:10,textAlign:"center"},sprintTask:{fontSize:18,fontWeight:600,color:e.textBright,margin:0,lineHeight:1.4},sprintForm:{display:"flex",flexDirection:"column",gap:12,alignItems:"center"},sprintInputWrapper:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"12px 16px",backgroundColor:e.bgPrimary,border:"2px solid",borderRadius:8,transition:"border-color 0.2s ease"},sprintCaret:{color:e.success,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontWeight:700,fontSize:16,flexShrink:0},sprintInput:{flex:1,background:"none",border:"none",outline:"none",color:e.textPrimary,fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',fontSize:15},sprintAnswer:{padding:"12px 16px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:8,fontSize:14,textAlign:"center"},sprintCode:{fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',color:e.accent},cardGrid:{display:"grid",gap:10,justifyContent:"center"},memoryCard:{aspectRatio:"1 / 1",minHeight:80,display:"flex",alignItems:"center",justifyContent:"center",padding:8,border:"2px solid",borderRadius:10,fontFamily:"inherit",transition:"all 0.2s ease",cursor:"pointer"},cardText:{textAlign:"center",lineHeight:1.3,wordBreak:"break-word"},cardBack:{fontSize:24,fontWeight:700,color:e.textMuted},resultsCard:{maxWidth:500,margin:"40px auto 0",padding:"40px 32px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:16,textAlign:"center",display:"flex",flexDirection:"column",gap:20},resultsTitle:{fontSize:24,fontWeight:700,color:e.textBright,margin:0},starsRow:{fontSize:32,letterSpacing:8},resultsGrid:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:24},resultStat:{display:"flex",flexDirection:"column",alignItems:"center",gap:4},resultValue:{fontSize:28,fontWeight:700,color:e.accent},resultLabel:{fontSize:12,color:e.textSecondary,textTransform:"uppercase",letterSpacing:1},xpEarned:{fontSize:20,fontWeight:700,color:e.success,padding:"8px 16px",backgroundColor:`${e.success}15`,borderRadius:8,alignSelf:"center"},playAgainButton:{padding:"12px 32px",fontSize:15,fontWeight:600,color:"#ffffff",backgroundColor:e.success,border:`1px solid ${e.success}`,borderRadius:8,cursor:"pointer",alignSelf:"center"}}}const jD=[{id:"home",label:"Home",icon:"🏠"},{id:"modules",label:"Modules",icon:"📚"},{id:"achievements",label:"Achievements",icon:"🏆"},{id:"settings",label:"Settings",icon:"⚙"}];function ND({activeNav:e,onNavClick:t,belt:r,xp:n,streak:s,onNewChat:o}){const{theme:c}=lr(),l=F.useMemo(()=>WD(c),[c]);return C.jsxs("nav",{style:l.nav,children:[C.jsxs("div",{style:l.left,children:[C.jsx("span",{style:l.logo,children:"⬡ ClaudeTeach"}),C.jsx("div",{style:l.navItems,children:jD.map(h=>C.jsxs("button",{style:e===h.id?l.navItemActive:l.navItem,onClick:()=>t(h.id),children:[h.icon," ",h.label]},h.id))})]}),C.jsxs("div",{style:l.right,children:[r&&C.jsxs("div",{style:{...l.beltBadge,background:`linear-gradient(135deg, ${r.color}22, ${r.color}11)`,border:`1px solid ${r.color}44`},children:[C.jsx("span",{children:r.badge}),C.jsxs("span",{style:{color:r.color,fontWeight:600},children:[r.name," Belt"]}),C.jsx("span",{style:{color:c.textSecondary},children:"·"}),C.jsxs("span",{style:{color:c.textPrimary},children:[n," XP"]})]}),s>0&&C.jsxs("div",{style:l.streakBadge,children:[C.jsx("span",{children:"🔥"}),C.jsx("span",{style:{color:c.orange,fontWeight:600},children:s})]})]})]})}function WD(e){return{nav:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",height:48,backgroundColor:e.bgSecondary,borderBottom:`1px solid ${e.border}`,flexShrink:0},left:{display:"flex",alignItems:"center",gap:16},logo:{fontSize:14,fontWeight:800,color:e.accent,letterSpacing:"-0.5px"},navItems:{display:"flex",gap:2,marginLeft:8},navItem:{padding:"4px 10px",fontSize:11,color:e.textSecondary,backgroundColor:"transparent",border:"none",borderRadius:6,cursor:"pointer",fontFamily:"inherit"},navItemActive:{padding:"4px 10px",fontSize:11,color:e.textPrimary,backgroundColor:e.bgTertiary,border:"none",borderRadius:6,cursor:"pointer",fontFamily:"inherit"},right:{display:"flex",alignItems:"center",gap:8},beltBadge:{display:"flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:16,fontSize:10},streakBadge:{display:"flex",alignItems:"center",gap:4,padding:"3px 8px",borderRadius:16,fontSize:11,background:`${e.orange}22`,border:`1px solid ${e.orange}44`}}}function HD({onClick:e}){const{theme:t}=lr(),r=F.useMemo(()=>qD(t),[t]);return C.jsx("button",{style:r.bubble,onClick:e,title:"Open chat",children:C.jsx("span",{style:r.icon,children:"💬"})})}function qD(e){return{bubble:{position:"fixed",bottom:16,right:16,width:44,height:44,borderRadius:"50%",background:`linear-gradient(135deg, ${e.userBubble}, ${e.accent})`,border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 2px 12px ${e.accent}33`,zIndex:100,transition:"transform 0.15s ease"},icon:{fontSize:18,lineHeight:1}}}const UD="canvas:diagram",GD="canvas:quiz",VD="canvas:code",YD="canvas:dashboard",XD="canvas:html",QD="canvas:celebrate",KD="canvas:terminal",ZD="canvas:game",JD="canvas:settings",tO="event:quiz-answer",eO="event:code-run",rO="event:click",nO="event:drag-complete",iO="event:terminal-command",sO="event:game-result",aO="capture:text",oO="capture:page",lO="context:topic",cO="context:match",uO="chat:send",hO="chat:assistant",dO="chat:stream",fO="chat:tool-use",pO="chat:tool-result",gO="chat:status",mO="chat:stop",yO="sys:connect",xO="sys:disconnect",vO="sys:tier-change",bO="sys:heartbeat",SO={canvas:[UD,GD,VD,YD,XD,QD,KD,ZD,JD],event:[tO,eO,rO,nO,iO,sO],capture:[aO,oO],context:[lO,cO],chat:[uO,hO,dO,fO,pO,gO,mO],system:[yO,xO,vO,bO]};new Set(Object.values(SO).flat());const Lc={LEARNING:"learning",QUIZZES_GAMES:"quizzes-games",STREAKS:"streaks",BELTS:"belts"},uf=[{id:"first-steps",icon:"🌱",name:"First Steps",description:"Complete your first module",category:"learning",criteria:{type:"modules-completed",target:1}},{id:"bookworm",icon:"📚",name:"Bookworm",description:"Complete 5 modules",category:"learning",criteria:{type:"modules-completed",target:5}},{id:"scholar",icon:"🎓",name:"Scholar",description:"Complete 20 modules",category:"learning",criteria:{type:"modules-completed",target:20}},{id:"encyclopedist",icon:"🏛",name:"Encyclopedist",description:"Complete all modules",category:"learning",criteria:{type:"modules-completed-all"}},{id:"deep-diver",icon:"🧠",name:"Deep Diver",description:"Complete 3 advanced modules",category:"learning",criteria:{type:"advanced-completed",target:3}},{id:"author",icon:"✍️",name:"Author",description:"Create a custom module",category:"learning",criteria:{type:"modules-authored",target:1}},{id:"speed-demon",icon:"⚡",name:"Speed Demon",description:"5 quizzes under 10s each",category:"quizzes-games",criteria:{type:"fast-quizzes",target:5}},{id:"perfect-score",icon:"🎯",name:"Perfect Score",description:"100% on any quiz",category:"quizzes-games",criteria:{type:"quiz-perfect",target:1}},{id:"bug-squasher",icon:"🐛",name:"Bug Squasher",description:"Win 10 Bug Hunt games",category:"quizzes-games",criteria:{type:"bug-hunt-wins",target:10}},{id:"memory-master",icon:"🧩",name:"Memory Master",description:"Perfect memory match 5 times",category:"quizzes-games",criteria:{type:"memory-perfect",target:5}},{id:"command-racer",icon:"🏘",name:"Command Racer",description:"100% on Command Sprint",category:"quizzes-games",criteria:{type:"command-sprint-perfect",target:1}},{id:"game-night",icon:"🎲",name:"Game Night",description:"Play all 6 game types",category:"quizzes-games",criteria:{type:"game-types-played",target:6}},{id:"streak-breaker",icon:"🔥",name:"Streak Breaker",description:"5x streak multiplier in Speed Round",category:"quizzes-games",criteria:{type:"speed-streak",target:5}},{id:"triple-crown",icon:"👑",name:"Triple Crown",description:"3 stars on 10 different games",category:"quizzes-games",criteria:{type:"three-star-games",target:10}},{id:"on-fire",icon:"🔥",name:"On Fire",description:"5-day learning streak",category:"streaks",criteria:{type:"streak-days",target:5}},{id:"marathon",icon:"🏃",name:"Marathon",description:"30-day learning streak",category:"streaks",criteria:{type:"streak-days",target:30}},{id:"night-owl",icon:"🦉",name:"Night Owl",description:"Study after midnight",category:"streaks",criteria:{type:"time-of-day",target:"night"},rare:!0},{id:"early-bird",icon:"☀️",name:"Early Bird",description:"Study before 7am",category:"streaks",criteria:{type:"time-of-day",target:"morning"},rare:!0},{id:"consistent",icon:"📅",name:"Consistent",description:"Learn something every day for a week",category:"streaks",criteria:{type:"streak-days",target:7}},{id:"belt-white",icon:"⚪",name:"White Belt",description:"Earn the White Belt",category:"belts",criteria:{type:"belt-earned",target:"White"}},{id:"belt-yellow",icon:"🟡",name:"Yellow Belt",description:"Earn the Yellow Belt",category:"belts",criteria:{type:"belt-earned",target:"Yellow"}},{id:"belt-green",icon:"🟢",name:"Green Belt",description:"Earn the Green Belt",category:"belts",criteria:{type:"belt-earned",target:"Green"}},{id:"belt-blue",icon:"🔵",name:"Blue Belt",description:"Earn the Blue Belt",category:"belts",criteria:{type:"belt-earned",target:"Blue"}},{id:"belt-purple",icon:"🟣",name:"Purple Belt",description:"Earn the Purple Belt",category:"belts",criteria:{type:"belt-earned",target:"Purple"}},{id:"belt-brown",icon:"🟤",name:"Brown Belt",description:"Earn the Brown Belt",category:"belts",criteria:{type:"belt-earned",target:"Brown"}},{id:"belt-black",icon:"⚫",name:"Black Belt",description:"Earn the Black Belt",category:"belts",criteria:{type:"belt-earned",target:"Black"}}],Ix=[{key:Lc.LEARNING,label:"Learning Milestones",icon:"📖"},{key:Lc.QUIZZES_GAMES,label:"Quizzes & Games",icon:"🎮"},{key:Lc.STREAKS,label:"Streaks & Dedication",icon:"🔥"},{key:Lc.BELTS,label:"Belt Milestones",icon:"🥋"}];function CO(e,t){switch(e){case"learning":return t.success;case"quizzes-games":return t.accent;case"streaks":return t.orange;case"belts":return t.purple;default:return t.accent}}function wO({data:e}){var f;const{theme:t}=lr(),r=F.useMemo(()=>kO(t),[t]),n=(e==null?void 0:e.achievements)||{unlocked:[],near:[]},s=F.useMemo(()=>{const g=new Map;for(const m of n.unlocked||[])g.set(m.id,m);return g},[n.unlocked]),o=F.useMemo(()=>{const g=new Map;for(const m of n.near||[])g.set(m.id,m);return g},[n.near]),c=((f=n.unlocked)==null?void 0:f.length)||0,l=uf.length-c,h=uf.filter(g=>g.rare&&s.has(g.id)).length,d=F.useMemo(()=>{const g={};for(const m of Ix)g[m.key]=[];for(const m of uf)g[m.category]&&g[m.category].push(m);return g},[]);return C.jsxs("div",{style:r.container,children:[C.jsxs("div",{style:r.statsBar,children:[C.jsxs("div",{style:{...r.statCard,border:`1px solid ${t.warning}44`},children:[C.jsx("span",{style:{fontSize:24},children:"🏆"}),C.jsxs("div",{children:[C.jsx("div",{style:{fontSize:22,fontWeight:700,color:t.warning},children:c}),C.jsx("div",{style:{fontSize:11,color:t.textSecondary},children:"Unlocked"})]})]}),C.jsxs("div",{style:{...r.statCard,border:`1px solid ${t.border}`},children:[C.jsx("span",{style:{fontSize:24},children:"🔒"}),C.jsxs("div",{children:[C.jsx("div",{style:{fontSize:22,fontWeight:700,color:t.textSecondary},children:l}),C.jsx("div",{style:{fontSize:11,color:t.textSecondary},children:"Locked"})]})]}),C.jsxs("div",{style:{...r.statCard,border:`1px solid ${t.purple}44`},children:[C.jsx("span",{style:{fontSize:24},children:"✨"}),C.jsxs("div",{children:[C.jsx("div",{style:{fontSize:22,fontWeight:700,color:t.purple},children:h}),C.jsx("div",{style:{fontSize:11,color:t.textSecondary},children:"Rare"})]})]})]}),Ix.map(g=>{const m=d[g.key]||[],y=CO(g.key,t);return C.jsxs("div",{style:r.categorySection,children:[C.jsxs("div",{style:r.categoryHeader,children:[C.jsx("span",{children:g.icon}),C.jsx("h3",{style:r.categoryTitle,children:g.label}),C.jsxs("span",{style:{fontSize:11,color:t.textMuted,marginLeft:"auto"},children:[m.filter(v=>s.has(v.id)).length,"/",m.length]})]}),C.jsx("div",{style:r.badgeGrid,children:m.map(v=>{const b=s.get(v.id),k=o.get(v.id),T=!!b,_=!T&&!!k;return C.jsxs("div",{style:{...r.badge,background:T?`linear-gradient(135deg, ${y}22, ${y}11)`:t.bgSecondary,border:T?`1px solid ${y}44`:`1px solid ${t.border}`,boxShadow:T?`0 0 12px ${y}15`:"none"},children:[v.rare&&C.jsx("span",{style:{position:"absolute",top:6,right:6,fontSize:8,fontWeight:700,color:t.purple,backgroundColor:`${t.purple}22`,padding:"1px 4px",borderRadius:3},children:"RARE"}),T&&b.isNew&&C.jsx("span",{style:{position:"absolute",top:6,left:6,fontSize:8,fontWeight:700,color:t.warning,backgroundColor:`${t.warning}22`,padding:"1px 4px",borderRadius:3},children:"NEW"}),C.jsx("span",{style:{fontSize:32,filter:T?"none":"grayscale(100%)",opacity:T?1:.4},children:v.icon}),C.jsx("span",{style:{fontSize:12,fontWeight:600,color:T?t.textPrimary:t.textSecondary},children:v.name}),C.jsx("span",{style:{fontSize:10,color:t.textMuted,textAlign:"center",lineHeight:1.3},children:v.description}),T&&b.date&&C.jsx("span",{style:{fontSize:9,color:t.textMuted},children:b.date}),!T&&C.jsx("span",{style:{fontSize:9,color:t.textMuted},children:"???"}),_&&k.current!==void 0&&C.jsxs("div",{style:{width:"80%",marginTop:2},children:[C.jsx("div",{style:{height:3,backgroundColor:t.bgTertiary,borderRadius:2,overflow:"hidden"},children:C.jsx("div",{style:{height:"100%",width:`${Math.min(100,k.current/k.target*100)}%`,backgroundColor:y,borderRadius:2}})}),C.jsxs("span",{style:{fontSize:9,color:t.textMuted},children:[k.current,"/",k.target]})]})]},v.id)})})]},g.key)})]})}function kO(e){return{container:{maxWidth:900,margin:"0 auto",display:"flex",flexDirection:"column",gap:28},statsBar:{display:"flex",gap:12,flexWrap:"wrap"},statCard:{flex:"1 1 140px",display:"flex",alignItems:"center",gap:12,padding:"16px 20px",backgroundColor:e.bgSecondary,borderRadius:12},categorySection:{display:"flex",flexDirection:"column",gap:12},categoryHeader:{display:"flex",alignItems:"center",gap:8},categoryTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:0},badgeGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(130px, 1fr))",gap:10},badge:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,padding:"16px 10px",borderRadius:12,textAlign:"center",position:"relative",transition:"transform 0.15s ease",cursor:"default"}}}const _O=["All","Developer","Leadership","AI","Product","Testing","General"];function TO({data:e}){var B;const{theme:t}=lr(),r=F.useMemo(()=>EO(t),[t]),[n,s]=F.useState([]),[o,c]=F.useState(""),[l,h]=F.useState("All"),[d,f]=F.useState(null),g=((B=e==null?void 0:e.progress)==null?void 0:B.modules)||[];F.useEffect(()=>{fetch("http://localhost:3456/api/modules").then(L=>L.ok?L.json():[]).then(L=>{const A=Array.isArray(L)?L:L.modules||[];s(A)}).catch(()=>s([]))},[]);const m=F.useMemo(()=>{const L=new Map;for(const A of g)L.set(A.slug,A);return n.map(A=>({...A,...L.get(A.slug)||{}}))},[n,g]),y=F.useMemo(()=>{let L=m;if(o.trim()){const A=o.toLowerCase();L=L.filter(E=>(E.title||"").toLowerCase().includes(A)||(E.description||"").toLowerCase().includes(A)||(E.slug||"").toLowerCase().includes(A))}if(l!=="All"){const A=l.toLowerCase();L=L.filter(E=>(E.category||"general").toLowerCase()===A)}return L},[m,o,l]),v=y.filter(L=>L.status&&L.status!=="completed"),b=y.filter(L=>L.status==="completed"),k=y,T=L=>{switch((L||"").toLowerCase()){case"beginner":return t.success;case"intermediate":return t.warning;case"advanced":return t.error;default:return t.textMuted}},_=(L,A)=>{const E=d===L.slug;return C.jsxs("div",{style:{...r.card,borderColor:A||t.border,transform:E?"translateY(-2px)":"none",boxShadow:E?`0 6px 20px ${t.bgPrimary}80`:"none"},onMouseEnter:()=>f(L.slug),onMouseLeave:()=>f(null),children:[C.jsxs("div",{style:r.cardHeader,children:[C.jsx("span",{style:r.cardIcon,children:L.icon||"📘"}),C.jsxs("div",{style:r.cardTitleWrap,children:[C.jsx("h4",{style:r.cardTitle,children:L.title||L.slug}),L.category&&C.jsx("span",{style:r.categoryBadge,children:L.category})]})]}),L.description&&C.jsx("p",{style:r.cardDescription,children:L.description}),C.jsxs("div",{style:r.cardFooter,children:[L.difficulty&&C.jsx("span",{style:{...r.difficultyBadge,color:T(L.difficulty),backgroundColor:`${T(L.difficulty)}18`},children:L.difficulty}),L.status==="completed"&&C.jsxs("span",{style:r.completedBadge,children:["✓"," Done"]}),L.status&&L.status!=="completed"&&L.walkthroughStep!=null&&C.jsxs("span",{style:r.progressBadge,children:["Step ",L.walkthroughStep,"/",L.totalSteps||"?"]}),L.xpEarned>0&&C.jsxs("span",{style:r.xpBadge,children:[L.xpEarned," XP"]})]})]},L.slug)};return C.jsxs("div",{style:r.container,children:[C.jsxs("div",{style:r.toolbar,children:[C.jsx("input",{type:"text",placeholder:"Search modules...",value:o,onChange:L=>c(L.target.value),style:r.searchInput}),C.jsx("div",{style:r.chips,children:_O.map(L=>C.jsx("button",{onClick:()=>h(L),style:{...r.chip,backgroundColor:l===L?t.accent:t.bgTertiary,color:l===L?t.bgPrimary:t.textSecondary,fontWeight:l===L?600:400},children:L},L))})]}),v.length>0&&C.jsxs("div",{style:r.section,children:[C.jsx("h3",{style:r.sectionTitle,children:"In Progress"}),C.jsx("div",{style:r.grid,children:v.map(L=>_(L,t.accent))})]}),b.length>0&&C.jsxs("div",{style:r.section,children:[C.jsx("h3",{style:r.sectionTitle,children:"Completed"}),C.jsx("div",{style:r.grid,children:b.map(L=>_(L,t.success))})]}),C.jsxs("div",{style:r.section,children:[C.jsx("h3",{style:r.sectionTitle,children:"All Modules"}),k.length>0?C.jsx("div",{style:r.grid,children:k.map(L=>_(L,null))}):C.jsxs("div",{style:r.emptyState,children:[C.jsx("span",{style:r.emptyIcon,children:"🔍"}),C.jsx("p",{style:r.emptyTitle,children:"No modules found"}),C.jsx("p",{style:r.emptySubtext,children:o?`No results for "${o}". Try a different search term.`:"No modules available in this category yet."})]})]})]})}function EO(e){return{container:{maxWidth:960,margin:"0 auto",display:"flex",flexDirection:"column",gap:28},toolbar:{display:"flex",flexDirection:"column",gap:12},searchInput:{width:"100%",padding:"10px 14px",fontSize:14,backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:8,color:e.textPrimary,outline:"none",boxSizing:"border-box"},chips:{display:"flex",gap:8,flexWrap:"wrap"},chip:{padding:"5px 14px",fontSize:13,border:"none",borderRadius:16,cursor:"pointer",transition:"background-color 0.15s ease, color 0.15s ease"},section:{display:"flex",flexDirection:"column",gap:12},sectionTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:0},grid:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:14},card:{padding:16,backgroundColor:e.bgSecondary,border:"1px solid",borderRadius:10,display:"flex",flexDirection:"column",gap:10,cursor:"default",transition:"transform 0.15s ease, box-shadow 0.15s ease"},cardHeader:{display:"flex",alignItems:"flex-start",gap:10},cardIcon:{fontSize:32,lineHeight:1,flexShrink:0},cardTitleWrap:{display:"flex",flexDirection:"column",gap:4,minWidth:0},cardTitle:{fontSize:14,fontWeight:600,color:e.textPrimary,margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},categoryBadge:{fontSize:11,color:e.textMuted,textTransform:"capitalize"},cardDescription:{fontSize:13,color:e.textSecondary,margin:0,lineHeight:1.4,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},cardFooter:{display:"flex",gap:8,flexWrap:"wrap",marginTop:"auto"},difficultyBadge:{fontSize:11,fontWeight:600,padding:"2px 8px",borderRadius:4,textTransform:"capitalize"},completedBadge:{fontSize:11,fontWeight:600,color:e.success,backgroundColor:`${e.success}18`,padding:"2px 8px",borderRadius:4},progressBadge:{fontSize:11,fontWeight:600,color:e.accent,backgroundColor:`${e.accent}18`,padding:"2px 8px",borderRadius:4},xpBadge:{fontSize:11,fontWeight:600,color:e.warning,backgroundColor:`${e.warning}18`,padding:"2px 8px",borderRadius:4},emptyState:{textAlign:"center",padding:"48px 24px",backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,borderRadius:12,display:"flex",flexDirection:"column",alignItems:"center",gap:8},emptyIcon:{fontSize:36,opacity:.4},emptyTitle:{fontSize:16,fontWeight:600,color:e.textPrimary,margin:0},emptySubtext:{fontSize:14,color:e.textSecondary,margin:0,maxWidth:320}}}const LO=["Appearance","Learning","Notifications","Connections","Data"],MO={Appearance:"✨",Learning:"📚",Notifications:"🔔",Connections:"🔗",Data:"💾"},BO=["beginner","intermediate","advanced"],AO=["gentle","standard","strict"],ew="http://localhost:3456/api/settings";function Mc(e){return fetch(ew,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).catch(()=>{})}function $O(){const{theme:e,preference:t,accentName:r,setThemePreference:n,setAccent:s}=lr(),o=F.useMemo(()=>RO(e),[e]),[c,l]=F.useState("Appearance"),[h,d]=F.useState(14),[f,g]=F.useState(!0),[m,y]=F.useState(!0),[v,b]=F.useState(!0),[k,T]=F.useState("intermediate"),[_,B]=F.useState(!0),[L,A]=F.useState("standard"),[E,$]=F.useState(!0),[z,Z]=F.useState(!0),[W,G]=F.useState(!1),[it]=F.useState("http://localhost:3456"),[rt,H]=F.useState("unknown"),[q,N]=F.useState("FULL"),[Y,P]=F.useState({modules:0,quizzes:0,xp:0}),[K,et]=F.useState(!1);F.useEffect(()=>{fetch(ew).then(X=>X.ok?X.json():null).then(X=>{X&&(X.fontSize&&d(X.fontSize),X.confetti!==void 0&&g(X.confetti),X.transitions!==void 0&&y(X.transitions),X.diagrams!==void 0&&b(X.diagrams),X.difficulty&&T(X.difficulty),X.quizTimer!==void 0&&B(X.quizTimer),X.strictness&&A(X.strictness),X.streakReminders!==void 0&&$(X.streakReminders),X.achievementPopups!==void 0&&Z(X.achievementPopups),X.soundEffects!==void 0&&G(X.soundEffects),X.extensionStatus&&H(X.extensionStatus),X.tier&&N(X.tier),X.history&&P(X.history))}).catch(()=>{})},[]);const I=F.useCallback(X=>{d(ft=>{const vt=Math.max(12,Math.min(18,ft+X));return Mc({fontSize:vt}),vt})},[]),tt=F.useCallback((X,ft)=>{X(vt=>(Mc({[ft]:!vt}),!vt))},[]),ct=F.useCallback(()=>{fetch("http://localhost:3456/api/progress").then(X=>X.json()).then(X=>{const ft=new Blob([JSON.stringify(X,null,2)],{type:"application/json"}),vt=document.createElement("a");vt.href=URL.createObjectURL(ft),vt.download="claudeteach-progress.json",vt.click()}).catch(()=>{})},[]),mt=F.useCallback(()=>{if(!K){et(!0);return}fetch("http://localhost:3456/api/progress",{method:"DELETE"}).then(()=>{P({modules:0,quizzes:0,xp:0}),et(!1)}).catch(()=>{})},[K]),dt=(X,ft,vt)=>C.jsxs("div",{style:o.toggleRow,children:[C.jsx("span",{style:o.toggleLabel,children:X}),C.jsx("button",{style:{...o.toggleTrack,background:ft?e.accent:e.bgTertiary},onClick:vt,children:C.jsx("span",{style:{...o.toggleThumb,transform:ft?"translateX(18px)":"translateX(2px)"}})})]}),ht=(X,ft,vt,Ft)=>C.jsxs("button",{onClick:vt,style:{...o.selectionCard,borderColor:ft?e.accent:e.border,background:ft?`${e.accent}12`:e.bgSecondary},children:[C.jsx("span",{style:{...o.cardLabel,color:ft?e.accent:e.textPrimary},children:X}),Ft&&C.jsx("span",{style:o.cardSub,children:Ft})]},X);return C.jsxs("div",{style:o.wrapper,children:[C.jsxs("nav",{style:o.sidebar,children:[C.jsx("h2",{style:o.sidebarTitle,children:"Settings"}),LO.map(X=>C.jsxs("button",{onClick:()=>l(X),style:{...o.tabBtn,background:c===X?`${e.accent}18`:"transparent",color:c===X?e.accent:e.textSecondary,borderLeft:c===X?`3px solid ${e.accent}`:"3px solid transparent"},children:[C.jsx("span",{style:o.tabIcon,children:MO[X]}),X]},X))]}),C.jsxs("main",{style:o.content,children:[c==="Appearance"&&C.jsxs(C.Fragment,{children:[C.jsx(Rr,{title:"Theme",s:o,children:C.jsx("div",{style:o.cardRow,children:["dark","light","system"].map(X=>ht(X.charAt(0).toUpperCase()+X.slice(1),t===X,()=>n(X),X==="dark"?"Easy on the eyes":X==="light"?"Bright & clean":"Match OS setting"))})}),C.jsx(Rr,{title:"Accent Color",s:o,children:C.jsx("div",{style:o.colorRow,children:Object.keys(Mi).map(X=>C.jsx("button",{onClick:()=>s(X),style:{...o.colorCircle,background:Mi[X][e.id]||Mi[X].dark,boxShadow:r===X?`0 0 0 3px ${e.bgPrimary}, 0 0 0 5px ${Mi[X][e.id]||Mi[X].dark}`:"none",transform:r===X?"scale(1.15)":"scale(1)"},title:X},X))})}),C.jsx(Rr,{title:"Font Size",s:o,children:C.jsxs("div",{style:o.fontRow,children:[C.jsx("button",{style:o.fontBtn,onClick:()=>I(-1),disabled:h<=12,children:"-"}),C.jsxs("span",{style:o.fontValue,children:[h,"px"]}),C.jsx("button",{style:o.fontBtn,onClick:()=>I(1),disabled:h>=18,children:"+"})]})}),C.jsxs(Rr,{title:"Animations",s:o,children:[dt("Confetti celebrations",f,()=>tt(g,"confetti")),dt("UI transitions",m,()=>tt(y,"transitions")),dt("Diagram animations",v,()=>tt(b,"diagrams"))]})]}),c==="Learning"&&C.jsxs(C.Fragment,{children:[C.jsx(Rr,{title:"Default Difficulty",s:o,children:C.jsx("select",{value:k,onChange:X=>{T(X.target.value),Mc({difficulty:X.target.value})},style:o.select,children:BO.map(X=>C.jsx("option",{value:X,children:X.charAt(0).toUpperCase()+X.slice(1)},X))})}),C.jsx(Rr,{title:"Quiz Timer",s:o,children:dt("Enable countdown timer on quizzes",_,()=>tt(B,"quizTimer"))}),C.jsx(Rr,{title:"Socratic Strictness",s:o,children:C.jsx("div",{style:o.cardRow,children:AO.map(X=>ht(X.charAt(0).toUpperCase()+X.slice(1),L===X,()=>{A(X),Mc({strictness:X})},X==="gentle"?"More hints & guidance":X==="standard"?"Balanced approach":"Minimal hand-holding"))})})]}),c==="Notifications"&&C.jsx(C.Fragment,{children:C.jsxs(Rr,{title:"Alerts",s:o,children:[dt("Streak reminders",E,()=>tt($,"streakReminders")),dt("Achievement popups",z,()=>tt(Z,"achievementPopups")),dt("Sound effects",W,()=>tt(G,"soundEffects"))]})}),c==="Connections"&&C.jsxs(C.Fragment,{children:[C.jsx(Rr,{title:"Bridge Server",s:o,children:C.jsxs("div",{style:o.infoRow,children:[C.jsx("span",{style:o.infoLabel,children:"URL"}),C.jsx("span",{style:o.infoValue,children:it})]})}),C.jsx(Rr,{title:"Extension",s:o,children:C.jsxs("div",{style:o.infoRow,children:[C.jsx("span",{style:o.infoLabel,children:"Status"}),C.jsx("span",{style:{...o.statusBadge,background:rt==="connected"?`${e.success}22`:`${e.warning}22`,color:rt==="connected"?e.success:e.warning},children:rt==="connected"?"Connected":rt==="unknown"?"Checking...":"Disconnected"})]})}),C.jsx(Rr,{title:"Tier",s:o,children:C.jsxs("div",{style:o.infoRow,children:[C.jsx("span",{style:o.infoLabel,children:"Enhancement level"}),C.jsx("span",{style:{...o.statusBadge,background:`${e.accent}22`,color:e.accent},children:q})]})})]}),c==="Data"&&C.jsxs(C.Fragment,{children:[C.jsx(Rr,{title:"Learning History",s:o,children:C.jsxs("div",{style:o.statGrid,children:[C.jsxs("div",{style:o.statCell,children:[C.jsx("span",{style:o.statNum,children:Y.modules}),C.jsx("span",{style:o.statLabel,children:"Modules"})]}),C.jsxs("div",{style:o.statCell,children:[C.jsx("span",{style:o.statNum,children:Y.quizzes}),C.jsx("span",{style:o.statLabel,children:"Quizzes"})]}),C.jsxs("div",{style:o.statCell,children:[C.jsx("span",{style:o.statNum,children:Y.xp}),C.jsx("span",{style:o.statLabel,children:"Total XP"})]})]})}),C.jsxs(Rr,{title:"Export & Reset",s:o,children:[C.jsxs("div",{style:o.btnRow,children:[C.jsx("button",{style:o.primaryBtn,onClick:ct,children:"Export Progress"}),C.jsx("button",{style:{...o.dangerBtn,background:K?e.error:"transparent"},onClick:mt,children:K?"Confirm Reset":"Reset Progress"})]}),K&&C.jsx("p",{style:o.warnText,children:"This will permanently erase all progress. Click again to confirm."})]})]})]})]})}function Rr({title:e,s:t,children:r}){return C.jsxs("div",{style:t.section,children:[C.jsx("h3",{style:t.sectionTitle,children:e}),r]})}function RO(e){return{wrapper:{display:"flex",height:"100%",minHeight:0,background:e.bgPrimary,color:e.textPrimary},sidebar:{width:220,minWidth:220,background:e.bgSecondary,borderRight:`1px solid ${e.border}`,padding:"24px 0",display:"flex",flexDirection:"column",gap:2},sidebarTitle:{fontSize:18,fontWeight:700,color:e.textBright,padding:"0 20px 16px",margin:0,letterSpacing:"-0.02em"},tabBtn:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"10px 20px",border:"none",cursor:"pointer",fontSize:14,fontWeight:500,fontFamily:"inherit",textAlign:"left",transition:"all 0.15s"},tabIcon:{fontSize:16,width:22,textAlign:"center"},content:{flex:1,overflow:"auto",padding:"32px 40px",display:"flex",flexDirection:"column",gap:8},section:{marginBottom:24},sectionTitle:{fontSize:13,fontWeight:600,color:e.textSecondary,textTransform:"uppercase",letterSpacing:"0.06em",margin:"0 0 12px"},cardRow:{display:"flex",gap:12},selectionCard:{flex:1,padding:"14px 16px",borderRadius:10,border:"2px solid",cursor:"pointer",background:"none",fontFamily:"inherit",textAlign:"left",transition:"all 0.15s",display:"flex",flexDirection:"column",gap:4},cardLabel:{fontSize:14,fontWeight:600},cardSub:{fontSize:12,color:e.textMuted},colorRow:{display:"flex",gap:14,alignItems:"center"},colorCircle:{width:32,height:32,borderRadius:"50%",border:"none",cursor:"pointer",transition:"all 0.2s"},fontRow:{display:"flex",alignItems:"center",gap:16},fontBtn:{width:36,height:36,borderRadius:8,border:`1px solid ${e.border}`,background:e.bgSecondary,color:e.textPrimary,fontSize:18,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit"},fontValue:{fontSize:16,fontWeight:600,color:e.textBright,minWidth:48,textAlign:"center"},toggleRow:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0"},toggleLabel:{fontSize:14,color:e.textPrimary},toggleTrack:{width:42,height:24,borderRadius:12,border:"none",cursor:"pointer",position:"relative",transition:"background 0.2s",padding:0},toggleThumb:{width:20,height:20,borderRadius:"50%",background:"#fff",position:"absolute",top:2,transition:"transform 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.3)"},select:{padding:"8px 12px",borderRadius:8,border:`1px solid ${e.border}`,background:e.bgSecondary,color:e.textPrimary,fontSize:14,fontFamily:"inherit",cursor:"pointer",minWidth:200},infoRow:{display:"flex",alignItems:"center",gap:12,padding:"8px 0"},infoLabel:{fontSize:13,color:e.textSecondary,minWidth:120},infoValue:{fontSize:14,color:e.textPrimary,fontFamily:"monospace",background:e.bgTertiary,padding:"4px 10px",borderRadius:6},statusBadge:{fontSize:13,fontWeight:600,padding:"4px 12px",borderRadius:20},statGrid:{display:"flex",gap:16},statCell:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",gap:4,padding:16,background:e.bgSecondary,borderRadius:10,border:`1px solid ${e.border}`},statNum:{fontSize:24,fontWeight:700,color:e.textBright},statLabel:{fontSize:12,color:e.textSecondary},btnRow:{display:"flex",gap:12},primaryBtn:{padding:"10px 20px",borderRadius:8,border:"none",background:e.accent,color:"#fff",fontSize:14,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},dangerBtn:{padding:"10px 20px",borderRadius:8,border:`1px solid ${e.error}`,color:e.error,fontSize:14,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},warnText:{fontSize:13,color:e.error,marginTop:8}}}const qt={dashboard:"dashboard",canvas:"canvas",quiz:"quiz",playground:"playground",terminal:"terminal",game:"game",html:"html",modules:"modules",achievements:"achievements",settings:"settings"},xe={chat:"chat",visual:"visual",immersive:"immersive"};function FO(e,t){if(e===xe.chat)return"100%";if(e===xe.immersive)return"0%";switch(t){case qt.quiz:return"20%";case qt.playground:case qt.terminal:case qt.canvas:case qt.settings:return"25%";case qt.achievements:return"30%";default:return"35%"}}const IO=new Set([qt.terminal,qt.playground,qt.game,qt.settings,qt.achievements,qt.modules]),Mu=[{name:"White",minXP:0,badge:"⬜",color:"#e6e6e6"},{name:"Yellow",minXP:50,badge:"🟨",color:"#f0c040"},{name:"Green",minXP:150,badge:"🟩",color:"#3fb950"},{name:"Blue",minXP:400,badge:"🟦",color:"#58a6ff"},{name:"Purple",minXP:800,badge:"🟪",color:"#bc8cff"},{name:"Brown",minXP:1500,badge:"🟫",color:"#a0522d"},{name:"Black",minXP:3e3,badge:"⬛",color:"#484f58"}];function hf(e){let t=Mu[0];for(const r of Mu)e>=r.minXP&&(t=r);return t}function PO(e){for(const t of Mu)if(e<t.minXP)return t;return null}function DO(){var nn;const{theme:e}=lr(),[t,r]=F.useState(xe.chat),[n,s]=F.useState("home"),[o,c]=F.useState(null),[l,h]=F.useState(null),[d,f]=F.useState(null),[g,m]=F.useState(null),[y,v]=F.useState(null),[b,k]=F.useState(null),[T,_]=F.useState(null),[B,L]=F.useState(null),[A,E]=F.useState(null),[$,z]=F.useState(null),[Z,W]=F.useState(0),[G,it]=F.useState([]),[rt,H]=F.useState(""),[q,N]=F.useState([]),[Y,P]=F.useState("idle"),[K,et]=F.useState(null),[I,tt]=F.useState([]),[ct,mt]=F.useState(null),dt=F.useRef(""),ht=F.useRef([]),X=F.useRef(!1),ft=F.useRef(null),vt=F.useRef(!1),Ft=F.useCallback(pt=>{c(pt),pt===qt.game?r(xe.immersive):r(xe.visual)},[]),ie=F.useCallback(()=>{c(null),r(xe.chat),s(null)},[]),ze=F.useCallback(()=>{r(xe.visual)},[]),ee=F.useCallback(()=>{ft.current&&clearTimeout(ft.current),ft.current=setTimeout(()=>{c(pt=>IO.has(pt)?pt:qt.dashboard),r(xe.visual),s("home")},6e4)},[]),cr=F.useCallback(pt=>{switch(s(pt),pt){case"home":c(qt.dashboard),r(xe.visual);break;case"modules":c(qt.modules),r(xe.visual);break;case"achievements":c(qt.achievements),r(xe.visual);break;case"settings":c(qt.settings),r(xe.visual);break}ee()},[ee]),Dr=F.useCallback(pt=>{var re,Nr,kr,Fe,Ne,_r,dr,Tn,sn,fr,an,on,Ni,Wi;if(!(!pt||!pt.type)){switch(pt.type){case"canvas:dashboard":h(pt.payload),Ft(qt.dashboard),s("home"),ee();break;case"canvas:diagram":f(pt.payload),Ft(qt.canvas),s(null),ee();break;case"canvas:quiz":m(pt.payload),Ft(qt.quiz),s(null),ee();break;case"canvas:code":v(pt.payload),Ft(qt.playground),s(null),ee();break;case"canvas:terminal":k(pt.payload),Ft(qt.terminal),s(null),ee();break;case"canvas:game":_(pt.payload),Ft(qt.game),s(null);break;case"canvas:html":L(pt.payload),Ft(qt.html),s(null),ee();break;case"canvas:celebrate":E(pt.payload),t===xe.immersive&&(r(xe.visual),c(qt.dashboard),s("home")),setTimeout(()=>E(null),5e3);break;case"chat:stream":dt.current+=((re=pt.payload)==null?void 0:re.delta)||"",H(dt.current),P("streaming");break;case"chat:assistant":{const Kt=((Nr=pt.payload)==null?void 0:Nr.text)||dt.current;Kt&&it(de=>{const Me=de[de.length-1];return Me&&Me.role==="assistant"&&Me._pending?[...de.slice(0,-1),{role:"assistant",text:Kt,tools:Me.tools}]:[...de,{role:"assistant",text:Kt,tools:[]}]}),dt.current="",H("");break}case"chat:tool-use":{const Kt={toolName:(kr=pt.payload)==null?void 0:kr.toolName,toolId:(Fe=pt.payload)==null?void 0:Fe.toolId,input:(Ne=pt.payload)==null?void 0:Ne.input};ht.current=[...ht.current,Kt],N(ht.current);break}case"chat:tool-result":{const Kt=(_r=pt.payload)==null?void 0:_r.toolId;ht.current=ht.current.map(de=>{var Me;return de.toolId===Kt?{...de,output:(Me=pt.payload)==null?void 0:Me.output}:de}),N(ht.current),it(de=>{const Me=de[de.length-1];if(Me&&Me.role==="assistant"){const ai=ht.current.find(Tr=>Tr.toolId===Kt);if(ai){const Tr=[...Me.tools||[],ai];return[...de.slice(0,-1),{...Me,tools:Tr}]}}return de});break}case"chat:status":P(((dr=pt.payload)==null?void 0:dr.status)||"idle"),(Tn=pt.payload)!=null&&Tn.sessionId&&et(pt.payload.sessionId),((sn=pt.payload)==null?void 0:sn.status)==="idle"&&(ht.current=[],N([]),dt.current="",H("")),((fr=pt.payload)==null?void 0:fr.status)==="error"&&mt(pt.payload.message),(((an=pt.payload)==null?void 0:an.status)==="started"||((on=pt.payload)==null?void 0:on.status)==="resumed")&&mt(null);break;case"event:game-result":r(xe.visual),c(qt.dashboard),s("home"),ee();break}(Ni=pt.payload)!=null&&Ni.module&&z(pt.payload.module),((Wi=pt.payload)==null?void 0:Wi.streak)!==void 0&&W(pt.payload.streak)}},[Ft,ee,t]),{status:tn,clientId:Je,sendEvent:ur,sendChatMessage:Or,stopChatGeneration:zr}=r_(Dr),en=F.useCallback(pt=>{it(re=>[...re,{role:"user",text:pt}]),dt.current="",H(""),(!K||K==="pending")&&!X.current?(X.current=!0,fetch("http://localhost:3456/api/chat/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:Je})}).then(re=>{if(!re.ok)throw new Error(`Session start failed (${re.status})`);return re.json()}).then(re=>{X.current=!1,re.sessionId?(et(re.sessionId),Or(pt,re.sessionId)):mt("Failed to create chat session — no session ID returned.")}).catch(re=>{X.current=!1,mt(re.message||"Failed to connect to Claude. Is the bridge server running?")})):K==="pending"?mt("Connecting to Claude... please try again in a moment."):Or(pt,K)},[K,Je,Or]),jr=F.useCallback(()=>{it([]),H(""),ht.current=[],N([]),P("idle"),et(null),mt(null),dt.current="",X.current=!1},[]),Ts=F.useCallback(pt=>{jr(),fetch("http://localhost:3456/api/chat/resume",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:pt,clientId:Je})}).then(re=>re.json()).then(re=>{re.sessionId&&et(re.sessionId)}).catch(()=>{})},[jr,Je]);F.useEffect(()=>{tn!=="connected"||!Je||K||X.current||(X.current=!0,fetch("http://localhost:3456/api/chat/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:Je})}).then(pt=>{if(!pt.ok)throw new Error(`Session start failed (${pt.status})`);return pt.json()}).then(pt=>{X.current=!1,et(pt.sessionId||"pending")}).catch(()=>{X.current=!1,et("pending")}),vt.current||(vt.current=!0,fetch("http://localhost:3456/api/progress").then(pt=>pt.ok?pt.json():null).then(pt=>{var kr,Fe,Ne,_r;if(!pt)return;const re=Object.entries(pt.modules||{}).map(([dr,Tn])=>({slug:dr,...Tn})),Nr={progress:{xp:((kr=pt.user)==null?void 0:kr.xp)||0,belt:(Fe=pt.user)==null?void 0:Fe.belt,modules:re,streak:((Ne=pt.user)==null?void 0:Ne.streak)||0,completedCount:re.filter(dr=>dr.status==="completed").length,totalCount:re.length},achievements:pt.achievements||{unlocked:[],near:[]}};h(Nr),c(qt.dashboard),r(xe.visual),s("home"),(_r=pt.user)!=null&&_r.streak&&W(pt.user.streak)}).catch(()=>{})))},[tn,Je,K]),F.useEffect(()=>{tn==="connected"&&fetch("http://localhost:3456/api/chat/sessions").then(pt=>pt.json()).then(pt=>{pt.sessions&&tt(pt.sessions)}).catch(()=>{})},[tn]),F.useEffect(()=>()=>{ft.current&&clearTimeout(ft.current)},[]);const Wn=((nn=l==null?void 0:l.progress)==null?void 0:nn.xp)??0,kn=hf(Wn),rn=FO(t,o),je=t!==xe.chat,_n=t!==xe.immersive,hr=F.useMemo(()=>OO(e),[e]);return C.jsxs("div",{style:hr.container,children:[C.jsx(ND,{activeNav:n,onNavClick:cr,belt:kn,xp:Wn,streak:Z,onNewChat:jr}),ct&&C.jsxs("div",{style:hr.errorBanner,children:[C.jsxs("span",{children:["Connection to Claude lost: ",ct]}),C.jsx("button",{style:hr.reconnectButton,onClick:()=>{mt(null),jr()},children:"Reconnect"})]}),C.jsxs("div",{style:hr.splitPane,children:[_n&&C.jsx("div",{style:{...hr.chatPane,width:rn},children:C.jsx(pT,{messages:G,streamingText:rt,tools:q,chatStatus:Y,onSend:en,onStop:zr,onNewChat:jr,onResume:Ts,sessions:I,sessionId:K,compact:t===xe.visual&&["quiz","playground","terminal","canvas","settings"].includes(o)})}),je&&C.jsxs("div",{style:hr.visualPane,children:[t!==xe.immersive&&C.jsx("button",{style:hr.closeVisual,onClick:ie,children:"✕"}),C.jsxs("div",{style:hr.visualContent,children:[o===qt.dashboard&&C.jsx(mT,{data:l,getBelt:hf,getNextBelt:PO,BELTS:Mu}),o===qt.canvas&&C.jsx(hD,{data:d}),o===qt.quiz&&C.jsx(fD,{data:g,sendEvent:ur}),o===qt.playground&&C.jsx(bD,{data:y,sendEvent:ur}),o===qt.terminal&&C.jsx(kD,{data:b,sendEvent:ur}),o===qt.game&&C.jsx(AD,{data:T,sendEvent:ur}),o===qt.html&&C.jsx(MD,{data:B}),o===qt.modules&&C.jsx(TO,{data:l}),o===qt.achievements&&C.jsx(wO,{data:l}),o===qt.settings&&C.jsx($O,{})]})]})]}),t===xe.immersive&&C.jsx(HD,{onClick:ze}),A&&C.jsx(ED,{data:A,getBelt:hf})]})}function OO(e){return{container:{display:"flex",flexDirection:"column",height:"100vh",backgroundColor:e.bgPrimary,color:e.textPrimary},errorBanner:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 20px",backgroundColor:e.errorBg,borderBottom:`1px solid ${e.error}`,fontSize:13,color:e.error,flexShrink:0},reconnectButton:{padding:"4px 12px",fontSize:12,color:"#fff",backgroundColor:e.errorButton,border:"none",borderRadius:6,cursor:"pointer"},splitPane:{display:"flex",flex:1,overflow:"hidden"},chatPane:{display:"flex",flexDirection:"column",transition:"width 0.3s ease, opacity 0.3s ease",borderRight:`1px solid ${e.border}`,minWidth:0,overflow:"hidden"},visualPane:{flex:1,display:"flex",flexDirection:"column",position:"relative",minWidth:0,overflow:"hidden"},closeVisual:{position:"absolute",top:8,right:8,zIndex:10,width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,color:e.textSecondary,backgroundColor:e.bgTertiary,border:`1px solid ${e.border}`,borderRadius:6,cursor:"pointer"},visualContent:{flex:1,overflow:"auto",padding:24},placeholder:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:12,color:e.textPrimary}}}Jk.createRoot(document.getElementById("root")).render(C.jsx(Gk.StrictMode,{children:C.jsx(l_,{children:C.jsx(DO,{})})}));export{g1 as $,Io as A,TT as B,TE as C,ig as D,a1 as E,Xe as F,n5 as G,sA as H,h0 as I,h3 as J,NT as K,pa as L,VO as M,Yu as N,aE as O,wp as P,g0 as Q,QB as R,zc as S,r5 as T,tl as U,pE as V,Jo as W,Ct as X,$t as Y,YR as Z,w as _,bE as a,SR as a$,GB as a0,I0 as a1,F0 as a2,i6 as a3,JO as a4,r6 as a5,e6 as a6,KO as a7,Pp as a8,n6 as a9,qR as aA,P$ as aB,DR as aC,Xp as aD,Lx as aE,F5 as aF,VB as aG,GO as aH,up as aI,al as aJ,$5 as aK,A5 as aL,F as aM,Gk as aN,$p as aO,Li as aP,No as aQ,L0 as aR,TM as aS,Cs as aT,UR as aU,i2 as aV,Hu as aW,Vu as aX,bu as aY,a2 as aZ,n2 as a_,ZO as aa,Ks as ab,a6 as ac,s6 as ad,t6 as ae,s4 as af,nC as ag,h6 as ah,f3 as ai,Le as aj,Oi as ak,Yp as al,M2 as am,_s as an,d2 as ao,jt as ap,On as aq,Q4 as ar,u6 as as,d6 as at,l6 as au,Lt as av,c6 as aw,$4 as ax,E4 as ay,T4 as az,vE as b,Tt as b0,Gb as b1,wr as b2,vM as b3,Ap as b4,M1 as b5,rl as b6,$1 as b7,QO as b8,_T as b9,Zp as bA,Jb as bB,ap as bC,GR as bD,Gu as bE,jO as bF,Zt as bG,HR as ba,PR as bb,w$ as bc,Qp as bd,yR as be,VR as bf,sl as bg,wa as bh,yu as bi,LR as bj,vF as bk,il as bl,vu as bm,CR as bn,Kb as bo,T$ as bp,E$ as bq,as as br,ex as bs,L$ as bt,Kp as bu,_$ as bv,A$ as bw,ka as bx,Di as by,Q0 as bz,Jt as c,Gt as d,p1 as e,Te as f,CE as g,ii as h,Zr as i,v3 as j,Sa as k,nt as l,p2 as m,YO as n,p6 as o,wE as p,kE as q,f6 as r,SE as s,d3 as t,bn as u,w4 as v,a5 as w,o6 as x,xE as y,XO as z};