hermium 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/hermium.mjs +6 -5
- package/dist/public/assets/{IconAlertCircle-B7TgWpbP.js → IconAlertCircle-BHkmI3j7.js} +1 -1
- package/dist/public/assets/{IconAlertTriangle-B7IYa46Q.js → IconAlertTriangle-wCJudlVg.js} +1 -1
- package/dist/public/assets/{IconCheck-B-_pWgtP.js → IconCheck-CFuEh_p7.js} +1 -1
- package/dist/public/assets/{IconLoader2-ClSf33Yd.js → IconLoader2-BIx3OuF9.js} +1 -1
- package/dist/public/assets/{IconRefresh-D4MZeezY.js → IconRefresh-Dgm93w3T.js} +1 -1
- package/dist/public/assets/index-Bbz3abmO.js +14 -0
- package/dist/public/assets/index-CWUaRwcE.js +1 -0
- package/dist/public/assets/index-CinLq3cd.js +1 -0
- package/dist/public/assets/{index-D04H-m2p.js → index-CrQs9n6q.js} +1 -1
- package/dist/public/assets/{index-DmUrSr_K.js → index-CtacpN3I.js} +1 -1
- package/dist/public/assets/{index-CsJLc3b2.js → index-DY7aE-9s.js} +1 -1
- package/dist/public/assets/index-DkYGodJj.js +94 -0
- package/dist/public/assets/{index-B-EALIKE.js → index-DvDLadUx.js} +1 -1
- package/dist/public/assets/index-U6RcWedt.js +1 -0
- package/dist/public/assets/index-_6iFZ0fh.js +1 -0
- package/dist/public/assets/index-enFS26SU.js +1 -0
- package/dist/public/assets/input-eNcwlDHp.js +1 -0
- package/dist/public/assets/queries-iHRgZzw2.js +1 -0
- package/dist/public/assets/styles-KcflDlA_.css +1 -0
- package/dist/public/assets/{switch-CgWk9YD3.js → switch-B1DcZLwL.js} +1 -1
- package/dist/public/assets/{syntax-highlighter-CR5pD3DZ.js → syntax-highlighter-DWPF-A_h.js} +2 -2
- package/dist/public/assets/textarea-Di_syYTS.js +1 -0
- package/dist/server/index.mjs +152 -147
- package/dist/web-server/_libs/tabler__icons-react.mjs +171 -165
- package/dist/web-server/_ssr/{index-wTy_4MhH.mjs → index-0n2Z3BPQ.mjs} +2 -2
- package/dist/web-server/_ssr/{index-DqFrn6kj.mjs → index-6itDALOw.mjs} +90 -29
- package/dist/web-server/_ssr/{index-DSIu0x-q.mjs → index-BIRTrOmp.mjs} +3 -3
- package/dist/web-server/_ssr/{index-Bp9a_nTf.mjs → index-BPzfADac.mjs} +1 -1
- package/dist/web-server/_ssr/{index-BkkxTg0a.mjs → index-BQE3bF14.mjs} +50 -35
- package/dist/web-server/_ssr/index-C5HpvlUP.mjs +190 -0
- package/dist/web-server/_ssr/{index-JzLhPyir.mjs → index-C_ZxnypN.mjs} +2 -2
- package/dist/web-server/_ssr/{index-BLK6uN4p.mjs → index-Ca8JFH8f.mjs} +4 -4
- package/dist/web-server/_ssr/{index-C8t8AZQG.mjs → index-DNVESZiA.mjs} +4 -4
- package/dist/web-server/_ssr/index.mjs +2 -2
- package/dist/web-server/_ssr/{input-BQFduUUo.mjs → input-CqXjTRQg.mjs} +1 -1
- package/dist/web-server/_ssr/queries-3H_19mUt.mjs +16 -0
- package/dist/web-server/_ssr/{router-59cN5lqo.mjs → router-sbsNus0Y.mjs} +186 -91
- package/dist/web-server/_ssr/{switch-Bim4kX8N.mjs → switch-usf2F1UM.mjs} +1 -1
- package/dist/web-server/_ssr/{textarea-CK0ROhfF.mjs → textarea-DfRheWY0.mjs} +1 -1
- package/dist/web-server/_tanstack-start-manifest_v-DqW-pKEH.mjs +4 -0
- package/dist/web-server/index.mjs +147 -161
- package/package.json +1 -1
- package/dist/public/assets/IconCode-AzDguzgN.js +0 -1
- package/dist/public/assets/IconPlus-BcEAWT5L.js +0 -1
- package/dist/public/assets/index-BP5217kc.js +0 -1
- package/dist/public/assets/index-BiFHsDt6.js +0 -1
- package/dist/public/assets/index-BuznEPrX.js +0 -1
- package/dist/public/assets/index-DEVyhUPW.js +0 -14
- package/dist/public/assets/index-DKYPj90W.js +0 -90
- package/dist/public/assets/index-D_8SzN4W.js +0 -1
- package/dist/public/assets/index-xH6PhxmS.js +0 -1
- package/dist/public/assets/input-of658hyw.js +0 -1
- package/dist/public/assets/styles-C9Ypt703.css +0 -1
- package/dist/public/assets/textarea-xdRt6_lX.js +0 -1
- package/dist/public/assets/useQuery-BtGwEPDz.js +0 -1
- package/dist/web-server/_ssr/index-EKE8NFy_.mjs +0 -189
- package/dist/web-server/_tanstack-start-manifest_v-DLw6M7p4.mjs +0 -4
package/bin/hermium.mjs
CHANGED
|
@@ -19,8 +19,8 @@ const API_PID_FILE = join(WEB_UI_HOME, 'api.pid')
|
|
|
19
19
|
const WEB_PID_FILE = join(WEB_UI_HOME, 'web.pid')
|
|
20
20
|
const API_LOG_FILE = join(WEB_UI_HOME, 'api.log')
|
|
21
21
|
const WEB_LOG_FILE = join(WEB_UI_HOME, 'web.log')
|
|
22
|
-
const DEFAULT_API_PORT =
|
|
23
|
-
const DEFAULT_WEB_PORT =
|
|
22
|
+
const DEFAULT_API_PORT = 47474
|
|
23
|
+
const DEFAULT_WEB_PORT = 42424
|
|
24
24
|
|
|
25
25
|
// ─── Runtime detection ─────────────────────────────────────────────────────
|
|
26
26
|
|
|
@@ -243,6 +243,7 @@ async function cmdStart() {
|
|
|
243
243
|
env: {
|
|
244
244
|
HERMIUM_PORT: String(apiPort),
|
|
245
245
|
HERMIUM_WEB_PORT: String(webPort),
|
|
246
|
+
HERMIUM_VERSION: CURRENT_VERSION,
|
|
246
247
|
WEB_STATIC_DIR: resolve(pkgDir, 'dist', 'public'),
|
|
247
248
|
},
|
|
248
249
|
})
|
|
@@ -351,12 +352,12 @@ ${pc.bold('Commands:')}
|
|
|
351
352
|
help Show this help message
|
|
352
353
|
|
|
353
354
|
${pc.bold('Options:')}
|
|
354
|
-
--port <n> API port (default:
|
|
355
|
-
--web-port <n> Web port (default:
|
|
355
|
+
--port <n> API port (default: 47474)
|
|
356
|
+
--web-port <n> Web port (default: 42424)
|
|
356
357
|
|
|
357
358
|
${pc.bold('Examples:')}
|
|
358
359
|
hermium start
|
|
359
|
-
hermium start --port
|
|
360
|
+
hermium start --port 47474 --web-port 42424
|
|
360
361
|
hermium stop
|
|
361
362
|
hermium status
|
|
362
363
|
`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./index-
|
|
1
|
+
import{c as e}from"./index-DkYGodJj.js";const t=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],o=e("outline","alert-circle","AlertCircle",t);export{o as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./index-
|
|
1
|
+
import{c as e}from"./index-DkYGodJj.js";const t=[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],o=e("outline","alert-triangle","AlertTriangle",t);export{o as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./index-
|
|
1
|
+
import{c}from"./index-DkYGodJj.js";const e=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],t=c("outline","check","Check",e);export{t as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o}from"./index-
|
|
1
|
+
import{c as o}from"./index-DkYGodJj.js";const e=[["path",{d:"M12 3a9 9 0 1 0 9 9",key:"svg-0"}]],t=o("outline","loader-2","Loader2",e);export{t as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./index-
|
|
1
|
+
import{c as e}from"./index-DkYGodJj.js";const o=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],s=e("outline","refresh","Refresh",o);export{s as I};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/syntax-highlighter-DWPF-A_h.js","assets/index-DkYGodJj.js","assets/index-CrQs9n6q.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as z,V as Ee,r as l,j as e,d as _,m as fe,a as Le,B as I,D as he,e as ge,f as xe,g as K,u as be,v as w,E as te,W as $e,I as Te,X as Ie,Y as Oe,l as ve,Z as ye,_ as Pe,b as se,$ as Ue,a0 as He}from"./index-DkYGodJj.js";import{T as Fe,I as We,a as Be,b as G}from"./textarea-Di_syYTS.js";import{u as Je,a as Ke,b as Ve,I as Ge}from"./queries-iHRgZzw2.js";import{I as F}from"./IconLoader2-BIx3OuF9.js";import{M as qe,r as Xe}from"./index-CrQs9n6q.js";import{I as B}from"./IconCheck-CFuEh_p7.js";import{I as Qe}from"./IconAlertTriangle-wCJudlVg.js";const Ye=[["path",{d:"M10 5a2 2 0 1 1 4 0a7 7 0 0 1 4 6v3a4 4 0 0 0 2 3h-16a4 4 0 0 0 2 -3v-3a7 7 0 0 1 4 -6",key:"svg-0"}],["path",{d:"M9 17v1a3 3 0 0 0 6 0v-1",key:"svg-1"}]],Ze=z("outline","bell","Bell",Ye);const et=[["path",{d:"M4 19l16 0",key:"svg-0"}],["path",{d:"M4 15l4 -6l4 2l4 -5l4 4",key:"svg-1"}]],tt=z("outline","chart-line","ChartLine",et);const st=[["path",{d:"M7 9a2 2 0 1 1 2 -2v10a2 2 0 1 1 -2 -2h10a2 2 0 1 1 -2 2v-10a2 2 0 1 1 2 2h-10",key:"svg-0"}]],nt=z("outline","command","Command",st);const rt=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}]],at=z("outline","file","File",rt);const ot=[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}]],it=z("outline","mail","Mail",ot);const lt=[["path",{d:"M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5",key:"svg-0"}]],ct=z("outline","paperclip","Paperclip",lt);const dt=[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]],ut=z("outline","photo","Photo",dt);const mt=[["path",{d:"M5 7a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2l0 -10",key:"svg-0"}]],pt=z("outline","player-stop","PlayerStop",mt);const ft=[["path",{d:"M11.46 20.846a12 12 0 0 1 -7.96 -14.846a12 12 0 0 0 8.5 -3a12 12 0 0 0 8.5 3a12 12 0 0 1 -.09 7.06",key:"svg-0"}],["path",{d:"M15 19l2 2l4 -4",key:"svg-1"}]],ne=z("outline","shield-check","ShieldCheck",ft),re=t=>Symbol.iterator in t,ae=t=>"entries"in t,oe=(t,s)=>{const n=t instanceof Map?t:new Map(t.entries()),a=s instanceof Map?s:new Map(s.entries());if(n.size!==a.size)return!1;for(const[o,i]of n)if(!a.has(o)||!Object.is(i,a.get(o)))return!1;return!0},ht=(t,s)=>{const n=t[Symbol.iterator](),a=s[Symbol.iterator]();let o=n.next(),i=a.next();for(;!o.done&&!i.done;){if(!Object.is(o.value,i.value))return!1;o=n.next(),i=a.next()}return!!o.done&&!!i.done};function gt(t,s){return Object.is(t,s)?!0:typeof t!="object"||t===null||typeof s!="object"||s===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(s)?!1:re(t)&&re(s)?ae(t)&&ae(s)?oe(t,s):ht(t,s):oe({entries:()=>Object.entries(t)},{entries:()=>Object.entries(s)})}function ie(t){const s=Ee.useRef(void 0);return n=>{const a=t(n);return gt(s.current,a)?s.current:s.current=a}}function xt(t){return t.nativeEvent?.isComposing===!0}const q=[{name:"/new",description:"Start a new chat",category:"chat",local:!0},{name:"/clear",description:"Clear conversation history",category:"chat",local:!0},{name:"/btw",description:"Ask a side question without affecting context",category:"agent"},{name:"/approve",description:"Approve a pending action",category:"agent"},{name:"/deny",description:"Deny a pending action",category:"agent"},{name:"/status",description:"Show current agent status",category:"agent"},{name:"/reset",description:"Reset conversation context",category:"agent"},{name:"/compact",description:"Compact and summarize the conversation",category:"agent"},{name:"/undo",description:"Undo the last action",category:"agent"},{name:"/retry",description:"Retry the last failed action",category:"agent"},{name:"/compress",description:"Compress conversation with optional focus topic",category:"agent"},{name:"/debug",description:"Show diagnostics and debug info",category:"agent"},{name:"/goal",description:"Lock the agent onto a persistent cross-turn goal",category:"agent"},{name:"/steer",description:"Steer the in-flight agent without interrupting it",category:"agent"},{name:"/queue",description:"Queue a follow-up to run after the current turn",category:"agent"},{name:"/web",description:"Search the web",category:"tools"},{name:"/image",description:"Generate an image",category:"tools"},{name:"/browse",description:"Browse a URL",category:"tools"},{name:"/code",description:"Write or execute code",category:"tools"},{name:"/file",description:"Read or write files",category:"tools"},{name:"/shell",description:"Run a shell command",category:"tools"},{name:"/help",description:"Show available commands and help",category:"info",local:!0},{name:"/model",description:"Show or switch the current model",category:"info",local:!0},{name:"/memory",description:"Show agent memory",category:"info",local:!0},{name:"/persona",description:"Show current persona",category:"info",local:!0},{name:"/version",description:"Show Hermes version",category:"info",local:!0},{name:"/usage",description:"Show token usage and cost",category:"info",local:!0},{name:"/tools",description:"List available tools",category:"info",local:!0},{name:"/skills",description:"List installed skills",category:"info",local:!0}];function bt(t){if(!t.startsWith("/"))return!1;const s=t.split(/\s+/)[0].toLowerCase();return q.some(n=>n.name===s&&n.local)}function vt({currentInput:t,applyText:s}){const[n,a]=l.useState([]),o=l.useRef(-1),i=l.useRef(""),c=l.useCallback(y=>{a(j=>[...j,y]),o.current=-1,i.current=""},[]),x=l.useCallback(()=>{if(n.length===0)return!1;const y=o.current,j=y===-1?n.length-1:Math.max(0,y-1);return y===-1&&(i.current=t),o.current=j,s(n[j]),!0},[n,t,s]),d=l.useCallback(()=>{const y=o.current;return y===-1?!1:(y<n.length-1?(o.current=y+1,s(n[y+1])):(o.current=-1,s(i.current)),!0)},[n,s]),v=l.useCallback(()=>o.current!==-1,[]),C=l.useCallback(()=>n.length,[n.length]);return{push:c,recallPrev:x,recallNext:d,isNavigating:v,size:C}}function yt(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function wt({attachment:t,onRemove:s}){const n=t.type.startsWith("image/");return e.jsxs("div",{className:"group relative flex shrink-0 items-center gap-2 rounded-lg border border-border bg-muted/40 px-2 py-1.5 text-xs",children:[n&&t.previewUrl?e.jsx("img",{src:t.previewUrl,alt:t.name,className:"h-10 w-10 rounded object-cover"}):n?e.jsx(ut,{className:"size-5 text-muted-foreground"}):e.jsx(at,{className:"size-5 text-muted-foreground"}),e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsx("span",{className:"truncate max-w-[120px] font-medium text-foreground",children:t.name}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:yt(t.size)})]}),e.jsx("button",{onClick:a=>{a.stopPropagation(),s()},className:"absolute -top-1.5 -right-1.5 flex size-4 items-center justify-center rounded-full bg-muted-foreground/20 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive hover:text-destructive-foreground transition-all","aria-label":`Remove ${t.name}`,children:e.jsx(fe,{className:"size-2.5"})})]})}function jt({attachments:t,onRemove:s,compact:n=!1}){return t.length===0?null:e.jsx("div",{className:_("flex gap-2 overflow-x-auto","px-3 pt-3"),children:t.map(a=>e.jsx(wt,{attachment:a,onRemove:()=>s(a.id)},a.id))})}function le(t){return t.name&&t.name!==t.id?t.name:(t.id.split("/").pop()||t.id).split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function Nt(){return Date.now().toString(36)+Math.random().toString(36).slice(2,8)}const St=l.forwardRef(function({sessionId:s,model:n,isLoading:a,onSubmit:o,onAbort:i},c){const[x,d]=l.useState(""),[v,C]=l.useState(!1),[y,j]=l.useState(!1),[S,M]=l.useState(""),[g,u]=l.useState(0),[m,p]=l.useState([]),[f,b]=l.useState(!1),h=l.useRef(null),R=l.useRef(null),D=l.useRef(null),{data:E,isLoading:A}=Je(),L=E?.models??[],[$,J]=l.useState("");l.useEffect(()=>{if(!L.length)return;const r=n&&L.some(k=>k.id===n),N=$&&L.some(k=>k.id===$);if(r){$!==n&&J(n);return}if(!N){const k=E?.default_model||L[0]?.id;k&&J(k)}},[L,E?.default_model,n]);const X=L.find(r=>r.id===$),we=l.useCallback(async r=>{J(r);try{await Le({model:r,session_id:s})}catch{}},[s]),U=l.useCallback(()=>{const r=h.current;r&&(r.style.height="auto",r.style.height=`${Math.min(r.scrollHeight,200)}px`)},[]),je=l.useCallback(r=>{d(r),requestAnimationFrame(()=>{U(),h.current?.setSelectionRange(r.length,r.length)})},[U]),O=vt({currentInput:x,applyText:je});l.useImperativeHandle(c,()=>({setText(r){d(r),requestAnimationFrame(()=>{U(),h.current?.focus()})},clear(){d(""),h.current&&(h.current.style.height="auto")},focus(){h.current?.focus()}}),[U]),l.useEffect(()=>{a||h.current?.focus()},[a]),l.useEffect(()=>{if(!y)return;function r(N){R.current&&!R.current.contains(N.target)&&j(!1)}return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[y]),l.useEffect(()=>{if(!y)return;R.current?.querySelector(".slash-item-active")?.scrollIntoView({block:"nearest"})},[g,y]);const P=l.useMemo(()=>y?q.filter(r=>r.name.toLowerCase().startsWith(S.toLowerCase())):[],[y,S]),H=l.useCallback(r=>{const N=Array.from(r).map(k=>({id:Nt(),name:k.name,type:k.type||"application/octet-stream",size:k.size,file:k,previewUrl:k.type.startsWith("image/")?URL.createObjectURL(k):void 0}));p(k=>[...k,...N])},[]),Ne=l.useCallback(r=>{p(N=>{const k=N.find(T=>T.id===r);return k?.previewUrl&&URL.revokeObjectURL(k.previewUrl),N.filter(T=>T.id!==r)})},[]);l.useEffect(()=>()=>{m.forEach(r=>{r.previewUrl&&URL.revokeObjectURL(r.previewUrl)})},[]);const Se=l.useCallback(r=>{r.preventDefault(),r.stopPropagation(),b(!0)},[]),ke=l.useCallback(r=>{r.preventDefault(),r.stopPropagation(),(r.currentTarget===r.target||!r.currentTarget.contains(r.relatedTarget))&&b(!1)},[]),Ce=l.useCallback(r=>{r.preventDefault(),r.stopPropagation(),b(!1),r.dataTransfer.files.length>0&&H(r.dataTransfer.files)},[H]),Re=l.useCallback(r=>{const N=r.clipboardData?.items;if(!N)return;const k=[];for(let T=0;T<N.length;T++){const W=N[T];if(W.type.startsWith("image/")){const ee=W.getAsFile();if(ee){const Ae=W.type.split("/")[1]||"png",ze=new File([ee],`pasted-image-${Date.now()}.${Ae}`,{type:W.type});k.push(ze)}}}k.length>0&&(r.preventDefault(),H(k))},[H]);function _e(r){O.push(r),d(""),h.current&&(h.current.style.height="auto")}function Q(){const r=x.trim();!r||a||(j(!1),_e(r),o(r,$,m),p([]))}function Y(r){if(j(!1),r.local||r.category==="info"){d(""),h.current&&(h.current.style.height="auto"),o(r.name,$);return}d(r.name+" "),h.current?.focus()}function Me(r){const N=r.target.value;d(N),U(),N.startsWith("/")&&!N.includes(" ")?(j(!0),M(N),u(0)):y&&j(!1)}function De(r){if(!xt(r)){if(y&&P.length>0){if(r.key==="ArrowDown"){r.preventDefault(),u(N=>N<P.length-1?N+1:0);return}if(r.key==="ArrowUp"){r.preventDefault(),u(N=>N>0?N-1:P.length-1);return}if(r.key==="Enter"||r.key==="Tab"){r.preventDefault(),Y(P[g]);return}if(r.key==="Escape"){r.preventDefault(),j(!1);return}}if(!y&&(O.isNavigating()||!x.includes(`
|
|
3
|
+
`))){if(r.key==="ArrowUp"&&O.size()>0&&O.recallPrev()){r.preventDefault();return}if(r.key==="ArrowDown"&&O.isNavigating()&&O.recallNext()){r.preventDefault();return}}r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),Q())}}const Z=x.trim().length>0;return e.jsxs("div",{className:"w-full max-w-3xl mx-auto flex flex-col gap-2 relative",children:[y&&P.length>0&&e.jsxs("div",{ref:R,className:"absolute bottom-full left-0 right-0 mb-1 rounded-xl border border-border bg-card shadow-lg z-50 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2 text-[11px] font-medium text-muted-foreground border-b border-border/60 bg-muted/30",children:[e.jsx(nt,{className:"size-3"}),"Commands"]}),e.jsx("div",{className:"max-h-[240px] overflow-y-auto py-1",children:P.map((r,N)=>e.jsxs("button",{className:_("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",N===g?"bg-accent text-accent-foreground slash-item-active":"hover:bg-accent/50"),onMouseEnter:()=>u(N),onClick:()=>Y(r),children:[e.jsx("span",{className:"font-mono text-xs text-primary",children:r.name}),e.jsx("span",{className:"text-muted-foreground text-xs",children:r.description})]},r.name))})]}),e.jsxs("div",{className:_("flex min-h-[80px] flex-col rounded-2xl cursor-text bg-card border shadow-lg transition-colors",f?"border-primary border-dashed":"border-border"),onDragOver:Se,onDragLeave:ke,onDrop:Ce,children:[e.jsx(jt,{attachments:m,onRemove:Ne,compact:!0}),e.jsx("div",{className:"flex-1 relative overflow-y-auto max-h-[200px]",children:e.jsx(Fe,{ref:h,value:x,onChange:Me,onKeyDown:De,onPaste:Re,onCompositionStart:()=>C(!0),onCompositionEnd:()=>C(!1),placeholder:"Ask anything…",rows:1,className:_("w-full !rounded-none border-0 p-3 outline-none text-[15px] text-foreground resize-none shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:border-transparent bg-transparent whitespace-pre-wrap break-words","min-h-[48px] max-h-[200px]")})}),e.jsxs("div",{className:"flex min-h-[40px] items-center gap-2 p-2 pb-1",children:[e.jsx(I,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground transition-colors",title:"Attach images",onClick:()=>D.current?.click(),children:e.jsx(ct,{className:"h-5 w-5"})}),e.jsxs(he,{children:[e.jsxs(ge,{className:"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer outline-none ml-1",children:[e.jsx(Ke,{className:"h-4 w-4 shrink-0"}),A&&e.jsx(F,{className:"h-3.5 w-3.5 animate-spin shrink-0"}),e.jsx("span",{className:_(A&&"opacity-60"),children:A?"Loading…":X?le(X):"Select model"})]}),e.jsx(xe,{align:"start",className:"max-h-[300px] overflow-y-auto min-w-48",children:L.map(r=>e.jsxs(K,{onClick:()=>we(r.id),className:_("flex-col items-start py-2",r.id===$&&"bg-muted"),children:[e.jsx("span",{className:"text-sm",children:le(r)}),e.jsx("span",{className:"text-muted-foreground text-xs",children:r.provider_name})]},r.id))})]}),e.jsx("div",{className:"ml-auto flex items-center gap-2",children:a?e.jsx(I,{variant:"ghost",size:"icon-sm",className:"rounded-full bg-destructive hover:bg-destructive/90 text-destructive-foreground transition-colors cursor-pointer",onClick:i,title:"Stop generating",children:e.jsx(pt,{className:"h-4 w-4"})}):e.jsx(I,{variant:"ghost",size:"icon-sm",className:_("rounded-full transition-colors cursor-pointer",Z?"bg-primary hover:bg-primary/90 text-primary-foreground":"bg-primary text-primary-foreground opacity-40"),disabled:!Z,onClick:Q,title:"Send message",children:e.jsx(Ve,{className:"h-4 w-4"})})})]})]}),e.jsx("input",{ref:D,type:"file",multiple:!0,accept:"image/*",className:"hidden",onChange:r=>{r.target.files?.length&&(H(r.target.files),r.target.value="")}})]})}),kt=l.memo(function({sessionId:s,title:n,hasMessages:a,onNewChat:o,onClear:i}){const c=be(),x=w(v=>v.deleteSession),d=async()=>{try{await Oe(s),x(s),c({to:"/chat"})}catch{}};return e.jsxs("div",{className:"group/header shrink-0 px-2 py-1 flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground truncate flex-1 select-none",children:n||"Conversation"}),e.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover/header:opacity-100 transition-opacity",children:[e.jsx("button",{onClick:o,className:"flex items-center justify-center rounded-lg p-1 text-muted-foreground hover:bg-sidebar-muted hover:text-foreground transition-colors",title:"New chat",children:e.jsx(We,{className:"size-3.5"})}),a&&e.jsx("button",{onClick:i,className:"flex items-center justify-center rounded-lg p-1 text-muted-foreground hover:bg-sidebar-muted hover:text-foreground transition-colors",title:"Clear chat",children:e.jsx(te,{className:"size-3.5"})}),e.jsxs(he,{children:[e.jsx(ge,{asChild:!0,children:e.jsx("button",{className:"flex items-center justify-center rounded-lg p-1 text-muted-foreground hover:bg-sidebar-muted hover:text-foreground transition-colors",children:e.jsx($e,{className:"size-3.5"})})}),e.jsxs(xe,{align:"end",side:"bottom",sideOffset:4,children:[e.jsxs(K,{className:"gap-2 text-xs",onClick:()=>{const v=prompt("Rename conversation",n||"");v?.trim()&&(Ie(s,v.trim()),w.getState().updateSession(s,{title:v.trim()}))},children:[e.jsx(Te,{className:"size-3"}),"Rename"]}),e.jsxs(K,{className:"gap-2 text-xs text-destructive",onClick:d,children:[e.jsx(te,{className:"size-3"}),"Delete"]})]})]})]})]})}),Ct=[{label:"Search the web",text:"Search the web for today's top tech news",Icon:ve},{label:"Set a reminder",text:"Set a reminder to check emails every day at 9 AM",Icon:Ze},{label:"Read emails",text:"Read my latest emails and summarize them",Icon:it},{label:"Write a script",text:"Write a Python script to rename all files in a folder",Icon:Ge},{label:"Schedule a job",text:"Schedule a cron job to back up my database every night",Icon:Be},{label:"Analyze data",text:"Analyze this CSV file and show key insights",Icon:tt}],Rt=l.memo(function({onSelectSuggestion:s}){return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-6 py-12",children:[e.jsx("div",{className:"mb-6 flex items-center justify-center w-16 h-16 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 text-primary",children:e.jsx(ve,{className:"w-8 h-8",strokeWidth:1.5})}),e.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"How can I help?"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-8 max-w-sm text-center",children:"Ask anything or pick a suggestion to get started."}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 w-full max-w-lg",children:Ct.map(({text:n,label:a,Icon:o})=>e.jsxs("button",{className:"flex items-center gap-3 rounded-xl border border-border/60 bg-card px-4 py-3 text-left text-sm text-foreground hover:bg-accent hover:border-accent transition-colors group",onClick:()=>s(n),children:[e.jsx(o,{className:"w-4 h-4 shrink-0 text-muted-foreground group-hover:text-foreground transition-colors"}),e.jsx("span",{className:"truncate",children:a})]},n))})]})}),_t=l.lazy(()=>Pe(()=>import("./syntax-highlighter-DWPF-A_h.js"),__vite__mapDeps([0,1,2])).then(t=>({default:t.SyncHighlighter})));function V({text:t}){const[s,n]=l.useState(!1),a=async()=>{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),2e3)};return e.jsx("button",{onClick:a,className:"absolute right-2 top-2 flex items-center gap-1 rounded px-1.5 py-1 text-xs text-muted-foreground/60 hover:text-foreground hover:bg-muted transition-colors","aria-label":"Copy code",children:s?e.jsx(B,{className:"size-3"}):e.jsx(ye,{className:"size-3"})})}function Mt({text:t}){const[s,n]=l.useState(!1),a=async()=>{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),2e3)};return e.jsxs("button",{onClick:a,className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-muted-foreground/50 hover:text-foreground hover:bg-muted transition-colors","aria-label":"Copy message",children:[s?e.jsx(B,{className:"size-3"}):e.jsx(ye,{className:"size-3"}),s?"Copied":"Copy"]})}function Dt(t){const s=Math.floor(t/1e3);if(s<60)return`${s}s`;const n=Math.floor(s/60),a=s%60;return a===0?`${n}m`:`${n}m ${a}s`}function ce({reasoning:t,isStreaming:s,startedAt:n,endedAt:a}){const[o,i]=l.useState(s??!1);l.useEffect(()=>{i(s??!1)},[s]);const[c,x]=l.useState(Date.now()),d=l.useRef(null);if(l.useEffect(()=>{if(s&&n&&!a)return d.current=setInterval(()=>x(Date.now()),1e3),()=>{d.current&&clearInterval(d.current)};d.current&&(clearInterval(d.current),d.current=null)},[s,n,a]),!t.trim())return null;const v=n?Math.max(0,(a??(s?c:n))-n):null,C=[...t].length,y=s&&n&&!a;return e.jsxs("div",{className:"mb-1",children:[e.jsxs("button",{onClick:()=>i(!o),className:_("inline-flex items-center gap-1.5 text-[11px] transition-colors",y?"text-amber-500 dark:text-amber-400 font-medium":"text-muted-foreground/70 hover:text-foreground"),children:[e.jsx(G,{className:_("size-3 shrink-0 transition-transform",o&&"rotate-90")}),y?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(F,{className:"size-2.5 animate-spin"}),"thinking…"]}):e.jsx("span",{children:"thought"}),v!==null&&v>0&&e.jsxs("span",{className:"text-muted-foreground/60 tabular-nums",children:["· ",Dt(v)]}),e.jsxs("span",{className:"text-muted-foreground/60",children:["· ",C.toLocaleString()," chars"]})]}),o&&e.jsx("div",{className:"mt-1 rounded-md bg-amber-50 dark:bg-amber-950/20 px-2.5 py-1.5 text-[11px] text-muted-foreground leading-relaxed whitespace-pre-wrap font-mono border border-amber-200 dark:border-amber-800/30",children:t})]})}function At({name:t,content:s}){const[n,a]=l.useState(!1),o=s.length>60?s.slice(0,60)+"...":s;return s?e.jsxs("div",{className:"mb-1",children:[e.jsxs("button",{onClick:()=>a(!n),className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground/70 hover:text-foreground transition-colors truncate max-w-full",children:[e.jsx(G,{className:_("size-3 shrink-0 transition-transform",n&&"rotate-90")}),e.jsxs("span",{className:"truncate",children:[t||"tool",': "',o,'"']})]}),n&&e.jsx("div",{className:"mt-1 rounded-md bg-muted/40 px-2.5 py-1.5 text-[11px] text-muted-foreground leading-relaxed whitespace-pre-wrap font-mono border border-border/50 max-h-[300px] overflow-auto",children:s})]}):null}function de(t){if(!t)return null;try{const s=JSON.parse(t);return{text:JSON.stringify(s,null,2),isJson:!0}}catch{return{text:t,isJson:!1}}}function ue({tools:t}){const[s,n]=l.useState(!1);if(!t?.length)return null;const a=t.filter(c=>c.status==="running").length,o=t.filter(c=>c.status==="done").length,i=t.filter(c=>c.status==="error").length;return e.jsxs("div",{className:"mb-1",children:[e.jsxs("button",{onClick:()=>n(!s),className:"inline-flex items-center gap-1 text-[11px] text-muted-foreground/70 hover:text-foreground transition-colors",children:[e.jsx(G,{className:_("size-3 shrink-0 transition-transform",s&&"rotate-90")}),e.jsxs("span",{children:["used ",t.length," tool",t.length>1?"s":""]}),a>0&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-amber-500",children:[e.jsx(F,{className:"size-2.5 animate-spin"}),a]}),o>0&&e.jsxs("span",{className:"text-emerald-500",children:[o," done"]}),i>0&&e.jsxs("span",{className:"text-red-500",children:[i," error"]}),t.length>0&&a===0&&e.jsxs("span",{className:"text-muted-foreground/50 truncate max-w-[200px]",children:["— ",t.map(c=>c.name).join(", ")]})]}),s&&e.jsx("div",{className:"mt-1 flex flex-col gap-1.5",children:t.map((c,x)=>{const d=de(c.preview),v=de(c.output);return e.jsxs("div",{className:"rounded-md bg-muted/40 border border-border/50 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5",children:[e.jsx("span",{className:"text-[11px] font-semibold text-foreground/80 font-mono",children:c.name}),c.status==="running"&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-amber-500",children:[e.jsx(F,{className:"size-2.5 animate-spin"}),"running"]}),c.status==="done"&&e.jsx("span",{className:"text-[10px] text-emerald-500",children:"✓ done"}),c.status==="error"&&e.jsx("span",{className:"text-[10px] text-red-500",children:"✗ error"})]}),d&&e.jsxs("div",{className:"border-t border-border/30",children:[e.jsxs("div",{className:"flex items-center justify-between px-2.5 py-0.5",children:[e.jsx("span",{className:"text-[9px] uppercase tracking-wider text-muted-foreground/60",children:"Arguments"}),e.jsx(V,{text:d.text})]}),e.jsx("div",{className:"px-2.5 pb-1.5",children:e.jsx("pre",{className:_("text-[10px] leading-relaxed overflow-x-auto font-mono whitespace-pre-wrap max-h-[200px] overflow-y-auto rounded",d.isJson?"bg-slate-900/10 dark:bg-slate-900/40 text-foreground/80 px-2 py-1":"text-muted-foreground/70"),children:d.text})})]}),v&&e.jsxs("div",{className:"border-t border-border/30",children:[e.jsxs("div",{className:"flex items-center justify-between px-2.5 py-0.5",children:[e.jsx("span",{className:"text-[9px] uppercase tracking-wider text-muted-foreground/60",children:"Result"}),e.jsx(V,{text:v.text})]}),e.jsx("div",{className:"px-2.5 pb-1.5",children:e.jsx("pre",{className:_("text-[10px] leading-relaxed overflow-x-auto font-mono whitespace-pre-wrap max-h-[200px] overflow-y-auto rounded",v.isJson?"bg-slate-900/10 dark:bg-slate-900/40 text-foreground/80 px-2 py-1":"text-muted-foreground/70"),children:v.text})})]})]},c.callId||`${c.name}-${x}`)})})]})}function zt({language:t,value:s}){return e.jsxs("div",{className:"relative group/code my-2",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-t-lg bg-muted/80 px-3 py-1.5 border border-border border-b-0",children:[e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wide",children:t||"text"}),e.jsx(V,{text:s})]}),e.jsx(l.Suspense,{fallback:e.jsx("pre",{className:"bg-[#282c34] text-gray-300 rounded-b-lg px-4 py-3 text-[13px] leading-relaxed overflow-x-auto font-mono",children:e.jsx("code",{children:s})}),children:e.jsx(_t,{language:t,value:s})})]})}const Et={pre({children:t}){return e.jsx("div",{className:"overflow-x-auto max-w-full",children:t})},code({className:t,children:s,...n}){const a=/language-(\w+)/.exec(t||""),o=String(s).replace(/\n$/,"");return a?a[1]==="plaintext"?e.jsx("pre",{className:"rounded-lg bg-muted/50 border border-border/50 px-4 py-3 text-[13px] leading-relaxed overflow-x-auto font-mono whitespace-pre-wrap",children:o}):e.jsx(zt,{language:a[1],value:o}):e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-[13px] font-mono text-foreground/90",...n,children:s})},a({href:t,children:s}){return e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 underline underline-offset-2",children:s})},img({src:t,alt:s}){return e.jsx("img",{src:t,alt:s,className:"rounded-lg max-w-full my-2",loading:"lazy"})},table({children:t}){return e.jsx("div",{className:"overflow-x-auto my-2",children:e.jsx("table",{className:"w-full text-sm border-collapse border border-border rounded-lg overflow-hidden",children:t})})},th({children:t}){return e.jsx("th",{className:"border border-border bg-muted px-3 py-1.5 text-left font-medium",children:t})},td({children:t}){return e.jsx("td",{className:"border border-border px-3 py-1.5",children:t})},blockquote({children:t}){return e.jsx("blockquote",{className:"border-l-2 border-amber-400 dark:border-amber-600 pl-3 my-2 text-muted-foreground italic",children:t})}},Lt=/[\u2500-\u257F]/;function $t(t){return Lt.test(t)}function Tt(t){const s=t.split(`
|
|
4
|
+
`),n=[];let a=!1;for(let o=0;o<s.length;o++){const i=s[o],c=$t(i);c&&!a?(n.length>0&&n[n.length-1]!==""&&n.push(""),n.push("```plaintext"),a=!0):!c&&a&&(n.push("```"),i!==""&&n.push(""),a=!1),n.push(i)}return a&&n.push("```"),n.join(`
|
|
5
|
+
`)}function me({content:t,isStreaming:s}){const n=Tt(t);return s&&t?e.jsx("div",{className:"max-w-none leading-relaxed",children:e.jsxs("div",{className:"whitespace-pre-wrap text-base leading-relaxed",children:[t,e.jsx("span",{className:"inline-block w-0.5 h-4 bg-foreground/70 ml-0.5 align-text-bottom animate-pulse"})]})}):s&&!t?e.jsx("span",{className:"inline-block w-0.5 h-4 bg-foreground/70 ml-0.5 align-text-bottom animate-pulse"}):e.jsx("div",{className:"max-w-none leading-relaxed [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_p]:my-3 [&_p]:leading-relaxed [&_ul]:my-3 [&_ul]:pl-5 [&_ul]:list-disc [&_ol]:my-3 [&_ol]:pl-5 [&_ol]:list-decimal [&_li]:my-1 [&_li]:leading-relaxed [&_h1]:mt-6 [&_h1]:mb-3 [&_h2]:mt-5 [&_h2]:mb-2 [&_h3]:mt-4 [&_h3]:mb-1.5 [&_h4]:mt-3 [&_h4]:mb-1 [&_blockquote]:my-3 [&_hr]:my-6 [&_table]:my-4 [&_pre]:my-3",children:e.jsx(qe,{remarkPlugins:[Xe],components:Et,children:n})})}function It(t){if(!t||isNaN(t))return null;try{return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return null}}function Ot({message:t}){const s=t.role==="user",n=t.role==="tool",a=!!t.content?.trim(),o=!!t.reasoning?.trim(),i=!!t.toolCalls?.length,c=It(t.timestamp);return n||!s&&!a&&(o||i)?e.jsxs("div",{className:"px-4 py-1",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[o&&e.jsx(ce,{reasoning:t.reasoning,isStreaming:t.isStreaming,startedAt:t.reasoningStartedAt,endedAt:t.reasoningEndedAt}),!n&&i&&e.jsx(ue,{tools:t.toolCalls}),n&&e.jsx(At,{name:t.toolName||"",content:t.content})]}),c&&e.jsx("span",{className:"mt-0.5 text-[10px] text-muted-foreground/40",children:c})]}):e.jsx("div",{className:_("flex px-4",s?"py-2 justify-end":"py-4 justify-start"),children:e.jsxs("div",{className:_("flex min-w-0 flex-col",s?"max-w-[85%] items-end":"w-full"),children:[t.isStreaming&&!a&&!o?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground py-1",children:[e.jsx(F,{className:"h-3.5 w-3.5 animate-spin"}),"Thinking..."]}):e.jsxs("div",{className:"flex flex-col gap-1 w-full",children:[o&&e.jsx(ce,{reasoning:t.reasoning,isStreaming:t.isStreaming,startedAt:t.reasoningStartedAt,endedAt:t.reasoningEndedAt}),!n&&!s&&i&&e.jsx(ue,{tools:t.toolCalls}),a&&(s?e.jsx("div",{className:"rounded-2xl px-4 py-2.5 text-sm leading-relaxed overflow-x-auto bg-primary text-primary-foreground",children:e.jsx(me,{content:t.content,isStreaming:t.isStreaming})}):e.jsx("div",{className:"text-base leading-relaxed",children:e.jsx(me,{content:t.content,isStreaming:t.isStreaming})}))]}),a&&!s&&e.jsx("div",{className:"mt-1 flex items-center gap-2 px-1",children:e.jsx(Mt,{text:t.content})}),c&&e.jsx("span",{className:"mt-1 text-[10px] text-muted-foreground/50 px-1",children:c})]})})}const Pt=l.memo(Ot),Ut=l.memo(function({messages:s,isLoading:n}){const a=l.useMemo(()=>s.map(o=>({id:o.id,role:o.role==="user"?"user":o.role==="tool"?"tool":"assistant",content:o.content,timestamp:o.timestamp,isStreaming:o.isStreaming,reasoning:o.reasoning,reasoningStartedAt:o.reasoningStartedAt,reasoningEndedAt:o.reasoningEndedAt,toolCalls:o.toolCalls})),[s]);return e.jsx(e.Fragment,{children:a.map(o=>e.jsx(Pt,{message:o},o.id))})});function Ht(t){const s=l.useRef(null),n=l.useRef(null),a=l.useRef(!1),o=l.useRef(t.length),i=l.useCallback(x=>{!x&&a.current||n.current?.scrollIntoView({behavior:"smooth"})},[]),c=l.useCallback(()=>{const x=s.current;if(!x)return;const d=x.scrollHeight-x.scrollTop-x.clientHeight<80;a.current=!d},[]);return l.useEffect(()=>{const x=o.current;o.current=t.length,t.length>x&&t[t.length-1]?.role==="user"?(a.current=!1,i(!0)):i()},[t,i]),{containerRef:s,bottomRef:n,onScroll:c}}const Ft="http://localhost:47474";async function*Wt(t){const{input:s,conversation:n,model:a,signal:o}=t,i={input:s};n&&(i.conversation=n),a&&(i.model=a),t.messages&&t.messages.length>0&&(i.messages=t.messages),t.attachments&&t.attachments.length>0&&(i.attachments=t.attachments);const c=await fetch(`${Ft}/api/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i),signal:o});if(!c.ok){const C=await c.text().catch(()=>"Stream request failed");throw new Error(C)}if(!c.body)throw new Error("No response body");const x=c.body.getReader(),d=new TextDecoder;let v="";try{for(;;){const{done:C,value:y}=await x.read();if(C)break;v+=d.decode(y,{stream:!0});let j=v.indexOf(`
|
|
6
|
+
|
|
7
|
+
`);for(;j>=0;){const S=v.slice(0,j);v=v.slice(j+2);let M="",g="";for(const u of S.split(`
|
|
8
|
+
`))u.startsWith("event: ")?M=u.slice(7).trim():u.startsWith("data: ")&&(g+=(g?`
|
|
9
|
+
`:"")+u.slice(6));if(g){let u={};try{u=JSON.parse(g)}catch{u={raw:g}}yield{type:M||"unknown",data:u}}j=v.indexOf(`
|
|
10
|
+
|
|
11
|
+
`)}}}finally{x.releaseLock()}}let Bt=0;function pe(){return`msg-${++Bt}-${Math.random().toString(36).slice(2,6)}`}function Jt(){const t=l.useRef(null),s=l.useCallback((o,i)=>{w.setState(c=>({streamingSessions:i?new Set([...c.streamingSessions,o]):new Set([...c.streamingSessions].filter(x=>x!==o))}))},[]),n=l.useCallback(()=>{t.current&&(t.current.abort(),t.current=null)},[]);return{sendMessage:l.useCallback(async(o,i,c,x)=>{if(w.getState().streamingSessions.has(i))return;const d={id:pe(),role:"user",content:o,timestamp:Date.now()};w.setState(g=>{if(!g.sessions.find(m=>m.id===i)){const m=Date.now();return{sessions:[{id:i,title:o.slice(0,64),model:c||"",messages:[d],createdAt:m,updatedAt:m},...g.sessions]}}return{sessions:g.sessions.map(m=>m.id===i?{...m,messages:[...m.messages,d],model:c||m.model||"",title:!m.title||m.title==="New Conversation"||m.title==="Untitled"?o.slice(0,64):m.title}:m)}});const v=w.getState().sessions.find(g=>g.id===i)?.messages.slice(0,-1).filter(g=>!g.isStreaming&&g.content).map(g=>({role:g.role,content:g.content}))||[],y={id:pe(),role:"assistant",content:"",timestamp:Date.now(),isStreaming:!0};w.setState(g=>({sessions:g.sessions.map(u=>u.id===i?{...u,messages:[...u.messages,y]}:u)})),s(i,!0);const j=new AbortController;t.current=j;let S=Date.now();const M=setInterval(()=>{Date.now()-S>3e5&&(console.warn("[stream] hang timeout — aborting",i),j.abort())},3e4);try{const g=Wt({input:o,conversation:i,model:c,signal:j.signal,messages:v,attachments:x?.attachments?.map(u=>({id:u.id,name:u.name,type:u.type,size:u.size}))});for await(const u of g)switch(S=Date.now(),u.type){case"token":{const m=u.data.delta||"";if(!m)continue;w.setState(p=>({sessions:p.sessions.map(f=>{if(f.id!==i)return f;const b=f.messages.slice(),h=b[b.length-1];return h&&h.role==="assistant"&&h.isStreaming&&(b[b.length-1]={...h,content:h.content+m}),{...f,messages:b}})}));break}case"reasoning":{const m=u.data.text||"";if(!m)continue;w.setState(p=>({sessions:p.sessions.map(f=>{if(f.id!==i)return f;const b=f.messages.slice(),h=b[b.length-1];if(h&&h.role==="assistant"&&h.isStreaming){const R=h.reasoning||"";b[b.length-1]={...h,reasoning:R+m,reasoningStartedAt:h.reasoningStartedAt||Date.now()}}return{...f,messages:b}})}));break}case"tool_start":{const m=u.data.name||"tool",p=u.data.preview||"",f=u.data.tool_call_id||void 0;w.setState(b=>({sessions:b.sessions.map(h=>{if(h.id!==i)return h;const R=h.messages.slice(),D=R[R.length-1];if(D&&D.role==="assistant"&&D.isStreaming){const E=[...D.toolCalls||[],{name:m,preview:p,callId:f,status:"running"}];R[R.length-1]={...D,toolCalls:E}}return{...h,messages:R}})}));break}case"tool_end":{const m=u.data.tool_call_id,p=u.data.tool,f=u.data.output;w.setState(b=>({sessions:b.sessions.map(h=>{if(h.id!==i)return h;const R=h.messages.slice(),D=R[R.length-1];if(!D?.toolCalls)return h;const E=D.toolCalls.map(A=>m&&A.callId===m?{...A,status:"done",output:f||A.output}:!m&&A.name===p&&A.status==="running"?{...A,status:"done",output:f||A.output}:A);return R[R.length-1]={...D,toolCalls:E},{...h,messages:R}})}));break}case"done":{w.setState(m=>({sessions:m.sessions.map(p=>{if(p.id!==i)return p;const f=p.messages.map(b=>b.role==="assistant"&&b.isStreaming?{...b,isStreaming:!1,reasoningEndedAt:b.reasoning?Date.now():void 0}:b);return{...p,messages:f}})})),s(i,!1);break}case"error":{const m=u.data.error;w.setState(p=>({sessions:p.sessions.map(f=>{if(f.id!==i)return f;const b=f.messages.map(h=>h.role==="assistant"&&h.isStreaming?{...h,isStreaming:!1,content:h.content||`**Error:** ${m||"Run failed"}`}:h);return{...f,messages:b}})})),s(i,!1);break}case"approval":{w.setState(m=>({sessions:m.sessions.map(p=>p.id===i?{...p,pendingApproval:u.data}:p)}));break}case"title":{const m=u.data.title;m&&w.setState(p=>({sessions:p.sessions.map(f=>f.id===i?{...f,title:m}:f)}));break}}}catch(g){const u=g instanceof Error?g.message:"Connection error";w.setState(m=>({sessions:m.sessions.map(p=>{if(p.id!==i)return p;const f=p.messages.map(b=>b.role==="assistant"&&b.isStreaming?{...b,isStreaming:!1,content:b.content||`**Error:** ${u}`}:b);return{...p,messages:f}})})),s(i,!1)}finally{clearInterval(M),t.current=null,s(i,!1),w.setState(g=>({sessions:g.sessions.map(u=>u.id!==i||!u.messages.some(p=>p.role==="assistant"&&p.isStreaming)?u:{...u,messages:u.messages.map(p=>p.role==="assistant"&&p.isStreaming?{...p,isStreaming:!1}:p)})}))}},[s]),abortChat:n}}function Kt({sessionId:t,model:s,isLoading:n,sendMessage:a,abortChat:o}){const i=be(),c=l.useRef(n);c.current=n;const x=l.useCallback(async(S,M,g)=>{const u=S.trim();if(!(!u||c.current)){if(bt(u)){const m=u.split(/\s+/)[0].toLowerCase();if(m==="/new"){const p=await se({model:s});i({to:"/chat/$sessionId",params:{sessionId:p.id}});return}if(m==="/clear"){w.setState(p=>({sessions:p.sessions.map(f=>f.id===t?{...f,messages:[]}:f)}));return}if(m==="/help"){const p=q.map(f=>`\`${f.name}\` — ${f.description}`).join(`
|
|
12
|
+
`);w.setState(f=>({sessions:f.sessions.map(b=>b.id===t?{...b,messages:[...b.messages,{id:`agent-${Date.now()}`,role:"assistant",content:`**Available Commands**
|
|
13
|
+
|
|
14
|
+
${p}`,timestamp:Date.now()}]}:b)}));return}w.setState(p=>({sessions:p.sessions.map(f=>f.id===t?{...f,messages:[...f.messages,{id:`agent-${Date.now()}`,role:"assistant",content:`Command \`${m}\` is not yet implemented in the web UI.`,timestamp:Date.now()}]}:f)}));return}await a(u,t,M||s,{attachments:g})}},[t,s,a,i]),d=l.useCallback(()=>{o()},[o]),v=l.useCallback(async()=>{c.current||await a("/approve",t,s)},[t,s,a]),C=l.useCallback(async()=>{c.current||await a("/deny",t,s)},[t,s,a]),y=l.useCallback(async()=>{const S=await se({model:s});i({to:"/chat/$sessionId",params:{sessionId:S.id}})},[s,i]),j=l.useCallback(()=>{c.current&&o(),w.setState(S=>({sessions:S.sessions.map(M=>M.id===t?{...M,messages:[]}:M)}))},[t,o]);return{handleSend:x,handleAbort:d,handleApprove:v,handleDeny:C,handleNewChat:y,handleClear:j}}function Vt({sessionId:t,request:s,onResolved:n}){const[a,o]=l.useState(!1),i=async v=>{o(!0);try{await Ue({session_id:t,choice:v}),n()}catch{}finally{o(!1)}},c=s.tool_name||"unknown tool",x=typeof s.command=="string"?s.command:typeof s.arguments=="string"?s.arguments:null,d=typeof s.description=="string"?s.description:typeof s.preview=="string"?s.preview:null;return e.jsx("div",{className:"mx-auto max-w-3xl px-4 py-3",children:e.jsxs("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ne,{className:"h-4 w-4 text-amber-500"}),e.jsx("span",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:"Approval Required"})]}),e.jsxs("p",{className:"text-sm text-foreground mb-1",children:["The agent wants to use ",e.jsx("span",{className:"font-medium",children:c})]}),x&&e.jsx("div",{className:"mt-2 rounded-lg bg-muted/60 border border-border px-3 py-2 text-xs font-mono text-muted-foreground whitespace-pre-wrap break-all max-h-32 overflow-y-auto",children:x}),d&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground leading-relaxed",children:d}),s.risk==="high"&&e.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-red-500",children:[e.jsx(Qe,{className:"h-3.5 w-3.5"}),"High risk operation"]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(I,{size:"sm",variant:"default",className:"gap-1.5 bg-emerald-600 hover:bg-emerald-700 text-white",disabled:a,onClick:()=>i("once"),children:[e.jsx(B,{className:"h-3.5 w-3.5"}),"Approve once"]}),e.jsxs(I,{size:"sm",variant:"secondary",className:"gap-1.5",disabled:a,onClick:()=>i("session"),children:[e.jsx(B,{className:"h-3.5 w-3.5"}),"Approve all"]}),e.jsxs(I,{size:"sm",variant:"outline",className:"gap-1.5",disabled:a,onClick:()=>i("always"),children:[e.jsx(ne,{className:"h-3.5 w-3.5"}),"Always allow"]}),e.jsxs(I,{size:"sm",variant:"ghost",className:"gap-1.5 text-destructive hover:text-destructive",disabled:a,onClick:()=>i("deny"),children:[e.jsx(fe,{className:"h-3.5 w-3.5"}),"Deny"]})]})]})})}function Gt({sessionId:t,messages:s,title:n,model:a,pendingApproval:o}){const i=l.useRef(null),c=l.useRef(!1),{containerRef:x,bottomRef:d,onScroll:v}=Ht(s),{sendMessage:C,abortChat:y}=Jt(),j=w(g=>g.streamingSessions.has(t)),S=Kt({sessionId:t,model:a,isLoading:j,sendMessage:C,abortChat:y});l.useEffect(()=>{if(!t||c.current)return;const g=`hermium_pending_msg_${t}`,u=`hermium_pending_model_${t}`,m=sessionStorage.getItem(g);if(!m)return;c.current=!0;const p=sessionStorage.getItem(u)||a;sessionStorage.removeItem(g),sessionStorage.removeItem(u),C(m,t,p)},[t,a,C]),l.useEffect(()=>{function g(u){(u.metaKey||u.ctrlKey)&&u.key==="n"&&(u.preventDefault(),S.handleNewChat())}return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[S]);const M=l.useCallback(g=>{i.current?.setText(g)},[]);return e.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[e.jsx(kt,{sessionId:t,title:n,hasMessages:s.length>0,onNewChat:S.handleNewChat,onClear:S.handleClear}),e.jsxs("div",{className:"flex-1 min-w-0 overflow-y-auto",ref:x,onScroll:v,children:[s.length===0&&!j?e.jsx(Rt,{onSelectSuggestion:M}):e.jsx("div",{className:"mx-auto max-w-3xl",children:e.jsx(Ut,{messages:s,isLoading:j,onApprove:S.handleApprove,onDeny:S.handleDeny})}),e.jsx("div",{ref:d}),o&&e.jsx("div",{className:"mx-auto max-w-3xl",children:e.jsx(Vt,{sessionId:t,request:o,onResolved:()=>{w.getState().updateSession(t,{pendingApproval:null})}})})]}),e.jsx("div",{className:"shrink-0 px-4 py-3 border-t bg-card/50 backdrop-blur-sm",children:e.jsx(St,{ref:i,sessionId:t,model:a,isLoading:j,onSubmit:S.handleSend,onAbort:S.handleAbort})})]})}function ss(){const{sessionId:t}=He.useParams(),s=w(d=>d.switchSession),n=w(d=>d.loadSessions),a=w(d=>d.loadSessionMessages),o=w(d=>d.sessionsLoaded),i=w(d=>d.isLoadingMessages),c=w(ie(d=>{const v=d.sessions.find(C=>C.id===t);return{title:v?.title,model:v?.model||"",pendingApproval:v?.pendingApproval??null}})),x=w(ie(d=>d.sessions.find(C=>C.id===t)?.messages??[]));return l.useEffect(()=>{o||n()},[o,n]),l.useEffect(()=>{if(!t)return;s(t);const d=w.getState().getSession(t);(!d||d.messages.length===0)&&a(t)},[t,s,a]),i&&x.length===0?e.jsxs("div",{className:"flex flex-1 flex-col h-full overflow-hidden",children:[e.jsx("div",{className:"shrink-0 border-b px-4 py-2.5 flex items-center gap-2 min-w-0",children:e.jsx("span",{className:"text-sm text-muted-foreground truncate flex-1",children:"Loading…"})}),e.jsx("div",{className:"flex-1 min-w-0 overflow-y-auto",children:e.jsx("div",{className:"space-y-4 p-4 mx-auto max-w-3xl",children:[1,2,3].map(d=>e.jsxs("div",{className:"animate-pulse space-y-2",children:[e.jsx("div",{className:`h-4 rounded bg-muted ${d%2===0?"w-2/3":"w-1/2 ml-auto"}`}),e.jsx("div",{className:`h-3 rounded bg-muted ${d%2===0?"w-1/2":"w-1/3 ml-auto"}`})]},d))})})]}):e.jsx(Gt,{sessionId:t,messages:x,title:c.title,model:c.model,pendingApproval:c.pendingApproval})}export{ss as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as F,h as R,p as D,r as o,t as z,j as e,d as i,m as U,I as k}from"./index-DkYGodJj.js";import{I as w}from"./IconLoader2-BIx3OuF9.js";import{I as C}from"./IconAlertCircle-BHkmI3j7.js";import{I as Y}from"./IconRefresh-Dgm93w3T.js";import{I as B}from"./IconCheck-CFuEh_p7.js";import{M as G,r as O}from"./index-CrQs9n6q.js";const T=[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]],W=F("outline","user","User",T);async function S(){return R("/api/hermes/memory")}async function X(r,s){return D("/api/hermes/memory/write",{section:r,content:s})}const E=[{key:"memory",label:"My Notes",icon:z,desc:"Personal notes & knowledge",emptyLabel:"No notes yet — click Edit to start writing."},{key:"user",label:"User Profile",icon:W,desc:"About you & your context",emptyLabel:"No profile yet — click Edit to add details about yourself."}],$={a({href:r,children:s}){return e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 underline underline-offset-2 decoration-blue-400/30 hover:decoration-blue-600/60 transition-colors",children:s})},img({src:r,alt:s}){return e.jsx("img",{src:r,alt:s,className:"rounded-xl max-w-full my-4",loading:"lazy"})}};function H(){const[r,s]=o.useState(null),[I,f]=o.useState(!0),[p,h]=o.useState(null),[n,M]=o.useState("memory"),[c,m]=o.useState(!1),[g,b]=o.useState(""),[a,_]=o.useState(!1),[y,l]=o.useState(null),x=o.useCallback(async()=>{f(!0),h(null);try{const t=await S();s(t)}catch(t){h(t instanceof Error?t.message:"Failed to load memory")}finally{f(!1)}},[]);o.useEffect(()=>{x()},[x]);const u=r?n==="memory"?r.memory:r.user:"",j=r?n==="memory"?r.memory_mtime:r.user_mtime:null,d=E.find(t=>t.key===n),v=()=>{b(u),l(null),m(!0)},L=()=>{m(!1),l(null)},q=async()=>{_(!0),l(null);try{await X(n,g);const t=await S();s(t),m(!1)}catch(t){l(t instanceof Error?t.message:"Failed to save")}finally{_(!1)}},P=t=>{if(c){if(!confirm("You have unsaved changes. Discard them?"))return;m(!1)}M(t),l(null)};return I?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[e.jsx(w,{className:"size-6 animate-spin"}),e.jsx("span",{className:"text-sm",children:"Loading memory..."})]})}):p?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-muted-foreground",children:[e.jsx(C,{className:"size-8 text-red-500"}),e.jsx("span",{className:"text-sm",children:p}),e.jsxs("button",{onClick:x,className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium bg-muted hover:bg-muted/80 transition-colors",children:[e.jsx(Y,{className:"size-3.5"}),"Retry"]})]})}):e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("aside",{className:"flex w-56 shrink-0 flex-col border-r border-border",children:[e.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-3.5",children:[e.jsx(z,{className:"size-5 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Memory"})]}),e.jsx("nav",{className:"flex-1 overflow-y-auto space-y-1 px-2 py-1",children:E.map(t=>{const A=t.icon,N=n===t.key;return e.jsxs("button",{onClick:()=>P(t.key),className:i("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-2.5 text-left transition-colors",N?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[e.jsx(A,{className:i("size-4 shrink-0",N?"text-foreground":"text-muted-foreground/60")}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium",children:t.label}),e.jsx("div",{className:"truncate text-[10px] text-muted-foreground/70",children:t.desc})]})]},t.key)})})]}),e.jsx("div",{className:"flex flex-1 flex-col min-w-0 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto w-full max-w-3xl px-8 py-8",children:[e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-foreground",children:d.label}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:d.desc}),j&&!c&&e.jsxs("p",{className:"text-[11px] text-muted-foreground/60 mt-1",children:["Last modified ",new Date(j*1e3).toLocaleString()]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:c?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:L,disabled:a,className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[e.jsx(U,{className:"size-4"}),"Cancel"]}),e.jsxs("button",{onClick:q,disabled:a,className:i("inline-flex items-center gap-1.5 rounded-lg px-4 py-1.5 text-sm font-medium transition-colors","bg-primary text-primary-foreground hover:bg-primary/90",a&&"opacity-60 cursor-not-allowed"),children:[a?e.jsx(w,{className:"size-4 animate-spin"}):e.jsx(B,{className:"size-4"}),a?"Saving...":"Save"]})]}):e.jsxs("button",{onClick:v,className:"inline-flex items-center gap-1.5 rounded-lg px-4 py-1.5 text-sm font-medium bg-muted text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors",children:[e.jsx(k,{className:"size-4"}),"Edit"]})})]})}),y&&e.jsx("div",{className:"mb-6 rounded-lg border border-red-200 dark:border-red-800/40 bg-red-50 dark:bg-red-950/20 px-4 py-2.5",children:e.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 flex items-center gap-1.5",children:[e.jsx(C,{className:"size-3.5 shrink-0"}),y]})}),e.jsx("div",{className:"rounded-xl border border-border bg-card p-8",children:c?e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("textarea",{value:g,onChange:t=>b(t.target.value),className:i("w-full min-h-[420px] rounded-lg border border-border bg-background p-4 font-mono text-sm leading-relaxed","focus:outline-none focus:ring-2 focus:ring-primary/15 focus:border-primary/40","resize-y placeholder:text-muted-foreground/30"),placeholder:`Write your ${d.label.toLowerCase()} using Markdown...`,spellCheck:!1,autoFocus:!0}),e.jsx("p",{className:"text-[11px] text-muted-foreground/50",children:"Markdown formatting is supported — headers, lists, code blocks, links, and more."})]}):u?e.jsx("div",{className:i("max-w-none","[&_h1]:mt-8 [&_h1]:mb-4 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:tracking-tight [&_h1]:text-foreground","[&_h2]:mt-7 [&_h2]:mb-3 [&_h2]:text-xl [&_h2]:font-semibold [&_h2]:tracking-tight [&_h2]:text-foreground","[&_h3]:mt-6 [&_h3]:mb-2.5 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:text-foreground","[&_h4]:mt-5 [&_h4]:mb-2 [&_h4]:text-base [&_h4]:font-medium [&_h4]:text-foreground","[&_h5]:mt-4 [&_h5]:mb-1.5 [&_h5]:text-sm [&_h5]:font-medium [&_h5]:text-foreground/90","[&_h6]:mt-4 [&_h6]:mb-1.5 [&_h6]:text-sm [&_h6]:font-medium [&_h6]:text-muted-foreground","[&_p]:my-4 [&_p]:leading-[1.75] [&_p]:text-foreground/85","[&_ul]:my-4 [&_ul]:pl-6 [&_ul]:list-disc [&_ul]:space-y-1.5 [&_ul]:marker:text-muted-foreground/40","[&_ol]:my-4 [&_ol]:pl-6 [&_ol]:list-decimal [&_ol]:space-y-1.5 [&_ol]:marker:text-muted-foreground/40","[&_li]:leading-relaxed [&_li]:text-foreground/85","[&_:not(pre)>code]:rounded-md [&_:not(pre)>code]:bg-muted/70 [&_:not(pre)>code]:px-1.5 [&_:not(pre)>code]:py-0.5 [&_:not(pre)>code]:text-[13px] [&_:not(pre)>code]:font-mono [&_:not(pre)>code]:text-foreground/90 [&_:not(pre)>code]:border [&_:not(pre)>code]:border-border/50","[&_pre]:my-5 [&_pre]:rounded-xl [&_pre]:bg-muted/50 [&_pre]:border [&_pre]:border-border/60 [&_pre]:px-5 [&_pre]:py-4 [&_pre]:text-[13px] [&_pre]:leading-relaxed [&_pre]:overflow-x-auto [&_pre]:font-mono [&_pre]:whitespace-pre-wrap","[&_blockquote]:my-5 [&_blockquote]:border-l-[3px] [&_blockquote]:border-amber-400 dark:[&_blockquote]:border-amber-500 [&_blockquote]:pl-4 [&_blockquote]:text-muted-foreground [&_blockquote]:italic [&_blockquote]:leading-relaxed","[&_hr]:my-8 [&_hr]:border-border/40","[&_table]:w-full [&_table]:my-4 [&_table]:text-sm","[&_th]:border [&_th]:border-border [&_th]:bg-muted/60 [&_th]:px-4 [&_th]:py-2.5 [&_th]:text-left [&_th]:font-medium [&_th]:text-foreground/80 [&_th]:text-xs [&_th]:uppercase [&_th]:tracking-wider","[&_td]:border [&_td]:border-border [&_td]:px-4 [&_td]:py-2.5 [&_td]:text-foreground/80","[&_img]:rounded-xl [&_img]:my-5 [&_img]:max-w-full","[&>*:first-child]:mt-0 [&>*:last-child]:mb-0"),children:e.jsx(G,{remarkPlugins:[O],components:$,children:u})}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-4",children:[e.jsx("div",{className:"flex size-14 items-center justify-center rounded-2xl bg-muted/50 border border-border/50",children:e.jsx(d.icon,{className:"size-6 text-muted-foreground/30"})}),e.jsxs("div",{className:"text-center max-w-xs",children:[e.jsx("p",{className:"text-sm font-medium text-foreground/70",children:d.emptyLabel}),e.jsx("p",{className:"text-xs text-muted-foreground/50 mt-1.5",children:"You can format your content with Markdown — headers, lists, code blocks, and more."})]}),e.jsxs("button",{onClick:v,className:"inline-flex items-center gap-1.5 rounded-lg px-4 py-2 text-sm font-medium bg-muted hover:bg-muted/80 text-foreground/80 transition-colors",children:[e.jsx(k,{className:"size-3.5"}),"Start Editing"]})]})})]})})]})}const te=H;export{te as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as I,r as l,j as e,d as u,x as q,z as C,p as F,A as J,C as L,B as y,y as D,I as A,E as K,h as E}from"./index-DkYGodJj.js";import{I as _}from"./input-eNcwlDHp.js";import{I as Q,T as B,a as P,b as W}from"./textarea-Di_syYTS.js";import{I as H}from"./IconRefresh-Dgm93w3T.js";import{I as U}from"./IconLoader2-BIx3OuF9.js";const O=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],G=I("outline","calendar","Calendar",O);const V=[["path",{d:"M7 4v16l13 -8l-13 -8",key:"svg-0"}]],X=I("outline","player-play","PlayerPlay",V);const Y=[["path",{d:"M7 6a7.75 7.75 0 1 0 10 0",key:"svg-0"}],["path",{d:"M12 4l0 8",key:"svg-1"}]],Z=I("outline","power","Power",Y),T=l.createContext(null);function ee(){const t=l.useContext(T);if(!t)throw new Error("Dialog components must be used within <Dialog>");return t}function te({open:t,onOpenChange:s,children:o}){const a=l.useCallback(r=>s(r),[s]);return l.useEffect(()=>{if(!t)return;const r=d=>{d.key==="Escape"&&a(!1)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,a]),t?e.jsxs(T.Provider,{value:{open:t,setOpen:a},children:[e.jsx("div",{className:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm",onClick:()=>a(!1)}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsx("div",{className:"relative w-full max-w-lg rounded-xl border border-border bg-card shadow-xl",onClick:r=>r.stopPropagation(),children:o})})]}):null}function se({children:t,className:s}){return ee(),e.jsx("div",{className:u("p-5",s),children:t})}function re({children:t,className:s}){return e.jsx("div",{className:u("mb-4",s),children:t})}function ne({children:t,className:s}){return e.jsx("h2",{className:u("text-base font-semibold",s),children:t})}function oe({children:t,className:s}){return e.jsx("div",{className:u("flex items-center justify-end gap-2 mt-4",s),children:t})}function v(t){return t.job_id||t.id||""}function ae(t){return t.name||v(t)||"Untitled"}function R(t){const s=t.trim().split(/\s+/);if(s.length<2)return t;const o=parseInt(s[0],10),a=parseInt(s[1],10);if(isNaN(o)||isNaN(a))return t;if(s[1]==="*")return`At minute ${o} past every hour`;const r=new Date(0,0,0,a,o).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0});if(s.length>=5){const d=s.slice(2,5).join(" ");if(d==="* * 1-5")return`${r} weekdays`;if(d==="* * 0,6")return`${r} weekends`}return`${r} daily`}function z(t){if(!t)return"—";if(typeof t=="string")return R(t);const s=t.display||t.expr||JSON.stringify(t);return R(s)}function ie(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/1024/1024).toFixed(1)}MB`}function le(t){const s=new Date(t),o=Date.now()-s.getTime(),a=Math.floor(o/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;const r=Math.floor(a/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function de(t){return new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function ce(){return D({queryKey:["cron","jobs"],queryFn:()=>E("/api/cron-history/jobs"),refetchInterval:3e4})}function ue(t){return D({queryKey:["cron","runs",t],queryFn:()=>E("/api/cron-history"),refetchInterval:15e3})}function me(t,s,o){if(o==="hourly")return`${s} * * * *`;const a=`${s} ${t}`;return o==="weekdays"?`${a} * * 1-5`:o==="weekends"?`${a} * * 0,6`:`${a} * * *`}function xe(t,s,o){return o==="hourly"?`At minute ${s} past every hour`:`Runs ${new Date(0,0,0,t,s).toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})} ${o==="weekdays"?"on weekdays":o==="weekends"?"on weekends":"daily"}`}const he=[{label:"Every hour",dayMode:"hourly",hour:0,minute:0},{label:"Daily 9AM",dayMode:"daily",hour:9,minute:0},{label:"Daily noon",dayMode:"daily",hour:12,minute:0},{label:"Daily 6PM",dayMode:"daily",hour:18,minute:0},{label:"Weekdays 9AM",dayMode:"weekdays",hour:9,minute:0},{label:"Weekdays noon",dayMode:"weekdays",hour:12,minute:0}];function fe({value:t,onChange:s}){const[o,a]=l.useState("daily"),[r,d]=l.useState(9),[c,h]=l.useState(0),[f,p]=l.useState(!1),[g,b]=l.useState(t||""),x=l.useMemo(()=>{if(!t)return null;const i=t.trim().split(/\s+/);if(i.length<2)return null;const m=parseInt(i[0],10),j=parseInt(i[1],10);return isNaN(m)||isNaN(j)?null:{hour:j,minute:m}},[]),w=l.useRef(!1);l.useEffect(()=>{if(w.current||!x)return;w.current=!0,d(x.hour),h(x.minute);const i=t.trim().split(/\s+/);if(i.length>=5){const m=i.slice(2,5).join(" ");m==="* * 1-5"?a("weekdays"):m==="* * 0,6"?a("weekends"):(m==="* * *"||i[2]==="*")&&a("daily"),i[1]==="*"&&a("hourly")}b(t)},[x,t]);const N=l.useMemo(()=>me(r,c,o),[r,c,o]),S=l.useMemo(()=>xe(r,c,o),[r,c,o]),M=i=>{const[m,j]=i.target.value.split(":").map(Number);isNaN(m)||d(m),isNaN(j)||h(j),o==="hourly"&&a("daily")},$=i=>{d(i.hour),h(i.minute),a(i.dayMode)},n=i=>{b(i.target.value)},k=f?g:N;return l.useEffect(()=>{s(k)},[k]),e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Schedule"}),f?e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{value:g,onChange:n,placeholder:"0 9 * * *",className:"h-9 text-sm font-mono"}),e.jsxs("p",{className:"text-[10px] text-muted-foreground flex items-center gap-1.5",children:["minute hour day month weekday",e.jsx("button",{type:"button",onClick:()=>p(!1),className:"underline underline-offset-2 hover:text-foreground ml-auto transition-colors",children:"Use time picker"})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"time",value:`${String(r).padStart(2,"0")}:${String(c).padStart(2,"0")}`,onChange:M,className:"flex h-10 w-full rounded-lg border border-input bg-background px-3 py-2 text-sm shadow-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"}),e.jsx("div",{className:"flex rounded-lg border border-border overflow-hidden text-xs font-medium",children:[{value:"daily",label:"Every day"},{value:"weekdays",label:"Weekdays"},{value:"weekends",label:"Weekends"}].map((i,m)=>e.jsx("button",{type:"button",onClick:()=>a(i.value),className:u("flex-1 px-3 py-1.5 transition-colors text-center",m>0&&"border-l border-border",o===i.value?"bg-primary text-primary-foreground font-semibold":"bg-background text-muted-foreground hover:bg-muted"),children:i.label},i.value))}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:he.map(i=>e.jsx("button",{type:"button",onClick:()=>$(i),className:u("px-2.5 py-1 rounded-md text-[11px] font-medium transition-colors",r===i.hour&&c===i.minute&&o===i.dayMode?"bg-emerald-500/10 text-emerald-600 border border-emerald-500/20 shadow-xs":"bg-muted/50 text-muted-foreground border border-border/50 hover:bg-muted hover:text-foreground"),children:i.label},i.label))}),e.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[e.jsx(P,{className:"h-3.5 w-3.5"}),S]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("code",{className:"text-[11px] text-muted-foreground/60 font-mono",children:N}),e.jsx("button",{type:"button",onClick:()=>{b(N),p(!0)},className:"text-[10px] text-muted-foreground/40 hover:text-muted-foreground underline underline-offset-2 transition-colors",children:"Raw cron"})]})]})]})}function pe({status:t}){if(!t)return e.jsx("div",{className:"h-2 w-2 rounded-full bg-muted-foreground/30"});const s=t==="ok"||t==="success"||t==="completed";return e.jsx("div",{className:u("h-2 w-2 rounded-full",s?"bg-emerald-500":"bg-red-500")})}function ge({job:t,onEdit:s,onDelete:o,onToggle:a}){return e.jsxs("div",{className:u("rounded-xl border bg-card p-5 transition-colors group relative",t.enabled!==!1?"border-border hover:border-emerald-500/30":"border-border opacity-60"),children:[e.jsxs("div",{className:"absolute top-3 right-3 flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(y,{variant:"ghost",size:"icon-sm",className:"h-7 w-7",onClick:r=>{r.stopPropagation(),a()},title:t.enabled!==!1?"Disable":"Enable",children:e.jsx(Z,{className:u("h-3.5 w-3.5",t.enabled!==!1?"text-emerald-500":"text-muted-foreground")})}),e.jsx(y,{variant:"ghost",size:"icon-sm",className:"h-7 w-7",onClick:r=>{r.stopPropagation(),s()},title:"Edit",children:e.jsx(A,{className:"h-3.5 w-3.5 text-muted-foreground"})}),e.jsx(y,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 hover:text-red-500",onClick:r=>{r.stopPropagation(),o()},title:"Delete",children:e.jsx(K,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.jsx("div",{className:u("h-8 w-8 rounded-lg flex items-center justify-center shrink-0",t.enabled!==!1?"bg-emerald-500/10 text-emerald-600":"bg-muted text-muted-foreground"),children:e.jsx(P,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold truncate pr-20",children:ae(t)}),e.jsx("p",{className:"text-[11px] text-muted-foreground font-mono",children:z(t.schedule)})]})]}),e.jsx(pe,{status:t.last_status})]}),t.prompt&&e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed line-clamp-2 mb-3",children:t.prompt}),e.jsxs("div",{className:"flex items-center gap-4 text-[11px] text-muted-foreground",children:[t.run_count!=null&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(X,{className:"h-3 w-3"}),t.run_count," runs"]}),t.next_run_at&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(G,{className:"h-3 w-3"}),"Next: ",de(t.next_run_at)]}),t.last_run_at&&e.jsx("span",{children:le(t.last_run_at)})]})]})}function be({run:t}){const[s,o]=l.useState(!1),a=D({queryKey:["cron","run",t.jobId,t.fileName],queryFn:()=>E(`/api/cron-history/${encodeURIComponent(t.jobId)}/${encodeURIComponent(t.fileName)}`),enabled:s});return e.jsxs("div",{className:"border-b border-border/50 last:border-b-0",children:[e.jsxs("button",{onClick:()=>o(!s),className:"flex w-full items-center gap-3 px-4 py-2.5 text-left hover:bg-muted/30 transition-colors group",children:[e.jsx(W,{className:u("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",s&&"rotate-90")}),e.jsx("span",{className:"text-xs font-medium text-foreground/80 min-w-[80px]",children:t.jobId}),e.jsx("span",{className:"text-xs text-muted-foreground flex-1",children:t.runTime}),e.jsx("span",{className:"text-[10px] text-muted-foreground/60 font-mono shrink-0",children:ie(t.size)})]}),s&&e.jsx("div",{className:"px-4 pb-4 pl-10",children:a.isLoading?e.jsxs("div",{className:"flex items-center gap-2 py-3 text-muted-foreground text-xs",children:[e.jsx(U,{className:"h-3.5 w-3.5 animate-spin"}),"Loading..."]}):e.jsx("pre",{className:"text-[12px] font-mono leading-relaxed whitespace-pre-wrap text-foreground/80 bg-muted/30 rounded-lg p-3 border border-border/50 max-h-[400px] overflow-auto",children:a.data?.content||"No output"})})]})}function ye(){const t=q(),s=ce(),o=ue(null),[a,r]=l.useState(!1),[d,c]=l.useState(null),[h,f]=l.useState(""),[p,g]=l.useState(""),[b,x]=l.useState(""),w=l.useCallback(()=>{s.refetch(),o.refetch()},[s,o]),N=C({mutationFn:n=>F("/api/cron-history/jobs",n),onSuccess:()=>{t.invalidateQueries({queryKey:["cron","jobs"]}),r(!1)}}),S=C({mutationFn:({id:n,data:k})=>J(`/api/cron-history/jobs/${n}`,k),onSuccess:()=>{t.invalidateQueries({queryKey:["cron","jobs"]}),c(null),r(!1)}}),M=C({mutationFn:n=>L(`/api/cron-history/jobs/${n}`),onSuccess:()=>t.invalidateQueries({queryKey:["cron","jobs"]})}),$=C({mutationFn:n=>F(`/api/cron-history/jobs/${n}/toggle`,{}),onSuccess:()=>t.invalidateQueries({queryKey:["cron","jobs"]})});return e.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"shrink-0 border-b px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold",children:"Automations"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Scheduled cron jobs managed by the Hermes agent"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(y,{size:"sm",variant:"outline",className:"gap-1.5",onClick:()=>{c(null),f(""),g(""),x(""),r(!0)},children:[e.jsx(Q,{className:"h-4 w-4"}),"New Job"]}),e.jsx("button",{onClick:w,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(H,{className:u("h-4 w-4",(s.isFetching||o.isFetching)&&"animate-spin")})})]})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[e.jsx(te,{open:a,onOpenChange:n=>{n||(r(!1),c(null))},children:e.jsxs(se,{children:[e.jsx(re,{children:e.jsx(ne,{children:d?"Edit Cron Job":"New Cron Job"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Name"}),e.jsx(_,{value:h,onChange:n=>f(n.target.value),placeholder:"e.g. Daily weather report",className:"h-9 text-sm"})]}),e.jsx(fe,{value:p,onChange:g}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1 block",children:"Prompt"}),e.jsx(B,{value:b,onChange:n=>x(n.target.value),placeholder:"What should the agent do when this job runs?",className:"min-h-[80px] text-sm",rows:4})]})]}),e.jsxs(oe,{children:[e.jsx(y,{size:"sm",variant:"ghost",onClick:()=>{r(!1),c(null)},children:"Cancel"}),e.jsx(y,{size:"sm",disabled:!h.trim()||!p.trim(),onClick:()=>{const n={name:h.trim(),schedule:p.trim(),prompt:b.trim()};d?S.mutate({id:v(d),data:n}):N.mutate(n)},children:d?"Save Changes":"Create Job"})]})]})}),e.jsxs("div",{className:"px-6 pt-5 pb-2",children:[e.jsx("h2",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-3",children:"Jobs"}),s.isLoading?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(n=>e.jsx("div",{className:"rounded-xl border border-border bg-card h-36 animate-pulse",children:e.jsxs("div",{className:"p-5 space-y-3",children:[e.jsx("div",{className:"h-4 bg-muted rounded w-1/2"}),e.jsx("div",{className:"h-3 bg-muted rounded w-3/4"}),e.jsx("div",{className:"h-3 bg-muted rounded w-full"})]})},n))}):s.data?.jobs?.length?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:s.data.jobs.map(n=>e.jsx(ge,{job:n,onEdit:()=>{c(n),f(n.name||""),g(z(n.schedule)),x(n.prompt||""),r(!0)},onDelete:()=>M.mutate(v(n)),onToggle:()=>$.mutate(v(n))},v(n)))}):e.jsxs("div",{className:"rounded-xl border border-dashed border-border bg-muted/20 py-12 text-center",children:[e.jsx(P,{className:"h-8 w-8 text-muted-foreground/40 mx-auto mb-3"}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:"No cron jobs yet"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Click ",e.jsx("span",{className:"font-medium",children:"New Job"})," to create one"]})]})]}),e.jsxs("div",{className:"px-6 pb-6",children:[e.jsx("h2",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-3 mt-6",children:"Run History"}),o.isLoading?e.jsx("div",{className:"space-y-1",children:[1,2,3,4,5].map(n=>e.jsx("div",{className:"h-10 bg-muted/30 rounded animate-pulse"},n))}):o.data?.runs?.length?e.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:o.data.runs.slice(0,50).map(n=>e.jsx(be,{run:n},`${n.jobId}/${n.fileName}`))}):e.jsx("div",{className:"rounded-xl border border-dashed border-border bg-muted/20 py-10 text-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No runs yet"})})]})]})]})}const Ce=ye;export{Ce as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ac as Zt,j as hn}from"./index-DKYPj90W.js";function Nc(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(i,r).trim();(l||!o)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function pi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const mi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,di={};function ct(e,t){return(di.jsx?gi:mi).test(e)}const yi=/[ \t\n\f\r]/g;function ki(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(yi,"")===""}class Ye{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ye.prototype.normal={};Ye.prototype.property={};Ye.prototype.space=void 0;function er(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ye(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let xi=0;const _=Ee(),Y=Ee(),Dn=Ee(),E=Ee(),W=Ee(),De=Ee(),te=Ee();function Ee(){return 2**++xi}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:_,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:De,number:E,overloadedBoolean:Dn,spaceSeparated:W},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),ht(this,"space",i),typeof r=="number")for(;++o<pn.length;){const l=pn[o];ht(this,pn[o],(r&Ln[l])===Ln[l])}}}Hn.prototype.defined=!0;function ht(e,t,n){n&&(e[t]=n)}function Fe(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Hn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[zn(r)]=r,n[zn(o.attribute)]=r}return new Ye(t,n,e.space)}const nr=Fe({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:E,ariaColIndex:E,ariaColSpan:E,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:W,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:E,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:E,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:W,ariaRowCount:E,ariaRowIndex:E,ariaRowSpan:E,ariaSelected:Y,ariaSetSize:E,ariaSort:null,ariaValueMax:E,ariaValueMin:E,ariaValueNow:E,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tr(e,t){return t in e?e[t]:t}function rr(e,t){return tr(e,t.toLowerCase())}const bi=Fe({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:De,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:_,allowPaymentRequest:_,allowUserMedia:_,alt:null,as:null,async:_,autoCapitalize:null,autoComplete:W,autoFocus:_,autoPlay:_,blocking:W,capture:null,charSet:null,checked:_,cite:null,className:W,cols:E,colSpan:null,content:null,contentEditable:Y,controls:_,controlsList:W,coords:E|De,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_,defer:_,dir:null,dirName:null,disabled:_,download:Dn,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_,formTarget:null,headers:W,height:E,hidden:Dn,high:E,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:_,inputMode:null,integrity:null,is:null,isMap:_,itemId:null,itemProp:W,itemRef:W,itemScope:_,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_,low:E,manifest:null,max:null,maxLength:E,media:null,method:null,min:null,minLength:E,multiple:_,muted:_,name:null,nonce:null,noModule:_,noValidate:_,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:_,optimum:E,pattern:null,ping:W,placeholder:null,playsInline:_,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_,referrerPolicy:null,rel:W,required:_,reversed:_,rows:E,rowSpan:E,sandbox:W,scope:null,scoped:_,seamless:_,selected:_,shadowRootClonable:_,shadowRootDelegatesFocus:_,shadowRootMode:null,shape:null,size:E,sizes:null,slot:null,span:E,spellCheck:Y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:E,step:null,style:null,tabIndex:E,target:null,title:null,translate:null,type:null,typeMustMatch:_,useMap:null,value:Y,width:E,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,axis:null,background:null,bgColor:null,border:E,borderColor:null,bottomMargin:E,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_,declare:_,event:null,face:null,frame:null,frameBorder:null,hSpace:E,leftMargin:E,link:null,longDesc:null,lowSrc:null,marginHeight:E,marginWidth:E,noResize:_,noHref:_,noShade:_,noWrap:_,object:null,profile:null,prompt:null,rev:null,rightMargin:E,rules:null,scheme:null,scrolling:Y,standby:null,summary:null,text:null,topMargin:E,valueType:null,version:null,vAlign:null,vLink:null,vSpace:E,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:_,disableRemotePlayback:_,prefix:null,property:null,results:E,security:null,unselectable:null},space:"html",transform:rr}),wi=Fe({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:te,accentHeight:E,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:E,amplitude:E,arabicForm:null,ascent:E,attributeName:null,attributeType:null,azimuth:E,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:E,by:null,calcMode:null,capHeight:E,className:W,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:E,diffuseConstant:E,direction:null,display:null,dur:null,divisor:E,dominantBaseline:null,download:_,dx:null,dy:null,edgeMode:null,editable:null,elevation:E,enableBackground:null,end:null,event:null,exponent:E,externalResourcesRequired:null,fill:null,fillOpacity:E,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:De,g2:De,glyphName:De,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:E,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:E,horizOriginX:E,horizOriginY:E,id:null,ideographic:E,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:E,k:E,k1:E,k2:E,k3:E,k4:E,kernelMatrix:te,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:E,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:E,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:E,overlineThickness:E,paintOrder:null,panose1:null,path:null,pathLength:E,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:E,pointsAtY:E,pointsAtZ:E,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:te,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:te,rev:te,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:te,requiredFeatures:te,requiredFonts:te,requiredFormats:te,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:E,specularExponent:E,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:E,strikethroughThickness:E,string:null,stroke:null,strokeDashArray:te,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:E,strokeOpacity:E,strokeWidth:null,style:null,surfaceScale:E,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:te,tabIndex:E,tableValues:null,target:null,targetX:E,targetY:E,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:te,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:E,underlineThickness:E,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:E,values:null,vAlphabetic:E,vMathematical:E,vectorEffect:null,vHanging:E,vIdeographic:E,version:null,vertAdvY:E,vertOriginX:E,vertOriginY:E,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:E,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tr}),ir=Fe({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),lr=Fe({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rr}),or=Fe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Si={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Ci=/[A-Z]/g,pt=/-[a-z]/g,Ei=/^data[-\w.:]+$/i;function Ii(e,t){const n=zn(t);let r=t,i=ee;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ei.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(pt,Ti);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!pt.test(o)){let l=o.replace(Ci,Ai);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function Ai(e){return"-"+e.toLowerCase()}function Ti(e){return e.charAt(1).toUpperCase()}const Pi=er([nr,bi,ir,lr,or],"html"),Un=er([nr,wi,ir,lr,or],"svg");function Bc(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function vi(e){return e.join(" ").trim()}var Pe={},mn,mt;function zi(){if(mt)return mn;mt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
|
|
1
|
+
import{a2 as Zt,j as hn}from"./index-DkYGodJj.js";function Nc(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(i,r).trim();(l||!o)&&t.push(l),i=r+1,r=n.indexOf(",",i)}return t}function pi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const mi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,di={};function ct(e,t){return(di.jsx?gi:mi).test(e)}const yi=/[ \t\n\f\r]/g;function ki(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(yi,"")===""}class Ye{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ye.prototype.normal={};Ye.prototype.property={};Ye.prototype.space=void 0;function er(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ye(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let xi=0;const _=Ee(),Y=Ee(),Dn=Ee(),E=Ee(),W=Ee(),De=Ee(),te=Ee();function Ee(){return 2**++xi}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:_,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:De,number:E,overloadedBoolean:Dn,spaceSeparated:W},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),ht(this,"space",i),typeof r=="number")for(;++o<pn.length;){const l=pn[o];ht(this,pn[o],(r&Ln[l])===Ln[l])}}}Hn.prototype.defined=!0;function ht(e,t,n){n&&(e[t]=n)}function Fe(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Hn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[zn(r)]=r,n[zn(o.attribute)]=r}return new Ye(t,n,e.space)}const nr=Fe({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:E,ariaColIndex:E,ariaColSpan:E,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:W,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:E,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:E,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:W,ariaRowCount:E,ariaRowIndex:E,ariaRowSpan:E,ariaSelected:Y,ariaSetSize:E,ariaSort:null,ariaValueMax:E,ariaValueMin:E,ariaValueNow:E,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tr(e,t){return t in e?e[t]:t}function rr(e,t){return tr(e,t.toLowerCase())}const bi=Fe({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:De,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:_,allowPaymentRequest:_,allowUserMedia:_,alt:null,as:null,async:_,autoCapitalize:null,autoComplete:W,autoFocus:_,autoPlay:_,blocking:W,capture:null,charSet:null,checked:_,cite:null,className:W,cols:E,colSpan:null,content:null,contentEditable:Y,controls:_,controlsList:W,coords:E|De,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_,defer:_,dir:null,dirName:null,disabled:_,download:Dn,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_,formTarget:null,headers:W,height:E,hidden:Dn,high:E,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:_,inputMode:null,integrity:null,is:null,isMap:_,itemId:null,itemProp:W,itemRef:W,itemScope:_,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_,low:E,manifest:null,max:null,maxLength:E,media:null,method:null,min:null,minLength:E,multiple:_,muted:_,name:null,nonce:null,noModule:_,noValidate:_,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:_,optimum:E,pattern:null,ping:W,placeholder:null,playsInline:_,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_,referrerPolicy:null,rel:W,required:_,reversed:_,rows:E,rowSpan:E,sandbox:W,scope:null,scoped:_,seamless:_,selected:_,shadowRootClonable:_,shadowRootDelegatesFocus:_,shadowRootMode:null,shape:null,size:E,sizes:null,slot:null,span:E,spellCheck:Y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:E,step:null,style:null,tabIndex:E,target:null,title:null,translate:null,type:null,typeMustMatch:_,useMap:null,value:Y,width:E,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,axis:null,background:null,bgColor:null,border:E,borderColor:null,bottomMargin:E,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_,declare:_,event:null,face:null,frame:null,frameBorder:null,hSpace:E,leftMargin:E,link:null,longDesc:null,lowSrc:null,marginHeight:E,marginWidth:E,noResize:_,noHref:_,noShade:_,noWrap:_,object:null,profile:null,prompt:null,rev:null,rightMargin:E,rules:null,scheme:null,scrolling:Y,standby:null,summary:null,text:null,topMargin:E,valueType:null,version:null,vAlign:null,vLink:null,vSpace:E,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:_,disableRemotePlayback:_,prefix:null,property:null,results:E,security:null,unselectable:null},space:"html",transform:rr}),wi=Fe({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:te,accentHeight:E,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:E,amplitude:E,arabicForm:null,ascent:E,attributeName:null,attributeType:null,azimuth:E,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:E,by:null,calcMode:null,capHeight:E,className:W,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:E,diffuseConstant:E,direction:null,display:null,dur:null,divisor:E,dominantBaseline:null,download:_,dx:null,dy:null,edgeMode:null,editable:null,elevation:E,enableBackground:null,end:null,event:null,exponent:E,externalResourcesRequired:null,fill:null,fillOpacity:E,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:De,g2:De,glyphName:De,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:E,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:E,horizOriginX:E,horizOriginY:E,id:null,ideographic:E,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:E,k:E,k1:E,k2:E,k3:E,k4:E,kernelMatrix:te,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:E,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:E,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:E,overlineThickness:E,paintOrder:null,panose1:null,path:null,pathLength:E,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:E,pointsAtY:E,pointsAtZ:E,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:te,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:te,rev:te,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:te,requiredFeatures:te,requiredFonts:te,requiredFormats:te,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:E,specularExponent:E,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:E,strikethroughThickness:E,string:null,stroke:null,strokeDashArray:te,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:E,strokeOpacity:E,strokeWidth:null,style:null,surfaceScale:E,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:te,tabIndex:E,tableValues:null,target:null,targetX:E,targetY:E,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:te,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:E,underlineThickness:E,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:E,values:null,vAlphabetic:E,vMathematical:E,vectorEffect:null,vHanging:E,vIdeographic:E,version:null,vertAdvY:E,vertOriginX:E,vertOriginY:E,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:E,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tr}),ir=Fe({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),lr=Fe({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rr}),or=Fe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Si={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Ci=/[A-Z]/g,pt=/-[a-z]/g,Ei=/^data[-\w.:]+$/i;function Ii(e,t){const n=zn(t);let r=t,i=ee;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ei.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(pt,Ti);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!pt.test(o)){let l=o.replace(Ci,Ai);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function Ai(e){return"-"+e.toLowerCase()}function Ti(e){return e.charAt(1).toUpperCase()}const Pi=er([nr,bi,ir,lr,or],"html"),Un=er([nr,wi,ir,lr,or],"svg");function Bc(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function vi(e){return e.join(" ").trim()}var Pe={},mn,mt;function zi(){if(mt)return mn;mt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
|
|
2
2
|
`,s="/",f="*",c="",p="comment",h="declaration";function d(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var I=1,C=1;function F(D){var T=D.match(t);T&&(I+=T.length);var q=D.lastIndexOf(u);C=~q?D.length-q:C+D.length}function R(){var D={line:I,column:C};return function(T){return T.position=new b(D),j(),T}}function b(D){this.start=D,this.end={line:I,column:C},this.source=y.source}b.prototype.content=S;function M(D){var T=new Error(y.source+":"+I+":"+C+": "+D);if(T.reason=D,T.filename=y.source,T.line=I,T.column=C,T.source=S,!y.silent)throw T}function H(D){var T=D.exec(S);if(T){var q=T[0];return F(q),S=S.slice(q.length),T}}function j(){H(n)}function k(D){var T;for(D=D||[];T=P();)T!==!1&&D.push(T);return D}function P(){var D=R();if(!(s!=S.charAt(0)||f!=S.charAt(1))){for(var T=2;c!=S.charAt(T)&&(f!=S.charAt(T)||s!=S.charAt(T+1));)++T;if(T+=2,c===S.charAt(T-1))return M("End of comment missing");var q=S.slice(2,T-2);return C+=2,F(q),S=S.slice(T),C+=2,D({type:p,comment:q})}}function v(){var D=R(),T=H(r);if(T){if(P(),!H(i))return M("property missing ':'");var q=H(o),X=D({type:h,property:w(T[0].replace(e,c)),value:q?w(q[0].replace(e,c)):c});return H(l),X}}function U(){var D=[];k(D);for(var T;T=v();)T!==!1&&(D.push(T),k(D));return D}return j(),U()}function w(S){return S?S.replace(a,c):c}return mn=d,mn}var gt;function Di(){if(gt)return Pe;gt=1;var e=Pe&&Pe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.default=n;const t=e(zi());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:s,value:f}=u;a?i(s,f,u):f&&(o=o||{},o[s]=f)}),o}return Pe}var Ne={},dt;function Li(){if(dt)return Ne;dt=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(s){return!s||n.test(s)||e.test(s)},l=function(s,f){return f.toUpperCase()},a=function(s,f){return"".concat(f,"-")},u=function(s,f){return f===void 0&&(f={}),o(s)?s:(s=s.toLowerCase(),f.reactCompat?s=s.replace(i,a):s=s.replace(r,a),s.replace(t,l))};return Ne.camelCase=u,Ne}var Be,yt;function Fi(){if(yt)return Be;yt=1;var e=Be&&Be.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Di()),n=Li();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,u){a&&u&&(l[(0,n.camelCase)(a,o)]=u)}),l}return r.default=r,Be=r,Be}var Ri=Fi();const _i=Zt(Ri),ar=ur("end"),qn=ur("start");function ur(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Oi(e){const t=qn(e),n=ar(e);if(t&&n)return{start:t,end:n}}function Ue(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?kt(e.position):"start"in e||"end"in e?kt(e):"line"in e||"column"in e?Fn(e):""}function Fn(e){return xt(e&&e.line)+":"+xt(e&&e.column)}function kt(e){return Fn(e&&e.start)+"-"+Fn(e&&e.end)}function xt(e){return e&&typeof e=="number"?e:1}class K extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ue(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K.prototype.file="";K.prototype.name="";K.prototype.reason="";K.prototype.message="";K.prototype.stack="";K.prototype.column=void 0;K.prototype.line=void 0;K.prototype.ancestors=void 0;K.prototype.cause=void 0;K.prototype.fatal=void 0;K.prototype.place=void 0;K.prototype.ruleId=void 0;K.prototype.source=void 0;const Vn={}.hasOwnProperty,Mi=new Map,Ni=/[A-Z]/g,Bi=new Set(["table","tbody","thead","tfoot","tr"]),ji=new Set(["td","th"]),sr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Hi(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Qi(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Xi(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Un:Pi,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=cr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function cr(e,t,n){if(t.type==="element")return Ui(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return qi(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return $i(e,t,n);if(t.type==="mdxjsEsm")return Vi(e,t);if(t.type==="root")return Wi(e,t,n);if(t.type==="text")return Yi(e,t)}function Ui(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=hr(e,t.tagName,!1),l=Gi(e,t);let a=Wn(e,t);return Bi.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!ki(u):!0})),fr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function qi(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}$e(e,t.position)}function Vi(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$e(e,t.position)}function $i(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:hr(e,t.name,!0),l=Ki(e,t),a=Wn(e,t);return fr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Wi(e,t,n){const r={};return $n(r,Wn(e,t)),e.create(t,e.Fragment,r,n)}function Yi(e,t){return t.value}function fr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $n(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Xi(e,t,n){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?n:t;return a?s(o,l,a):s(o,l)}}function Qi(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),u=qn(r);return t(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Gi(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Vn.call(t.properties,i)){const o=Ji(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&ji.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Ki(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else $e(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else $e(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Mi;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const s=i.get(u)||0;l=u+"-"+s,i.set(u,s+1)}}const a=cr(e,o,l);a!==void 0&&n.push(a)}return n}function Ji(e,t,n){const r=Ii(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?pi(n):vi(n)),r.property==="style"){let i=typeof n=="object"?n:Zi(e,String(n));return e.stylePropertyNameCase==="css"&&(i=el(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Si[r.property]||r.property:r.attribute,n]}}function Zi(e,t){try{return _i(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new K("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=sr+"#cannot-parse-style-attribute",i}}function hr(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const a=ct(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=ct(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Vn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);$e(e)}function $e(e,t){const n=new K("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=sr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function el(e){const t={};let n;for(n in e)Vn.call(e,n)&&(t[nl(n)]=e[n]);return t}function nl(e){let t=e.replace(Ni,tl);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function tl(e){return"-"+e.toLowerCase()}const gn={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},rl={};function Yn(e,t){const n=rl,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return pr(e,r,i)}function pr(e,t,n){if(il(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return bt(e.children,t,n)}return Array.isArray(e)?bt(e,t,n):""}function bt(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=pr(e[i],t,n);return r.join("")}function il(e){return!!(e&&typeof e=="object")}const wt=document.createElement("i");function Xn(e){const t="&"+e+";";wt.innerHTML=t;const n=wt.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function re(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function ie(e,t){return e.length>0?(re(e,e.length,0,t),e):t}const St={}.hasOwnProperty;function mr(e){const t={};let n=-1;for(;++n<e.length;)ll(t,e[n]);return t}function ll(e,t){let n;for(n in t){const i=(St.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){St.call(i,l)||(i[l]=[]);const a=o[l];ol(i[l],Array.isArray(a)?a:a?[a]:[])}}}function ol(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);re(e,0,0,r)}function gr(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function se(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=xe(/[A-Za-z]/),G=xe(/[\dA-Za-z]/),al=xe(/[#-'*+\--9=?A-Z^-~]/);function tn(e){return e!==null&&(e<32||e===127)}const Rn=xe(/\d/),ul=xe(/[\dA-Fa-f]/),sl=xe(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function $(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const an=xe(new RegExp("\\p{P}|\\p{S}","u")),Ce=xe(/\s/);function xe(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Re(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&G(e.charCodeAt(n+1))&&G(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return O(u)?(e.enter(n),a(u)):t(u)}function a(u){return O(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}const cl={tokenize:fl};function fl(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),B(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return z(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const hl={tokenize:pl},Ct={tokenize:ml};function pl(e){const t=this,n=[];let r=0,i,o,l;return a;function a(C){if(r<n.length){const F=n[r];return t.containerState=F[1],e.attempt(F[0].continuation,u,s)(C)}return s(C)}function u(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&I();const F=t.events.length;let R=F,b;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){b=t.events[R][1].end;break}y(r);let M=F;for(;M<t.events.length;)t.events[M][1].end={...b},M++;return re(t.events,R+1,0,t.events.slice(F)),t.events.length=M,s(C)}return a(C)}function s(C){if(r===n.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return d(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ct,f,c)(C)}function f(C){return i&&I(),y(r),p(C)}function c(C){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,d(C)}function p(C){return t.containerState={},e.attempt(Ct,h,d)(C)}function h(C){return r++,n.push([t.currentConstruct,t.containerState]),p(C)}function d(C){if(C===null){i&&I(),y(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),w(C)}function w(C){if(C===null){S(e.exit("chunkFlow"),!0),y(0),e.consume(C);return}return z(C)?(e.consume(C),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),w)}function S(C,F){const R=t.sliceStream(C);if(F&&R.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(R),t.parser.lazy[C.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<l&&(!i.events[b][1].end||i.events[b][1].end.offset>l))return;const M=t.events.length;let H=M,j,k;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(j){k=t.events[H][1].end;break}j=!0}for(y(r),b=M;b<t.events.length;)t.events[b][1].end={...k},b++;re(t.events,H+1,0,t.events.slice(M)),t.events.length=b}}function y(C){let F=n.length;for(;F-- >C;){const R=n[F];t.containerState=R[1],R[0].exit.call(t,e)}n.length=C}function I(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ml(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Le(e){if(e===null||$(e)||Ce(e))return 1;if(an(e))return 2}function un(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const _n={name:"attention",resolveAll:gl,tokenize:dl};function gl(e,t){let n=-1,r,i,o,l,a,u,s,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};Et(c,-u),Et(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ie(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=ie(s,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),s=ie(s,un(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),s=ie(s,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,s=ie(s,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,re(e,r-1,n-r+3,s),n=r+s.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function dl(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Le(r);let o;return l;function l(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=Le(u),c=!f||f===2&&i||n.includes(u),p=!i||i===2&&f||n.includes(r);return s._open=!!(o===42?c:c&&(i||!p)),s._close=!!(o===42?p:p&&(f||!c)),t(u)}}function Et(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const yl={name:"autolink",tokenize:kl};function kl(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return J(h)?(e.consume(h),l):h===64?n(h):s(h)}function l(h){return h===43||h===45||h===46||G(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||G(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||tn(h)?n(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):al(h)?(e.consume(h),s):n(h)}function f(h){return G(h)?c(h):n(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||G(h))&&r++<63){const d=h===45?p:c;return e.consume(h),d}return n(h)}}const Xe={partial:!0,tokenize:xl};function xl(e,t,n){return r;function r(o){return O(o)?B(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?t(o):n(o)}}const dr={continuation:{tokenize:wl},exit:Sl,name:"blockQuote",tokenize:bl};function bl(e,t,n){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return O(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function wl(e,t,n){const r=this;return i;function i(l){return O(l)?B(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(dr,t,n)(l)}}function Sl(e){e.exit("blockQuote")}const yr={name:"characterEscape",tokenize:Cl};function Cl(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return sl(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const kr={name:"characterReference",tokenize:El};function El(e,t,n){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,l=G,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=ul,f):(e.enter("characterReferenceValue"),o=7,l=Rn,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===G&&!Xn(r.sliceSerialize(p))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(c)&&i++<o?(e.consume(c),f):n(c)}}const It={partial:!0,tokenize:Al},At={concrete:!0,name:"codeFenced",tokenize:Il};function Il(e,t,n){const r=this,i={partial:!0,tokenize:R};let o=0,l=0,a;return u;function u(b){return s(b)}function s(b){const M=r.events[r.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(b)}function f(b){return b===a?(l++,e.consume(b),f):l<3?n(b):(e.exit("codeFencedFenceSequence"),O(b)?B(e,c,"whitespace")(b):c(b))}function c(b){return b===null||z(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(It,w,F)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):O(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),B(e,h,"whitespace")(b)):b===96&&b===a?n(b):(e.consume(b),p)}function h(b){return b===null||z(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?n(b):(e.consume(b),d)}function w(b){return e.attempt(i,F,S)(b)}function S(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),y}function y(b){return o>0&&O(b)?B(e,I,"linePrefix",o+1)(b):I(b)}function I(b){return b===null||z(b)?e.check(It,w,F)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||z(b)?(e.exit("codeFlowValue"),I(b)):(e.consume(b),C)}function F(b){return e.exit("codeFenced"),t(b)}function R(b,M,H){let j=0;return k;function k(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),P}function P(T){return b.enter("codeFencedFence"),O(T)?B(b,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):v(T)}function v(T){return T===a?(b.enter("codeFencedFenceSequence"),U(T)):H(T)}function U(T){return T===a?(j++,b.consume(T),U):j>=l?(b.exit("codeFencedFenceSequence"),O(T)?B(b,D,"whitespace")(T):D(T)):H(T)}function D(T){return T===null||z(T)?(b.exit("codeFencedFence"),M(T)):H(T)}}}function Al(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const dn={name:"codeIndented",tokenize:Pl},Tl={partial:!0,tokenize:vl};function Pl(e,t,n){const r=this;return i;function i(s){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):n(s)}function l(s){return s===null?u(s):z(s)?e.attempt(Tl,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||z(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),t(s)}}function vl(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):z(l)?i(l):n(l)}}const zl={name:"codeText",previous:Ll,resolve:Dl,tokenize:Fl};function Dl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ll(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Fl(e,t,n){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):z(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||z(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",s(c))}}class Rl{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&je(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),je(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),je(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);je(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);je(this.left,n.reverse())}}}function je(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function xr(e){const t={};let n=-1,r,i,o,l,a,u,s;const f=new Rl(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,_l(f,n)),n=t[n],s=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return re(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function _l(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,u=[],s={};let f,c,p=-1,h=n,d=0,w=0;const S=[w];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(w=p+1,S.push(w),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):S.pop(),p=S.length;p--;){const y=a.slice(S[p],S[p+1]),I=o.pop();u.push([I,I+y.length-1]),e.splice(I,2,y)}for(u.reverse(),p=-1;++p<u.length;)s[d+u[p][0]]=d+u[p][1],d+=u[p][1]-u[p][0]-1;return s}const Ol={resolve:Nl,tokenize:Bl},Ml={partial:!0,tokenize:jl};function Nl(e){return xr(e),e}function Bl(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?e.check(Ml,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function l(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function jl(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),B(e,o,"linePrefix")}function o(l){if(l===null||z(l))return n(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function br(e,t,n,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||tn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||z(y)?n(y):(e.consume(y),y===92?d:h)}function d(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function w(y){return!f&&(y===null||y===41||$(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):f<s&&y===40?(e.consume(y),f++,w):y===41?(e.consume(y),f--,w):y===null||y===32||y===40||tn(y)?n(y):(e.consume(y),y===92?S:w)}function S(y){return y===40||y===41||y===92?(e.consume(y),w):w(y)}}function wr(e,t,n,r,i,o){const l=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||z(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!O(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function Sr(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?n(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),B(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||z(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function qe(e,t){let n;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):O(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Hl={name:"definition",tokenize:ql},Ul={partial:!0,tokenize:Vl};function ql(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return wr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return $(h)?qe(e,s)(h):s(h)}function s(h){return br(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(Ul,c,c)(h)}function c(h){return O(h)?B(e,p,"whitespace")(h):p(h)}function p(h){return h===null||z(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function Vl(e,t,n){return r;function r(a){return $(a)?qe(e,i)(a):n(a)}function i(a){return Sr(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return O(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?t(a):n(a)}}const $l={name:"hardBreakEscape",tokenize:Wl};function Wl(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Yl={name:"headingAtx",resolve:Xl,tokenize:Ql};function Xl(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},re(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ql(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||$(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||z(f)?(e.exit("atxHeading"),t(f)):O(f)?B(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||$(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const Gl=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Tt=["pre","script","style","textarea"],Kl={concrete:!0,name:"htmlFlow",resolveTo:eo,tokenize:no},Jl={partial:!0,tokenize:ro},Zl={partial:!0,tokenize:to};function eo(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function no(e,t,n){const r=this;let i,o,l,a,u;return s;function s(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),o=!0,w):g===63?(e.consume(g),i=3,r.interrupt?t:m):J(g)?(e.consume(g),l=String.fromCharCode(g),S):n(g)}function p(g){return g===45?(e.consume(g),i=2,h):g===91?(e.consume(g),i=5,a=0,d):J(g)?(e.consume(g),i=4,r.interrupt?t:m):n(g)}function h(g){return g===45?(e.consume(g),r.interrupt?t:m):n(g)}function d(g){const ae="CDATA[";return g===ae.charCodeAt(a++)?(e.consume(g),a===ae.length?r.interrupt?t:v:d):n(g)}function w(g){return J(g)?(e.consume(g),l=String.fromCharCode(g),S):n(g)}function S(g){if(g===null||g===47||g===62||$(g)){const ae=g===47,be=l.toLowerCase();return!ae&&!o&&Tt.includes(be)?(i=1,r.interrupt?t(g):v(g)):Gl.includes(l.toLowerCase())?(i=6,ae?(e.consume(g),y):r.interrupt?t(g):v(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?I(g):C(g))}return g===45||G(g)?(e.consume(g),l+=String.fromCharCode(g),S):n(g)}function y(g){return g===62?(e.consume(g),r.interrupt?t:v):n(g)}function I(g){return O(g)?(e.consume(g),I):k(g)}function C(g){return g===47?(e.consume(g),k):g===58||g===95||J(g)?(e.consume(g),F):O(g)?(e.consume(g),C):k(g)}function F(g){return g===45||g===46||g===58||g===95||G(g)?(e.consume(g),F):R(g)}function R(g){return g===61?(e.consume(g),b):O(g)?(e.consume(g),R):C(g)}function b(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),u=g,M):O(g)?(e.consume(g),b):H(g)}function M(g){return g===u?(e.consume(g),u=null,j):g===null||z(g)?n(g):(e.consume(g),M)}function H(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||$(g)?R(g):(e.consume(g),H)}function j(g){return g===47||g===62||O(g)?C(g):n(g)}function k(g){return g===62?(e.consume(g),P):n(g)}function P(g){return g===null||z(g)?v(g):O(g)?(e.consume(g),P):n(g)}function v(g){return g===45&&i===2?(e.consume(g),q):g===60&&i===1?(e.consume(g),X):g===62&&i===4?(e.consume(g),oe):g===63&&i===3?(e.consume(g),m):g===93&&i===5?(e.consume(g),he):z(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Jl,pe,U)(g)):g===null||z(g)?(e.exit("htmlFlowData"),U(g)):(e.consume(g),v)}function U(g){return e.check(Zl,D,pe)(g)}function D(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),T}function T(g){return g===null||z(g)?U(g):(e.enter("htmlFlowData"),v(g))}function q(g){return g===45?(e.consume(g),m):v(g)}function X(g){return g===47?(e.consume(g),l="",le):v(g)}function le(g){if(g===62){const ae=l.toLowerCase();return Tt.includes(ae)?(e.consume(g),oe):v(g)}return J(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),le):v(g)}function he(g){return g===93?(e.consume(g),m):v(g)}function m(g){return g===62?(e.consume(g),oe):g===45&&i===2?(e.consume(g),m):v(g)}function oe(g){return g===null||z(g)?(e.exit("htmlFlowData"),pe(g)):(e.consume(g),oe)}function pe(g){return e.exit("htmlFlow"),t(g)}}function to(e,t,n){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ro(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Xe,t,n)}}const io={name:"htmlText",tokenize:lo};function lo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),R):m===63?(e.consume(m),C):J(m)?(e.consume(m),H):n(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,d):J(m)?(e.consume(m),I):n(m)}function f(m){return m===45?(e.consume(m),h):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):z(m)?(l=c,X(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?q(m):m===45?p(m):c(m)}function d(m){const oe="CDATA[";return m===oe.charCodeAt(o++)?(e.consume(m),o===oe.length?w:d):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),S):z(m)?(l=w,X(m)):(e.consume(m),w)}function S(m){return m===93?(e.consume(m),y):w(m)}function y(m){return m===62?q(m):m===93?(e.consume(m),y):w(m)}function I(m){return m===null||m===62?q(m):z(m)?(l=I,X(m)):(e.consume(m),I)}function C(m){return m===null?n(m):m===63?(e.consume(m),F):z(m)?(l=C,X(m)):(e.consume(m),C)}function F(m){return m===62?q(m):C(m)}function R(m){return J(m)?(e.consume(m),b):n(m)}function b(m){return m===45||G(m)?(e.consume(m),b):M(m)}function M(m){return z(m)?(l=M,X(m)):O(m)?(e.consume(m),M):q(m)}function H(m){return m===45||G(m)?(e.consume(m),H):m===47||m===62||$(m)?j(m):n(m)}function j(m){return m===47?(e.consume(m),q):m===58||m===95||J(m)?(e.consume(m),k):z(m)?(l=j,X(m)):O(m)?(e.consume(m),j):q(m)}function k(m){return m===45||m===46||m===58||m===95||G(m)?(e.consume(m),k):P(m)}function P(m){return m===61?(e.consume(m),v):z(m)?(l=P,X(m)):O(m)?(e.consume(m),P):j(m)}function v(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,U):z(m)?(l=v,X(m)):O(m)?(e.consume(m),v):(e.consume(m),D)}function U(m){return m===i?(e.consume(m),i=void 0,T):m===null?n(m):z(m)?(l=U,X(m)):(e.consume(m),U)}function D(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||$(m)?j(m):(e.consume(m),D)}function T(m){return m===47||m===62||$(m)?j(m):n(m)}function q(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function X(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),le}function le(m){return O(m)?B(e,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):he(m)}function he(m){return e.enter("htmlTextData"),l(m)}}const Qn={name:"labelEnd",resolveAll:so,resolveTo:co,tokenize:fo},oo={tokenize:ho},ao={tokenize:po},uo={tokenize:mo};function so(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&re(e,0,e.length,n),e}function co(e,t){let n=e.length,r=0,i,o,l,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",u,t],["enter",s,t]],a=ie(a,e.slice(o+1,o+r+3)),a=ie(a,[["enter",f,t]]),a=ie(a,un(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),a=ie(a,[["exit",f,t],e[l-2],e[l-1],["exit",s,t]]),a=ie(a,e.slice(l+1)),a=ie(a,[["exit",u,t]]),re(e,o,e.length,a),e}function fo(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(se(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):n(p)}function u(p){return p===40?e.attempt(oo,f,l?f:c)(p):p===91?e.attempt(ao,f,l?s:c)(p):l?f(p):c(p)}function s(p){return e.attempt(uo,f,c)(p)}function f(p){return t(p)}function c(p){return o._balanced=!0,n(p)}}function ho(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return $(c)?qe(e,o)(c):o(c)}function o(c){return c===41?f(c):br(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return $(c)?qe(e,u)(c):f(c)}function a(c){return n(c)}function u(c){return c===34||c===39||c===40?Sr(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return $(c)?qe(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function po(e,t,n){const r=this;return i;function i(a){return wr.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function l(a){return n(a)}}function mo(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const go={name:"labelStartImage",resolveAll:Qn.resolveAll,tokenize:yo};function yo(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):n(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ko={name:"labelStartLink",resolveAll:Qn.resolveAll,tokenize:xo};function xo(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const yn={name:"lineEnding",tokenize:bo};function bo(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),B(e,t,"linePrefix")}}const nn={name:"thematicBreak",tokenize:wo};function wo(e,t,n){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||z(s))?(e.exit("thematicBreak"),t(s)):n(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),O(s)?B(e,a,"whitespace")(s):a(s))}}const Z={continuation:{tokenize:Io},exit:To,name:"list",tokenize:Eo},So={partial:!0,tokenize:Po},Co={partial:!0,tokenize:Ao};function Eo(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const d=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(d==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Rn(h)){if(r.containerState.type||(r.containerState.type=d,e.enter(d,{_container:!0})),d==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(nn,n,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return Rn(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):n(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Xe,r.interrupt?n:f,e.attempt(So,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return O(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Io(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Xe,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Co,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Ao(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function To(e){e.exit(this.containerState.type)}function Po(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Pt={name:"setextUnderline",resolveTo:vo,tokenize:zo};function vo(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function zo(e,t,n){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):n(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),O(s)?B(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||z(s)?(e.exit("setextHeadingLine"),t(s)):n(s)}}const Do={tokenize:Lo};function Lo(e){const t=this,n=e.attempt(Xe,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ol,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Fo={resolveAll:Er()},Ro=Cr("string"),_o=Cr("text");function Cr(e){return{resolveAll:Er(e==="text"?Oo:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return s(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Er(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Oo(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,a=0,u;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const s={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(n,0,["enter",s,t],["exit",s,t]),n+=2)}n++}return e}const Mo={42:Z,43:Z,45:Z,48:Z,49:Z,50:Z,51:Z,52:Z,53:Z,54:Z,55:Z,56:Z,57:Z,62:dr},No={91:Hl},Bo={[-2]:dn,[-1]:dn,32:dn},jo={35:Yl,42:nn,45:[Pt,nn],60:Kl,61:Pt,95:nn,96:At,126:At},Ho={38:kr,92:yr},Uo={[-5]:yn,[-4]:yn,[-3]:yn,33:go,38:kr,42:_n,60:[yl,io],91:ko,92:[$l,yr],93:Qn,95:_n,96:zl},qo={null:[_n,Fo]},Vo={null:[42,95]},$o={null:[]},Wo=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Vo,contentInitial:No,disable:$o,document:Mo,flow:jo,flowInitial:Bo,insideSpan:qo,string:Ho,text:Uo},Symbol.toStringTag,{value:"Module"}));function Yo(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],a=[];const u={attempt:M(R),check:M(b),consume:I,enter:C,exit:F,interrupt:M(b,{interrupt:!0})},s={code:null,containerState:{},defineSkip:w,events:[],now:d,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=t.tokenize.call(s,u);return t.resolveAll&&o.push(t),s;function c(P){return l=ie(l,P),S(),l[l.length-1]!==null?[]:(H(t,0),s.events=un(o,s.events,s),s.events)}function p(P,v){return Qo(h(P),v)}function h(P){return Xo(l,P)}function d(){const{_bufferIndex:P,_index:v,line:U,column:D,offset:T}=r;return{_bufferIndex:P,_index:v,line:U,column:D,offset:T}}function w(P){i[P.line]=P.column,k()}function S(){let P;for(;r._index<l.length;){const v=l[r._index];if(typeof v=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<v.length;)y(v.charCodeAt(r._bufferIndex));else y(v)}}function y(P){f=f(P)}function I(P){z(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,k()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=P}function C(P,v){const U=v||{};return U.type=P,U.start=d(),s.events.push(["enter",U,s]),a.push(U),U}function F(P){const v=a.pop();return v.end=d(),s.events.push(["exit",v,s]),v}function R(P,v){H(P,v.from)}function b(P,v){v.restore()}function M(P,v){return U;function U(D,T,q){let X,le,he,m;return Array.isArray(D)?pe(D):"tokenize"in D?pe([D]):oe(D);function oe(Q){return _e;function _e(ye){const Ie=ye!==null&&Q[ye],Ae=ye!==null&&Q.null,Ge=[...Array.isArray(Ie)?Ie:Ie?[Ie]:[],...Array.isArray(Ae)?Ae:Ae?[Ae]:[]];return pe(Ge)(ye)}}function pe(Q){return X=Q,le=0,Q.length===0?q:g(Q[le])}function g(Q){return _e;function _e(ye){return m=j(),he=Q,Q.partial||(s.currentConstruct=Q),Q.name&&s.parser.constructs.disable.null.includes(Q.name)?be():Q.tokenize.call(v?Object.assign(Object.create(s),v):s,u,ae,be)(ye)}}function ae(Q){return P(he,m),T}function be(Q){return m.restore(),++le<X.length?g(X[le]):q}}}function H(P,v){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&re(s.events,v,s.events.length-v,P.resolve(s.events.slice(v),s)),P.resolveTo&&(s.events=P.resolveTo(s.events,s))}function j(){const P=d(),v=s.previous,U=s.currentConstruct,D=s.events.length,T=Array.from(a);return{from:D,restore:q};function q(){r=P,s.previous=v,s.currentConstruct=U,s.events.length=D,a=T,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Xo(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Qo(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
3
3
|
`;break}case-3:{l=`\r
|
|
4
4
|
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function Go(e){const r={constructs:mr([Wo,...(e||{}).extensions||[]]),content:i(cl),defined:[],document:i(hl),flow:i(Do),lazy:{},string:i(Ro),text:i(_o)};return r;function i(o){return l;function l(a){return Yo(r,o,a)}}}function Ko(e){for(;!xr(e););return e}const vt=/[\0\t\n\r]/g;function Jo(){let e=1,t="",n=!0,r;return i;function i(o,l,a){const u=[];let s,f,c,p,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(vt.lastIndex=c,s=vt.exec(o),p=s&&s.index!==void 0?s.index:o.length,h=o.charCodeAt(p),!s){t=o.slice(c);break}if(h===10&&c===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<p&&(u.push(o.slice(c,p)),e+=p-c),h){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const Zo=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ea(e){return e.replace(Zo,na)}function na(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return gr(n.slice(o?2:1),o?16:10)}return Xn(n)||e}const Ir={}.hasOwnProperty;function ta(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ra(n)(Ko(Go(n).document().write(Jo()(e,t,!0))))}function ra(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ut),autolinkProtocol:j,autolinkEmail:j,atxHeading:o(lt),blockQuote:o(Ae),characterEscape:j,characterReference:j,codeFenced:o(Ge),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Ge,l),codeText:o(ii,l),codeTextData:j,data:j,codeFlowValue:j,definition:o(li),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(oi),hardBreakEscape:o(ot),hardBreakTrailing:o(ot),htmlFlow:o(at,l),htmlFlowData:j,htmlText:o(at,l),htmlTextData:j,image:o(ai),label:l,link:o(ut),listItem:o(ui),listItemValue:p,listOrdered:o(st,c),listUnordered:o(st),paragraph:o(si),reference:g,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(lt),strong:o(ci),thematicBreak:o(hi)},exit:{atxHeading:u(),atxHeadingSequence:R,autolink:u(),autolinkEmail:Ie,autolinkProtocol:ye,blockQuote:u(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:Q,characterReference:_e,codeFenced:u(S),codeFencedFence:w,codeFencedFenceInfo:h,codeFencedFenceMeta:d,codeFlowValue:k,codeIndented:u(y),codeText:u(T),codeTextData:k,data:k,definition:u(),definitionDestinationString:F,definitionLabelString:I,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(v),hardBreakTrailing:u(v),htmlFlow:u(U),htmlFlowData:k,htmlText:u(D),htmlTextData:k,image:u(X),label:he,labelText:le,lineEnding:P,link:u(q),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ae,resourceDestinationString:m,resourceTitleString:oe,resource:pe,setextHeading:u(H),setextHeadingLineSequence:M,setextHeadingText:b,strong:u(),thematicBreak:u()}};Ar(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(x){let A={type:"root",children:[]};const L={stack:[A],tokenStack:[],config:t,enter:a,exit:s,buffer:l,resume:f,data:n},N=[];let V=-1;for(;++V<x.length;)if(x[V][1].type==="listOrdered"||x[V][1].type==="listUnordered")if(x[V][0]==="enter")N.push(V);else{const ue=N.pop();V=i(x,ue,V)}for(V=-1;++V<x.length;){const ue=t[x[V][0]];Ir.call(ue,x[V][1].type)&&ue[x[V][1].type].call(Object.assign({sliceSerialize:x[V][2].sliceSerialize},L),x[V][1])}if(L.tokenStack.length>0){const ue=L.tokenStack[L.tokenStack.length-1];(ue[1]||zt).call(L,void 0,ue[0])}for(A.position={start:ke(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:ke(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V<t.transforms.length;)A=t.transforms[V](A)||A;return A}function i(x,A,L){let N=A-1,V=-1,ue=!1,we,me,Oe,Me;for(;++N<=L;){const ne=x[N];switch(ne[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ne[0]==="enter"?V++:V--,Me=void 0;break}case"lineEndingBlank":{ne[0]==="enter"&&(we&&!Me&&!V&&!Oe&&(Oe=N),Me=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Me=void 0}if(!V&&ne[0]==="enter"&&ne[1].type==="listItemPrefix"||V===-1&&ne[0]==="exit"&&(ne[1].type==="listUnordered"||ne[1].type==="listOrdered")){if(we){let Te=N;for(me=void 0;Te--;){const ge=x[Te];if(ge[1].type==="lineEnding"||ge[1].type==="lineEndingBlank"){if(ge[0]==="exit")continue;me&&(x[me][1].type="lineEndingBlank",ue=!0),ge[1].type="lineEnding",me=Te}else if(!(ge[1].type==="linePrefix"||ge[1].type==="blockQuotePrefix"||ge[1].type==="blockQuotePrefixWhitespace"||ge[1].type==="blockQuoteMarker"||ge[1].type==="listItemIndent"))break}Oe&&(!me||Oe<me)&&(we._spread=!0),we.end=Object.assign({},me?x[me][1].start:ne[1].end),x.splice(me||N,0,["exit",we,ne[2]]),N++,L++}if(ne[1].type==="listItemPrefix"){const Te={type:"listItem",_spread:!1,start:Object.assign({},ne[1].start),end:void 0};we=Te,x.splice(N,0,["enter",Te,ne[2]]),N++,L++,Oe=void 0,Me=!0}}}return x[A][1]._spread=ue,L}function o(x,A){return L;function L(N){a.call(this,x(N),N),A&&A.call(this,N)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(x,A,L){this.stack[this.stack.length-1].children.push(x),this.stack.push(x),this.tokenStack.push([A,L||void 0]),x.position={start:ke(A.start),end:void 0}}function u(x){return A;function A(L){x&&x.call(this,L),s.call(this,L)}}function s(x,A){const L=this.stack.pop(),N=this.tokenStack.pop();if(N)N[0].type!==x.type&&(A?A.call(this,x,N[0]):(N[1]||zt).call(this,x,N[0]));else throw new Error("Cannot close `"+x.type+"` ("+Ue({start:x.start,end:x.end})+"): it’s not open");L.position.end=ke(x.end)}function f(){return Yn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(x){if(this.data.expectingFirstListItemValue){const A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(x),10),this.data.expectingFirstListItemValue=void 0}}function h(){const x=this.resume(),A=this.stack[this.stack.length-1];A.lang=x}function d(){const x=this.resume(),A=this.stack[this.stack.length-1];A.meta=x}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const x=this.resume(),A=this.stack[this.stack.length-1];A.value=x.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const x=this.resume(),A=this.stack[this.stack.length-1];A.value=x.replace(/(\r?\n|\r)$/g,"")}function I(x){const A=this.resume(),L=this.stack[this.stack.length-1];L.label=A,L.identifier=se(this.sliceSerialize(x)).toLowerCase()}function C(){const x=this.resume(),A=this.stack[this.stack.length-1];A.title=x}function F(){const x=this.resume(),A=this.stack[this.stack.length-1];A.url=x}function R(x){const A=this.stack[this.stack.length-1];if(!A.depth){const L=this.sliceSerialize(x).length;A.depth=L}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function M(x){const A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(x).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function j(x){const L=this.stack[this.stack.length-1].children;let N=L[L.length-1];(!N||N.type!=="text")&&(N=fi(),N.position={start:ke(x.start),end:void 0},L.push(N)),this.stack.push(N)}function k(x){const A=this.stack.pop();A.value+=this.sliceSerialize(x),A.position.end=ke(x.end)}function P(x){const A=this.stack[this.stack.length-1];if(this.data.atHardBreak){const L=A.children[A.children.length-1];L.position.end=ke(x.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(A.type)&&(j.call(this,x),k.call(this,x))}function v(){this.data.atHardBreak=!0}function U(){const x=this.resume(),A=this.stack[this.stack.length-1];A.value=x}function D(){const x=this.resume(),A=this.stack[this.stack.length-1];A.value=x}function T(){const x=this.resume(),A=this.stack[this.stack.length-1];A.value=x}function q(){const x=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";x.type+="Reference",x.referenceType=A,delete x.url,delete x.title}else delete x.identifier,delete x.label;this.data.referenceType=void 0}function X(){const x=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";x.type+="Reference",x.referenceType=A,delete x.url,delete x.title}else delete x.identifier,delete x.label;this.data.referenceType=void 0}function le(x){const A=this.sliceSerialize(x),L=this.stack[this.stack.length-2];L.label=ea(A),L.identifier=se(A).toLowerCase()}function he(){const x=this.stack[this.stack.length-1],A=this.resume(),L=this.stack[this.stack.length-1];if(this.data.inReference=!0,L.type==="link"){const N=x.children;L.children=N}else L.alt=A}function m(){const x=this.resume(),A=this.stack[this.stack.length-1];A.url=x}function oe(){const x=this.resume(),A=this.stack[this.stack.length-1];A.title=x}function pe(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function ae(x){const A=this.resume(),L=this.stack[this.stack.length-1];L.label=A,L.identifier=se(this.sliceSerialize(x)).toLowerCase(),this.data.referenceType="full"}function be(x){this.data.characterReferenceType=x.type}function Q(x){const A=this.sliceSerialize(x),L=this.data.characterReferenceType;let N;L?(N=gr(A,L==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):N=Xn(A);const V=this.stack[this.stack.length-1];V.value+=N}function _e(x){const A=this.stack.pop();A.position.end=ke(x.end)}function ye(x){k.call(this,x);const A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(x)}function Ie(x){k.call(this,x);const A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(x)}function Ae(){return{type:"blockquote",children:[]}}function Ge(){return{type:"code",lang:null,meta:null,value:""}}function ii(){return{type:"inlineCode",value:""}}function li(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function oi(){return{type:"emphasis",children:[]}}function lt(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function at(){return{type:"html",value:""}}function ai(){return{type:"image",title:null,url:"",alt:null}}function ut(){return{type:"link",title:null,url:"",children:[]}}function st(x){return{type:"list",ordered:x.type==="listOrdered",start:null,spread:x._spread,children:[]}}function ui(x){return{type:"listItem",spread:x._spread,checked:null,children:[]}}function si(){return{type:"paragraph",children:[]}}function ci(){return{type:"strong",children:[]}}function fi(){return{type:"text",value:""}}function hi(){return{type:"thematicBreak"}}}function ke(e){return{line:e.line,column:e.column,offset:e.offset}}function Ar(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Ar(e,r):ia(e,r)}}function ia(e,t){let n;for(n in t)if(Ir.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function zt(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ue({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ue({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ue({start:t.start,end:t.end})+") is still open")}function la(e){const t=this;t.parser=n;function n(r){return ta(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function oa(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function aa(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|