clankie 0.2.13 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +40 -223
  2. package/dist/cli.js +12116 -27954
  3. package/package.json +10 -10
  4. package/web-ui-dist/_shell.html +2 -2
  5. package/web-ui-dist/assets/auth-js9k1Rhz.js +1 -0
  6. package/web-ui-dist/assets/badge-BHJdQwRZ.js +1 -0
  7. package/web-ui-dist/assets/circle-alert-DCRgcJjZ.js +1 -0
  8. package/web-ui-dist/assets/connection-C-eUc8pB.js +1 -0
  9. package/web-ui-dist/assets/extensions-CfM4cd1k.js +1 -0
  10. package/web-ui-dist/assets/extensions-VKiAe2xJ.js +1 -0
  11. package/web-ui-dist/assets/field-DEnoPHIp.js +1 -0
  12. package/web-ui-dist/assets/index-QqHwIr0R.js +1 -0
  13. package/web-ui-dist/assets/index-wQYa97UB.js +1 -0
  14. package/web-ui-dist/assets/json-render-renderer-iSQAWNBF.js +94 -0
  15. package/web-ui-dist/assets/main-pUlhQiIA.js +35 -0
  16. package/web-ui-dist/assets/sessions._sessionId-UF84S83t.js +38 -0
  17. package/web-ui-dist/assets/skills-CnPlzEye.js +1 -0
  18. package/web-ui-dist/assets/styles-CEa8RAD6.css +1 -0
  19. package/dist/koffi-216xhpes.node +0 -0
  20. package/dist/koffi-2erktc37.node +0 -0
  21. package/dist/koffi-2rrez93a.node +0 -0
  22. package/dist/koffi-2wv0r22g.node +0 -0
  23. package/dist/koffi-3kae4xj3.node +0 -0
  24. package/dist/koffi-3rkr2zqv.node +0 -0
  25. package/dist/koffi-abxfktv9.node +0 -0
  26. package/dist/koffi-c67c0c5b.node +0 -0
  27. package/dist/koffi-cnf0q0dx.node +0 -0
  28. package/dist/koffi-df38sqz5.node +0 -0
  29. package/dist/koffi-gfbqb3a0.node +0 -0
  30. package/dist/koffi-kjemmmem.node +0 -0
  31. package/dist/koffi-kkrfq9yv.node +0 -0
  32. package/dist/koffi-mzaqwwqy.node +0 -0
  33. package/dist/koffi-q49fgkeq.node +0 -0
  34. package/dist/koffi-q54bk8bf.node +0 -0
  35. package/dist/koffi-x1790w0j.node +0 -0
  36. package/dist/koffi-yxvjwcj6.node +0 -0
  37. package/web-ui-dist/assets/extensions-Ce8R4mF3.js +0 -1
  38. package/web-ui-dist/assets/field-omFPry7c.js +0 -1
  39. package/web-ui-dist/assets/index-CdxpJyJ4.js +0 -1
  40. package/web-ui-dist/assets/loader-circle-DJwIWnWV.js +0 -1
  41. package/web-ui-dist/assets/main-UkFzTTck.js +0 -35
  42. package/web-ui-dist/assets/sessions._sessionId-DA8C51jO.js +0 -131
  43. package/web-ui-dist/assets/settings-Db2CTnq7.js +0 -1
  44. package/web-ui-dist/assets/styles-DAZ1IN1z.css +0 -1
@@ -1,131 +0,0 @@
1
- import{c as Dt,j as f,B as ti,X as gv,f as Kt,m as Hn,M as Os,r as g,N as bv,O as vv,Q as yv,R as sc,T as lc,U as Ao,V as cc,W as uc,Y as dc,Z as fc,p as ni,_ as xv,$ as wv,a0 as _v,a1 as Ev,a2 as Ms,a3 as H,a4 as Ps,a5 as Sd,a6 as Sv,a7 as kv,a8 as Nv,a9 as Cv,aa as Tv,ab as Av,ac as Iv,ad as Rv,ae as Ov,af as Mv,ag as Pv,ah as Dv,ai as Lv,J as io,aj as $v,ak as zv,al as jv,am as Fv,an as Bv,K as Uv,q as Hv,A as Vv,H as pc,L as Gv}from"./main-UkFzTTck.js";import{L as Ds}from"./loader-circle-DJwIWnWV.js";const Zv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],mc=Dt("check",Zv);const Kv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ls=Dt("chevron-down",Kv);const Wv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],qv=Dt("clock-3",Wv);const Yv=[["path",{d:"M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z",key:"ukzhwg"}],["path",{d:"M14.487 7.858A1 1 0 0 1 14 7V2",key:"1klhew"}],["path",{d:"M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516",key:"rxaxab"}],["path",{d:"M8 18h1",key:"13wk12"}]],Xv=Dt("file-pen-line",Yv);const Jv=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],Qv=Dt("file-plus-corner",Jv);const ey=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ty=Dt("file-text",ey);const ny=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],kd=Dt("file",ny);const ry=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],oy=Dt("folder-open",ry);const iy=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],ay=Dt("folder-tree",iy);const sy=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],ly=Dt("paperclip",sy);const cy=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],uy=Dt("search",cy);const dy=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],fy=Dt("send",dy);const py=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],my=Dt("terminal",py);const hy=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],gy=Dt("wrench",hy);function by({attachments:e,onRemove:t}){return e.length===0?null:f.jsx("div",{className:"flex flex-wrap gap-2 pb-2",children:e.map(n=>{const r=n.mimeType.startsWith("image/");return f.jsxs("div",{className:Kt("group relative flex items-center gap-2 rounded-lg border border-border bg-muted px-3 py-2","hover:bg-muted/80 transition-colors"),children:[r&&n.preview?f.jsx("div",{className:"relative h-12 w-12 shrink-0 overflow-hidden rounded",children:f.jsx("img",{src:n.preview,alt:n.file.name,className:"h-full w-full object-cover"})}):f.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded bg-background",children:f.jsx(kd,{className:"h-6 w-6 text-muted-foreground"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("p",{className:"text-sm font-medium truncate",children:n.file.name}),f.jsx("p",{className:"text-xs text-muted-foreground",children:vy(n.file.size)})]}),f.jsxs(ti,{type:"button",variant:"ghost",size:"icon-xs",onClick:()=>t(n.id),className:"shrink-0",title:"Remove attachment",children:[f.jsx(gv,{className:"h-3 w-3"}),f.jsxs("span",{className:"sr-only",children:["Remove ",n.file.name]})]})]},n.id)})})}function vy(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Math.round(e/t**r*100)/100} ${n[r]}`}function pa(e){return{anthropic:"Anthropic",openai:"OpenAI",google:"Google","amazon-bedrock":"Amazon Bedrock",openrouter:"OpenRouter","vercel-ai-gateway":"Vercel AI Gateway",xai:"xAI",mistral:"Mistral",groq:"Groq",huggingface:"Hugging Face","google-vertex":"Google Vertex AI","google-antigravity":"Google Antigravity","google-gemini-cli":"Google Gemini CLI","azure-openai-responses":"Azure OpenAI","github-copilot":"GitHub Copilot",cerebras:"Cerebras",opencode:"OpenCode",zai:"Z.ai",minimax:"MiniMax","minimax-cn":"MiniMax (CN)","kimi-coding":"Kimi"}[e]||e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function hc(e){const t=e.replace(/\s+\((EU|US|Global|latest|free|exacto|thinking|Antigravity)\)$/i,"").trim(),n=t.match(/\s+([\d.]+)$/);if(n){const r=n[1],o=parseFloat(r);if(!isNaN(o))return{family:t.substring(0,t.length-n[0].length).trim(),version:o}}return{family:t,version:null}}function yy(e){const t=new Map;for(const o of e){const{family:i}=hc(o.name);t.has(i)||t.set(i,[]),t.get(i).push(o)}const n=[],r=[];for(const[o,i]of t){if(i.length===1){n.push(i[0]);continue}const a=i.map(c=>({model:c,...hc(c.name)})),s=a.filter(c=>c.version===null),l=a.filter(c=>c.version!==null);if(l.length===0)n.push(...i);else{const c=Math.max(...l.map(p=>p.version)),u=l.filter(p=>p.version===c),d=l.filter(p=>p.version!==c);n.push(...u.map(p=>p.model)),n.push(...s.map(p=>p.model)),r.push(...d.map(p=>p.model))}}return{latest:n,older:r}}function xy(e){const t=new Map;for(const n of e)t.has(n.provider)||t.set(n.provider,[]),t.get(n.provider).push(n);for(const[n,r]of t)r.sort((o,i)=>o.name.localeCompare(i.name));return t}function wy(){const{sessionId:e,model:t,availableModels:n,thinkingLevel:r,isStreaming:o}=Hn(Os,h=>({sessionId:h.sessionId,model:h.model,availableModels:h.availableModels,thinkingLevel:h.thinkingLevel,isStreaming:h.isStreaming})),[i,a]=g.useState(!1),{latestModels:s,olderModels:l,shouldShowSubmenu:c}=g.useMemo(()=>{if(n.length===0)return{latestModels:[],olderModels:[],shouldShowSubmenu:!1};if(n.length<=10)return{latestModels:[...n].sort((x,w)=>x.name.localeCompare(w.name)),olderModels:[],shouldShowSubmenu:!1};const{latest:h,older:y}=yy(n);return h.sort((v,x)=>v.name.localeCompare(x.name)),{latestModels:h,olderModels:y,shouldShowSubmenu:y.length>0}},[n]),u=g.useMemo(()=>xy(l),[l]),d=async(h,y)=>{if(!e){console.log("[ModelSelector] No sessionId");return}console.log("[ModelSelector] Changing model:",{provider:h,modelId:y,sessionId:e});const v=ni.getClient();if(v)try{const x=await v.setModel(e,h,y);console.log("[ModelSelector] Model changed successfully:",x),wv(x),a(!1)}catch(x){console.error("[ModelSelector] Failed to set model:",x)}else console.error("[ModelSelector] No client available")},p=async h=>{if(!e)return;const y=ni.getClient();if(y)try{await y.setThinkingLevel(e,h),xv(h)}catch(v){console.error("Failed to set thinking level:",v)}},m=[{value:"off",label:"Off"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"XHigh"}];if(!t)return null;const b=h=>{const y=t.provider===h.provider&&t.id===h.id;return f.jsxs(fc,{onClick:()=>d(h.provider,h.id),className:"flex items-start gap-2 py-2",children:[f.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:y&&f.jsx(mc,{className:"h-4 w-4"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"font-medium",children:h.name}),f.jsx("div",{className:"text-xs text-muted-foreground line-clamp-2",children:_y(h)})]})]},`${h.provider}/${h.id}`)};return f.jsxs(bv,{open:i,onOpenChange:a,children:[f.jsxs(vv,{type:"button",disabled:o||!e,className:Kt("flex flex-col items-start gap-0.5 rounded-lg border border-border bg-background px-3 py-1.5 text-sm transition-colors","hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:[f.jsxs("div",{className:"flex items-center gap-1.5 w-full",children:[f.jsx("span",{className:"font-medium",children:t.name}),f.jsx(Ls,{className:"h-4 w-4 text-muted-foreground ml-auto"})]}),r!=="medium"&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:["thinking: ",r]})]}),f.jsxs(yv,{align:"end",className:"w-80",children:[f.jsx(sc,{children:f.jsx(lc,{children:"Select Model"})}),f.jsx(Ao,{}),f.jsx("div",{className:"max-h-96 overflow-y-auto",children:s.map(b)}),c&&f.jsxs(f.Fragment,{children:[f.jsx(Ao,{}),f.jsxs(cc,{children:[f.jsx(uc,{children:f.jsx("span",{children:"Other models"})}),f.jsx(dc,{className:"w-80 max-h-96 overflow-y-auto",children:Array.from(u.entries()).sort(([h],[y])=>pa(h).localeCompare(pa(y))).map(([h,y])=>f.jsxs("div",{children:[f.jsx(sc,{children:f.jsx(lc,{className:"sticky top-0 bg-popover z-10",children:pa(h)})}),y.map(b),f.jsx(Ao,{className:"my-1"})]},h))})]})]}),f.jsx(Ao,{}),f.jsxs(cc,{children:[f.jsx(uc,{children:f.jsx("span",{children:"Thinking Level"})}),f.jsx(dc,{children:m.map(h=>f.jsxs(fc,{onClick:()=>p(h.value),className:"flex items-center gap-2",children:[f.jsx("div",{className:"flex h-5 w-5 items-center justify-center shrink-0",children:r===h.value&&f.jsx(mc,{className:"h-4 w-4"})}),f.jsx("span",{children:h.label})]},h.value))})]})]})]})}function _y(e){const t=e.name.toLowerCase();return t.includes("opus")?"Most capable for ambitious work":t.includes("sonnet")?"Most efficient for everyday tasks":t.includes("haiku")?"Fastest for quick answers":t.includes("gpt-4")?"Advanced reasoning and analysis":t.includes("gpt-3.5")?"Fast and efficient":t.includes("gemini")?"Google's multimodal AI":t.includes("claude")?"Anthropic's AI assistant":`${e.provider}/${e.id}`}const gc=10*1024*1024,bc=20*1024*1024;function Ey(){const{sessionId:e,isStreaming:t}=Hn(Os,C=>({sessionId:C.sessionId,isStreaming:C.isStreaming})),[n,r]=g.useState(""),[o,i]=g.useState([]),[a,s]=g.useState(!1),l=g.useRef(null),c=g.useRef(null),u=g.useCallback(C=>new Promise((E,A)=>{const R=new FileReader;R.onload=()=>{const T=R.result.split(",")[1];E(T)},R.onerror=A,R.readAsDataURL(C)}),[]),d=g.useCallback(C=>C.type.startsWith("image/")?new Promise(E=>{const A=new FileReader;A.onload=()=>E(A.result),A.onerror=()=>E(void 0),A.readAsDataURL(C)}):Promise.resolve(void 0),[]),p=g.useCallback(async C=>{const E=Array.from(C),A=o.reduce((M,T)=>M+T.file.size,0),R=E.reduce((M,T)=>M+T.size,0);if(A+R>bc){alert(`Total attachment size cannot exceed ${bc/1024/1024}MB`);return}for(const M of E){if(M.size>gc){alert(`File "${M.name}" is too large. Maximum size is ${gc/1024/1024}MB`);continue}try{const T=await u(M),I=await d(M),O={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,file:M,preview:I,base64:T,mimeType:M.type};i(D=>[...D,O])}catch(T){console.error(`Failed to process file "${M.name}":`,T),alert(`Failed to process file "${M.name}"`)}}},[o,u,d]),m=g.useCallback(C=>{const E=C.target.files;E&&E.length>0&&p(E),c.current&&(c.current.value="")},[p]),b=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s(!0)},[]),h=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s(!1)},[]),y=g.useCallback(C=>{C.preventDefault(),C.stopPropagation(),s(!1);const E=C.dataTransfer.files;E.length>0&&p(E)},[p]),v=g.useCallback(C=>{const E=C.clipboardData.items,A=[];for(const R of Array.from(E))if(R.kind==="file"){const M=R.getAsFile();M&&A.push(M)}A.length>0&&(C.preventDefault(),p(A))},[p]),x=g.useCallback(C=>{i(E=>E.filter(A=>A.id!==C))},[]),w=async()=>{if(!n.trim()&&o.length===0||!e||t)return;const C=n.trim(),E=[...o];r(""),i([]);const A=E.map(O=>({type:O.mimeType.startsWith("image/")?"image":"file",name:O.file.name,mimeType:O.mimeType,previewUrl:O.preview})),R=E.filter(O=>O.mimeType.startsWith("image/")).map(O=>({type:"image",data:O.base64,mimeType:O.mimeType})),M=E.filter(O=>!O.mimeType.startsWith("image/")),T=ni.getClient();if(!T){console.error("No client available");return}let I=C;try{for(const D of M)try{const L=await T.uploadAttachment(e,D.file.name,D.base64,D.mimeType);I+=`
2
- [Attached: ${L.fileName}]`}catch(L){console.error(`Failed to upload ${D.file.name}:`,L)}const O=I.replace(/(?:^|\n)\[Attached: [^\]]+\]/g,"").replace(/\n{3,}/g,`
3
-
4
- `).trim();Ev(O,A),await T.prompt(e,I,R.length>0?R:void 0)}catch(O){console.error("Failed to send message:",O)}l.current?.focus()},_=C=>{C.key==="Enter"&&(C.ctrlKey||C.metaKey)&&(C.preventDefault(),w())};return f.jsx("div",{className:"border-t border-border bg-card p-4",onDragOver:b,onDragLeave:h,onDrop:y,children:f.jsx("div",{className:"mx-auto w-full max-w-3xl",children:f.jsxs("div",{className:"flex flex-col gap-2",children:[f.jsx(by,{attachments:o,onRemove:x}),f.jsxs("div",{className:"relative",children:[f.jsx(_v,{ref:l,id:"chat-input",name:"message",value:n,onChange:C=>r(C.target.value),onKeyDown:_,onPaste:v,placeholder:"Send a message... (Ctrl+Enter to send)",className:"min-h-[80px] resize-none focus-glow",disabled:!e||t}),a&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-lg border-2 border-dashed border-primary bg-background/80 backdrop-blur-sm",children:f.jsx("p",{className:"text-sm font-medium text-primary",children:"Drop files here"})})]}),f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{ref:c,type:"file",multiple:!0,onChange:m,className:"hidden",accept:"image/*,application/pdf,text/*"}),f.jsxs(ti,{type:"button",variant:"ghost",size:"icon-sm",disabled:!e||t,onClick:()=>c.current?.click(),title:"Attach files",children:[f.jsx(ly,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Attach files"})]}),f.jsxs("p",{className:"text-xs text-muted-foreground",children:[f.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5",children:"Ctrl+Enter"})," ","to send"]})]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(wy,{}),f.jsxs(ti,{onClick:w,disabled:!n.trim()&&o.length===0||!e||t,size:"icon",className:"transition-transform hover:scale-105 active:scale-95",children:[f.jsx(fy,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Send message"})]})]})]})]})})})}function Sy(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ky=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ny=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Cy={};function vc(e,t){return(Cy.jsx?Ny:ky).test(e)}const Ty=/[ \t\n\f\r]/g;function Ay(e){return typeof e=="object"?e.type==="text"?yc(e.value):!1:yc(e)}function yc(e){return e.replace(Ty,"")===""}class ao{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ao.prototype.normal={};ao.prototype.property={};ao.prototype.space=void 0;function Nd(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new ao(n,r,t)}function Ya(e){return e.toLowerCase()}class Lt{constructor(t,n){this.attribute=n,this.property=t}}Lt.prototype.attribute="";Lt.prototype.booleanish=!1;Lt.prototype.boolean=!1;Lt.prototype.commaOrSpaceSeparated=!1;Lt.prototype.commaSeparated=!1;Lt.prototype.defined=!1;Lt.prototype.mustUseProperty=!1;Lt.prototype.number=!1;Lt.prototype.overloadedBoolean=!1;Lt.prototype.property="";Lt.prototype.spaceSeparated=!1;Lt.prototype.space=void 0;let Iy=0;const Ne=Yn(),it=Yn(),Xa=Yn(),Z=Yn(),We=Yn(),br=Yn(),Ft=Yn();function Yn(){return 2**++Iy}const Ja=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ne,booleanish:it,commaOrSpaceSeparated:Ft,commaSeparated:br,number:Z,overloadedBoolean:Xa,spaceSeparated:We},Symbol.toStringTag,{value:"Module"})),ma=Object.keys(Ja);class $s extends Lt{constructor(t,n,r,o){let i=-1;if(super(t,n),xc(this,"space",o),typeof r=="number")for(;++i<ma.length;){const a=ma[i];xc(this,ma[i],(r&Ja[a])===Ja[a])}}}$s.prototype.defined=!0;function xc(e,t,n){n&&(e[t]=n)}function kr(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new $s(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Ya(r)]=r,n[Ya(i.attribute)]=r}return new ao(t,n,e.space)}const Cd=kr({properties:{ariaActiveDescendant:null,ariaAtomic:it,ariaAutoComplete:null,ariaBusy:it,ariaChecked:it,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:We,ariaCurrent:null,ariaDescribedBy:We,ariaDetails:null,ariaDisabled:it,ariaDropEffect:We,ariaErrorMessage:null,ariaExpanded:it,ariaFlowTo:We,ariaGrabbed:it,ariaHasPopup:null,ariaHidden:it,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:We,ariaLevel:Z,ariaLive:null,ariaModal:it,ariaMultiLine:it,ariaMultiSelectable:it,ariaOrientation:null,ariaOwns:We,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:it,ariaReadOnly:it,ariaRelevant:null,ariaRequired:it,ariaRoleDescription:We,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:it,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Td(e,t){return t in e?e[t]:t}function Ad(e,t){return Td(e,t.toLowerCase())}const Ry=kr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:br,acceptCharset:We,accessKey:We,action:null,allow:null,allowFullScreen:Ne,allowPaymentRequest:Ne,allowUserMedia:Ne,alt:null,as:null,async:Ne,autoCapitalize:null,autoComplete:We,autoFocus:Ne,autoPlay:Ne,blocking:We,capture:null,charSet:null,checked:Ne,cite:null,className:We,cols:Z,colSpan:null,content:null,contentEditable:it,controls:Ne,controlsList:We,coords:Z|br,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ne,defer:Ne,dir:null,dirName:null,disabled:Ne,download:Xa,draggable:it,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ne,formTarget:null,headers:We,height:Z,hidden:Xa,high:Z,href:null,hrefLang:null,htmlFor:We,httpEquiv:We,id:null,imageSizes:null,imageSrcSet:null,inert:Ne,inputMode:null,integrity:null,is:null,isMap:Ne,itemId:null,itemProp:We,itemRef:We,itemScope:Ne,itemType:We,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ne,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:Ne,muted:Ne,name:null,nonce:null,noModule:Ne,noValidate:Ne,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:Ne,optimum:Z,pattern:null,ping:We,placeholder:null,playsInline:Ne,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ne,referrerPolicy:null,rel:We,required:Ne,reversed:Ne,rows:Z,rowSpan:Z,sandbox:We,scope:null,scoped:Ne,seamless:Ne,selected:Ne,shadowRootClonable:Ne,shadowRootDelegatesFocus:Ne,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:it,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:Ne,useMap:null,value:it,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:We,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ne,declare:Ne,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:Ne,noHref:Ne,noShade:Ne,noWrap:Ne,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:it,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ne,disableRemotePlayback:Ne,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:Ad}),Oy=kr({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:Ft,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:We,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:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:Ne,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,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:br,g2:br,glyphName:br,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:Ft,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,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:Z,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:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:We,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ft,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ft,rev:Ft,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ft,requiredFeatures:Ft,requiredFonts:Ft,requiredFormats:Ft,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:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:Ft,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ft,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ft,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Td}),Id=kr({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()}}),Rd=kr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ad}),Od=kr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),My={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"},Py=/[A-Z]/g,wc=/-[a-z]/g,Dy=/^data[-\w.:]+$/i;function Ly(e,t){const n=Ya(t);let r=t,o=Lt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Dy.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(wc,zy);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!wc.test(i)){let a=i.replace(Py,$y);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=$s}return new o(r,t)}function $y(e){return"-"+e.toLowerCase()}function zy(e){return e.charAt(1).toUpperCase()}const jy=Nd([Cd,Ry,Id,Rd,Od],"html"),zs=Nd([Cd,Oy,Id,Rd,Od],"svg");function Fy(e){return e.join(" ").trim()}var tr={},ha,_c;function By(){if(_c)return ha;_c=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l=`
5
- `,c="/",u="*",d="",p="comment",m="declaration";function b(y,v){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];v=v||{};var x=1,w=1;function _(L){var P=L.match(t);P&&(x+=P.length);var F=L.lastIndexOf(l);w=~F?L.length-F:w+L.length}function C(){var L={line:x,column:w};return function(P){return P.position=new E(L),M(),P}}function E(L){this.start=L,this.end={line:x,column:w},this.source=v.source}E.prototype.content=y;function A(L){var P=new Error(v.source+":"+x+":"+w+": "+L);if(P.reason=L,P.filename=v.source,P.line=x,P.column=w,P.source=y,!v.silent)throw P}function R(L){var P=L.exec(y);if(P){var F=P[0];return _(F),y=y.slice(F.length),P}}function M(){R(n)}function T(L){var P;for(L=L||[];P=I();)P!==!1&&L.push(P);return L}function I(){var L=C();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var P=2;d!=y.charAt(P)&&(u!=y.charAt(P)||c!=y.charAt(P+1));)++P;if(P+=2,d===y.charAt(P-1))return A("End of comment missing");var F=y.slice(2,P-2);return w+=2,_(F),y=y.slice(P),w+=2,L({type:p,comment:F})}}function O(){var L=C(),P=R(r);if(P){if(I(),!R(o))return A("property missing ':'");var F=R(i),K=L({type:m,property:h(P[0].replace(e,d)),value:F?h(F[0].replace(e,d)):d});return R(a),K}}function D(){var L=[];T(L);for(var P;P=O();)P!==!1&&(L.push(P),T(L));return L}return M(),D()}function h(y){return y?y.replace(s,d):d}return ha=b,ha}var Ec;function Uy(){if(Ec)return tr;Ec=1;var e=tr&&tr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(tr,"__esModule",{value:!0}),tr.default=n;const t=e(By());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const a=(0,t.default)(r),s=typeof o=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;s?o(c,u,l):u&&(i=i||{},i[c]=u)}),i}return tr}var Pr={},Sc;function Hy(){if(Sc)return Pr;Sc=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},a=function(c,u){return u.toUpperCase()},s=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),i(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(o,s):c=c.replace(r,s),c.replace(t,a))};return Pr.camelCase=l,Pr}var Dr,kc;function Vy(){if(kc)return Dr;kc=1;var e=Dr&&Dr.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(Uy()),n=Hy();function r(o,i){var a={};return!o||typeof o!="string"||(0,t.default)(o,function(s,l){s&&l&&(a[(0,n.camelCase)(s,i)]=l)}),a}return r.default=r,Dr=r,Dr}var Gy=Vy();const Zy=Ms(Gy),Md=Pd("end"),js=Pd("start");function Pd(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 Ky(e){const t=js(e),n=Md(e);if(t&&n)return{start:t,end:n}}function Gr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Nc(e.position):"start"in e||"end"in e?Nc(e):"line"in e||"column"in e?Qa(e):""}function Qa(e){return Cc(e&&e.line)+":"+Cc(e&&e.column)}function Nc(e){return Qa(e&&e.start)+"-"+Qa(e&&e.end)}function Cc(e){return e&&typeof e=="number"?e:1}class kt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(a=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=s?s.line:void 0,this.name=Gr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}kt.prototype.file="";kt.prototype.name="";kt.prototype.reason="";kt.prototype.message="";kt.prototype.stack="";kt.prototype.column=void 0;kt.prototype.line=void 0;kt.prototype.ancestors=void 0;kt.prototype.cause=void 0;kt.prototype.fatal=void 0;kt.prototype.place=void 0;kt.prototype.ruleId=void 0;kt.prototype.source=void 0;const Fs={}.hasOwnProperty,Wy=new Map,qy=/[A-Z]/g,Yy=new Set(["table","tbody","thead","tfoot","tr"]),Xy=new Set(["td","th"]),Dd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Jy(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=ax(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=ix(n,t.jsx,t.jsxs)}const o={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"?zs:jy,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Ld(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Ld(e,t,n){if(t.type==="element")return Qy(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ex(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return nx(e,t,n);if(t.type==="mdxjsEsm")return tx(e,t);if(t.type==="root")return rx(e,t,n);if(t.type==="text")return ox(e,t)}function Qy(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=zs,e.schema=o),e.ancestors.push(t);const i=zd(e,t.tagName,!1),a=sx(e,t);let s=Us(e,t);return Yy.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Ay(l):!0})),$d(e,a,i,t),Bs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function ex(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)}Yr(e,t.position)}function tx(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Yr(e,t.position)}function nx(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=zs,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:zd(e,t.name,!0),a=lx(e,t),s=Us(e,t);return $d(e,a,i,t),Bs(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}function rx(e,t,n){const r={};return Bs(r,Us(e,t)),e.create(t,e.Fragment,r,n)}function ox(e,t){return t.value}function $d(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Bs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ix(e,t,n){return r;function r(o,i,a,s){const c=Array.isArray(a.children)?n:t;return s?c(i,a,s):c(i,a)}}function ax(e,t){return n;function n(r,o,i,a){const s=Array.isArray(i.children),l=js(r);return t(o,i,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function sx(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Fs.call(t.properties,o)){const i=cx(e,o,t.properties[o]);if(i){const[a,s]=i;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&Xy.has(t.tagName)?r=s:n[a]=s}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function lx(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const s=a.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Yr(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,i=e.evaluater.evaluateExpression(s.expression)}else Yr(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function Us(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Wy;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;a=l+"-"+c,o.set(l,c+1)}}const s=Ld(e,i,a);s!==void 0&&n.push(s)}return n}function cx(e,t,n){const r=Ly(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Sy(n):Fy(n)),r.property==="style"){let o=typeof n=="object"?n:ux(e,String(n));return e.stylePropertyNameCase==="css"&&(o=dx(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?My[r.property]||r.property:r.attribute,n]}}function ux(e,t){try{return Zy(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new kt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Dd+"#cannot-parse-style-attribute",o}}function zd(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,a;for(;++i<o.length;){const s=vc(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}r=a}else r=vc(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return Fs.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Yr(e)}function Yr(e,t){const n=new kt("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=Dd+"#cannot-handle-mdx-estrees-without-createevaluater",n}function dx(e){const t={};let n;for(n in e)Fs.call(e,n)&&(t[fx(n)]=e[n]);return t}function fx(e){let t=e.replace(qy,px);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function px(e){return"-"+e.toLowerCase()}const ga={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"]},mx={};function Hs(e,t){const n=mx,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return jd(e,r,o)}function jd(e,t,n){if(hx(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 Tc(e.children,t,n)}return Array.isArray(e)?Tc(e,t,n):""}function Tc(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=jd(e[o],t,n);return r.join("")}function hx(e){return!!(e&&typeof e=="object")}const Ac=document.createElement("i");function Vs(e){const t="&"+e+";";Ac.innerHTML=t;const n=Ac.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Bt(e,t,n,r){const o=e.length;let i=0,a;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function Zt(e,t){return e.length>0?(Bt(e,e.length,0,t),e):t}const Ic={}.hasOwnProperty;function Fd(e){const t={};let n=-1;for(;++n<e.length;)gx(t,e[n]);return t}function gx(e,t){let n;for(n in t){const o=(Ic.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){Ic.call(o,a)||(o[a]=[]);const s=i[a];bx(o[a],Array.isArray(s)?s:s?[s]:[])}}}function bx(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Bt(e,0,0,r)}function Bd(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 en(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const At=An(/[A-Za-z]/),St=An(/[\dA-Za-z]/),vx=An(/[#-'*+\--9=?A-Z^-~]/);function ri(e){return e!==null&&(e<32||e===127)}const es=An(/\d/),yx=An(/[\dA-Fa-f]/),xx=An(/[!-/:-@[-`{-~]/);function ge(e){return e!==null&&e<-2}function Ge(e){return e!==null&&(e<0||e===32)}function Re(e){return e===-2||e===-1||e===32}const Ei=An(new RegExp("\\p{P}|\\p{S}","u")),Vn=An(/\s/);function An(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Nr(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(i===37&&St(e.charCodeAt(n+1))&&St(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const s=e.charCodeAt(n+1);i<56320&&s>56319&&s<57344?(a=String.fromCharCode(i,s),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function Pe(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return Re(l)?(e.enter(n),s(l)):t(l)}function s(l){return Re(l)&&i++<o?(e.consume(l),s):(e.exit(n),t(l))}}const wx={tokenize:_x};function _x(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Pe(e,t,"linePrefix")}function o(s){return e.enter("paragraph"),i(s)}function i(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ge(s)?(e.consume(s),e.exit("chunkText"),i):(e.consume(s),a)}}const Ex={tokenize:Sx},Rc={tokenize:kx};function Sx(e){const t=this,n=[];let r=0,o,i,a;return s;function s(w){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,l,c)(w)}return c(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&x();const _=t.events.length;let C=_,E;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){E=t.events[C][1].end;break}v(r);let A=_;for(;A<t.events.length;)t.events[A][1].end={...E},A++;return Bt(t.events,C+1,0,t.events.slice(_)),t.events.length=A,c(w)}return s(w)}function c(w){if(r===n.length){if(!o)return p(w);if(o.currentConstruct&&o.currentConstruct.concrete)return b(w);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Rc,u,d)(w)}function u(w){return o&&x(),v(r),p(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,b(w)}function p(w){return t.containerState={},e.attempt(Rc,m,b)(w)}function m(w){return r++,n.push([t.currentConstruct,t.containerState]),p(w)}function b(w){if(w===null){o&&x(),v(0),e.consume(w);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),h(w)}function h(w){if(w===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return ge(w)?(e.consume(w),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(w),h)}function y(w,_){const C=t.sliceStream(w);if(_&&C.push(null),w.previous=i,i&&(i.next=w),i=w,o.defineSkip(w.start),o.write(C),t.parser.lazy[w.start.line]){let E=o.events.length;for(;E--;)if(o.events[E][1].start.offset<a&&(!o.events[E][1].end||o.events[E][1].end.offset>a))return;const A=t.events.length;let R=A,M,T;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(M){T=t.events[R][1].end;break}M=!0}for(v(r),E=A;E<t.events.length;)t.events[E][1].end={...T},E++;Bt(t.events,R+1,0,t.events.slice(A)),t.events.length=E}}function v(w){let _=n.length;for(;_-- >w;){const C=n[_];t.containerState=C[1],C[0].exit.call(t,e)}n.length=w}function x(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function kx(e,t,n){return Pe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function xr(e){if(e===null||Ge(e)||Vn(e))return 1;if(Ei(e))return 2}function Si(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const ts={name:"attention",resolveAll:Nx,tokenize:Cx};function Nx(e,t){let n=-1,r,o,i,a,s,l,c,u;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;l=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 d={...e[r][1].end},p={...e[n][1].start};Oc(d,-l),Oc(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[r][1].end={...a.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Zt(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Zt(c,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",i,t]]),c=Zt(c,Si(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Zt(c,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Zt(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Bt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Cx(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=xr(r);let i;return a;function a(l){return i=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===i)return e.consume(l),s;const c=e.exit("attentionSequence"),u=xr(l),d=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?d:d&&(o||!p)),c._close=!!(i===42?p:p&&(u||!d)),t(l)}}function Oc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Tx={name:"autolink",tokenize:Ax};function Ax(e,t,n){let r=0;return o;function o(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(m){return At(m)?(e.consume(m),a):m===64?n(m):c(m)}function a(m){return m===43||m===45||m===46||St(m)?(r=1,s(m)):c(m)}function s(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||St(m))&&r++<32?(e.consume(m),s):(r=0,c(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||ri(m)?n(m):(e.consume(m),l)}function c(m){return m===64?(e.consume(m),u):vx(m)?(e.consume(m),c):n(m)}function u(m){return St(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,u):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||St(m))&&r++<63){const b=m===45?p:d;return e.consume(m),b}return n(m)}}const so={partial:!0,tokenize:Ix};function Ix(e,t,n){return r;function r(i){return Re(i)?Pe(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||ge(i)?t(i):n(i)}}const Ud={continuation:{tokenize:Ox},exit:Mx,name:"blockQuote",tokenize:Rx};function Rx(e,t,n){const r=this;return o;function o(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return n(a)}function i(a){return Re(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Ox(e,t,n){const r=this;return o;function o(a){return Re(a)?Pe(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(Ud,t,n)(a)}}function Mx(e){e.exit("blockQuote")}const Hd={name:"characterEscape",tokenize:Px};function Px(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return xx(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Vd={name:"characterReference",tokenize:Dx};function Dx(e,t,n){const r=this;let o=0,i,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,a=St,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=yx,u):(e.enter("characterReferenceValue"),i=7,a=es,u(d))}function u(d){if(d===59&&o){const p=e.exit("characterReferenceValue");return a===St&&!Vs(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&o++<i?(e.consume(d),u):n(d)}}const Mc={partial:!0,tokenize:$x},Pc={concrete:!0,name:"codeFenced",tokenize:Lx};function Lx(e,t,n){const r=this,o={partial:!0,tokenize:C};let i=0,a=0,s;return l;function l(E){return c(E)}function c(E){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,s=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(E)}function u(E){return E===s?(a++,e.consume(E),u):a<3?n(E):(e.exit("codeFencedFenceSequence"),Re(E)?Pe(e,d,"whitespace")(E):d(E))}function d(E){return E===null||ge(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Mc,h,_)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||ge(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(E)):Re(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Pe(e,m,"whitespace")(E)):E===96&&E===s?n(E):(e.consume(E),p)}function m(E){return E===null||ge(E)?d(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===null||ge(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(E)):E===96&&E===s?n(E):(e.consume(E),b)}function h(E){return e.attempt(o,_,y)(E)}function y(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),v}function v(E){return i>0&&Re(E)?Pe(e,x,"linePrefix",i+1)(E):x(E)}function x(E){return E===null||ge(E)?e.check(Mc,h,_)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||ge(E)?(e.exit("codeFlowValue"),x(E)):(e.consume(E),w)}function _(E){return e.exit("codeFenced"),t(E)}function C(E,A,R){let M=0;return T;function T(P){return E.enter("lineEnding"),E.consume(P),E.exit("lineEnding"),I}function I(P){return E.enter("codeFencedFence"),Re(P)?Pe(E,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):O(P)}function O(P){return P===s?(E.enter("codeFencedFenceSequence"),D(P)):R(P)}function D(P){return P===s?(M++,E.consume(P),D):M>=a?(E.exit("codeFencedFenceSequence"),Re(P)?Pe(E,L,"whitespace")(P):L(P)):R(P)}function L(P){return P===null||ge(P)?(E.exit("codeFencedFence"),A(P)):R(P)}}}function $x(e,t,n){const r=this;return o;function o(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const ba={name:"codeIndented",tokenize:jx},zx={partial:!0,tokenize:Fx};function jx(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),Pe(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):ge(c)?e.attempt(zx,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||ge(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function Fx(e,t,n){const r=this;return o;function o(a){return r.parser.lazy[r.now().line]?n(a):ge(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):Pe(e,i,"linePrefix",5)(a)}function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):ge(a)?o(a):n(a)}}const Bx={name:"codeText",previous:Hx,resolve:Ux,tokenize:Vx};function Ux(e){let t=e.length-4,n=3,r,o;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;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function Hx(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Vx(e,t,n){let r=0,o,i;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),r++,s):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(i=e.enter("codeTextSequence"),o=0,u(d)):ge(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||ge(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}class Gx{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 o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Lr(this.left,r),i.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),Lr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Lr(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);Lr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Lr(this.left,n.reverse())}}}function Lr(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 Gd(e){const t={};let n=-1,r,o,i,a,s,l,c;const u=new Gx(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Zx(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(a=u.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),a[1].type="lineEnding",o=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;o&&(r[1].end={...u.get(o)[1].start},s=u.slice(o,n),s.unshift(r),u.splice(o,n-o+1,s))}}return Bt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Zx(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,p=-1,m=n,b=0,h=0;const y=[h];for(;m;){for(;e.get(++o)[1]!==m;);i.push(o),m._tokenizer||(u=r.sliceStream(m),m.next||u.push(null),d&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(h=p+1,y.push(h),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):y.pop(),p=y.length;p--;){const v=s.slice(y[p],y[p+1]),x=i.pop();l.push([x,x+v.length-1]),e.splice(x,2,v)}for(l.reverse(),p=-1;++p<l.length;)c[b+l[p][0]]=b+l[p][1],b+=l[p][1]-l[p][0]-1;return c}const Kx={resolve:qx,tokenize:Yx},Wx={partial:!0,tokenize:Xx};function qx(e){return Gd(e),e}function Yx(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(s)}function o(s){return s===null?i(s):ge(s)?e.check(Wx,a,i)(s):(e.consume(s),o)}function i(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function Xx(e,t,n){const r=this;return o;function o(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Pe(e,i,"linePrefix")}function i(a){if(a===null||ge(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Zd(e,t,n,r,o,i,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(v),e.exit(i),p):v===null||v===32||v===41||ri(v)?n(v):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(v))}function p(v){return v===62?(e.enter(i),e.consume(v),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(s),p(v)):v===null||v===60||ge(v)?n(v):(e.consume(v),v===92?b:m)}function b(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function h(v){return!u&&(v===null||v===41||Ge(v))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(v)):u<c&&v===40?(e.consume(v),u++,h):v===41?(e.consume(v),u--,h):v===null||v===32||v===40||ri(v)?n(v):(e.consume(v),v===92?y:h)}function y(v){return v===40||v===41||v===92?(e.consume(v),h):h(v)}}function Kd(e,t,n,r,o,i){const a=this;let s=0,l;return c;function c(m){return e.enter(r),e.enter(o),e.consume(m),e.exit(o),e.enter(i),u}function u(m){return s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(i),e.enter(o),e.consume(m),e.exit(o),e.exit(r),t):ge(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||ge(m)||s++>999?(e.exit("chunkString"),u(m)):(e.consume(m),l||(l=!Re(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}function Wd(e,t,n,r,o,i){let a;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),a=p===40?41:p,l):n(p)}function l(p){return p===a?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===a?(e.exit(i),l(a)):p===null?n(p):ge(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Pe(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===a||p===null||ge(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?d:u)}function d(p){return p===a||p===92?(e.consume(p),u):u(p)}}function Zr(e,t){let n;return r;function r(o){return ge(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Re(o)?Pe(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Jx={name:"definition",tokenize:ew},Qx={partial:!0,tokenize:tw};function ew(e,t,n){const r=this;let o;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return Kd.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return o=en(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return Ge(m)?Zr(e,c)(m):c(m)}function c(m){return Zd(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return e.attempt(Qx,d,d)(m)}function d(m){return Re(m)?Pe(e,p,"whitespace")(m):p(m)}function p(m){return m===null||ge(m)?(e.exit("definition"),r.parser.defined.push(o),t(m)):n(m)}}function tw(e,t,n){return r;function r(s){return Ge(s)?Zr(e,o)(s):n(s)}function o(s){return Wd(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return Re(s)?Pe(e,a,"whitespace")(s):a(s)}function a(s){return s===null||ge(s)?t(s):n(s)}}const nw={name:"hardBreakEscape",tokenize:rw};function rw(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return ge(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const ow={name:"headingAtx",resolve:iw,tokenize:aw};function iw(e,t){let n=e.length-2,r=3,o,i;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&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Bt(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function aw(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&r++<6?(e.consume(u),a):u===null||Ge(u)?(e.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ge(u)?(e.exit("atxHeading"),t(u)):Re(u)?Pe(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Ge(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const sw=["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"],Dc=["pre","script","style","textarea"],lw={concrete:!0,name:"htmlFlow",resolveTo:dw,tokenize:fw},cw={partial:!0,tokenize:mw},uw={partial:!0,tokenize:pw};function dw(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 fw(e,t,n){const r=this;let o,i,a,s,l;return c;function c(k){return u(k)}function u(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),d}function d(k){return k===33?(e.consume(k),p):k===47?(e.consume(k),i=!0,h):k===63?(e.consume(k),o=3,r.interrupt?t:S):At(k)?(e.consume(k),a=String.fromCharCode(k),y):n(k)}function p(k){return k===45?(e.consume(k),o=2,m):k===91?(e.consume(k),o=5,s=0,b):At(k)?(e.consume(k),o=4,r.interrupt?t:S):n(k)}function m(k){return k===45?(e.consume(k),r.interrupt?t:S):n(k)}function b(k){const Ee="CDATA[";return k===Ee.charCodeAt(s++)?(e.consume(k),s===Ee.length?r.interrupt?t:O:b):n(k)}function h(k){return At(k)?(e.consume(k),a=String.fromCharCode(k),y):n(k)}function y(k){if(k===null||k===47||k===62||Ge(k)){const Ee=k===47,Le=a.toLowerCase();return!Ee&&!i&&Dc.includes(Le)?(o=1,r.interrupt?t(k):O(k)):sw.includes(a.toLowerCase())?(o=6,Ee?(e.consume(k),v):r.interrupt?t(k):O(k)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(k):i?x(k):w(k))}return k===45||St(k)?(e.consume(k),a+=String.fromCharCode(k),y):n(k)}function v(k){return k===62?(e.consume(k),r.interrupt?t:O):n(k)}function x(k){return Re(k)?(e.consume(k),x):T(k)}function w(k){return k===47?(e.consume(k),T):k===58||k===95||At(k)?(e.consume(k),_):Re(k)?(e.consume(k),w):T(k)}function _(k){return k===45||k===46||k===58||k===95||St(k)?(e.consume(k),_):C(k)}function C(k){return k===61?(e.consume(k),E):Re(k)?(e.consume(k),C):w(k)}function E(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),l=k,A):Re(k)?(e.consume(k),E):R(k)}function A(k){return k===l?(e.consume(k),l=null,M):k===null||ge(k)?n(k):(e.consume(k),A)}function R(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||Ge(k)?C(k):(e.consume(k),R)}function M(k){return k===47||k===62||Re(k)?w(k):n(k)}function T(k){return k===62?(e.consume(k),I):n(k)}function I(k){return k===null||ge(k)?O(k):Re(k)?(e.consume(k),I):n(k)}function O(k){return k===45&&o===2?(e.consume(k),F):k===60&&o===1?(e.consume(k),K):k===62&&o===4?(e.consume(k),le):k===63&&o===3?(e.consume(k),S):k===93&&o===5?(e.consume(k),B):ge(k)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(cw,be,D)(k)):k===null||ge(k)?(e.exit("htmlFlowData"),D(k)):(e.consume(k),O)}function D(k){return e.check(uw,L,be)(k)}function L(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),P}function P(k){return k===null||ge(k)?D(k):(e.enter("htmlFlowData"),O(k))}function F(k){return k===45?(e.consume(k),S):O(k)}function K(k){return k===47?(e.consume(k),a="",V):O(k)}function V(k){if(k===62){const Ee=a.toLowerCase();return Dc.includes(Ee)?(e.consume(k),le):O(k)}return At(k)&&a.length<8?(e.consume(k),a+=String.fromCharCode(k),V):O(k)}function B(k){return k===93?(e.consume(k),S):O(k)}function S(k){return k===62?(e.consume(k),le):k===45&&o===2?(e.consume(k),S):O(k)}function le(k){return k===null||ge(k)?(e.exit("htmlFlowData"),be(k)):(e.consume(k),le)}function be(k){return e.exit("htmlFlow"),t(k)}}function pw(e,t,n){const r=this;return o;function o(a){return ge(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function mw(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(so,t,n)}}const hw={name:"htmlText",tokenize:gw};function gw(e,t,n){const r=this;let o,i,a;return s;function s(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),l}function l(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),C):S===63?(e.consume(S),w):At(S)?(e.consume(S),R):n(S)}function c(S){return S===45?(e.consume(S),u):S===91?(e.consume(S),i=0,b):At(S)?(e.consume(S),x):n(S)}function u(S){return S===45?(e.consume(S),m):n(S)}function d(S){return S===null?n(S):S===45?(e.consume(S),p):ge(S)?(a=d,K(S)):(e.consume(S),d)}function p(S){return S===45?(e.consume(S),m):d(S)}function m(S){return S===62?F(S):S===45?p(S):d(S)}function b(S){const le="CDATA[";return S===le.charCodeAt(i++)?(e.consume(S),i===le.length?h:b):n(S)}function h(S){return S===null?n(S):S===93?(e.consume(S),y):ge(S)?(a=h,K(S)):(e.consume(S),h)}function y(S){return S===93?(e.consume(S),v):h(S)}function v(S){return S===62?F(S):S===93?(e.consume(S),v):h(S)}function x(S){return S===null||S===62?F(S):ge(S)?(a=x,K(S)):(e.consume(S),x)}function w(S){return S===null?n(S):S===63?(e.consume(S),_):ge(S)?(a=w,K(S)):(e.consume(S),w)}function _(S){return S===62?F(S):w(S)}function C(S){return At(S)?(e.consume(S),E):n(S)}function E(S){return S===45||St(S)?(e.consume(S),E):A(S)}function A(S){return ge(S)?(a=A,K(S)):Re(S)?(e.consume(S),A):F(S)}function R(S){return S===45||St(S)?(e.consume(S),R):S===47||S===62||Ge(S)?M(S):n(S)}function M(S){return S===47?(e.consume(S),F):S===58||S===95||At(S)?(e.consume(S),T):ge(S)?(a=M,K(S)):Re(S)?(e.consume(S),M):F(S)}function T(S){return S===45||S===46||S===58||S===95||St(S)?(e.consume(S),T):I(S)}function I(S){return S===61?(e.consume(S),O):ge(S)?(a=I,K(S)):Re(S)?(e.consume(S),I):M(S)}function O(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),o=S,D):ge(S)?(a=O,K(S)):Re(S)?(e.consume(S),O):(e.consume(S),L)}function D(S){return S===o?(e.consume(S),o=void 0,P):S===null?n(S):ge(S)?(a=D,K(S)):(e.consume(S),D)}function L(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Ge(S)?M(S):(e.consume(S),L)}function P(S){return S===47||S===62||Ge(S)?M(S):n(S)}function F(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function K(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),V}function V(S){return Re(S)?Pe(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):B(S)}function B(S){return e.enter("htmlTextData"),a(S)}}const Gs={name:"labelEnd",resolveAll:xw,resolveTo:ww,tokenize:_w},bw={tokenize:Ew},vw={tokenize:Sw},yw={tokenize:kw};function xw(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 o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&Bt(e,0,e.length,n),e}function ww(e,t){let n=e.length,r=0,o,i,a,s;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(a=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=Zt(s,e.slice(i+1,i+r+3)),s=Zt(s,[["enter",u,t]]),s=Zt(s,Si(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),s=Zt(s,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),s=Zt(s,e.slice(a+1)),s=Zt(s,[["exit",l,t]]),Bt(e,i,e.length,s),e}function _w(e,t,n){const r=this;let o=r.events.length,i,a;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return s;function s(p){return i?i._inactive?d(p):(a=r.parser.defined.includes(en(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(bw,u,a?u:d)(p):p===91?e.attempt(vw,u,a?c:d)(p):a?u(p):d(p)}function c(p){return e.attempt(yw,u,d)(p)}function u(p){return t(p)}function d(p){return i._balanced=!0,n(p)}}function Ew(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),o}function o(d){return Ge(d)?Zr(e,i)(d):i(d)}function i(d){return d===41?u(d):Zd(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Ge(d)?Zr(e,l)(d):u(d)}function s(d){return n(d)}function l(d){return d===34||d===39||d===40?Wd(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Ge(d)?Zr(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function Sw(e,t,n){const r=this;return o;function o(s){return Kd.call(r,e,i,a,"reference","referenceMarker","referenceString")(s)}function i(s){return r.parser.defined.includes(en(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function kw(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const Nw={name:"labelStartImage",resolveAll:Gs.resolveAll,tokenize:Cw};function Cw(e,t,n){const r=this;return o;function o(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),i}function i(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Tw={name:"labelStartLink",resolveAll:Gs.resolveAll,tokenize:Aw};function Aw(e,t,n){const r=this;return o;function o(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const va={name:"lineEnding",tokenize:Iw};function Iw(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Pe(e,t,"linePrefix")}}const Xo={name:"thematicBreak",tokenize:Rw};function Rw(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),a(c)}function a(c){return o=c,s(c)}function s(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ge(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Re(c)?Pe(e,s,"whitespace")(c):s(c))}}const Mt={continuation:{tokenize:Dw},exit:$w,name:"list",tokenize:Pw},Ow={partial:!0,tokenize:zw},Mw={partial:!0,tokenize:Lw};function Pw(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,a=0;return s;function s(m){const b=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:es(m)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Xo,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return es(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(so,r.interrupt?n:u,e.attempt(Ow,p,d))}function u(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function d(m){return Re(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function Dw(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(so,o,i);function o(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Pe(e,t,"listItemIndent",r.containerState.size+1)(s)}function i(s){return r.containerState.furtherBlankLines||!Re(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Mw,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Pe(e,e.attempt(Mt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Lw(e,t,n){const r=this;return Pe(e,o,"listItemIndent",r.containerState.size+1);function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function $w(e){e.exit(this.containerState.type)}function zw(e,t,n){const r=this;return Pe(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const a=r.events[r.events.length-1];return!Re(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const Lc={name:"setextUnderline",resolveTo:jw,tokenize:Fw};function jw(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Fw(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),o=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===o?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Re(c)?Pe(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ge(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Bw={tokenize:Uw};function Uw(e){const t=this,n=e.attempt(so,r,e.attempt(this.parser.constructs.flowInitial,o,Pe(e,e.attempt(this.parser.constructs.flow,o,e.attempt(Kx,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Hw={resolveAll:Yd()},Vw=qd("string"),Gw=qd("text");function qd(e){return{resolveAll:Yd(e==="text"?Zw:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,a,s);return a;function a(u){return c(u)?i(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=o[u];let p=-1;if(d)for(;++p<d.length;){const m=d[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Yd(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function Zw(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],o=t.sliceStream(r);let i=o.length,a=-1,s=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const Kw={42:Mt,43:Mt,45:Mt,48:Mt,49:Mt,50:Mt,51:Mt,52:Mt,53:Mt,54:Mt,55:Mt,56:Mt,57:Mt,62:Ud},Ww={91:Jx},qw={[-2]:ba,[-1]:ba,32:ba},Yw={35:ow,42:Xo,45:[Lc,Xo],60:lw,61:Lc,95:Xo,96:Pc,126:Pc},Xw={38:Vd,92:Hd},Jw={[-5]:va,[-4]:va,[-3]:va,33:Nw,38:Vd,42:ts,60:[Tx,hw],91:Tw,92:[nw,Hd],93:Gs,95:ts,96:Bx},Qw={null:[ts,Hw]},e_={null:[42,95]},t_={null:[]},n_=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:e_,contentInitial:Ww,disable:t_,document:Kw,flow:Yw,flowInitial:qw,insideSpan:Qw,string:Xw,text:Jw},Symbol.toStringTag,{value:"Module"}));function r_(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 o={},i=[];let a=[],s=[];const l={attempt:A(C),check:A(E),consume:x,enter:w,exit:_,interrupt:A(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:h,events:[],now:b,parser:e,previous:null,sliceSerialize:p,sliceStream:m,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(I){return a=Zt(a,I),y(),a[a.length-1]!==null?[]:(R(t,0),c.events=Si(i,c.events,c),c.events)}function p(I,O){return i_(m(I),O)}function m(I){return o_(a,I)}function b(){const{_bufferIndex:I,_index:O,line:D,column:L,offset:P}=r;return{_bufferIndex:I,_index:O,line:D,column:L,offset:P}}function h(I){o[I.line]=I.column,T()}function y(){let I;for(;r._index<a.length;){const O=a[r._index];if(typeof O=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<O.length;)v(O.charCodeAt(r._bufferIndex));else v(O)}}function v(I){u=u(I)}function x(I){ge(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,T()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=I}function w(I,O){const D=O||{};return D.type=I,D.start=b(),c.events.push(["enter",D,c]),s.push(D),D}function _(I){const O=s.pop();return O.end=b(),c.events.push(["exit",O,c]),O}function C(I,O){R(I,O.from)}function E(I,O){O.restore()}function A(I,O){return D;function D(L,P,F){let K,V,B,S;return Array.isArray(L)?be(L):"tokenize"in L?be([L]):le(L);function le(we){return G;function G(se){const Ce=se!==null&&we[se],fe=se!==null&&we.null,ie=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(fe)?fe:fe?[fe]:[]];return be(ie)(se)}}function be(we){return K=we,V=0,we.length===0?F:k(we[V])}function k(we){return G;function G(se){return S=M(),B=we,we.partial||(c.currentConstruct=we),we.name&&c.parser.constructs.disable.null.includes(we.name)?Le():we.tokenize.call(O?Object.assign(Object.create(c),O):c,l,Ee,Le)(se)}}function Ee(we){return I(B,S),P}function Le(we){return S.restore(),++V<K.length?k(K[V]):F}}}function R(I,O){I.resolveAll&&!i.includes(I)&&i.push(I),I.resolve&&Bt(c.events,O,c.events.length-O,I.resolve(c.events.slice(O),c)),I.resolveTo&&(c.events=I.resolveTo(c.events,c))}function M(){const I=b(),O=c.previous,D=c.currentConstruct,L=c.events.length,P=Array.from(s);return{from:L,restore:F};function F(){r=I,c.previous=O,c.currentConstruct=D,c.events.length=L,s=P,T()}}function T(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function o_(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}function i_(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
6
- `;break}case-3:{a=`\r
7
- `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&o)continue;a=" ";break}default:a=String.fromCharCode(i)}o=i===-2,r.push(a)}return r.join("")}function a_(e){const r={constructs:Fd([n_,...(e||{}).extensions||[]]),content:o(wx),defined:[],document:o(Ex),flow:o(Bw),lazy:{},string:o(Vw),text:o(Gw)};return r;function o(i){return a;function a(s){return r_(r,i,s)}}}function s_(e){for(;!Gd(e););return e}const $c=/[\0\t\n\r]/g;function l_(){let e=1,t="",n=!0,r;return o;function o(i,a,s){const l=[];let c,u,d,p,m;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if($c.lastIndex=d,c=$c.exec(i),p=c&&c.index!==void 0?c.index:i.length,m=i.charCodeAt(p),!c){t=i.slice(d);break}if(m===10&&d===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<p&&(l.push(i.slice(d,p)),e+=p-d),m){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=p+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const c_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function u_(e){return e.replace(c_,d_)}function d_(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return Bd(n.slice(i?2:1),i?16:10)}return Vs(n)||e}const Xd={}.hasOwnProperty;function f_(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),p_(n)(s_(a_(n).document().write(l_()(e,t,!0))))}function p_(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(yt),autolinkProtocol:M,autolinkEmail:M,atxHeading:i(Fe),blockQuote:i(fe),characterEscape:M,characterReference:M,codeFenced:i(ie),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(ie,a),codeText:i(X,a),codeTextData:M,data:M,codeFlowValue:M,definition:i(xe),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(Q),hardBreakEscape:i(ve),hardBreakTrailing:i(ve),htmlFlow:i(Ve,a),htmlFlowData:M,htmlText:i(Ve,a),htmlTextData:M,image:i(ct),label:a,link:i(yt),listItem:i(Ut),listItemValue:p,listOrdered:i(rt,d),listUnordered:i(rt),paragraph:i(gn),reference:k,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Fe),strong:i(Rt),thematicBreak:i(an)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:Ce,autolinkProtocol:se,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:Le,characterReferenceMarkerNumeric:Le,characterReferenceValue:we,characterReference:G,codeFenced:l(y),codeFencedFence:h,codeFencedFenceInfo:m,codeFencedFenceMeta:b,codeFlowValue:T,codeIndented:l(v),codeText:l(P),codeTextData:T,data:T,definition:l(),definitionDestinationString:_,definitionLabelString:x,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(O),hardBreakTrailing:l(O),htmlFlow:l(D),htmlFlowData:T,htmlText:l(L),htmlTextData:T,image:l(K),label:B,labelText:V,lineEnding:I,link:l(F),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ee,resourceDestinationString:S,resourceTitleString:le,resource:be,setextHeading:l(R),setextHeadingLineSequence:A,setextHeadingText:E,strong:l(),thematicBreak:l()}};Jd(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(z){let W={type:"root",children:[]};const me={stack:[W],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},Se=[];let Te=-1;for(;++Te<z.length;)if(z[Te][1].type==="listOrdered"||z[Te][1].type==="listUnordered")if(z[Te][0]==="enter")Se.push(Te);else{const ut=Se.pop();Te=o(z,ut,Te)}for(Te=-1;++Te<z.length;){const ut=t[z[Te][0]];Xd.call(ut,z[Te][1].type)&&ut[z[Te][1].type].call(Object.assign({sliceSerialize:z[Te][2].sliceSerialize},me),z[Te][1])}if(me.tokenStack.length>0){const ut=me.tokenStack[me.tokenStack.length-1];(ut[1]||zc).call(me,void 0,ut[0])}for(W.position={start:_n(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:_n(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},Te=-1;++Te<t.transforms.length;)W=t.transforms[Te](W)||W;return W}function o(z,W,me){let Se=W-1,Te=-1,ut=!1,dt,ft,Ht,Yt;for(;++Se<=me;){const pt=z[Se];switch(pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pt[0]==="enter"?Te++:Te--,Yt=void 0;break}case"lineEndingBlank":{pt[0]==="enter"&&(dt&&!Yt&&!Te&&!Ht&&(Ht=Se),Yt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yt=void 0}if(!Te&&pt[0]==="enter"&&pt[1].type==="listItemPrefix"||Te===-1&&pt[0]==="exit"&&(pt[1].type==="listUnordered"||pt[1].type==="listOrdered")){if(dt){let Vt=Se;for(ft=void 0;Vt--;){const xt=z[Vt];if(xt[1].type==="lineEnding"||xt[1].type==="lineEndingBlank"){if(xt[0]==="exit")continue;ft&&(z[ft][1].type="lineEndingBlank",ut=!0),xt[1].type="lineEnding",ft=Vt}else if(!(xt[1].type==="linePrefix"||xt[1].type==="blockQuotePrefix"||xt[1].type==="blockQuotePrefixWhitespace"||xt[1].type==="blockQuoteMarker"||xt[1].type==="listItemIndent"))break}Ht&&(!ft||Ht<ft)&&(dt._spread=!0),dt.end=Object.assign({},ft?z[ft][1].start:pt[1].end),z.splice(ft||Se,0,["exit",dt,pt[2]]),Se++,me++}if(pt[1].type==="listItemPrefix"){const Vt={type:"listItem",_spread:!1,start:Object.assign({},pt[1].start),end:void 0};dt=Vt,z.splice(Se,0,["enter",Vt,pt[2]]),Se++,me++,Ht=void 0,Yt=!0}}}return z[W][1]._spread=ut,me}function i(z,W){return me;function me(Se){s.call(this,z(Se),Se),W&&W.call(this,Se)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(z,W,me){this.stack[this.stack.length-1].children.push(z),this.stack.push(z),this.tokenStack.push([W,me||void 0]),z.position={start:_n(W.start),end:void 0}}function l(z){return W;function W(me){z&&z.call(this,me),c.call(this,me)}}function c(z,W){const me=this.stack.pop(),Se=this.tokenStack.pop();if(Se)Se[0].type!==z.type&&(W?W.call(this,z,Se[0]):(Se[1]||zc).call(this,z,Se[0]));else throw new Error("Cannot close `"+z.type+"` ("+Gr({start:z.start,end:z.end})+"): it’s not open");me.position.end=_n(z.end)}function u(){return Hs(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(z){if(this.data.expectingFirstListItemValue){const W=this.stack[this.stack.length-2];W.start=Number.parseInt(this.sliceSerialize(z),10),this.data.expectingFirstListItemValue=void 0}}function m(){const z=this.resume(),W=this.stack[this.stack.length-1];W.lang=z}function b(){const z=this.resume(),W=this.stack[this.stack.length-1];W.meta=z}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const z=this.resume(),W=this.stack[this.stack.length-1];W.value=z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const z=this.resume(),W=this.stack[this.stack.length-1];W.value=z.replace(/(\r?\n|\r)$/g,"")}function x(z){const W=this.resume(),me=this.stack[this.stack.length-1];me.label=W,me.identifier=en(this.sliceSerialize(z)).toLowerCase()}function w(){const z=this.resume(),W=this.stack[this.stack.length-1];W.title=z}function _(){const z=this.resume(),W=this.stack[this.stack.length-1];W.url=z}function C(z){const W=this.stack[this.stack.length-1];if(!W.depth){const me=this.sliceSerialize(z).length;W.depth=me}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function A(z){const W=this.stack[this.stack.length-1];W.depth=this.sliceSerialize(z).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function M(z){const me=this.stack[this.stack.length-1].children;let Se=me[me.length-1];(!Se||Se.type!=="text")&&(Se=Ot(),Se.position={start:_n(z.start),end:void 0},me.push(Se)),this.stack.push(Se)}function T(z){const W=this.stack.pop();W.value+=this.sliceSerialize(z),W.position.end=_n(z.end)}function I(z){const W=this.stack[this.stack.length-1];if(this.data.atHardBreak){const me=W.children[W.children.length-1];me.position.end=_n(z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(W.type)&&(M.call(this,z),T.call(this,z))}function O(){this.data.atHardBreak=!0}function D(){const z=this.resume(),W=this.stack[this.stack.length-1];W.value=z}function L(){const z=this.resume(),W=this.stack[this.stack.length-1];W.value=z}function P(){const z=this.resume(),W=this.stack[this.stack.length-1];W.value=z}function F(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=W,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function K(){const z=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";z.type+="Reference",z.referenceType=W,delete z.url,delete z.title}else delete z.identifier,delete z.label;this.data.referenceType=void 0}function V(z){const W=this.sliceSerialize(z),me=this.stack[this.stack.length-2];me.label=u_(W),me.identifier=en(W).toLowerCase()}function B(){const z=this.stack[this.stack.length-1],W=this.resume(),me=this.stack[this.stack.length-1];if(this.data.inReference=!0,me.type==="link"){const Se=z.children;me.children=Se}else me.alt=W}function S(){const z=this.resume(),W=this.stack[this.stack.length-1];W.url=z}function le(){const z=this.resume(),W=this.stack[this.stack.length-1];W.title=z}function be(){this.data.inReference=void 0}function k(){this.data.referenceType="collapsed"}function Ee(z){const W=this.resume(),me=this.stack[this.stack.length-1];me.label=W,me.identifier=en(this.sliceSerialize(z)).toLowerCase(),this.data.referenceType="full"}function Le(z){this.data.characterReferenceType=z.type}function we(z){const W=this.sliceSerialize(z),me=this.data.characterReferenceType;let Se;me?(Se=Bd(W,me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Se=Vs(W);const Te=this.stack[this.stack.length-1];Te.value+=Se}function G(z){const W=this.stack.pop();W.position.end=_n(z.end)}function se(z){T.call(this,z);const W=this.stack[this.stack.length-1];W.url=this.sliceSerialize(z)}function Ce(z){T.call(this,z);const W=this.stack[this.stack.length-1];W.url="mailto:"+this.sliceSerialize(z)}function fe(){return{type:"blockquote",children:[]}}function ie(){return{type:"code",lang:null,meta:null,value:""}}function X(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Q(){return{type:"emphasis",children:[]}}function Fe(){return{type:"heading",depth:0,children:[]}}function ve(){return{type:"break"}}function Ve(){return{type:"html",value:""}}function ct(){return{type:"image",title:null,url:"",alt:null}}function yt(){return{type:"link",title:null,url:"",children:[]}}function rt(z){return{type:"list",ordered:z.type==="listOrdered",start:null,spread:z._spread,children:[]}}function Ut(z){return{type:"listItem",spread:z._spread,checked:null,children:[]}}function gn(){return{type:"paragraph",children:[]}}function Rt(){return{type:"strong",children:[]}}function Ot(){return{type:"text",value:""}}function an(){return{type:"thematicBreak"}}}function _n(e){return{line:e.line,column:e.column,offset:e.offset}}function Jd(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Jd(e,r):m_(e,r)}}function m_(e,t){let n;for(n in t)if(Xd.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 zc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Gr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Gr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Gr({start:t.start,end:t.end})+") is still open")}function h_(e){const t=this;t.parser=n;function n(r){return f_(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function g_(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 b_(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
8
- `}]}function v_(e,t){const n=t.value?t.value+`
9
- `:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function y_(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function x_(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function w_(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Nr(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function __(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E_(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Qd(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&a.type==="text"?a.value+=r:o.push({type:"text",value:r}),o}function S_(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Qd(e,t);const o={src:Nr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function k_(e,t){const n={src:Nr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function N_(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function C_(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Qd(e,t);const o={href:Nr(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function T_(e,t){const n={href:Nr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function A_(e,t,n){const r=e.all(t),o=n?I_(n):ef(t),i={},a=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const u=r[s];(o||s!==0||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
10
- `}),u.type==="element"&&u.tagName==="p"&&!o?a.push(...u.children):a.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
11
- `});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)}function I_(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ef(n[r])}return t}function ef(e){const t=e.spread;return t??e.children.length>1}function R_(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const a=r[o];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function O_(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function M_(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function P_(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D_(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),o.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=js(t.children[1]),l=Md(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),o.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function L_(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const d=t.children[l],p={},m=a?a[l]:void 0;m&&(p.align=m);let b={type:"element",tagName:i,properties:p,children:[]};d&&(b.children=e.all(d),e.patch(d,b),b=e.applyData(d,b)),c.push(b)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function $_(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const jc=9,Fc=32;function z_(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Bc(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Bc(t.slice(o),o>0,!1)),i.join("")}function Bc(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===jc||i===Fc;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===jc||i===Fc;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function j_(e,t){const n={type:"text",value:z_(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function F_(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const B_={blockquote:g_,break:b_,code:v_,delete:y_,emphasis:x_,footnoteReference:w_,heading:__,html:E_,imageReference:S_,image:k_,inlineCode:N_,linkReference:C_,link:T_,listItem:A_,list:R_,paragraph:O_,root:M_,strong:P_,table:D_,tableCell:$_,tableRow:L_,text:j_,thematicBreak:F_,toml:Io,yaml:Io,definition:Io,footnoteDefinition:Io};function Io(){}const tf=-1,ki=0,Kr=1,oi=2,Zs=3,Ks=4,Ws=5,qs=6,nf=7,rf=8,Uc=typeof self=="object"?self:globalThis,U_=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,a]=t[o];switch(i){case ki:case tf:return n(a,o);case Kr:{const s=n([],o);for(const l of a)s.push(r(l));return s}case oi:{const s=n({},o);for(const[l,c]of a)s[r(l)]=r(c);return s}case Zs:return n(new Date(a),o);case Ks:{const{source:s,flags:l}=a;return n(new RegExp(s,l),o)}case Ws:{const s=n(new Map,o);for(const[l,c]of a)s.set(r(l),r(c));return s}case qs:{const s=n(new Set,o);for(const l of a)s.add(r(l));return s}case nf:{const{name:s,message:l}=a;return n(new Uc[s](l),o)}case rf:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:s}=new Uint8Array(a);return n(new DataView(s),a)}}return n(new Uc[i](a),o)};return r},Hc=e=>U_(new Map,e)(0),nr="",{toString:H_}={},{keys:V_}=Object,$r=e=>{const t=typeof e;if(t!=="object"||!e)return[ki,t];const n=H_.call(e).slice(8,-1);switch(n){case"Array":return[Kr,nr];case"Object":return[oi,nr];case"Date":return[Zs,nr];case"RegExp":return[Ks,nr];case"Map":return[Ws,nr];case"Set":return[qs,nr];case"DataView":return[Kr,n]}return n.includes("Array")?[Kr,n]:n.includes("Error")?[nf,n]:[oi,n]},Ro=([e,t])=>e===ki&&(t==="function"||t==="symbol"),G_=(e,t,n,r)=>{const o=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},i=a=>{if(n.has(a))return n.get(a);let[s,l]=$r(a);switch(s){case ki:{let u=a;switch(l){case"bigint":s=rf,u=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([tf],a)}return o([s,u],a)}case Kr:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),o([l,[...p]],a)}const u=[],d=o([s,u],a);for(const p of a)u.push(i(p));return d}case oi:{if(l)switch(l){case"BigInt":return o([l,a.toString()],a);case"Boolean":case"Number":case"String":return o([l,a.valueOf()],a)}if(t&&"toJSON"in a)return i(a.toJSON());const u=[],d=o([s,u],a);for(const p of V_(a))(e||!Ro($r(a[p])))&&u.push([i(p),i(a[p])]);return d}case Zs:return o([s,a.toISOString()],a);case Ks:{const{source:u,flags:d}=a;return o([s,{source:u,flags:d}],a)}case Ws:{const u=[],d=o([s,u],a);for(const[p,m]of a)(e||!(Ro($r(p))||Ro($r(m))))&&u.push([i(p),i(m)]);return d}case qs:{const u=[],d=o([s,u],a);for(const p of a)(e||!Ro($r(p)))&&u.push(i(p));return d}}const{message:c}=a;return o([s,{name:l,message:c}],a)};return i},Vc=(e,{json:t,lossy:n}={})=>{const r=[];return G_(!(t||n),!!t,new Map,r)(e),r},ii=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Hc(Vc(e,t)):structuredClone(e):(e,t)=>Hc(Vc(e,t));function Z_(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function K_(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function W_(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Z_,r=e.options.footnoteBackLabel||K_,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),p=Nr(d.toLowerCase());let m=0;const b=[],h=e.footnoteCounts.get(d);for(;h!==void 0&&++m<=h;){b.length>0&&b.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,m);typeof x=="string"&&(x={type:"text",value:x}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const x=y.children[y.children.length-1];x&&x.type==="text"?x.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...b)}else u.push(...b);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,v),s.push(v)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ii(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
12
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
13
- `}]}}const lo=(function(e){if(e==null)return J_;if(typeof e=="function")return Ni(e);if(typeof e=="object")return Array.isArray(e)?q_(e):Y_(e);if(typeof e=="string")return X_(e);throw new Error("Expected function, string, or object as test")});function q_(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=lo(e[n]);return Ni(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function Y_(e){const t=e;return Ni(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function X_(e){return Ni(t);function t(n){return n&&n.type===e}}function Ni(e){return t;function t(n,r,o){return!!(Q_(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function J_(){return!0}function Q_(e){return e!==null&&typeof e=="object"&&"type"in e}const of=[],eE=!0,ns=!1,tE="skip";function af(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=lo(o),a=r?-1:1;s(e,void 0,[])();function s(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=of,b,h,y;if((!t||i(l,c,u[u.length-1]||void 0))&&(m=nE(n(l,u)),m[0]===ns))return m;if("children"in l&&l.children){const v=l;if(v.children&&m[0]!==tE)for(h=(r?v.children.length:-1)+a,y=u.concat(v);h>-1&&h<v.children.length;){const x=v.children[h];if(b=s(x,h,y)(),b[0]===ns)return b;h=typeof b[1]=="number"?b[1]:h+a}}return m}}}function nE(e){return Array.isArray(e)?e:typeof e=="number"?[eE,e]:e==null?of:[e]}function Ci(e,t,n,r){let o,i,a;typeof t=="function"&&typeof n!="function"?(i=void 0,a=t,o=n):(i=t,a=n,o=r),af(e,i,s,o);function s(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return a(l,d,u)}}const rs={}.hasOwnProperty,rE={};function oE(e,t){const n=t||rE,r=new Map,o=new Map,i=new Map,a={...B_,...n.handlers},s={all:c,applyData:aE,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:l,options:n,patch:iE,wrap:lE};return Ci(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:o,p=String(u.identifier).toUpperCase();d.has(p)||d.set(p,u)}}),s;function l(u,d){const p=u.type,m=s.handlers[p];if(rs.call(s.handlers,p)&&m)return m(s,u,d);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in u){const{children:h,...y}=u,v=ii(y);return v.children=s.all(u),v}return ii(u)}return(s.options.unknownHandler||sE)(s,u,d)}function c(u){const d=[];if("children"in u){const p=u.children;let m=-1;for(;++m<p.length;){const b=s.one(p[m],u);if(b){if(m&&p[m-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=Gc(b.value)),!Array.isArray(b)&&b.type==="element")){const h=b.children[0];h&&h.type==="text"&&(h.value=Gc(h.value))}Array.isArray(b)?d.push(...b):d.push(b)}}}return d}}function iE(e,t){e.position&&(t.position=Ky(e))}function aE(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&i&&Object.assign(n.properties,ii(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function sE(e,t){const n=t.data||{},r="value"in t&&!(rs.call(n,"hProperties")||rs.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function lE(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
14
- `});++r<e.length;)r&&n.push({type:"text",value:`
15
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
16
- `}),n}function Gc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Zc(e,t){const n=oE(e,t),r=n.one(e,void 0),o=W_(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
17
- `},o),i}function cE(e,t){return e&&"run"in e?async function(n,r){const o=Zc(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Zc(n,{file:r,...e||t})}}function Kc(e){if(e)throw e}var ya,Wc;function uE(){if(Wc)return ya;Wc=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),d=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!d)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},a=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},s=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return ya=function l(){var c,u,d,p,m,b,h=arguments[0],y=1,v=arguments.length,x=!1;for(typeof h=="boolean"&&(x=h,h=arguments[1]||{},y=2),(h==null||typeof h!="object"&&typeof h!="function")&&(h={});y<v;++y)if(c=arguments[y],c!=null)for(u in c)d=s(h,u),p=s(c,u),h!==p&&(x&&p&&(i(p)||(m=o(p)))?(m?(m=!1,b=d&&o(d)?d:[]):b=d&&i(d)?d:{},a(h,{name:u,newValue:l(x,b,p)})):typeof p<"u"&&a(h,{name:u,newValue:p}));return h},ya}var dE=uE();const xa=Ms(dE);function os(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function fE(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const a=o.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...o);function s(l,...c){const u=e[++i];let d=-1;if(l){a(l);return}for(;++d<o.length;)(c[d]===null||c[d]===void 0)&&(c[d]=o[d]);o=c,u?pE(u,s)(...c):a(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function pE(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(o);try{l=e.apply(this,a)}catch(c){const u=c;if(s&&n)throw u;return o(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(a,...s){n||(n=!0,t(a,...s))}function i(a){o(null,a)}}const un={basename:mE,dirname:hE,extname:gE,join:bE,sep:"/"};function mE(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');co(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else a<0&&(i=!0,a=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(r=o):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function hE(e){if(co(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function gE(e){co(e);let t=e.length,n=-1,r=0,o=-1,i=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function bE(...e){let t=-1,n;for(;++t<e.length;)co(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":vE(n)}function vE(e){co(e);const t=e.codePointAt(0)===47;let n=yE(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yE(e,t){let n="",r=0,o=-1,i=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(o===a-1||i===1))if(o!==a-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=a,i=0;continue}}else if(n.length>0){n="",r=0,o=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),r=a-o-1;o=a,i=0}else s===46&&i>-1?i++:i=-1}return n}function co(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xE={cwd:wE};function wE(){return"/"}function is(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _E(e){if(typeof e=="string")e=new URL(e);else if(!is(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return EE(e)}function EE(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const wa=["history","path","basename","stem","extname","dirname"];class sf{constructor(t){let n;t?is(t)?n={path:t}:typeof t=="string"||SE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":xE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<wa.length;){const i=wa[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)wa.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?un.basename(this.path):void 0}set basename(t){Ea(t,"basename"),_a(t,"basename"),this.path=un.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?un.dirname(this.path):void 0}set dirname(t){qc(this.basename,"dirname"),this.path=un.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?un.extname(this.path):void 0}set extname(t){if(_a(t,"extname"),qc(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=un.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){is(t)&&(t=_E(t)),Ea(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?un.basename(this.path,this.extname):void 0}set stem(t){Ea(t,"stem"),_a(t,"stem"),this.path=un.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new kt(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function _a(e,t){if(e&&e.includes(un.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+un.sep+"`")}function Ea(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function SE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kE=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),NE={}.hasOwnProperty;class Ys extends kE{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=fE()}copy(){const t=new Ys;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(xa(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Na("data",this.frozen),this.namespace[t]=n,this):NE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Na("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Oo(t),r=this.parser||this.Parser;return Sa("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Sa("process",this.parser||this.Parser),ka("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,a){const s=Oo(t),l=r.parse(s);r.run(l,s,function(u,d,p){if(u||!d||!p)return c(u);const m=d,b=r.stringify(m,p);AE(b)?p.value=b:p.result=b,c(u,p)});function c(u,d){u||!d?a(u):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Sa("processSync",this.parser||this.Parser),ka("processSync",this.compiler||this.Compiler),this.process(t,o),Xc("processSync","process",n),r;function o(i,a){n=!0,Kc(i),r=a}}run(t,n,r){Yc(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(a,s){const l=Oo(n);o.run(t,l,c);function c(u,d,p){const m=d||t;u?s(u):a?a(m):r(void 0,m,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),Xc("runSync","run",r),o;function i(a,s){Kc(a),o=s,r=!0}}stringify(t,n){this.freeze();const r=Oo(n),o=this.compiler||this.Compiler;return ka("stringify",o),Yc(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Na("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(o.settings=xa(!0,o.settings,c.settings))}function s(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===c){p=d;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[m,...b]=u;const h=r[p][1];os(h)&&os(m)&&(m=xa(!0,h,m)),r[p]=[c,m,...b]}}}}const CE=new Ys().freeze();function Sa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ka(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Na(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Yc(e){if(!os(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Xc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Oo(e){return TE(e)?e:new sf(e)}function TE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function AE(e){return typeof e=="string"||IE(e)}function IE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const RE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Jc=[],Qc={allowDangerousHtml:!0},OE=/^(https?|ircs?|mailto|xmpp)$/i,ME=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function lf(e){const t=PE(e),n=DE(e);return LE(t.runSync(t.parse(n),n),e)}function PE(e){const t=e.rehypePlugins||Jc,n=e.remarkPlugins||Jc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Qc}:Qc;return CE().use(h_).use(n).use(cE,r).use(t)}function DE(e){const t=e.children||"",n=new sf;return typeof t=="string"&&(n.value=t),n}function LE(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||$E;for(const u of ME)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+RE+u.id,void 0);return Ci(e,c),Jy(e,{Fragment:f.Fragment,components:o,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function c(u,d,p){if(u.type==="raw"&&p&&typeof d=="number")return a?p.children.splice(d,1):p.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let m;for(m in ga)if(Object.hasOwn(ga,m)&&Object.hasOwn(u.properties,m)){const b=u.properties[m],h=ga[m];(h===null||h.includes(u.tagName))&&(u.properties[m]=l(String(b||""),m,u))}}if(u.type==="element"){let m=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(u,d,p)),m&&p&&typeof d=="number")return s&&u.children?p.children.splice(d,1,...u.children):p.children.splice(d,1),d}}}function $E(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||OE.test(e.slice(0,t))?e:""}const eu=(function(e,t,n){const r=lo(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),Xn=(function(e){if(e==null)return FE;if(typeof e=="string")return jE(e);if(typeof e=="object")return zE(e);if(typeof e=="function")return Xs(e);throw new Error("Expected function, string, or array as `test`")});function zE(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xn(e[n]);return Xs(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function jE(e){return Xs(t);function t(n){return n.tagName===e}}function Xs(e){return t;function t(n,r,o){return!!(BE(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function FE(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function BE(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const tu=/\n/g,nu=/[\t ]+/g,as=Xn("br"),ru=Xn(qE),UE=Xn("p"),ou=Xn("tr"),HE=Xn(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",WE,YE]),cf=Xn(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function VE(e,t){const n=t||{},r="children"in e?e.children:[],o=cf(e),i=ff(e,{whitespace:n.whitespace||"normal"}),a=[];(e.type==="text"||e.type==="comment")&&a.push(...df(e,{breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)a.push(...uf(r[s],e,{whitespace:i,breakBefore:s?void 0:o,breakAfter:s<r.length-1?as(r[s+1]):o}));const l=[];let c;for(s=-1;++s<a.length;){const u=a[s];typeof u=="number"?c!==void 0&&u>c&&(c=u):u&&(c!==void 0&&c>-1&&l.push(`
18
- `.repeat(c)||" "),c=-1,l.push(u))}return l.join("")}function uf(e,t,n){return e.type==="element"?GE(e,t,n):e.type==="text"?n.whitespace==="normal"?df(e,n):ZE(e):[]}function GE(e,t,n){const r=ff(e,n),o=e.children||[];let i=-1,a=[];if(HE(e))return a;let s,l;for(as(e)||ou(e)&&eu(t,e,ou)?l=`
19
- `:UE(e)?(s=2,l=2):cf(e)&&(s=1,l=1);++i<o.length;)a=a.concat(uf(o[i],e,{whitespace:r,breakBefore:i?void 0:s,breakAfter:i<o.length-1?as(o[i+1]):l}));return ru(e)&&eu(t,e,ru)&&a.push(" "),s&&a.unshift(s),l&&a.push(l),a}function df(e,t){const n=String(e.value),r=[],o=[];let i=0;for(;i<=n.length;){tu.lastIndex=i;const l=tu.exec(n),c=l&&"index"in l?l.index:n.length;r.push(KE(n.slice(i,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?t.breakBefore:!0,c===n.length?t.breakAfter:!0)),i=c+1}let a=-1,s;for(;++a<r.length;)r[a].charCodeAt(r[a].length-1)===8203||a<r.length-1&&r[a+1].charCodeAt(0)===8203?(o.push(r[a]),s=void 0):r[a]?(typeof s=="number"&&o.push(s),o.push(r[a]),s=0):(a===0||a===r.length-1)&&o.push(0);return o}function ZE(e){return[String(e.value)]}function KE(e,t,n){const r=[];let o=0,i;for(;o<e.length;){nu.lastIndex=o;const a=nu.exec(e);i=a?a.index:e.length,!o&&!i&&a&&!t&&r.push(""),o!==i&&r.push(e.slice(o,i)),o=a?i+a[0].length:i}return o!==i&&!n&&r.push(""),r.join(" ")}function ff(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function WE(e){return!!(e.properties||{}).hidden}function qE(e){return e.tagName==="td"||e.tagName==="th"}function YE(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function XE(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},m=t.optional(o)+e.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],v=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:h,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},C={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},E=[C,d,s,n,e.C_BLOCK_COMMENT_MODE,u,c],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:E.concat([{begin:/\(/,end:/\)/,keywords:_,contains:E.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:m,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,s,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(A,R,C,E,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function JE(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=XE(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function QE(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,o]};o.contains.push(s);const l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),b={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},h=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],v={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],C=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:h,literal:y,built_in:[...x,...w,"set","shopt",..._,...C]},contains:[m,e.SHEBANG(),b,d,i,a,v,s,l,c,u,n]}}function eS(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},m=t.optional(o)+e.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},v=[d,s,n,e.C_BLOCK_COMMENT_MODE,u,c],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:v.concat([{begin:/\(/,end:/\)/,keywords:y,contains:v.concat(["self"]),relevance:0}]),relevance:0},w={begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:m,returnBegin:!0,contains:[e.inherit(p,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,s,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"</",contains:[].concat(x,w,v,[d,{begin:e.IDENT_RE+"::",keywords:y},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:d,strings:c,keywords:y}}}function tS(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},m=t.optional(o)+e.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],v=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:h,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},C={className:"function.dispatch",relevance:0,keywords:{_hint:v},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},E=[C,d,s,n,e.C_BLOCK_COMMENT_MODE,u,c],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:E.concat([{begin:/\(/,end:/\)/,keywords:_,contains:E.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:m,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,s,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(A,R,C,E,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function nS(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:o.concat(i),built_in:t,literal:r},s=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},d=e.inherit(u,{illegal:/\n/}),p={className:"subst",begin:/\{/,end:/\}/,keywords:a},m=e.inherit(p,{illegal:/\n/}),b={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},h={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]},y=e.inherit(h,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});p.contains=[h,b,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],m.contains=[y,b,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const v={variants:[c,h,b,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},s]},w=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},v,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},s,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+w+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[v,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const rS=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),oS=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],iS=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],aS=[...oS,...iS],sS=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),lS=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),cS=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),uS=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function dS(e){const t=e.regex,n=rS(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",s=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+lS.join("|")+")"},{begin:":(:)?("+cS.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+uS.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...s,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...s,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:sS.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...s,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+aS.join("|")+")\\b"}]}}function fS(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function pS(e){const i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}function mS(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function hS(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},a={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},s={begin:/\[/,end:/\]/,contains:[r,i,o,a,n,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,u=/'[^']*'/,d=t.either(l,c,u),p=t.concat(d,"(\\s*\\.\\s*",d,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:p,className:"attr",starts:{end:/$/,contains:[r,s,i,o,a,n]}}]}}var ur="[0-9](_*[0-9])*",Mo=`\\.(${ur})`,Po="[0-9a-fA-F](_*[0-9a-fA-F])*",iu={className:"number",variants:[{begin:`(\\b(${ur})((${Mo})|\\.)?|(${Mo}))[eE][+-]?(${ur})[fFdD]?\\b`},{begin:`\\b(${ur})((${Mo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Mo})[fFdD]?\\b`},{begin:`\\b(${ur})[fFdD]\\b`},{begin:`\\b0[xX]((${Po})\\.?|(${Po})?\\.(${Po}))[pP][+-]?(${ur})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Po})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function pf(e,t,n){return n===-1?"":e.replace(t,r=>pf(e,t,n-1))}function gS(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+pf("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,iu,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},iu,c]}}const au="[A-Za-z$_][0-9A-Za-z$_]*",bS=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],vS=["true","false","null","undefined","NaN","Infinity"],mf=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],hf=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],gf=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],yS=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],xS=[].concat(gf,mf,hf);function wS(e){const t=e.regex,n=(V,{after:B})=>{const S="</"+V[0].slice(1);return V.input.indexOf(S,B)!==-1},r=au,o={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,B)=>{const S=V[0].length+V.index,le=V.input[S];if(le==="<"||le===","){B.ignoreMatch();return}le===">"&&(n(V,{after:S})||B.ignoreMatch());let be;const k=V.input.substring(S);if(be=k.match(/^\s*=/)){B.ignoreMatch();return}if((be=k.match(/^\s+extends\s+/))&&be.index===0){B.ignoreMatch();return}}},s={$pattern:au,keyword:bS,literal:vS,built_in:xS,"variable.language":yS},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,b,h,y,{match:/\$\d+/},d];p.contains=w.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(w)});const _=[].concat(x,p.contains),C=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(_)}]),E={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:C},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...mf,...hf]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function O(V){return t.concat("(?!",V.join("|"),")")}const D={match:t.concat(/\b/,O([...gf,"super","import"].map(V=>`${V}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,b,h,y,x,{match:/\$\d+/},d,R,{scope:"attr",match:r+t.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},D,I,A,P,{match:/\$[(.]/}]}}function _S(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],o={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var dr="[0-9](_*[0-9])*",Do=`\\.(${dr})`,Lo="[0-9a-fA-F](_*[0-9a-fA-F])*",ES={className:"number",variants:[{begin:`(\\b(${dr})((${Do})|\\.)?|(${Do}))[eE][+-]?(${dr})[fFdD]?\\b`},{begin:`\\b(${dr})((${Do})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Do})[fFdD]?\\b`},{begin:`\\b(${dr})[fFdD]\\b`},{begin:`\\b0[xX]((${Lo})\\.?|(${Lo})?\\.(${Lo}))[pP][+-]?(${dr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Lo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function SS(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,o]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,i,o]}]};o.contains.push(a);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},c=ES,u=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=d;return p.variants[1].contains=[d],d.variants[1].contains=[p],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,u,n,r,s,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,s,l,a,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
20
- `},c]}}const kS=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),NS=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],CS=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],TS=[...NS,...CS],AS=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),bf=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),vf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),IS=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),RS=bf.concat(vf).sort().reverse();function OS(e){const t=kS(e),n=RS,r="and or not only",o="[\\w-]+",i="("+o+"|@\\{"+o+"\\})",a=[],s=[],l=function(w){return{className:"string",begin:"~?"+w+".*?"+w}},c=function(w,_,C){return{className:w,begin:_,relevance:C}},u={$pattern:/[a-z-]+/,keyword:r,attribute:AS.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:u,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,d,c("variable","@@?"+o,10),c("variable","@\\{"+o+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const p=s.concat({begin:/\{/,end:/\}/,contains:a}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},b={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+IS.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},h={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:s,relevance:0}},y={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:p}},v={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,c("keyword","all\\b"),c("variable","@\\{"+o+"\\}"),{begin:"\\b("+TS.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",i,0),c("selector-id","#"+i),c("selector-class","\\."+i,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+bf.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+vf.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{begin:"!important"},t.FUNCTION_DISPATCH]},x={begin:o+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[v]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,y,x,b,v,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function MS(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function PS(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},i={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},a={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,o,i,a]}}function DS(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},s=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,s,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=e.inherit(c,{contains:[]}),p=e.inherit(u,{contains:[]});c.contains.push(p),u.contains.push(d);let m=[n,l];return[c,u,d,p].forEach(v=>{v.contains=v.contains.concat(m)}),m=m.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,i,c,u,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},o,r,l,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function LS(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,s={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:s,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function $S(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:n.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},a={begin:/->\{/,end:/\}/},s={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,i,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],p=(h,y,v="\\1")=>{const x=v==="\\1"?v:t.concat(v,y);return t.concat(t.concat("(?:",h,")"),y,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,v,r)},m=(h,y,v)=>t.concat(t.concat("(?:",h,")"),y,/(?:\\.|[^\\\/])*?/,v,r),b=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:p("s|tr|y",t.either(...d,{capture:!0}))},{begin:p("s|tr|y","\\(","\\)")},{begin:p("s|tr|y","\\[","\\]")},{begin:p("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...d,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=b,a.contains=b,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:b}}function zS(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),o=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(L,P)=>{P.data._beginMatch=L[1]||L[2]},"on:end":(L,P)=>{P.data._beginMatch!==L[1]&&P.ignoreMatch()}},p=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[
21
- ]`,b={scope:"string",variants:[u,c,d,p]},h={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],v=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],_={keyword:v,literal:(L=>{const P=[];return L.forEach(F=>{P.push(F),F.toLowerCase()===F?P.push(F.toUpperCase()):P.push(F.toLowerCase())}),P})(y),built_in:x},C=L=>L.map(P=>P.replace(/\|\d+$/,"")),E={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",C(x).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(r,"\\b(?!\\()"),R={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},M={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[M,a,R,e.C_BLOCK_COMMENT_MODE,b,h,E]},I={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",C(v).join("\\b|"),"|",C(x).join("\\b|"),"\\b)"),r,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(I);const O=[M,R,e.C_BLOCK_COMMENT_MODE,b,h,E],D={begin:t.concat(/#\[\s*\\?/,t.either(o,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...O]},...O,{scope:"meta",variants:[{match:o},{match:i}]}]};return{case_insensitive:!1,keywords:_,contains:[D,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},a,I,R,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},E,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",D,a,R,e.C_BLOCK_COMMENT_MODE,b,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},b,h]}}function jS(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function FS(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function BS(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:s,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,u,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",m=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,b=`\\b|${r.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${m}))[eE][+-]?(${p})[jJ]?(?=${b})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${p})[jJ](?=${b})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:s,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:["self",l,h,d,e.HASH_COMMENT_MODE]}]};return c.contains=[d,h,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s,illegal:/(<\/|\?)|=>/,contains:[l,h,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,v,d]}]}}function US(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function HS(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function VS(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:a},d={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},p="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",b={className:"number",relevance:0,variants:[{begin:`\\b(${p})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},E=[d,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:a},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},b,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=E,h.contains=E;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:E}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:E}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(c).concat(E)}}function GS(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),o=t.concat(n,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",s=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:u,keyword:s,literal:l,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:u}},{className:"punctuation",begin:"->"},i]}}const ZS=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),KS=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],WS=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],qS=[...KS,...WS],YS=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),XS=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),JS=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),QS=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function ek(e){const t=ZS(e),n=JS,r=XS,o="@[a-z-]+",i="and or not only",s={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+qS.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},s,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+QS.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,s,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:YS.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},s,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function tk(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function nk(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],s=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],p=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=u,b=[...c,...l].filter(C=>!u.includes(C)),h={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},v={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function x(C){return t.concat(/\b/,t.either(...C.map(E=>E.replace(/\s+/,"\\s+"))),/\b/)}const w={scope:"keyword",match:x(p),relevance:0};function _(C,{exceptions:E,when:A}={}){const R=A;return E=E||[],C.map(M=>M.match(/\|\d+$/)||E.includes(M)?M:R(M)?`${M}|0`:M)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(b,{when:C=>C.length<3}),literal:i,type:s,built_in:d},contains:[{scope:"type",match:x(a)},w,v,h,r,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,y]}}function yf(e){return e?typeof e=="string"?e:e.source:null}function zr(e){return He("(?=",e,")")}function He(...e){return e.map(n=>yf(n)).join("")}function rk(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Tt(...e){return"("+(rk(e).capture?"":"?:")+e.map(r=>yf(r)).join("|")+")"}const Js=e=>He(/\b/,e,/\w$/.test(e)?/\b/:/\B/),ok=["Protocol","Type"].map(Js),su=["init","self"].map(Js),ik=["Any","Self"],Ca=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],lu=["false","nil","true"],ak=["assignment","associativity","higherThan","left","lowerThan","none","right"],sk=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],cu=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],xf=Tt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),wf=Tt(xf,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Ta=He(xf,wf,"*"),_f=Tt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),ai=Tt(_f,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),cn=He(_f,ai,"*"),$o=He(/[A-Z]/,ai,"*"),lk=["attached","autoclosure",He(/convention\(/,Tt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",He(/objc\(/,cn,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],ck=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function uk(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],o={match:[/\./,Tt(...ok,...su)],className:{2:"keyword"}},i={match:He(/\./,Tt(...Ca)),relevance:0},a=Ca.filter(ve=>typeof ve=="string").concat(["_|0"]),s=Ca.filter(ve=>typeof ve!="string").concat(ik).map(Js),l={variants:[{className:"keyword",match:Tt(...s,...su)}]},c={$pattern:Tt(/\b\w+/,/#\w+/),keyword:a.concat(sk),literal:lu},u=[o,i,l],d={match:He(/\./,Tt(...cu)),relevance:0},p={className:"built_in",match:He(/\b/,Tt(...cu),/(?=\()/)},m=[d,p],b={match:/->/,relevance:0},h={className:"operator",relevance:0,variants:[{match:Ta},{match:`\\.(\\.|${wf})+`}]},y=[b,h],v="([0-9]_*)+",x="([0-9a-fA-F]_*)+",w={className:"number",relevance:0,variants:[{match:`\\b(${v})(\\.(${v}))?([eE][+-]?(${v}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${v}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(ve="")=>({className:"subst",variants:[{match:He(/\\/,ve,/[0\\tnr"']/)},{match:He(/\\/,ve,/u\{[0-9a-fA-F]{1,8}\}/)}]}),C=(ve="")=>({className:"subst",match:He(/\\/,ve,/[\t ]*(?:[\r\n]|\r\n)/)}),E=(ve="")=>({className:"subst",label:"interpol",begin:He(/\\/,ve,/\(/),end:/\)/}),A=(ve="")=>({begin:He(ve,/"""/),end:He(/"""/,ve),contains:[_(ve),C(ve),E(ve)]}),R=(ve="")=>({begin:He(ve,/"/),end:He(/"/,ve),contains:[_(ve),E(ve)]}),M={className:"string",variants:[A(),A("#"),A("##"),A("###"),R(),R("#"),R("##"),R("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],I={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},O=ve=>{const Ve=He(ve,/\//),ct=He(/\//,ve);return{begin:Ve,end:ct,contains:[...T,{scope:"comment",begin:`#(?!.*${ct})`,end:/$/}]}},D={scope:"regexp",variants:[O("###"),O("##"),O("#"),I]},L={match:He(/`/,cn,/`/)},P={className:"variable",match:/\$\d+/},F={className:"variable",match:`\\$${ai}+`},K=[L,P,F],V={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:ck,contains:[...y,w,M]}]}},B={scope:"keyword",match:He(/@/,Tt(...lk),zr(Tt(/\(/,/\s+/)))},S={scope:"meta",match:He(/@/,cn)},le=[V,B,S],be={match:zr(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:He(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,ai,"+")},{className:"type",match:$o,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:He(/\s+&\s+/,zr($o)),relevance:0}]},k={begin:/</,end:/>/,keywords:c,contains:[...r,...u,...le,b,be]};be.contains.push(k);const Ee={match:He(cn,/\s*:/),keywords:"_|0",relevance:0},Le={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",Ee,...r,D,...u,...m,...y,w,M,...K,...le,be]},we={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,be]},G={begin:Tt(zr(He(cn,/\s*:/)),zr(He(cn,/\s+/,cn,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:cn}]},se={begin:/\(/,end:/\)/,keywords:c,contains:[G,...r,...u,...y,w,M,...le,be,Le],endsParent:!0,illegal:/["']/},Ce={match:[/(func|macro)/,/\s+/,Tt(L.match,cn,Ta)],className:{1:"keyword",3:"title.function"},contains:[we,se,t],illegal:[/\[/,/%/]},fe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[we,se,t],illegal:/\[|%/},ie={match:[/operator/,/\s+/,Ta],className:{1:"keyword",3:"title"}},X={begin:[/precedencegroup/,/\s+/,$o],className:{1:"keyword",3:"title"},contains:[be],keywords:[...ak,...lu],end:/}/},xe={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Q={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Fe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,cn,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[we,...u,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:$o},...u],relevance:0}]};for(const ve of M.variants){const Ve=ve.contains.find(yt=>yt.label==="interpol");Ve.keywords=c;const ct=[...u,...m,...y,w,M,...K];Ve.contains=[...ct,{begin:/\(/,end:/\)/,contains:["self",...ct]}]}return{name:"Swift",keywords:c,contains:[...r,Ce,fe,xe,Q,Fe,ie,X,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},D,...u,...m,...y,w,M,...K,...le,be,Le]}}const si="[A-Za-z$_][0-9A-Za-z$_]*",Ef=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Sf=["true","false","null","undefined","NaN","Infinity"],kf=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Nf=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Cf=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Tf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Af=[].concat(Cf,kf,Nf);function dk(e){const t=e.regex,n=(V,{after:B})=>{const S="</"+V[0].slice(1);return V.input.indexOf(S,B)!==-1},r=si,o={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,B)=>{const S=V[0].length+V.index,le=V.input[S];if(le==="<"||le===","){B.ignoreMatch();return}le===">"&&(n(V,{after:S})||B.ignoreMatch());let be;const k=V.input.substring(S);if(be=k.match(/^\s*=/)){B.ignoreMatch();return}if((be=k.match(/^\s+extends\s+/))&&be.index===0){B.ignoreMatch();return}}},s={$pattern:si,keyword:Ef,literal:Sf,built_in:Af,"variable.language":Tf},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},w=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,b,h,y,{match:/\$\d+/},d];p.contains=w.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(w)});const _=[].concat(x,p.contains),C=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(_)}]),E={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:C},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...kf,...Nf]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},I={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function O(V){return t.concat("(?!",V.join("|"),")")}const D={match:t.concat(/\b/,O([...Cf,"super","import"].map(V=>`${V}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},F="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(F)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,b,h,y,x,{match:/\$\d+/},d,R,{scope:"attr",match:r+t.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:F,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},D,I,A,P,{match:/\$[(.]/}]}}function fk(e){const t=e.regex,n=dk(e),r=si,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[n.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:si,keyword:Ef.concat(l),literal:Sf,built_in:Af.concat(o),"variable.language":Tf},u={className:"meta",begin:"@"+r},d=(h,y,v)=>{const x=h.contains.findIndex(w=>w.label===y);if(x===-1)throw new Error("can not find mode to replace");h.contains.splice(x,1,v)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(u);const p=n.contains.find(h=>h.scope==="attr"),m=Object.assign({},p,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,p,m]),n.contains=n.contains.concat([u,i,a,m]),d(n,"shebang",e.SHEBANG()),d(n,"use_strict",s);const b=n.contains.find(h=>h.label==="func.def");return b.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function pk(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(i,o),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(i,o),/ +/,t.either(a,s),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),p=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,c,u,d,p,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[p]}]}}function mk(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},s={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,a,o,e.QUOTE_STRING_MODE,l,c,s]}}function hk(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,l,s,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,l,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function gk(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},s=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},b={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},h={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},y=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},b,h,i,a],v=[...y];return v.pop(),v.push(s),m.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}const bk={arduino:JE,bash:QE,c:eS,cpp:tS,csharp:nS,css:dS,diff:fS,go:pS,graphql:mS,ini:hS,java:gS,javascript:wS,json:_S,kotlin:SS,less:OS,lua:MS,makefile:PS,markdown:DS,objectivec:LS,perl:$S,php:zS,"php-template":jS,plaintext:FS,python:BS,"python-repl":US,r:HS,ruby:VS,rust:GS,scss:ek,shell:tk,sql:nk,swift:uk,typescript:fk,vbnet:pk,wasm:mk,xml:hk,yaml:gk};var Aa,uu;function vk(){if(uu)return Aa;uu=1;function e(N){return N instanceof Map?N.clear=N.delete=N.set=function(){throw new Error("map is read-only")}:N instanceof Set&&(N.add=N.clear=N.delete=function(){throw new Error("set is read-only")}),Object.freeze(N),Object.getOwnPropertyNames(N).forEach($=>{const q=N[$],ce=typeof q;(ce==="object"||ce==="function")&&!Object.isFrozen(q)&&e(q)}),N}class t{constructor($){$.data===void 0&&($.data={}),this.data=$.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(N){return N.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function r(N,...$){const q=Object.create(null);for(const ce in N)q[ce]=N[ce];return $.forEach(function(ce){for(const Be in ce)q[Be]=ce[Be]}),q}const o="</span>",i=N=>!!N.scope,a=(N,{prefix:$})=>{if(N.startsWith("language:"))return N.replace("language:","language-");if(N.includes(".")){const q=N.split(".");return[`${$}${q.shift()}`,...q.map((ce,Be)=>`${ce}${"_".repeat(Be+1)}`)].join(" ")}return`${$}${N}`};class s{constructor($,q){this.buffer="",this.classPrefix=q.classPrefix,$.walk(this)}addText($){this.buffer+=n($)}openNode($){if(!i($))return;const q=a($.scope,{prefix:this.classPrefix});this.span(q)}closeNode($){i($)&&(this.buffer+=o)}value(){return this.buffer}span($){this.buffer+=`<span class="${$}">`}}const l=(N={})=>{const $={children:[]};return Object.assign($,N),$};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add($){this.top.children.push($)}openNode($){const q=l({scope:$});this.add(q),this.stack.push(q)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk($){return this.constructor._walk($,this.rootNode)}static _walk($,q){return typeof q=="string"?$.addText(q):q.children&&($.openNode(q),q.children.forEach(ce=>this._walk($,ce)),$.closeNode(q)),$}static _collapse($){typeof $!="string"&&$.children&&($.children.every(q=>typeof q=="string")?$.children=[$.children.join("")]:$.children.forEach(q=>{c._collapse(q)}))}}class u extends c{constructor($){super(),this.options=$}addText($){$!==""&&this.add($)}startScope($){this.openNode($)}endScope(){this.closeNode()}__addSublanguage($,q){const ce=$.root;q&&(ce.scope=`language:${q}`),this.add(ce)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(N){return N?typeof N=="string"?N:N.source:null}function p(N){return h("(?=",N,")")}function m(N){return h("(?:",N,")*")}function b(N){return h("(?:",N,")?")}function h(...N){return N.map(q=>d(q)).join("")}function y(N){const $=N[N.length-1];return typeof $=="object"&&$.constructor===Object?(N.splice(N.length-1,1),$):{}}function v(...N){return"("+(y(N).capture?"":"?:")+N.map(ce=>d(ce)).join("|")+")"}function x(N){return new RegExp(N.toString()+"|").exec("").length-1}function w(N,$){const q=N&&N.exec($);return q&&q.index===0}const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(N,{joinWith:$}){let q=0;return N.map(ce=>{q+=1;const Be=q;let je=d(ce),ne="";for(;je.length>0;){const re=_.exec(je);if(!re){ne+=je;break}ne+=je.substring(0,re.index),je=je.substring(re.index+re[0].length),re[0][0]==="\\"&&re[1]?ne+="\\"+String(Number(re[1])+Be):(ne+=re[0],re[0]==="("&&q++)}return ne}).map(ce=>`(${ce})`).join($)}const E=/\b\B/,A="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",M="\\b\\d+(\\.\\d+)?",T="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",I="\\b(0b[01]+)",O="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",D=(N={})=>{const $=/^#![ ]*\//;return N.binary&&(N.begin=h($,/.*\b/,N.binary,/\b.*/)),r({scope:"meta",begin:$,end:/$/,relevance:0,"on:begin":(q,ce)=>{q.index!==0&&ce.ignoreMatch()}},N)},L={begin:"\\\\[\\s\\S]",relevance:0},P={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[L]},F={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[L]},K={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},V=function(N,$,q={}){const ce=r({scope:"comment",begin:N,end:$,contains:[]},q);ce.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Be=v("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ce.contains.push({begin:h(/[ ]+/,"(",Be,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ce},B=V("//","$"),S=V("/\\*","\\*/"),le=V("#","$"),be={scope:"number",begin:M,relevance:0},k={scope:"number",begin:T,relevance:0},Ee={scope:"number",begin:I,relevance:0},Le={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[L,{begin:/\[/,end:/\]/,relevance:0,contains:[L]}]},we={scope:"title",begin:A,relevance:0},G={scope:"title",begin:R,relevance:0},se={begin:"\\.\\s*"+R,relevance:0};var fe=Object.freeze({__proto__:null,APOS_STRING_MODE:P,BACKSLASH_ESCAPE:L,BINARY_NUMBER_MODE:Ee,BINARY_NUMBER_RE:I,COMMENT:V,C_BLOCK_COMMENT_MODE:S,C_LINE_COMMENT_MODE:B,C_NUMBER_MODE:k,C_NUMBER_RE:T,END_SAME_AS_BEGIN:function(N){return Object.assign(N,{"on:begin":($,q)=>{q.data._beginMatch=$[1]},"on:end":($,q)=>{q.data._beginMatch!==$[1]&&q.ignoreMatch()}})},HASH_COMMENT_MODE:le,IDENT_RE:A,MATCH_NOTHING_RE:E,METHOD_GUARD:se,NUMBER_MODE:be,NUMBER_RE:M,PHRASAL_WORDS_MODE:K,QUOTE_STRING_MODE:F,REGEXP_MODE:Le,RE_STARTERS_RE:O,SHEBANG:D,TITLE_MODE:we,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:G});function ie(N,$){N.input[N.index-1]==="."&&$.ignoreMatch()}function X(N,$){N.className!==void 0&&(N.scope=N.className,delete N.className)}function xe(N,$){$&&N.beginKeywords&&(N.begin="\\b("+N.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",N.__beforeBegin=ie,N.keywords=N.keywords||N.beginKeywords,delete N.beginKeywords,N.relevance===void 0&&(N.relevance=0))}function Q(N,$){Array.isArray(N.illegal)&&(N.illegal=v(...N.illegal))}function Fe(N,$){if(N.match){if(N.begin||N.end)throw new Error("begin & end are not supported with match");N.begin=N.match,delete N.match}}function ve(N,$){N.relevance===void 0&&(N.relevance=1)}const Ve=(N,$)=>{if(!N.beforeMatch)return;if(N.starts)throw new Error("beforeMatch cannot be used with starts");const q=Object.assign({},N);Object.keys(N).forEach(ce=>{delete N[ce]}),N.keywords=q.keywords,N.begin=h(q.beforeMatch,p(q.begin)),N.starts={relevance:0,contains:[Object.assign(q,{endsParent:!0})]},N.relevance=0,delete q.beforeMatch},ct=["of","and","for","in","not","or","if","then","parent","list","value"],yt="keyword";function rt(N,$,q=yt){const ce=Object.create(null);return typeof N=="string"?Be(q,N.split(" ")):Array.isArray(N)?Be(q,N):Object.keys(N).forEach(function(je){Object.assign(ce,rt(N[je],$,je))}),ce;function Be(je,ne){$&&(ne=ne.map(re=>re.toLowerCase())),ne.forEach(function(re){const ye=re.split("|");ce[ye[0]]=[je,Ut(ye[0],ye[1])]})}}function Ut(N,$){return $?Number($):gn(N)?0:1}function gn(N){return ct.includes(N.toLowerCase())}const Rt={},Ot=N=>{console.error(N)},an=(N,...$)=>{console.log(`WARN: ${N}`,...$)},z=(N,$)=>{Rt[`${N}/${$}`]||(console.log(`Deprecated as of ${N}. ${$}`),Rt[`${N}/${$}`]=!0)},W=new Error;function me(N,$,{key:q}){let ce=0;const Be=N[q],je={},ne={};for(let re=1;re<=$.length;re++)ne[re+ce]=Be[re],je[re+ce]=!0,ce+=x($[re-1]);N[q]=ne,N[q]._emit=je,N[q]._multi=!0}function Se(N){if(Array.isArray(N.begin)){if(N.skip||N.excludeBegin||N.returnBegin)throw Ot("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),W;if(typeof N.beginScope!="object"||N.beginScope===null)throw Ot("beginScope must be object"),W;me(N,N.begin,{key:"beginScope"}),N.begin=C(N.begin,{joinWith:""})}}function Te(N){if(Array.isArray(N.end)){if(N.skip||N.excludeEnd||N.returnEnd)throw Ot("skip, excludeEnd, returnEnd not compatible with endScope: {}"),W;if(typeof N.endScope!="object"||N.endScope===null)throw Ot("endScope must be object"),W;me(N,N.end,{key:"endScope"}),N.end=C(N.end,{joinWith:""})}}function ut(N){N.scope&&typeof N.scope=="object"&&N.scope!==null&&(N.beginScope=N.scope,delete N.scope)}function dt(N){ut(N),typeof N.beginScope=="string"&&(N.beginScope={_wrap:N.beginScope}),typeof N.endScope=="string"&&(N.endScope={_wrap:N.endScope}),Se(N),Te(N)}function ft(N){function $(ne,re){return new RegExp(d(ne),"m"+(N.case_insensitive?"i":"")+(N.unicodeRegex?"u":"")+(re?"g":""))}class q{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(re,ye){ye.position=this.position++,this.matchIndexes[this.matchAt]=ye,this.regexes.push([ye,re]),this.matchAt+=x(re)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const re=this.regexes.map(ye=>ye[1]);this.matcherRe=$(C(re,{joinWith:"|"}),!0),this.lastIndex=0}exec(re){this.matcherRe.lastIndex=this.lastIndex;const ye=this.matcherRe.exec(re);if(!ye)return null;const gt=ye.findIndex((Mr,sa)=>sa>0&&Mr!==void 0),ot=this.matchIndexes[gt];return ye.splice(0,gt),Object.assign(ye,ot)}}class ce{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(re){if(this.multiRegexes[re])return this.multiRegexes[re];const ye=new q;return this.rules.slice(re).forEach(([gt,ot])=>ye.addRule(gt,ot)),ye.compile(),this.multiRegexes[re]=ye,ye}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(re,ye){this.rules.push([re,ye]),ye.type==="begin"&&this.count++}exec(re){const ye=this.getMatcher(this.regexIndex);ye.lastIndex=this.lastIndex;let gt=ye.exec(re);if(this.resumingScanAtSamePosition()&&!(gt&&gt.index===this.lastIndex)){const ot=this.getMatcher(0);ot.lastIndex=this.lastIndex+1,gt=ot.exec(re)}return gt&&(this.regexIndex+=gt.position+1,this.regexIndex===this.count&&this.considerAll()),gt}}function Be(ne){const re=new ce;return ne.contains.forEach(ye=>re.addRule(ye.begin,{rule:ye,type:"begin"})),ne.terminatorEnd&&re.addRule(ne.terminatorEnd,{type:"end"}),ne.illegal&&re.addRule(ne.illegal,{type:"illegal"}),re}function je(ne,re){const ye=ne;if(ne.isCompiled)return ye;[X,Fe,dt,Ve].forEach(ot=>ot(ne,re)),N.compilerExtensions.forEach(ot=>ot(ne,re)),ne.__beforeBegin=null,[xe,Q,ve].forEach(ot=>ot(ne,re)),ne.isCompiled=!0;let gt=null;return typeof ne.keywords=="object"&&ne.keywords.$pattern&&(ne.keywords=Object.assign({},ne.keywords),gt=ne.keywords.$pattern,delete ne.keywords.$pattern),gt=gt||/\w+/,ne.keywords&&(ne.keywords=rt(ne.keywords,N.case_insensitive)),ye.keywordPatternRe=$(gt,!0),re&&(ne.begin||(ne.begin=/\B|\b/),ye.beginRe=$(ye.begin),!ne.end&&!ne.endsWithParent&&(ne.end=/\B|\b/),ne.end&&(ye.endRe=$(ye.end)),ye.terminatorEnd=d(ye.end)||"",ne.endsWithParent&&re.terminatorEnd&&(ye.terminatorEnd+=(ne.end?"|":"")+re.terminatorEnd)),ne.illegal&&(ye.illegalRe=$(ne.illegal)),ne.contains||(ne.contains=[]),ne.contains=[].concat(...ne.contains.map(function(ot){return Yt(ot==="self"?ne:ot)})),ne.contains.forEach(function(ot){je(ot,ye)}),ne.starts&&je(ne.starts,re),ye.matcher=Be(ye),ye}if(N.compilerExtensions||(N.compilerExtensions=[]),N.contains&&N.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return N.classNameAliases=r(N.classNameAliases||{}),je(N)}function Ht(N){return N?N.endsWithParent||Ht(N.starts):!1}function Yt(N){return N.variants&&!N.cachedVariants&&(N.cachedVariants=N.variants.map(function($){return r(N,{variants:null},$)})),N.cachedVariants?N.cachedVariants:Ht(N)?r(N,{starts:N.starts?r(N.starts):null}):Object.isFrozen(N)?r(N):N}var pt="11.11.1";class Vt extends Error{constructor($,q){super($),this.name="HTMLInjectionError",this.html=q}}const xt=n,he=r,Me=Symbol("nomatch"),$e=7,Ie=function(N){const $=Object.create(null),q=Object.create(null),ce=[];let Be=!0;const je="Could not find the language '{}', did you forget to load/include a language module?",ne={disableAutodetect:!0,name:"Plain text",contains:[]};let re={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function ye(Y){return re.noHighlightRe.test(Y)}function gt(Y){let pe=Y.className+" ";pe+=Y.parentNode?Y.parentNode.className:"";const Oe=re.languageDetectRe.exec(pe);if(Oe){const Ze=xn(Oe[1]);return Ze||(an(je.replace("{}",Oe[1])),an("Falling back to no-highlight mode for this block.",Y)),Ze?Oe[1]:"no-highlight"}return pe.split(/\s+/).find(Ze=>ye(Ze)||xn(Ze))}function ot(Y,pe,Oe){let Ze="",mt="";typeof pe=="object"?(Ze=Y,Oe=pe.ignoreIllegals,mt=pe.language):(z("10.7.0","highlight(lang, code, ...args) has been deprecated."),z("10.7.0",`Please use highlight(code, options) instead.
22
- https://github.com/highlightjs/highlight.js/issues/2277`),mt=Y,Ze=pe),Oe===void 0&&(Oe=!0);const Xt={code:Ze,language:mt};ko("before:highlight",Xt);const wn=Xt.result?Xt.result:Mr(Xt.language,Xt.code,Oe);return wn.code=Xt.code,ko("after:highlight",wn),wn}function Mr(Y,pe,Oe,Ze){const mt=Object.create(null);function Xt(te,ue){return te.keywords[ue]}function wn(){if(!ke.keywords){wt.addText(Ke);return}let te=0;ke.keywordPatternRe.lastIndex=0;let ue=ke.keywordPatternRe.exec(Ke),Ae="";for(;ue;){Ae+=Ke.substring(te,ue.index);const Ue=ln.case_insensitive?ue[0].toLowerCase():ue[0],_t=Xt(ke,Ue);if(_t){const[bn,mv]=_t;if(wt.addText(Ae),Ae="",mt[Ue]=(mt[Ue]||0)+1,mt[Ue]<=$e&&(To+=mv),bn.startsWith("_"))Ae+=ue[0];else{const hv=ln.classNameAliases[bn]||bn;sn(ue[0],hv)}}else Ae+=ue[0];te=ke.keywordPatternRe.lastIndex,ue=ke.keywordPatternRe.exec(Ke)}Ae+=Ke.substring(te),wt.addText(Ae)}function No(){if(Ke==="")return;let te=null;if(typeof ke.subLanguage=="string"){if(!$[ke.subLanguage]){wt.addText(Ke);return}te=Mr(ke.subLanguage,Ke,!0,ac[ke.subLanguage]),ac[ke.subLanguage]=te._top}else te=la(Ke,ke.subLanguage.length?ke.subLanguage:null);ke.relevance>0&&(To+=te.relevance),wt.__addSublanguage(te._emitter,te.language)}function zt(){ke.subLanguage!=null?No():wn(),Ke=""}function sn(te,ue){te!==""&&(wt.startScope(ue),wt.addText(te),wt.endScope())}function nc(te,ue){let Ae=1;const Ue=ue.length-1;for(;Ae<=Ue;){if(!te._emit[Ae]){Ae++;continue}const _t=ln.classNameAliases[te[Ae]]||te[Ae],bn=ue[Ae];_t?sn(bn,_t):(Ke=bn,wn(),Ke=""),Ae++}}function rc(te,ue){return te.scope&&typeof te.scope=="string"&&wt.openNode(ln.classNameAliases[te.scope]||te.scope),te.beginScope&&(te.beginScope._wrap?(sn(Ke,ln.classNameAliases[te.beginScope._wrap]||te.beginScope._wrap),Ke=""):te.beginScope._multi&&(nc(te.beginScope,ue),Ke="")),ke=Object.create(te,{parent:{value:ke}}),ke}function oc(te,ue,Ae){let Ue=w(te.endRe,Ae);if(Ue){if(te["on:end"]){const _t=new t(te);te["on:end"](ue,_t),_t.isMatchIgnored&&(Ue=!1)}if(Ue){for(;te.endsParent&&te.parent;)te=te.parent;return te}}if(te.endsWithParent)return oc(te.parent,ue,Ae)}function cv(te){return ke.matcher.regexIndex===0?(Ke+=te[0],1):(fa=!0,0)}function uv(te){const ue=te[0],Ae=te.rule,Ue=new t(Ae),_t=[Ae.__beforeBegin,Ae["on:begin"]];for(const bn of _t)if(bn&&(bn(te,Ue),Ue.isMatchIgnored))return cv(ue);return Ae.skip?Ke+=ue:(Ae.excludeBegin&&(Ke+=ue),zt(),!Ae.returnBegin&&!Ae.excludeBegin&&(Ke=ue)),rc(Ae,te),Ae.returnBegin?0:ue.length}function dv(te){const ue=te[0],Ae=pe.substring(te.index),Ue=oc(ke,te,Ae);if(!Ue)return Me;const _t=ke;ke.endScope&&ke.endScope._wrap?(zt(),sn(ue,ke.endScope._wrap)):ke.endScope&&ke.endScope._multi?(zt(),nc(ke.endScope,te)):_t.skip?Ke+=ue:(_t.returnEnd||_t.excludeEnd||(Ke+=ue),zt(),_t.excludeEnd&&(Ke=ue));do ke.scope&&wt.closeNode(),!ke.skip&&!ke.subLanguage&&(To+=ke.relevance),ke=ke.parent;while(ke!==Ue.parent);return Ue.starts&&rc(Ue.starts,te),_t.returnEnd?0:ue.length}function fv(){const te=[];for(let ue=ke;ue!==ln;ue=ue.parent)ue.scope&&te.unshift(ue.scope);te.forEach(ue=>wt.openNode(ue))}let Co={};function ic(te,ue){const Ae=ue&&ue[0];if(Ke+=te,Ae==null)return zt(),0;if(Co.type==="begin"&&ue.type==="end"&&Co.index===ue.index&&Ae===""){if(Ke+=pe.slice(ue.index,ue.index+1),!Be){const Ue=new Error(`0 width match regex (${Y})`);throw Ue.languageName=Y,Ue.badRule=Co.rule,Ue}return 1}if(Co=ue,ue.type==="begin")return uv(ue);if(ue.type==="illegal"&&!Oe){const Ue=new Error('Illegal lexeme "'+Ae+'" for mode "'+(ke.scope||"<unnamed>")+'"');throw Ue.mode=ke,Ue}else if(ue.type==="end"){const Ue=dv(ue);if(Ue!==Me)return Ue}if(ue.type==="illegal"&&Ae==="")return Ke+=`
23
- `,1;if(da>1e5&&da>ue.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ke+=Ae,Ae.length}const ln=xn(Y);if(!ln)throw Ot(je.replace("{}",Y)),new Error('Unknown language: "'+Y+'"');const pv=ft(ln);let ua="",ke=Ze||pv;const ac={},wt=new re.__emitter(re);fv();let Ke="",To=0,jn=0,da=0,fa=!1;try{if(ln.__emitTokens)ln.__emitTokens(pe,wt);else{for(ke.matcher.considerAll();;){da++,fa?fa=!1:ke.matcher.considerAll(),ke.matcher.lastIndex=jn;const te=ke.matcher.exec(pe);if(!te)break;const ue=pe.substring(jn,te.index),Ae=ic(ue,te);jn=te.index+Ae}ic(pe.substring(jn))}return wt.finalize(),ua=wt.toHTML(),{language:Y,value:ua,relevance:To,illegal:!1,_emitter:wt,_top:ke}}catch(te){if(te.message&&te.message.includes("Illegal"))return{language:Y,value:xt(pe),illegal:!0,relevance:0,_illegalBy:{message:te.message,index:jn,context:pe.slice(jn-100,jn+100),mode:te.mode,resultSoFar:ua},_emitter:wt};if(Be)return{language:Y,value:xt(pe),illegal:!1,relevance:0,errorRaised:te,_emitter:wt,_top:ke};throw te}}function sa(Y){const pe={value:xt(Y),illegal:!1,relevance:0,_top:ne,_emitter:new re.__emitter(re)};return pe._emitter.addText(Y),pe}function la(Y,pe){pe=pe||re.languages||Object.keys($);const Oe=sa(Y),Ze=pe.filter(xn).filter(tc).map(zt=>Mr(zt,Y,!1));Ze.unshift(Oe);const mt=Ze.sort((zt,sn)=>{if(zt.relevance!==sn.relevance)return sn.relevance-zt.relevance;if(zt.language&&sn.language){if(xn(zt.language).supersetOf===sn.language)return 1;if(xn(sn.language).supersetOf===zt.language)return-1}return 0}),[Xt,wn]=mt,No=Xt;return No.secondBest=wn,No}function Jb(Y,pe,Oe){const Ze=pe&&q[pe]||Oe;Y.classList.add("hljs"),Y.classList.add(`language-${Ze}`)}function ca(Y){let pe=null;const Oe=gt(Y);if(ye(Oe))return;if(ko("before:highlightElement",{el:Y,language:Oe}),Y.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Y);return}if(Y.children.length>0&&(re.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Y)),re.throwUnescapedHTML))throw new Vt("One of your code blocks includes unescaped HTML.",Y.innerHTML);pe=Y;const Ze=pe.textContent,mt=Oe?ot(Ze,{language:Oe,ignoreIllegals:!0}):la(Ze);Y.innerHTML=mt.value,Y.dataset.highlighted="yes",Jb(Y,Oe,mt.language),Y.result={language:mt.language,re:mt.relevance,relevance:mt.relevance},mt.secondBest&&(Y.secondBest={language:mt.secondBest.language,relevance:mt.secondBest.relevance}),ko("after:highlightElement",{el:Y,result:mt,text:Ze})}function Qb(Y){re=he(re,Y)}const ev=()=>{So(),z("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function tv(){So(),z("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ql=!1;function So(){function Y(){So()}if(document.readyState==="loading"){Ql||window.addEventListener("DOMContentLoaded",Y,!1),Ql=!0;return}document.querySelectorAll(re.cssSelector).forEach(ca)}function nv(Y,pe){let Oe=null;try{Oe=pe(N)}catch(Ze){if(Ot("Language definition for '{}' could not be registered.".replace("{}",Y)),Be)Ot(Ze);else throw Ze;Oe=ne}Oe.name||(Oe.name=Y),$[Y]=Oe,Oe.rawDefinition=pe.bind(null,N),Oe.aliases&&ec(Oe.aliases,{languageName:Y})}function rv(Y){delete $[Y];for(const pe of Object.keys(q))q[pe]===Y&&delete q[pe]}function ov(){return Object.keys($)}function xn(Y){return Y=(Y||"").toLowerCase(),$[Y]||$[q[Y]]}function ec(Y,{languageName:pe}){typeof Y=="string"&&(Y=[Y]),Y.forEach(Oe=>{q[Oe.toLowerCase()]=pe})}function tc(Y){const pe=xn(Y);return pe&&!pe.disableAutodetect}function iv(Y){Y["before:highlightBlock"]&&!Y["before:highlightElement"]&&(Y["before:highlightElement"]=pe=>{Y["before:highlightBlock"](Object.assign({block:pe.el},pe))}),Y["after:highlightBlock"]&&!Y["after:highlightElement"]&&(Y["after:highlightElement"]=pe=>{Y["after:highlightBlock"](Object.assign({block:pe.el},pe))})}function av(Y){iv(Y),ce.push(Y)}function sv(Y){const pe=ce.indexOf(Y);pe!==-1&&ce.splice(pe,1)}function ko(Y,pe){const Oe=Y;ce.forEach(function(Ze){Ze[Oe]&&Ze[Oe](pe)})}function lv(Y){return z("10.7.0","highlightBlock will be removed entirely in v12.0"),z("10.7.0","Please use highlightElement now."),ca(Y)}Object.assign(N,{highlight:ot,highlightAuto:la,highlightAll:So,highlightElement:ca,highlightBlock:lv,configure:Qb,initHighlighting:ev,initHighlightingOnLoad:tv,registerLanguage:nv,unregisterLanguage:rv,listLanguages:ov,getLanguage:xn,registerAliases:ec,autoDetection:tc,inherit:he,addPlugin:av,removePlugin:sv}),N.debugMode=function(){Be=!1},N.safeMode=function(){Be=!0},N.versionString=pt,N.regex={concat:h,lookahead:p,either:v,optional:b,anyNumberOfTimes:m};for(const Y in fe)typeof fe[Y]=="object"&&e(fe[Y]);return Object.assign(N,fe),N},ze=Ie({});return ze.newInstance=()=>Ie({}),Aa=ze,ze.HighlightJS=ze,ze.default=ze,Aa}var yk=vk();const xk=Ms(yk),du={},wk="hljs-";function _k(e){const t=xk.newInstance();return e&&i(e),{highlight:n,highlightAuto:r,listLanguages:o,register:i,registerAlias:a,registered:s};function n(l,c,u){const d=u||du,p=typeof d.prefix=="string"?d.prefix:wk;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:Ek,classPrefix:p});const m=t.highlight(c,{ignoreIllegals:!0,language:l});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const b=m._emitter.root,h=b.data;return h.language=m.language,h.relevance=m.relevance,b}function r(l,c){const d=(c||du).subset||o();let p=-1,m=0,b;for(;++p<d.length;){const h=d[p];if(!t.getLanguage(h))continue;const y=n(h,l,c);y.data&&y.data.relevance!==void 0&&y.data.relevance>m&&(m=y.data.relevance,b=y)}return b||{type:"root",children:[],data:{language:void 0,relevance:m}}}function o(){return t.listLanguages()}function i(l,c){if(typeof l=="string")t.registerLanguage(l,c);else{let u;for(u in l)Object.hasOwn(l,u)&&t.registerLanguage(u,l[u])}}function a(l,c){if(typeof l=="string")t.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let u;for(u in l)if(Object.hasOwn(l,u)){const d=l[u];t.registerAliases(typeof d=="string"?d:[...d],{languageName:u})}}}function s(l){return!!t.getLanguage(l)}}class Ek{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],o=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:o}):r.children.push(...o)}openNode(t){const n=this,r=t.split(".").map(function(a,s){return s?a+"_".repeat(s):n.options.classPrefix+a}),o=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:r},children:[]};o.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Sk={};function kk(e){const t=e||Sk,n=t.aliases,r=t.detect||!1,o=t.languages||bk,i=t.plainText,a=t.prefix,s=t.subset;let l="hljs";const c=_k(o);if(n&&c.registerAlias(n),a){const u=a.indexOf("-");l=u===-1?a:a.slice(0,u)}return function(u,d){Ci(u,"element",function(p,m,b){if(p.tagName!=="code"||!b||b.type!=="element"||b.tagName!=="pre")return;const h=Nk(p);if(h===!1||!h&&!r||h&&i&&i.includes(h))return;Array.isArray(p.properties.className)||(p.properties.className=[]),p.properties.className.includes(l)||p.properties.className.unshift(l);const y=VE(p,{whitespace:"pre"});let v;try{v=h?c.highlight(h,y,{prefix:a}):c.highlightAuto(y,{prefix:a,subset:s})}catch(x){const w=x;if(h&&/Unknown language/.test(w.message)){d.message("Cannot highlight as `"+h+"`, it’s not registered",{ancestors:[b,p],cause:w,place:p.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw w}!h&&v.data&&v.data.language&&p.properties.className.push("language-"+v.data.language),v.children.length>0&&(p.children=v.children)})}}function Nk(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const o=String(t[n]);if(o==="no-highlight"||o==="nohighlight")return!1;!r&&o.slice(0,5)==="lang-"&&(r=o.slice(5)),!r&&o.slice(0,9)==="language-"&&(r=o.slice(9))}return r}function fu(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function Ck(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Tk(e,t,n){const o=lo((n||{}).ignore||[]),i=Ak(t);let a=-1;for(;++a<i.length;)af(e,"text",s);function s(c,u){let d=-1,p;for(;++d<u.length;){const m=u[d],b=p?p.children:void 0;if(o(m,b?b.indexOf(m):void 0,p))return;p=m}if(p)return l(c,u)}function l(c,u){const d=u[u.length-1],p=i[a][0],m=i[a][1];let b=0;const y=d.children.indexOf(c);let v=!1,x=[];p.lastIndex=0;let w=p.exec(c.value);for(;w;){const _=w.index,C={index:w.index,input:w.input,stack:[...u,c]};let E=m(...w,C);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=_+1:(b!==_&&x.push({type:"text",value:c.value.slice(b,_)}),Array.isArray(E)?x.push(...E):E&&x.push(E),b=_+w[0].length,v=!0),!p.global)break;w=p.exec(c.value)}return v?(b<c.value.length&&x.push({type:"text",value:c.value.slice(b)}),d.children.splice(y,1,...x)):x=[c],y+x.length}}function Ak(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const o=n[r];t.push([Ik(o[0]),Rk(o[1])])}return t}function Ik(e){return typeof e=="string"?new RegExp(Ck(e),"g"):e}function Rk(e){return typeof e=="function"?e:function(){return e}}const Ia="phrasing",Ra=["autolink","link","image","label"];function Ok(){return{transforms:[jk],enter:{literalAutolink:Pk,literalAutolinkEmail:Oa,literalAutolinkHttp:Oa,literalAutolinkWww:Oa},exit:{literalAutolink:zk,literalAutolinkEmail:$k,literalAutolinkHttp:Dk,literalAutolinkWww:Lk}}}function Mk(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ia,notInConstruct:Ra},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ia,notInConstruct:Ra},{character:":",before:"[ps]",after:"\\/",inConstruct:Ia,notInConstruct:Ra}]}}function Pk(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Oa(e){this.config.enter.autolinkProtocol.call(this,e)}function Dk(e){this.config.exit.autolinkProtocol.call(this,e)}function Lk(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function $k(e){this.config.exit.autolinkEmail.call(this,e)}function zk(e){this.exit(e)}function jk(e){Tk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Fk],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Bk]],{ignore:["link","linkReference"]})}function Fk(e,t,n,r,o){let i="";if(!If(o)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!Uk(n)))return!1;const a=Hk(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function Bk(e,t,n,r){return!If(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Uk(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Hk(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=fu(e,"(");let i=fu(e,")");for(;r!==-1&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function If(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Vn(n)||Ei(n))&&(!t||n!==47)}Rf.peek=Jk;function Vk(){this.buffer()}function Gk(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Zk(){this.buffer()}function Kk(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Wk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=en(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qk(e){this.exit(e)}function Yk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=en(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Xk(e){this.exit(e)}function Jk(){return"["}function Rf(e,t,n,r){const o=n.createTracker(r);let i=o.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return i+=o.move(n.safe(n.associationId(e),{after:"]",before:i})),s(),a(),i+=o.move("]"),i}function Qk(){return{enter:{gfmFootnoteCallString:Vk,gfmFootnoteCall:Gk,gfmFootnoteDefinitionLabelString:Zk,gfmFootnoteDefinition:Kk},exit:{gfmFootnoteCallString:Wk,gfmFootnoteCall:qk,gfmFootnoteDefinitionLabelString:Yk,gfmFootnoteDefinition:Xk}}}function e0(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Rf},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,i,a){const s=i.createTracker(a);let l=s.move("[^");const c=i.enter("footnoteDefinition"),u=i.enter("label");return l+=s.move(i.safe(i.associationId(r),{before:l,after:"]"})),u(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
24
- `:" ")+i.indentLines(i.containerFlow(r,s.current()),t?Of:t0))),c(),l}}function t0(e,t,n){return t===0?e:Of(e,t,n)}function Of(e,t,n){return(n?"":" ")+e}const n0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Mf.peek=s0;function r0(){return{canContainEols:["delete"],enter:{strikethrough:i0},exit:{strikethrough:a0}}}function o0(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:n0}],handlers:{delete:Mf}}}function i0(e){this.enter({type:"delete",children:[]},e)}function a0(e){this.exit(e)}function Mf(e,t,n,r){const o=n.createTracker(r),i=n.enter("strikethrough");let a=o.move("~~");return a+=n.containerPhrasing(e,{...o.current(),before:a,after:"~"}),a+=o.move("~~"),i(),a}function s0(){return"~"}function l0(e){return e.length}function c0(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||l0,i=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const h=[],y=[];let v=-1;for(e[u].length>c&&(c=e[u].length);++v<e[u].length;){const x=u0(e[u][v]);if(n.alignDelimiters!==!1){const w=o(x);y[v]=w,(l[v]===void 0||w>l[v])&&(l[v]=w)}h.push(x)}a[u]=h,s[u]=y}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)i[d]=pu(r[d]);else{const h=pu(r);for(;++d<c;)i[d]=h}d=-1;const p=[],m=[];for(;++d<c;){const h=i[d];let y="",v="";h===99?(y=":",v=":"):h===108?y=":":h===114&&(v=":");let x=n.alignDelimiters===!1?1:Math.max(1,l[d]-y.length-v.length);const w=y+"-".repeat(x)+v;n.alignDelimiters!==!1&&(x=y.length+x+v.length,x>l[d]&&(l[d]=x),m[d]=x),p[d]=w}a.splice(1,0,p),s.splice(1,0,m),u=-1;const b=[];for(;++u<a.length;){const h=a[u],y=s[u];d=-1;const v=[];for(;++d<c;){const x=h[d]||"";let w="",_="";if(n.alignDelimiters!==!1){const C=l[d]-(y[d]||0),E=i[d];E===114?w=" ".repeat(C):E===99?C%2?(w=" ".repeat(C/2+.5),_=" ".repeat(C/2-.5)):(w=" ".repeat(C/2),_=w):_=" ".repeat(C)}n.delimiterStart!==!1&&!d&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&x==="")&&(n.delimiterStart!==!1||d)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(x),n.alignDelimiters!==!1&&v.push(_),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&v.push("|")}b.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return b.join(`
25
- `)}function u0(e){return e==null?"":String(e)}function pu(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function d0(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),f0);return o(),a}function f0(e,t,n){return">"+(n?"":" ")+e}function p0(e,t){return mu(e,t.inConstruct,!0)&&!mu(e,t.notInConstruct,!1)}function mu(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function hu(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
26
- `&&p0(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
27
- `}function m0(e,t){const n=String(e);let r=n.indexOf(t),o=r,i=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++i>a&&(a=i):i=1,o=r+t.length,r=n.indexOf(t,o);return a}function h0(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function g0(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function b0(e,t,n,r){const o=g0(n),i=e.value||"",a=o==="`"?"GraveAccent":"Tilde";if(h0(e,n)){const d=n.enter("codeIndented"),p=n.indentLines(i,v0);return d(),p}const s=n.createTracker(r),l=o.repeat(Math.max(m0(i,o)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const d=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:`
28
- `,encode:["`"],...s.current()})),d()}return u+=s.move(`
29
- `),i&&(u+=s.move(i+`
30
- `)),u+=s.move(l),c(),u}function v0(e,t,n){return(n?"":" ")+e}function Qs(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function y0(e,t,n,r){const o=Qs(n),i=o==='"'?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
31
- `,...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),a(),c}function x0(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function li(e,t,n){const r=xr(e),o=xr(t);return r===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Pf.peek=w0;function Pf(e,t,n,r){const o=x0(n),i=n.enter("emphasis"),a=n.createTracker(r),s=a.move(o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=li(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=Xr(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=li(r.after.charCodeAt(0),d,o);p.inside&&(l=l.slice(0,-1)+Xr(d));const m=a.move(o);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+m}function w0(e,t,n){return n.options.emphasis||"*"}function _0(e,t){let n=!1;return Ci(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ns}),!!((!e.depth||e.depth<3)&&Hs(e)&&(t.options.setext||n))}function E0(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(_0(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),p=n.containerPhrasing(e,{...i.current(),before:`
32
- `,after:`
33
- `});return d(),u(),p+`
34
- `+(o===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
35
- `))+1))}const a="#".repeat(o),s=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
36
- `,...i.current()});return/^[\t ]/.test(c)&&(c=Xr(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c}Df.peek=S0;function Df(e){return e.value||""}function S0(){return"<"}Lf.peek=k0;function Lf(e,t,n,r){const o=Qs(n),i=o==='"'?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),c+=l.move(")"),a(),c}function k0(){return"!"}$f.peek=N0;function $f(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),o==="full"||!c||c!==d?l+=s.move(d+"]"):o==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function N0(){return"!"}zf.peek=C0;function zf(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],s=n.compilePattern(a);let l;if(a.atBreak)for(;l=s.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return o+r+o}function C0(){return"`"}function jf(e,t){const n=Hs(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ff.peek=T0;function Ff(e,t,n,r){const o=Qs(n),i=o==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(jf(e,n)){const u=n.stack;n.stack=[],s=n.enter("autolink");let d=a.move("<");return d+=a.move(n.containerPhrasing(e,{before:d,after:">",...a.current()})),d+=a.move(">"),s(),n.stack=u,d}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),c+=a.move(" "+o),c+=a.move(n.safe(e.title,{before:c,after:o,...a.current()})),c+=a.move(o),l()),c+=a.move(")"),s(),c}function T0(e,t,n){return jf(e,n)?"<":"["}Bf.peek=A0;function Bf(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),o==="full"||!c||c!==d?l+=s.move(d+"]"):o==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function A0(){return"["}function el(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function I0(e){const t=el(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function R0(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Uf(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function O0(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?R0(n):el(n);const s=e.ordered?a==="."?")":".":I0(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Uf(n)===a&&u){let d=-1;for(;++d<e.children.length;){const p=e.children[d];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=i,o(),c}function M0(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function P0(e,t,n,r){const o=M0(n);let i=n.bulletCurrent||el(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const s=n.createTracker(r);s.move(i+" ".repeat(a-i.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),u);return l(),c;function u(d,p,m){return p?(m?"":" ".repeat(a))+d:(m?i:i+" ".repeat(a-i.length))+d}}function D0(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),o(),a}const L0=lo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function $0(e,t,n,r){return(e.children.some(function(a){return L0(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function z0(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Hf.peek=j0;function Hf(e,t,n,r){const o=z0(n),i=n.enter("strong"),a=n.createTracker(r),s=a.move(o+o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=li(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=Xr(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=li(r.after.charCodeAt(0),d,o);p.inside&&(l=l.slice(0,-1)+Xr(d));const m=a.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+m}function j0(e,t,n){return n.options.strong||"*"}function F0(e,t,n,r){return n.safe(e.value,r)}function B0(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function U0(e,t,n){const r=(Uf(n)+(n.options.ruleSpaces?" ":"")).repeat(B0(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Vf={blockquote:d0,break:hu,code:b0,definition:y0,emphasis:Pf,hardBreak:hu,heading:E0,html:Df,image:Lf,imageReference:$f,inlineCode:zf,link:Ff,linkReference:Bf,list:O0,listItem:P0,paragraph:D0,root:$0,strong:Hf,text:F0,thematicBreak:U0};function H0(){return{enter:{table:V0,tableData:gu,tableHeader:gu,tableRow:Z0},exit:{codeText:K0,table:G0,tableData:Ma,tableHeader:Ma,tableRow:Ma}}}function V0(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function G0(e){this.exit(e),this.data.inTable=void 0}function Z0(e){this.enter({type:"tableRow",children:[]},e)}function Ma(e){this.exit(e)}function gu(e){this.enter({type:"tableCell",children:[]},e)}function K0(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,W0));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function W0(e,t){return t==="|"?t:e}function q0(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
37
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:s}};function a(m,b,h,y){return c(u(m,h,y),m.align)}function s(m,b,h,y){const v=d(m,h,y),x=c([v]);return x.slice(0,x.indexOf(`
38
- `))}function l(m,b,h,y){const v=h.enter("tableCell"),x=h.enter("phrasing"),w=h.containerPhrasing(m,{...y,before:i,after:i});return x(),v(),w}function c(m,b){return c0(m,{align:b,alignDelimiters:r,padding:n,stringLength:o})}function u(m,b,h){const y=m.children;let v=-1;const x=[],w=b.enter("table");for(;++v<y.length;)x[v]=d(y[v],b,h);return w(),x}function d(m,b,h){const y=m.children;let v=-1;const x=[],w=b.enter("tableRow");for(;++v<y.length;)x[v]=l(y[v],m,b,h);return w(),x}function p(m,b,h){let y=Vf.inlineCode(m,b,h);return h.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Y0(){return{exit:{taskListCheckValueChecked:bu,taskListCheckValueUnchecked:bu,paragraph:J0}}}function X0(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Q0}}}function bu(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function J0(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let i=-1,a;for(;++i<o.length;){const s=o[i];if(s.type==="paragraph"){a=s;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Q0(e,t,n,r){const o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);i&&s.move(a);let l=Vf.listItem(e,t,n,{...r,...s.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+a}}function eN(){return[Ok(),Qk(),r0(),H0(),Y0()]}function tN(e){return{extensions:[Mk(),e0(e),o0(),q0(e),X0()]}}const nN={tokenize:lN,partial:!0},Gf={tokenize:cN,partial:!0},Zf={tokenize:uN,partial:!0},Kf={tokenize:dN,partial:!0},rN={tokenize:fN,partial:!0},Wf={name:"wwwAutolink",tokenize:aN,previous:Yf},qf={name:"protocolAutolink",tokenize:sN,previous:Xf},yn={name:"emailAutolink",tokenize:iN,previous:Jf},pn={};function oN(){return{text:pn}}let Fn=48;for(;Fn<123;)pn[Fn]=yn,Fn++,Fn===58?Fn=65:Fn===91&&(Fn=97);pn[43]=yn;pn[45]=yn;pn[46]=yn;pn[95]=yn;pn[72]=[yn,qf];pn[104]=[yn,qf];pn[87]=[yn,Wf];pn[119]=[yn,Wf];function iN(e,t,n){const r=this;let o,i;return a;function a(d){return!ss(d)||!Jf.call(r,r.previous)||tl(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return ss(d)?(e.consume(d),s):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(rN,u,c)(d):d===45||d===95||St(d)?(i=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),o=!0,l}function u(d){return i&&o&&At(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function aN(e,t,n){const r=this;return o;function o(a){return a!==87&&a!==119||!Yf.call(r,r.previous)||tl(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(nN,e.attempt(Gf,e.attempt(Zf,i),n),n)(a))}function i(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function sN(e,t,n){const r=this;let o="",i=!1;return a;function a(d){return(d===72||d===104)&&Xf.call(r,r.previous)&&!tl(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(d),e.consume(d),s):n(d)}function s(d){if(At(d)&&o.length<5)return o+=String.fromCodePoint(d),e.consume(d),s;if(d===58){const p=o.toLowerCase();if(p==="http"||p==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),i?c:(i=!0,l)):n(d)}function c(d){return d===null||ri(d)||Ge(d)||Vn(d)||Ei(d)?n(d):e.attempt(Gf,e.attempt(Zf,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function lN(e,t,n){let r=0;return o;function o(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),o):a===46&&r===3?(e.consume(a),i):n(a)}function i(a){return a===null?n(a):t(a)}}function cN(e,t,n){let r,o,i;return a;function a(c){return c===46||c===95?e.check(Kf,l,s)(c):c===null||Ge(c)||Vn(c)||c!==45&&Ei(c)?l(c):(i=!0,e.consume(c),a)}function s(c){return c===95?r=!0:(o=r,r=void 0),e.consume(c),a}function l(c){return o||r||!i?n(c):t(c)}}function uN(e,t){let n=0,r=0;return o;function o(a){return a===40?(n++,e.consume(a),o):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Kf,t,i)(a):a===null||Ge(a)||Vn(a)?t(a):(e.consume(a),o)}function i(a){return a===41&&r++,e.consume(a),o}}function dN(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),i):s===93?(e.consume(s),o):s===60||s===null||Ge(s)||Vn(s)?t(s):n(s)}function o(s){return s===null||s===40||s===91||Ge(s)||Vn(s)?t(s):r(s)}function i(s){return At(s)?a(s):n(s)}function a(s){return s===59?(e.consume(s),r):At(s)?(e.consume(s),a):n(s)}}function fN(e,t,n){return r;function r(i){return e.consume(i),o}function o(i){return St(i)?n(i):t(i)}}function Yf(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ge(e)}function Xf(e){return!At(e)}function Jf(e){return!(e===47||ss(e))}function ss(e){return e===43||e===45||e===46||e===95||St(e)}function tl(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const pN={tokenize:wN,partial:!0};function mN(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:vN,continuation:{tokenize:yN},exit:xN}},text:{91:{name:"gfmFootnoteCall",tokenize:bN},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hN,resolveTo:gN}}}}function hN(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const l=r.events[o][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!a||!a._balanced)return n(l);const c=en(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function gN(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function bN(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return s;function s(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(i>999||d===93&&!a||d===null||d===91||Ge(d))return n(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return o.includes(en(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Ge(d)||(a=!0),i++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),i++,c):c(d)}}function vN(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,s;return l;function l(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(b)}function u(b){if(a>999||b===93&&!s||b===null||b===91||Ge(b))return n(b);if(b===93){e.exit("chunkString");const h=e.exit("gfmFootnoteDefinitionLabelString");return i=en(r.sliceSerialize(h)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Ge(b)||(s=!0),a++,e.consume(b),b===92?d:u}function d(b){return b===91||b===92||b===93?(e.consume(b),a++,u):u(b)}function p(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),o.includes(i)||o.push(i),Pe(e,m,"gfmFootnoteDefinitionWhitespace")):n(b)}function m(b){return t(b)}}function yN(e,t,n){return e.check(so,t,e.attempt(pN,t,n))}function xN(e){e.exit("gfmFootnoteDefinition")}function wN(e,t,n){const r=this;return Pe(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function _N(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(a,s){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let c=l;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[l][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[l][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",u,s],["enter",a[c][1],s],["exit",a[c][1],s],["enter",d,s]],m=s.parser.constructs.insideSpan.null;m&&Bt(p,p.length,0,Si(m,a.slice(c+1,l),s)),Bt(p,p.length,0,[["exit",d,s],["enter",a[l][1],s],["exit",a[l][1],s],["exit",u,s]]),Bt(a,c-1,l-c+3,p),l=c+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,s,l){const c=this.previous,u=this.events;let d=0;return p;function p(b){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(b):(a.enter("strikethroughSequenceTemporary"),m(b))}function m(b){const h=xr(c);if(b===126)return d>1?l(b):(a.consume(b),d++,m);if(d<2&&!n)return l(b);const y=a.exit("strikethroughSequenceTemporary"),v=xr(b);return y._open=!v||v===2&&!!h,y._close=!h||h===2&&!!v,s(b)}}}class EN{constructor(){this.map=[]}add(t,n,r){SN(this,t,n,r)}consume(t){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const i of o)t.push(i);o=r.pop()}this.map.length=0}}function SN(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function kN(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function NN(){return{flow:{null:{name:"table",tokenize:CN,resolveAll:TN}}}}function CN(e,t,n){const r=this;let o=0,i=0,a;return s;function s(T){let I=r.events.length-1;for(;I>-1;){const L=r.events[I][1].type;if(L==="lineEnding"||L==="linePrefix")I--;else break}const O=I>-1?r.events[I][1].type:null,D=O==="tableHead"||O==="tableRow"?E:l;return D===E&&r.parser.lazy[r.now().line]?n(T):D(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),c(T)}function c(T){return T===124||(a=!0,i+=1),u(T)}function u(T){return T===null?n(T):ge(T)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),m):n(T):Re(T)?Pe(e,u,"whitespace")(T):(i+=1,a&&(a=!1,o+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),a=!0,u):(e.enter("data"),d(T)))}function d(T){return T===null||T===124||Ge(T)?(e.exit("data"),u(T)):(e.consume(T),T===92?p:d)}function p(T){return T===92||T===124?(e.consume(T),d):d(T)}function m(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),a=!1,Re(T)?Pe(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):b(T))}function b(T){return T===45||T===58?y(T):T===124?(a=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),h):C(T)}function h(T){return Re(T)?Pe(e,y,"whitespace")(T):y(T)}function y(T){return T===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),v):T===45?(i+=1,v(T)):T===null||ge(T)?_(T):C(T)}function v(T){return T===45?(e.enter("tableDelimiterFiller"),x(T)):C(T)}function x(T){return T===45?(e.consume(T),x):T===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return Re(T)?Pe(e,_,"whitespace")(T):_(T)}function _(T){return T===124?b(T):T===null||ge(T)?!a||o!==i?C(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):C(T)}function C(T){return n(T)}function E(T){return e.enter("tableRow"),A(T)}function A(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),A):T===null||ge(T)?(e.exit("tableRow"),t(T)):Re(T)?Pe(e,A,"whitespace")(T):(e.enter("data"),R(T))}function R(T){return T===null||T===124||Ge(T)?(e.exit("data"),A(T)):(e.consume(T),T===92?M:R)}function M(T){return T===92||T===124?(e.consume(T),R):R(T)}}function TN(e,t){let n=-1,r=!0,o=0,i=[0,0,0,0],a=[0,0,0,0],s=!1,l=0,c,u,d;const p=new EN;for(;++n<e.length;){const m=e[n],b=m[1];m[0]==="enter"?b.type==="tableHead"?(s=!1,l!==0&&(vu(p,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},p.add(n,0,[["enter",c,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,d=void 0,i=[0,0,0,0],a=[0,n+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},p.add(n,0,[["enter",u,t]])),o=b.type==="tableDelimiterRow"?2:u?3:1):o&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],d=zo(p,t,i,o,void 0,d),i=[0,0,0,0]),a[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],d=zo(p,t,i,o,void 0,d)),i=a,a=[i[1],n,0,0])):b.type==="tableHead"?(s=!0,l=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(l=n,i[1]!==0?(a[0]=a[1],d=zo(p,t,i,o,n,d)):a[1]!==0&&(d=zo(p,t,a,o,n,d)),o=0):o&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&vu(p,t,l,c,u),p.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=kN(t.events,n))}return e}function zo(e,t,n,r,o,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(i.end=Object.assign({},fr(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const l=fr(t.events,n[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const c=fr(t.events,n[2]),u=fr(t.events,n[3]),d={type:s,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const p=t.events[n[2]],m=t.events[n[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,h=n[3]-n[2]-1;e.add(b,h,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return o!==void 0&&(i.end=Object.assign({},fr(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function vu(e,t,n,r,o){const i=[],a=fr(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function fr(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const AN={name:"tasklistCheck",tokenize:RN};function IN(){return{text:{91:AN}}}function RN(e,t,n){const r=this;return o;function o(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),i)}function i(l){return Ge(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return ge(l)?t(l):Re(l)?e.check({tokenize:ON},t,n)(l):n(l)}}function ON(e,t,n){return Pe(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function MN(e){return Fd([oN(),mN(),_N(e),NN(),IN()])}const PN={};function Qf(e){const t=this,n=e||PN,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(MN(n)),i.push(eN()),a.push(tN(n))}function DN(e){const{toolName:t,args:n}=e;switch(t){case"bash":return{icon:my,command:String(n.command??"")};case"read":return{icon:ty,command:String(n.path??"")};case"write":return{icon:Qv,command:String(n.path??"")};case"edit":return{icon:Xv,command:String(n.path??"")};case"grep":return{icon:uy,command:String(n.pattern??"")};case"find":return{icon:ay,command:String(n.pattern??"*")};case"ls":return{icon:oy,command:String(n.path??".")};default:{const r=Object.values(n)[0];return{icon:gy,command:r?String(r):""}}}}function LN(e){const t=e.result??e.partialResult,n=t?.content?.find(r=>"type"in r&&r.type==="text"&&"text"in r&&typeof r.text=="string");if(n?.text)return n.text;if(e.toolName==="edit"){const r=e.result?.details;if(r?.diff)return r.diff}return t?.details?JSON.stringify(t.details,null,2):e.status==="running"?"Running…":""}function j(e,t,n){function r(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,l);const c=a.prototype,u=Object.keys(c);for(let d=0;d<u.length;d++){const p=u[d];p in s||(s[p]=c[p].bind(s))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(s){var l;const c=n?.Parent?new i:this;r(c,s),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class vr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ep extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const tp={};function Nn(e){return tp}function np(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ls(e,t){return typeof t=="bigint"?t.toString():t}function nl(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function rl(e){return e==null}function ol(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function $N(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l?.[1]&&(o=Number.parseInt(l[1]))}const i=n>o?n:o,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return a%s/10**i}const yu=Symbol("evaluating");function De(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==yu)return r===void 0&&(r=yu,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Jn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function In(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function xu(e){return JSON.stringify(e)}function zN(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const rp="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ci(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const jN=nl(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function wr(e){if(ci(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ci(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function op(e){return wr(e)?{...e}:Array.isArray(e)?[...e]:e}const FN=new Set(["string","number","symbol"]);function _r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function de(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function BN(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const UN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function HN(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=In(e._zod.def,{get shape(){const a={};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=n.shape[s])}return Jn(this,"shape",a),a},checks:[]});return Rn(e,i)}function VN(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=In(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return Jn(this,"shape",a),a},checks:[]});return Rn(e,i)}function GN(e,t){if(!wr(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=In(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Jn(this,"shape",i),i}});return Rn(e,o)}function ZN(e,t){if(!wr(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=In(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Jn(this,"shape",r),r}});return Rn(e,n)}function KN(e,t){const n=In(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Jn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Rn(e,n)}function WN(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=In(t._zod.def,{get shape(){const s=t._zod.def.shape,l={...s};if(n)for(const c in n){if(!(c in s))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:s[c]}):s[c])}else for(const c in s)l[c]=e?new e({type:"optional",innerType:s[c]}):s[c];return Jn(this,"shape",l),l},checks:[]});return Rn(t,a)}function qN(e,t,n){const r=In(t._zod.def,{get shape(){const o=t._zod.def.shape,i={...o};if(n)for(const a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)i[a]=new e({type:"nonoptional",innerType:o[a]});return Jn(this,"shape",i),i}});return Rn(t,r)}function mr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function hr(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function jo(e){return typeof e=="string"?e:e?.message}function Cn(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=jo(e.inst?._zod.def?.error?.(e))??jo(t?.error?.(e))??jo(n.customError?.(e))??jo(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function il(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Jr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const ip=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ls,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ap=j("$ZodError",ip),sp=j("$ZodError",ip,{Parent:Error});function YN(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function XN(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let a=n,s=0;for(;s<i.path.length;){const l=i.path[s];s===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(i))):a[l]=a[l]||{_errors:[]},a=a[l],s++}}};return r(e),n}const al=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new vr;if(a.issues.length){const s=new(o?.Err??e)(a.issues.map(l=>Cn(l,i,Nn())));throw rp(s,o?.callee),s}return a.value},sl=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new(o?.Err??e)(a.issues.map(l=>Cn(l,i,Nn())));throw rp(s,o?.callee),s}return a.value},Ti=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new vr;return i.issues.length?{success:!1,error:new(e??ap)(i.issues.map(a=>Cn(a,o,Nn())))}:{success:!0,data:i.value}},JN=Ti(sp),Ai=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Cn(a,o,Nn())))}:{success:!0,data:i.value}},QN=Ai(sp),eC=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return al(e)(t,n,o)},tC=e=>(t,n,r)=>al(e)(t,n,r),nC=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return sl(e)(t,n,o)},rC=e=>async(t,n,r)=>sl(e)(t,n,r),oC=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ti(e)(t,n,o)},iC=e=>(t,n,r)=>Ti(e)(t,n,r),aC=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ai(e)(t,n,o)},sC=e=>async(t,n,r)=>Ai(e)(t,n,r),lC=/^[cC][^\s-]{8,}$/,cC=/^[0-9a-z]+$/,uC=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dC=/^[0-9a-vA-V]{20}$/,fC=/^[A-Za-z0-9]{27}$/,pC=/^[a-zA-Z0-9_-]{21}$/,mC=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,hC=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,wu=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,gC=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function vC(){return new RegExp(bC,"u")}const yC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xC=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,wC=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,_C=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,EC=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,lp=/^[A-Za-z0-9_-]*$/,SC=/^\+[1-9]\d{6,14}$/,cp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",kC=new RegExp(`^${cp}$`);function up(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function NC(e){return new RegExp(`^${up(e)}$`)}function CC(e){const t=up({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${cp}T(?:${r})$`)}const TC=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},AC=/^-?\d+$/,dp=/^-?\d+(?:\.\d+)?$/,IC=/^(?:true|false)$/i,RC=/^null$/i,OC=/^[^A-Z]*$/,MC=/^[^a-z]*$/,$t=j("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),fp={number:"number",bigint:"bigint",object:"date"},pp=j("$ZodCheckLessThan",(e,t)=>{$t.init(e,t);const n=fp[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),mp=j("$ZodCheckGreaterThan",(e,t)=>{$t.init(e,t);const n=fp[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),PC=j("$ZodCheckMultipleOf",(e,t)=>{$t.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):$N(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),DC=j("$ZodCheckNumberFormat",(e,t)=>{$t.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=UN[t.format];e._zod.onattach.push(a=>{const s=a._zod.bag;s.format=t.format,s.minimum=o,s.maximum=i,n&&(s.pattern=AC)}),e._zod.check=a=>{const s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<o&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),LC=j("$ZodCheckMaxLength",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!rl(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const a=il(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),$C=j("$ZodCheckMinLength",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!rl(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const a=il(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),zC=j("$ZodCheckLengthEquals",(e,t)=>{var n;$t.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!rl(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const a=il(o),s=i>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ii=j("$ZodCheckStringFormat",(e,t)=>{var n,r;$t.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jC=j("$ZodCheckRegex",(e,t)=>{Ii.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),FC=j("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=OC),Ii.init(e,t)}),BC=j("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=MC),Ii.init(e,t)}),UC=j("$ZodCheckIncludes",(e,t)=>{$t.init(e,t);const n=_r(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),HC=j("$ZodCheckStartsWith",(e,t)=>{$t.init(e,t);const n=new RegExp(`^${_r(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),VC=j("$ZodCheckEndsWith",(e,t)=>{$t.init(e,t);const n=new RegExp(`.*${_r(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),GC=j("$ZodCheckOverwrite",(e,t)=>{$t.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class ZC{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
39
- `).filter(a=>a),o=Math.min(...r.map(a=>a.length-a.trimStart().length)),i=r.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of i)this.content.push(a)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
40
- `))}}const KC={major:4,minor:3,patch:6},qe=j("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=KC;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const i of o._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,s,l)=>{let c=mr(a),u;for(const d of s){if(d._zod.def.when){if(!d._zod.def.when(a))continue}else if(c)continue;const p=a.issues.length,m=d._zod.check(a);if(m instanceof Promise&&l?.async===!1)throw new vr;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,a.issues.length!==p&&(c||(c=mr(a,p)))});else{if(a.issues.length===p)continue;c||(c=mr(a,p))}}return u?u.then(()=>a):a},i=(a,s,l)=>{if(mr(a))return a.aborted=!0,a;const c=o(s,r,l);if(c instanceof Promise){if(l.async===!1)throw new vr;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){const c=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,a,s)):i(c,a,s)}const l=e._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new vr;return l.then(c=>o(c,r,s))}return o(l,r,s)}}De(e,"~standard",()=>({validate:o=>{try{const i=JN(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return QN(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),ll=j("$ZodString",(e,t)=>{qe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??TC(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Xe=j("$ZodStringFormat",(e,t)=>{Ii.init(e,t),ll.init(e,t)}),WC=j("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=hC),Xe.init(e,t)}),qC=j("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=wu(r))}else t.pattern??(t.pattern=wu());Xe.init(e,t)}),YC=j("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=gC),Xe.init(e,t)}),XC=j("$ZodURL",(e,t)=>{Xe.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),JC=j("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=vC()),Xe.init(e,t)}),QC=j("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=pC),Xe.init(e,t)}),eT=j("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lC),Xe.init(e,t)}),tT=j("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=cC),Xe.init(e,t)}),nT=j("$ZodULID",(e,t)=>{t.pattern??(t.pattern=uC),Xe.init(e,t)}),rT=j("$ZodXID",(e,t)=>{t.pattern??(t.pattern=dC),Xe.init(e,t)}),oT=j("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fC),Xe.init(e,t)}),iT=j("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=CC(t)),Xe.init(e,t)}),aT=j("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=kC),Xe.init(e,t)}),sT=j("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=NC(t)),Xe.init(e,t)}),lT=j("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=mC),Xe.init(e,t)}),cT=j("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=yC),Xe.init(e,t),e._zod.bag.format="ipv4"}),uT=j("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xC),Xe.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),dT=j("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=wC),Xe.init(e,t)}),fT=j("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=_C),Xe.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,i]=r;if(!i)throw new Error;const a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function hp(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const pT=j("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=EC),Xe.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{hp(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function mT(e){if(!lp.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return hp(n)}const hT=j("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=lp),Xe.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{mT(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),gT=j("$ZodE164",(e,t)=>{t.pattern??(t.pattern=SC),Xe.init(e,t)});function bT(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const vT=j("$ZodJWT",(e,t)=>{Xe.init(e,t),e._zod.check=n=>{bT(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),gp=j("$ZodNumber",(e,t)=>{qe.init(e,t),e._zod.pattern=e._zod.bag.pattern??dp,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),yT=j("$ZodNumberFormat",(e,t)=>{DC.init(e,t),gp.init(e,t)}),xT=j("$ZodBoolean",(e,t)=>{qe.init(e,t),e._zod.pattern=IC,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),wT=j("$ZodNull",(e,t)=>{qe.init(e,t),e._zod.pattern=RC,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n}}),_T=j("$ZodAny",(e,t)=>{qe.init(e,t),e._zod.parse=n=>n}),ET=j("$ZodUnknown",(e,t)=>{qe.init(e,t),e._zod.parse=n=>n}),ST=j("$ZodNever",(e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function _u(e,t,n){e.issues.length&&t.issues.push(...hr(n,e.issues)),t.value[n]=e.value}const kT=j("$ZodArray",(e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let a=0;a<o.length;a++){const s=o[a],l=t.element._zod.run({value:s,issues:[]},r);l instanceof Promise?i.push(l.then(c=>_u(c,n,a))):_u(l,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function ui(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...hr(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function bp(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=BN(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function vp(e,t,n,r,o,i){const a=[],s=o.keySet,l=o.catchall._zod,c=l.def.type,u=l.optout==="optional";for(const d in t){if(s.has(d))continue;if(c==="never"){a.push(d);continue}const p=l.run({value:t[d],issues:[]},r);p instanceof Promise?e.push(p.then(m=>ui(m,n,d,t,u))):ui(p,n,d,t,u)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const NT=j("$ZodObject",(e,t)=>{if(qe.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...s};return Object.defineProperty(t,"shape",{value:l}),l}})}const r=nl(()=>bp(t));De(e._zod,"propValues",()=>{const s=t.shape,l={};for(const c in s){const u=s[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(const d of u.values)l[c].add(d)}}return l});const o=ci,i=t.catchall;let a;e._zod.parse=(s,l)=>{a??(a=r.value);const c=s.value;if(!o(c))return s.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),s;s.value={};const u=[],d=a.shape;for(const p of a.keys){const m=d[p],b=m._zod.optout==="optional",h=m._zod.run({value:c[p],issues:[]},l);h instanceof Promise?u.push(h.then(y=>ui(y,s,p,c,b))):ui(h,s,p,c,b)}return i?vp(u,c,s,l,r.value,e):u.length?Promise.all(u).then(()=>s):s}}),CT=j("$ZodObjectJIT",(e,t)=>{NT.init(e,t);const n=e._zod.parse,r=nl(()=>bp(t)),o=p=>{const m=new ZC(["shape","payload","ctx"]),b=r.value,h=w=>{const _=xu(w);return`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`};m.write("const input = payload.value;");const y=Object.create(null);let v=0;for(const w of b.keys)y[w]=`key_${v++}`;m.write("const newResult = {};");for(const w of b.keys){const _=y[w],C=xu(w),A=p[w]?._zod?.optout==="optional";m.write(`const ${_} = ${h(w)};`),A?m.write(`
41
- if (${_}.issues.length) {
42
- if (${C} in input) {
43
- payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
44
- ...iss,
45
- path: iss.path ? [${C}, ...iss.path] : [${C}]
46
- })));
47
- }
48
- }
49
-
50
- if (${_}.value === undefined) {
51
- if (${C} in input) {
52
- newResult[${C}] = undefined;
53
- }
54
- } else {
55
- newResult[${C}] = ${_}.value;
56
- }
57
-
58
- `):m.write(`
59
- if (${_}.issues.length) {
60
- payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
61
- ...iss,
62
- path: iss.path ? [${C}, ...iss.path] : [${C}]
63
- })));
64
- }
65
-
66
- if (${_}.value === undefined) {
67
- if (${C} in input) {
68
- newResult[${C}] = undefined;
69
- }
70
- } else {
71
- newResult[${C}] = ${_}.value;
72
- }
73
-
74
- `)}m.write("payload.value = newResult;"),m.write("return payload;");const x=m.compile();return(w,_)=>x(p,w,_)};let i;const a=ci,s=!tp.jitless,c=s&&jN.value,u=t.catchall;let d;e._zod.parse=(p,m)=>{d??(d=r.value);const b=p.value;return a(b)?s&&c&&m?.async===!1&&m.jitless!==!0?(i||(i=o(t.shape)),p=i(p,m),u?vp([],b,p,m,d,e):p):n(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),p)}});function Eu(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!mr(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(a=>Cn(a,r,Nn())))}),t)}const TT=j("$ZodUnion",(e,t)=>{qe.init(e,t),De(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),De(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),De(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),De(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>ol(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let a=!1;const s=[];for(const l of t.options){const c=l._zod.run({value:o.value,issues:[]},i);if(c instanceof Promise)s.push(c),a=!0;else{if(c.issues.length===0)return c;s.push(c)}}return a?Promise.all(s).then(l=>Eu(l,o,e,i)):Eu(s,o,e,i)}}),AT=j("$ZodIntersection",(e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),a=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>Su(n,l,c)):Su(n,i,a)}});function cs(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(wr(e)&&wr(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const a=cs(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],a=cs(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Su(e,t,n){const r=new Map;let o;for(const s of t.issues)if(s.code==="unrecognized_keys"){o??(o=s);for(const l of s.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(s);for(const s of n.issues)if(s.code==="unrecognized_keys")for(const l of s.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(s);const i=[...r].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&o&&e.issues.push({...o,keys:i}),mr(e))return e;const a=cs(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const IT=j("$ZodRecord",(e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!wr(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],a=t.keyType._zod.values;if(a){n.value={};const s=new Set;for(const c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){s.add(typeof c=="number"?c.toString():c);const u=t.valueType._zod.run({value:o[c],issues:[]},r);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&n.issues.push(...hr(c,d.issues)),n.value[c]=d.value})):(u.issues.length&&n.issues.push(...hr(c,u.issues)),n.value[c]=u.value)}let l;for(const c in o)s.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const s of Reflect.ownKeys(o)){if(s==="__proto__")continue;let l=t.keyType._zod.run({value:s,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&dp.test(s)&&l.issues.length){const d=t.keyType._zod.run({value:Number(s),issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(l=d)}if(l.issues.length){t.mode==="loose"?n.value[s]=o[s]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>Cn(d,r,Nn())),input:s,path:[s],inst:e});continue}const u=t.valueType._zod.run({value:o[s],issues:[]},r);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&n.issues.push(...hr(s,d.issues)),n.value[l.value]=d.value})):(u.issues.length&&n.issues.push(...hr(s,u.issues)),n.value[l.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),RT=j("$ZodEnum",(e,t)=>{qe.init(e,t);const n=np(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>FN.has(typeof o)).map(o=>typeof o=="string"?_r(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const a=o.value;return r.has(a)||o.issues.push({code:"invalid_value",values:n,input:a,inst:e}),o}}),OT=j("$ZodLiteral",(e,t)=>{if(qe.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?_r(r):r?_r(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),MT=j("$ZodTransform",(e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ep(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new vr;return n.value=o,n}});function ku(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const yp=j("$ZodOptional",(e,t)=>{qe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",De(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),De(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ol(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>ku(i,n.value)):ku(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),PT=j("$ZodExactOptional",(e,t)=>{yp.init(e,t),De(e._zod,"values",()=>t.innerType._zod.values),De(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),DT=j("$ZodNullable",(e,t)=>{qe.init(e,t),De(e._zod,"optin",()=>t.innerType._zod.optin),De(e._zod,"optout",()=>t.innerType._zod.optout),De(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${ol(n.source)}|null)$`):void 0}),De(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),LT=j("$ZodDefault",(e,t)=>{qe.init(e,t),e._zod.optin="optional",De(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Nu(i,t)):Nu(o,t)}});function Nu(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const $T=j("$ZodPrefault",(e,t)=>{qe.init(e,t),e._zod.optin="optional",De(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),zT=j("$ZodNonOptional",(e,t)=>{qe.init(e,t),De(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Cu(i,e)):Cu(o,e)}});function Cu(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const jT=j("$ZodCatch",(e,t)=>{qe.init(e,t),De(e._zod,"optin",()=>t.innerType._zod.optin),De(e._zod,"optout",()=>t.innerType._zod.optout),De(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Cn(a,r,Nn()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Cn(i,r,Nn()))},input:n.value}),n.issues=[]),n)}}),FT=j("$ZodPipe",(e,t)=>{qe.init(e,t),De(e._zod,"values",()=>t.in._zod.values),De(e._zod,"optin",()=>t.in._zod.optin),De(e._zod,"optout",()=>t.out._zod.optout),De(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(a=>Fo(a,t.in,r)):Fo(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Fo(i,t.out,r)):Fo(o,t.out,r)}});function Fo(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const BT=j("$ZodReadonly",(e,t)=>{qe.init(e,t),De(e._zod,"propValues",()=>t.innerType._zod.propValues),De(e._zod,"values",()=>t.innerType._zod.values),De(e._zod,"optin",()=>t.innerType?._zod?.optin),De(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Tu):Tu(o)}});function Tu(e){return e.value=Object.freeze(e.value),e}const UT=j("$ZodLazy",(e,t)=>{qe.init(e,t),De(e._zod,"innerType",()=>t.getter()),De(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),De(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),De(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),De(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),HT=j("$ZodCustom",(e,t)=>{$t.init(e,t),qe.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>Au(i,n,r,e));Au(o,n,r,e)}});function Au(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Jr(o))}}var Iu;class VT{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function GT(){return new VT}(Iu=globalThis).__zod_globalRegistry??(Iu.__zod_globalRegistry=GT());const Br=globalThis.__zod_globalRegistry;function ZT(e,t){return new e({type:"string",...de(t)})}function KT(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...de(t)})}function Ru(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...de(t)})}function WT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...de(t)})}function qT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...de(t)})}function YT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...de(t)})}function XT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...de(t)})}function JT(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...de(t)})}function QT(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...de(t)})}function eA(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...de(t)})}function tA(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...de(t)})}function nA(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...de(t)})}function rA(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...de(t)})}function oA(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...de(t)})}function iA(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...de(t)})}function aA(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...de(t)})}function sA(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...de(t)})}function lA(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...de(t)})}function cA(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...de(t)})}function uA(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...de(t)})}function dA(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...de(t)})}function fA(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...de(t)})}function pA(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...de(t)})}function mA(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...de(t)})}function hA(e,t){return new e({type:"string",format:"date",check:"string_format",...de(t)})}function gA(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...de(t)})}function bA(e,t){return new e({type:"string",format:"duration",check:"string_format",...de(t)})}function vA(e,t){return new e({type:"number",checks:[],...de(t)})}function yA(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...de(t)})}function xA(e,t){return new e({type:"boolean",...de(t)})}function wA(e,t){return new e({type:"null",...de(t)})}function _A(e){return new e({type:"any"})}function EA(e){return new e({type:"unknown"})}function SA(e,t){return new e({type:"never",...de(t)})}function Ou(e,t){return new pp({check:"less_than",...de(t),value:e,inclusive:!1})}function Pa(e,t){return new pp({check:"less_than",...de(t),value:e,inclusive:!0})}function Mu(e,t){return new mp({check:"greater_than",...de(t),value:e,inclusive:!1})}function Da(e,t){return new mp({check:"greater_than",...de(t),value:e,inclusive:!0})}function Pu(e,t){return new PC({check:"multiple_of",...de(t),value:e})}function xp(e,t){return new LC({check:"max_length",...de(t),maximum:e})}function di(e,t){return new $C({check:"min_length",...de(t),minimum:e})}function wp(e,t){return new zC({check:"length_equals",...de(t),length:e})}function kA(e,t){return new jC({check:"string_format",format:"regex",...de(t),pattern:e})}function NA(e){return new FC({check:"string_format",format:"lowercase",...de(e)})}function CA(e){return new BC({check:"string_format",format:"uppercase",...de(e)})}function TA(e,t){return new UC({check:"string_format",format:"includes",...de(t),includes:e})}function AA(e,t){return new HC({check:"string_format",format:"starts_with",...de(t),prefix:e})}function IA(e,t){return new VC({check:"string_format",format:"ends_with",...de(t),suffix:e})}function Cr(e){return new GC({check:"overwrite",tx:e})}function RA(e){return Cr(t=>t.normalize(e))}function OA(){return Cr(e=>e.trim())}function MA(){return Cr(e=>e.toLowerCase())}function PA(){return Cr(e=>e.toUpperCase())}function DA(){return Cr(e=>zN(e))}function LA(e,t,n){return new e({type:"array",element:t,...de(n)})}function $A(e,t,n){return new e({type:"custom",check:"custom",fn:t,...de(n)})}function zA(e){const t=jA(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Jr(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Jr(o))}},e(n.value,n)));return t}function jA(e,t){const n=new $t({check:"custom",...de(t)});return n._zod.check=e,n}function _p(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Br,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function nt(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);const s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,u);else{const p=a.schema,m=t.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,p,u)}const d=e._zod.parent;d&&(a.ref||(a.ref=d),nt(d,t,u),t.seen.get(d).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&Ct(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Ep(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const a of e.seen.entries()){const s=e.metadataRegistry.get(a[0])?.id;if(s){const l=r.get(s);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(s,a[0])}}const o=a=>{const s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(a[0])?.id,p=e.external.uri??(b=>b);if(d)return{ref:p(d)};const m=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=m,{defId:m,ref:`${p("__shared")}#/${s}/${m}`}}if(a[1]===n)return{ref:"#"};const c=`#/${s}/`,u=a[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},i=a=>{if(a[1].schema.$ref)return;const s=a[1],{ref:l,defId:c}=o(a);s.def={...s.schema},c&&(s.defId=c);const u=s.schema;for(const d in u)delete u[d];u.$ref=l};if(e.cycles==="throw")for(const a of e.seen.entries()){const s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
75
-
76
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const s=a[1];if(t===a[0]){i(a);continue}if(e.external){const c=e.external.registry.get(a[0])?.id;if(t!==a[0]&&c){i(a);continue}}if(e.metadataRegistry.get(a[0])?.id){i(a);continue}if(s.cycle){i(a);continue}if(s.count>1&&e.reused==="ref"){i(a);continue}}}function Sp(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const s=e.seen.get(a);if(s.ref===null)return;const l=s.def??s.schema,c={...l},u=s.ref;if(s.ref=null,u){r(u);const p=e.seen.get(u),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):Object.assign(l,m),Object.assign(l,c),a._zod.parent===u)for(const h in l)h==="$ref"||h==="allOf"||h in c||delete l[h];if(m.$ref&&p.def)for(const h in l)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(l[h])===JSON.stringify(p.def[h])&&delete l[h]}const d=a._zod.parent;if(d&&d!==u){r(d);const p=e.seen.get(d);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(const m in l)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(l[m])===JSON.stringify(p.def[m])&&delete l[m]}e.override({zodSchema:a,jsonSchema:l,path:s.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,n.def??n.schema);const i=e.external?.defs??{};for(const a of e.seen.entries()){const s=a[1];s.def&&s.defId&&(i[s.defId]=s.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:fi(t,"input",e.processors),output:fi(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ct(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Ct(r.element,n);if(r.type==="set")return Ct(r.valueType,n);if(r.type==="lazy")return Ct(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Ct(r.innerType,n);if(r.type==="intersection")return Ct(r.left,n)||Ct(r.right,n);if(r.type==="record"||r.type==="map")return Ct(r.keyType,n)||Ct(r.valueType,n);if(r.type==="pipe")return Ct(r.in,n)||Ct(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Ct(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Ct(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Ct(o,n))return!0;return!!(r.rest&&Ct(r.rest,n))}return!1}const FA=(e,t={})=>n=>{const r=_p({...n,processors:t});return nt(e,r),Ep(r,e),Sp(r,e)},fi=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},a=_p({...o??{},target:i,io:t,processors:n});return nt(e,a),Ep(a,e),Sp(a,e)},BA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},UA=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof a=="number"&&(o.maxLength=a),s&&(o.format=BA[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},HA=(e,t,n,r)=>{const o=n,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof s=="string"&&s.includes("int")?o.type="integer":o.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u),typeof i=="number"&&(o.minimum=i,typeof u=="number"&&t.target!=="draft-04"&&(u>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),typeof a=="number"&&(o.maximum=a,typeof c=="number"&&t.target!=="draft-04"&&(c<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},VA=(e,t,n,r)=>{n.type="boolean"},GA=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},ZA=(e,t,n,r)=>{n.not={}},KA=(e,t,n,r)=>{},WA=(e,t,n,r)=>{},qA=(e,t,n,r)=>{const o=e._zod.def,i=np(o.entries);i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),n.enum=i},YA=(e,t,n,r)=>{const o=e._zod.def,i=[];for(const a of o.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(a))}else i.push(a);if(i.length!==0)if(i.length===1){const a=i[0];n.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[a]:n.const=a}else i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),i.every(a=>typeof a=="boolean")&&(n.type="boolean"),i.every(a=>a===null)&&(n.type="null"),n.enum=i},XA=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},JA=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},QA=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=nt(i.element,t,{...r,path:[...r.path,"items"]})},eI=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const a=i.shape;for(const c in a)o.properties[c]=nt(a[c],t,{...r,path:[...r.path,"properties",c]});const s=new Set(Object.keys(a)),l=new Set([...s].filter(c=>{const u=i.shape[c]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=nt(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},tI=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,a=o.options.map((s,l)=>nt(s,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=a:n.anyOf=a},nI=(e,t,n,r)=>{const o=e._zod.def,i=nt(o.left,t,{...r,path:[...r.path,"allOf",0]}),a=nt(o.right,t,{...r,path:[...r.path,"allOf",1]}),s=c=>"allOf"in c&&Object.keys(c).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];n.allOf=l},rI=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const a=i.keyType,l=a._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){const u=nt(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const d of l)o.patternProperties[d.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=nt(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=nt(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=a._zod.values;if(c){const u=[...c].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(o.required=u)}},oI=(e,t,n,r)=>{const o=e._zod.def,i=nt(o.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},iI=(e,t,n,r)=>{const o=e._zod.def;nt(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},aI=(e,t,n,r)=>{const o=e._zod.def;nt(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},sI=(e,t,n,r)=>{const o=e._zod.def;nt(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},lI=(e,t,n,r)=>{const o=e._zod.def;nt(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},cI=(e,t,n,r)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;nt(i,t,r);const a=t.seen.get(e);a.ref=i},uI=(e,t,n,r)=>{const o=e._zod.def;nt(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},kp=(e,t,n,r)=>{const o=e._zod.def;nt(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},dI=(e,t,n,r)=>{const o=e._zod.innerType;nt(o,t,r);const i=t.seen.get(e);i.ref=o},fI=j("ZodISODateTime",(e,t)=>{iT.init(e,t),tt.init(e,t)});function pI(e){return mA(fI,e)}const mI=j("ZodISODate",(e,t)=>{aT.init(e,t),tt.init(e,t)});function hI(e){return hA(mI,e)}const gI=j("ZodISOTime",(e,t)=>{sT.init(e,t),tt.init(e,t)});function bI(e){return gA(gI,e)}const vI=j("ZodISODuration",(e,t)=>{lT.init(e,t),tt.init(e,t)});function yI(e){return bA(vI,e)}const xI=(e,t)=>{ap.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>XN(e,n)},flatten:{value:n=>YN(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ls,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ls,2)}},isEmpty:{get(){return e.issues.length===0}}})},qt=j("ZodError",xI,{Parent:Error}),wI=al(qt),_I=sl(qt),EI=Ti(qt),SI=Ai(qt),kI=eC(qt),NI=tC(qt),CI=nC(qt),TI=rC(qt),AI=oC(qt),II=iC(qt),RI=aC(qt),OI=sC(qt),Ye=j("ZodType",(e,t)=>(qe.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:fi(e,"input"),output:fi(e,"output")}}),e.toJSONSchema=FA(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(In(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Rn(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>wI(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>EI(e,n,r),e.parseAsync=async(n,r)=>_I(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>SI(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>kI(e,n,r),e.decode=(n,r)=>NI(e,n,r),e.encodeAsync=async(n,r)=>CI(e,n,r),e.decodeAsync=async(n,r)=>TI(e,n,r),e.safeEncode=(n,r)=>AI(e,n,r),e.safeDecode=(n,r)=>II(e,n,r),e.safeEncodeAsync=async(n,r)=>RI(e,n,r),e.safeDecodeAsync=async(n,r)=>OI(e,n,r),e.refine=(n,r)=>e.check(RR(n,r)),e.superRefine=n=>e.check(OR(n)),e.overwrite=n=>e.check(Cr(n)),e.optional=()=>$u(e),e.exactOptional=()=>gR(e),e.nullable=()=>zu(e),e.nullish=()=>$u(zu(e)),e.nonoptional=n=>_R(e,n),e.array=()=>bt(e),e.or=n=>mn([e,n]),e.and=n=>uR(e,n),e.transform=n=>ju(e,mR(n)),e.default=n=>yR(e,n),e.prefault=n=>wR(e,n),e.catch=n=>SR(e,n),e.pipe=n=>ju(e,n),e.readonly=()=>CR(e),e.describe=n=>{const r=e.clone();return Br.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Br.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Br.get(e);const r=e.clone();return Br.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Np=j("_ZodString",(e,t)=>{ll.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(r,o,i)=>UA(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(kA(...r)),e.includes=(...r)=>e.check(TA(...r)),e.startsWith=(...r)=>e.check(AA(...r)),e.endsWith=(...r)=>e.check(IA(...r)),e.min=(...r)=>e.check(di(...r)),e.max=(...r)=>e.check(xp(...r)),e.length=(...r)=>e.check(wp(...r)),e.nonempty=(...r)=>e.check(di(1,...r)),e.lowercase=r=>e.check(NA(r)),e.uppercase=r=>e.check(CA(r)),e.trim=()=>e.check(OA()),e.normalize=(...r)=>e.check(RA(...r)),e.toLowerCase=()=>e.check(MA()),e.toUpperCase=()=>e.check(PA()),e.slugify=()=>e.check(DA())}),MI=j("ZodString",(e,t)=>{ll.init(e,t),Np.init(e,t),e.email=n=>e.check(KT(PI,n)),e.url=n=>e.check(JT(DI,n)),e.jwt=n=>e.check(pA(YI,n)),e.emoji=n=>e.check(QT(LI,n)),e.guid=n=>e.check(Ru(Du,n)),e.uuid=n=>e.check(WT(Bo,n)),e.uuidv4=n=>e.check(qT(Bo,n)),e.uuidv6=n=>e.check(YT(Bo,n)),e.uuidv7=n=>e.check(XT(Bo,n)),e.nanoid=n=>e.check(eA($I,n)),e.guid=n=>e.check(Ru(Du,n)),e.cuid=n=>e.check(tA(zI,n)),e.cuid2=n=>e.check(nA(jI,n)),e.ulid=n=>e.check(rA(FI,n)),e.base64=n=>e.check(uA(KI,n)),e.base64url=n=>e.check(dA(WI,n)),e.xid=n=>e.check(oA(BI,n)),e.ksuid=n=>e.check(iA(UI,n)),e.ipv4=n=>e.check(aA(HI,n)),e.ipv6=n=>e.check(sA(VI,n)),e.cidrv4=n=>e.check(lA(GI,n)),e.cidrv6=n=>e.check(cA(ZI,n)),e.e164=n=>e.check(fA(qI,n)),e.datetime=n=>e.check(pI(n)),e.date=n=>e.check(hI(n)),e.time=n=>e.check(bI(n)),e.duration=n=>e.check(yI(n))});function U(e){return ZT(MI,e)}const tt=j("ZodStringFormat",(e,t)=>{Xe.init(e,t),Np.init(e,t)}),PI=j("ZodEmail",(e,t)=>{YC.init(e,t),tt.init(e,t)}),Du=j("ZodGUID",(e,t)=>{WC.init(e,t),tt.init(e,t)}),Bo=j("ZodUUID",(e,t)=>{qC.init(e,t),tt.init(e,t)}),DI=j("ZodURL",(e,t)=>{XC.init(e,t),tt.init(e,t)}),LI=j("ZodEmoji",(e,t)=>{JC.init(e,t),tt.init(e,t)}),$I=j("ZodNanoID",(e,t)=>{QC.init(e,t),tt.init(e,t)}),zI=j("ZodCUID",(e,t)=>{eT.init(e,t),tt.init(e,t)}),jI=j("ZodCUID2",(e,t)=>{tT.init(e,t),tt.init(e,t)}),FI=j("ZodULID",(e,t)=>{nT.init(e,t),tt.init(e,t)}),BI=j("ZodXID",(e,t)=>{rT.init(e,t),tt.init(e,t)}),UI=j("ZodKSUID",(e,t)=>{oT.init(e,t),tt.init(e,t)}),HI=j("ZodIPv4",(e,t)=>{cT.init(e,t),tt.init(e,t)}),VI=j("ZodIPv6",(e,t)=>{uT.init(e,t),tt.init(e,t)}),GI=j("ZodCIDRv4",(e,t)=>{dT.init(e,t),tt.init(e,t)}),ZI=j("ZodCIDRv6",(e,t)=>{fT.init(e,t),tt.init(e,t)}),KI=j("ZodBase64",(e,t)=>{pT.init(e,t),tt.init(e,t)}),WI=j("ZodBase64URL",(e,t)=>{hT.init(e,t),tt.init(e,t)}),qI=j("ZodE164",(e,t)=>{gT.init(e,t),tt.init(e,t)}),YI=j("ZodJWT",(e,t)=>{vT.init(e,t),tt.init(e,t)}),Cp=j("ZodNumber",(e,t)=>{gp.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(r,o,i)=>HA(e,r,o),e.gt=(r,o)=>e.check(Mu(r,o)),e.gte=(r,o)=>e.check(Da(r,o)),e.min=(r,o)=>e.check(Da(r,o)),e.lt=(r,o)=>e.check(Ou(r,o)),e.lte=(r,o)=>e.check(Pa(r,o)),e.max=(r,o)=>e.check(Pa(r,o)),e.int=r=>e.check(Lu(r)),e.safe=r=>e.check(Lu(r)),e.positive=r=>e.check(Mu(0,r)),e.nonnegative=r=>e.check(Da(0,r)),e.negative=r=>e.check(Ou(0,r)),e.nonpositive=r=>e.check(Pa(0,r)),e.multipleOf=(r,o)=>e.check(Pu(r,o)),e.step=(r,o)=>e.check(Pu(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Et(e){return vA(Cp,e)}const XI=j("ZodNumberFormat",(e,t)=>{yT.init(e,t),Cp.init(e,t)});function Lu(e){return yA(XI,e)}const JI=j("ZodBoolean",(e,t)=>{xT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>VA(e,n,r)});function Gt(e){return xA(JI,e)}const QI=j("ZodNull",(e,t)=>{wT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>GA(e,n,r)});function eR(e){return wA(QI,e)}const tR=j("ZodAny",(e,t)=>{_T.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>KA()});function nR(){return _A(tR)}const rR=j("ZodUnknown",(e,t)=>{ET.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>WA()});function fn(){return EA(rR)}const oR=j("ZodNever",(e,t)=>{ST.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ZA(e,n,r)});function iR(e){return SA(oR,e)}const aR=j("ZodArray",(e,t)=>{kT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>QA(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(di(n,r)),e.nonempty=n=>e.check(di(1,n)),e.max=(n,r)=>e.check(xp(n,r)),e.length=(n,r)=>e.check(wp(n,r)),e.unwrap=()=>e.element});function bt(e,t){return LA(aR,e,t)}const sR=j("ZodObject",(e,t)=>{CT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>eI(e,n,r,o),De(e,"shape",()=>t.shape),e.keyof=()=>Je(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fn()}),e.loose=()=>e.clone({...e._zod.def,catchall:fn()}),e.strict=()=>e.clone({...e._zod.def,catchall:iR()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>GN(e,n),e.safeExtend=n=>ZN(e,n),e.merge=n=>KN(e,n),e.pick=n=>HN(e,n),e.omit=n=>VN(e,n),e.partial=(...n)=>WN(Tp,e,n[0]),e.required=(...n)=>qN(Ap,e,n[0])});function ae(e,t){const n={type:"object",shape:e??{},...de(t)};return new sR(n)}const lR=j("ZodUnion",(e,t)=>{TT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tI(e,n,r,o),e.options=t.options});function mn(e,t){return new lR({type:"union",options:e,...de(t)})}const cR=j("ZodIntersection",(e,t)=>{AT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nI(e,n,r,o)});function uR(e,t){return new cR({type:"intersection",left:e,right:t})}const dR=j("ZodRecord",(e,t)=>{IT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rI(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Sn(e,t,n){return new dR({type:"record",keyType:e,valueType:t,...de(n)})}const us=j("ZodEnum",(e,t)=>{RT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(r,o,i)=>qA(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const a of r)if(n.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new us({...t,checks:[],...de(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new us({...t,checks:[],...de(o),entries:i})}});function Je(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new us({type:"enum",entries:n,...de(t)})}const fR=j("ZodLiteral",(e,t)=>{OT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>YA(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function cl(e,t){return new fR({type:"literal",values:Array.isArray(e)?e:[e],...de(t)})}const pR=j("ZodTransform",(e,t)=>{MT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>JA(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ep(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Jr(i,n.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(Jr(a))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function mR(e){return new pR({type:"transform",transform:e})}const Tp=j("ZodOptional",(e,t)=>{yp.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function $u(e){return new Tp({type:"optional",innerType:e})}const hR=j("ZodExactOptional",(e,t)=>{PT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function gR(e){return new hR({type:"optional",innerType:e})}const bR=j("ZodNullable",(e,t)=>{DT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>oI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function zu(e){return new bR({type:"nullable",innerType:e})}const vR=j("ZodDefault",(e,t)=>{LT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>aI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yR(e,t){return new vR({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():op(t)}})}const xR=j("ZodPrefault",(e,t)=>{$T.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function wR(e,t){return new xR({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():op(t)}})}const Ap=j("ZodNonOptional",(e,t)=>{zT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>iI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function _R(e,t){return new Ap({type:"nonoptional",innerType:e,...de(t)})}const ER=j("ZodCatch",(e,t)=>{jT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function SR(e,t){return new ER({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const kR=j("ZodPipe",(e,t)=>{FT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cI(e,n,r,o),e.in=t.in,e.out=t.out});function ju(e,t){return new kR({type:"pipe",in:e,out:t})}const NR=j("ZodReadonly",(e,t)=>{BT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>uI(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function CR(e){return new NR({type:"readonly",innerType:e})}const TR=j("ZodLazy",(e,t)=>{UT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dI(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function AR(e){return new TR({type:"lazy",getter:e})}const IR=j("ZodCustom",(e,t)=>{HT.init(e,t),Ye.init(e,t),e._zod.processJSONSchema=(n,r,o)=>XA(e,n)});function RR(e,t={}){return $A(IR,e,t)}function OR(e){return zA(e)}var Ip=mn([U(),Et(),Gt(),eR(),ae({$state:U()})]);mn([U(),ae({$state:U()})]);mn([Et(),ae({$state:U()})]);mn([Gt(),ae({$state:U()})]);function MR(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function PR(e){return(e.startsWith("/")?e.slice(1).split("/"):e.split("/")).map(MR)}function Qt(e,t){if(!t||t==="/")return e;const n=PR(t);let r=e;for(const o of n){if(r==null)return;if(Array.isArray(r)){const i=parseInt(o,10);r=r[i]}else if(typeof r=="object")r=r[o];else return}return r}var Uo=mn([Et(),ae({$state:U()})]),ul={eq:fn().optional(),neq:fn().optional(),gt:Uo.optional(),gte:Uo.optional(),lt:Uo.optional(),lte:Uo.optional(),not:cl(!0).optional()},DR=ae({$state:U(),...ul}),LR=ae({$item:U(),...ul}),$R=ae({$index:cl(!0),...ul}),Fu=mn([DR,LR,$R]),ds=AR(()=>mn([Gt(),Fu,bt(Fu),ae({$and:bt(ds)}),ae({$or:bt(ds)})]));function rr(e,t){return typeof e=="object"&&e!==null&&"$state"in e&&typeof e.$state=="string"?Qt(t.stateModel,e.$state):e}function zR(e){return"$item"in e}function jR(e){return"$index"in e}function FR(e,t){return jR(e)?t.repeatIndex:zR(e)?t.repeatItem===void 0?void 0:e.$item===""?t.repeatItem:Qt(t.repeatItem,e.$item):Qt(t.stateModel,e.$state)}function Bu(e,t){const n=FR(e,t);let r;if(e.eq!==void 0){const o=rr(e.eq,t);r=n===o}else if(e.neq!==void 0){const o=rr(e.neq,t);r=n!==o}else if(e.gt!==void 0){const o=rr(e.gt,t);r=typeof n=="number"&&typeof o=="number"?n>o:!1}else if(e.gte!==void 0){const o=rr(e.gte,t);r=typeof n=="number"&&typeof o=="number"?n>=o:!1}else if(e.lt!==void 0){const o=rr(e.lt,t);r=typeof n=="number"&&typeof o=="number"?n<o:!1}else if(e.lte!==void 0){const o=rr(e.lte,t);r=typeof n=="number"&&typeof o=="number"?n<=o:!1}else r=!!n;return e.not===!0?!r:r}function BR(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"$and"in e}function UR(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&"$or"in e}function pi(e,t){return e===void 0?!0:typeof e=="boolean"?e:Array.isArray(e)?e.every(n=>Bu(n,t)):BR(e)?e.$and.every(n=>pi(n,t)):UR(e)?e.$or.some(n=>pi(n,t)):Bu(e,t)}function HR(e){return typeof e=="object"&&e!==null&&"$state"in e&&typeof e.$state=="string"}function Rp(e){return typeof e=="object"&&e!==null&&"$item"in e&&typeof e.$item=="string"}function Op(e){return typeof e=="object"&&e!==null&&"$index"in e&&e.$index===!0}function Mp(e){return typeof e=="object"&&e!==null&&"$bindState"in e&&typeof e.$bindState=="string"}function Pp(e){return typeof e=="object"&&e!==null&&"$bindItem"in e&&typeof e.$bindItem=="string"}function VR(e){return typeof e=="object"&&e!==null&&"$cond"in e&&"$then"in e&&"$else"in e}function GR(e){return typeof e=="object"&&e!==null&&"$computed"in e&&typeof e.$computed=="string"}function ZR(e){return typeof e=="object"&&e!==null&&"$template"in e&&typeof e.$template=="string"}var KR=100,La=new Set,WR=100,$a=new Set;function dl(e,t){if(t.repeatBasePath==null){console.warn(`$bindItem used outside repeat scope: "${e}"`);return}return e===""?t.repeatBasePath:t.repeatBasePath+"/"+e}function gr(e,t){if(e==null)return e;if(HR(e))return Qt(t.stateModel,e.$state);if(Rp(e))return t.repeatItem===void 0?void 0:e.$item===""?t.repeatItem:Qt(t.repeatItem,e.$item);if(Op(e))return t.repeatIndex;if(Mp(e))return Qt(t.stateModel,e.$bindState);if(Pp(e)){const n=dl(e.$bindItem,t);return n===void 0?void 0:Qt(t.stateModel,n)}if(VR(e)){const n=pi(e.$cond,t);return gr(n?e.$then:e.$else,t)}if(GR(e)){const n=t.functions?.[e.$computed];if(!n){La.has(e.$computed)||(La.size<KR&&La.add(e.$computed),console.warn(`Unknown $computed function: "${e.$computed}"`));return}const r={};if(e.args)for(const[o,i]of Object.entries(e.args))r[o]=gr(i,t);return n(r)}if(ZR(e))return e.$template.replace(/\$\{([^}]+)\}/g,(n,r)=>{let o=r;o.startsWith("/")||($a.has(o)||($a.size<WR&&$a.add(o),console.warn(`$template path "${o}" should be a JSON Pointer starting with "/". Automatically resolving as "/${o}".`)),o="/"+o);const i=Qt(t.stateModel,o);return i!=null?String(i):""});if(Array.isArray(e))return e.map(n=>gr(n,t));if(typeof e=="object"){const n={};for(const[r,o]of Object.entries(e))n[r]=gr(o,t);return n}return e}function qR(e,t){const n={};for(const[r,o]of Object.entries(e))n[r]=gr(o,t);return n}function YR(e,t){let n;for(const[r,o]of Object.entries(e))if(Mp(o))n||(n={}),n[r]=o.$bindState;else if(Pp(o)){const i=dl(o.$bindItem,t);i!==void 0&&(n||(n={}),n[r]=i)}return n}function Uu(e,t){return Rp(e)?dl(e.$item,t):Op(e)?t.repeatIndex:gr(e,t)}var XR=ae({title:U(),message:U(),confirmLabel:U().optional(),cancelLabel:U().optional(),variant:Je(["default","danger"]).optional()}),JR=mn([ae({navigate:U()}),ae({set:Sn(U(),fn())}),ae({action:U()})]),QR=mn([ae({set:Sn(U(),fn())}),ae({action:U()})]);ae({action:U(),params:Sn(U(),Ip).optional(),confirm:XR.optional(),onSuccess:JR.optional(),onError:QR.optional(),preventDefault:Gt().optional()});var eO=ae({type:U(),args:Sn(U(),Ip).optional(),message:U()});ae({checks:bt(eO).optional(),validateOn:Je(["change","blur","submit"]).optional(),enabled:ds.optional()});function tO(){return{string:()=>({kind:"string"}),number:()=>({kind:"number"}),boolean:()=>({kind:"boolean"}),array:e=>({kind:"array",inner:e}),object:e=>({kind:"object",inner:e}),record:e=>({kind:"record",inner:e}),any:()=>({kind:"any"}),zod:()=>({kind:"zod"}),ref:e=>({kind:"ref",inner:e}),propsOf:e=>({kind:"propsOf",inner:e}),map:e=>({kind:"map",inner:e}),optional:()=>({optional:!0})}}function nO(e,t){const n=tO();return{definition:e(n),promptTemplate:t?.promptTemplate,defaultRules:t?.defaultRules,builtInActions:t?.builtInActions,createCatalog(o){return rO(this,o)}}}function rO(e,t){const n=t.components,r=t.actions,o=n?Object.keys(n):[],i=r?Object.keys(r):[],a=oO(e.definition,t);return{schema:e,data:t,componentNames:o,actionNames:i,prompt(s={}){return sO(this,s)},jsonSchema(){return pr(a)},validate(s){const l=a.safeParse(s);return l.success?{success:!0,data:l.data}:{success:!1,error:l.error}},zodSchema(){return a},get _specType(){throw new Error("_specType is only for type inference")}}}function oO(e,t){return Jo(e.spec,t)}function Jo(e,t){switch(e.kind){case"string":return U();case"number":return Et();case"boolean":return Gt();case"any":return nR();case"array":{const n=Jo(e.inner,t);return bt(n)}case"object":{const n=e.inner,r={};for(const[o,i]of Object.entries(n)){let a=Jo(i,t);i.optional&&(a=a.optional()),r[o]=a}return ae(r)}case"record":{const n=Jo(e.inner,t);return Sn(U(),n)}case"ref":{const n=e.inner,r=iO(n,t);return r.length===0?U():r.length===1?cl(r[0]):Je(r)}case"propsOf":{const n=e.inner,r=aO(n,t);return r.length===0?Sn(U(),fn()):r.length===1?r[0]:Sn(U(),fn())}default:return fn()}}function iO(e,t){const n=e.split(".");let r={catalog:t};for(const o of n)if(r&&typeof r=="object")r=r[o];else return[];return r&&typeof r=="object"?Object.keys(r):[]}function aO(e,t){const n=e.split(".");let r={catalog:t};for(const o of n)if(r&&typeof r=="object")r=r[o];else return[];return r&&typeof r=="object"?Object.values(r).map(o=>o.props).filter(o=>o!==void 0):[]}function sO(e,t){if(e.schema.promptTemplate){const I={catalog:e.data,componentNames:e.componentNames,actionNames:e.actionNames,options:t,formatZodType:Un};return e.schema.promptTemplate(I)}const{system:n="You are a UI generator that outputs JSON.",customRules:r=[],mode:o="generate"}=t,i=[];i.push(n),i.push(""),o==="chat"?(i.push("OUTPUT FORMAT (text + JSONL, RFC 6902 JSON Patch):"),i.push("You respond conversationally. When generating UI, first write a brief explanation (1-3 sentences), then output JSONL patch lines wrapped in a ```spec code fence."),i.push("The JSONL lines use RFC 6902 JSON Patch operations to build a UI tree. Always wrap them in a ```spec fence block:"),i.push(" ```spec"),i.push(' {"op":"add","path":"/root","value":"main"}'),i.push(' {"op":"add","path":"/elements/main","value":{"type":"Card","props":{"title":"Hello"},"children":[]}}'),i.push(" ```"),i.push("If the user's message does not require a UI (e.g. a greeting or clarifying question), respond with text only — no JSONL.")):(i.push("OUTPUT FORMAT (JSONL, RFC 6902 JSON Patch):"),i.push("Output JSONL (one JSON object per line) using RFC 6902 JSON Patch operations to build a UI tree.")),i.push("Each line is a JSON patch operation (add, remove, replace). Start with /root, then stream /elements and /state patches interleaved so the UI fills in progressively as it streams."),i.push(""),i.push("Example output (each line is a separate JSON object):"),i.push("");const a=e.data.components,s=e.componentNames,l=s[0]||"Component",c=s.length>1?s[1]:l,u=a?.[l],d=a?.[c],p=u?Hu(u):{},m=d?Hu(d):{},b=d?.props?lO(d.props):null,h=b?{...m,[b]:{$item:"title"}}:m,y=[JSON.stringify({op:"add",path:"/root",value:"main"}),JSON.stringify({op:"add",path:"/elements/main",value:{type:l,props:p,children:["child-1","list"]}}),JSON.stringify({op:"add",path:"/elements/child-1",value:{type:c,props:m,children:[]}}),JSON.stringify({op:"add",path:"/elements/list",value:{type:l,props:p,repeat:{statePath:"/items",key:"id"},children:["item"]}}),JSON.stringify({op:"add",path:"/elements/item",value:{type:c,props:h,children:[]}}),JSON.stringify({op:"add",path:"/state/items",value:[]}),JSON.stringify({op:"add",path:"/state/items/0",value:{id:"1",title:"First Item"}}),JSON.stringify({op:"add",path:"/state/items/1",value:{id:"2",title:"Second Item"}})].join(`
77
- `);i.push(`${y}
78
-
79
- Note: state patches appear right after the elements that use them, so the UI fills in as it streams. ONLY use component types from the AVAILABLE COMPONENTS list below.`),i.push(""),i.push("INITIAL STATE:"),i.push("Specs include a /state field to seed the state model. Components with { $bindState } or { $bindItem } read from and write to this state, and $state expressions read from it."),i.push("CRITICAL: You MUST include state patches whenever your UI displays data via $state, $bindState, $bindItem, $item, or $index expressions, or uses repeat to iterate over arrays. Without state, these references resolve to nothing and repeat lists render zero items."),i.push("Output state patches right after the elements that reference them, so the UI fills in progressively as it streams."),i.push("Stream state progressively - output one patch per array item instead of one giant blob:"),i.push(' For arrays: {"op":"add","path":"/state/posts/0","value":{"id":"1","title":"First Post",...}} then /state/posts/1, /state/posts/2, etc.'),i.push(' For scalars: {"op":"add","path":"/state/newTodoText","value":""}'),i.push(' Initialize the array first if needed: {"op":"add","path":"/state/posts","value":[]}'),i.push('When content comes from the state model, use { "$state": "/some/path" } dynamic props to display it instead of hardcoding the same value in both state and props. The state model is the single source of truth.'),i.push("Include realistic sample data in state. For blogs: 3-4 posts with titles, excerpts, authors, dates. For product lists: 3-5 items with names, prices, descriptions. Never leave arrays empty."),i.push(""),i.push("DYNAMIC LISTS (repeat field):"),i.push('Any element can have a top-level "repeat" field to render its children once per item in a state array: { "repeat": { "statePath": "/arrayPath", "key": "id" } }.'),i.push('The element itself renders once (as the container), and its children are expanded once per array item. "statePath" is the state array path. "key" is an optional field name on each item for stable React keys.'),i.push(`Example: ${JSON.stringify({type:l,props:p,repeat:{statePath:"/todos",key:"id"},children:["todo-item"]})}`),i.push('Inside children of a repeated element, use { "$item": "field" } to read a field from the current item, and { "$index": true } to get the current array index. For two-way binding to an item field use { "$bindItem": "completed" } on the appropriate prop.'),i.push("ALWAYS use the repeat field for lists backed by state arrays. NEVER hardcode individual elements for each array item."),i.push('IMPORTANT: "repeat" is a top-level field on the element (sibling of type/props/children), NOT inside props.'),i.push(""),i.push("ARRAY STATE ACTIONS:"),i.push('Use action "pushState" to append items to arrays. Params: { statePath: "/arrayPath", value: { ...item }, clearStatePath: "/inputPath" }.'),i.push('Values inside pushState can contain { "$state": "/statePath" } references to read current state (e.g. the text from an input field).'),i.push('Use "$id" inside a pushState value to auto-generate a unique ID.'),i.push('Example: on: { "press": { "action": "pushState", "params": { "statePath": "/todos", "value": { "id": "$id", "title": { "$state": "/newTodoText" }, "completed": false }, "clearStatePath": "/newTodoText" } } }'),i.push(`Use action "removeState" to remove items from arrays by index. Params: { statePath: "/arrayPath", index: N }. Inside a repeated element's children, use { "$index": true } for the current item index. Action params support the same expressions as props: { "$item": "field" } resolves to the absolute state path, { "$index": true } resolves to the index number, and { "$state": "/path" } reads a value from state.`),i.push("For lists where users can add/remove items (todos, carts, etc.), use pushState and removeState instead of hardcoding with setState."),i.push(""),i.push('IMPORTANT: State paths use RFC 6901 JSON Pointer syntax (e.g. "/todos/0/title"). Do NOT use JavaScript-style dot notation (e.g. "/todos.length" is WRONG). To generate unique IDs for new items, use "$id" instead of trying to read array length.'),i.push("");const v=a;if(v){i.push(`AVAILABLE COMPONENTS (${e.componentNames.length}):`),i.push("");for(const[I,O]of Object.entries(v)){const D=O.props?Un(O.props):"{}",P=O.slots&&O.slots.length>0?" [accepts children]":"",F=O.events&&O.events.length>0?` [events: ${O.events.join(", ")}]`:"",K=O.description?` - ${O.description}`:"";i.push(`- ${I}: ${D}${K}${P}${F}`)}i.push("")}const x=e.data.actions,w=e.schema.builtInActions??[],_=x&&e.actionNames.length>0,C=w.length>0;if(_||C){i.push("AVAILABLE ACTIONS:"),i.push("");for(const I of w)i.push(`- ${I.name}: ${I.description} [built-in]`);if(_)for(const[I,O]of Object.entries(x))i.push(`- ${I}${O.description?`: ${O.description}`:""}`);i.push("")}i.push("EVENTS (the `on` field):"),i.push("Elements can have an optional `on` field to bind events to actions. The `on` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),i.push('Each key in `on` is an event name (from the component\'s supported events), and the value is an action binding: `{ "action": "<actionName>", "params": { ... } }`.'),i.push(""),i.push("Example:"),i.push(` ${JSON.stringify({type:l,props:p,on:{press:{action:"setState",params:{statePath:"/saved",value:!0}}},children:[]})}`),i.push(""),i.push('Action params can use dynamic references to read from state: { "$state": "/statePath" }.'),i.push("IMPORTANT: Do NOT put action/actionParams inside props. Always use the `on` field for event bindings."),i.push(""),i.push("VISIBILITY CONDITIONS:"),i.push("Elements can have an optional `visible` field to conditionally show/hide based on state. IMPORTANT: `visible` is a top-level field on the element object (sibling of type/props/children), NOT inside props."),i.push(`Correct: ${JSON.stringify({type:l,props:p,visible:{$state:"/activeTab",eq:"home"},children:["..."]})}`),i.push('- `{ "$state": "/path" }` - visible when state at path is truthy'),i.push('- `{ "$state": "/path", "not": true }` - visible when state at path is falsy'),i.push('- `{ "$state": "/path", "eq": "value" }` - visible when state equals value'),i.push('- `{ "$state": "/path", "neq": "value" }` - visible when state does not equal value'),i.push('- `{ "$state": "/path", "gt": N }` / `gte` / `lt` / `lte` - numeric comparisons'),i.push("- Use ONE operator per condition (eq, neq, gt, gte, lt, lte). Do not combine multiple operators."),i.push('- Any condition can add `"not": true` to invert its result'),i.push("- `[condition, condition]` - all conditions must be true (implicit AND)"),i.push('- `{ "$and": [condition, condition] }` - explicit AND (use when nesting inside $or)'),i.push('- `{ "$or": [condition, condition] }` - at least one must be true (OR)'),i.push("- `true` / `false` - always visible/hidden"),i.push(""),i.push("Use a component with on.press bound to setState to update state and drive visibility."),i.push(`Example: A ${l} with on: { "press": { "action": "setState", "params": { "statePath": "/activeTab", "value": "home" } } } sets state, then a container with visible: { "$state": "/activeTab", "eq": "home" } shows only when that tab is active.`),i.push(""),i.push('For tab patterns where the first/default tab should be visible when no tab is selected yet, use $or to handle both cases: visible: { "$or": [{ "$state": "/activeTab", "eq": "home" }, { "$state": "/activeTab", "not": true }] }. This ensures the first tab is visible both when explicitly selected AND when /activeTab is not yet set.'),i.push(""),i.push("DYNAMIC PROPS:"),i.push("Any prop value can be a dynamic expression that resolves based on state. Three forms are supported:"),i.push(""),i.push('1. Read-only state: `{ "$state": "/statePath" }` - resolves to the value at that state path (one-way read).'),i.push(' Example: `"color": { "$state": "/theme/primary" }` reads the color from state.'),i.push(""),i.push('2. Two-way binding: `{ "$bindState": "/statePath" }` - resolves to the value at the state path AND enables write-back. Use on form input props (value, checked, pressed, etc.).'),i.push(' Example: `"value": { "$bindState": "/form/email" }` binds the input value to /form/email.'),i.push(' Inside repeat scopes: `"checked": { "$bindItem": "completed" }` binds to the current item\'s completed field.'),i.push(""),i.push('3. Conditional: `{ "$cond": <condition>, "$then": <value>, "$else": <value> }` - evaluates the condition (same syntax as visibility conditions) and picks the matching value.'),i.push(' Example: `"color": { "$cond": { "$state": "/activeTab", "eq": "home" }, "$then": "#007AFF", "$else": "#8E8E93" }`'),i.push(""),i.push("Use $bindState for form inputs (text fields, checkboxes, selects, sliders, etc.) and $state for read-only data display. Inside repeat scopes, use $bindItem for form inputs bound to the current item. Use dynamic props instead of duplicating elements with opposing visible conditions when only prop values differ."),i.push(""),i.push('4. Template: `{ "$template": "Hello, ${/name}!" }` - interpolates `${/path}` references in the string with values from the state model.'),i.push(' Example: `"label": { "$template": "Items: ${/cart/count} | Total: ${/cart/total}" }` renders "Items: 3 | Total: 42.00" when /cart/count is 3 and /cart/total is 42.00.'),i.push("");const E=e.data.functions;if(E&&Object.keys(E).length>0){i.push('5. Computed: `{ "$computed": "<functionName>", "args": { "key": <expression> } }` - calls a registered function with resolved args and returns the result.'),i.push(' Example: `"value": { "$computed": "fullName", "args": { "first": { "$state": "/form/firstName" }, "last": { "$state": "/form/lastName" } } }`'),i.push(" Available functions:");for(const I of Object.keys(E))i.push(` - ${I}`);i.push("")}a&&Object.entries(a).some(([,I])=>I.props?Un(I.props).includes("checks"):!1)&&(i.push("VALIDATION:"),i.push("Form components that accept a `checks` prop support client-side validation."),i.push('Each check is an object: { "type": "<name>", "message": "...", "args": { ... } }'),i.push(""),i.push("Built-in validation types:"),i.push(" - required — value must be non-empty"),i.push(" - email — valid email format"),i.push(' - minLength — minimum string length (args: { "min": N })'),i.push(' - maxLength — maximum string length (args: { "max": N })'),i.push(' - pattern — match a regex (args: { "pattern": "regex" })'),i.push(' - min — minimum numeric value (args: { "min": N })'),i.push(' - max — maximum numeric value (args: { "max": N })'),i.push(" - numeric — value must be a number"),i.push(" - url — valid URL format"),i.push(' - matches — must equal another field (args: { "other": { "$state": "/path" } })'),i.push(' - equalTo — alias for matches (args: { "other": { "$state": "/path" } })'),i.push(' - lessThan — value must be less than another field (args: { "other": { "$state": "/path" } })'),i.push(' - greaterThan — value must be greater than another field (args: { "other": { "$state": "/path" } })'),i.push(' - requiredIf — required only when another field is truthy (args: { "field": { "$state": "/path" } })'),i.push(""),i.push("Example:"),i.push(' "checks": [{ "type": "required", "message": "Email is required" }, { "type": "email", "message": "Invalid email" }]'),i.push(""),i.push("IMPORTANT: When using checks, the component must also have a { $bindState } or { $bindItem } on its value/checked prop for two-way binding."),i.push("Always include validation checks on form inputs for a good user experience (e.g. required, email, minLength)."),i.push("")),(_||C)&&(i.push("STATE WATCHERS:"),i.push("Elements can have an optional `watch` field to react to state changes and trigger actions. The `watch` field is a top-level field on the element (sibling of type/props/children), NOT inside props."),i.push("Maps state paths (JSON Pointers) to action bindings. When the value at a watched path changes, the bound actions fire automatically."),i.push(""),i.push("Example (cascading select — country changes trigger city loading):"),i.push(` ${JSON.stringify({type:"Select",props:{value:{$bindState:"/form/country"},options:["US","Canada","UK"]},watch:{"/form/country":{action:"loadCities",params:{country:{$state:"/form/country"}}}},children:[]})}`),i.push(""),i.push("Use `watch` for cascading dependencies where changing one field should trigger side effects (loading data, resetting dependent fields, computing derived values)."),i.push("IMPORTANT: `watch` is a top-level field on the element (sibling of type/props/children), NOT inside props. Watchers only fire when the value changes, not on initial render."),i.push("")),i.push("RULES:");const R=o==="chat"?["When generating UI, wrap all JSONL patches in a ```spec code fence - one JSON object per line inside the fence","Write a brief conversational response before any JSONL output",'First set root: {"op":"add","path":"/root","value":"<root-key>"}','Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}',"Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.","ONLY use components listed above","Each element value needs: type, props, children (array of child keys)","Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')"]:["Output ONLY JSONL patches - one JSON object per line, no markdown, no code fences",'First set root: {"op":"add","path":"/root","value":"<root-key>"}','Then add each element: {"op":"add","path":"/elements/<key>","value":{...}}',"Output /state patches right after the elements that use them, one per array item for progressive loading. REQUIRED whenever using $state, $bindState, $bindItem, $item, $index, or repeat.","ONLY use components listed above","Each element value needs: type, props, children (array of child keys)","Use unique keys for the element map entries (e.g., 'header', 'metric-1', 'chart-revenue')"],M=e.schema.defaultRules??[];return[...R,...M,...r].forEach((I,O)=>{i.push(`${O+1}. ${I}`)}),i.join(`
80
- `)}function Hu(e){return e.example&&Object.keys(e.example).length>0?e.example:e.props?Dp(e.props):{}}function Dp(e){if(!e||!e._def)return{};const t=e._def,n=Gn(e);if(n!=="ZodObject"&&n!=="object")return{};const r=typeof t.shape=="function"?t.shape():t.shape;if(!r)return{};const o={};for(const[i,a]of Object.entries(r)){const s=Gn(a);s==="ZodOptional"||s==="optional"||s==="ZodNullable"||s==="nullable"||(o[i]=fs(a))}return o}function fs(e){if(!e||!e._def)return"...";const t=e._def;switch(Gn(e)){case"ZodString":case"string":return"example";case"ZodNumber":case"number":return 0;case"ZodBoolean":case"boolean":return!0;case"ZodLiteral":case"literal":return t.value;case"ZodEnum":case"enum":{if(Array.isArray(t.values)&&t.values.length>0)return t.values[0];if(t.entries&&typeof t.entries=="object"){const r=Object.values(t.entries);return r.length>0?r[0]:"example"}return"example"}case"ZodOptional":case"optional":case"ZodNullable":case"nullable":case"ZodDefault":case"default":{const r=t.innerType??t.wrapped;return r?fs(r):null}case"ZodArray":case"array":return[];case"ZodObject":case"object":return Dp(e);case"ZodUnion":case"union":{const r=t.options;return r&&r.length>0?fs(r[0]):"..."}default:return"..."}}function lO(e){if(!e||!e._def)return null;const t=e._def,n=Gn(e);if(n!=="ZodObject"&&n!=="object")return null;const r=typeof t.shape=="function"?t.shape():t.shape;if(!r)return null;for(const[o,i]of Object.entries(r)){const a=Gn(i);if(!(a==="ZodOptional"||a==="optional"||a==="ZodNullable"||a==="nullable")&&(a==="ZodString"||a==="string"))return o}return null}function Gn(e){if(!e||!e._def)return"";const t=e._def;return t.typeName??t.type??""}function Un(e){if(!e||!e._def)return"unknown";const t=e._def;switch(Gn(e)){case"ZodString":case"string":return"string";case"ZodNumber":case"number":return"number";case"ZodBoolean":case"boolean":return"boolean";case"ZodLiteral":case"literal":return JSON.stringify(t.value);case"ZodEnum":case"enum":{let r;if(Array.isArray(t.values))r=t.values;else if(t.entries&&typeof t.entries=="object")r=Object.values(t.entries);else return"enum";return r.map(o=>`"${o}"`).join(" | ")}case"ZodArray":case"array":{const r=typeof t.element=="object"?t.element:typeof t.type=="object"?t.type:void 0;return r?`Array<${Un(r)}>`:"Array<unknown>"}case"ZodObject":case"object":{const r=typeof t.shape=="function"?t.shape():t.shape;return r?`{ ${Object.entries(r).map(([i,a])=>{const s=Gn(a);return`${i}${s==="ZodOptional"||s==="ZodNullable"||s==="optional"||s==="nullable"?"?":""}: ${Un(a)}`}).join(", ")} }`:"object"}case"ZodOptional":case"optional":case"ZodNullable":case"nullable":{const r=t.innerType??t.wrapped;return r?Un(r):"unknown"}case"ZodUnion":case"union":{const r=t.options;return r?r.map(o=>Un(o)).join(" | "):"unknown"}default:return"unknown"}}function pr(e){const t=e._def;switch(t.typeName??""){case"ZodString":return{type:"string"};case"ZodNumber":return{type:"number"};case"ZodBoolean":return{type:"boolean"};case"ZodLiteral":return{const:t.value};case"ZodEnum":return{enum:t.values};case"ZodArray":{const r=t.type;return{type:"array",items:r?pr(r):{}}}case"ZodObject":{const r=t.shape?.();if(!r)return{type:"object"};const o={},i=[];for(const[a,s]of Object.entries(r)){o[a]=pr(s);const l=s._def;l.typeName!=="ZodOptional"&&l.typeName!=="ZodNullable"&&i.push(a)}return{type:"object",properties:o,required:i.length>0?i:void 0,additionalProperties:!1}}case"ZodRecord":{const r=t.valueType;return{type:"object",additionalProperties:r?pr(r):!0}}case"ZodOptional":case"ZodNullable":{const r=t.innerType;return r?pr(r):{}}case"ZodUnion":{const r=t.options;return r?{anyOf:r.map(pr)}:{}}case"ZodAny":return{};default:return{}}}function cO(e,t){return e.createCatalog(t)}var uO=nO(e=>({spec:e.object({root:e.string(),elements:e.record(e.object({type:e.ref("catalog.components"),props:e.propsOf("catalog.components"),children:e.array(e.string()),visible:e.any()}))}),catalog:e.object({components:e.map({props:e.zod(),slots:e.array(e.string()),description:e.string(),example:e.any()}),actions:e.map({params:e.zod(),description:e.string()})})}),{builtInActions:[{name:"setState",description:"Update a value in the state model at the given statePath. Params: { statePath: string, value: any }"},{name:"pushState",description:'Append an item to an array in state. Params: { statePath: string, value: any, clearStatePath?: string }. Value can contain {"$state":"/path"} refs and "$id" for auto IDs.'},{name:"removeState",description:"Remove an item from an array in state by index. Params: { statePath: string, index: number }"},{name:"validateForm",description:"Validate all registered form fields and write the result to state. Params: { statePath?: string }. Defaults to /formValidation. Result: { valid: boolean, errors: Record<string, string[]> }."}],defaultRules:["CRITICAL INTEGRITY CHECK: Before outputting ANY element that references children, you MUST have already output (or will output) each child as its own element. If an element has children: ['a', 'b'], then elements 'a' and 'b' MUST exist. A missing child element causes that entire branch of the UI to be invisible.","SELF-CHECK: After generating all elements, mentally walk the tree from root. Every key in every children array must resolve to a defined element. If you find a gap, output the missing element immediately.",'CRITICAL: The "visible" field goes on the ELEMENT object, NOT inside "props". Correct: {"type":"<ComponentName>","props":{},"visible":{"$state":"/tab","eq":"home"},"children":[...]}.','CRITICAL: The "on" field goes on the ELEMENT object, NOT inside "props". Use on.press, on.change, on.submit etc. NEVER put action/actionParams inside props.',"When the user asks for a UI that displays data (e.g. blog posts, products, users), ALWAYS include a state field with realistic sample data. The state field is a top-level field on the spec (sibling of root/elements).",'When building repeating content backed by a state array (e.g. posts, products, items), use the "repeat" field on a container element. Example: { "type": "<ContainerComponent>", "props": {}, "repeat": { "statePath": "/posts", "key": "id" }, "children": ["post-card"] }. Replace <ContainerComponent> with an appropriate component from the AVAILABLE COMPONENTS list. Inside repeated children, use { "$item": "field" } to read a field from the current item, and { "$index": true } for the current array index. For two-way binding to an item field use { "$bindItem": "completed" }. Do NOT hardcode individual elements for each array item.',"Design with visual hierarchy: use container components to group content, heading components for section titles, proper spacing, and status indicators. ONLY use components from the AVAILABLE COMPONENTS list.","For data-rich UIs, use multi-column layout components if available. For forms and single-column content, use vertical layout components. ONLY use components from the AVAILABLE COMPONENTS list.","Always include realistic, professional-looking sample data. For blogs include 3-4 posts with varied titles, authors, dates, categories. For products include names, prices, images. Never leave data empty."]}),dO=g.createContext(null);function Ri(){const e=g.useContext(dO);if(!e)throw new Error("useStateStore must be used within a StateProvider");return e}function Vu(e){const{state:t,set:n}=Ri(),r=Qt(t,e),o=g.useCallback(i=>n(e,i),[e,n]);return[r,o]}var fO=g.createContext(null);function pO(){const e=g.useContext(fO);if(!e)throw new Error("useVisibility must be used within a VisibilityProvider");return e}var mO=g.createContext(null);function hO(){const e=g.useContext(mO);if(!e)throw new Error("useValidation must be used within a ValidationProvider");return e}function or(e,t){const{fieldStates:n,validate:r,touch:o,clear:i,registerField:a}=hO();H.useEffect(()=>{e&&t&&a(e,t)},[e,t,a]);const s=n[e]??{touched:!1,validated:!1,result:null},l=g.useCallback(()=>r(e,t??{checks:[]}),[e,t,r]),c=g.useCallback(()=>o(e),[e,o]),u=g.useCallback(()=>i(e),[e,i]);return{state:s,validate:l,touch:c,clear:u,errors:s.result?.errors??[],isValid:s.result?.valid??!0}}var gO=g.createContext(null);function bO(){const e=g.useContext(gO);if(!e)throw new Error("useActions must be used within an ActionProvider");return e}var Lp=g.createContext(null);function vO({item:e,index:t,basePath:n,children:r}){return f.jsx(Lp.Provider,{value:{item:e,index:t,basePath:n},children:r})}function yO(){return g.useContext(Lp)}var xO=class extends H.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error(`[json-render] Rendering error in <${this.props.elementType}>:`,e,t.componentStack)}render(){return this.state.hasError?null:this.props.children}},wO={},_O=H.createContext(wO);function EO(){return H.useContext(_O)}var $p=H.memo(function e({element:t,spec:n,registry:r,loading:o,fallback:i}){const a=yO(),{ctx:s}=pO(),{execute:l}=bO(),{getSnapshot:c,state:u}=Ri(),d=EO(),p=g.useMemo(()=>{const I=a?{...s,repeatItem:a.item,repeatIndex:a.index,repeatBasePath:a.basePath}:{...s};return I.functions=d,I},[s,a,d]),m=t.visible===void 0?!0:pi(t.visible,p),b=t.on,h=g.useCallback(async I=>{const O=b?.[I];if(!O)return;const D=Array.isArray(O)?O:[O];for(const L of D){if(!L.params){await l(L);continue}const P={...p,stateModel:c()},F={};for(const[K,V]of Object.entries(L.params))F[K]=Uu(V,P);await l({...L,params:F})}},[b,l,p,c]),y=g.useCallback(I=>{const O=b?.[I];if(!O)return{emit:()=>{},shouldPreventDefault:!1,bound:!1};const L=(Array.isArray(O)?O:[O]).some(P=>P.preventDefault);return{emit:()=>h(I),shouldPreventDefault:L,bound:!0}},[b,h]),v=t.watch,x=g.useRef(null),w=g.useRef(void 0),_=g.useMemo(()=>{if(!v)return;const I={};for(const D of Object.keys(v))I[D]=Qt(u,D);const O=w.current;if(O){const D=Object.keys(I);if(D.length===Object.keys(O).length&&D.every(L=>I[L]===O[L]))return O}return w.current=I,I},[v,u]);if(g.useEffect(()=>{if(!v||!_)return;const I=Object.keys(v);if(I.length===0)return;const O=x.current;if(x.current=_,O===null)return;let D=!1;return(async()=>{for(const L of I){if(D)break;if(_[L]!==O[L]){const P=v[L];if(!P)continue;const F=Array.isArray(P)?P:[P];for(const K of F){if(D)break;if(!K.params){if(await l(K),D)break;continue}const V={...p,stateModel:c()},B={};for(const[S,le]of Object.entries(K.params))B[S]=Uu(le,V);if(await l({...K,params:B}),D)break}}}})().catch(console.error),()=>{D=!0}},[v,_,l,p,c]),!m)return null;const C=t.props,E=YR(C,p),A=qR(C,p),R=A!==t.props?{...t,props:A}:t,M=r[R.type]??i;if(!M)return console.warn(`No renderer for component type: ${R.type}`),null;const T=R.repeat?f.jsx(SO,{element:R,spec:n,registry:r,loading:o,fallback:i}):R.children?.map(I=>{const O=n.elements[I];return O?f.jsx(e,{element:O,spec:n,registry:r,loading:o,fallback:i},I):(o||console.warn(`[json-render] Missing element "${I}" referenced as child of "${R.type}". This element will not render.`),null)});return f.jsx(xO,{elementType:R.type,children:f.jsx(M,{element:R,emit:h,on:y,bindings:E,loading:o,children:T})})});function SO({element:e,spec:t,registry:n,loading:r,fallback:o}){const{state:i}=Ri(),a=e.repeat,s=a.statePath,l=Qt(i,s)??[];return f.jsx(f.Fragment,{children:l.map((c,u)=>{const d=a.key&&typeof c=="object"&&c!==null?String(c[a.key]??u):String(u);return f.jsx(vO,{item:c,index:u,basePath:`${s}/${u}`,children:e.children?.map(p=>{const m=t.elements[p];return m?f.jsx($p,{element:m,spec:t,registry:n,loading:r,fallback:o},p):(r||console.warn(`[json-render] Missing element "${p}" referenced as child of "${e.type}" (repeat). This element will not render.`),null)})},d)})})}function kO({spec:e,registry:t,loading:n,fallback:r}){if(!e||!e.root)return null;const o=e.elements[e.root];return o?f.jsx($p,{element:o,spec:e,registry:t,loading:n,fallback:r}):null}function NO(e,t){const n={};if(t.components)for(const[a,s]of Object.entries(t.components))n[a]=({element:l,children:c,emit:u,on:d,bindings:p,loading:m})=>s({props:l.props,children:c,emit:u,on:d,bindings:p,loading:m});const r=t.actions?Object.entries(t.actions):[];return{registry:n,handlers:(a,s)=>{const l={};for(const[c,u]of r)l[c]=async d=>{const p=a(),m=s();p&&await u(d,p,m)};return l},executeAction:async(a,s,l,c={})=>{const u=r.find(([d])=>d===a);u?await u[1](s,l,c):console.warn(`Unknown action: ${a}`)}}}function jt(e,t){const{set:n}=Ri(),r=g.useCallback(o=>{t&&n(t,o)},[t,n]);return[e,r]}var ir=bt(ae({type:U(),message:U(),args:Sn(U(),fn()).optional()})).nullable(),ar=Je(["change","blur","submit"]).nullable(),CO={Card:{props:ae({title:U().nullable(),description:U().nullable(),maxWidth:Je(["sm","md","lg","full"]).nullable(),centered:Gt().nullable()}),slots:["default"],description:"Container card for content sections. Use for forms/content boxes, NOT for page headers.",example:{title:"Overview",description:"Your account summary"}},Stack:{props:ae({direction:Je(["horizontal","vertical"]).nullable(),gap:Je(["none","sm","md","lg"]).nullable(),align:Je(["start","center","end","stretch"]).nullable(),justify:Je(["start","center","end","between","around"]).nullable()}),slots:["default"],description:"Flex container for layouts",example:{direction:"vertical",gap:"md"}},Grid:{props:ae({columns:Et().nullable(),gap:Je(["sm","md","lg"]).nullable()}),slots:["default"],description:"Grid layout (1-6 columns)",example:{columns:3,gap:"md"}},Separator:{props:ae({orientation:Je(["horizontal","vertical"]).nullable()}),description:"Visual separator line"},Tabs:{props:ae({tabs:bt(ae({label:U(),value:U()})),defaultValue:U().nullable(),value:U().nullable()}),slots:["default"],events:["change"],description:"Tab navigation. Use { $bindState } on value for active tab binding."},Accordion:{props:ae({items:bt(ae({title:U(),content:U()})),type:Je(["single","multiple"]).nullable()}),description:"Collapsible sections. Items as [{title, content}]. Type 'single' (default) or 'multiple'."},Collapsible:{props:ae({title:U(),defaultOpen:Gt().nullable()}),slots:["default"],description:"Collapsible section with trigger. Children render inside."},Dialog:{props:ae({title:U(),description:U().nullable(),openPath:U()}),slots:["default"],description:"Modal dialog. Set openPath to a boolean state path. Use setState to toggle."},Drawer:{props:ae({title:U(),description:U().nullable(),openPath:U()}),slots:["default"],description:"Bottom sheet drawer. Set openPath to a boolean state path. Use setState to toggle."},Carousel:{props:ae({items:bt(ae({title:U().nullable(),description:U().nullable()}))}),description:"Horizontally scrollable carousel of cards."},Table:{props:ae({columns:bt(U()),rows:bt(bt(U())),caption:U().nullable()}),description:'Data table. columns: header labels. rows: 2D array of cell strings, e.g. [["Alice","admin"],["Bob","user"]].',example:{columns:["Name","Role"],rows:[["Alice","Admin"],["Bob","User"]]}},Heading:{props:ae({text:U(),level:Je(["h1","h2","h3","h4"]).nullable()}),description:"Heading text (h1-h4)",example:{text:"Welcome",level:"h1"}},Text:{props:ae({text:U(),variant:Je(["body","caption","muted","lead","code"]).nullable()}),description:"Paragraph text",example:{text:"Hello, world!"}},Image:{props:ae({src:U().nullable(),alt:U(),width:Et().nullable(),height:Et().nullable()}),description:"Image component. Renders an img tag when src is provided, otherwise a placeholder."},Avatar:{props:ae({src:U().nullable(),name:U(),size:Je(["sm","md","lg"]).nullable()}),description:"User avatar with fallback initials",example:{name:"Jane Doe",size:"md"}},Badge:{props:ae({text:U(),variant:Je(["default","secondary","destructive","outline"]).nullable()}),description:"Status badge",example:{text:"Active",variant:"default"}},Alert:{props:ae({title:U(),message:U().nullable(),type:Je(["info","success","warning","error"]).nullable()}),description:"Alert banner",example:{title:"Note",message:"Your changes have been saved.",type:"success"}},Progress:{props:ae({value:Et(),max:Et().nullable(),label:U().nullable()}),description:"Progress bar (value 0-100)",example:{value:65,max:100,label:"Upload progress"}},Skeleton:{props:ae({width:U().nullable(),height:U().nullable(),rounded:Gt().nullable()}),description:"Loading placeholder skeleton"},Spinner:{props:ae({size:Je(["sm","md","lg"]).nullable(),label:U().nullable()}),description:"Loading spinner indicator"},Tooltip:{props:ae({content:U(),text:U()}),description:"Hover tooltip. Shows content on hover over text."},Popover:{props:ae({trigger:U(),content:U()}),description:"Popover that appears on click of trigger."},Input:{props:ae({label:U(),name:U(),type:Je(["text","email","password","number"]).nullable(),placeholder:U().nullable(),value:U().nullable(),checks:ir,validateOn:ar}),events:["submit","focus","blur"],description:"Text input field. Use { $bindState } on value for two-way binding. Use checks for validation (e.g. required, email, minLength). validateOn controls timing (default: blur).",example:{label:"Email",name:"email",type:"email",placeholder:"you@example.com"}},Textarea:{props:ae({label:U(),name:U(),placeholder:U().nullable(),rows:Et().nullable(),value:U().nullable(),checks:ir,validateOn:ar}),description:"Multi-line text input. Use { $bindState } on value for binding. Use checks for validation. validateOn controls timing (default: blur)."},Select:{props:ae({label:U(),name:U(),options:bt(U()),placeholder:U().nullable(),value:U().nullable(),checks:ir,validateOn:ar}),events:["change"],description:"Dropdown select input. Use { $bindState } on value for binding. Use checks for validation. validateOn controls timing (default: change)."},Checkbox:{props:ae({label:U(),name:U(),checked:Gt().nullable(),checks:ir,validateOn:ar}),events:["change"],description:"Checkbox input. Use { $bindState } on checked for binding. Use checks for validation. validateOn controls timing (default: change)."},Radio:{props:ae({label:U(),name:U(),options:bt(U()),value:U().nullable(),checks:ir,validateOn:ar}),events:["change"],description:"Radio button group. Use { $bindState } on value for binding. Use checks for validation. validateOn controls timing (default: change)."},Switch:{props:ae({label:U(),name:U(),checked:Gt().nullable(),checks:ir,validateOn:ar}),events:["change"],description:"Toggle switch. Use { $bindState } on checked for binding. Use checks for validation. validateOn controls timing (default: change)."},Slider:{props:ae({label:U().nullable(),min:Et().nullable(),max:Et().nullable(),step:Et().nullable(),value:Et().nullable()}),events:["change"],description:"Range slider input. Use { $bindState } on value for binding."},Button:{props:ae({label:U(),variant:Je(["primary","secondary","danger"]).nullable(),disabled:Gt().nullable()}),events:["press"],description:"Clickable button. Bind on.press for handler.",example:{label:"Submit",variant:"primary"}},Link:{props:ae({label:U(),href:U()}),events:["press"],description:"Anchor link. Bind on.press for click handler."},DropdownMenu:{props:ae({label:U(),items:bt(ae({label:U(),value:U()})),value:U().nullable()}),events:["select"],description:"Dropdown menu with trigger button and selectable items. Use { $bindState } on value for selected item binding."},Toggle:{props:ae({label:U(),pressed:Gt().nullable(),variant:Je(["default","outline"]).nullable()}),events:["change"],description:"Toggle button. Use { $bindState } on pressed for state binding."},ToggleGroup:{props:ae({items:bt(ae({label:U(),value:U()})),type:Je(["single","multiple"]).nullable(),value:U().nullable()}),events:["change"],description:"Group of toggle buttons. Type 'single' (default) or 'multiple'. Use { $bindState } on value."},ButtonGroup:{props:ae({buttons:bt(ae({label:U(),value:U()})),selected:U().nullable()}),events:["change"],description:"Segmented button group. Use { $bindState } on selected for selected value."},Pagination:{props:ae({totalPages:Et(),page:Et().nullable()}),events:["change"],description:"Page navigation. Use { $bindState } on page for current page number."}};function Gu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Oi(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Gu(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Gu(e[o],null)}}}}function _e(...e){return g.useCallback(Oi(...e),e)}function Tn(e){const t=TO(e),n=g.forwardRef((r,o)=>{const{children:i,...a}=r,s=g.Children.toArray(i),l=s.find(IO);if(l){const c=l.props.children,u=s.map(d=>d===l?g.Children.count(c)>1?g.Children.only(null):g.isValidElement(c)?c.props.children:null:d);return f.jsx(t,{...a,ref:o,children:g.isValidElement(c)?g.cloneElement(c,void 0,u):null})}return f.jsx(t,{...a,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var zp=Tn("Slot");function TO(e){const t=g.forwardRef((n,r)=>{const{children:o,...i}=n;if(g.isValidElement(o)){const a=OO(o),s=RO(i,o.props);return o.type!==g.Fragment&&(s.ref=r?Oi(r,a):a),g.cloneElement(o,s)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jp=Symbol("radix.slottable");function AO(e){const t=({children:n})=>f.jsx(f.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=jp,t}function IO(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jp}function RO(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const l=i(...s);return o(...s),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function OO(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var MO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oe=MO.reduce((e,t)=>{const n=Tn(`Primitive.${t}`),r=g.forwardRef((o,i)=>{const{asChild:a,...s}=o,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(l,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Fp(e,t){e&&Ps.flushSync(()=>e.dispatchEvent(t))}var Bp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),PO="VisuallyHidden",Up=g.forwardRef((e,t)=>f.jsx(oe.span,{...e,ref:t,style:{...Bp,...e.style}}));Up.displayName=PO;var DO=Up;function LO(e,t){const n=g.createContext(t),r=i=>{const{children:a,...s}=i,l=g.useMemo(()=>s,Object.values(s));return f.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function o(i){const a=g.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function lt(e,t=[]){let n=[];function r(i,a){const s=g.createContext(a),l=n.length;n=[...n,a];const c=d=>{const{scope:p,children:m,...b}=d,h=p?.[e]?.[l]||s,y=g.useMemo(()=>b,Object.values(b));return f.jsx(h.Provider,{value:y,children:m})};c.displayName=i+"Provider";function u(d,p){const m=p?.[e]?.[l]||s,b=g.useContext(m);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(a=>g.createContext(a));return function(s){const l=s?.[e]||i;return g.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,$O(o,...t)]}function $O(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function uo(e){const t=e+"CollectionProvider",[n,r]=lt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:y,children:v}=h,x=H.useRef(null),w=H.useRef(new Map).current;return f.jsx(o,{scope:y,itemMap:w,collectionRef:x,children:v})};a.displayName=t;const s=e+"CollectionSlot",l=Tn(s),c=H.forwardRef((h,y)=>{const{scope:v,children:x}=h,w=i(s,v),_=_e(y,w.collectionRef);return f.jsx(l,{ref:_,children:x})});c.displayName=s;const u=e+"CollectionItemSlot",d="data-radix-collection-item",p=Tn(u),m=H.forwardRef((h,y)=>{const{scope:v,children:x,...w}=h,_=H.useRef(null),C=_e(y,_),E=i(u,v);return H.useEffect(()=>(E.itemMap.set(_,{ref:_,...w}),()=>{E.itemMap.delete(_)})),f.jsx(p,{[d]:"",ref:C,children:x})});m.displayName=u;function b(h){const y=i(e+"CollectionConsumer",h);return H.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((E,A)=>w.indexOf(E.ref.current)-w.indexOf(A.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:c,ItemSlot:m},b,r]}function J(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var st=globalThis?.document?g.useLayoutEffect:()=>{},zO=Sd[" useInsertionEffect ".trim().toString()]||st;function vt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,a]=jO({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:o;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const d=u.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,r])}const c=g.useCallback(u=>{if(s){const d=FO(u)?u(e):u;d!==e&&a.current?.(d)}else i(u)},[s,e,i,a]);return[l,c]}function jO({defaultProp:e,onChange:t}){const[n,r]=g.useState(e),o=g.useRef(n),i=g.useRef(t);return zO(()=>{i.current=t},[t]),g.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function FO(e){return typeof e=="function"}function BO(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var Nt=e=>{const{present:t,children:n}=e,r=UO(t),o=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=_e(r.ref,HO(o));return typeof n=="function"||r.isPresent?g.cloneElement(o,{ref:i}):null};Nt.displayName="Presence";function UO(e){const[t,n]=g.useState(),r=g.useRef(null),o=g.useRef(e),i=g.useRef("none"),a=e?"mounted":"unmounted",[s,l]=BO(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const c=Ho(r.current);i.current=s==="mounted"?c:"none"},[s]),st(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,m=Ho(c);e?l("MOUNT"):m==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&p!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),st(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=m=>{const h=Ho(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&h&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=m=>{m.target===t&&(i.current=Ho(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:g.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Ho(e){return e?.animationName||"none"}function HO(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var VO=Sd[" useId ".trim().toString()]||(()=>{}),GO=0;function Pt(e){const[t,n]=g.useState(VO());return st(()=>{n(r=>r??String(GO++))},[e]),e||(t?`radix-${t}`:"")}var Mi="Collapsible",[ZO,Hp]=lt(Mi),[KO,fl]=ZO(Mi),Vp=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:a,...s}=e,[l,c]=vt({prop:r,defaultProp:o??!1,onChange:a,caller:Mi});return f.jsx(KO,{scope:n,disabled:i,contentId:Pt(),open:l,onOpenToggle:g.useCallback(()=>c(u=>!u),[c]),children:f.jsx(oe.div,{"data-state":gl(l),"data-disabled":i?"":void 0,...s,ref:t})})});Vp.displayName=Mi;var Gp="CollapsibleTrigger",pl=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=fl(Gp,n);return f.jsx(oe.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":gl(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:J(e.onClick,o.onOpenToggle)})});pl.displayName=Gp;var ml="CollapsibleContent",hl=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=fl(ml,e.__scopeCollapsible);return f.jsx(Nt,{present:n||o.open,children:({present:i})=>f.jsx(WO,{...r,ref:t,present:i})})});hl.displayName=ml;var WO=g.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,a=fl(ml,n),[s,l]=g.useState(r),c=g.useRef(null),u=_e(t,c),d=g.useRef(0),p=d.current,m=g.useRef(0),b=m.current,h=a.open||s,y=g.useRef(h),v=g.useRef(void 0);return g.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),st(()=>{const x=c.current;if(x){v.current=v.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();d.current=w.height,m.current=w.width,y.current||(x.style.transitionDuration=v.current.transitionDuration,x.style.animationName=v.current.animationName),l(r)}},[a.open,r]),f.jsx(oe.div,{"data-state":gl(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:h&&o})});function gl(e){return e?"open":"closed"}var Zp=Vp,qO=pl,YO=hl,XO=g.createContext(void 0);function On(e){const t=g.useContext(XO);return e||t||"ltr"}var rn="Accordion",JO=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[bl,QO,e1]=uo(rn),[Pi]=lt(rn,[e1,Hp]),vl=Hp(),Kp=H.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return f.jsx(bl.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?f.jsx(o1,{...i,ref:t}):f.jsx(r1,{...o,ref:t})})});Kp.displayName=rn;var[Wp,t1]=Pi(rn),[qp,n1]=Pi(rn,{collapsible:!1}),r1=H.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...a}=e,[s,l]=vt({prop:n,defaultProp:r??"",onChange:o,caller:rn});return f.jsx(Wp,{scope:e.__scopeAccordion,value:H.useMemo(()=>s?[s]:[],[s]),onItemOpen:l,onItemClose:H.useCallback(()=>i&&l(""),[i,l]),children:f.jsx(qp,{scope:e.__scopeAccordion,collapsible:i,children:f.jsx(Yp,{...a,ref:t})})})}),o1=H.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=vt({prop:n,defaultProp:r??[],onChange:o,caller:rn}),l=H.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=H.useCallback(u=>s((d=[])=>d.filter(p=>p!==u)),[s]);return f.jsx(Wp,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:c,children:f.jsx(qp,{scope:e.__scopeAccordion,collapsible:!0,children:f.jsx(Yp,{...i,ref:t})})})}),[i1,Di]=Pi(rn),Yp=H.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...a}=e,s=H.useRef(null),l=_e(s,t),c=QO(n),d=On(o)==="ltr",p=J(e.onKeyDown,m=>{if(!JO.includes(m.key))return;const b=m.target,h=c().filter(R=>!R.ref.current?.disabled),y=h.findIndex(R=>R.ref.current===b),v=h.length;if(y===-1)return;m.preventDefault();let x=y;const w=0,_=v-1,C=()=>{x=y+1,x>_&&(x=w)},E=()=>{x=y-1,x<w&&(x=_)};switch(m.key){case"Home":x=w;break;case"End":x=_;break;case"ArrowRight":i==="horizontal"&&(d?C():E());break;case"ArrowDown":i==="vertical"&&C();break;case"ArrowLeft":i==="horizontal"&&(d?E():C());break;case"ArrowUp":i==="vertical"&&E();break}const A=x%v;h[A].ref.current?.focus()});return f.jsx(i1,{scope:n,disabled:r,direction:o,orientation:i,children:f.jsx(bl.Slot,{scope:n,children:f.jsx(oe.div,{...a,"data-orientation":i,ref:l,onKeyDown:r?void 0:p})})})}),mi="AccordionItem",[a1,yl]=Pi(mi),Xp=H.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Di(mi,n),a=t1(mi,n),s=vl(n),l=Pt(),c=r&&a.value.includes(r)||!1,u=i.disabled||e.disabled;return f.jsx(a1,{scope:n,open:c,disabled:u,triggerId:l,children:f.jsx(Zp,{"data-orientation":i.orientation,"data-state":rm(c),...s,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?a.onItemOpen(r):a.onItemClose(r)}})})});Xp.displayName=mi;var Jp="AccordionHeader",Qp=H.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Di(rn,n),i=yl(Jp,n);return f.jsx(oe.h3,{"data-orientation":o.orientation,"data-state":rm(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});Qp.displayName=Jp;var ps="AccordionTrigger",em=H.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Di(rn,n),i=yl(ps,n),a=n1(ps,n),s=vl(n);return f.jsx(bl.ItemSlot,{scope:n,children:f.jsx(qO,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...s,...r,ref:t})})});em.displayName=ps;var tm="AccordionContent",nm=H.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Di(rn,n),i=yl(tm,n),a=vl(n);return f.jsx(YO,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...a,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});nm.displayName=tm;function rm(e){return e?"open":"closed"}var s1=Kp,l1=Xp,c1=Qp,u1=em,d1=nm;function nn(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>t.current?.(...n),[])}function f1(e,t=globalThis?.document){const n=nn(e);g.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var p1="DismissableLayer",ms="dismissableLayer.update",m1="dismissableLayer.pointerDownOutside",h1="dismissableLayer.focusOutside",Zu,om=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Tr=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...l}=e,c=g.useContext(om),[u,d]=g.useState(null),p=u?.ownerDocument??globalThis?.document,[,m]=g.useState({}),b=_e(t,A=>d(A)),h=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(y),x=u?h.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,_=x>=v,C=v1(A=>{const R=A.target,M=[...c.branches].some(T=>T.contains(R));!_||M||(o?.(A),a?.(A),A.defaultPrevented||s?.())},p),E=y1(A=>{const R=A.target;[...c.branches].some(T=>T.contains(R))||(i?.(A),a?.(A),A.defaultPrevented||s?.())},p);return f1(A=>{x===c.layers.size-1&&(r?.(A),!A.defaultPrevented&&s&&(A.preventDefault(),s()))},p),g.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Zu=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Ku(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Zu)}},[u,p,n,c]),g.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Ku())},[u,c]),g.useEffect(()=>{const A=()=>m({});return document.addEventListener(ms,A),()=>document.removeEventListener(ms,A)},[]),f.jsx(oe.div,{...l,ref:b,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,E.onFocusCapture),onBlurCapture:J(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,C.onPointerDownCapture)})});Tr.displayName=p1;var g1="DismissableLayerBranch",b1=g.forwardRef((e,t)=>{const n=g.useContext(om),r=g.useRef(null),o=_e(t,r);return g.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),f.jsx(oe.div,{...e,ref:o})});b1.displayName=g1;function v1(e,t=globalThis?.document){const n=nn(e),r=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let l=function(){im(m1,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function y1(e,t=globalThis?.document){const n=nn(e),r=g.useRef(!1);return g.useEffect(()=>{const o=i=>{i.target&&!r.current&&im(h1,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ku(){const e=new CustomEvent(ms);document.dispatchEvent(e)}function im(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Fp(o,i):o.dispatchEvent(i)}var za="focusScope.autoFocusOnMount",ja="focusScope.autoFocusOnUnmount",Wu={bubbles:!1,cancelable:!0},x1="FocusScope",fo=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}=e,[s,l]=g.useState(null),c=nn(o),u=nn(i),d=g.useRef(null),p=_e(t,h=>l(h)),m=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let h=function(w){if(m.paused||!s)return;const _=w.target;s.contains(_)?d.current=_:En(d.current,{select:!0})},y=function(w){if(m.paused||!s)return;const _=w.relatedTarget;_!==null&&(s.contains(_)||En(d.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&En(s)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const x=new MutationObserver(v);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),x.disconnect()}}},[r,s,m.paused]),g.useEffect(()=>{if(s){Yu.add(m);const h=document.activeElement;if(!s.contains(h)){const v=new CustomEvent(za,Wu);s.addEventListener(za,c),s.dispatchEvent(v),v.defaultPrevented||(w1(N1(am(s)),{select:!0}),document.activeElement===h&&En(s))}return()=>{s.removeEventListener(za,c),setTimeout(()=>{const v=new CustomEvent(ja,Wu);s.addEventListener(ja,u),s.dispatchEvent(v),v.defaultPrevented||En(h??document.body,{select:!0}),s.removeEventListener(ja,u),Yu.remove(m)},0)}}},[s,c,u,m]);const b=g.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,v=document.activeElement;if(y&&v){const x=h.currentTarget,[w,_]=_1(x);w&&_?!h.shiftKey&&v===_?(h.preventDefault(),n&&En(w,{select:!0})):h.shiftKey&&v===w&&(h.preventDefault(),n&&En(_,{select:!0})):v===x&&h.preventDefault()}},[n,r,m.paused]);return f.jsx(oe.div,{tabIndex:-1,...a,ref:p,onKeyDown:b})});fo.displayName=x1;function w1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(En(r,{select:t}),document.activeElement!==n)return}function _1(e){const t=am(e),n=qu(t,e),r=qu(t.reverse(),e);return[n,r]}function am(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qu(e,t){for(const n of e)if(!E1(n,{upTo:t}))return n}function E1(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function S1(e){return e instanceof HTMLInputElement&&"select"in e}function En(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&S1(e)&&t&&e.select()}}var Yu=k1();function k1(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Xu(e,t),e.unshift(t)},remove(t){e=Xu(e,t),e[0]?.resume()}}}function Xu(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function N1(e){return e.filter(t=>t.tagName!=="A")}var C1="Portal",Ar=g.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=g.useState(!1);st(()=>i(!0),[]);const a=n||o&&globalThis?.document?.body;return a?Sv.createPortal(f.jsx(oe.div,{...r,ref:t}),a):null});Ar.displayName=C1;var Fa=0;function Li(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ju()),document.body.insertAdjacentElement("beforeend",e[1]??Ju()),Fa++,()=>{Fa===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Fa--}},[])}function Ju(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var dn=function(){return dn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},dn.apply(this,arguments)};function sm(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function T1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Qo="right-scroll-bar-position",ei="width-before-scroll-bar",A1="with-scroll-bars-hidden",I1="--removed-body-scroll-bar-size";function Ba(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function R1(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var O1=typeof window<"u"?g.useLayoutEffect:g.useEffect,Qu=new WeakMap;function M1(e,t){var n=R1(null,function(r){return e.forEach(function(o){return Ba(o,r)})});return O1(function(){var r=Qu.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(s){i.has(s)||Ba(s,null)}),i.forEach(function(s){o.has(s)||Ba(s,a)})}Qu.set(n,e)},[e]),n}function P1(e){return e}function D1(e,t){t===void 0&&(t=P1);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(i),a=n}var l=function(){var u=a;a=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){a.push(u),c()},filter:function(u){return a=a.filter(u),n}}}};return o}function L1(e){e===void 0&&(e={});var t=D1(null);return t.options=dn({async:!0,ssr:!1},e),t}var lm=function(e){var t=e.sideCar,n=sm(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return g.createElement(r,dn({},n))};lm.isSideCarExport=!0;function $1(e,t){return e.useMedium(t),lm}var cm=L1(),Ua=function(){},$i=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:Ua,onWheelCapture:Ua,onTouchMoveCapture:Ua}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,m=e.noRelative,b=e.noIsolation,h=e.inert,y=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,w=e.gapMode,_=sm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,E=M1([n,t]),A=dn(dn({},_),o);return g.createElement(g.Fragment,null,u&&g.createElement(C,{sideCar:cm,removeScrollBar:c,shards:d,noRelative:m,noIsolation:b,inert:h,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:w}),a?g.cloneElement(g.Children.only(s),dn(dn({},A),{ref:E})):g.createElement(x,dn({},A,{className:l,ref:E}),s))});$i.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$i.classNames={fullWidth:ei,zeroRight:Qo};var z1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function j1(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=z1();return t&&e.setAttribute("nonce",t),e}function F1(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function B1(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var U1=function(){var e=0,t=null;return{add:function(n){e==0&&(t=j1())&&(F1(t,n),B1(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},H1=function(){var e=U1();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},um=function(){var e=H1(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},V1={left:0,top:0,right:0,gap:0},Ha=function(e){return parseInt(e||"",10)||0},G1=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ha(n),Ha(r),Ha(o)]},Z1=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return V1;var t=G1(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},K1=um(),yr="data-scroll-locked",W1=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
81
- .`.concat(A1,` {
82
- overflow: hidden `).concat(r,`;
83
- padding-right: `).concat(s,"px ").concat(r,`;
84
- }
85
- body[`).concat(yr,`] {
86
- overflow: hidden `).concat(r,`;
87
- overscroll-behavior: contain;
88
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
89
- padding-left: `.concat(o,`px;
90
- padding-top: `).concat(i,`px;
91
- padding-right: `).concat(a,`px;
92
- margin-left:0;
93
- margin-top:0;
94
- margin-right: `).concat(s,"px ").concat(r,`;
95
- `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
96
- }
97
-
98
- .`).concat(Qo,` {
99
- right: `).concat(s,"px ").concat(r,`;
100
- }
101
-
102
- .`).concat(ei,` {
103
- margin-right: `).concat(s,"px ").concat(r,`;
104
- }
105
-
106
- .`).concat(Qo," .").concat(Qo,` {
107
- right: 0 `).concat(r,`;
108
- }
109
-
110
- .`).concat(ei," .").concat(ei,` {
111
- margin-right: 0 `).concat(r,`;
112
- }
113
-
114
- body[`).concat(yr,`] {
115
- `).concat(I1,": ").concat(s,`px;
116
- }
117
- `)},ed=function(){var e=parseInt(document.body.getAttribute(yr)||"0",10);return isFinite(e)?e:0},q1=function(){g.useEffect(function(){return document.body.setAttribute(yr,(ed()+1).toString()),function(){var e=ed()-1;e<=0?document.body.removeAttribute(yr):document.body.setAttribute(yr,e.toString())}},[])},Y1=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;q1();var i=g.useMemo(function(){return Z1(o)},[o]);return g.createElement(K1,{styles:W1(i,!t,o,n?"":"!important")})},hs=!1;if(typeof window<"u")try{var Vo=Object.defineProperty({},"passive",{get:function(){return hs=!0,!0}});window.addEventListener("test",Vo,Vo),window.removeEventListener("test",Vo,Vo)}catch{hs=!1}var sr=hs?{passive:!1}:!1,X1=function(e){return e.tagName==="TEXTAREA"},dm=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!X1(e)&&n[t]==="visible")},J1=function(e){return dm(e,"overflowY")},Q1=function(e){return dm(e,"overflowX")},td=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=fm(e,r);if(o){var i=pm(e,r),a=i[1],s=i[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},eM=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},tM=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},fm=function(e,t){return e==="v"?J1(t):Q1(t)},pm=function(e,t){return e==="v"?eM(t):tM(t)},nM=function(e,t){return e==="h"&&t==="rtl"?-1:1},rM=function(e,t,n,r,o){var i=nM(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,p=0;do{if(!s)break;var m=pm(e,s),b=m[0],h=m[1],y=m[2],v=h-y-i*b;(b||v)&&fm(e,s)&&(d+=v,p+=b);var x=s.parentNode;s=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&Math.abs(d)<1||!u&&Math.abs(p)<1)&&(c=!0),c},Go=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nd=function(e){return[e.deltaX,e.deltaY]},rd=function(e){return e&&"current"in e?e.current:e},oM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},iM=function(e){return`
118
- .block-interactivity-`.concat(e,` {pointer-events: none;}
119
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
120
- `)},aM=0,lr=[];function sM(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(aM++)[0],i=g.useState(um)[0],a=g.useRef(e);g.useEffect(function(){a.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var h=T1([e.lockRef.current],(e.shards||[]).map(rd),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=g.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var v=Go(h),x=n.current,w="deltaX"in h?h.deltaX:x[0]-v[0],_="deltaY"in h?h.deltaY:x[1]-v[1],C,E=h.target,A=Math.abs(w)>Math.abs(_)?"h":"v";if("touches"in h&&A==="h"&&E.type==="range")return!1;var R=window.getSelection(),M=R&&R.anchorNode,T=M?M===E||M.contains(E):!1;if(T)return!1;var I=td(A,E);if(!I)return!0;if(I?C=A:(C=A==="v"?"h":"v",I=td(A,E)),!I)return!1;if(!r.current&&"changedTouches"in h&&(w||_)&&(r.current=C),!C)return!0;var O=r.current||C;return rM(O,y,h,O==="h"?w:_)},[]),l=g.useCallback(function(h){var y=h;if(!(!lr.length||lr[lr.length-1]!==i)){var v="deltaY"in y?nd(y):Go(y),x=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&oM(C.delta,v)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(a.current.shards||[]).map(rd).filter(Boolean).filter(function(C){return C.contains(y.target)}),_=w.length>0?s(y,w[0]):!a.current.noIsolation;_&&y.cancelable&&y.preventDefault()}}},[]),c=g.useCallback(function(h,y,v,x){var w={name:h,delta:y,target:v,should:x,shadowParent:lM(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(_){return _!==w})},1)},[]),u=g.useCallback(function(h){n.current=Go(h),r.current=void 0},[]),d=g.useCallback(function(h){c(h.type,nd(h),h.target,s(h,e.lockRef.current))},[]),p=g.useCallback(function(h){c(h.type,Go(h),h.target,s(h,e.lockRef.current))},[]);g.useEffect(function(){return lr.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,sr),document.addEventListener("touchmove",l,sr),document.addEventListener("touchstart",u,sr),function(){lr=lr.filter(function(h){return h!==i}),document.removeEventListener("wheel",l,sr),document.removeEventListener("touchmove",l,sr),document.removeEventListener("touchstart",u,sr)}},[]);var m=e.removeScrollBar,b=e.inert;return g.createElement(g.Fragment,null,b?g.createElement(i,{styles:iM(o)}):null,m?g.createElement(Y1,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const cM=$1(cm,sM);var po=g.forwardRef(function(e,t){return g.createElement($i,dn({},e,{ref:t,sideCar:cM}))});po.classNames=$i.classNames;var uM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},cr=new WeakMap,Zo=new WeakMap,Ko={},Va=0,mm=function(e){return e&&(e.host||mm(e.parentNode))},dM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=mm(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},fM=function(e,t,n,r){var o=dM(t,Array.isArray(e)?e:[e]);Ko[n]||(Ko[n]=new WeakMap);var i=Ko[n],a=[],s=new Set,l=new Set(o),c=function(d){!d||s.has(d)||(s.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(s.has(p))u(p);else try{var m=p.getAttribute(r),b=m!==null&&m!=="false",h=(cr.get(p)||0)+1,y=(i.get(p)||0)+1;cr.set(p,h),i.set(p,y),a.push(p),h===1&&b&&Zo.set(p,!0),y===1&&p.setAttribute(n,"true"),b||p.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return u(t),s.clear(),Va++,function(){a.forEach(function(d){var p=cr.get(d)-1,m=i.get(d)-1;cr.set(d,p),i.set(d,m),p||(Zo.has(d)||d.removeAttribute(r),Zo.delete(d)),m||d.removeAttribute(n)}),Va--,Va||(cr=new WeakMap,cr=new WeakMap,Zo=new WeakMap,Ko={})}},zi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=uM(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),fM(r,o,n,"aria-hidden")):function(){return null}},ji="Dialog",[hm]=lt(ji),[pM,on]=hm(ji),gm=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,s=g.useRef(null),l=g.useRef(null),[c,u]=vt({prop:r,defaultProp:o??!1,onChange:i,caller:ji});return f.jsx(pM,{scope:t,triggerRef:s,contentRef:l,contentId:Pt(),titleId:Pt(),descriptionId:Pt(),open:c,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(d=>!d),[u]),modal:a,children:n})};gm.displayName=ji;var bm="DialogTrigger",mM=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=on(bm,n),i=_e(t,o.triggerRef);return f.jsx(oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":_l(o.open),...r,ref:i,onClick:J(e.onClick,o.onOpenToggle)})});mM.displayName=bm;var xl="DialogPortal",[hM,vm]=hm(xl,{forceMount:void 0}),ym=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=on(xl,t);return f.jsx(hM,{scope:t,forceMount:n,children:g.Children.map(r,a=>f.jsx(Nt,{present:n||i.open,children:f.jsx(Ar,{asChild:!0,container:o,children:a})}))})};ym.displayName=xl;var hi="DialogOverlay",xm=g.forwardRef((e,t)=>{const n=vm(hi,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=on(hi,e.__scopeDialog);return i.modal?f.jsx(Nt,{present:r||i.open,children:f.jsx(bM,{...o,ref:t})}):null});xm.displayName=hi;var gM=Tn("DialogOverlay.RemoveScroll"),bM=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=on(hi,n);return f.jsx(po,{as:gM,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(oe.div,{"data-state":_l(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Zn="DialogContent",wm=g.forwardRef((e,t)=>{const n=vm(Zn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=on(Zn,e.__scopeDialog);return f.jsx(Nt,{present:r||i.open,children:i.modal?f.jsx(vM,{...o,ref:t}):f.jsx(yM,{...o,ref:t})})});wm.displayName=Zn;var vM=g.forwardRef((e,t)=>{const n=on(Zn,e.__scopeDialog),r=g.useRef(null),o=_e(t,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return zi(i)},[]),f.jsx(_m,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&i.preventDefault()}),onFocusOutside:J(e.onFocusOutside,i=>i.preventDefault())})}),yM=g.forwardRef((e,t)=>{const n=on(Zn,e.__scopeDialog),r=g.useRef(!1),o=g.useRef(!1);return f.jsx(_m,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),_m=g.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...a}=e,s=on(Zn,n),l=g.useRef(null),c=_e(t,l);return Li(),f.jsxs(f.Fragment,{children:[f.jsx(fo,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:f.jsx(Tr,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":_l(s.open),...a,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(xM,{titleId:s.titleId}),f.jsx(_M,{contentRef:l,descriptionId:s.descriptionId})]})]})}),wl="DialogTitle",Em=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=on(wl,n);return f.jsx(oe.h2,{id:o.titleId,...r,ref:t})});Em.displayName=wl;var Sm="DialogDescription",km=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=on(Sm,n);return f.jsx(oe.p,{id:o.descriptionId,...r,ref:t})});km.displayName=Sm;var Nm="DialogClose",Cm=g.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=on(Nm,n);return f.jsx(oe.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});Cm.displayName=Nm;function _l(e){return e?"open":"closed"}var Tm="DialogTitleWarning",[g2,Am]=LO(Tm,{contentName:Zn,titleName:wl,docsSlug:"dialog"}),xM=({titleId:e})=>{const t=Am(Tm),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
121
-
122
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
123
-
124
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},wM="DialogDescriptionWarning",_M=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Am(wM).contentName}}.`;return g.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Im=gm,Rm=ym,Om=xm,Mm=wm,Pm=Em,Dm=km,EM=Cm;function SM(){return kv.useSyncExternalStore(kM,()=>!0,()=>!1)}function kM(){return()=>{}}var El="Avatar",[NM]=lt(El),[CM,Lm]=NM(El),$m=g.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=g.useState("idle");return f.jsx(CM,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:f.jsx(oe.span,{...r,ref:t})})});$m.displayName=El;var zm="AvatarImage",jm=g.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,a=Lm(zm,n),s=TM(r,i),l=nn(c=>{o(c),a.onImageLoadingStatusChange(c)});return st(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?f.jsx(oe.img,{...i,ref:t,src:r}):null});jm.displayName=zm;var Fm="AvatarFallback",Bm=g.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=Lm(Fm,n),[a,s]=g.useState(r===void 0);return g.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&i.imageLoadingStatus!=="loaded"?f.jsx(oe.span,{...o,ref:t}):null});Bm.displayName=Fm;function od(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function TM(e,{referrerPolicy:t,crossOrigin:n}){const r=SM(),o=g.useRef(null),i=r?(o.current||(o.current=new window.Image),o.current):null,[a,s]=g.useState(()=>od(i,e));return st(()=>{s(od(i,e))},[i,e]),st(()=>{const l=d=>()=>{s(d)};if(!i)return;const c=l("loaded"),u=l("error");return i.addEventListener("load",c),i.addEventListener("error",u),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",c),i.removeEventListener("error",u)}},[i,n,t]),a}var AM=$m,IM=jm,RM=Bm;function mo(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ho(e){const[t,n]=g.useState(void 0);return st(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Fi="Checkbox",[OM]=lt(Fi),[MM,Sl]=OM(Fi);function PM(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:i,form:a,name:s,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[p,m]=vt({prop:n,defaultProp:o??!1,onChange:l,caller:Fi}),[b,h]=g.useState(null),[y,v]=g.useState(null),x=g.useRef(!1),w=b?!!a||!!b.closest("form"):!0,_={checked:p,disabled:i,setChecked:m,control:b,setControl:h,name:s,form:a,value:u,hasConsumerStoppedPropagationRef:x,required:c,defaultChecked:kn(o)?!1:o,isFormControl:w,bubbleInput:y,setBubbleInput:v};return f.jsx(MM,{scope:t,..._,children:DM(d)?d(_):r})}var Um="CheckboxTrigger",Hm=g.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:i,value:a,disabled:s,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:b}=Sl(Um,e),h=_e(o,u),y=g.useRef(l);return g.useEffect(()=>{const v=i?.form;if(v){const x=()=>d(y.current);return v.addEventListener("reset",x),()=>v.removeEventListener("reset",x)}},[i,d]),f.jsx(oe.button,{type:"button",role:"checkbox","aria-checked":kn(l)?"mixed":l,"aria-required":c,"data-state":qm(l),"data-disabled":s?"":void 0,disabled:s,value:a,...r,ref:h,onKeyDown:J(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:J(n,v=>{d(x=>kn(x)?!0:!x),b&&m&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})})});Hm.displayName=Um;var Vm=g.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l,onCheckedChange:c,form:u,...d}=e;return f.jsx(PM,{__scopeCheckbox:n,checked:o,defaultChecked:i,disabled:s,required:a,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:p})=>f.jsxs(f.Fragment,{children:[f.jsx(Hm,{...d,ref:t,__scopeCheckbox:n}),p&&f.jsx(Wm,{__scopeCheckbox:n})]})})});Vm.displayName=Fi;var Gm="CheckboxIndicator",Zm=g.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Sl(Gm,n);return f.jsx(Nt,{present:r||kn(i.checked)||i.checked===!0,children:f.jsx(oe.span,{"data-state":qm(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Zm.displayName=Gm;var Km="CheckboxBubbleInput",Wm=g.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:i,defaultChecked:a,required:s,disabled:l,name:c,value:u,form:d,bubbleInput:p,setBubbleInput:m}=Sl(Km,e),b=_e(n,m),h=mo(i),y=ho(r);g.useEffect(()=>{const x=p;if(!x)return;const w=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(w,"checked").set,E=!o.current;if(h!==i&&C){const A=new Event("click",{bubbles:E});x.indeterminate=kn(i),C.call(x,kn(i)?!1:i),x.dispatchEvent(A)}},[p,h,i,o]);const v=g.useRef(kn(i)?!1:i);return f.jsx(oe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??v.current,required:s,disabled:l,name:c,value:u,form:d,...t,tabIndex:-1,ref:b,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Wm.displayName=Km;function DM(e){return typeof e=="function"}function kn(e){return e==="indeterminate"}function qm(e){return kn(e)?"indeterminate":e?"checked":"unchecked"}var LM="Arrow",Ym=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return f.jsx(oe.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ym.displayName=LM;var $M=Ym,kl="Popper",[Xm,Mn]=lt(kl),[zM,Jm]=Xm(kl),Qm=e=>{const{__scopePopper:t,children:n}=e,[r,o]=g.useState(null);return f.jsx(zM,{scope:t,anchor:r,onAnchorChange:o,children:n})};Qm.displayName=kl;var eh="PopperAnchor",th=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Jm(eh,n),a=g.useRef(null),s=_e(t,a),l=g.useRef(null);return g.useEffect(()=>{const c=l.current;l.current=r?.current||a.current,c!==l.current&&i.onAnchorChange(l.current)}),r?null:f.jsx(oe.div,{...o,ref:s})});th.displayName=eh;var Nl="PopperContent",[jM,FM]=Xm(Nl),nh=g.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:b,...h}=e,y=Jm(Nl,n),[v,x]=g.useState(null),w=_e(t,G=>x(G)),[_,C]=g.useState(null),E=ho(_),A=E?.width??0,R=E?.height??0,M=r+(i!=="center"?"-"+i:""),T=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},I=Array.isArray(c)?c:[c],O=I.length>0,D={padding:T,boundary:I.filter(UM),altBoundary:O},{refs:L,floatingStyles:P,placement:F,isPositioned:K,middlewareData:V}=Nv({strategy:"fixed",placement:M,whileElementsMounted:(...G)=>Mv(...G,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[Cv({mainAxis:o+R,alignmentAxis:a}),l&&Tv({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Pv():void 0,...D}),l&&Av({...D}),Iv({...D,apply:({elements:G,rects:se,availableWidth:Ce,availableHeight:fe})=>{const{width:ie,height:X}=se.reference,xe=G.floating.style;xe.setProperty("--radix-popper-available-width",`${Ce}px`),xe.setProperty("--radix-popper-available-height",`${fe}px`),xe.setProperty("--radix-popper-anchor-width",`${ie}px`),xe.setProperty("--radix-popper-anchor-height",`${X}px`)}}),_&&Rv({element:_,padding:s}),HM({arrowWidth:A,arrowHeight:R}),p&&Ov({strategy:"referenceHidden",...D})]}),[B,S]=ih(F),le=nn(b);st(()=>{K&&le?.()},[K,le]);const be=V.arrow?.x,k=V.arrow?.y,Ee=V.arrow?.centerOffset!==0,[Le,we]=g.useState();return st(()=>{v&&we(window.getComputedStyle(v).zIndex)},[v]),f.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:K?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Le,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(jM,{scope:n,placedSide:B,onArrowChange:C,arrowX:be,arrowY:k,shouldHideArrow:Ee,children:f.jsx(oe.div,{"data-side":B,"data-align":S,...h,ref:w,style:{...h.style,animation:K?void 0:"none"}})})})});nh.displayName=Nl;var rh="PopperArrow",BM={top:"bottom",right:"left",bottom:"top",left:"right"},oh=g.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=FM(rh,r),a=BM[i.placedSide];return f.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:f.jsx($M,{...o,ref:n,style:{...o.style,display:"block"}})})});oh.displayName=rh;function UM(e){return e!==null}var HM=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=o.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,u]=ih(n),d={start:"0%",center:"50%",end:"100%"}[u],p=(o.arrow?.x??0)+s/2,m=(o.arrow?.y??0)+l/2;let b="",h="";return c==="bottom"?(b=a?d:`${p}px`,h=`${-l}px`):c==="top"?(b=a?d:`${p}px`,h=`${r.floating.height+l}px`):c==="right"?(b=`${-l}px`,h=a?d:`${m}px`):c==="left"&&(b=`${r.floating.width+l}px`,h=a?d:`${m}px`),{data:{x:b,y:h}}}});function ih(e){const[t,n="center"]=e.split("-");return[t,n]}var Bi=Qm,go=th,Ui=nh,Hi=oh,Ga="rovingFocusGroup.onEntryFocus",VM={bubbles:!1,cancelable:!0},bo="RovingFocusGroup",[gs,ah,GM]=uo(bo),[ZM,Pn]=lt(bo,[GM]),[KM,WM]=ZM(bo),sh=g.forwardRef((e,t)=>f.jsx(gs.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(gs.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(qM,{...e,ref:t})})}));sh.displayName=bo;var qM=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,p=g.useRef(null),m=_e(t,p),b=On(i),[h,y]=vt({prop:a,defaultProp:s??null,onChange:l,caller:bo}),[v,x]=g.useState(!1),w=nn(c),_=ah(n),C=g.useRef(!1),[E,A]=g.useState(0);return g.useEffect(()=>{const R=p.current;if(R)return R.addEventListener(Ga,w),()=>R.removeEventListener(Ga,w)},[w]),f.jsx(KM,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:h,onItemFocus:g.useCallback(R=>y(R),[y]),onItemShiftTab:g.useCallback(()=>x(!0),[]),onFocusableItemAdd:g.useCallback(()=>A(R=>R+1),[]),onFocusableItemRemove:g.useCallback(()=>A(R=>R-1),[]),children:f.jsx(oe.div,{tabIndex:v||E===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:J(e.onMouseDown,()=>{C.current=!0}),onFocus:J(e.onFocus,R=>{const M=!C.current;if(R.target===R.currentTarget&&M&&!v){const T=new CustomEvent(Ga,VM);if(R.currentTarget.dispatchEvent(T),!T.defaultPrevented){const I=_().filter(F=>F.focusable),O=I.find(F=>F.active),D=I.find(F=>F.id===h),P=[O,D,...I].filter(Boolean).map(F=>F.ref.current);uh(P,u)}}C.current=!1}),onBlur:J(e.onBlur,()=>x(!1))})})}),lh="RovingFocusGroupItem",ch=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:a,...s}=e,l=Pt(),c=i||l,u=WM(lh,n),d=u.currentTabStopId===c,p=ah(n),{onFocusableItemAdd:m,onFocusableItemRemove:b,currentTabStopId:h}=u;return g.useEffect(()=>{if(r)return m(),()=>b()},[r,m,b]),f.jsx(gs.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:f.jsx(oe.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:J(e.onMouseDown,y=>{r?u.onItemFocus(c):y.preventDefault()}),onFocus:J(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:J(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=JM(y,u.orientation,u.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=p().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const _=w.indexOf(y.currentTarget);w=u.loop?QM(w,_+1):w.slice(_+1)}setTimeout(()=>uh(w))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:h!=null}):a})})});ch.displayName=lh;var YM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function XM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function JM(e,t,n){const r=XM(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return YM[r]}function uh(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function QM(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Vi=sh,Gi=ch,bs=["Enter"," "],eP=["ArrowDown","PageUp","Home"],dh=["ArrowUp","PageDown","End"],tP=[...eP,...dh],nP={ltr:[...bs,"ArrowRight"],rtl:[...bs,"ArrowLeft"]},rP={ltr:["ArrowLeft"],rtl:["ArrowRight"]},vo="Menu",[Qr,oP,iP]=uo(vo),[Qn,fh]=lt(vo,[iP,Mn,Pn]),Zi=Mn(),ph=Pn(),[aP,er]=Qn(vo),[sP,yo]=Qn(vo),mh=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:a=!0}=e,s=Zi(t),[l,c]=g.useState(null),u=g.useRef(!1),d=nn(i),p=On(o);return g.useEffect(()=>{const m=()=>{u.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>u.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),f.jsx(Bi,{...s,children:f.jsx(aP,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:f.jsx(sP,{scope:t,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:a,children:r})})})};mh.displayName=vo;var lP="MenuAnchor",Cl=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Zi(n);return f.jsx(go,{...o,...r,ref:t})});Cl.displayName=lP;var Tl="MenuPortal",[cP,hh]=Qn(Tl,{forceMount:void 0}),gh=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=er(Tl,t);return f.jsx(cP,{scope:t,forceMount:n,children:f.jsx(Nt,{present:n||i.open,children:f.jsx(Ar,{asChild:!0,container:o,children:r})})})};gh.displayName=Tl;var Wt="MenuContent",[uP,Al]=Qn(Wt),bh=g.forwardRef((e,t)=>{const n=hh(Wt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=er(Wt,e.__scopeMenu),a=yo(Wt,e.__scopeMenu);return f.jsx(Qr.Provider,{scope:e.__scopeMenu,children:f.jsx(Nt,{present:r||i.open,children:f.jsx(Qr.Slot,{scope:e.__scopeMenu,children:a.modal?f.jsx(dP,{...o,ref:t}):f.jsx(fP,{...o,ref:t})})})})}),dP=g.forwardRef((e,t)=>{const n=er(Wt,e.__scopeMenu),r=g.useRef(null),o=_e(t,r);return g.useEffect(()=>{const i=r.current;if(i)return zi(i)},[]),f.jsx(Il,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:J(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),fP=g.forwardRef((e,t)=>{const n=er(Wt,e.__scopeMenu);return f.jsx(Il,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),pP=Tn("MenuContent.ScrollLock"),Il=g.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:b,...h}=e,y=er(Wt,n),v=yo(Wt,n),x=Zi(n),w=ph(n),_=oP(n),[C,E]=g.useState(null),A=g.useRef(null),R=_e(t,A,y.onContentChange),M=g.useRef(0),T=g.useRef(""),I=g.useRef(0),O=g.useRef(null),D=g.useRef("right"),L=g.useRef(0),P=b?po:g.Fragment,F=b?{as:pP,allowPinchZoom:!0}:void 0,K=B=>{const S=T.current+B,le=_().filter(G=>!G.disabled),be=document.activeElement,k=le.find(G=>G.ref.current===be)?.textValue,Ee=le.map(G=>G.textValue),Le=kP(Ee,S,k),we=le.find(G=>G.textValue===Le)?.ref.current;(function G(se){T.current=se,window.clearTimeout(M.current),se!==""&&(M.current=window.setTimeout(()=>G(""),1e3))})(S),we&&setTimeout(()=>we.focus())};g.useEffect(()=>()=>window.clearTimeout(M.current),[]),Li();const V=g.useCallback(B=>D.current===O.current?.side&&CP(B,O.current?.area),[]);return f.jsx(uP,{scope:n,searchRef:T,onItemEnter:g.useCallback(B=>{V(B)&&B.preventDefault()},[V]),onItemLeave:g.useCallback(B=>{V(B)||(A.current?.focus(),E(null))},[V]),onTriggerLeave:g.useCallback(B=>{V(B)&&B.preventDefault()},[V]),pointerGraceTimerRef:I,onPointerGraceIntentChange:g.useCallback(B=>{O.current=B},[]),children:f.jsx(P,{...F,children:f.jsx(fo,{asChild:!0,trapped:o,onMountAutoFocus:J(i,B=>{B.preventDefault(),A.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:f.jsx(Tr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:f.jsx(Vi,{asChild:!0,...w,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:E,onEntryFocus:J(l,B=>{v.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(Ui,{role:"menu","aria-orientation":"vertical","data-state":Mh(y.open),"data-radix-menu-content":"",dir:v.dir,...x,...h,ref:R,style:{outline:"none",...h.style},onKeyDown:J(h.onKeyDown,B=>{const le=B.target.closest("[data-radix-menu-content]")===B.currentTarget,be=B.ctrlKey||B.altKey||B.metaKey,k=B.key.length===1;le&&(B.key==="Tab"&&B.preventDefault(),!be&&k&&K(B.key));const Ee=A.current;if(B.target!==Ee||!tP.includes(B.key))return;B.preventDefault();const we=_().filter(G=>!G.disabled).map(G=>G.ref.current);dh.includes(B.key)&&we.reverse(),EP(we)}),onBlur:J(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(M.current),T.current="")}),onPointerMove:J(e.onPointerMove,eo(B=>{const S=B.target,le=L.current!==B.clientX;if(B.currentTarget.contains(S)&&le){const be=B.clientX>L.current?"right":"left";D.current=be,L.current=B.clientX}}))})})})})})})});bh.displayName=Wt;var mP="MenuGroup",Rl=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(oe.div,{role:"group",...r,ref:t})});Rl.displayName=mP;var hP="MenuLabel",vh=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(oe.div,{...r,ref:t})});vh.displayName=hP;var gi="MenuItem",id="menu.itemSelect",Ki=g.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=g.useRef(null),a=yo(gi,e.__scopeMenu),s=Al(gi,e.__scopeMenu),l=_e(t,i),c=g.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const p=new CustomEvent(id,{bubbles:!0,cancelable:!0});d.addEventListener(id,m=>r?.(m),{once:!0}),Fp(d,p),p.defaultPrevented?c.current=!1:a.onClose()}};return f.jsx(yh,{...o,ref:l,disabled:n,onClick:J(e.onClick,u),onPointerDown:d=>{e.onPointerDown?.(d),c.current=!0},onPointerUp:J(e.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:J(e.onKeyDown,d=>{const p=s.searchRef.current!=="";n||p&&d.key===" "||bs.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Ki.displayName=gi;var yh=g.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,a=Al(gi,n),s=ph(n),l=g.useRef(null),c=_e(t,l),[u,d]=g.useState(!1),[p,m]=g.useState("");return g.useEffect(()=>{const b=l.current;b&&m((b.textContent??"").trim())},[i.children]),f.jsx(Qr.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:f.jsx(Gi,{asChild:!0,...s,focusable:!r,children:f.jsx(oe.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:J(e.onPointerMove,eo(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:J(e.onPointerLeave,eo(b=>a.onItemLeave(b))),onFocus:J(e.onFocus,()=>d(!0)),onBlur:J(e.onBlur,()=>d(!1))})})})}),gP="MenuCheckboxItem",xh=g.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return f.jsx(kh,{scope:e.__scopeMenu,checked:n,children:f.jsx(Ki,{role:"menuitemcheckbox","aria-checked":bi(n)?"mixed":n,...o,ref:t,"data-state":Ml(n),onSelect:J(o.onSelect,()=>r?.(bi(n)?!0:!n),{checkForDefaultPrevented:!1})})})});xh.displayName=gP;var wh="MenuRadioGroup",[bP,vP]=Qn(wh,{value:void 0,onValueChange:()=>{}}),_h=g.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=nn(r);return f.jsx(bP,{scope:e.__scopeMenu,value:n,onValueChange:i,children:f.jsx(Rl,{...o,ref:t})})});_h.displayName=wh;var Eh="MenuRadioItem",Sh=g.forwardRef((e,t)=>{const{value:n,...r}=e,o=vP(Eh,e.__scopeMenu),i=n===o.value;return f.jsx(kh,{scope:e.__scopeMenu,checked:i,children:f.jsx(Ki,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Ml(i),onSelect:J(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Sh.displayName=Eh;var Ol="MenuItemIndicator",[kh,yP]=Qn(Ol,{checked:!1}),Nh=g.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=yP(Ol,n);return f.jsx(Nt,{present:r||bi(i.checked)||i.checked===!0,children:f.jsx(oe.span,{...o,ref:t,"data-state":Ml(i.checked)})})});Nh.displayName=Ol;var xP="MenuSeparator",Ch=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(oe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Ch.displayName=xP;var wP="MenuArrow",Th=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Zi(n);return f.jsx(Hi,{...o,...r,ref:t})});Th.displayName=wP;var _P="MenuSub",[b2,Ah]=Qn(_P),Ur="MenuSubTrigger",Ih=g.forwardRef((e,t)=>{const n=er(Ur,e.__scopeMenu),r=yo(Ur,e.__scopeMenu),o=Ah(Ur,e.__scopeMenu),i=Al(Ur,e.__scopeMenu),a=g.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=g.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return g.useEffect(()=>u,[u]),g.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),f.jsx(Cl,{asChild:!0,...c,children:f.jsx(yh,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Mh(n.open),...e,ref:Oi(t,o.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:J(e.onPointerMove,eo(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:J(e.onPointerLeave,eo(d=>{u();const p=n.content?.getBoundingClientRect();if(p){const m=n.content?.dataset.side,b=m==="right",h=b?-5:5,y=p[b?"left":"right"],v=p[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+h,y:d.clientY},{x:y,y:p.top},{x:v,y:p.top},{x:v,y:p.bottom},{x:y,y:p.bottom}],side:m}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:J(e.onKeyDown,d=>{const p=i.searchRef.current!=="";e.disabled||p&&d.key===" "||nP[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});Ih.displayName=Ur;var Rh="MenuSubContent",Oh=g.forwardRef((e,t)=>{const n=hh(Wt,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=er(Wt,e.__scopeMenu),a=yo(Wt,e.__scopeMenu),s=Ah(Rh,e.__scopeMenu),l=g.useRef(null),c=_e(t,l);return f.jsx(Qr.Provider,{scope:e.__scopeMenu,children:f.jsx(Nt,{present:r||i.open,children:f.jsx(Qr.Slot,{scope:e.__scopeMenu,children:f.jsx(Il,{id:s.contentId,"aria-labelledby":s.triggerId,...o,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{a.isUsingKeyboardRef.current&&l.current?.focus(),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:J(e.onFocusOutside,u=>{u.target!==s.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:J(e.onEscapeKeyDown,u=>{a.onClose(),u.preventDefault()}),onKeyDown:J(e.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),p=rP[a.dir].includes(u.key);d&&p&&(i.onOpenChange(!1),s.trigger?.focus(),u.preventDefault())})})})})})});Oh.displayName=Rh;function Mh(e){return e?"open":"closed"}function bi(e){return e==="indeterminate"}function Ml(e){return bi(e)?"indeterminate":e?"checked":"unchecked"}function EP(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function SP(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function kP(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=SP(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function NP(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i],l=t[a],c=s.x,u=s.y,d=l.x,p=l.y;u>r!=p>r&&n<(d-c)*(r-u)/(p-u)+c&&(o=!o)}return o}function CP(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return NP(n,t)}function eo(e){return t=>t.pointerType==="mouse"?e(t):void 0}var TP=mh,AP=Cl,IP=gh,RP=bh,OP=Rl,MP=vh,PP=Ki,DP=xh,LP=_h,$P=Sh,zP=Nh,jP=Ch,FP=Th,BP=Ih,UP=Oh,Wi="DropdownMenu",[HP]=lt(Wi,[fh]),It=fh(),[VP,Ph]=HP(Wi),Dh=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,l=It(t),c=g.useRef(null),[u,d]=vt({prop:o,defaultProp:i??!1,onChange:a,caller:Wi});return f.jsx(VP,{scope:t,triggerId:Pt(),triggerRef:c,contentId:Pt(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(p=>!p),[d]),modal:s,children:f.jsx(TP,{...l,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Dh.displayName=Wi;var Lh="DropdownMenuTrigger",$h=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=Ph(Lh,n),a=It(n);return f.jsx(AP,{asChild:!0,...a,children:f.jsx(oe.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Oi(t,i.triggerRef),onPointerDown:J(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(i.onOpenToggle(),i.open||s.preventDefault())}),onKeyDown:J(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&i.onOpenToggle(),s.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});$h.displayName=Lh;var GP="DropdownMenuPortal",zh=e=>{const{__scopeDropdownMenu:t,...n}=e,r=It(t);return f.jsx(IP,{...r,...n})};zh.displayName=GP;var jh="DropdownMenuContent",Fh=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ph(jh,n),i=It(n),a=g.useRef(!1);return f.jsx(RP,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:J(e.onCloseAutoFocus,s=>{a.current||o.triggerRef.current?.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:J(e.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Fh.displayName=jh;var ZP="DropdownMenuGroup",KP=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=It(n);return f.jsx(OP,{...o,...r,ref:t})});KP.displayName=ZP;var WP="DropdownMenuLabel",qP=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=It(n);return f.jsx(MP,{...o,...r,ref:t})});qP.displayName=WP;var YP="DropdownMenuItem",Bh=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=It(n);return f.jsx(PP,{...o,...r,ref:t})});Bh.displayName=YP;var XP="DropdownMenuCheckboxItem",JP=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=It(n);return f.jsx(DP,{...o,...r,ref:t})});JP.displayName=XP;var QP="DropdownMenuRadioGroup",eD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=It(n);return f.jsx(LP,{...o,...r,ref:t})});eD.displayName=QP;var tD="DropdownMenuRadioItem",nD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=It(n);return f.jsx($P,{...o,...r,ref:t})});nD.displayName=tD;var rD="DropdownMenuItemIndicator",oD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=It(n);return f.jsx(zP,{...o,...r,ref:t})});oD.displayName=rD;var iD="DropdownMenuSeparator",aD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=It(n);return f.jsx(jP,{...o,...r,ref:t})});aD.displayName=iD;var sD="DropdownMenuArrow",lD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=It(n);return f.jsx(FP,{...o,...r,ref:t})});lD.displayName=sD;var cD="DropdownMenuSubTrigger",uD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=It(n);return f.jsx(BP,{...o,...r,ref:t})});uD.displayName=cD;var dD="DropdownMenuSubContent",fD=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=It(n);return f.jsx(UP,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fD.displayName=dD;var pD=Dh,mD=$h,hD=zh,gD=Fh,bD=Bh,vD="Label",Uh=g.forwardRef((e,t)=>f.jsx(oe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Uh.displayName=vD;var yD=Uh;function vi(e,[t,n]){return Math.min(n,Math.max(t,e))}var qi="Popover",[Hh]=lt(qi,[Mn]),xo=Mn(),[xD,Dn]=Hh(qi),Vh=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:a=!1}=e,s=xo(t),l=g.useRef(null),[c,u]=g.useState(!1),[d,p]=vt({prop:r,defaultProp:o??!1,onChange:i,caller:qi});return f.jsx(Bi,{...s,children:f.jsx(xD,{scope:t,contentId:Pt(),triggerRef:l,open:d,onOpenChange:p,onOpenToggle:g.useCallback(()=>p(m=>!m),[p]),hasCustomAnchor:c,onCustomAnchorAdd:g.useCallback(()=>u(!0),[]),onCustomAnchorRemove:g.useCallback(()=>u(!1),[]),modal:a,children:n})})};Vh.displayName=qi;var Gh="PopoverAnchor",wD=g.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Dn(Gh,n),i=xo(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:s}=o;return g.useEffect(()=>(a(),()=>s()),[a,s]),f.jsx(go,{...i,...r,ref:t})});wD.displayName=Gh;var Zh="PopoverTrigger",Kh=g.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Dn(Zh,n),i=xo(n),a=_e(t,o.triggerRef),s=f.jsx(oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Jh(o.open),...r,ref:a,onClick:J(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:f.jsx(go,{asChild:!0,...i,children:s})});Kh.displayName=Zh;var Pl="PopoverPortal",[_D,ED]=Hh(Pl,{forceMount:void 0}),Wh=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Dn(Pl,t);return f.jsx(_D,{scope:t,forceMount:n,children:f.jsx(Nt,{present:n||i.open,children:f.jsx(Ar,{asChild:!0,container:o,children:r})})})};Wh.displayName=Pl;var Er="PopoverContent",qh=g.forwardRef((e,t)=>{const n=ED(Er,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Dn(Er,e.__scopePopover);return f.jsx(Nt,{present:r||i.open,children:i.modal?f.jsx(kD,{...o,ref:t}):f.jsx(ND,{...o,ref:t})})});qh.displayName=Er;var SD=Tn("PopoverContent.RemoveScroll"),kD=g.forwardRef((e,t)=>{const n=Dn(Er,e.__scopePopover),r=g.useRef(null),o=_e(t,r),i=g.useRef(!1);return g.useEffect(()=>{const a=r.current;if(a)return zi(a)},[]),f.jsx(po,{as:SD,allowPinchZoom:!0,children:f.jsx(Yh,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,a=>{a.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0,c=s.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ND=g.forwardRef((e,t)=>{const n=Dn(Er,e.__scopePopover),r=g.useRef(!1),o=g.useRef(!1);return f.jsx(Yh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Yh=g.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,p=Dn(Er,n),m=xo(n);return Li(),f.jsx(fo,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:f.jsx(Tr,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:f.jsx(Ui,{"data-state":Jh(p.open),role:"dialog",id:p.contentId,...m,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Xh="PopoverClose",CD=g.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Dn(Xh,n);return f.jsx(oe.button,{type:"button",...r,ref:t,onClick:J(e.onClick,()=>o.onOpenChange(!1))})});CD.displayName=Xh;var TD="PopoverArrow",AD=g.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=xo(n);return f.jsx(Hi,{...o,...r,ref:t})});AD.displayName=TD;function Jh(e){return e?"open":"closed"}var ID=Vh,RD=Kh,OD=Wh,MD=qh,Dl="Progress",Ll=100,[PD]=lt(Dl),[DD,LD]=PD(Dl),Qh=g.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=$D,...a}=e;(o||o===0)&&!ad(o)&&console.error(zD(`${o}`,"Progress"));const s=ad(o)?o:Ll;r!==null&&!sd(r,s)&&console.error(jD(`${r}`,"Progress"));const l=sd(r,s)?r:null,c=yi(l)?i(l,s):void 0;return f.jsx(DD,{scope:n,value:l,max:s,children:f.jsx(oe.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":yi(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":ng(l,s),"data-value":l??void 0,"data-max":s,...a,ref:t})})});Qh.displayName=Dl;var eg="ProgressIndicator",tg=g.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=LD(eg,n);return f.jsx(oe.div,{"data-state":ng(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});tg.displayName=eg;function $D(e,t){return`${Math.round(e/t*100)}%`}function ng(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function yi(e){return typeof e=="number"}function ad(e){return yi(e)&&!isNaN(e)&&e>0}function sd(e,t){return yi(e)&&!isNaN(e)&&e<=t&&e>=0}function zD(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ll}\`.`}function jD(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
125
- - a positive number
126
- - less than the value passed to \`max\` (or ${Ll} if no \`max\` prop is set)
127
- - \`null\` or \`undefined\` if the progress is indeterminate.
128
-
129
- Defaulting to \`null\`.`}var FD=Qh,BD=tg,$l="Radio",[UD,rg]=lt($l),[HD,VD]=UD($l),og=g.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:a,value:s="on",onCheck:l,form:c,...u}=e,[d,p]=g.useState(null),m=_e(t,y=>p(y)),b=g.useRef(!1),h=d?c||!!d.closest("form"):!0;return f.jsxs(HD,{scope:n,checked:o,disabled:a,children:[f.jsx(oe.button,{type:"button",role:"radio","aria-checked":o,"data-state":lg(o),"data-disabled":a?"":void 0,disabled:a,value:s,...u,ref:m,onClick:J(e.onClick,y=>{o||l?.(),h&&(b.current=y.isPropagationStopped(),b.current||y.stopPropagation())})}),h&&f.jsx(sg,{control:d,bubbles:!b.current,name:r,value:s,checked:o,required:i,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});og.displayName=$l;var ig="RadioIndicator",ag=g.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=VD(ig,n);return f.jsx(Nt,{present:r||i.checked,children:f.jsx(oe.span,{"data-state":lg(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});ag.displayName=ig;var GD="RadioBubbleInput",sg=g.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const a=g.useRef(null),s=_e(a,i),l=mo(n),c=ho(t);return g.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&m){const b=new Event("click",{bubbles:r});m.call(u,n),u.dispatchEvent(b)}},[l,n,r]),f.jsx(oe.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});sg.displayName=GD;function lg(e){return e?"checked":"unchecked"}var ZD=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Yi="RadioGroup",[KD]=lt(Yi,[Pn,rg]),cg=Pn(),ug=rg(),[WD,qD]=KD(Yi),dg=g.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:a=!1,disabled:s=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...p}=e,m=cg(n),b=On(c),[h,y]=vt({prop:i,defaultProp:o??null,onChange:d,caller:Yi});return f.jsx(WD,{scope:n,name:r,required:a,disabled:s,value:h,onValueChange:y,children:f.jsx(Vi,{asChild:!0,...m,orientation:l,dir:b,loop:u,children:f.jsx(oe.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":s?"":void 0,dir:b,...p,ref:t})})})});dg.displayName=Yi;var fg="RadioGroupItem",pg=g.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=qD(fg,n),a=i.disabled||r,s=cg(n),l=ug(n),c=g.useRef(null),u=_e(t,c),d=i.value===o.value,p=g.useRef(!1);return g.useEffect(()=>{const m=h=>{ZD.includes(h.key)&&(p.current=!0)},b=()=>p.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",b)}},[]),f.jsx(Gi,{asChild:!0,...s,focusable:!a,active:d,children:f.jsx(og,{disabled:a,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:J(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:J(o.onFocus,()=>{p.current&&c.current?.click()})})})});pg.displayName=fg;var YD="RadioGroupIndicator",mg=g.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=ug(n);return f.jsx(ag,{...o,...r,ref:t})});mg.displayName=YD;var XD=dg,JD=pg,QD=mg,eL=[" ","Enter","ArrowUp","ArrowDown"],tL=[" ","Enter"],Kn="Select",[Xi,Ji,nL]=uo(Kn),[Ir]=lt(Kn,[nL,Mn]),Qi=Mn(),[rL,Ln]=Ir(Kn),[oL,iL]=Ir(Kn),hg=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:s,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:p,required:m,form:b}=e,h=Qi(t),[y,v]=g.useState(null),[x,w]=g.useState(null),[_,C]=g.useState(!1),E=On(c),[A,R]=vt({prop:r,defaultProp:o??!1,onChange:i,caller:Kn}),[M,T]=vt({prop:a,defaultProp:s,onChange:l,caller:Kn}),I=g.useRef(null),O=y?b||!!y.closest("form"):!0,[D,L]=g.useState(new Set),P=Array.from(D).map(F=>F.props.value).join(";");return f.jsx(Bi,{...h,children:f.jsxs(rL,{required:m,scope:t,trigger:y,onTriggerChange:v,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:_,onValueNodeHasChildrenChange:C,contentId:Pt(),value:M,onValueChange:T,open:A,onOpenChange:R,dir:E,triggerPointerDownPosRef:I,disabled:p,children:[f.jsx(Xi.Provider,{scope:t,children:f.jsx(oL,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(F=>{L(K=>new Set(K).add(F))},[]),onNativeOptionRemove:g.useCallback(F=>{L(K=>{const V=new Set(K);return V.delete(F),V})},[]),children:n})}),O?f.jsxs($g,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:d,value:M,onChange:F=>T(F.target.value),disabled:p,form:b,children:[M===void 0?f.jsx("option",{value:""}):null,Array.from(D)]},P):null]})})};hg.displayName=Kn;var gg="SelectTrigger",bg=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Qi(n),a=Ln(gg,n),s=a.disabled||r,l=_e(t,a.onTriggerChange),c=Ji(n),u=g.useRef("touch"),[d,p,m]=jg(h=>{const y=c().filter(w=>!w.disabled),v=y.find(w=>w.value===a.value),x=Fg(y,h,v);x!==void 0&&a.onValueChange(x.value)}),b=h=>{s||(a.onOpenChange(!0),m()),h&&(a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})};return f.jsx(go,{asChild:!0,...i,children:f.jsx(oe.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":zg(a.value)?"":void 0,...o,ref:l,onClick:J(o.onClick,h=>{h.currentTarget.focus(),u.current!=="mouse"&&b(h)}),onPointerDown:J(o.onPointerDown,h=>{u.current=h.pointerType;const y=h.target;y.hasPointerCapture(h.pointerId)&&y.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(b(h),h.preventDefault())}),onKeyDown:J(o.onKeyDown,h=>{const y=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&p(h.key),!(y&&h.key===" ")&&eL.includes(h.key)&&(b(),h.preventDefault())})})})});bg.displayName=gg;var vg="SelectValue",yg=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=Ln(vg,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=_e(t,l.onValueNodeChange);return st(()=>{c(u)},[c,u]),f.jsx(oe.span,{...s,ref:d,style:{pointerEvents:"none"},children:zg(l.value)?f.jsx(f.Fragment,{children:a}):i})});yg.displayName=vg;var aL="SelectIcon",xg=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return f.jsx(oe.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});xg.displayName=aL;var sL="SelectPortal",wg=e=>f.jsx(Ar,{asChild:!0,...e});wg.displayName=sL;var Wn="SelectContent",_g=g.forwardRef((e,t)=>{const n=Ln(Wn,e.__scopeSelect),[r,o]=g.useState();if(st(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Ps.createPortal(f.jsx(Eg,{scope:e.__scopeSelect,children:f.jsx(Xi.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),i):null}return f.jsx(Sg,{...e,ref:t})});_g.displayName=Wn;var Jt=10,[Eg,$n]=Ir(Wn),lL="SelectContentImpl",cL=Tn("SelectContent.RemoveScroll"),Sg=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:b,hideWhenDetached:h,avoidCollisions:y,...v}=e,x=Ln(Wn,n),[w,_]=g.useState(null),[C,E]=g.useState(null),A=_e(t,G=>_(G)),[R,M]=g.useState(null),[T,I]=g.useState(null),O=Ji(n),[D,L]=g.useState(!1),P=g.useRef(!1);g.useEffect(()=>{if(w)return zi(w)},[w]),Li();const F=g.useCallback(G=>{const[se,...Ce]=O().map(X=>X.ref.current),[fe]=Ce.slice(-1),ie=document.activeElement;for(const X of G)if(X===ie||(X?.scrollIntoView({block:"nearest"}),X===se&&C&&(C.scrollTop=0),X===fe&&C&&(C.scrollTop=C.scrollHeight),X?.focus(),document.activeElement!==ie))return},[O,C]),K=g.useCallback(()=>F([R,w]),[F,R,w]);g.useEffect(()=>{D&&K()},[D,K]);const{onOpenChange:V,triggerPointerDownPosRef:B}=x;g.useEffect(()=>{if(w){let G={x:0,y:0};const se=fe=>{G={x:Math.abs(Math.round(fe.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(fe.pageY)-(B.current?.y??0))}},Ce=fe=>{G.x<=10&&G.y<=10?fe.preventDefault():w.contains(fe.target)||V(!1),document.removeEventListener("pointermove",se),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[w,V,B]),g.useEffect(()=>{const G=()=>V(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[V]);const[S,le]=jg(G=>{const se=O().filter(ie=>!ie.disabled),Ce=se.find(ie=>ie.ref.current===document.activeElement),fe=Fg(se,G,Ce);fe&&setTimeout(()=>fe.ref.current.focus())}),be=g.useCallback((G,se,Ce)=>{const fe=!P.current&&!Ce;(x.value!==void 0&&x.value===se||fe)&&(M(G),fe&&(P.current=!0))},[x.value]),k=g.useCallback(()=>w?.focus(),[w]),Ee=g.useCallback((G,se,Ce)=>{const fe=!P.current&&!Ce;(x.value!==void 0&&x.value===se||fe)&&I(G)},[x.value]),Le=r==="popper"?vs:kg,we=Le===vs?{side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:b,hideWhenDetached:h,avoidCollisions:y}:{};return f.jsx(Eg,{scope:n,content:w,viewport:C,onViewportChange:E,itemRefCallback:be,selectedItem:R,onItemLeave:k,itemTextRefCallback:Ee,focusSelectedItem:K,selectedItemText:T,position:r,isPositioned:D,searchRef:S,children:f.jsx(po,{as:cL,allowPinchZoom:!0,children:f.jsx(fo,{asChild:!0,trapped:x.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:J(o,G=>{x.trigger?.focus({preventScroll:!0}),G.preventDefault()}),children:f.jsx(Tr,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:f.jsx(Le,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:G=>G.preventDefault(),...v,...we,onPlaced:()=>L(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:J(v.onKeyDown,G=>{const se=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!se&&G.key.length===1&&le(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let fe=O().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(G.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const ie=G.target,X=fe.indexOf(ie);fe=fe.slice(X+1)}setTimeout(()=>F(fe)),G.preventDefault()}})})})})})})});Sg.displayName=lL;var uL="SelectItemAlignedPosition",kg=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Ln(Wn,n),a=$n(Wn,n),[s,l]=g.useState(null),[c,u]=g.useState(null),d=_e(t,A=>u(A)),p=Ji(n),m=g.useRef(!1),b=g.useRef(!0),{viewport:h,selectedItem:y,selectedItemText:v,focusSelectedItem:x}=a,w=g.useCallback(()=>{if(i.trigger&&i.valueNode&&s&&c&&h&&y&&v){const A=i.trigger.getBoundingClientRect(),R=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),T=v.getBoundingClientRect();if(i.dir!=="rtl"){const ie=T.left-R.left,X=M.left-ie,xe=A.left-X,Q=A.width+xe,Fe=Math.max(Q,R.width),ve=window.innerWidth-Jt,Ve=vi(X,[Jt,Math.max(Jt,ve-Fe)]);s.style.minWidth=Q+"px",s.style.left=Ve+"px"}else{const ie=R.right-T.right,X=window.innerWidth-M.right-ie,xe=window.innerWidth-A.right-X,Q=A.width+xe,Fe=Math.max(Q,R.width),ve=window.innerWidth-Jt,Ve=vi(X,[Jt,Math.max(Jt,ve-Fe)]);s.style.minWidth=Q+"px",s.style.right=Ve+"px"}const I=p(),O=window.innerHeight-Jt*2,D=h.scrollHeight,L=window.getComputedStyle(c),P=parseInt(L.borderTopWidth,10),F=parseInt(L.paddingTop,10),K=parseInt(L.borderBottomWidth,10),V=parseInt(L.paddingBottom,10),B=P+F+D+V+K,S=Math.min(y.offsetHeight*5,B),le=window.getComputedStyle(h),be=parseInt(le.paddingTop,10),k=parseInt(le.paddingBottom,10),Ee=A.top+A.height/2-Jt,Le=O-Ee,we=y.offsetHeight/2,G=y.offsetTop+we,se=P+F+G,Ce=B-se;if(se<=Ee){const ie=I.length>0&&y===I[I.length-1].ref.current;s.style.bottom="0px";const X=c.clientHeight-h.offsetTop-h.offsetHeight,xe=Math.max(Le,we+(ie?k:0)+X+K),Q=se+xe;s.style.height=Q+"px"}else{const ie=I.length>0&&y===I[0].ref.current;s.style.top="0px";const xe=Math.max(Ee,P+h.offsetTop+(ie?be:0)+we)+Ce;s.style.height=xe+"px",h.scrollTop=se-Ee+h.offsetTop}s.style.margin=`${Jt}px 0`,s.style.minHeight=S+"px",s.style.maxHeight=O+"px",r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,i.trigger,i.valueNode,s,c,h,y,v,i.dir,r]);st(()=>w(),[w]);const[_,C]=g.useState();st(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const E=g.useCallback(A=>{A&&b.current===!0&&(w(),x?.(),b.current=!1)},[w,x]);return f.jsx(fL,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:E,children:f.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:f.jsx(oe.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});kg.displayName=uL;var dL="SelectPopperPosition",vs=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Jt,...i}=e,a=Qi(n);return f.jsx(Ui,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});vs.displayName=dL;var[fL,zl]=Ir(Wn,{}),ys="SelectViewport",Ng=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=$n(ys,n),a=zl(ys,n),s=_e(t,i.onViewportChange),l=g.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),f.jsx(Xi.Slot,{scope:n,children:f.jsx(oe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:J(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=a;if(p?.current&&d){const m=Math.abs(l.current-u.scrollTop);if(m>0){const b=window.innerHeight-Jt*2,h=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),v=Math.max(h,y);if(v<b){const x=v+m,w=Math.min(b,x),_=x-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Ng.displayName=ys;var Cg="SelectGroup",[pL,mL]=Ir(Cg),hL=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pt();return f.jsx(pL,{scope:n,id:o,children:f.jsx(oe.div,{role:"group","aria-labelledby":o,...r,ref:t})})});hL.displayName=Cg;var Tg="SelectLabel",gL=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=mL(Tg,n);return f.jsx(oe.div,{id:o.id,...r,ref:t})});gL.displayName=Tg;var xi="SelectItem",[bL,Ag]=Ir(xi),Ig=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,s=Ln(xi,n),l=$n(xi,n),c=s.value===r,[u,d]=g.useState(i??""),[p,m]=g.useState(!1),b=_e(t,x=>l.itemRefCallback?.(x,r,o)),h=Pt(),y=g.useRef("touch"),v=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(bL,{scope:n,value:r,disabled:o,textId:h,isSelected:c,onItemTextChange:g.useCallback(x=>{d(w=>w||(x?.textContent??"").trim())},[]),children:f.jsx(Xi.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:f.jsx(oe.div,{role:"option","aria-labelledby":h,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:b,onFocus:J(a.onFocus,()=>m(!0)),onBlur:J(a.onBlur,()=>m(!1)),onClick:J(a.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:J(a.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:J(a.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:J(a.onPointerMove,x=>{y.current=x.pointerType,o?l.onItemLeave?.():y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(a.onPointerLeave,x=>{x.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:J(a.onKeyDown,x=>{l.searchRef?.current!==""&&x.key===" "||(tL.includes(x.key)&&v(),x.key===" "&&x.preventDefault())})})})})});Ig.displayName=xi;var Hr="SelectItemText",Rg=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,a=Ln(Hr,n),s=$n(Hr,n),l=Ag(Hr,n),c=iL(Hr,n),[u,d]=g.useState(null),p=_e(t,v=>d(v),l.onItemTextChange,v=>s.itemTextRefCallback?.(v,l.value,l.disabled)),m=u?.textContent,b=g.useMemo(()=>f.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=c;return st(()=>(h(b),()=>y(b)),[h,y,b]),f.jsxs(f.Fragment,{children:[f.jsx(oe.span,{id:l.textId,...i,ref:p}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ps.createPortal(i.children,a.valueNode):null]})});Rg.displayName=Hr;var Og="SelectItemIndicator",Mg=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Ag(Og,n).isSelected?f.jsx(oe.span,{"aria-hidden":!0,...r,ref:t}):null});Mg.displayName=Og;var xs="SelectScrollUpButton",Pg=g.forwardRef((e,t)=>{const n=$n(xs,e.__scopeSelect),r=zl(xs,e.__scopeSelect),[o,i]=g.useState(!1),a=_e(t,r.onScrollButtonChange);return st(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?f.jsx(Lg,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});Pg.displayName=xs;var ws="SelectScrollDownButton",Dg=g.forwardRef((e,t)=>{const n=$n(ws,e.__scopeSelect),r=zl(ws,e.__scopeSelect),[o,i]=g.useState(!1),a=_e(t,r.onScrollButtonChange);return st(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),o?f.jsx(Lg,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});Dg.displayName=ws;var Lg=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=$n("SelectScrollButton",n),a=g.useRef(null),s=Ji(n),l=g.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),st(()=>{s().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),f.jsx(oe.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:J(o.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:J(o.onPointerMove,()=>{i.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:J(o.onPointerLeave,()=>{l()})})}),vL="SelectSeparator",yL=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(oe.div,{"aria-hidden":!0,...r,ref:t})});yL.displayName=vL;var _s="SelectArrow",xL=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Qi(n),i=Ln(_s,n),a=$n(_s,n);return i.open&&a.position==="popper"?f.jsx(Hi,{...o,...r,ref:t}):null});xL.displayName=_s;var wL="SelectBubbleInput",$g=g.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=g.useRef(null),i=_e(r,o),a=mo(t);return g.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&u){const d=new Event("change",{bubbles:!0});u.call(s,t),s.dispatchEvent(d)}},[a,t]),f.jsx(oe.select,{...n,style:{...Bp,...n.style},ref:i,defaultValue:t})});$g.displayName=wL;function zg(e){return e===""||e===void 0}function jg(e){const t=nn(e),n=g.useRef(""),r=g.useRef(0),o=g.useCallback(a=>{const s=n.current+a;t(s),(function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(s)},[t]),i=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Fg(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=_L(e,Math.max(i,0));o.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function _L(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var EL=hg,SL=bg,kL=yg,NL=xg,CL=wg,TL=_g,AL=Ng,IL=Ig,RL=Rg,OL=Mg,ML=Pg,PL=Dg,DL="Separator",ld="horizontal",LL=["horizontal","vertical"],Bg=g.forwardRef((e,t)=>{const{decorative:n,orientation:r=ld,...o}=e,i=$L(r)?r:ld,s=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return f.jsx(oe.div,{"data-orientation":i,...s,...o,ref:t})});Bg.displayName=DL;function $L(e){return LL.includes(e)}var zL=Bg,Ug=["PageUp","PageDown"],Hg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Vg={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Rr="Slider",[Es,jL,FL]=uo(Rr),[Gg]=lt(Rr,[FL]),[BL,ea]=Gg(Rr),Zg=g.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:a="horizontal",disabled:s=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:u,onValueChange:d=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:b,...h}=e,y=g.useRef(new Set),v=g.useRef(0),w=a==="horizontal"?UL:HL,[_=[],C]=vt({prop:u,defaultProp:c,onChange:I=>{[...y.current][v.current]?.focus(),d(I)}}),E=g.useRef(_);function A(I){const O=WL(_,I);T(I,O)}function R(I){T(I,v.current)}function M(){const I=E.current[v.current];_[v.current]!==I&&p(_)}function T(I,O,{commit:D}={commit:!1}){const L=JL(i),P=QL(Math.round((I-r)/i)*i+r,L),F=vi(P,[r,o]);C((K=[])=>{const V=ZL(K,F,O);if(XL(V,l*i)){v.current=V.indexOf(F);const B=String(V)!==String(K);return B&&D&&p(V),B?V:K}else return K})}return f.jsx(BL,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:o,valueIndexToChangeRef:v,thumbs:y.current,values:_,orientation:a,form:b,children:f.jsx(Es.Provider,{scope:e.__scopeSlider,children:f.jsx(Es.Slot,{scope:e.__scopeSlider,children:f.jsx(w,{"aria-disabled":s,"data-disabled":s?"":void 0,...h,ref:t,onPointerDown:J(h.onPointerDown,()=>{s||(E.current=_)}),min:r,max:o,inverted:m,onSlideStart:s?void 0:A,onSlideMove:s?void 0:R,onSlideEnd:s?void 0:M,onHomeKeyDown:()=>!s&&T(r,0,{commit:!0}),onEndKeyDown:()=>!s&&T(o,_.length-1,{commit:!0}),onStepKeyDown:({event:I,direction:O})=>{if(!s){const P=Ug.includes(I.key)||I.shiftKey&&Hg.includes(I.key)?10:1,F=v.current,K=_[F],V=i*P*O;T(K+V,F,{commit:!0})}}})})})})});Zg.displayName=Rr;var[Kg,Wg]=Gg(Rr,{startEdge:"left",endEdge:"right",size:"width",direction:1}),UL=g.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...u}=e,[d,p]=g.useState(null),m=_e(t,w=>p(w)),b=g.useRef(void 0),h=On(o),y=h==="ltr",v=y&&!i||!y&&i;function x(w){const _=b.current||d.getBoundingClientRect(),C=[0,_.width],A=jl(C,v?[n,r]:[r,n]);return b.current=_,A(w-_.left)}return f.jsx(Kg,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:f.jsx(qg,{dir:h,"data-orientation":"horizontal",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const _=x(w.clientX);a?.(_)},onSlideMove:w=>{const _=x(w.clientX);s?.(_)},onSlideEnd:()=>{b.current=void 0,l?.()},onStepKeyDown:w=>{const C=Vg[v?"from-left":"from-right"].includes(w.key);c?.({event:w,direction:C?-1:1})}})})}),HL=g.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:a,onSlideEnd:s,onStepKeyDown:l,...c}=e,u=g.useRef(null),d=_e(t,u),p=g.useRef(void 0),m=!o;function b(h){const y=p.current||u.current.getBoundingClientRect(),v=[0,y.height],w=jl(v,m?[r,n]:[n,r]);return p.current=y,w(h-y.top)}return f.jsx(Kg,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:f.jsx(qg,{"data-orientation":"vertical",...c,ref:d,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:h=>{const y=b(h.clientY);i?.(y)},onSlideMove:h=>{const y=b(h.clientY);a?.(y)},onSlideEnd:()=>{p.current=void 0,s?.()},onStepKeyDown:h=>{const v=Vg[m?"from-bottom":"from-top"].includes(h.key);l?.({event:h,direction:v?-1:1})}})})}),qg=g.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,u=ea(Rr,n);return f.jsx(oe.span,{...c,ref:t,onKeyDown:J(e.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(s(d),d.preventDefault()):Ug.concat(Hg).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:J(e.onPointerDown,d=>{const p=d.target;p.setPointerCapture(d.pointerId),d.preventDefault(),u.thumbs.has(p)?p.focus():r(d)}),onPointerMove:J(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&o(d)}),onPointerUp:J(e.onPointerUp,d=>{const p=d.target;p.hasPointerCapture(d.pointerId)&&(p.releasePointerCapture(d.pointerId),i(d))})})}),Yg="SliderTrack",Xg=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=ea(Yg,n);return f.jsx(oe.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})});Xg.displayName=Yg;var Ss="SliderRange",Jg=g.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=ea(Ss,n),i=Wg(Ss,n),a=g.useRef(null),s=_e(t,a),l=o.values.length,c=o.values.map(p=>tb(p,o.min,o.max)),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return f.jsx(oe.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...r,ref:s,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:d+"%"}})});Jg.displayName=Ss;var ks="SliderThumb",Qg=g.forwardRef((e,t)=>{const n=jL(e.__scopeSlider),[r,o]=g.useState(null),i=_e(t,s=>o(s)),a=g.useMemo(()=>r?n().findIndex(s=>s.ref.current===r):-1,[n,r]);return f.jsx(VL,{...e,ref:i,index:a})}),VL=g.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:o,...i}=e,a=ea(ks,n),s=Wg(ks,n),[l,c]=g.useState(null),u=_e(t,x=>c(x)),d=l?a.form||!!l.closest("form"):!0,p=ho(l),m=a.values[r],b=m===void 0?0:tb(m,a.min,a.max),h=KL(r,a.values.length),y=p?.[s.size],v=y?qL(y,b,s.direction):0;return g.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),f.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${b}% + ${v}px)`},children:[f.jsx(Es.ItemSlot,{scope:e.__scopeSlider,children:f.jsx(oe.span,{role:"slider","aria-label":e["aria-label"]||h,"aria-valuemin":a.min,"aria-valuenow":m,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:u,style:m===void 0?{display:"none"}:e.style,onFocus:J(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),d&&f.jsx(eb,{name:o??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:m},r)]})});Qg.displayName=ks;var GL="RadioBubbleInput",eb=g.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const o=g.useRef(null),i=_e(o,r),a=mo(t);return g.useEffect(()=>{const s=o.current;if(!s)return;const l=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&u){const d=new Event("input",{bubbles:!0});u.call(s,t),s.dispatchEvent(d)}},[a,t]),f.jsx(oe.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});eb.displayName=GL;function ZL(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function tb(e,t,n){const i=100/(n-t)*(e-t);return vi(i,[0,100])}function KL(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function WL(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function qL(e,t,n){const r=e/2,i=jl([0,50],[0,r]);return(r-i(t)*n)*n}function YL(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function XL(e,t){if(t>0){const n=YL(e);return Math.min(...n)>=t}return!0}function jl(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function JL(e){return(String(e).split(".")[1]||"").length}function QL(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var e$=Zg,t$=Xg,n$=Jg,r$=Qg,ta="Switch",[o$]=lt(ta),[i$,a$]=o$(ta),nb=g.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,m]=g.useState(null),b=_e(t,w=>m(w)),h=g.useRef(!1),y=p?u||!!p.closest("form"):!0,[v,x]=vt({prop:o,defaultProp:i??!1,onChange:c,caller:ta});return f.jsxs(i$,{scope:n,checked:v,disabled:s,children:[f.jsx(oe.button,{type:"button",role:"switch","aria-checked":v,"aria-required":a,"data-state":ab(v),"data-disabled":s?"":void 0,disabled:s,value:l,...d,ref:b,onClick:J(e.onClick,w=>{x(_=>!_),y&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})}),y&&f.jsx(ib,{control:p,bubbles:!h.current,name:r,value:l,checked:v,required:a,disabled:s,form:u,style:{transform:"translateX(-100%)"}})]})});nb.displayName=ta;var rb="SwitchThumb",ob=g.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=a$(rb,n);return f.jsx(oe.span,{"data-state":ab(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});ob.displayName=rb;var s$="SwitchBubbleInput",ib=g.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},i)=>{const a=g.useRef(null),s=_e(a,i),l=mo(n),c=ho(t);return g.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&m){const b=new Event("click",{bubbles:r});m.call(u,n),u.dispatchEvent(b)}},[l,n,r]),f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...o.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ib.displayName=s$;function ab(e){return e?"checked":"unchecked"}var l$=nb,c$=ob,na="Tabs",[u$]=lt(na,[Pn]),sb=Pn(),[d$,Fl]=u$(na),lb=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=On(s),[d,p]=vt({prop:r,onChange:o,defaultProp:i??"",caller:na});return f.jsx(d$,{scope:n,baseId:Pt(),value:d,onValueChange:p,orientation:a,dir:u,activationMode:l,children:f.jsx(oe.div,{dir:u,"data-orientation":a,...c,ref:t})})});lb.displayName=na;var cb="TabsList",ub=g.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Fl(cb,n),a=sb(n);return f.jsx(Vi,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:f.jsx(oe.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});ub.displayName=cb;var db="TabsTrigger",fb=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=Fl(db,n),s=sb(n),l=mb(a.baseId,r),c=hb(a.baseId,r),u=r===a.value;return f.jsx(Gi,{asChild:!0,...s,focusable:!o,active:u,children:f.jsx(oe.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:J(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:J(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:J(e.onFocus,()=>{const d=a.activationMode!=="manual";!u&&!o&&d&&a.onValueChange(r)})})})});fb.displayName=db;var pb="TabsContent",f$=g.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=Fl(pb,n),l=mb(s.baseId,r),c=hb(s.baseId,r),u=r===s.value,d=g.useRef(u);return g.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),f.jsx(Nt,{present:o||u,children:({present:p})=>f.jsx(oe.div,{"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&i})})});f$.displayName=pb;function mb(e,t){return`${e}-trigger-${t}`}function hb(e,t){return`${e}-content-${t}`}var p$=lb,m$=ub,h$=fb,gb="Toggle",Bl=g.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...i}=e,[a,s]=vt({prop:n,onChange:o,defaultProp:r??!1,caller:gb});return f.jsx(oe.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:J(e.onClick,()=>{e.disabled||s(!a)})})});Bl.displayName=gb;var g$=Bl,zn="ToggleGroup",[bb]=lt(zn,[Pn]),vb=Pn(),Ul=H.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return f.jsx(b$,{...o,ref:t})}if(n==="multiple"){const o=r;return f.jsx(v$,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${zn}\``)});Ul.displayName=zn;var[yb,xb]=bb(zn),b$=H.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=vt({prop:n,defaultProp:r??"",onChange:o,caller:zn});return f.jsx(yb,{scope:e.__scopeToggleGroup,type:"single",value:H.useMemo(()=>a?[a]:[],[a]),onItemActivate:s,onItemDeactivate:H.useCallback(()=>s(""),[s]),children:f.jsx(wb,{...i,ref:t})})}),v$=H.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[a,s]=vt({prop:n,defaultProp:r??[],onChange:o,caller:zn}),l=H.useCallback(u=>s((d=[])=>[...d,u]),[s]),c=H.useCallback(u=>s((d=[])=>d.filter(p=>p!==u)),[s]);return f.jsx(yb,{scope:e.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:l,onItemDeactivate:c,children:f.jsx(wb,{...i,ref:t})})});Ul.displayName=zn;var[y$,x$]=bb(zn),wb=H.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:i,dir:a,loop:s=!0,...l}=e,c=vb(n),u=On(a),d={role:"group",dir:u,...l};return f.jsx(y$,{scope:n,rovingFocus:o,disabled:r,children:o?f.jsx(Vi,{asChild:!0,...c,orientation:i,dir:u,loop:s,children:f.jsx(oe.div,{...d,ref:t})}):f.jsx(oe.div,{...d,ref:t})})}),wi="ToggleGroupItem",_b=H.forwardRef((e,t)=>{const n=xb(wi,e.__scopeToggleGroup),r=x$(wi,e.__scopeToggleGroup),o=vb(e.__scopeToggleGroup),i=n.value.includes(e.value),a=r.disabled||e.disabled,s={...e,pressed:i,disabled:a},l=H.useRef(null);return r.rovingFocus?f.jsx(Gi,{asChild:!0,...o,focusable:!a,active:i,ref:l,children:f.jsx(cd,{...s,ref:t})}):f.jsx(cd,{...s,ref:t})});_b.displayName=wi;var cd=H.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,i=xb(wi,n),a={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s=i.type==="single"?a:void 0;return f.jsx(Bl,{...s,...o,ref:t,onPressedChange:l=>{l?i.onItemActivate(r):i.onItemDeactivate(r)}})}),w$=Ul,_$=_b,[ra]=lt("Tooltip",[Mn]),oa=Mn(),Eb="TooltipProvider",E$=700,Ns="tooltip.open",[S$,Hl]=ra(Eb),Sb=e=>{const{__scopeTooltip:t,delayDuration:n=E$,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,a=g.useRef(!0),s=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),f.jsx(S$,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:g.useCallback(c=>{s.current=c},[]),disableHoverableContent:o,children:i})};Sb.displayName=Eb;var to="Tooltip",[k$,wo]=ra(to),kb=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=Hl(to,e.__scopeTooltip),c=oa(t),[u,d]=g.useState(null),p=Pt(),m=g.useRef(0),b=a??l.disableHoverableContent,h=s??l.delayDuration,y=g.useRef(!1),[v,x]=vt({prop:r,defaultProp:o??!1,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ns))):l.onClose(),i?.(A)},caller:to}),w=g.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),_=g.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,x(!0)},[x]),C=g.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x(!1)},[x]),E=g.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,x(!0),m.current=0},h)},[h,x]);return g.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),f.jsx(Bi,{...c,children:f.jsx(k$,{scope:t,contentId:p,open:v,stateAttribute:w,trigger:u,onTriggerChange:d,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayedRef.current?E():_()},[l.isOpenDelayedRef,E,_]),onTriggerLeave:g.useCallback(()=>{b?C():(window.clearTimeout(m.current),m.current=0)},[C,b]),onOpen:_,onClose:C,disableHoverableContent:b,children:n})})};kb.displayName=to;var Cs="TooltipTrigger",Nb=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=wo(Cs,n),i=Hl(Cs,n),a=oa(n),s=g.useRef(null),l=_e(t,s,o.onTriggerChange),c=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),f.jsx(go,{asChild:!0,...a,children:f.jsx(oe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:J(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:J(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:J(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:J(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:J(e.onBlur,o.onClose),onClick:J(e.onClick,o.onClose)})})});Nb.displayName=Cs;var Vl="TooltipPortal",[N$,C$]=ra(Vl,{forceMount:void 0}),Cb=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=wo(Vl,t);return f.jsx(N$,{scope:t,forceMount:n,children:f.jsx(Nt,{present:n||i.open,children:f.jsx(Ar,{asChild:!0,container:o,children:r})})})};Cb.displayName=Vl;var Sr="TooltipContent",Tb=g.forwardRef((e,t)=>{const n=C$(Sr,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=wo(Sr,e.__scopeTooltip);return f.jsx(Nt,{present:r||a.open,children:a.disableHoverableContent?f.jsx(Ab,{side:o,...i,ref:t}):f.jsx(T$,{side:o,...i,ref:t})})}),T$=g.forwardRef((e,t)=>{const n=wo(Sr,e.__scopeTooltip),r=Hl(Sr,e.__scopeTooltip),o=g.useRef(null),i=_e(t,o),[a,s]=g.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,p=g.useCallback(()=>{s(null),d(!1)},[d]),m=g.useCallback((b,h)=>{const y=b.currentTarget,v={x:b.clientX,y:b.clientY},x=O$(v,y.getBoundingClientRect()),w=M$(v,x),_=P$(h.getBoundingClientRect()),C=L$([...w,..._]);s(C),d(!0)},[d]);return g.useEffect(()=>()=>p(),[p]),g.useEffect(()=>{if(l&&u){const b=y=>m(y,u),h=y=>m(y,l);return l.addEventListener("pointerleave",b),u.addEventListener("pointerleave",h),()=>{l.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",h)}}},[l,u,m,p]),g.useEffect(()=>{if(a){const b=h=>{const y=h.target,v={x:h.clientX,y:h.clientY},x=l?.contains(y)||u?.contains(y),w=!D$(v,a);x?p():w&&(p(),c())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,u,a,c,p]),f.jsx(Ab,{...e,ref:i})}),[A$,I$]=ra(to,{isInside:!1}),R$=AO("TooltipContent"),Ab=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=wo(Sr,n),c=oa(n),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(Ns,u),()=>document.removeEventListener(Ns,u)),[u]),g.useEffect(()=>{if(l.trigger){const d=p=>{p.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),f.jsx(Tr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:f.jsxs(Ui,{"data-state":l.stateAttribute,...c,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(R$,{children:r}),f.jsx(A$,{scope:n,isInside:!0,children:f.jsx(DO,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Tb.displayName=Sr;var Ib="TooltipArrow",Rb=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=oa(n);return I$(Ib,n).isInside?null:f.jsx(Hi,{...o,...r,ref:t})});Rb.displayName=Ib;function O$(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function M$(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function P$(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function D$(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const s=t[i],l=t[a],c=s.x,u=s.y,d=l.x,p=l.y;u>r!=p>r&&n<(d-c)*(r-u)/(p-u)+c&&(o=!o)}return o}function L$(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),$$(t)}function $$(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var z$=Sb,j$=kb,F$=Nb,B$=Cb,U$=Tb,H$=Rb;const Ob=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const V$=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const G$=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const ud=e=>{const t=G$(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Z$={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const K$=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const W$=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>g.createElement("svg",{ref:l,...Z$,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ob("lucide",o),...!i&&!K$(s)&&{"aria-hidden":"true"},...s},[...a.map(([c,u])=>g.createElement(c,u)),...Array.isArray(i)?i:[i]]));const hn=(e,t)=>{const n=g.forwardRef(({className:r,...o},i)=>g.createElement(W$,{ref:i,iconNode:t,className:Ob(`lucide-${V$(ud(e))}`,`lucide-${e}`,r),...o}));return n.displayName=ud(e),n};const q$=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Y$=hn("arrow-left",q$);const X$=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],J$=hn("arrow-right",X$);const Q$=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Mb=hn("check",Q$);const ez=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Gl=hn("chevron-down",ez);const tz=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],nz=hn("chevron-left",tz);const rz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],oz=hn("chevron-right",rz);const iz=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],az=hn("chevron-up",iz);const sz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],lz=hn("circle",sz);const cz=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],uz=hn("ellipsis",cz);const dz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fz=hn("x",dz);function pz(e){return Object.prototype.toString.call(e)==="[object Object]"}function dd(e){return pz(e)||Array.isArray(e)}function mz(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Zl(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const o=JSON.stringify(Object.keys(e.breakpoints||{})),i=JSON.stringify(Object.keys(t.breakpoints||{}));return o!==i?!1:n.every(a=>{const s=e[a],l=t[a];return typeof s=="function"?`${s}`==`${l}`:!dd(s)||!dd(l)?s===l:Zl(s,l)})}function fd(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function hz(e,t){if(e.length!==t.length)return!1;const n=fd(e),r=fd(t);return n.every((o,i)=>{const a=r[i];return Zl(o,a)})}function Kl(e){return typeof e=="number"}function Ts(e){return typeof e=="string"}function ia(e){return typeof e=="boolean"}function pd(e){return Object.prototype.toString.call(e)==="[object Object]"}function et(e){return Math.abs(e)}function Wl(e){return Math.sign(e)}function Wr(e,t){return et(e-t)}function gz(e,t){if(e===0||t===0||et(e)<=et(t))return 0;const n=Wr(et(e),et(t));return et(n/e)}function bz(e){return Math.round(e*100)/100}function no(e){return ro(e).map(Number)}function tn(e){return e[_o(e)]}function _o(e){return Math.max(0,e.length-1)}function ql(e,t){return t===_o(e)}function md(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function ro(e){return Object.keys(e)}function Pb(e,t){return[e,t].reduce((n,r)=>(ro(r).forEach(o=>{const i=n[o],a=r[o],s=pd(i)&&pd(a);n[o]=s?Pb(i,a):a}),n),{})}function As(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function vz(e,t){const n={start:r,center:o,end:i};function r(){return 0}function o(l){return i(l)/2}function i(l){return t-l}function a(l,c){return Ts(e)?n[e](l):e(t,l,c)}return{measure:a}}function oo(){let e=[];function t(o,i,a,s={passive:!0}){let l;if("addEventListener"in o)o.addEventListener(i,a,s),l=()=>o.removeEventListener(i,a,s);else{const c=o;c.addListener(a),l=()=>c.removeListener(a)}return e.push(l),r}function n(){e=e.filter(o=>o())}const r={add:t,clear:n};return r}function yz(e,t,n,r){const o=oo(),i=1e3/60;let a=null,s=0,l=0;function c(){o.add(e,"visibilitychange",()=>{e.hidden&&b()})}function u(){m(),o.clear()}function d(y){if(!l)return;a||(a=y,n(),n());const v=y-a;for(a=y,s+=v;s>=i;)n(),s-=i;const x=s/i;r(x),l&&(l=t.requestAnimationFrame(d))}function p(){l||(l=t.requestAnimationFrame(d))}function m(){t.cancelAnimationFrame(l),a=null,s=0,l=0}function b(){a=null,s=0}return{init:c,destroy:u,start:p,stop:m,update:n,render:r}}function xz(e,t){const n=t==="rtl",r=e==="y",o=r?"y":"x",i=r?"x":"y",a=!r&&n?-1:1,s=u(),l=d();function c(b){const{height:h,width:y}=b;return r?h:y}function u(){return r?"top":n?"right":"left"}function d(){return r?"bottom":n?"left":"right"}function p(b){return b*a}return{scroll:o,cross:i,startEdge:s,endEdge:l,measureSize:c,direction:p}}function qn(e=0,t=0){const n=et(e-t);function r(c){return c<e}function o(c){return c>t}function i(c){return r(c)||o(c)}function a(c){return i(c)?r(c)?e:t:c}function s(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:a,reachedAny:i,reachedMax:o,reachedMin:r,removeOffset:s}}function Db(e,t,n){const{constrain:r}=qn(0,e),o=e+1;let i=a(t);function a(p){return n?et((o+p)%o):r(p)}function s(){return i}function l(p){return i=a(p),d}function c(p){return u().set(s()+p)}function u(){return Db(e,s(),n)}const d={get:s,set:l,add:c,clone:u};return d}function wz(e,t,n,r,o,i,a,s,l,c,u,d,p,m,b,h,y,v,x){const{cross:w,direction:_}=e,C=["INPUT","SELECT","TEXTAREA"],E={passive:!1},A=oo(),R=oo(),M=qn(50,225).constrain(m.measure(20)),T={mouse:300,touch:400},I={mouse:500,touch:600},O=b?43:25;let D=!1,L=0,P=0,F=!1,K=!1,V=!1,B=!1;function S(X){if(!x)return;function xe(Fe){(ia(x)||x(X,Fe))&&we(Fe)}const Q=t;A.add(Q,"dragstart",Fe=>Fe.preventDefault(),E).add(Q,"touchmove",()=>{},E).add(Q,"touchend",()=>{}).add(Q,"touchstart",xe).add(Q,"mousedown",xe).add(Q,"touchcancel",se).add(Q,"contextmenu",se).add(Q,"click",Ce,!0)}function le(){A.clear(),R.clear()}function be(){const X=B?n:t;R.add(X,"touchmove",G,E).add(X,"touchend",se).add(X,"mousemove",G,E).add(X,"mouseup",se)}function k(X){const xe=X.nodeName||"";return C.includes(xe)}function Ee(){return(b?I:T)[B?"mouse":"touch"]}function Le(X,xe){const Q=d.add(Wl(X)*-1),Fe=u.byDistance(X,!b).distance;return b||et(X)<M?Fe:y&&xe?Fe*.5:u.byIndex(Q.get(),0).distance}function we(X){const xe=As(X,r);B=xe,V=b&&xe&&!X.buttons&&D,D=Wr(o.get(),a.get())>=2,!(xe&&X.button!==0)&&(k(X.target)||(F=!0,i.pointerDown(X),c.useFriction(0).useDuration(0),o.set(a),be(),L=i.readPoint(X),P=i.readPoint(X,w),p.emit("pointerDown")))}function G(X){if(!As(X,r)&&X.touches.length>=2)return se(X);const Q=i.readPoint(X),Fe=i.readPoint(X,w),ve=Wr(Q,L),Ve=Wr(Fe,P);if(!K&&!B&&(!X.cancelable||(K=ve>Ve,!K)))return se(X);const ct=i.pointerMove(X);ve>h&&(V=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(_(ct)),X.preventDefault()}function se(X){const Q=u.byDistance(0,!1).index!==d.get(),Fe=i.pointerUp(X)*Ee(),ve=Le(_(Fe),Q),Ve=gz(Fe,ve),ct=O-10*Ve,yt=v+Ve/50;K=!1,F=!1,R.clear(),c.useDuration(ct).useFriction(yt),l.distance(ve,!b),B=!1,p.emit("pointerUp")}function Ce(X){V&&(X.stopPropagation(),X.preventDefault(),V=!1)}function fe(){return F}return{init:S,destroy:le,pointerDown:fe}}function _z(e,t){let r,o;function i(d){return d.timeStamp}function a(d,p){const b=`client${(p||e.scroll)==="x"?"X":"Y"}`;return(As(d,t)?d:d.touches[0])[b]}function s(d){return r=d,o=d,a(d)}function l(d){const p=a(d)-a(o),m=i(d)-i(r)>170;return o=d,m&&(r=d),p}function c(d){if(!r||!o)return 0;const p=a(o)-a(r),m=i(d)-i(r),b=i(d)-i(o)>170,h=p/m;return m&&!b&&et(h)>.1?h:0}return{pointerDown:s,pointerMove:l,pointerUp:c,readPoint:a}}function Ez(){function e(n){const{offsetTop:r,offsetLeft:o,offsetWidth:i,offsetHeight:a}=n;return{top:r,right:o+i,bottom:r+a,left:o,width:i,height:a}}return{measure:e}}function Sz(e){function t(r){return e*(r/100)}return{measure:t}}function kz(e,t,n,r,o,i,a){const s=[e].concat(r);let l,c,u=[],d=!1;function p(y){return o.measureSize(a.measure(y))}function m(y){if(!i)return;c=p(e),u=r.map(p);function v(x){for(const w of x){if(d)return;const _=w.target===e,C=r.indexOf(w.target),E=_?c:u[C],A=p(_?e:r[C]);if(et(A-E)>=.5){y.reInit(),t.emit("resize");break}}}l=new ResizeObserver(x=>{(ia(i)||i(y,x))&&v(x)}),n.requestAnimationFrame(()=>{s.forEach(x=>l.observe(x))})}function b(){d=!0,l&&l.disconnect()}return{init:m,destroy:b}}function Nz(e,t,n,r,o,i){let a=0,s=0,l=o,c=i,u=e.get(),d=0;function p(){const E=r.get()-e.get(),A=!l;let R=0;return A?(a=0,n.set(r),e.set(r),R=E):(n.set(e),a+=E/l,a*=c,u+=a,e.add(a),R=u-d),s=Wl(R),d=u,C}function m(){const E=r.get()-t.get();return et(E)<.001}function b(){return l}function h(){return s}function y(){return a}function v(){return w(o)}function x(){return _(i)}function w(E){return l=E,C}function _(E){return c=E,C}const C={direction:h,duration:b,velocity:y,seek:p,settled:m,useBaseFriction:x,useBaseDuration:v,useFriction:_,useDuration:w};return C}function Cz(e,t,n,r,o){const i=o.measure(10),a=o.measure(50),s=qn(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(m){if(!c())return;const b=e.reachedMin(t.get())?"min":"max",h=et(e[b]-t.get()),y=n.get()-t.get(),v=s.constrain(h/a);n.subtract(y*v),!m&&et(y)<i&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(m){l=!m}return{shouldConstrain:c,constrain:u,toggleActive:d}}function Tz(e,t,n,r,o){const i=qn(-t+e,0),a=d(),s=u(),l=p();function c(b,h){return Wr(b,h)<=1}function u(){const b=a[0],h=tn(a),y=a.lastIndexOf(b),v=a.indexOf(h)+1;return qn(y,v)}function d(){return n.map((b,h)=>{const{min:y,max:v}=i,x=i.constrain(b),w=!h,_=ql(n,h);return w?v:_||c(y,x)?y:c(v,x)?v:x}).map(b=>parseFloat(b.toFixed(3)))}function p(){if(t<=e+o)return[i.max];if(r==="keepSnaps")return a;const{min:b,max:h}=s;return a.slice(b,h)}return{snapsContained:l,scrollContainLimit:s}}function Az(e,t,n){const r=t[0],o=n?r-e:tn(t);return{limit:qn(o,r)}}function Iz(e,t,n,r){const i=t.min+.1,a=t.max+.1,{reachedMin:s,reachedMax:l}=qn(i,a);function c(p){return p===1?l(n.get()):p===-1?s(n.get()):!1}function u(p){if(!c(p))return;const m=e*(p*-1);r.forEach(b=>b.add(m))}return{loop:u}}function Rz(e){const{max:t,length:n}=e;function r(i){const a=i-t;return n?a/-n:0}return{get:r}}function Oz(e,t,n,r,o){const{startEdge:i,endEdge:a}=e,{groupSlides:s}=o,l=d().map(t.measure),c=p(),u=m();function d(){return s(r).map(h=>tn(h)[a]-h[0][i]).map(et)}function p(){return r.map(h=>n[i]-h[i]).map(h=>-et(h))}function m(){return s(c).map(h=>h[0]).map((h,y)=>h+l[y])}return{snaps:c,snapsAligned:u}}function Mz(e,t,n,r,o,i){const{groupSlides:a}=o,{min:s,max:l}=r,c=u();function u(){const p=a(i),m=!e||t==="keepSnaps";return n.length===1?[i]:m?p:p.slice(s,l).map((b,h,y)=>{const v=!h,x=ql(y,h);if(v){const w=tn(y[0])+1;return md(w)}if(x){const w=_o(i)-tn(y)[0]+1;return md(w,tn(y)[0])}return b})}return{slideRegistry:c}}function Pz(e,t,n,r,o){const{reachedAny:i,removeOffset:a,constrain:s}=r;function l(b){return b.concat().sort((h,y)=>et(h)-et(y))[0]}function c(b){const h=e?a(b):s(b),y=t.map((x,w)=>({diff:u(x-h,0),index:w})).sort((x,w)=>et(x.diff)-et(w.diff)),{index:v}=y[0];return{index:v,distance:h}}function u(b,h){const y=[b,b+n,b-n];if(!e)return b;if(!h)return l(y);const v=y.filter(x=>Wl(x)===h);return v.length?l(v):tn(y)-n}function d(b,h){const y=t[b]-o.get(),v=u(y,h);return{index:b,distance:v}}function p(b,h){const y=o.get()+b,{index:v,distance:x}=c(y),w=!e&&i(y);if(!h||w)return{index:v,distance:b};const _=t[v]-x,C=b+u(_,0);return{index:v,distance:C}}return{byDistance:p,byIndex:d,shortcut:u}}function Dz(e,t,n,r,o,i,a){function s(d){const p=d.distance,m=d.index!==t.get();i.add(p),p&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),m&&(n.set(t.get()),t.set(d.index),a.emit("select"))}function l(d,p){const m=o.byDistance(d,p);s(m)}function c(d,p){const m=t.clone().set(d),b=o.byIndex(m.get(),p);s(b)}return{distance:l,index:c}}function Lz(e,t,n,r,o,i,a,s){const l={passive:!0,capture:!0};let c=0;function u(m){if(!s)return;function b(h){if(new Date().getTime()-c>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const x=n.findIndex(w=>w.includes(h));Kl(x)&&(o.useDuration(0),r.index(x,0),a.emit("slideFocus"))}i.add(document,"keydown",d,!1),t.forEach((h,y)=>{i.add(h,"focus",v=>{(ia(s)||s(m,v))&&b(y)},l)})}function d(m){m.code==="Tab"&&(c=new Date().getTime())}return{init:u}}function Vr(e){let t=e;function n(){return t}function r(l){t=a(l)}function o(l){t+=a(l)}function i(l){t-=a(l)}function a(l){return Kl(l)?l:l.get()}return{get:n,set:r,add:o,subtract:i}}function Lb(e,t){const n=e.scroll==="x"?a:s,r=t.style;let o=null,i=!1;function a(p){return`translate3d(${p}px,0px,0px)`}function s(p){return`translate3d(0px,${p}px,0px)`}function l(p){if(i)return;const m=bz(e.direction(p));m!==o&&(r.transform=n(m),o=m)}function c(p){i=!p}function u(){i||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:u,to:l,toggleActive:c}}function $z(e,t,n,r,o,i,a,s,l){const u=no(o),d=no(o).reverse(),p=v().concat(x());function m(A,R){return A.reduce((M,T)=>M-o[T],R)}function b(A,R){return A.reduce((M,T)=>m(M,R)>0?M.concat([T]):M,[])}function h(A){return i.map((R,M)=>({start:R-r[M]+.5+A,end:R+t-.5+A}))}function y(A,R,M){const T=h(R);return A.map(I=>{const O=M?0:-n,D=M?n:0,L=M?"end":"start",P=T[I][L];return{index:I,loopPoint:P,slideLocation:Vr(-1),translate:Lb(e,l[I]),target:()=>s.get()>P?O:D}})}function v(){const A=a[0],R=b(d,A);return y(R,n,!1)}function x(){const A=t-a[0]-1,R=b(u,A);return y(R,-n,!0)}function w(){return p.every(({index:A})=>{const R=u.filter(M=>M!==A);return m(R,t)<=.1})}function _(){p.forEach(A=>{const{target:R,translate:M,slideLocation:T}=A,I=R();I!==T.get()&&(M.to(I),T.set(I))})}function C(){p.forEach(A=>A.translate.clear())}return{canLoop:w,clear:C,loop:_,loopPoints:p}}function zz(e,t,n){let r,o=!1;function i(l){if(!n)return;function c(u){for(const d of u)if(d.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(u=>{o||(ia(n)||n(l,u))&&c(u)}),r.observe(e,{childList:!0})}function a(){r&&r.disconnect(),o=!0}return{init:i,destroy:a}}function jz(e,t,n,r){const o={};let i=null,a=null,s,l=!1;function c(){s=new IntersectionObserver(b=>{l||(b.forEach(h=>{const y=t.indexOf(h.target);o[y]=h}),i=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(b=>s.observe(b))}function u(){s&&s.disconnect(),l=!0}function d(b){return ro(o).reduce((h,y)=>{const v=parseInt(y),{isIntersecting:x}=o[v];return(b&&x||!b&&!x)&&h.push(v),h},[])}function p(b=!0){if(b&&i)return i;if(!b&&a)return a;const h=d(b);return b&&(i=h),b||(a=h),h}return{init:c,destroy:u,get:p}}function Fz(e,t,n,r,o,i){const{measureSize:a,startEdge:s,endEdge:l}=e,c=n[0]&&o,u=b(),d=h(),p=n.map(a),m=y();function b(){if(!c)return 0;const x=n[0];return et(t[s]-x[s])}function h(){if(!c)return 0;const x=i.getComputedStyle(tn(r));return parseFloat(x.getPropertyValue(`margin-${l}`))}function y(){return n.map((x,w,_)=>{const C=!w,E=ql(_,w);return C?p[w]+u:E?p[w]+d:_[w+1][s]-x[s]}).map(et)}return{slideSizes:p,slideSizesWithGaps:m,startGap:u,endGap:d}}function Bz(e,t,n,r,o,i,a,s,l){const{startEdge:c,endEdge:u,direction:d}=e,p=Kl(n);function m(v,x){return no(v).filter(w=>w%x===0).map(w=>v.slice(w,w+x))}function b(v){return v.length?no(v).reduce((x,w,_)=>{const C=tn(x)||0,E=C===0,A=w===_o(v),R=o[c]-i[C][c],M=o[c]-i[w][u],T=!r&&E?d(a):0,I=!r&&A?d(s):0,O=et(M-I-(R+T));return _&&O>t+l&&x.push(w),A&&x.push(v.length),x},[]).map((x,w,_)=>{const C=Math.max(_[w-1]||0);return v.slice(C,x)}):[]}function h(v){return p?m(v,n):b(v)}return{groupSlides:h}}function Uz(e,t,n,r,o,i,a){const{align:s,axis:l,direction:c,startIndex:u,loop:d,duration:p,dragFree:m,dragThreshold:b,inViewThreshold:h,slidesToScroll:y,skipSnaps:v,containScroll:x,watchResize:w,watchSlides:_,watchDrag:C,watchFocus:E}=i,A=2,R=Ez(),M=R.measure(t),T=n.map(R.measure),I=xz(l,c),O=I.measureSize(M),D=Sz(O),L=vz(s,O),P=!d&&!!x,F=d||!!x,{slideSizes:K,slideSizesWithGaps:V,startGap:B,endGap:S}=Fz(I,M,T,n,F,o),le=Bz(I,O,y,d,M,T,B,S,A),{snaps:be,snapsAligned:k}=Oz(I,L,M,T,le),Ee=-tn(be)+tn(V),{snapsContained:Le,scrollContainLimit:we}=Tz(O,Ee,k,x,A),G=P?Le:k,{limit:se}=Az(Ee,G,d),Ce=Db(_o(G),u,d),fe=Ce.clone(),ie=no(n),X=({dragHandler:Te,scrollBody:ut,scrollBounds:dt,options:{loop:ft}})=>{ft||dt.constrain(Te.pointerDown()),ut.seek()},xe=({scrollBody:Te,translate:ut,location:dt,offsetLocation:ft,previousLocation:Ht,scrollLooper:Yt,slideLooper:pt,dragHandler:Vt,animation:xt,eventHandler:he,scrollBounds:Me,options:{loop:$e}},Ie)=>{const ze=Te.settled(),N=!Me.shouldConstrain(),$=$e?ze:ze&&N,q=$&&!Vt.pointerDown();q&&xt.stop();const ce=dt.get()*Ie+Ht.get()*(1-Ie);ft.set(ce),$e&&(Yt.loop(Te.direction()),pt.loop()),ut.to(ft.get()),q&&he.emit("settle"),$||he.emit("scroll")},Q=yz(r,o,()=>X(Se),Te=>xe(Se,Te)),Fe=.68,ve=G[Ce.get()],Ve=Vr(ve),ct=Vr(ve),yt=Vr(ve),rt=Vr(ve),Ut=Nz(Ve,yt,ct,rt,p,Fe),gn=Pz(d,G,Ee,se,rt),Rt=Dz(Q,Ce,fe,Ut,gn,rt,a),Ot=Rz(se),an=oo(),z=jz(t,n,a,h),{slideRegistry:W}=Mz(P,x,G,we,le,ie),me=Lz(e,n,W,Rt,Ut,an,a,E),Se={ownerDocument:r,ownerWindow:o,eventHandler:a,containerRect:M,slideRects:T,animation:Q,axis:I,dragHandler:wz(I,e,r,o,rt,_z(I,o),Ve,Q,Rt,Ut,gn,Ce,a,D,m,b,v,Fe,C),eventStore:an,percentOfView:D,index:Ce,indexPrevious:fe,limit:se,location:Ve,offsetLocation:yt,previousLocation:ct,options:i,resizeHandler:kz(t,a,o,n,I,w,R),scrollBody:Ut,scrollBounds:Cz(se,yt,rt,Ut,D),scrollLooper:Iz(Ee,se,yt,[Ve,yt,ct,rt]),scrollProgress:Ot,scrollSnapList:G.map(Ot.get),scrollSnaps:G,scrollTarget:gn,scrollTo:Rt,slideLooper:$z(I,O,Ee,K,V,be,G,yt,n),slideFocus:me,slidesHandler:zz(t,a,_),slidesInView:z,slideIndexes:ie,slideRegistry:W,slidesToScroll:le,target:rt,translate:Lb(I,t)};return Se}function Hz(){let e={},t;function n(c){t=c}function r(c){return e[c]||[]}function o(c){return r(c).forEach(u=>u(t,c)),l}function i(c,u){return e[c]=r(c).concat([u]),l}function a(c,u){return e[c]=r(c).filter(d=>d!==u),l}function s(){e={}}const l={init:n,emit:o,off:a,on:i,clear:s};return l}const Vz={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Gz(e){function t(i,a){return Pb(i,a||{})}function n(i){const a=i.breakpoints||{},s=ro(a).filter(l=>e.matchMedia(l).matches).map(l=>a[l]).reduce((l,c)=>t(l,c),{});return t(i,s)}function r(i){return i.map(a=>ro(a.breakpoints||{})).reduce((a,s)=>a.concat(s),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function Zz(e){let t=[];function n(i,a){return t=a.filter(({options:s})=>e.optionsAtMedia(s).active!==!1),t.forEach(s=>s.init(i,e)),a.reduce((s,l)=>Object.assign(s,{[l.name]:l}),{})}function r(){t=t.filter(i=>i.destroy())}return{init:n,destroy:r}}function _i(e,t,n){const r=e.ownerDocument,o=r.defaultView,i=Gz(o),a=Zz(i),s=oo(),l=Hz(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=i,{on:p,off:m,emit:b}=l,h=I;let y=!1,v,x=c(Vz,_i.globalOptions),w=c(x),_=[],C,E,A;function R(){const{container:ie,slides:X}=w;E=(Ts(ie)?e.querySelector(ie):ie)||e.children[0];const Q=Ts(X)?E.querySelectorAll(X):X;A=[].slice.call(Q||E.children)}function M(ie){const X=Uz(e,E,A,r,o,ie,l);if(ie.loop&&!X.slideLooper.canLoop()){const xe=Object.assign({},ie,{loop:!1});return M(xe)}return X}function T(ie,X){y||(x=c(x,ie),w=u(x),_=X||_,R(),v=M(w),d([x,..._.map(({options:xe})=>xe)]).forEach(xe=>s.add(xe,"change",I)),w.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(fe),v.eventHandler.init(fe),v.resizeHandler.init(fe),v.slidesHandler.init(fe),v.options.loop&&v.slideLooper.loop(),E.offsetParent&&A.length&&v.dragHandler.init(fe),C=a.init(fe,_)))}function I(ie,X){const xe=le();O(),T(c({startIndex:xe},ie),X),l.emit("reInit")}function O(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),a.destroy(),s.clear()}function D(){y||(y=!0,s.clear(),O(),l.emit("destroy"),l.clear())}function L(ie,X,xe){!w.active||y||(v.scrollBody.useBaseFriction().useDuration(X===!0?0:w.duration),v.scrollTo.index(ie,xe||0))}function P(ie){const X=v.index.add(1).get();L(X,ie,-1)}function F(ie){const X=v.index.add(-1).get();L(X,ie,1)}function K(){return v.index.add(1).get()!==le()}function V(){return v.index.add(-1).get()!==le()}function B(){return v.scrollSnapList}function S(){return v.scrollProgress.get(v.offsetLocation.get())}function le(){return v.index.get()}function be(){return v.indexPrevious.get()}function k(){return v.slidesInView.get()}function Ee(){return v.slidesInView.get(!1)}function Le(){return C}function we(){return v}function G(){return e}function se(){return E}function Ce(){return A}const fe={canScrollNext:K,canScrollPrev:V,containerNode:se,internalEngine:we,destroy:D,off:m,on:p,emit:b,plugins:Le,previousScrollSnap:be,reInit:h,rootNode:G,scrollNext:P,scrollPrev:F,scrollProgress:S,scrollSnapList:B,scrollTo:L,selectedScrollSnap:le,slideNodes:Ce,slidesInView:k,slidesNotInView:Ee};return T(t,n),setTimeout(()=>l.emit("init"),0),fe}_i.globalOptions=void 0;function Yl(e={},t=[]){const n=g.useRef(e),r=g.useRef(t),[o,i]=g.useState(),[a,s]=g.useState(),l=g.useCallback(()=>{o&&o.reInit(n.current,r.current)},[o]);return g.useEffect(()=>{Zl(n.current,e)||(n.current=e,l())},[e,l]),g.useEffect(()=>{hz(r.current,t)||(r.current=t,l())},[t,l]),g.useEffect(()=>{if(mz()&&a){_i.globalOptions=Yl.globalOptions;const c=_i(a,n.current,r.current);return i(c),()=>c.destroy()}else i(void 0)},[a,i]),[s,o]}Yl.globalOptions=void 0;function Kz(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const $b=H.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Eo=()=>{const e=H.useContext($b);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Kz(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
130
- [data-state=closed]
131
- ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Wz(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function qz(){return Xl(/^Mac/)}function Yz(){return Xl(/^iPhone/)}function hd(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Xz(){return Xl(/^iPad/)||qz()&&navigator.maxTouchPoints>1}function zb(){return Yz()||Xz()}function Xl(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Jz=24,Qz=typeof window<"u"?g.useLayoutEffect:g.useEffect;function gd(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Za=typeof document<"u"&&window.visualViewport;function bd(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function jb(e){for(bd(e)&&(e=e.parentElement);e&&!bd(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const ej=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Wo=0,Ka;function tj(e={}){let{isDisabled:t}=e;Qz(()=>{if(!t)return Wo++,Wo===1&&zb()&&(Ka=nj()),()=>{Wo--,Wo===0&&Ka?.()}},[t])}function nj(){let e,t=0,n=d=>{e=jb(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let p=d.changedTouches[0].pageY,m=e.scrollTop,b=e.scrollHeight-e.clientHeight;b!==0&&((m<=0&&p>t||m>=b&&p<t)&&d.preventDefault(),t=p)},o=d=>{let p=d.target;Is(p)&&p!==document.activeElement&&(d.preventDefault(),p.style.transform="translateY(-2000px)",p.focus(),requestAnimationFrame(()=>{p.style.transform=""}))},i=d=>{let p=d.target;Is(p)&&(p.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{p.style.transform="",Za&&(Za.height<window.innerHeight?requestAnimationFrame(()=>{vd(p)}):Za.addEventListener("resize",()=>vd(p),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=gd(rj(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=gd(jr(document,"touchstart",n,{passive:!1,capture:!0}),jr(document,"touchmove",r,{passive:!1,capture:!0}),jr(document,"touchend",o,{passive:!1,capture:!0}),jr(document,"focus",i,!0),jr(window,"scroll",a));return()=>{c(),u(),window.scrollTo(s,l)}}function rj(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function jr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function vd(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=jb(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+Jz;i>a&&(n.scrollTop+=o-r)}e=n.parentElement}}function Is(e){return e instanceof HTMLInputElement&&!ej.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function oj(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ij(...e){return t=>e.forEach(n=>oj(n,t))}function Fb(...e){return g.useCallback(ij(...e),e)}const Bb=new WeakMap;function ht(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Bb.set(e,r)}function aj(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Bb.get(e);n&&(e.style[t]=n[t])}const at=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function qo(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[at(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[at(t)?5:4]):null)}function sj(e){return 8*(Math.log(e+1)-2)}function Wa(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function lj(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Qe={DURATION:.5,EASE:[.32,.72,0,1]},Ub=.4,cj=.25,uj=100,Hb=8,Bn=16,Rs=26,qa="vaul-dragging";function Vb(e){const t=H.useRef(e);return H.useEffect(()=>{t.current=e}),H.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function dj({defaultProp:e,onChange:t}){const n=H.useState(e),[r]=n,o=H.useRef(r),i=Vb(t);return H.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Gb({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=dj({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=Vb(n),l=H.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function fj({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:a,direction:s="bottom",container:l,snapToSequentialPoint:c}){const[u,d]=Gb({prop:e,defaultProp:n?.[0],onChange:t}),[p,m]=H.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);H.useEffect(()=>{function A(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]);const b=H.useMemo(()=>u===n?.[n.length-1]||null,[n,u]),h=H.useMemo(()=>{var A;return(A=n?.findIndex(R=>R===u))!=null?A:null},[n,u]),y=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===u||!n,v=H.useMemo(()=>{const A=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var R;return(R=n?.map(M=>{const T=typeof M=="string";let I=0;if(T&&(I=parseInt(M,10)),at(s)){const D=T?I:p?M*A.height:0;return p?s==="bottom"?A.height-D:-A.height+D:D}const O=T?I:p?M*A.width:0;return p?s==="right"?A.width-O:-A.width+O:O}))!=null?R:[]},[n,p,l]),x=H.useMemo(()=>h!==null?v?.[h]:null,[v,h]),w=H.useCallback(A=>{var R;const M=(R=v?.findIndex(T=>T===A))!=null?R:null;a(M),ht(r.current,{transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,transform:at(s)?`translate3d(0, ${A}px, 0)`:`translate3d(${A}px, 0, 0)`}),v&&M!==v.length-1&&i!==void 0&&M!==i&&M<i?ht(o.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,opacity:"0"}):ht(o.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(M,0)])},[r.current,n,v,i,o,d]);H.useEffect(()=>{if(u||e){var A;const R=(A=n?.findIndex(M=>M===e||M===u))!=null?A:-1;v&&R!==-1&&typeof v[R]=="number"&&w(v[R])}},[u,e,n,v,w]);function _({draggedDistance:A,closeDrawer:R,velocity:M,dismissible:T}){if(i===void 0)return;const I=s==="bottom"||s==="right"?(x??0)-A:(x??0)+A,O=h===i-1,D=h===0,L=A>0;if(O&&ht(o.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`}),!c&&M>2&&!L){T?R():w(v[0]);return}if(!c&&M>2&&L&&v&&n){w(v[n.length-1]);return}const P=v?.reduce((K,V)=>typeof K!="number"||typeof V!="number"?K:Math.abs(V-I)<Math.abs(K-I)?V:K),F=at(s)?window.innerHeight:window.innerWidth;if(M>Ub&&Math.abs(A)<F*.4){const K=L?1:-1;if(K>0&&b&&n){w(v[n.length-1]);return}if(D&&K<0&&T&&R(),h===null)return;w(v[h+K]);return}w(P)}function C({draggedDistance:A}){if(x===null)return;const R=s==="bottom"||s==="right"?x-A:x+A;(s==="bottom"||s==="right")&&R<v[v.length-1]||(s==="top"||s==="left")&&R>v[v.length-1]||ht(r.current,{transform:at(s)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`})}function E(A,R){if(!n||typeof h!="number"||!v||i===void 0)return null;const M=h===i-1;if(h>=i&&R)return 0;if(M&&!R)return 1;if(!y&&!M)return null;const I=M?h+1:h-1,O=M?v[I]-v[I-1]:v[I+1]-v[I],D=A/Math.abs(O);return M?1-D:D}return{isLastSnapPoint:b,activeSnapPoint:u,shouldFade:y,getPercentageDragged:E,setActiveSnapPoint:d,activeSnapPointIndex:h,onRelease:_,onDrag:C,snapPointsOffset:v}}const pj=()=>()=>{};function mj(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=Eo(),i=H.useRef(null),a=g.useMemo(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-Rs)/window.innerWidth}H.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;lj(r&&!o?Wa(document.body,{background:"black"}):pj,Wa(l,{transformOrigin:at(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Qe.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Qe.EASE.join(",")})`}));const c=Wa(l,{borderRadius:`${Hb}px`,overflow:"hidden",...at(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},Qe.DURATION*1e3)}}},[t,n,a])}let Fr=null;function hj({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[a,s]=H.useState(()=>typeof window<"u"?window.location.href:""),l=H.useRef(0),c=H.useCallback(()=>{if(hd()&&Fr===null&&e&&!i){Fr={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:p}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const m=p-window.innerHeight;m&&l.current>=p&&(document.body.style.top=`${-(l.current+m)}px`)}),300)}},[e]),u=H.useCallback(()=>{if(hd()&&Fr!==null&&!i){const d=-parseInt(document.body.style.top,10),p=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Fr),window.requestAnimationFrame(()=>{if(o&&a!==window.location.href){s(window.location.href);return}window.scrollTo(p,d)}),Fr=null}},[a]);return H.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),H.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),H.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,a,t,n,c,u]),{restorePositionSetting:u}}function gj({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:s=!0,closeThreshold:l=cj,scrollLockTimeout:c=uj,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:p=i&&i.length-1,activeSnapPoint:m,setActiveSnapPoint:b,fixed:h,modal:y=!0,onClose:v,nested:x,noBodyStyles:w=!1,direction:_="bottom",defaultOpen:C=!1,disablePreventScroll:E=!0,snapToSequentialPoint:A=!1,preventScrollRestoration:R=!1,repositionInputs:M=!0,onAnimationEnd:T,container:I,autoFocus:O=!1}){var D,L;const[P=!1,F]=Gb({defaultProp:C,prop:e,onChange:he=>{t?.(he),!he&&!x&&W(),setTimeout(()=>{T?.(he)},Qe.DURATION*1e3),he&&!y&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),he||(document.body.style.pointerEvents="auto")}}),[K,V]=H.useState(!1),[B,S]=H.useState(!1),[le,be]=H.useState(!1),k=H.useRef(null),Ee=H.useRef(null),Le=H.useRef(null),we=H.useRef(null),G=H.useRef(null),se=H.useRef(!1),Ce=H.useRef(null),fe=H.useRef(0),ie=H.useRef(!1),X=H.useRef(!C),xe=H.useRef(0),Q=H.useRef(null),Fe=H.useRef(((D=Q.current)==null?void 0:D.getBoundingClientRect().height)||0),ve=H.useRef(((L=Q.current)==null?void 0:L.getBoundingClientRect().width)||0),Ve=H.useRef(0),ct=H.useCallback(he=>{i&&he===Rt.length-1&&(Ee.current=new Date)},[]),{activeSnapPoint:yt,activeSnapPointIndex:rt,setActiveSnapPoint:Ut,onRelease:gn,snapPointsOffset:Rt,onDrag:Ot,shouldFade:an,getPercentageDragged:z}=fj({snapPoints:i,activeSnapPointProp:m,setActiveSnapPointProp:b,drawerRef:Q,fadeFromIndex:p,overlayRef:k,onSnapPointChange:ct,direction:_,container:I,snapToSequentialPoint:A});tj({isDisabled:!P||B||!y||le||!K||!M||!E});const{restorePositionSetting:W}=hj({isOpen:P,modal:y,nested:x??!1,hasBeenOpened:K,preventScrollRestoration:R,noBodyStyles:w});function me(){return(window.innerWidth-Rs)/window.innerWidth}function Se(he){var Me,$e;!u&&!i||Q.current&&!Q.current.contains(he.target)||(Fe.current=((Me=Q.current)==null?void 0:Me.getBoundingClientRect().height)||0,ve.current=(($e=Q.current)==null?void 0:$e.getBoundingClientRect().width)||0,S(!0),Le.current=new Date,zb()&&window.addEventListener("touchend",()=>se.current=!1,{once:!0}),he.target.setPointerCapture(he.pointerId),fe.current=at(_)?he.pageY:he.pageX)}function Te(he,Me){var $e;let Ie=he;const ze=($e=window.getSelection())==null?void 0:$e.toString(),N=Q.current?qo(Q.current,_):null,$=new Date;if(Ie.tagName==="SELECT"||Ie.hasAttribute("data-vaul-no-drag")||Ie.closest("[data-vaul-no-drag]"))return!1;if(_==="right"||_==="left")return!0;if(Ee.current&&$.getTime()-Ee.current.getTime()<500)return!1;if(N!==null&&(_==="bottom"?N>0:N<0))return!0;if(ze&&ze.length>0)return!1;if(G.current&&$.getTime()-G.current.getTime()<c&&N===0||Me)return G.current=$,!1;for(;Ie;){if(Ie.scrollHeight>Ie.clientHeight){if(Ie.scrollTop!==0)return G.current=new Date,!1;if(Ie.getAttribute("role")==="dialog")return!0}Ie=Ie.parentNode}return!0}function ut(he){if(Q.current&&B){const Me=_==="bottom"||_==="right"?1:-1,$e=(fe.current-(at(_)?he.pageY:he.pageX))*Me,Ie=$e>0,ze=i&&!u&&!Ie;if(ze&&rt===0)return;const N=Math.abs($e),$=document.querySelector("[data-vaul-drawer-wrapper]"),q=_==="bottom"||_==="top"?Fe.current:ve.current;let ce=N/q;const Be=z(N,Ie);if(Be!==null&&(ce=Be),ze&&ce>=1||!se.current&&!Te(he.target,Ie))return;if(Q.current.classList.add(qa),se.current=!0,ht(Q.current,{transition:"none"}),ht(k.current,{transition:"none"}),i&&Ot({draggedDistance:$e}),Ie&&!i){const ne=sj($e),re=Math.min(ne*-1,0)*Me;ht(Q.current,{transform:at(_)?`translate3d(0, ${re}px, 0)`:`translate3d(${re}px, 0, 0)`});return}const je=1-ce;if((an||p&&rt===p-1)&&(r?.(he,ce),ht(k.current,{opacity:`${je}`,transition:"none"},!0)),$&&k.current&&a){const ne=Math.min(me()+ce*(1-me()),1),re=8-ce*8,ye=Math.max(0,14-ce*14);ht($,{borderRadius:`${re}px`,transform:at(_)?`scale(${ne}) translate3d(0, ${ye}px, 0)`:`scale(${ne}) translate3d(${ye}px, 0, 0)`,transition:"none"},!0)}if(!i){const ne=N*Me;ht(Q.current,{transform:at(_)?`translate3d(0, ${ne}px, 0)`:`translate3d(${ne}px, 0, 0)`})}}}H.useEffect(()=>{window.requestAnimationFrame(()=>{X.current=!0})},[]),H.useEffect(()=>{var he;function Me(){if(!Q.current||!M)return;const $e=document.activeElement;if(Is($e)||ie.current){var Ie;const ze=((Ie=window.visualViewport)==null?void 0:Ie.height)||0,N=window.innerHeight;let $=N-ze;const q=Q.current.getBoundingClientRect().height||0,ce=q>N*.8;Ve.current||(Ve.current=q);const Be=Q.current.getBoundingClientRect().top;if(Math.abs(xe.current-$)>60&&(ie.current=!ie.current),i&&i.length>0&&Rt&&rt){const je=Rt[rt]||0;$+=je}if(xe.current=$,q>ze||ie.current){const je=Q.current.getBoundingClientRect().height;let ne=je;je>ze&&(ne=ze-(ce?Be:Rs)),h?Q.current.style.height=`${je-Math.max($,0)}px`:Q.current.style.height=`${Math.max(ne,ze-Be)}px`}else Wz()||(Q.current.style.height=`${Ve.current}px`);i&&i.length>0&&!ie.current?Q.current.style.bottom="0px":Q.current.style.bottom=`${Math.max($,0)}px`}}return(he=window.visualViewport)==null||he.addEventListener("resize",Me),()=>{var $e;return($e=window.visualViewport)==null?void 0:$e.removeEventListener("resize",Me)}},[rt,i,Rt]);function dt(he){Ht(),v?.(),he||F(!1),setTimeout(()=>{i&&Ut(i[0])},Qe.DURATION*1e3)}function ft(){if(!Q.current)return;const he=document.querySelector("[data-vaul-drawer-wrapper]"),Me=qo(Q.current,_);ht(Q.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`}),ht(k.current,{transition:`opacity ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,opacity:"1"}),a&&Me&&Me>0&&P&&ht(he,{borderRadius:`${Hb}px`,overflow:"hidden",...at(_)?{transform:`scale(${me()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${me()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Qe.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Qe.EASE.join(",")})`},!0)}function Ht(){!B||!Q.current||(Q.current.classList.remove(qa),se.current=!1,S(!1),we.current=new Date)}function Yt(he){if(!B||!Q.current)return;Q.current.classList.remove(qa),se.current=!1,S(!1),we.current=new Date;const Me=qo(Q.current,_);if(!he||!Te(he.target,!1)||!Me||Number.isNaN(Me)||Le.current===null)return;const $e=we.current.getTime()-Le.current.getTime(),Ie=fe.current-(at(_)?he.pageY:he.pageX),ze=Math.abs(Ie)/$e;if(ze>.05&&(be(!0),setTimeout(()=>{be(!1)},200)),i){gn({draggedDistance:Ie*(_==="bottom"||_==="right"?1:-1),closeDrawer:dt,velocity:ze,dismissible:u}),o?.(he,!0);return}if(_==="bottom"||_==="right"?Ie>0:Ie<0){ft(),o?.(he,!0);return}if(ze>Ub){dt(),o?.(he,!1);return}var N;const $=Math.min((N=Q.current.getBoundingClientRect().height)!=null?N:0,window.innerHeight);var q;const ce=Math.min((q=Q.current.getBoundingClientRect().width)!=null?q:0,window.innerWidth),Be=_==="left"||_==="right";if(Math.abs(Me)>=(Be?ce:$)*l){dt(),o?.(he,!1);return}o?.(he,!0),ft()}H.useEffect(()=>(P&&(ht(document.documentElement,{scrollBehavior:"auto"}),Ee.current=new Date),()=>{aj(document.documentElement,"scrollBehavior")}),[P]);function pt(he){const Me=he?(window.innerWidth-Bn)/window.innerWidth:1,$e=he?-Bn:0;Ce.current&&window.clearTimeout(Ce.current),ht(Q.current,{transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,transform:at(_)?`scale(${Me}) translate3d(0, ${$e}px, 0)`:`scale(${Me}) translate3d(${$e}px, 0, 0)`}),!he&&Q.current&&(Ce.current=setTimeout(()=>{const Ie=qo(Q.current,_);ht(Q.current,{transition:"none",transform:at(_)?`translate3d(0, ${Ie}px, 0)`:`translate3d(${Ie}px, 0, 0)`})},500))}function Vt(he,Me){if(Me<0)return;const $e=(window.innerWidth-Bn)/window.innerWidth,Ie=$e+Me*(1-$e),ze=-Bn+Me*Bn;ht(Q.current,{transform:at(_)?`scale(${Ie}) translate3d(0, ${ze}px, 0)`:`scale(${Ie}) translate3d(${ze}px, 0, 0)`,transition:"none"})}function xt(he,Me){const $e=at(_)?window.innerHeight:window.innerWidth,Ie=Me?($e-Bn)/$e:1,ze=Me?-Bn:0;Me&&ht(Q.current,{transition:`transform ${Qe.DURATION}s cubic-bezier(${Qe.EASE.join(",")})`,transform:at(_)?`scale(${Ie}) translate3d(0, ${ze}px, 0)`:`scale(${Ie}) translate3d(${ze}px, 0, 0)`})}return H.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),H.createElement(Im,{defaultOpen:C,onOpenChange:he=>{!u&&!he||(he?V(!0):dt(!0),F(he))},open:P},H.createElement($b.Provider,{value:{activeSnapPoint:yt,snapPoints:i,setActiveSnapPoint:Ut,drawerRef:Q,overlayRef:k,onOpenChange:t,onPress:Se,onRelease:Yt,onDrag:ut,dismissible:u,shouldAnimate:X,handleOnly:d,isOpen:P,isDragging:B,shouldFade:an,closeDrawer:dt,onNestedDrag:Vt,onNestedOpenChange:pt,onNestedRelease:xt,keyboardIsOpen:ie,modal:y,snapPointsOffset:Rt,activeSnapPointIndex:rt,direction:_,shouldScaleBackground:a,setBackgroundColorOnScale:s,noBodyStyles:w,container:I,autoFocus:O}},n))}const Zb=H.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:a,modal:s,shouldAnimate:l}=Eo(),c=Fb(t,n),u=r&&r.length>0;if(!s)return null;const d=H.useCallback(p=>o(p),[o]);return H.createElement(Om,{onMouseUp:d,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&u?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false","data-vaul-animate":l?.current?"true":"false",...e})});Zb.displayName="Drawer.Overlay";const Kb=H.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:a,onRelease:s,onDrag:l,keyboardIsOpen:c,snapPointsOffset:u,activeSnapPointIndex:d,modal:p,isOpen:m,direction:b,snapPoints:h,container:y,handleOnly:v,shouldAnimate:x,autoFocus:w}=Eo(),[_,C]=H.useState(!1),E=Fb(o,i),A=H.useRef(null),R=H.useRef(null),M=H.useRef(!1),T=h&&h.length>0;mj();const I=(D,L,P=0)=>{if(M.current)return!0;const F=Math.abs(D.y),K=Math.abs(D.x),V=K>F,B=["bottom","right"].includes(L)?1:-1;if(L==="left"||L==="right"){if(!(D.x*B<0)&&K>=0&&K<=P)return V}else if(!(D.y*B<0)&&F>=0&&F<=P)return!V;return M.current=!0,!0};H.useEffect(()=>{T&&window.requestAnimationFrame(()=>{C(!0)})},[]);function O(D){A.current=null,M.current=!1,s(D)}return H.createElement(Mm,{"data-vaul-drawer-direction":b,"data-vaul-drawer":"","data-vaul-delayed-snap-points":_?"true":"false","data-vaul-snap-points":m&&T?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":x?.current?"true":"false",...r,ref:E,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:D=>{v||(r.onPointerDown==null||r.onPointerDown.call(r,D),A.current={x:D.pageX,y:D.pageY},a(D))},onOpenAutoFocus:D=>{n?.(D),w||D.preventDefault()},onPointerDownOutside:D=>{if(e?.(D),!p||D.defaultPrevented){D.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:D=>{if(!p){D.preventDefault();return}},onPointerMove:D=>{if(R.current=D,v||(r.onPointerMove==null||r.onPointerMove.call(r,D),!A.current))return;const L=D.pageY-A.current.y,P=D.pageX-A.current.x,F=D.pointerType==="touch"?10:2;I({x:P,y:L},b,F)?l(D):(Math.abs(P)>F||Math.abs(L)>F)&&(A.current=null)},onPointerUp:D=>{r.onPointerUp==null||r.onPointerUp.call(r,D),A.current=null,M.current=!1,s(D)},onPointerOut:D=>{r.onPointerOut==null||r.onPointerOut.call(r,D),O(R.current)},onContextMenu:D=>{r.onContextMenu==null||r.onContextMenu.call(r,D),R.current&&O(R.current)}})});Kb.displayName="Drawer.Content";const bj=250,vj=120,yj=H.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:a,activeSnapPoint:s,setActiveSnapPoint:l,dismissible:c,handleOnly:u,isOpen:d,onPress:p,onDrag:m}=Eo(),b=H.useRef(null),h=H.useRef(!1);function y(){if(h.current){w();return}window.setTimeout(()=>{v()},vj)}function v(){if(i||e||h.current){w();return}if(w(),!a||a.length===0){c||o();return}if(s===a[a.length-1]&&c){o();return}const C=a.findIndex(A=>A===s);if(C===-1)return;const E=a[C+1];l(E)}function x(){b.current=window.setTimeout(()=>{h.current=!0},bj)}function w(){b.current&&window.clearTimeout(b.current),h.current=!1}return H.createElement("div",{onClick:y,onPointerCancel:w,onPointerDown:_=>{u&&p(_),x()},onPointerMove:_=>{u&&m(_)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},H.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});yj.displayName="Drawer.Handle";function xj(e){const t=Eo(),{container:n=t.container,...r}=e;return H.createElement(Rm,{container:n,...r})}const Or={Root:gj,Content:Kb,Overlay:Zb,Portal:xj,Title:Pm,Description:Dm};function ee(...e){return Dv(Lv(e))}var Wb=io("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function qr({className:e,variant:t="default",size:n="default",asChild:r=!1,...o}){const i=r?zp:"button";return f.jsx(i,{"data-slot":"button","data-variant":t,"data-size":n,className:ee(Wb({variant:t,size:n,className:e})),...o})}function wj({className:e,...t}){return f.jsx("div",{"data-slot":"card",className:ee("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function _j({className:e,...t}){return f.jsx("div",{"data-slot":"card-header",className:ee("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Ej({className:e,...t}){return f.jsx("div",{"data-slot":"card-title",className:ee("leading-none font-semibold",e),...t})}function Sj({className:e,...t}){return f.jsx("div",{"data-slot":"card-description",className:ee("text-muted-foreground text-sm",e),...t})}function kj({className:e,...t}){return f.jsx("div",{"data-slot":"card-content",className:ee("px-6",e),...t})}function Nj({className:e,type:t,...n}){return f.jsx("input",{type:t,"data-slot":"input",className:ee("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function vn({className:e,...t}){return f.jsx(yD,{"data-slot":"label",className:ee("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Cj({className:e,...t}){return f.jsx("textarea",{"data-slot":"textarea",className:ee("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function Tj({className:e,...t}){return f.jsx(Vm,{"data-slot":"checkbox",className:ee("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:f.jsx(Zm,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:f.jsx(Mb,{className:"size-3.5"})})})}function Aj({className:e,size:t="default",...n}){return f.jsx(l$,{"data-slot":"switch","data-size":t,className:ee("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...n,children:f.jsx(c$,{"data-slot":"switch-thumb",className:ee("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Ij({className:e,value:t,...n}){return f.jsx(FD,{"data-slot":"progress",className:ee("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:f.jsx(BD,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function Rj({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return f.jsx(zL,{"data-slot":"separator",decorative:n,orientation:t,className:ee("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}var Oj=io("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function Mj({className:e,variant:t,...n}){return f.jsx("div",{"data-slot":"alert",role:"alert",className:ee(Oj({variant:t}),e),...n})}function Pj({className:e,...t}){return f.jsx("div",{"data-slot":"alert-title",className:ee("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Dj({className:e,...t}){return f.jsx("div",{"data-slot":"alert-description",className:ee("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function Lj({...e}){return f.jsx(Im,{"data-slot":"dialog",...e})}function $j({...e}){return f.jsx(Rm,{"data-slot":"dialog-portal",...e})}function zj({className:e,...t}){return f.jsx(Om,{"data-slot":"dialog-overlay",className:ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function jj({className:e,children:t,showCloseButton:n=!0,...r}){return f.jsxs($j,{"data-slot":"dialog-portal",children:[f.jsx(zj,{}),f.jsxs(Mm,{"data-slot":"dialog-content",className:ee("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",e),...r,children:[t,n&&f.jsxs(EM,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[f.jsx(fz,{}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Fj({className:e,...t}){return f.jsx("div",{"data-slot":"dialog-header",className:ee("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Bj({className:e,...t}){return f.jsx(Pm,{"data-slot":"dialog-title",className:ee("text-lg leading-none font-semibold",e),...t})}function Uj({className:e,...t}){return f.jsx(Dm,{"data-slot":"dialog-description",className:ee("text-muted-foreground text-sm",e),...t})}function yd({...e}){return f.jsx(s1,{"data-slot":"accordion",...e})}function Hj({className:e,...t}){return f.jsx(l1,{"data-slot":"accordion-item",className:ee("border-b last:border-b-0",e),...t})}function Vj({className:e,children:t,...n}){return f.jsx(c1,{className:"flex",children:f.jsxs(u1,{"data-slot":"accordion-trigger",className:ee("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,f.jsx(Gl,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Gj({className:e,children:t,...n}){return f.jsx(d1,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...n,children:f.jsx("div",{className:ee("pt-0 pb-4",e),children:t})})}function Zj({className:e,...t}){return f.jsx(AM,{"data-slot":"avatar",className:ee("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function Kj({className:e,...t}){return f.jsx(IM,{"data-slot":"avatar-image",className:ee("aspect-square size-full",e),...t})}function Wj({className:e,...t}){return f.jsx(RM,{"data-slot":"avatar-fallback",className:ee("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var qj=io("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Yj({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?zp:"span";return f.jsx(o,{"data-slot":"badge","data-variant":t,className:ee(qj({variant:t}),e),...r})}function Xj({className:e,...t}){return f.jsx(XD,{"data-slot":"radio-group",className:ee("grid gap-3",e),...t})}function Jj({className:e,...t}){return f.jsx(JD,{"data-slot":"radio-group-item",className:ee("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:f.jsx(QD,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:f.jsx(lz,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Qj({...e}){return f.jsx(EL,{"data-slot":"select",...e})}function eF({...e}){return f.jsx(kL,{"data-slot":"select-value",...e})}function tF({className:e,size:t="default",children:n,...r}){return f.jsxs(SL,{"data-slot":"select-trigger","data-size":t,className:ee("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,f.jsx(NL,{asChild:!0,children:f.jsx(Gl,{className:"size-4 opacity-50"})})]})}function nF({className:e,children:t,position:n="item-aligned",align:r="center",...o}){return f.jsx(CL,{children:f.jsxs(TL,{"data-slot":"select-content",className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...o,children:[f.jsx(oF,{}),f.jsx(AL,{className:ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),f.jsx(iF,{})]})})}function rF({className:e,children:t,...n}){return f.jsxs(IL,{"data-slot":"select-item",className:ee("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[f.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:f.jsx(OL,{children:f.jsx(Mb,{className:"size-4"})})}),f.jsx(RL,{children:t})]})}function oF({className:e,...t}){return f.jsx(ML,{"data-slot":"select-scroll-up-button",className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(az,{className:"size-4"})})}function iF({className:e,...t}){return f.jsx(PL,{"data-slot":"select-scroll-down-button",className:ee("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(Gl,{className:"size-4"})})}var qb=g.createContext(null);function aa(){const e=g.useContext(qb);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function aF({orientation:e="horizontal",opts:t,setApi:n,plugins:r,className:o,children:i,...a}){const[s,l]=Yl({...t,axis:e==="horizontal"?"x":"y"},r),[c,u]=g.useState(!1),[d,p]=g.useState(!1),m=g.useCallback(v=>{v&&(u(v.canScrollPrev()),p(v.canScrollNext()))},[]),b=g.useCallback(()=>{l?.scrollPrev()},[l]),h=g.useCallback(()=>{l?.scrollNext()},[l]),y=g.useCallback(v=>{v.key==="ArrowLeft"?(v.preventDefault(),b()):v.key==="ArrowRight"&&(v.preventDefault(),h())},[b,h]);return g.useEffect(()=>{!l||!n||n(l)},[l,n]),g.useEffect(()=>{if(l)return m(l),l.on("reInit",m),l.on("select",m),()=>{l?.off("select",m)}},[l,m]),f.jsx(qb.Provider,{value:{carouselRef:s,api:l,opts:t,orientation:e||(t?.axis==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:h,canScrollPrev:c,canScrollNext:d},children:f.jsx("div",{onKeyDownCapture:y,className:ee("relative",o),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...a,children:i})})}function sF({className:e,...t}){const{carouselRef:n,orientation:r}=aa();return f.jsx("div",{ref:n,className:"overflow-hidden","data-slot":"carousel-content",children:f.jsx("div",{className:ee("flex",r==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})}function lF({className:e,...t}){const{orientation:n}=aa();return f.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:ee("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",e),...t})}function cF({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:o,scrollPrev:i,canScrollPrev:a}=aa();return f.jsxs(qr,{"data-slot":"carousel-previous",variant:t,size:n,className:ee("absolute size-8 rounded-full",o==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!a,onClick:i,...r,children:[f.jsx(Y$,{}),f.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function uF({className:e,variant:t="outline",size:n="icon",...r}){const{orientation:o,scrollNext:i,canScrollNext:a}=aa();return f.jsxs(qr,{"data-slot":"carousel-next",variant:t,size:n,className:ee("absolute size-8 rounded-full",o==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!a,onClick:i,...r,children:[f.jsx(J$,{}),f.jsx("span",{className:"sr-only",children:"Next slide"})]})}function dF({...e}){return f.jsx(Zp,{"data-slot":"collapsible",...e})}function fF({...e}){return f.jsx(pl,{"data-slot":"collapsible-trigger",...e})}function pF({...e}){return f.jsx(hl,{"data-slot":"collapsible-content",...e})}function mF({className:e,...t}){return f.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:f.jsx("table",{"data-slot":"table",className:ee("w-full caption-bottom text-sm",e),...t})})}function hF({className:e,...t}){return f.jsx("thead",{"data-slot":"table-header",className:ee("[&_tr]:border-b",e),...t})}function gF({className:e,...t}){return f.jsx("tbody",{"data-slot":"table-body",className:ee("[&_tr:last-child]:border-0",e),...t})}function xd({className:e,...t}){return f.jsx("tr",{"data-slot":"table-row",className:ee("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function bF({className:e,...t}){return f.jsx("th",{"data-slot":"table-head",className:ee("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function vF({className:e,...t}){return f.jsx("td",{"data-slot":"table-cell",className:ee("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function yF({className:e,...t}){return f.jsx("caption",{"data-slot":"table-caption",className:ee("text-muted-foreground mt-4 text-sm",e),...t})}function xF({...e}){return f.jsx(Or.Root,{"data-slot":"drawer",...e})}function wF({...e}){return f.jsx(Or.Portal,{"data-slot":"drawer-portal",...e})}function _F({className:e,...t}){return f.jsx(Or.Overlay,{"data-slot":"drawer-overlay",className:ee("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function EF({className:e,children:t,...n}){return f.jsxs(wF,{"data-slot":"drawer-portal",children:[f.jsx(_F,{}),f.jsxs(Or.Content,{"data-slot":"drawer-content",className:ee("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...n,children:[f.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function SF({className:e,...t}){return f.jsx("div",{"data-slot":"drawer-header",className:ee("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",e),...t})}function kF({className:e,...t}){return f.jsx(Or.Title,{"data-slot":"drawer-title",className:ee("text-foreground font-semibold",e),...t})}function NF({className:e,...t}){return f.jsx(Or.Description,{"data-slot":"drawer-description",className:ee("text-muted-foreground text-sm",e),...t})}function CF({...e}){return f.jsx(pD,{"data-slot":"dropdown-menu",...e})}function TF({...e}){return f.jsx(mD,{"data-slot":"dropdown-menu-trigger",...e})}function AF({className:e,sideOffset:t=4,...n}){return f.jsx(hD,{children:f.jsx(gD,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function IF({className:e,inset:t,variant:n="default",...r}){return f.jsx(bD,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ee("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function RF({className:e,...t}){return f.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:ee("mx-auto flex w-full justify-center",e),...t})}function OF({className:e,...t}){return f.jsx("ul",{"data-slot":"pagination-content",className:ee("flex flex-row items-center gap-1",e),...t})}function Yo({...e}){return f.jsx("li",{"data-slot":"pagination-item",...e})}function Jl({className:e,isActive:t,size:n="icon",...r}){return f.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:ee(Wb({variant:t?"outline":"ghost",size:n}),e),...r})}function MF({className:e,...t}){return f.jsxs(Jl,{"aria-label":"Go to previous page",size:"default",className:ee("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[f.jsx(nz,{}),f.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function PF({className:e,...t}){return f.jsxs(Jl,{"aria-label":"Go to next page",size:"default",className:ee("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[f.jsx("span",{className:"hidden sm:block",children:"Next"}),f.jsx(oz,{})]})}function DF({className:e,...t}){return f.jsxs("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:ee("flex size-9 items-center justify-center",e),...t,children:[f.jsx(uz,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"More pages"})]})}function LF({...e}){return f.jsx(ID,{"data-slot":"popover",...e})}function $F({...e}){return f.jsx(RD,{"data-slot":"popover-trigger",...e})}function zF({className:e,align:t="center",sideOffset:n=4,...r}){return f.jsx(OD,{children:f.jsx(MD,{"data-slot":"popover-content",align:t,sideOffset:n,className:ee("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function jF({className:e,...t}){return f.jsx("div",{"data-slot":"skeleton",className:ee("bg-accent animate-pulse rounded-md",e),...t})}function FF({className:e,defaultValue:t,value:n,min:r=0,max:o=100,...i}){const a=g.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,o],[n,t,r,o]);return f.jsxs(e$,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:o,className:ee("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...i,children:[f.jsx(t$,{"data-slot":"slider-track",className:ee("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:f.jsx(n$,{"data-slot":"slider-range",className:ee("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:a.length},(s,l)=>f.jsx(r$,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},l))]})}function BF({className:e,orientation:t="horizontal",...n}){return f.jsx(p$,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ee("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}var UF=io("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function HF({className:e,variant:t="default",...n}){return f.jsx(m$,{"data-slot":"tabs-list","data-variant":t,className:ee(UF({variant:t}),e),...n})}function VF({className:e,...t}){return f.jsx(h$,{"data-slot":"tabs-trigger",className:ee("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}var Yb=io("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function GF({className:e,variant:t,size:n,...r}){return f.jsx(g$,{"data-slot":"toggle",className:ee(Yb({variant:t,size:n,className:e})),...r})}var Xb=g.createContext({size:"default",variant:"default",spacing:0});function wd({className:e,variant:t,size:n,spacing:r=0,children:o,...i}){return f.jsx(w$,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:ee("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",e),...i,children:f.jsx(Xb.Provider,{value:{variant:t,size:n,spacing:r},children:o})})}function _d({className:e,children:t,variant:n,size:r,...o}){const i=g.useContext(Xb);return f.jsx(_$,{"data-slot":"toggle-group-item","data-variant":i.variant||n,"data-size":i.size||r,"data-spacing":i.spacing,className:ee(Yb({variant:i.variant||n,size:i.size||r}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",e),...o,children:t})}function ZF({delayDuration:e=0,...t}){return f.jsx(z$,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function KF({...e}){return f.jsx(j$,{"data-slot":"tooltip",...e})}function WF({...e}){return f.jsx(F$,{"data-slot":"tooltip-trigger",...e})}function qF({className:e,sideOffset:t=0,children:n,...r}){return f.jsx(B$,{children:f.jsxs(U$,{"data-slot":"tooltip-content",sideOffset:t,className:ee("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[n,f.jsx(H$,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function YF(e,t){if(t<=7)return Array.from({length:t},(i,a)=>a+1);const n=[];n.push(1),e>3&&n.push("ellipsis");const r=Math.max(2,e-1),o=Math.min(t-1,e+1);for(let i=r;i<=o;i++)n.push(i);return e<t-2&&n.push("ellipsis"),n.push(t),n}var XF={Card:({props:e,children:t})=>{const n=e.maxWidth==="sm"?"max-w-xs sm:min-w-[280px]":e.maxWidth==="md"?"max-w-sm sm:min-w-[320px]":e.maxWidth==="lg"?"max-w-md sm:min-w-[360px]":"w-full",r=e.centered?"mx-auto":"";return f.jsxs(wj,{className:ee(n,r),children:[(e.title||e.description)&&f.jsxs(_j,{children:[e.title&&f.jsx(Ej,{children:e.title}),e.description&&f.jsx(Sj,{children:e.description})]}),f.jsx(kj,{className:"flex flex-col gap-3",children:t})]})},Stack:({props:e,children:t})=>{const n=e.direction==="horizontal",r={none:"gap-0",sm:"gap-2",md:"gap-3",lg:"gap-4"},o={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},i={start:"",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"},a=r[e.gap??"md"]??"gap-3",s=o[e.align??"start"]??"items-start",l=i[e.justify??""]??"";return f.jsx("div",{className:`flex ${n?"flex-row flex-wrap":"flex-col"} ${a} ${s} ${l}`,children:t})},Grid:({props:e,children:t})=>{const n={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6"},r={sm:"gap-2",md:"gap-3",lg:"gap-4"},o=Math.max(1,Math.min(6,e.columns??1)),i=n[o]??"grid-cols-1",a=r[e.gap??"md"]??"gap-3";return f.jsx("div",{className:`grid ${i} ${a}`,children:t})},Separator:({props:e})=>f.jsx(Rj,{orientation:e.orientation??"horizontal",className:e.orientation==="vertical"?"h-full mx-2":"my-3"}),Tabs:({props:e,children:t,bindings:n,emit:r})=>{const o=e.tabs??[],[i,a]=jt(e.value,n?.value),[s,l]=g.useState(e.defaultValue??o[0]?.value??""),c=!!n?.value,u=c?i??o[0]?.value??"":s,d=c?a:l;return f.jsxs(BF,{value:u,onValueChange:p=>{d(p),r("change")},children:[f.jsx(HF,{children:o.map(p=>f.jsx(VF,{value:p.value,children:p.label},p.value))}),t]})},Accordion:({props:e})=>{const t=e.items??[],n=e.type==="multiple",r=t.map((o,i)=>f.jsxs(Hj,{value:`item-${i}`,children:[f.jsx(Vj,{children:o.title}),f.jsx(Gj,{children:o.content})]},i));return n?f.jsx(yd,{type:"multiple",className:"w-full",children:r}):f.jsx(yd,{type:"single",collapsible:!0,className:"w-full",children:r})},Collapsible:({props:e,children:t})=>{const[n,r]=g.useState(e.defaultOpen??!1);return f.jsxs(dF,{open:n,onOpenChange:r,className:"w-full",children:[f.jsx(fF,{asChild:!0,children:f.jsxs("button",{className:"flex w-full items-center justify-between rounded-md border border-border px-4 py-2 text-sm font-medium hover:bg-muted transition-colors",children:[e.title,f.jsx("svg",{className:`h-4 w-4 transition-transform ${n?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]})}),f.jsx(pF,{className:"pt-2",children:t})]})},Dialog:({props:e,children:t})=>{const[n,r]=Vu(e.openPath??"");return f.jsx(Lj,{open:n??!1,onOpenChange:o=>r(o),children:f.jsxs(jj,{children:[f.jsxs(Fj,{children:[f.jsx(Bj,{children:e.title}),e.description&&f.jsx(Uj,{children:e.description})]}),t]})})},Drawer:({props:e,children:t})=>{const[n,r]=Vu(e.openPath??"");return f.jsx(xF,{open:n??!1,onOpenChange:o=>r(o),children:f.jsxs(EF,{children:[f.jsxs(SF,{children:[f.jsx(kF,{children:e.title}),e.description&&f.jsx(NF,{children:e.description})]}),f.jsx("div",{className:"p-4",children:t})]})})},Carousel:({props:e})=>{const t=e.items??[];return f.jsxs(aF,{className:"w-full",children:[f.jsx(sF,{children:t.map((n,r)=>f.jsx(lF,{className:"basis-3/4 md:basis-1/2 lg:basis-1/3",children:f.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card h-full",children:[n.title&&f.jsx("h4",{className:"font-semibold text-sm mb-1",children:n.title}),n.description&&f.jsx("p",{className:"text-sm text-muted-foreground",children:n.description})]})},r))}),f.jsx(cF,{}),f.jsx(uF,{})]})},Table:({props:e})=>{const t=e.columns??[],n=(e.rows??[]).map(r=>r.map(String));return f.jsx("div",{className:"rounded-md border border-border overflow-hidden",children:f.jsxs(mF,{children:[e.caption&&f.jsx(yF,{children:e.caption}),f.jsx(hF,{children:f.jsx(xd,{children:t.map(r=>f.jsx(bF,{children:r},r))})}),f.jsx(gF,{children:n.map((r,o)=>f.jsx(xd,{children:r.map((i,a)=>f.jsx(vF,{children:i},a))},o))})]})})},Heading:({props:e})=>{const t=e.level??"h2",n=t==="h1"?"text-2xl font-bold":t==="h3"?"text-base font-semibold":t==="h4"?"text-sm font-semibold":"text-lg font-semibold";return t==="h1"?f.jsx("h1",{className:`${n} text-left`,children:e.text}):t==="h3"?f.jsx("h3",{className:`${n} text-left`,children:e.text}):t==="h4"?f.jsx("h4",{className:`${n} text-left`,children:e.text}):f.jsx("h2",{className:`${n} text-left`,children:e.text})},Text:({props:e})=>{const t=e.variant==="caption"?"text-xs":e.variant==="muted"?"text-sm text-muted-foreground":e.variant==="lead"?"text-xl text-muted-foreground":e.variant==="code"?"font-mono text-sm bg-muted px-1.5 py-0.5 rounded":"text-sm";return e.variant==="code"?f.jsx("code",{className:`${t} text-left`,children:e.text}):f.jsx("p",{className:`${t} text-left`,children:e.text})},Image:({props:e})=>e.src?f.jsx("img",{src:e.src,alt:e.alt??"",width:e.width??void 0,height:e.height??void 0,className:"rounded max-w-full"}):f.jsx("div",{className:"bg-muted border border-border rounded flex items-center justify-center text-xs text-muted-foreground",style:{width:e.width??80,height:e.height??60},children:e.alt||"img"}),Avatar:({props:e})=>{const t=e.name||"?",n=t.split(" ").map(o=>o[0]).join("").slice(0,2).toUpperCase(),r=e.size==="lg"?"h-12 w-12":e.size==="sm"?"h-8 w-8":"h-10 w-10";return f.jsxs(Zj,{className:r,children:[e.src&&f.jsx(Kj,{src:e.src,alt:t}),f.jsx(Wj,{children:n})]})},Badge:({props:e})=>f.jsx(Yj,{variant:e.variant??"default",children:e.text}),Alert:({props:e})=>{const t=e.type==="error"?"destructive":"default",n=e.type==="success"?"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-950 dark:text-green-100":e.type==="warning"?"border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-100":e.type==="info"?"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100":"";return f.jsxs(Mj,{variant:t,className:n,children:[f.jsx(Pj,{children:e.title}),e.message&&f.jsx(Dj,{children:e.message})]})},Progress:({props:e})=>{const t=Math.min(100,Math.max(0,e.value||0));return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{className:"text-sm text-muted-foreground",children:e.label}),f.jsx(Ij,{value:t})]})},Skeleton:({props:e})=>f.jsx(jF,{className:e.rounded?"rounded-full":"rounded-md",style:{width:e.width??"100%",height:e.height??"1.25rem"}}),Spinner:({props:e})=>{const t=e.size==="lg"?"h-8 w-8":e.size==="sm"?"h-4 w-4":"h-6 w-6";return f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs("svg",{className:`${t} animate-spin text-muted-foreground`,viewBox:"0 0 24 24",fill:"none",children:[f.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),e.label&&f.jsx("span",{className:"text-sm text-muted-foreground",children:e.label})]})},Tooltip:({props:e})=>f.jsx(ZF,{children:f.jsxs(KF,{children:[f.jsx(WF,{asChild:!0,children:f.jsx("span",{className:"text-sm underline decoration-dotted cursor-help",children:e.text})}),f.jsx(qF,{children:f.jsx("p",{children:e.content})})]})}),Popover:({props:e})=>f.jsxs(LF,{children:[f.jsx($F,{asChild:!0,children:f.jsx(qr,{variant:"outline",className:"text-sm",children:e.trigger})}),f.jsx(zF,{className:"w-64",children:f.jsx("p",{className:"text-sm",children:e.content})})]}),Input:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.value,t?.value),[i,a]=g.useState(""),s=!!t?.value,l=s?r??"":i,c=s?o:a,u=e.validateOn??"blur",d=!!(t?.value&&e.checks?.length),{errors:p,validate:m}=or(t?.value??"",d?{checks:e.checks??[],validateOn:u}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{htmlFor:e.name??void 0,children:e.label}),f.jsx(Nj,{id:e.name??void 0,name:e.name??void 0,type:e.type??"text",placeholder:e.placeholder??"",value:l,onChange:b=>{c(b.target.value),d&&u==="change"&&m()},onKeyDown:b=>{b.key==="Enter"&&n("submit")},onFocus:()=>n("focus"),onBlur:()=>{d&&u==="blur"&&m(),n("blur")}}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Textarea:({props:e,bindings:t})=>{const[n,r]=jt(e.value,t?.value),[o,i]=g.useState(""),a=!!t?.value,s=a?n??"":o,l=a?r:i,c=e.validateOn??"blur",u=!!(t?.value&&e.checks?.length),{errors:d,validate:p}=or(t?.value??"",u?{checks:e.checks??[],validateOn:c}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{htmlFor:e.name??void 0,children:e.label}),f.jsx(Cj,{id:e.name??void 0,name:e.name??void 0,placeholder:e.placeholder??"",rows:e.rows??3,value:s,onChange:m=>{l(m.target.value),u&&c==="change"&&p()},onBlur:()=>{u&&c==="blur"&&p()}}),d.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:d[0]})]})},Select:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.value,t?.value),[i,a]=g.useState(""),s=!!t?.value,l=s?r??"":i,c=s?o:a,d=(e.options??[]).map(y=>typeof y=="string"?y:String(y??"")),p=e.validateOn??"change",m=!!(t?.value&&e.checks?.length),{errors:b,validate:h}=or(t?.value??"",m?{checks:e.checks??[],validateOn:p}:void 0);return f.jsxs("div",{className:"space-y-2",children:[f.jsx(vn,{children:e.label}),f.jsxs(Qj,{value:l,onValueChange:y=>{c(y),m&&p==="change"&&h(),n("change")},children:[f.jsx(tF,{className:"w-full",children:f.jsx(eF,{placeholder:e.placeholder??"Select..."})}),f.jsx(nF,{children:d.map((y,v)=>f.jsx(rF,{value:y||`option-${v}`,children:y},`${v}-${y}`))})]}),b.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:b[0]})]})},Checkbox:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.checked,t?.checked),[i,a]=g.useState(!!e.checked),s=!!t?.checked,l=s?r??!1:i,c=s?o:a,u=e.validateOn??"change",d=!!(t?.checked&&e.checks?.length),{errors:p,validate:m}=or(t?.checked??"",d?{checks:e.checks??[],validateOn:u}:void 0);return f.jsxs("div",{className:"space-y-1",children:[f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Tj,{id:e.name??void 0,checked:l,onCheckedChange:b=>{c(b===!0),d&&u==="change"&&m(),n("change")}}),f.jsx(vn,{htmlFor:e.name??void 0,className:"cursor-pointer",children:e.label})]}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Radio:({props:e,bindings:t,emit:n})=>{const o=(e.options??[]).map(y=>typeof y=="string"?y:String(y??"")),[i,a]=jt(e.value,t?.value),[s,l]=g.useState(o[0]??""),c=!!t?.value,u=c?i??"":s,d=c?a:l,p=e.validateOn??"change",m=!!(t?.value&&e.checks?.length),{errors:b,validate:h}=or(t?.value??"",m?{checks:e.checks??[],validateOn:p}:void 0);return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsx(vn,{children:e.label}),f.jsx(Xj,{value:u,onValueChange:y=>{d(y),m&&p==="change"&&h(),n("change")},children:o.map((y,v)=>f.jsxs("div",{className:"flex items-center space-x-2",children:[f.jsx(Jj,{value:y||`option-${v}`,id:`${e.name}-${v}-${y}`}),f.jsx(vn,{htmlFor:`${e.name}-${v}-${y}`,className:"cursor-pointer",children:y})]},`${v}-${y}`))}),b.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:b[0]})]})},Switch:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.checked,t?.checked),[i,a]=g.useState(!!e.checked),s=!!t?.checked,l=s?r??!1:i,c=s?o:a,u=e.validateOn??"change",d=!!(t?.checked&&e.checks?.length),{errors:p,validate:m}=or(t?.checked??"",d?{checks:e.checks??[],validateOn:u}:void 0);return f.jsxs("div",{className:"space-y-1",children:[f.jsxs("div",{className:"flex items-center justify-between space-x-2",children:[f.jsx(vn,{htmlFor:e.name??void 0,className:"cursor-pointer",children:e.label}),f.jsx(Aj,{id:e.name??void 0,checked:l,onCheckedChange:b=>{c(b),d&&u==="change"&&m(),n("change")}})]}),p.length>0&&f.jsx("p",{className:"text-sm text-destructive",children:p[0]})]})},Slider:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.value,t?.value),[i,a]=g.useState(e.min??0),s=!!t?.value,l=s?r??e.min??0:i,c=s?o:a;return f.jsxs("div",{className:"space-y-2",children:[e.label&&f.jsxs("div",{className:"flex justify-between",children:[f.jsx(vn,{className:"text-sm",children:e.label}),f.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),f.jsx(FF,{value:[l],min:e.min??0,max:e.max??100,step:e.step??1,onValueChange:u=>{c(u[0]??0),n("change")}})]})},Button:({props:e,emit:t})=>{const n=e.variant==="danger"?"destructive":e.variant==="secondary"?"secondary":"default";return f.jsx(qr,{variant:n,disabled:e.disabled??!1,onClick:()=>t("press"),children:e.label})},Link:({props:e,on:t})=>f.jsx("a",{href:e.href??"#",className:"text-primary underline-offset-4 hover:underline text-sm font-medium",onClick:n=>{const r=t("press");r.shouldPreventDefault&&n.preventDefault(),r.emit()},children:e.label}),DropdownMenu:({props:e,bindings:t,emit:n})=>{const r=e.items??[],[,o]=jt(e.value,t?.value);return f.jsxs(CF,{children:[f.jsx(TF,{asChild:!0,children:f.jsx(qr,{variant:"outline",children:e.label})}),f.jsx(AF,{children:r.map(i=>f.jsx(IF,{onClick:()=>{o(i.value),n("select")},children:i.label},i.value))})]})},Toggle:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.pressed,t?.pressed),[i,a]=g.useState(e.pressed??!1),s=!!t?.pressed,l=s?r??!1:i,c=s?o:a;return f.jsx(GF,{variant:e.variant??"default",pressed:l,onPressedChange:u=>{c(u),n("change")},children:e.label})},ToggleGroup:({props:e,bindings:t,emit:n})=>{const r=e.type??"single",o=e.items??[],[i,a]=jt(e.value,t?.value),[s,l]=g.useState(o[0]?.value??""),c=!!t?.value,u=c?i??"":s,d=c?a:l;if(r==="multiple"){const p=u?u.split(",").filter(Boolean):[];return f.jsx(wd,{type:"multiple",value:p,onValueChange:m=>{d(m.join(",")),n("change")},children:o.map(m=>f.jsx(_d,{value:m.value,children:m.label},m.value))})}return f.jsx(wd,{type:"single",value:u,onValueChange:p=>{p&&(d(p),n("change"))},children:o.map(p=>f.jsx(_d,{value:p.value,children:p.label},p.value))})},ButtonGroup:({props:e,bindings:t,emit:n})=>{const r=e.buttons??[],[o,i]=jt(e.selected,t?.selected),[a,s]=g.useState(r[0]?.value??""),l=!!t?.selected,c=l?o??"":a,u=l?i:s;return f.jsx("div",{className:"inline-flex rounded-md border border-border",children:r.map((d,p)=>f.jsx("button",{className:`px-3 py-1.5 text-sm transition-colors ${c===d.value?"bg-primary text-primary-foreground":"bg-background hover:bg-muted"} ${p>0?"border-l border-border":""} ${p===0?"rounded-l-md":""} ${p===r.length-1?"rounded-r-md":""}`,onClick:()=>{u(d.value),n("change")},children:d.label},d.value))})},Pagination:({props:e,bindings:t,emit:n})=>{const[r,o]=jt(e.page,t?.page),i=r??1,a=e.totalPages??1,s=YF(i,a);return f.jsx(RF,{children:f.jsxs(OF,{children:[f.jsx(Yo,{children:f.jsx(MF,{href:"#",onClick:l=>{l.preventDefault(),i>1&&(o(i-1),n("change"))}})}),s.map((l,c)=>l==="ellipsis"?f.jsx(Yo,{children:f.jsx(DF,{})},`ellipsis-${c}`):f.jsx(Yo,{children:f.jsx(Jl,{href:"#",isActive:l===i,onClick:u=>{u.preventDefault(),o(l),n("change")},children:l})},l)),f.jsx(Yo,{children:f.jsx(PF,{href:"#",onClick:l=>{l.preventDefault(),i<a&&(o(i+1),n("change"))}})})]})})}};const JF=cO(uO,{components:CO,actions:{}}),{registry:QF}=NO(JF,{components:XF});function e2({spec:e}){return f.jsx(kO,{spec:e,registry:QF})}function t2(e){return typeof e=="string"?e:JSON.stringify(e,null,2)}function n2({hint:e,data:t}){const n=t2(t);if(e.type==="markdown")return f.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:f.jsx(lf,{remarkPlugins:[Qf],children:n})});if(e.type==="json")return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n});if(e.type==="list")try{const r=Array.isArray(t)?t:JSON.parse(n);if(!Array.isArray(r))throw new Error("not an array");return e.ordered?f.jsx("ol",{className:"list-decimal pl-5 text-sm space-y-1",children:r.map((o,i)=>f.jsx("li",{children:String(o)},i))}):f.jsx("ul",{className:"list-disc pl-5 text-sm space-y-1",children:r.map((o,i)=>f.jsx("li",{children:String(o)},i))})}catch{return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n})}return f.jsx("pre",{className:"text-xs whitespace-pre-wrap",children:n})}function r2({execution:e}){const[t,n]=g.useState(e.status!=="completed"),r=DN(e),o=r.icon,i=LN(e),a=e.result?.details??e.partialResult?.details??{},s=a.renderHint,l=a.uiSpec,c=!!(s||l);return f.jsxs("div",{className:Kt("group text-xs",e.status==="error"&&"text-destructive"),children:[f.jsxs("button",{type:"button",onClick:()=>n(u=>!u),className:Kt("flex w-full items-center gap-1.5 rounded px-2 py-1 text-left transition-colors","hover:bg-muted/50",e.status==="error"&&"hover:bg-destructive/10"),children:[f.jsx($v,{className:Kt("h-3 w-3 shrink-0 transition-transform text-muted-foreground",t&&"rotate-90")}),f.jsx(o,{className:Kt("h-3.5 w-3.5 shrink-0",e.toolName==="bash"&&"text-emerald-500",e.toolName==="read"&&"text-blue-500",e.toolName==="write"&&"text-emerald-500",e.toolName==="edit"&&"text-amber-500",e.toolName==="grep"&&"text-violet-500",e.toolName==="find"&&"text-cyan-500",e.toolName==="ls"&&"text-indigo-500",!["bash","read","write","edit","grep","find","ls"].includes(e.toolName)&&"text-muted-foreground")}),f.jsx("span",{className:"font-mono",children:e.toolName}),r.command&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-muted-foreground",children:"›"}),f.jsx("span",{className:"truncate font-mono text-muted-foreground",children:r.command})]}),e.status==="running"&&f.jsx(Ds,{className:"ml-auto h-3 w-3 shrink-0 animate-spin text-muted-foreground"}),e.status==="error"&&f.jsx("span",{className:"ml-auto shrink-0 text-destructive",children:"failed"})]}),t&&f.jsx("div",{className:"mt-1 ml-5 rounded-md border border-border bg-muted/30 p-2 animate-in fade-in slide-in-from-top-2 duration-200",children:c?f.jsxs(f.Fragment,{children:[s&&f.jsx(n2,{hint:s,data:a.data??a.content??a}),l&&f.jsx(e2,{spec:l})]}):f.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap text-xs",children:i||"(no output)"})})]})}function o2({messageId:e}){const t=Hn(jv,n=>zv(e,n));return t.length===0?null:f.jsx("div",{className:"space-y-2 mb-2",children:t.map(n=>f.jsx(r2,{execution:n},n.toolCallId))})}function i2(e){const t=e.trim().replace(/\s+/g," ");return t?t.length<=50?t:`${t.slice(0,50)}…`:"Assistant response"}function a2({message:e}){const[t,n]=g.useState(!1),r=e.thinkingContent??e.persistedThinkingContent??"",o=r.length>0;return f.jsxs(f.Fragment,{children:[o&&f.jsxs("div",{className:"mb-3",children:[f.jsxs("button",{className:"flex w-full items-center justify-between rounded-md border border-border bg-background/60 px-3 py-2 text-left text-sm",onClick:()=>n(i=>!i),type:"button",children:[f.jsx("span",{className:"font-medium text-foreground",children:i2(e.content)}),f.jsx(Ls,{className:Kt("h-4 w-4 text-muted-foreground transition-transform",t&&"rotate-180")})]}),t&&f.jsx("div",{className:"mt-2 space-y-3 rounded-md border border-border bg-background/40 p-3",children:f.jsxs("div",{className:"space-y-1.5 text-xs",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[f.jsx(qv,{className:"h-3.5 w-3.5"}),f.jsx("span",{className:"font-medium",children:e.isThinking?"Thinking...":"Thinking"}),e.isThinking&&f.jsx(Ds,{className:"h-3 w-3 animate-spin"})]}),f.jsx("p",{className:"whitespace-pre-wrap italic text-muted-foreground",children:r})]})})]}),f.jsx(o2,{messageId:e.id}),e.content.trim().length>0?f.jsx("div",{className:"prose prose-base dark:prose-invert max-w-none",children:f.jsx(lf,{remarkPlugins:[Qf],rehypePlugins:[kk],children:e.content})}):e.isStreaming?f.jsx("div",{className:"prose prose-base dark:prose-invert max-w-none text-muted-foreground",children:"..."}):null]})}function s2({attachments:e}){return!e||e.length===0?null:f.jsx("div",{className:"mb-2 flex flex-wrap gap-2",children:e.map((t,n)=>{const r=`${t.type}-${t.name??"unnamed"}-${n}`;return t.type==="image"&&t.previewUrl?f.jsx("a",{href:t.previewUrl,target:"_blank",rel:"noreferrer",className:"block",children:f.jsx("img",{src:t.previewUrl,alt:t.name??"Attached image",className:"h-20 w-20 rounded-md border border-primary-foreground/25 object-cover transition-opacity hover:opacity-90"})},r):f.jsxs("div",{className:Kt("inline-flex max-w-full items-center gap-2 rounded-md border px-2 py-1","border-primary-foreground/25 bg-primary-foreground/10 text-primary-foreground"),children:[f.jsx(kd,{className:"h-3.5 w-3.5 shrink-0"}),f.jsx("span",{className:"truncate text-xs font-medium",children:t.name??"Attached file"})]},r)})})}function l2({message:e}){const t=e.role==="user";return f.jsx("div",{className:Kt("flex w-full animate-message-enter",t?"justify-end":"justify-start"),children:f.jsxs("div",{className:Kt(t?"max-w-[75%] rounded-2xl bg-primary px-4 py-2.5 text-primary-foreground":"w-full text-foreground"),children:[t?f.jsxs(f.Fragment,{children:[f.jsx(s2,{attachments:e.attachments}),e.content?f.jsx("p",{className:"whitespace-pre-wrap",children:e.content}):null]}):f.jsx(a2,{message:e}),e.isStreaming&&!t&&f.jsxs("span",{className:"ml-2 inline-flex gap-1",children:[f.jsx("span",{className:"typing-dot inline-block h-1.5 w-1.5 rounded-full bg-current"}),f.jsx("span",{className:"typing-dot inline-block h-1.5 w-1.5 rounded-full bg-current"}),f.jsx("span",{className:"typing-dot inline-block h-1.5 w-1.5 rounded-full bg-current"})]})]})})}function Ed(e){return e.thinkingContent??e.persistedThinkingContent??""}function c2(e,t=50){const n=e.trim().replace(/\s+/g," ");return n.length<=t?n:`${n.slice(0,t)}…`}function u2({messages:e}){const[t,n]=g.useState(!1),r=e.some(l=>l.isThinking||l.isStreaming),o=e[e.length-1],i=Ed(o),a=c2(i),s=e.length;return f.jsxs("div",{className:"relative w-full",children:[f.jsxs("button",{type:"button",onClick:()=>n(l=>!l),className:Kt("flex w-full min-w-0 items-center gap-2 rounded-lg border border-dashed px-3 py-2 text-left transition-colors","border-border/60 bg-muted/30 hover:bg-muted/50",t&&"bg-muted/50"),children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[f.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[f.jsx("span",{children:"💭 Thinking"}),r&&f.jsx(Ds,{className:"h-3 w-3 animate-spin"})]}),!t&&i&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),f.jsx("span",{className:"min-w-0 truncate text-xs italic text-muted-foreground",children:a})]})]}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[f.jsxs("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:[s," ",s===1?"step":"steps"]}),f.jsx(Ls,{className:Kt("h-3.5 w-3.5 text-muted-foreground transition-transform",t&&"rotate-180")})]})]}),t&&f.jsx("div",{className:"mt-2 rounded-lg border border-border/60 bg-card/95 p-3 shadow-sm backdrop-blur-sm animate-in fade-in slide-in-from-top-2 duration-200",children:f.jsx("ol",{className:"space-y-2 text-xs",children:e.map((l,c)=>{const u=Ed(l);return f.jsxs("li",{className:"flex gap-2 text-muted-foreground",children:[f.jsxs("span",{className:"shrink-0 font-medium text-primary",children:[c+1,"."]}),f.jsx("span",{className:"whitespace-pre-wrap italic",children:u||"(empty)"})]},l.id)})})})]})}function d2(e){if(e.role!=="assistant")return!1;const t=e.content.trim().length>0,n=(e.thinkingContent??e.persistedThinkingContent??"").trim().length>0;return!t&&n}function f2(e){const t=[];let n=[];for(const r of e)d2(r)?n.push(r):(n.length>0&&(t.push({type:"thinking-steps",messages:n}),n=[]),t.push({type:"message",message:r}));return n.length>0&&t.push({type:"thinking-steps",messages:n}),t}function p2(){const{messages:e}=Hn(Fv,r=>({messages:r.messages})),t=g.useRef(null);if(g.useEffect(()=>{t.current?.scrollIntoView({behavior:"smooth"})},[e]),e.length===0)return f.jsx("div",{className:"flex h-full items-center justify-center p-8 chat-background",children:f.jsxs("div",{className:"text-center space-y-4 max-w-md",children:[f.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-primary/10 border border-primary/20 mb-2",children:f.jsx("span",{className:"text-3xl font-mono font-bold text-primary",children:"c/"})}),f.jsx("p",{className:"text-xl font-semibold",children:"Start a conversation"}),f.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed",children:["Send a message to begin chatting with"," ",f.jsx("span",{className:"font-mono text-primary",children:"clankie"}),", your personal AI assistant that lives in your workspace."]}),f.jsxs("div",{className:"pt-2 flex flex-wrap gap-2 justify-center text-xs text-muted-foreground",children:[f.jsx("span",{className:"px-3 py-1 rounded-full bg-muted/50",children:"💬 Natural language"}),f.jsx("span",{className:"px-3 py-1 rounded-full bg-muted/50",children:"🔧 Tools & commands"}),f.jsx("span",{className:"px-3 py-1 rounded-full bg-muted/50",children:"📎 File uploads"})]})]})});const n=f2(e);return f.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-6 chat-background",children:f.jsxs("div",{className:"mx-auto w-full max-w-3xl space-y-4",children:[n.map(r=>r.type==="message"?f.jsx(l2,{message:r.message},r.message.id):f.jsx(u2,{messages:r.messages},r.messages[0].id)),f.jsx("div",{ref:t})]})})}function v2(){const{sessionId:e}=Bv.useParams(),t=Uv(),{status:n}=Hn(Hv,i=>({status:i.status})),{sessionId:r}=Hn(Os,i=>({sessionId:i.sessionId}));Hn(Vv,i=>i);const o=n==="connected";return g.useEffect(()=>{if(o){if(r===e){console.log(`[session-page] Already on session ${e}, no switch needed`);return}console.log(`[session-page] URL sessionId changed to ${e}, switching...`),ni.switchSession(e).catch(i=>{console.error(`[session-page] Failed to load session ${e}:`,i),t({to:"/"})})}},[e,o,r,t]),o?r!==e?f.jsx("div",{className:"flex h-full items-center justify-center chat-background",children:f.jsxs("div",{className:"text-center space-y-3",children:[f.jsxs("div",{className:"inline-flex gap-1 mb-2",children:[f.jsx("span",{className:"typing-dot inline-block h-3 w-3 rounded-full bg-primary"}),f.jsx("span",{className:"typing-dot inline-block h-3 w-3 rounded-full bg-primary"}),f.jsx("span",{className:"typing-dot inline-block h-3 w-3 rounded-full bg-primary"})]}),f.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading session"," ",f.jsx("span",{className:"font-mono text-primary",children:e.slice(0,8)})]})]})}):f.jsxs("div",{className:"flex h-full flex-col",children:[f.jsx(p2,{}),f.jsx(Ey,{})]}):f.jsx("div",{className:"flex h-full items-center justify-center chat-background",children:f.jsxs("div",{className:"text-center space-y-4 max-w-md p-8",children:[f.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-destructive/10 border border-destructive/20 mb-2",children:f.jsx(pc,{className:"h-8 w-8 text-destructive"})}),f.jsxs("div",{className:"space-y-2",children:[f.jsx("h2",{className:"text-2xl font-semibold",children:"Not Connected"}),f.jsx("p",{className:"text-muted-foreground",children:"Configure your connection to get started"})]}),f.jsx(Gv,{to:"/settings",children:f.jsxs(ti,{className:"transition-transform hover:scale-105 active:scale-95",children:[f.jsx(pc,{className:"mr-2 h-4 w-4"}),"Go to Settings"]})})]})})}export{v2 as component};