208 lines
510 KiB
JavaScript
208 lines
510 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-i2ZEVJq0.js","assets/rolldown-runtime-B0Z9INg1.js","assets/html-DhBYQyK4.js","assets/javascript-DWVbOe4X.js","assets/css-DeEW2upM.js","assets/angular-ts-CEQYB7nm.js","assets/scss-DngyzxVC.js","assets/apl-BqqYD0H4.js","assets/xml-CNfvW5JP.js","assets/java-duG_UTKe.js","assets/json-Br_ORbR4.js","assets/astro-Dt1mSA-e.js","assets/typescript-BAz-bF8J.js","assets/postcss-BXeXVLqQ.js","assets/tsx-JMDX3aQ7.js","assets/blade-D83jhYA_.js","assets/html-derivative-C_nRlqME.js","assets/sql-CLgiMrxJ.js","assets/bsl-BkkzgIyY.js","assets/sdbl-bTVj8UrX.js","assets/c-aGSZMVdM.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/cobol-BgCIwGZu.js","assets/coffee-ouOQ86EC.js","assets/cpp-D7oTDj03.js","assets/regexp--aR2_iz7.js","assets/glsl-TOBAB6bO.js","assets/crystal-Dj_CYA08.js","assets/shellscript-DnoJEH0-.js","assets/edge-CCRlTIbg.js","assets/elixir-DkgEFlh9.js","assets/elm-C-6n8iva.js","assets/erb-Cs0Iy0dO.js","assets/ruby-D3BGyoLR.js","assets/haml-BUBfnAPo.js","assets/graphql-ns1EoQQG.js","assets/jsx-fcCEM_-L.js","assets/lua-BIP2dQgW.js","assets/yaml-B9zsrP9R.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-C0sCabJj.js","assets/gdshader-CBce3t8t.js","assets/gdscript-Cp2uCuqX.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-BnAFTyQc.js","assets/glimmer-js-CFyErDLZ.js","assets/glimmer-ts-Ct4QKAg6.js","assets/hack-DB7M32Gm.js","assets/handlebars-qVnY7qVv.js","assets/http-Da_kjz5m.js","assets/hurl-DKXSMFRR.js","assets/csv-Dx-8-gkx.js","assets/hxml-B0Qn7Nwc.js","assets/haxe-OTjmBuCE.js","assets/jinja-DuNSryF7.js","assets/jison-CHwnC1Pv.js","assets/julia-mj6xfn4X.js","assets/r-B_2zvz1A.js","assets/just-DZo2o5E2.js","assets/perl-C1dZQPV5.js","assets/latex-CSkjTfPS.js","assets/tex-Bjo-GMiN.js","assets/liquid-XCoXGo1k.js","assets/marko-CiosSmec.js","assets/less-DVTAwKKz.js","assets/mdc-C7Lb5uay.js","assets/nextflow-Bbiyy34d.js","assets/nextflow-groovy-Dc_ddanL.js","assets/nginx-BgDTOYqs.js","assets/nim-CUz-jMgf.js","assets/php-Cv1yln_y.js","assets/pug-Ce37auPQ.js","assets/qml-DWs4ParD.js","assets/razor-Ctpaw8Xr.js","assets/csharp-Ct8U2NOr.js","assets/rst-CqRkteH8.js","assets/cmake-Bj61d0ZC.js","assets/sas-BaCscvql.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-DnjHxDMP.js","assets/soy-DmAO5KqQ.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-BiJ8hoIJ.js","assets/surrealql-D9bH0Csw.js","assets/svelte-B3woShZ2.js","assets/templ-B7gtJFlV.js","assets/go-BJwz_mda.js","assets/ts-tags-CSxB5Eny.js","assets/twig-DCsq_S7z.js","assets/vue-BR4XqTj9.js","assets/vue-html-DZGW9MGR.js","assets/vue-vine-B157dWFT.js","assets/stylus-B6D30XZt.js","assets/xsl-zsHjPACe.js","assets/c4Diagram-5PPSVZJV-OczhytfR.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-BY_WSiz7.js","assets/chunk-I66GZJ75-DyIufBk3.js","assets/preload-helper-BGRGm2aY.js","assets/dist-BDCdLWk4.js","assets/chunk-NSK5VX7P-C5rgTOqf.js","assets/chunk-2GRJ4B5K-CjXzWa6S.js","assets/flowDiagram-UKHOOZJN-BUBkadfr.js","assets/chunk-4I5QYGJK-CqcwRbfk.js","assets/chunk-WRU74C26-BTfK14t9.js","assets/chunk-7BUUIJ7U-Bb538aSH.js","assets/chunk-UBXNYLIW-D4IRhP65.js","assets/chunk-XXDRQBXY-DR-hrsFH.js","assets/chunk-KBJHAD2P-jJj-4Ly6.js","assets/chunk-W5SLKNZC-Bwa0Erac.js","assets/chunk-QR6OTTB3-Gf6zEt7G.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-7Z6QIM7H-C8-Xmgc1.js","assets/line-C3peQHkb.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/chunk-J7OUQ5F2-B_bnfxd4.js","assets/chunk-ZIRB5QZD-O39ZBUk3.js","assets/chunk-JQJVKLGR-Dqo-DW7E.js","assets/channel-utvaOuUZ.js","assets/chunk-5VM5RSS4-ZNzvKenW.js","assets/swimlanesDiagram-ULZ7WXOC-CrVvBgdm.js","assets/erDiagram-JOGREHBK-DSe3_-3x.js","assets/gitGraphDiagram-DS77QQ5N-CkEDBEZA.js","assets/chunk-JWPE2WC7-DVXcaiue.js","assets/mermaid-parser.core-3r-A_QO0.js","assets/chunk-KEIR6QF5-BICK3FdT.js","assets/chunk-MOZMSUNE-XVucA-n6.js","assets/chunk-OSBZ3O6U-CrKZOUOr.js","assets/chunk-5JV3BV7I-Cy5pj3QY.js","assets/chunk-CYSBUYHQ-C1Rf4art.js","assets/chunk-BIQX33UG-DZEsGuSn.js","assets/chunk-EMLP6XTP-RLD4nXpI.js","assets/chunk-YOTPTUD7-D0vRKqYp.js","assets/chunk-QBLGF6JB-CxAyS2mW.js","assets/chunk-5TONJI2A-DQOY3q1H.js","assets/chunk-5HE753X5-Bw-yg4kO.js","assets/chunk-U6XO7XAA-BFxjP5U3.js","assets/chunk-JG7HCLWE-BYfiSaVt.js","assets/chunk-CQNSW5MT-B8S09OIh.js","assets/chunk-R7FJI6CG-Cnn3gE-Y.js","assets/chunk-5FCAYU7R-Dh5nylU8.js","assets/chunk-2Q5K7J3B-C1jixKkw.js","assets/ganttDiagram-PKOTCBZU-BRE655Yg.js","assets/linear-CmpaHCv3.js","assets/defaultLocale-BFoDCU3G.js","assets/init-C-OQMol4.js","assets/infoDiagram-6WML65LV-DCrOXTRX.js","assets/chunk-3NCLNEKW-CxJ1byyi.js","assets/pieDiagram-7S7Q4E2Y-DymmotfN.js","assets/ordinal-BDEzSJ7C.js","assets/arc-3UKfLtkz.js","assets/quadrantDiagram-CIZ2JOQS-Bdmf940A.js","assets/xychartDiagram-ELKLHX3M-BXEvabM_.js","assets/requirementDiagram-LRYGKXZP-DOQHap5a.js","assets/sequenceDiagram-SI44F4Z6-DZz8CoAK.js","assets/classDiagram-JCYQIIEL-BGtYH_yr.js","assets/chunk-GF5L2VYU-eIwojrcb.js","assets/classDiagram-v2-OCEON4UE-BGtYH_yr.js","assets/stateDiagram-OKZ733FA-Diw1faox.js","assets/graphlib-DS17s2tU.js","assets/dagre-Buvkdvvj.js","assets/map-BaFkSB1l.js","assets/chunk-5RXB4S5H-Bz8imepf.js","assets/stateDiagram-v2-UEYNNEHI-CL8rTg3I.js","assets/journeyDiagram-NVQOT4AX-DjG_Ivem.js","assets/timeline-definition-Z64GVDOM-CeZF9jb3.js","assets/mindmap-definition-FAOFIHXS-B-zxlH-3.js","assets/kanban-definition-27J2QSJJ-DcHXIYS7.js","assets/sankeyDiagram-W5VNT64P-Bw_JjJMs.js","assets/diagram-LBJQPF4R-DX9fn8uM.js","assets/diagram-UB23O5K3-DN2WW8Lf.js","assets/blockDiagram-VBNYF7ZC-DI8mHgDh.js","assets/diagram-7IWD3JNH-CntAMELi.js","assets/architectureDiagram-T3A2C74G-BRtUBpl-.js","assets/cytoscape.esm-B-NFISlW.js","assets/diagram-B4RE2ZJO-CzK0s5lu.js","assets/ishikawaDiagram-WSZJBQD7-Eprw_Axw.js","assets/vennDiagram-T6HMQDX7-Bea6zExh.js","assets/diagram-Q27KOJAE-__XgFhkl.js","assets/wardleyDiagram-T6FBY63Y-fLVlb6T8.js","assets/cynefinDiagram-MW4NZA55-BkWmLTXz.js","assets/railroadDiagram-AXF67PYL-C2_yAAm1.js","assets/chunk-6Q2QTUOP-UdMAlPWh.js","assets/ebnfDiagram-BXEA7PRR-BUzfFfXM.js","assets/abnfDiagram-N423BO3Z-BXLvdit9.js","assets/pegDiagram-VL7TDLO6-CCulIlRS.js"])))=>i.map(i=>d[i]);
|
||
import{a as e,i as t,n,r}from"./rolldown-runtime-B0Z9INg1.js";import{i,n as a,r as o}from"./bundle-mjs-fcjm5Rpo.js";import{t as s}from"./react-dom-tvCQ6jCF.js";import{n as c,t as l}from"./utils-C1dPOAK7.js";import{C as u,S as d,T as f,_ as p,b as m,c as h,d as g,f as _,g as v,h as y,i as b,l as x,m as S,n as C,o as w,p as T,r as ee,s as E,u as te,v as ne,w as D,x as re,y as O}from"./theme-Dll-6lIc.js";import{t as k}from"./preload-helper-BGRGm2aY.js";import{t as ie}from"./katex-ukvJUC1e.js";import{n as A}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{h as ae,m as j,p as oe}from"./src-BY_WSiz7.js";import{$ as se,C as ce,E as le,I as ue,L as de,N as fe,P as pe,Q as me,S as he,T as ge,V as _e,W as ve,X as ye,Z as be,_ as xe,b as Se,c as Ce,g as we,l as Te,m as Ee,n as De,p as Oe,q as ke,r as Ae,t as je,u as Me}from"./chunk-I66GZJ75-DyIufBk3.js";import{S as Ne,a as Pe,f as Fe,g as Ie,h as Le,i as Re,o as ze,v as Be,x as Ve,y as He}from"./chunk-NSK5VX7P-C5rgTOqf.js";import{t as Ue}from"./chunk-3NCLNEKW-CxJ1byyi.js";import{r as We}from"./chunk-4I5QYGJK-CqcwRbfk.js";import{r as Ge}from"./chunk-WRU74C26-BTfK14t9.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-UBXNYLIW-D4IRhP65.js";import"./chunk-W5SLKNZC-Bwa0Erac.js";import"./chunk-QR6OTTB3-Gf6zEt7G.js";import"./chunk-7Z6QIM7H-C8-Xmgc1.js";import{n as Ke}from"./chunk-J7OUQ5F2-B_bnfxd4.js";import{n as qe,t as Je}from"./chunk-ZIRB5QZD-O39ZBUk3.js";import{C as Ye,D as Xe,E as Ze,O as Qe,S as $e,_ as et,b as tt,c as nt,d as rt,f as it,g as at,h as ot,k as st,l as ct,m as lt,o as ut,p as dt,r as ft,s as pt,u as mt,v as ht,w as gt,x as _t,y as vt}from"./chunk-BO2N2NFS-D9GzoDA1.js";import{c as yt,d as bt,i as xt,l as St,n as Ct,o as wt,s as Tt,t as Et,u as Dt}from"./access-control-D86mfb14.js";function Ot(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function kt(e){if(e==null)return!0;if(Ve(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!Ne(e)&&!Be(e)&&!He(e)?!1:e.length===0;if(typeof e==`object`||typeof e==`function`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Ot(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var At=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),jt=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Mt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Nt=e=>{let t=Mt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Pt={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`},Ft=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},M=e(i()),It=(0,M.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,M.createElement)(`svg`,{ref:c,...Pt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:At(`lucide`,i),...!a&&!Ft(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,M.createElement)(e,t)),...Array.isArray(a)?a:[a]])),N=(e,t)=>{let n=(0,M.forwardRef)(({className:n,...r},i)=>(0,M.createElement)(It,{ref:i,iconNode:t,className:At(`lucide-${jt(Nt(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Nt(e),n},Lt=N(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Rt=N(`badge-dollar-sign`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]),zt=N(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Bt=N(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Vt=N(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Ht=N(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ut=N(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Wt=N(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Gt=N(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Kt=N(`ellipsis`,[[`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`}]]),qt=N(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Jt=N(`file-text`,[[`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`}]]),Yt=N(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Xt=N(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Zt=N(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Qt=N(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),$t=N(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),en=N(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),tn=N(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),nn=N(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),rn=N(`paperclip`,[[`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`}]]),an=N(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),on=N(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),sn=N(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),cn=N(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ln=N(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),un=N(`send`,[[`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`}]]),dn=N(`sparkle`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}]]),fn=N(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),pn=N(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),mn=N(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),hn=N(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),gn=N(`wallet`,[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]),_n=N(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),vn=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,yn=a,bn=(e,t)=>n=>{if(t?.variants==null)return yn(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=vn(t)||vn(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return yn(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},P=o(),xn=bn(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`,outline:`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`,"icon-sm":`h-8 w-8`}},defaultVariants:{variant:`default`,size:`default`}}),Sn=M.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,P.jsx)(r?re:`button`,{className:l(xn({variant:t,size:n,className:e})),ref:a,...i}));Sn.displayName=`Button`;var Cn={damping:.7,stiffness:.05,mass:1.25},wn=70,Tn=1e3/60,En=350,Dn=!1;globalThis.document?.addEventListener(`mousedown`,()=>{Dn=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{Dn=!1}),globalThis.document?.addEventListener(`click`,()=>{Dn=!1});var On=(e={})=>{let[t,n]=(0,M.useState)(!1),[r,i]=(0,M.useState)(e.initial!==!1),[a,o]=(0,M.useState)(!1),s=(0,M.useRef)(null);s.current=e;let c=(0,M.useCallback)(()=>{if(!Dn)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,M.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,M.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,M.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=wn}}},[]),f=(0,M.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=jn(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/Tn;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:jn(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,M.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,M.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,M.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=kn(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=kn(e=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=jn(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:En})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function kn(e,t){let n=(0,M.useCallback)(t=>(n.current=t,e(t)),t);return n}var An=new Map;function jn(...e){let t={...Cn},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return An.has(r)||An.set(r,Object.freeze(t)),n?`instant`:An.get(r)}var Mn=(0,M.createContext)(null),Nn=typeof window<`u`?M.useLayoutEffect:M.useEffect;function Pn({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,M.useRef)(null),d=On({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:M.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,M.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,M.useImperativeHandle)(c,()=>y,[y]),Nn(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),M.createElement(Mn.Provider,{value:y},M.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=Fn();return M.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},M.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(Pn||={});function Fn(){let e=(0,M.useContext)(Mn);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}var In=({className:e,...t})=>(0,P.jsx)(Pn,{className:l(`relative flex-1 overflow-y-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),Ln=({className:e,...t})=>(0,P.jsx)(Pn.Content,{className:l(`flex flex-col gap-8 p-4`,e),...t}),Rn=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=Fn(),i=(0,M.useCallback)(()=>{r()},[r]);return!n&&(0,P.jsx)(Sn,{className:l(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,P.jsx)(Lt,{className:`size-4`})})},F={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},zn={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},Bn={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},Vn=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Hn=[12288,12288,65281,65376,65504,65510],Un=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Wn=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Gn=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],Kn=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},qn=19968,[Jn,Yn]=Xn(Gn);function Xn(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(qn>=i&&qn<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var Zn=e=>e<161||e>1114109?!1:Kn(Vn,e),Qn=e=>e<12288||e>65510?!1:Kn(Hn,e),$n=e=>e<8361||e>65518?!1:Kn(Un,e),er=e=>e<32||e>10630?!1:Kn(Wn,e),tr=e=>e>=Jn&&e<=Yn?!0:e<4352||e>262141?!1:Kn(Gn,e);function nr(e){return Zn(e)?`ambiguous`:Qn(e)?`fullwidth`:$n(e)?`halfwidth`:er(e)?`narrow`:tr(e)?`wide`:`neutral`}function rr(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function ir(e){return rr(e),nr(e)}function ar(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function or(e){if(!e||e<4352)return!1;switch(ir(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!ar(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999&&null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function sr(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function cr(e){return e!==null&&e>=65024&&e<=65038}var lr=dr(/\p{P}|\p{S}/u),ur=dr(/\s/);function dr(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function I(e){return!!(e&zn.characterGroupWhitespace)}function fr(e){return(e&vr.cjkPunctuation)===zn.characterGroupPunctuation}function pr(e){return!!(e&vr.cjk)}function mr(e){return e===vr.ivs}function hr(e){return!!(e&vr.cjkOrIvs)}function gr(e){return e===vr.nonEmojiGeneralUseVS}function _r(e){return!!(e&vr.spaceOrPunctuation)}var vr;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(vr||={});function yr(e){if(e===F.eof||dt(e)||ur(e))return zn.characterGroupWhitespace;let t=0;if(e>=4352){if(cr(e))return vr.nonEmojiGeneralUseVS;switch(or(e)){case null:return vr.ivs;case!0:t|=vr.cjk}}return lr(e)&&(t|=zn.characterGroupPunctuation),t}function br(e,t,n){if(!gr(e))return e;let r=t(),i=yr(r);return!r||I(i)?e:sr(r,n)?vr.cjkPunctuation:xr(i)}function xr(e){return e&~vr.ivs}function Sr(e){return!!(e&&e>=55296&&e<=56319)}function Cr(e){return!!(e&&e>=56320&&e<=57343)}function wr(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function Tr(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var Er=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=Tr(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function Dr(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}var Or={name:`attention`,resolveAll:kr,tokenize:Ar};function kr(e,t){let n=-1,r,i,a,o,s,c,l,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;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};jr(d,-c),jr(f,c),o={type:c>1?Bn.strongSequence:Bn.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?Bn.strongSequence:Bn.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?Bn.strongText:Bn.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?Bn.strong:Bn.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ct(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ct(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=ct(l,nt(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ct(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ct(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,mt(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Ar(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=Cr(a)?wr(a,r(),i):a,s=yr(o),c=new Er(o,r(),i),l=br(s,c.value.bind(c),o),u;return d;function d(t){return t===F.asterisk||F.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=yr(Sr(a)?Dr(a,r(),i):a),d=fr(l),p=d||I(l),m=fr(c),h=m||I(c),g=hr(l),_=!h||m&&(p||g)||n.includes(a),v=!p||d&&(h||pr(c))||n.includes(o);return s._open=!!(u===F.asterisk?_:_&&(_r(l)||!v)),s._close=!!(u===F.asterisk?v:v&&(_r(c)||!_)),t(a)}}function jr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function Mr(){return{text:{[F.asterisk]:Or,[F.underscore]:Or},insideSpan:{null:[Or]}}}function Nr(){let e=this.data();(e.micromarkExtensions||=[]).push(Mr())}var Pr=`;`.codePointAt(0)??F.eof,Fr=`&`.codePointAt(0)??F.eof;function Ir(){return{handlers:{emphasis:Lr,strong:Rr,text:Hr}}}Lr.peek=zr,Rr.peek=Br;function Lr(e,t,n,r){return Vr(e,t,n,r,zr(e,t,n),1)}function Rr(e,t,n,r){return Vr(e,t,n,r,Br(e,t,n),2)}function zr(e,t,n){return n.options.emphasis||`*`}function Br(e,t,n){return n.options.strong||`*`}function Vr(e,t,n,r,i,a){let o=i.repeat(a),s=n.enter(a===1?`emphasis`:`strong`),c=n.createTracker(r),l=c.move(o),u=c.move(n.containerPhrasing(e,{after:i,before:l,...c.current()})),d=Xr(e,t,n,r.before),f=Zr(e,t,n,r.after),p=Ur(d,li(u),i,`open`);p.inside&&u&&(u=oi(u));let m=Ur({current:ui(u),previous:ci(u)},f,i,`close`);m.inside&&u&&(u=si(u));let h=c.move(o);s();let g=m.outside&&ni(t,n);return n.attentionEncodeSurroundingInfo={after:m.outside&&!g,before:p.outside},ri(n).cjkFriendlyEncodeAfterSupplementaryText=g,l+u+h}function Hr(e,t,n,r){let i=ri(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${ai(a.codePointAt(0)??F.eof)}${n.safe(o,{...r,before:`;`})}`}function Ur(e,t,n,r){let i=Yr(e),a=yr(t);if(!hr(i)&&!hr(a))return r===`open`?Wr(i,a,n):Wr(a,i,n);let o={inside:!1,outside:!1},s={inside:!0,outside:!1},c={inside:!1,outside:!0},l={inside:!0,outside:!0};for(let i of[o,s,c,l]){let a=r===`open`?i.outside?di:e:i.inside?di:e,o=r===`open`?i.inside?fi:t:i.outside?fi:t;if(r===`open`?Gr(n,a,o):Kr(n,a,o))return i}return l}function Wr(e,t,n){return Jr(e)?Jr(t)?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:I(e)?Jr(t)?{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Gr(e,t,n){let r=Yr(t),{close:i,open:a}=qr(r,yr(n));return e===`_`?a&&(_r(r)||!i):a}function Kr(e,t,n){let r=yr(n),{close:i,open:a}=qr(Yr(t),r);return e===`_`?i&&(_r(r)||!a):i}function qr(e,t){let n=fr(e),r=n||I(e),i=fr(t),a=i||I(t);return{open:!a||i&&(r||hr(e)),close:!r||n&&(a||pr(t))}}function Jr(e){return!I(e)&&!fr(e)}function Yr(e){let t=yr(e.current);return e.current===null||!gr(t)?t:br(t,()=>e.previous,e.current)}function Xr(e,t,n,r){let i=ui(r),a=ci(r);if(Qr(i)||ei(i,a)){let r=ti(e,t,n,-1);r&&(i=ui(r),a=ci(r))}return{current:i,previous:a}}function Zr(e,t,n,r){let i=li(r);if(!$r(i))return i;let a=ti(e,t,n,1);return a?li(a):i}function Qr(e){return e!==null&&56320<=e&&e<=57343}function $r(e){return e!==null&&55296<=e&&e<=56319}function ei(e,t){return gr(yr(e))&&(t===null||t===F.eof)}function ti(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return ii(s)||void 0}function ni(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(li(r.value)??0)>65535}function ri(e){return e}function ii(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(ii).join(``):``}function ai(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function oi(e){let[t=``]=[...e];return ai(t.codePointAt(0)??F.eof)+e.slice(t.length)}function si(e){let t=[...e],n=t.pop();return`${t.join(``)}${ai(n?.codePointAt(0)??F.eof)}`}function ci(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??F.eof}function li(e){return e.codePointAt(0)??F.eof}function ui(e){return[...e].at(-1)?.codePointAt(0)??F.eof}var di={current:Pr,previous:F.eof},fi=Fr;function pi(){let e=this.data();(e.toMarkdownExtensions||=[]).push(Ir())}function mi(){Nr.call(this),pi.call(this)}var hi=mi;function gi(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{[F.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[F.tilde]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&mt(o,o.length,0,nt(s,e.slice(r+1,n),t)),mt(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),mt(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=Bn.data);return e}function i(e,n,r){let{now:i,sliceSerialize:a,previous:o}=this,s=Cr(o)?wr(o,i(),a):o,c=yr(s),l=new Er(s,i(),a),u=br(c,l.value.bind(l),s),d=this.events,f=0;return p;function p(t){return F.tilde,s===F.tilde&&d[d.length-1][1].type!==Bn.characterEscape?r(t):(e.enter(`strikethroughSequenceTemporary`),m(t))}function m(o){let c=yr(s);if(o===F.tilde)return f>1?r(o):(e.consume(o),f++,m);if(f<2&&!t)return r(o);let l=e.exit(`strikethroughSequenceTemporary`),d=yr(Sr(o)?Dr(o,i(),a):o),p=fr(u)||I(u),h=fr(d)||I(d),g=pr(u)||mr(c);return l._open=!h||d===zn.attentionSideAfter&&(p||g),l._close=!p||c===zn.attentionSideAfter&&(h||pr(d)),n(o)}}}function _i(e){let t=this.data();(t.micromarkExtensions||=[]).push(gi(e))}var vi=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],yi=`;`.codePointAt(0)??F.eof,bi=`&`.codePointAt(0)??F.eof;function xi(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:vi}],handlers:{delete:Si,text:Ci}}}Si.peek=wi;function Si(e,t,n,r){let i=n.enter(`strikethrough`),a=n.createTracker(r),o=a.move(`~~`),s=a.move(n.containerPhrasing(e,{after:`~`,before:o,...a.current()})),c=Mi(e,t,n,r.before),l=Ni(e,t,n,r.after),u=Ti(c,Gi(s),`open`);u.inside&&s&&(s=Hi(s));let d=Ti({current:Ki(s),previous:Wi(s)},l,`close`);d.inside&&s&&(s=Ui(s));let f=a.move(`~~`);i();let p=d.outside&&Ri(t,n);return n.attentionEncodeSurroundingInfo={after:d.outside&&!p,before:u.outside},zi(n).cjkFriendlyEncodeAfterSupplementaryText=p,o+s+f}function Ci(e,t,n,r){let i=zi(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${Vi(a.codePointAt(0)??F.eof)}${n.safe(o,{...r,before:`;`})}`}function wi(){return`~`}function Ti(e,t,n){let r=ji(e),i=yr(t);if(!hr(r)&&!hr(i))return n===`open`?Ei(r,i):Ei(i,r);let a={inside:!1,outside:!1},o={inside:!0,outside:!1},s={inside:!1,outside:!0},c={inside:!0,outside:!0};for(let r of[a,o,s,c]){let i=n===`open`?r.outside?qi:e:r.inside?qi:e,a=n===`open`?r.inside?Ji:t:r.outside?Ji:t;if(n===`open`?Di(i,a):Oi(i,a))return r}return c}function Ei(e,t){return Ai(e)?Ai(t)?{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:I(e)?Ai(t)?{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Di(e,t){let{open:n}=ki(ji(e),yr(t));return n}function Oi(e,t){let n=yr(t),{close:r}=ki(ji(e),n);return r}function ki(e,t){let n=fr(e),r=n||I(e),i=fr(t),a=i||I(t);return{open:!a||i&&(r||hr(e)),close:!r||n&&(a||pr(t))}}function Ai(e){return!I(e)&&!fr(e)}function ji(e){let t=yr(e.current);return e.current===null||!gr(t)?t:br(t,()=>e.previous,e.current)}function Mi(e,t,n,r){let i=Ki(r),a=Wi(r);if(Pi(i)||Ii(i,a)){let r=Li(e,t,n,-1);r&&(i=Ki(r),a=Wi(r))}return{current:i,previous:a}}function Ni(e,t,n,r){let i=Gi(r);if(!Fi(i))return i;let a=Li(e,t,n,1);return a?Gi(a):i}function Pi(e){return e!==null&&56320<=e&&e<=57343}function Fi(e){return e!==null&&55296<=e&&e<=56319}function Ii(e,t){return gr(yr(e))&&(t===null||t===F.eof)}function Li(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return Bi(s)||void 0}function Ri(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(Gi(r.value)??0)>65535}function zi(e){return e}function Bi(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(Bi).join(``):``}function Vi(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function Hi(e){let[t=``]=[...e];return Vi(t.codePointAt(0)??F.eof)+e.slice(t.length)}function Ui(e){let t=[...e],n=t.pop();return`${t.join(``)}${Vi(n?.codePointAt(0)??F.eof)}`}function Wi(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??F.eof}function Gi(e){return e.codePointAt(0)??F.eof}function Ki(e){return[...e].at(-1)?.codePointAt(0)??F.eof}var qi={current:yi,previous:F.eof},Ji=bi;function Yi(){let e=this.data();(e.toMarkdownExtensions||=[]).push(xi())}function Xi(e){_i.call(this,e),Yi.call(this)}var Zi=Xi,Qi=new Set([`。`,`.`,`,`,`、`,`?`,`!`,`:`,`;`,`(`,`)`,`【`,`】`,`「`,`」`,`『`,`』`,`〈`,`〉`,`《`,`》`]),$i=/^(https?:\/\/|mailto:|www\.)/i,ea=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type===`text`&&t.value===e.url},ta=e=>{let t=0;for(let n of e){if(Qi.has(n))return t;t+=n.length}return null},na=(e,t)=>({...t,url:e,children:[{type:`text`,value:e}]}),ra=e=>({type:`text`,value:e}),ia=()=>e=>{Ze(e,`link`,(e,t,n)=>{if(!n||typeof t!=`number`||!ea(e)||!$i.test(e.url))return;let r=ta(e.url);if(r===null||r===0)return;let i=e.url.slice(0,r),a=e.url.slice(r),o=na(i,e),s=ra(a);return n.children.splice(t,1,o,s),t+1})};function aa(){let e=[hi],t=[ia,Zi];return{name:`cjk`,type:`cjk`,remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:[...e,...t]}}var oa=aa(),L=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function sa(e){return ca(e)}function ca(e){return Array.isArray(e)?la(e):e instanceof RegExp?e:typeof e==`object`?ua(e):e}function la(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=ca(e[n]);return t}function ua(e){let t={};for(let n in e)t[n]=ca(e[n]);return t}function da(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function fa(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?fa(e.substring(0,e.length-1)):e.substr(~t+1)}var pa=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ma=class{static hasCaptures(e){return e!==null&&(pa.lastIndex=0,pa.test(e))}static replaceCaptures(e,t,n){return e.replace(pa,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function ha(e,t){return e<t?-1:+(e>t)}function ga(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=ha(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function _a(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function va(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var ya=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},ba=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Ta(e),t)}static createFromParsedTheme(e,t){return Oa(e,t)}_cachedMatchRoot=new ya(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Sa(e.parent,t.parentScopes));return n?new wa(n.fontStyle,n.foreground,n.background):null}},xa=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Sa(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Ca(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Ca(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var wa=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ta(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&_a(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&_a(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Ea(l,u,e,o,s,c)}}return n}var Ea=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},Da=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(Da||{});function Oa(e,t){e.sort((e,t)=>{let n=ha(e.scope,t.scope);return n!==0||(n=ga(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new ka(t),o=new wa(n,a.getId(r),a.getId(i)),s=new Ma(new ja(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new ba(a,o,s)}var ka=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Aa=Object.freeze([]),ja=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Aa,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Ma=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),ja.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ga(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new ja(e,t,n,r,i))}},Na=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Fa(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Pa(e){return e}function Fa(e){return e}function Ia(e,t){let n=[],r=Ra(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(La(i)){let e=[];do e.push(i),i=r.next();while(La(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function La(e){return!!e&&!!e.match(/[\w\.:]+/)}function Ra(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function za(e){typeof e.dispose==`function`&&e.dispose()}var Ba=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Va=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ha=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Ua=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ba(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Ha;for(let n of e)Wa(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Ba){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Wa(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Ba?Ka({baseGrammar:a,selfGrammar:i},r):Ga(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Ba(e))}function Ga(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];qa([r],t,n)}}function Ka(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&qa(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&qa(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function qa(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?da({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&qa(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=$a(i);switch(a.kind){case 0:Ka({...t,selfGrammar:t.baseGrammar},n);break;case 1:Ka(t,n);break;case 2:Ga(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Ga(a.ruleName,i,n):Ka(i,n)}else a.kind===4?n.add(new Va(a.scopeName,a.ruleName)):n.add(new Ba(a.scopeName))}}}var Ja=class{kind=0},Ya=class{kind=1},Xa=class{constructor(e){this.ruleName=e}kind=2},Za=class{constructor(e){this.scopeName=e}kind=3},Qa=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function $a(e){if(e===`$base`)return new Ja;if(e===`$self`)return new Ya;let t=e.indexOf(`#`);return t===-1?new Za(e):t===0?new Xa(e.substring(1)):new Qa(e.substring(0,t),e.substring(t+1))}var eo=/\\(\d+)/,to=/\\(\d+)/g,no=-1,ro=-2;function io(e){return e}function ao(e){return e}var oo=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=ma.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ma.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${fa(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:ma.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ma.replaceCaptures(this._contentName,e,t)}},so=class extends oo{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},co=class extends oo{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new mo(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ho,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},lo=class extends oo{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ho,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},uo=class extends oo{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new mo(i,this.id),this.beginCaptures=a,this._end=new mo(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ho;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},fo=class extends oo{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new mo(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new mo(o,ro),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ho;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ho,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},po=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new so(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new co(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=da({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new lo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new fo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new uo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=$a(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof lo||e instanceof uo||e instanceof fo)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},mo=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&eo.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return to.lastIndex=0,this.source.replace(to,(e,t)=>va(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ho=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new go(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new go(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},go=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
||
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},_o=class{constructor(e,t){this.languageId=e,this.tokenType=t}},vo=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new _o(e,8),this._embeddedLanguagesMatcher=new yo(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new _o(0,0);_getBasicScopeAttributes=new ya(e=>new _o(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},yo=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>va(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var bo=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function xo(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=So(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new bo(i,!0);f()}return new bo(i,!1);function f(){let o=Co(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===no){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Oo(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof uo){let r=o;Oo(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof fo){let r=o;Oo(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Oo(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function So(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof fo&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Do(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==ro){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Oo(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Co(e,t,n,r,i,a){let o=wo(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=To(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function wo(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Eo(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function To(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Eo(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Eo(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Do(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Oo(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));xo(e,p,n&&d.start===0,d.start,f,i,!1,0),za(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new ko(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var ko=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Ao(e,t,n,r,i,a,o,s){return new Po(e,t,n,r,i,a,o,s)}function jo(e,t,n,r,i){let a=Ia(t,Mo),o=po.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Mo(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(No(t[r],e))return n=r+1,!0;return!1})}function No(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var Po=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new vo(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Fo(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=Ia(e,Mo);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)jo(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&jo(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(io(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[ao(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Fo(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=po.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Lo.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Na.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Io.createRootAndLookUpScopeName(a,r,this):Io.createRoot(`unknown`,r),t=new Lo(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
||
`;let a=this.createOnigString(e),o=a.content.length,s=new zo(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=xo(this,a,i,0,t,s,!0,r);return za(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Fo(e,t){return e=sa(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Io=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=xa.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new xa(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new xa(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Na.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Lo=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Io.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:ao(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Io.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,io(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Io.fromExtension(r,n.contentNameScopesList))}},Ro=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Ia(e,Mo).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Ia(e,Mo).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},zo=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=Na.set(n,0,Pa(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Na.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Bo=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Ao(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Vo=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Bo(ba.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(ba.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Ro(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Ua(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Ho=Lo.NULL,Uo=/["&'<>`]/g,Wo=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Go=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ko=/[|\\{}()[\]^$+*?.]/g,qo=new WeakMap;function Jo(e,t){if(e=e.replace(t.subset?Yo(t.subset):Uo,r),t.subset||t.escapeOnly)return e;return e.replace(Wo,n).replace(Go,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Yo(e){let t=qo.get(e);return t||(t=Xo(e),qo.set(e,t)),t}function Xo(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Ko,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Zo=/[\dA-Fa-f]/;function Qo(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Zo.test(String.fromCharCode(t))?r:r+`;`}var $o=/\d/;function es(e,t,n){let r=`&#`+String(e);return n&&t&&!$o.test(String.fromCharCode(t))?r:r+`;`}var ts=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),ns={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},rs=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],is={}.hasOwnProperty,as={},os;for(os in ns)is.call(ns,os)&&(as[ns[os]]=os);var ss=/[^\dA-Za-z]/;function cs(e,t,n,r){let i=String.fromCharCode(e);if(is.call(as,i)){let e=as[i],a=`&`+e;return n&&ts.includes(e)&&!rs.includes(e)&&(!r||t&&t!==61&&ss.test(String.fromCharCode(t)))?a:a+`;`}return``}function ls(e,t,n){let r=Qo(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=cs(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=es(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function us(e,t){return Jo(e,Object.assign({format:ls},t))}var ds=/^>|^->|<!--|-->|--!>|<!-$/g,fs=[`>`],ps=[`<`,`>`];function ms(e,t,n,r){return r.settings.bogusComments?`<?`+us(e.value,Object.assign({},r.settings.characterReferences,{subset:fs}))+`>`:`<!--`+e.value.replace(ds,i)+`-->`;function i(e){return us(e,Object.assign({},r.settings.characterReferences,{subset:ps}))}}function hs(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var R=vs(1),gs=vs(-1),_s=[];function vs(e){return t;function t(t,n,r){let i=t?t.children:_s,a=(n||0)+e,o=i[a];if(!r)for(;o&&ut(o);)a+=e,o=i[a];return o}}var ys={}.hasOwnProperty;function bs(e){return t;function t(t,n,r){return ys.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var xs=bs({body:ws,caption:Ss,colgroup:Ss,dd:Os,dt:Ds,head:Ss,html:Cs,li:Es,optgroup:As,option:js,p:Ts,rp:ks,rt:ks,tbody:Ns,td:Is,tfoot:Ps,th:Is,thead:Ms,tr:Fs});function Ss(e,t,n){let r=R(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&ut(r.value.charAt(0)))}function Cs(e,t,n){let r=R(n,t);return!r||r.type!==`comment`}function ws(e,t,n){let r=R(n,t);return!r||r.type!==`comment`}function Ts(e,t,n){let r=R(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function Es(e,t,n){let r=R(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Ds(e,t,n){let r=R(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Os(e,t,n){let r=R(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function ks(e,t,n){let r=R(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function As(e,t,n){let r=R(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function js(e,t,n){let r=R(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Ms(e,t,n){let r=R(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Ns(e,t,n){let r=R(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Ps(e,t,n){return!R(n,t)}function Fs(e,t,n){let r=R(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Is(e,t,n){let r=R(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Ls=bs({body:Bs,colgroup:Vs,head:zs,html:Rs,tbody:Hs});function Rs(e){let t=R(e,-1);return!t||t.type!==`comment`}function zs(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Bs(e){let t=R(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&ut(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Vs(e,t,n){let r=gs(n,t),i=R(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&xs(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Hs(e,t,n){let r=gs(n,t),i=R(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&xs(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Us={name:[[`
|
||
\f\r &/=>`.split(``),`
|
||
\f\r "&'/=>\``.split(``)],[`\0
|
||
\f\r "&'/<=>`.split(``),`\0
|
||
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
||
\f\r &>`.split(``),`\0
|
||
\f\r "&'<=>\``.split(``)],[`\0
|
||
\f\r "&'<=>\``.split(``),`\0
|
||
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Ws(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Ye);let l=Gs(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Ls(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!xs(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Gs(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Ks(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Ks(e,t,n){let r=gt(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=us(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Us.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?_t:tt)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=us(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Us.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&<(n,o)>lt(n,e.alternative)&&(o=e.alternative),s=o+us(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Us.single:Us.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var qs=[`<`,`&`];function Js(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:us(e.value,Object.assign({},r.settings.characterReferences,{subset:qs}))}function Ys(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Js(e,t,n,r)}function Xs(e,t,n,r){return r.all(e)}var Zs=at(`type`,{invalid:Qs,unknown:$s,handlers:{comment:ms,doctype:hs,element:Ws,raw:Ys,root:Xs,text:Js}});function Qs(e){throw Error("Expected node, not `"+e+"`")}function $s(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var ec={},tc={},nc=[];function rc(e,t){let n=t||ec,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ic,all:ac,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ot,characterReferences:n.characterReferences||tc,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Ye:$e,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function ic(e,t,n){return Zs(e,t,n,this)}function ac(e){let t=[],n=e&&e.children||nc,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function oc(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function sc(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function cc(e){return Array.isArray(e)?e:[e]}async function lc(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function uc(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function dc(e){return e===`ansi`||uc(e)}function fc(e){return e===`none`}function pc(e){return fc(e)}function mc(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function hc(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}function gc(e){let t=hc(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function _c(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var vc=`light-dark()`,yc=[`color`,`background-color`];function bc(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function xc(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?bc(e,t):e})):e}function Sc(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Cc(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&yc.includes(a)){if(r===vc&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new L('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function Cc(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&Da.Italic&&(t[`font-style`]=`italic`),e.fontStyle&Da.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&Da.Underline&&n.push(`underline`),e.fontStyle&Da.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function wc(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var Tc=new WeakMap;function Ec(e,t){Tc.set(e,t)}function Dc(e){return Tc.get(e)}var Oc=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(cc(n).map(e=>[e,Ho])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return kc(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function kc(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Ac(e,t){if(!(e instanceof Oc))throw new L(`Invalid grammar state`);return e.getInternalStack(t)}function jc(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new L(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}{let t=r.lines[e.line];if(t===void 0)throw new L(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new L(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}},r=gc(t.source),i=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));Mc(i),e.set(t.meta,{decorations:i,converter:r,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return xc(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new L(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Nc(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new L(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new L(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&mc(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Mc(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new L(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new L(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Nc(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Nc).join(``):``}var Pc=[jc()];function Fc(e){let t=Ic(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Pc]}function Ic(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Lc=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Rc={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function zc(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Bc(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Vc(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)Rc[r]&&t.push({type:`setDecoration`,value:Rc[r]});else if(r<=29){let e=Rc[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:Lc[r-30]}});else if(r===38){let n=Bc(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:Lc[r-40]}});else if(r===48){let n=Bc(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:Lc[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:Lc[r-100+8]}})}}return t}function Hc(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=zc(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Vc(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Uc={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Wc(e=Uc){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<Lc.length;e++)r.push(t(Lc[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Gc={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Kc(e,t,n){let r=oc(e,n),i=hc(t),a=Wc(Object.fromEntries(Lc.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Gc[t]]}))),o=Hc();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=sc(i,r),o=sc(o,r),n.decorations.has(`dim`)&&(i=qc(i));let s=Da.None;return n.decorations.has(`bold`)&&(s|=Da.Bold),n.decorations.has(`italic`)&&(s|=Da.Italic),n.decorations.has(`underline`)&&(s|=Da.Underline),n.decorations.has(`strikethrough`)&&(s|=Da.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function qc(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Jc(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||`text`);if(uc(i)||fc(r))return hc(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:a,colorMap:o}=e.setTheme(r);if(i===`ansi`)return Kc(a,t,n);let s=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==s.name)throw new L(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(a.name))throw new L(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return Xc(t,s,a,o,n)}function Yc(...e){if(e.length===2)return Dc(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(uc(i)||fc(a))throw new L(`Plain language does not have grammar state`);if(i===`ansi`)throw new L(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Oc(Zc(n,c,o,s,r).stateStack,c.name,o.name)}function Xc(e,t,n,r,i){let a=Zc(e,t,n,r,i),o=new Oc(a.stateStack,t.name,n.name);return Ec(a.tokens,o),a.tokens}function Zc(e,t,n,r,i){let a=oc(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=hc(e),l=i.grammarState?Ac(i.grammarState,n.name)??Ho:i.grammarContextCode==null?Ho:Zc(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=sc(r[Na.getForeground(s)],a),l=Na.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?Qc(t.scopes):$c(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function Qc(e){return e.map(e=>({scopeName:e}))}function $c(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:nl(e,i,t.slice(0,r))}}return n}function el(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function tl(e,t,n){if(!el(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)el(e[r],n[i])&&--r,--i;return r===-1}function nl(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(tl(e,t,n)){r.push(a);break}return r}function rl(e,t,n){let r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{let i=Jc(e,t,{...n,theme:r.theme});return{tokens:i,state:Dc(i),theme:typeof r.theme==`string`?r.theme:r.theme.name}}),a=il(...i.map(e=>e.tokens)),o=a[0].map((e,t)=>e.map((e,i)=>{let o={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(o.explanation=e.explanation),a.forEach((e,n)=>{let{content:a,explanation:s,offset:c,...l}=e[t][i];o.variants[r[n].color]=l}),o})),s=i[0].state?new Oc(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return s&&Ec(o,s),o}function il(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}function al(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new L("`themes` option must not be empty");let p=rl(e,t,n);if(c=Dc(p),l&&vc!==l&&!f.find(e=>e.color===l))throw new L(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Sc(e,h,u,l,d))),c&&Ec(a,c);let g=f.map(e=>oc(e.theme,n));i=ol(f,m,g,u,l,`fg`,d),r=ol(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=oc(n.theme,n);a=Jc(e,t,n);let l=e.getTheme(n.theme);r=sc(l.bg,s),i=sc(l.fg,s),o=l.name,c=Dc(a)}else throw new L("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function ol(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=sc(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===vc&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new L('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${sc(t[r][a],n[r])||`inherit`}, ${sc(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function sl(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>sl(e,t,n),codeToTokens:(t,n)=>al(e,t,n)}){let i=t;for(let e of Fc(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=al(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=ll(a):d===`never`&&(a=ul(a)),f&&(a=dl(a));let p={...r,get source(){return i}};for(let e of Fc(n))a=e.tokens?.call(p,a)||a;return cl(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function cl(e,t,n,r=Dc(e)){let i=Fc(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:mc,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
||
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=wc(a.htmlStyle||Cc(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Ec(m,r),m}function ll(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&Da.Underline||i.fontStyle&Da.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function ul(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function dl(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=wc(e.htmlStyle||Cc(e)),i=wc(n.htmlStyle||Cc(n)),a=e.fontStyle&&(e.fontStyle&Da.Underline||e.fontStyle&Da.Strikethrough),o=n.fontStyle&&(n.fontStyle&Da.Underline||n.fontStyle&Da.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var fl=rc;function pl(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>sl(e,t,n),codeToTokens:(t,n)=>al(e,t,n)},i=fl(sl(e,t,n,r));for(let e of Fc(n))i=e.postprocess?.call(r,i,n)||i;return i}var ml={light:`#333333`,dark:`#bbbbbb`},hl={light:`#fffffe`,dark:`#1e1e1e`},gl=`__shiki_resolved`;function _l(e){if(e?.[gl])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?ml.light:ml.dark,n||=t.type===`light`?hl.light:hl.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,gl,{enumerable:!1,writable:!1,value:!0}),t}async function vl(e){return Array.from(new Set((await Promise.all(e.filter(e=>!dc(e)).map(async e=>await lc(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function yl(e){return(await Promise.all(e.map(async e=>pc(e)?null:_l(await lc(e))))).filter(e=>!!e)}var bl=3;function xl(e,t=3){bl&&(typeof bl==`number`&&t>bl||console.trace(`[SHIKI DEPRECATE]: ${e}`))}var Sl=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Cl(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Sl(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var wl=class extends Vo{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=_l(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=ba.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Cl(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new Sl(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Tl=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},El=0;function Dl(e){El+=1,e.warnings!==!1&&El>=10&&El%10==0&&console.warn(`[Shiki] ${El} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Sl("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(_l),i=new wl(new Tl(e.engine,n),r,n,e.langAlias),a;function o(t){return Cl(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new Sl(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new Sl(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await vl(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await yl(e))}function g(){if(t)throw new Sl(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--El)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Ol(e){e.engine||xl("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([yl(e.themes||[]),vl(e.langs||[]),e.engine]);return Dl({...e,themes:t,langs:n,engine:r})}async function kl(e){let t=await Ol(e);return{getLastGrammarState:(...e)=>Yc(t,...e),codeToTokensBase:(e,n)=>Jc(t,e,n),codeToTokensWithThemes:(e,n)=>rl(t,e,n),codeToTokens:(e,n)=>al(t,e,n),codeToHast:(e,n)=>sl(t,e,n),codeToHtml:(e,n)=>pl(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Al(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,dc(n))return[];let r=t[n];if(!r)throw new L(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(pc(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new L(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await kl({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function jl(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function Ml(e,t){let n=jl(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var Nl=[{id:`abap`,name:`ABAP`,import:(()=>k(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>k(()=>import(`./actionscript-3--17pq3dv.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>k(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>k(()=>import(`./angular-html-i2ZEVJq0.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>k(()=>import(`./angular-ts-CEQYB7nm.js`),__vite__mapDeps([5,0,1,2,3,4,6])))},{id:`apache`,name:`Apache Conf`,import:(()=>k(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>k(()=>import(`./apex-CGTLDQj6.js`),[]))},{id:`apl`,name:`APL`,import:(()=>k(()=>import(`./apl-BqqYD0H4.js`),__vite__mapDeps([7,3,1,4,2,8,9,10])))},{id:`applescript`,name:`AppleScript`,import:(()=>k(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>k(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>k(()=>import(`./asciidoc-DE70LPWp.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>k(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>k(()=>import(`./astro-Dt1mSA-e.js`),__vite__mapDeps([11,3,1,4,10,12,13,14])))},{id:`awk`,name:`AWK`,import:(()=>k(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>k(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>k(()=>import(`./bat-Bo4NYOV-.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>k(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>k(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>k(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>k(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>k(()=>import(`./bird2-C2hNVINV.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>k(()=>import(`./blade-D83jhYA_.js`),__vite__mapDeps([15,3,1,4,2,8,9,10,16,17])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>k(()=>import(`./bsl-BkkzgIyY.js`),__vite__mapDeps([18,19])))},{id:`c`,name:`C`,import:(()=>k(()=>import(`./c-aGSZMVdM.js`).then(e=>e.n),__vite__mapDeps([20,1])))},{id:`c3`,name:`C3`,import:(()=>k(()=>import(`./c3-CnJL0r0V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>k(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>k(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>k(()=>import(`./clarity-SemFz856.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>k(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>k(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>k(()=>import(`./cobol-BgCIwGZu.js`),__vite__mapDeps([23,2,1,3,4,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>k(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>k(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>k(()=>import(`./coffee-ouOQ86EC.js`),__vite__mapDeps([24,3,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>k(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>k(()=>import(`./coq-BrsZFFmf.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>k(()=>import(`./cpp-D7oTDj03.js`).then(e=>e.n),__vite__mapDeps([25,1,17,26,27,20])))},{id:`crystal`,name:`Crystal`,import:(()=>k(()=>import(`./crystal-Dj_CYA08.js`),__vite__mapDeps([28,3,1,4,2,17,20,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>k(()=>import(`./csharp-Ct8U2NOr.js`),[]))},{id:`css`,name:`CSS`,import:(()=>k(()=>import(`./css-DeEW2upM.js`).then(e=>e.n),__vite__mapDeps([4,1])))},{id:`csv`,name:`CSV`,import:(()=>k(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>k(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>k(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>k(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>k(()=>import(`./dart-DkHntEIa.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>k(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>k(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>k(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>k(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>k(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>k(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>k(()=>import(`./edge-CCRlTIbg.js`),__vite__mapDeps([30,2,1,3,4,12,16])))},{id:`elixir`,name:`Elixir`,import:(()=>k(()=>import(`./elixir-DkgEFlh9.js`),__vite__mapDeps([31,2,1,3,4])))},{id:`elm`,name:`Elm`,import:(()=>k(()=>import(`./elm-C-6n8iva.js`),__vite__mapDeps([32,27,1,20])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>k(()=>import(`./emacs-lisp-C9PiwqqW.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>k(()=>import(`./erb-Cs0Iy0dO.js`),__vite__mapDeps([33,2,1,3,4,34,8,9,17,20,25,26,27,29,35,36,12,14,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>k(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>k(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>k(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>k(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>k(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>k(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>k(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>k(()=>import(`./gdresource-C0sCabJj.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>k(()=>import(`./gdscript-Cp2uCuqX.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>k(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>k(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>k(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>k(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>k(()=>import(`./git-rebase-BnAFTyQc.js`),__vite__mapDeps([50,29,1])))},{id:`gleam`,name:`Gleam`,import:(()=>k(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>k(()=>import(`./glimmer-js-CFyErDLZ.js`),__vite__mapDeps([51,3,1,4,2,12])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>k(()=>import(`./glimmer-ts-Ct4QKAg6.js`),__vite__mapDeps([52,3,1,4,2,12])))},{id:`glsl`,name:`GLSL`,import:(()=>k(()=>import(`./glsl-TOBAB6bO.js`).then(e=>e.n),__vite__mapDeps([27,1,20])))},{id:`gn`,name:`GN`,import:(()=>k(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>k(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>k(()=>import(`./go-BJwz_mda.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>k(()=>import(`./graphql-ns1EoQQG.js`).then(e=>e.n),__vite__mapDeps([36,1,3,12,14,37])))},{id:`groovy`,name:`Groovy`,import:(()=>k(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>k(()=>import(`./hack-DB7M32Gm.js`),__vite__mapDeps([53,2,1,3,4,17])))},{id:`haml`,name:`Ruby Haml`,import:(()=>k(()=>import(`./haml-BUBfnAPo.js`).then(e=>e.n),__vite__mapDeps([35,1,3,4])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>k(()=>import(`./handlebars-qVnY7qVv.js`),__vite__mapDeps([54,3,1,4,2,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>k(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>k(()=>import(`./haxe-OTjmBuCE.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>k(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>k(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>k(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>k(()=>import(`./html-DhBYQyK4.js`).then(e=>e.n),__vite__mapDeps([2,1,3,4])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>k(()=>import(`./html-derivative-C_nRlqME.js`),__vite__mapDeps([16,2,1,3,4])))},{id:`http`,name:`HTTP`,import:(()=>k(()=>import(`./http-Da_kjz5m.js`),__vite__mapDeps([55,8,1,9,10,29,36,3,12,14,37])))},{id:`hurl`,name:`Hurl`,import:(()=>k(()=>import(`./hurl-DKXSMFRR.js`),__vite__mapDeps([56,8,1,9,57,36,3,12,14,37])))},{id:`hxml`,name:`HXML`,import:(()=>k(()=>import(`./hxml-B0Qn7Nwc.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>k(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>k(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>k(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>k(()=>import(`./java-duG_UTKe.js`).then(e=>e.n),__vite__mapDeps([9,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>k(()=>import(`./javascript-DWVbOe4X.js`).then(e=>e.n),__vite__mapDeps([3,1])))},{id:`jinja`,name:`Jinja`,import:(()=>k(()=>import(`./jinja-DuNSryF7.js`),__vite__mapDeps([60,2,1,3,4])))},{id:`jison`,name:`Jison`,import:(()=>k(()=>import(`./jison-CHwnC1Pv.js`),__vite__mapDeps([61,3,1])))},{id:`json`,name:`JSON`,import:(()=>k(()=>import(`./json-Br_ORbR4.js`).then(e=>e.n),__vite__mapDeps([10,1])))},{id:`json5`,name:`JSON5`,import:(()=>k(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>k(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>k(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>k(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>k(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>k(()=>import(`./jsx-fcCEM_-L.js`).then(e=>e.n),__vite__mapDeps([37,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>k(()=>import(`./julia-mj6xfn4X.js`),__vite__mapDeps([62,3,1,17,22,25,26,27,20,63])))},{id:`just`,name:`Just`,import:(()=>k(()=>import(`./just-DZo2o5E2.js`),__vite__mapDeps([64,3,1,12,22,29,34,4,2,8,9,17,20,25,26,27,35,36,14,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>k(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>k(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>k(()=>import(`./kusto-BUv0MjJC.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>k(()=>import(`./latex-CSkjTfPS.js`),__vite__mapDeps([66,67,63,1])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>k(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>k(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>k(()=>import(`./liquid-XCoXGo1k.js`),__vite__mapDeps([68,3,1,4,2,10])))},{id:`llvm`,name:`LLVM IR`,import:(()=>k(()=>import(`./llvm-Cm23YOpf.js`),[]))},{id:`log`,name:`Log file`,import:(()=>k(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>k(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>k(()=>import(`./lua-BIP2dQgW.js`).then(e=>e.n),__vite__mapDeps([38,1,20])))},{id:`luau`,name:`Luau`,import:(()=>k(()=>import(`./luau-CNKltnaQ.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>k(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>k(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>k(()=>import(`./marko-CiosSmec.js`),__vite__mapDeps([69,4,1,6,12,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>k(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>k(()=>import(`./mdc-C7Lb5uay.js`),__vite__mapDeps([71,16,2,1,3,4,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>k(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>k(()=>import(`./mermaid-Bk4SNUv9.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>k(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>k(()=>import(`./mojo-BgCJLMeH.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>k(()=>import(`./moonbit-CaWjb8XO.js`),[]))},{id:`move`,name:`Move`,import:(()=>k(()=>import(`./move-B1IS1UjX.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>k(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>k(()=>import(`./nextflow-Bbiyy34d.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>k(()=>import(`./nextflow-groovy-Dc_ddanL.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>k(()=>import(`./nginx-BgDTOYqs.js`),__vite__mapDeps([74,38,1,20])))},{id:`nim`,name:`Nim`,import:(()=>k(()=>import(`./nim-CUz-jMgf.js`),__vite__mapDeps([75,3,1,4,2,8,9,20,27,41])))},{id:`nix`,name:`Nix`,import:(()=>k(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>k(()=>import(`./nushell-DcLAeLz5.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>k(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>k(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>k(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>k(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>k(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>k(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>k(()=>import(`./perl-C1dZQPV5.js`),__vite__mapDeps([65,3,1,4,2,8,9,17])))},{id:`php`,name:`PHP`,import:(()=>k(()=>import(`./php-Cv1yln_y.js`),__vite__mapDeps([76,3,1,4,2,8,9,10,17])))},{id:`pkl`,name:`Pkl`,import:(()=>k(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>k(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>k(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>k(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>k(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>k(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>k(()=>import(`./powershell-DshXNtvi.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>k(()=>import(`./prisma-BsRQq5mF.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>k(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>k(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>k(()=>import(`./pug-Ce37auPQ.js`),__vite__mapDeps([77,3,1,4,2])))},{id:`puppet`,name:`Puppet`,import:(()=>k(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>k(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>k(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>k(()=>import(`./qml-DWs4ParD.js`),__vite__mapDeps([78,3,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>k(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>k(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>k(()=>import(`./r-B_2zvz1A.js`).then(e=>e.n),__vite__mapDeps([63,1])))},{id:`racket`,name:`Racket`,import:(()=>k(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>k(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>k(()=>import(`./razor-Ctpaw8Xr.js`),__vite__mapDeps([79,2,1,3,4,80])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>k(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>k(()=>import(`./regexp--aR2_iz7.js`).then(e=>e.n),__vite__mapDeps([26,1])))},{id:`rel`,name:`Rel`,import:(()=>k(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>k(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>k(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>k(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>k(()=>import(`./rst-CqRkteH8.js`),__vite__mapDeps([81,3,1,16,2,4,22,82,25,17,26,27,20,29,39,34,8,9,35,36,12,14,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>k(()=>import(`./ruby-D3BGyoLR.js`),__vite__mapDeps([34,3,1,4,2,8,9,17,20,25,26,27,29,35,36,12,14,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>k(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>k(()=>import(`./sas-BaCscvql.js`),__vite__mapDeps([83,17,1])))},{id:`sass`,name:`Sass`,import:(()=>k(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>k(()=>import(`./scala-DKOlJaKm.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>k(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>k(()=>import(`./scss-DngyzxVC.js`).then(e=>e.n),__vite__mapDeps([6,1,4])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>k(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>k(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([84,85])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>k(()=>import(`./shellscript-DnoJEH0-.js`).then(e=>e.n),__vite__mapDeps([29,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>k(()=>import(`./shellsession-DnjHxDMP.js`),__vite__mapDeps([86,29,1])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>k(()=>import(`./smalltalk-B16xEiuN.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>k(()=>import(`./solidity-CKzVLygQ.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>k(()=>import(`./soy-DmAO5KqQ.js`),__vite__mapDeps([87,2,1,3,4])))},{id:`sparql`,name:`SPARQL`,import:(()=>k(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([88,89])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>k(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>k(()=>import(`./sql-CLgiMrxJ.js`).then(e=>e.n),__vite__mapDeps([17,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>k(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>k(()=>import(`./stata-BiJ8hoIJ.js`),__vite__mapDeps([90,17,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>k(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>k(()=>import(`./surrealql-D9bH0Csw.js`),__vite__mapDeps([91,3,1])))},{id:`svelte`,name:`Svelte`,import:(()=>k(()=>import(`./svelte-B3woShZ2.js`),__vite__mapDeps([92,3,1,4,12,13])))},{id:`swift`,name:`Swift`,import:(()=>k(()=>import(`./swift-DonLKvLd.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>k(()=>import(`./system-verilog-DJ5XKQeo.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>k(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>k(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>k(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>k(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>k(()=>import(`./templ-B7gtJFlV.js`),__vite__mapDeps([93,3,1,4,94])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>k(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>k(()=>import(`./tex-Bjo-GMiN.js`),__vite__mapDeps([67,63,1])))},{id:`toml`,name:`TOML`,import:(()=>k(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>k(()=>import(`./ts-tags-CSxB5Eny.js`),__vite__mapDeps([95,3,1,4,2,8,9,12,17,27,20])))},{id:`tsv`,name:`TSV`,import:(()=>k(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>k(()=>import(`./tsx-JMDX3aQ7.js`).then(e=>e.n),__vite__mapDeps([14,1])))},{id:`turtle`,name:`Turtle`,import:(()=>k(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>k(()=>import(`./twig-DCsq_S7z.js`),__vite__mapDeps([96,3,1,4,6,22,34,2,8,9,17,20,25,26,27,29,35,36,12,14,37,38,39,76,10])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>k(()=>import(`./typescript-BAz-bF8J.js`).then(e=>e.n),__vite__mapDeps([12,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>k(()=>import(`./typespec-B88KGewJ.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>k(()=>import(`./typst-DI99ib-x.js`),[]))},{id:`v`,name:`V`,import:(()=>k(()=>import(`./v-DETTlOr0.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>k(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>k(()=>import(`./vb-Djn5o6TS.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>k(()=>import(`./verilog-CiiDBU1e.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>k(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>k(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>k(()=>import(`./vue-BR4XqTj9.js`),__vite__mapDeps([97,3,1,4,2,10,12,16])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>k(()=>import(`./vue-html-DZGW9MGR.js`),__vite__mapDeps([98,3,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>k(()=>import(`./vue-vine-B157dWFT.js`),__vite__mapDeps([99,3,1,4,6,13,70,100])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>k(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>k(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>k(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>k(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>k(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>k(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>k(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>k(()=>import(`./xml-CNfvW5JP.js`).then(e=>e.n),__vite__mapDeps([8,1,9])))},{id:`xsl`,name:`XSL`,import:(()=>k(()=>import(`./xsl-zsHjPACe.js`),__vite__mapDeps([101,8,1,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>k(()=>import(`./yaml-B9zsrP9R.js`).then(e=>e.n),__vite__mapDeps([39,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>k(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>k(()=>import(`./zig-CMLA9XwU.js`),[]))}],Pl=Object.fromEntries(Nl.map(e=>[e.id,e.import])),Fl=Object.fromEntries(Nl.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Il={...Pl,...Fl},Ll=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>k(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>k(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>k(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>k(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>k(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>k(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>k(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>k(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>k(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>k(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>k(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>k(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>k(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>k(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>k(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>k(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>k(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>k(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>k(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>k(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>k(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>k(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>k(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>k(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>k(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>k(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>k(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>k(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>k(()=>import(`./horizon-bright-Br1oVSNq.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>k(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>k(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>k(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>k(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>k(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>k(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>k(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>k(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>k(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>k(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>k(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>k(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>k(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>k(()=>import(`./monokai-CdkpiU2Y.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>k(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>k(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>k(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>k(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>k(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>k(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>k(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>k(()=>import(`./red-CJ3rzSJv.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>k(()=>import(`./rose-pine-BthvhNj6.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>k(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>k(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>k(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>k(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>k(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>k(()=>import(`./solarized-dark-DV17i1UV.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>k(()=>import(`./solarized-light-DSh2HLQt.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>k(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>k(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>k(()=>import(`./vesper-D5bVUKB1.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>k(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>k(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>k(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),Rl=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function zl(){return 2147483648}function Bl(){return typeof performance<`u`?performance.now():Date.now()}var Vl=(e,t)=>e+(t-e%t)%t;async function Hl(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=zl();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Vl(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Bl,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var Ul=Object.defineProperty,Wl=(e,t,n)=>t in e?Ul(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z=(e,t,n)=>Wl(e,typeof t==`symbol`?t:t+``,n),B=null;function Gl(e){throw new Rl(e.UTF8ToString(e.getLastOnigError()))}var Kl=class e{constructor(t){z(this,`utf16Length`),z(this,`utf8Length`),z(this,`utf16Value`),z(this,`utf8Value`),z(this,`utf16OffsetToUtf8`),z(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},ql=class e{constructor(t){if(z(this,`id`,++e.LAST_ID),z(this,`_onigBinding`),z(this,`content`),z(this,`utf16Length`),z(this,`utf8Length`),z(this,`utf16OffsetToUtf8`),z(this,`utf8OffsetToUtf16`),z(this,`ptr`),!B)throw new Rl(`Must invoke loadWasm first.`);this._onigBinding=B,this.content=t;let n=new Kl(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=B.omalloc(1e4),e._sharedPtrInUse=!0,B.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(B)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};z(ql,`LAST_ID`,0),z(ql,`_sharedPtr`,0),z(ql,`_sharedPtrInUse`,!1);var Jl=ql,Yl=class{constructor(e){if(z(this,`_onigBinding`),z(this,`_ptr`),!B)throw new Rl(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Kl(e[r]);t[r]=i.createString(B),n[r]=i.utf8Length}let r=B.omalloc(4*e.length);B.HEAPU32.set(t,r/4);let i=B.omalloc(4*e.length);B.HEAPU32.set(n,i/4);let a=B.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)B.ofree(t[n]);B.ofree(i),B.ofree(r),a===0&&Gl(B),this._onigBinding=B,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Jl(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function Xl(e){return typeof e.instantiator==`function`}function Zl(e){return typeof e.default==`function`}function Ql(e){return e.data!==void 0}function $l(e){return typeof Response<`u`&&e instanceof Response}function eu(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var tu;function nu(e){if(tu)return tu;async function t(){B=await Hl(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Xl(n)?n=await n.instantiator(t):Zl(n)?n=await n.default(t):(Ql(n)&&(n=n.data),$l(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await iu(n)(t):await au(n)(t):eu(n)||n instanceof WebAssembly.Module?n=await ru(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await ru(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return tu=t(),tu}function ru(e){return t=>WebAssembly.instantiate(e,t)}function iu(e){return t=>WebAssembly.instantiateStreaming(e,t)}function au(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function ou(e){return e&&await nu(e),{createScanner(e){return new Yl(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Jl(e)}}}var su=Al({langs:Il,themes:Ll,engine:()=>ou(k(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:cu,codeToHast:lu,codeToTokens:uu,codeToTokensBase:du,codeToTokensWithThemes:fu,getSingletonHighlighter:pu,getLastGrammarState:mu}=Ml(su,{guessEmbeddedLanguages:_c});function hu(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function gu(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var _u=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),V=String.raw;function vu(e,t){if(e==null)throw Error(t??`Value expected`);return e}var yu=V`\[\^?`,bu=`c.? | C(?:-.?)?|${V`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${V`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${V`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${V`o\{[^\}]*\}?`}|${V`\d{1,3}`}`,xu=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Su=new RegExp(V`
|
||
\\ (?:
|
||
${bu}
|
||
| [gk]<[^>]*>?
|
||
| [gk]'[^']*'?
|
||
| .
|
||
)
|
||
| \( (?:
|
||
\? (?:
|
||
[:=!>({]
|
||
| <[=!]
|
||
| <[^>]*>
|
||
| '[^']*'
|
||
| ~\|?
|
||
| #(?:[^)\\]|\\.?)*
|
||
| [^:)]*[:)]
|
||
)?
|
||
| \*[^\)]*\)?
|
||
)?
|
||
| (?:${xu.source})+
|
||
| ${yu}
|
||
| .
|
||
`.replace(/\s+/g,``),`gsu`),Cu=new RegExp(V`
|
||
\\ (?:
|
||
${bu}
|
||
| .
|
||
)
|
||
| \[:(?:\^?\p{Alpha}+|\^):\]
|
||
| ${yu}
|
||
| &&
|
||
| .
|
||
`.replace(/\s+/g,``),`gsu`);function wu(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=ed(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(Su.lastIndex=0;s=Su.exec(e);){let t=Tu(a,e,s[0],Su.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(Su.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?nd(e,u):e).flat(),flags:r}}function Tu(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Eu(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:Au(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Wu(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:ju(n)}}if(a===`K`)return{token:Ru(`keep`,n)};if(a===`N`||a===`R`)return{token:Lu(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:Lu(`any`,n)};if(a===`X`)return{token:Lu(`text_segment`,n)};let e=Ou(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:Yu(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Ju(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Vu(`group`,n)};if(n===`(?>`)return{token:Vu(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Vu(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Vu(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Vu(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:Bu(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
|
||
`,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:Lu(`dot`,n)}:n===`^`||n===`$`?{token:Au(e.singleline?{"^":V`\A`,$:V`\Z`}[n]:n,n)}:n===`|`?{token:ku(n)}:xu.test(n)?{tokens:rd(n)}:{token:Mu(hu(n),n)}}function Eu(e,t,n){let r=[Iu(t[1]===`^`,t)],i=1,a;for(Cu.lastIndex=n;a=Cu.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Iu(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(Mu(93,e));else if(i--,r.push(Nu(e)),!i)break}else{let t=Du(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:Cu.lastIndex||e.length}}function Du(e){if(e[0]===`\\`)return Ou(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!_u.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return Lu(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?Pu(e):e===`&&`?Fu(e):Mu(hu(e),e)}function Ou(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return qu(e);if(`dDhHsSwW`.includes(n))return Zu(e);if(e.startsWith(V`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return Qu(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return Mu(hu(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return Mu(td(e),e);if(Ku.has(n))return Mu(Ku.get(n),e);if(/\d/.test(n))return zu(t,e);if(e===`\\`)throw Error(V`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Mu(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function ku(e){return{type:`Alternator`,raw:e}}function Au(e,t){return{type:`Assertion`,kind:e,raw:t}}function ju(e){return{type:`Backreference`,raw:e}}function Mu(e,t){return{type:`Character`,value:e,raw:t}}function Nu(e){return{type:`CharacterClassClose`,raw:e}}function Pu(e){return{type:`CharacterClassHyphen`,raw:e}}function Fu(e){return{type:`CharacterClassIntersector`,raw:e}}function Iu(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function Lu(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Ru(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:vu(n.flags),raw:t}}function zu(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Bu(e){return{type:`GroupClose`,raw:e}}function Vu(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function Hu(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Uu(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Wu(e){return{type:`Subroutine`,raw:e}}var Gu=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Ku=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function qu(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Mu(hu(t.toUpperCase())-64,e)}function Ju(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=$u(n),o=$u(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Ru(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Vu(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function Yu(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=Gu.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return Hu(l,r??null,i?.split(`,`)??null,e)}function Xu(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return Uu(t,n,r,e)}function Zu(e){let t=e[1].toLowerCase();return Lu({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function Qu(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Lu(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function $u(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function ed(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function td(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function nd(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[ju(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(V`Octal encoded byte above 177 unsupported "${n}"`)}else r=hu(t);a.push(Mu(r,(e===0?`\\`:``)+t))}return a}function rd(e){let t=[],n=new RegExp(xu,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(Xu(e.slice(0,-1)));continue}}}t.push(Xu(e))}return t}function id(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function ad(e){return od.has(e.type)}var od=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function sd(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=wu(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return _d();case`Assertion`:return cd(n);case`Backreference`:return ld(n,a);case`Character`:return xd(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return ud(n,a,t);case`CharacterClassOpen`:return dd(n,a,t);case`CharacterSet`:return fd(n,a);case`Directive`:return Td(n.kind,{flags:n.flags});case`GroupOpen`:return pd(n,a,t);case`NamedCallout`:return kd(n.kind,n.tag,n.arguments);case`Quantifier`:return md(n,a);case`Subroutine`:return hd(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=Md(Ed(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(V`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(V`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function cd({kind:e}){return vd(vu({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===V`\B`||e===V`\Y`})}function ld({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,yd(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return yd(r)}return i(+r)}function ud(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),Cd(o,e);throw Error(`Invalid character class range`)}return xd(hu(`-`))}function dd({negate:e},t,n){let{tokens:r,walk:i}=t,a=[Sd()],o=r[t.nextIndex],s=Ud(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(Sd()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=Ud(r[t.nextIndex],o)}let c=Sd({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function fd({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=Hd(n);if(_u.has(r)&&!o?.has(r))e=`posix`,n=r;else return Pd(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?Ad(n,{negate:t}):wd(e,{negate:t})}function pd(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=Fd(e),l=c.type===`AbsenceFunction`,u=zd(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&gu(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=Wd(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(_d()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(Rd(t)||t.type===`CapturingGroup`)throw Error(e)}else if(Rd(t)||zd(t)&&t.negate)throw Error(e)}}f=Wd(r[t.nextIndex])}return t.nextIndex++,c}function md({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!ad(a))throw Error(`Quantifier requires a repeatable token`);let o=jd(e,t,n,a);return i.body.pop(),o}function hd({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=Nd(i);return r.push(o),o}function gd(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:Id(t?.body)}}function _d(e){return{type:`Alternative`,body:Ld(e?.body)}}function vd(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function yd(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function bd(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!Bd(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:Id(t?.body)}}function xd(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function Sd(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:Ld(e?.body)}}function Cd(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function wd(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function Td(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:vu(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function Ed(e){return{type:`Flags`,...e}}function Dd(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:Id(e?.body)}}function Od(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:Id(e?.body)}}function kd(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function Ad(e,t){let n=!!t?.negate;if(!_u.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function jd(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function Md(e,t){return{type:`Regex`,body:Id(t?.body),flags:e}}function Nd(e){return{type:`Subroutine`,ref:e}}function Pd(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(Hd(e));if(!r){if(n.normalizeUnknownPropertyNames)r=Vd(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(V`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function Fd({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return gd(`repeater`);case`atomic`:return Dd({atomic:!0});case`capturing`:return bd(i,{name:n});case`group`:return Dd({flags:e});case`lookahead`:case`lookbehind`:return Od({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function Id(e){if(e===void 0)e=[_d()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function Ld(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function Rd(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function zd(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function Bd(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Vd(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function Hd(e){return e.replace(/[- _]+/g,``).toLowerCase()}function Ud(e,t){let n=t;return vu(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function Wd(e){return vu(e,`Unclosed group`)}function Gd(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){Kd(c).splice(Math.max(0,qd(s)+l),1),l--,u=!0},removeAllNextSiblings(){return Kd(c).splice(qd(s)+1)},removeAllPrevSiblings(){let e=qd(s)+l;return l-=e,Kd(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,qd(s)+l)]=e:vu(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(Kd(c).splice(Math.max(0,qd(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,qd(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function Kd(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function qd(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var Jd=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Yd(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Xd(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var Zd=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function Qd(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===Zd.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?Zd.CHAR_CLASS:Zd.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function $d(e,t,n,r){Qd(e,t,n,r)}function ef(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===Zd.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function tf(e,t,n){return!!ef(e,t,0,n)}function nf(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var rf=new RegExp(String.raw`(?<noncapturingStart>${Jd})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function af(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(rf.lastIndex=Number.isNaN(c)?0:c+7;f=rf.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),Yd(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=Qd(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},Zd.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var of=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,sf=new RegExp(String.raw`
|
||
\\(?: \d+
|
||
| c[A-Za-z]
|
||
| [gk]<[^>]+>
|
||
| [pPu]\{[^\}]+\}
|
||
| u[A-Fa-f\d]{4}
|
||
| x[A-Fa-f\d]{2}
|
||
)
|
||
| \((?: \? (?: [:=!>]
|
||
| <(?:[=!]|[^>]+>)
|
||
| [A-Za-z\-]+:
|
||
| \(DEFINE\)
|
||
))?
|
||
| (?<qBase>${of})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
||
| \\?.
|
||
`.replace(/\s+/g,``),`gsu`);function cf(e){if(!RegExp(`${of}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(sf.lastIndex=0;o=sf.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=Xd(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}sf.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var lf=String.raw,uf=lf`\(\?R=(?<rDepth>[^\)]+)\)|${lf`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,df=lf`\(\?<(?![=!])(?<captureName>[^>]+)>`,ff=lf`${df}|(?<unnamed>\()(?!\?)`,pf=new RegExp(lf`${df}|${uf}|\(\?|\\?.`,`gsu`),mf=`Cannot use multiple overlapping recursions`;function hf(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(uf,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&tf(e,lf`\(\?\(DEFINE\)`,Zd.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=tf(e,lf`\\[1-9]`,Zd.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(pf.lastIndex=0;f=pf.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(gf(m),l)throw Error(mf);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(pf.lastIndex);if(tf(s,uf,Zd.DEFAULT))throw Error(mf);let c=m-1;e=_f(t,s,c,!1,n,a,d),i=bf(i,t,c,a.length,0,d);break}if(h){gf(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(mf);break}if(!u)throw Error(lf`Recursive \g cannot be used outside the referenced group "${r===`external`?h:lf`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=nf(e,p);if(o&&tf(m,lf`${df}|\((?!\?)`,Zd.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=_f(_,v,b,!0,n,a,d);i=bf(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,pf.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),pf.lastIndex),s.set(p,pf.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),pf.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function gf(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function _f(e,t,n,r,i,a,o){let s=new Set;r&&$d(e+t,df,({groups:{captureName:e}})=>{s.add(e)},Zd.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${vf(`(?:${e}`,`forward`,...c)}(?:)${vf(`${t})`,`backward`,...c)}${t}`}function vf(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=Qd(e,lf`${ff}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),yf(i,n),s?e:`(?<${t}${l}>`}return lf`\k<${c}${l}>`},Zd.DEFAULT)}return c}function yf(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function bf(e,t,n,r,i,a){if(e.size&&r){let o=0;$d(t,ff,()=>o++,Zd.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var H=String.fromCodePoint,U=String.raw,xf={},Sf=globalThis.RegExp;xf.flagGroups=(()=>{try{new Sf(`(?i:)`)}catch{return!1}return!0})(),xf.unicodeSets=(()=>{try{new Sf(`[[]]`,`v`)}catch{return!1}return!0})(),xf.bugFlagVLiteralHyphenIsRange=xf.unicodeSets?(()=>{try{new Sf(U`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,xf.bugNestedClassIgnoresNegation=xf.unicodeSets&&new Sf(`[[^a]]`,`v`).test(`a`);function Cf(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function wf(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Tf(e,t){return Df[e]>=Df[t]}function Ef(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Df={ES2025:2025,ES2024:2024,ES2018:2018},Of={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function kf(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!Of[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=xf.flagGroups?`ES2025`:xf.unicodeSets?`ES2024`:`ES2018`),t}var Af=`[ -\r ]`,jf=new Set([H(304),H(305)]),Mf=U`[\p{L}\p{M}\p{N}\p{Pc}]`;function Nf(e){if(jf.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Lf.get(n),a=Ff.get(n),o=If.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var Pf=new Map(`C Other
|
||
Cc Control cntrl
|
||
Cf Format
|
||
Cn Unassigned
|
||
Co Private_Use
|
||
Cs Surrogate
|
||
L Letter
|
||
LC Cased_Letter
|
||
Ll Lowercase_Letter
|
||
Lm Modifier_Letter
|
||
Lo Other_Letter
|
||
Lt Titlecase_Letter
|
||
Lu Uppercase_Letter
|
||
M Mark Combining_Mark
|
||
Mc Spacing_Mark
|
||
Me Enclosing_Mark
|
||
Mn Nonspacing_Mark
|
||
N Number
|
||
Nd Decimal_Number digit
|
||
Nl Letter_Number
|
||
No Other_Number
|
||
P Punctuation punct
|
||
Pc Connector_Punctuation
|
||
Pd Dash_Punctuation
|
||
Pe Close_Punctuation
|
||
Pf Final_Punctuation
|
||
Pi Initial_Punctuation
|
||
Po Other_Punctuation
|
||
Ps Open_Punctuation
|
||
S Symbol
|
||
Sc Currency_Symbol
|
||
Sk Modifier_Symbol
|
||
Sm Math_Symbol
|
||
So Other_Symbol
|
||
Z Separator
|
||
Zl Line_Separator
|
||
Zp Paragraph_Separator
|
||
Zs Space_Separator
|
||
ASCII
|
||
ASCII_Hex_Digit AHex
|
||
Alphabetic Alpha
|
||
Any
|
||
Assigned
|
||
Bidi_Control Bidi_C
|
||
Bidi_Mirrored Bidi_M
|
||
Case_Ignorable CI
|
||
Cased
|
||
Changes_When_Casefolded CWCF
|
||
Changes_When_Casemapped CWCM
|
||
Changes_When_Lowercased CWL
|
||
Changes_When_NFKC_Casefolded CWKCF
|
||
Changes_When_Titlecased CWT
|
||
Changes_When_Uppercased CWU
|
||
Dash
|
||
Default_Ignorable_Code_Point DI
|
||
Deprecated Dep
|
||
Diacritic Dia
|
||
Emoji
|
||
Emoji_Component EComp
|
||
Emoji_Modifier EMod
|
||
Emoji_Modifier_Base EBase
|
||
Emoji_Presentation EPres
|
||
Extended_Pictographic ExtPict
|
||
Extender Ext
|
||
Grapheme_Base Gr_Base
|
||
Grapheme_Extend Gr_Ext
|
||
Hex_Digit Hex
|
||
IDS_Binary_Operator IDSB
|
||
IDS_Trinary_Operator IDST
|
||
ID_Continue IDC
|
||
ID_Start IDS
|
||
Ideographic Ideo
|
||
Join_Control Join_C
|
||
Logical_Order_Exception LOE
|
||
Lowercase Lower
|
||
Math
|
||
Noncharacter_Code_Point NChar
|
||
Pattern_Syntax Pat_Syn
|
||
Pattern_White_Space Pat_WS
|
||
Quotation_Mark QMark
|
||
Radical
|
||
Regional_Indicator RI
|
||
Sentence_Terminal STerm
|
||
Soft_Dotted SD
|
||
Terminal_Punctuation Term
|
||
Unified_Ideograph UIdeo
|
||
Uppercase Upper
|
||
Variation_Selector VS
|
||
White_Space space
|
||
XID_Continue XIDC
|
||
XID_Start XIDS`.split(/\s/).map(e=>[Hd(e),e])),Ff=new Map([[`s`,H(383)],[H(383),`s`]]),If=new Map([[H(223),H(7838)],[H(107),H(8490)],[H(229),H(8491)],[H(969),H(8486)]]),Lf=new Map([Bf(453),Bf(456),Bf(459),Bf(498),...Vf(8072,8079),...Vf(8088,8095),...Vf(8104,8111),Bf(8124),Bf(8140),Bf(8188)]),Rf=new Map([[`alnum`,U`[\p{Alpha}\p{Nd}]`],[`alpha`,U`\p{Alpha}`],[`ascii`,U`\p{ASCII}`],[`blank`,U`[\p{Zs}\t]`],[`cntrl`,U`\p{Cc}`],[`digit`,U`\p{Nd}`],[`graph`,U`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,U`\p{Lower}`],[`print`,U`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,U`[\p{P}\p{S}]`],[`space`,U`\p{space}`],[`upper`,U`\p{Upper}`],[`word`,U`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,U`\p{AHex}`]]);function zf(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Bf(e){let t=H(e);return[t.toLowerCase(),t]}function Vf(e,t){return zf(e,t).map(e=>Bf(e))}var Hf=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Uf(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};qf(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Tf(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Gd(e,Wf,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return Gd(e,Gf,a),Gd(e,Kf,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var Wf={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=Dd();e.body[0].body.push(Od({negate:!0,body:r}),Pd(`Any`));let i=Dd();i.body[0].body.push(jd(`greedy`,0,1/0,e)),n(W(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];wf(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=ep(t.get(e));if(n){let t=Dd({flags:n});t.body[0].body=e.body,e.body=[W(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(W(Od({body:[_d({body:[vd(`string_end`)]}),_d({body:[xd(10)]})]}),t));else if(c===`line_start`)o(W(lp(U`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&op(e))o(W(Od({negate:!0}),t));else if(d)throw Error(U`Uses "\G" in a way that requires a subclass`);else o(dp(vd(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(W(lp(U`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Mf})(?!${Mf})|(?<!${Mf})(?=${Mf}))`,n=`(?:(?<=${Mf})(?=${Mf})|(?<!${Mf})(?!${Mf}))`;o(W(lp(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!cp(n)&&(n=$f(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!cp(r)&&(r=$f(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(W(Sd({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(dp(wd(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(W(up(lp(Af),l),t));return}if(s&&(c===`word`||u===`word`)){n(dp(wd(`word`,{negate:l}),t));return}if(c===`any`)n(dp(Pd(`Any`),t));else if(c===`digit`)n(dp(Pd(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(U`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=U`\p{RI}{2}|${e}(?:\u200D${e})*`;n(W(lp(U`(?>\r\n|${i?U`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(dp(Pd(`AHex`,{negate:l}),t));else if(c===`newline`)n(W(lp(l?`[^
|
||
]`:`(?>\r
|
||
?|[
|
||
\v\f
\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${H(e.codePointAt(0)-1)}${H(e.codePointAt(2)+1)}-\u{10FFFF}`),n(W(lp(`[${e}]`),t))}else n(W(up(lp(Rf.get(u)),l),t))}else if(c===`property`)Pf.has(Hd(u))||(e.key=`sc`);else if(c===`space`)n(dp(Pd(`space`,{negate:l}),t));else if(c===`word`)n(W(up(lp(Mf),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=Dd({flags:c});e.body[0].body=o(),i(W(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&id(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(U`Uses "\K" in a way that's unsupported`);let o=Od({behind:!0});o.body[0].body=a(),i(W(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(W(Od({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=Dd();t.body[0].body.push(e.body),e.body=W(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=rp(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(U`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!cp(n)&&(n=$f(n,t),e.ref=n)}},Gf={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=dp(Zf(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&wf(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=wf(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Cf(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Zf(0):Xf(o,r.groupOriginByCopy,null),l=c;if(!s){let e=ep(Qf(o,e=>e.type===`Group`&&!!e.flags)),t=e?Cf(r.globalFlags,e):r.globalFlags;Jf(t,r.currentFlags)||(l=Dd({flags:tp(t)}),l.body[0].body.push(c))}n(W(l,t),{traverse:!s})}},Kf={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>Yf(t,e));i.length?i.length>1?n(W(Dd({atomic:!0,body:i.reverse().map(e=>_d({body:[yd(e.number)]}))}),t)):e.ref=i[0].number:n(W(Od({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=bd();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function qf(e){Gd(e,{"*"({node:e,parent:t}){e.parent=t}})}function Jf(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Yf(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=np(n.parent);for(let r of t){if(r===n)break;if(r===e||ip(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Xf(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Xf(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Zf(e){let t=Nd(e);return t.isRecursive=!0,t}function Qf(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function $f(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function ep(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function tp({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function np(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function rp(e){let t=e.find(e=>e.kind===`search_start`||sp(e,{negate:!1})||!ap(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=rp(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function ip(e,t){let n=np(e)??[];for(let e of n)if(e===t||ip(e,t))return!0;return!1}function ap({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function op(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function sp(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&id(e.body[0],{type:`Assertion`,kind:`search_start`})}function cp(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function lp(e,t){let n=sd(e,{...t,unicodePropertyMap:Pf}).body;return n.length>1||n[0].body.length>1?Dd({body:n}):n[0].body[0]}function up(e,t){return e.negate=t,e}function dp(e,t){return e.parent=t,e}function W(e,t){return qf(e),e.parent=t,e}function fp(e,t){let n=kf(t),r=Tf(n.target,`ES2024`),i=Tf(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];Gd(e,pp,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,Ef(mp[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&wf(f._captureTransfers,e.transferTo,[]).push(t)}),f}var pp={"*":{enter({node:e},t){if(Ep(e)){let n=t.getCurrentModI();t.pushModI(e.flags?Cf({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Ep(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){bp(H(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),xp(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Hf.has(e.value)&&t.setHasCasedChar()}},mp={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?U`\B`:U`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=H(e),r=Sp(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&bp(n)){let e=Nf(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);xf.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(Op)&&(o=[xd(45),...o.filter(e=>!Op(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||xf.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=Dd(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=_d({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(xf.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=Sp(n,i),o=Sp(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Cp(xp(e)).forEach(e=>{s.add(Array.isArray(e)?`${Sp(e[0],i)}-${Sp(e[1],i)}`:Sp(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:U`[^\n]`;if(e===`digit`)return t?U`\D`:U`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Hf.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?U`\P`:U`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?U`\W`:U`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=Cf(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${wp(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+Tp(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:U`\g<${t}&R=${r}>`}},hp=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),gp=new Set([`-`,`\\`,`]`,`^`,`[`]),_p=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),vp=new Map([[9,U`\t`],[10,U`\n`],[11,U`\v`],[12,U`\f`],[13,U`\r`],[8232,U`\u2028`],[8233,U`\u2029`],[65279,U`\uFEFF`]]),yp=/^\p{Cased}$/u;function bp(e){return yp.test(e)}function xp(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=H(e);if(!bp(t))continue;let o=Nf(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function Sp(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(vp.has(e))return vp.get(e);if(e<32||e>126&&e<160||e>262143||t&&Dp(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?_p:gp:hp,a=H(e);return(i.has(a)?`\\`:``)+a}function Cp(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function wp(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function Tp({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function Ep({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Dp(e){return e>47&&e<58}function Op({type:e,value:t}){return e===`Character`&&t===45}var kp=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=jp(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(Ap(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=Mp(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function Ap(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function jp(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)wf(n,t,{}).transferTo=e;return n}function Mp(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Np(e,t){let n=Pp(e,t);return n.options?new kp(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Pp(e,t){let n=kf(t),r=Uf(sd(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Pf}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=fp(r,n),a=hf(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=af(cf(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}var Fp=4294967295,Ip=class{constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}regexps;findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:Fp,end:Fp,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function Lp(e,t){return Np(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Rp(e={}){let t=Object.assign({target:`auto`,cache:new Map},e);return t.regexConstructor||=e=>Lp(e,{target:t.target}),{createScanner(e){return new Ip(e,t)},createString(e){return{content:e}}}}var zp=Rp({forgiving:!0}),Bp=Object.fromEntries(Nl.flatMap(e=>(e.aliases??[]).map(t=>[t,e.id]))),Vp=new Set(Object.keys(Il)),Hp=e=>{let t=e.trim().toLowerCase();return Bp[t]||(Vp.has(t),t)},Up=new Map,Wp=new Map,Gp=new Map,Kp=e=>typeof e==`string`?e:e.name??`custom`,qp=(e,t)=>`${e}-${Kp(t[0])}-${Kp(t[1])}`,Jp=(e,t,n)=>{let r=e.slice(0,100),i=e.length>100?e.slice(-100):``;return`${t}:${n[0]}:${n[1]}:${e.length}:${r}:${i}`},Yp=(e,t)=>{let n=qp(e,t);if(Up.has(n))return Up.get(n);let r=su({themes:t,langs:[e],engine:zp});return Up.set(n,r),r};function Xp(e={}){let t=e.themes??[`github-light`,`github-dark`];return{name:`shiki`,type:`code-highlighter`,supportsLanguage(e){let t=Hp(e);return Vp.has(t)},getSupportedLanguages(){return Array.from(Vp)},getThemes(){return t},highlight({code:e,language:t,themes:n},r){let i=Hp(t),a=[Kp(n[0]),Kp(n[1])],o=Jp(e,i,a);return Wp.has(o)?Wp.get(o):(r&&(Gp.has(o)||Gp.set(o,new Set),Gp.get(o).add(r)),Yp(Vp.has(i)?i:`text`,n).then(t=>{let n=t.getLoadedLanguages().includes(i)?i:`text`,r=t.codeToTokens(e,{lang:n,themes:{light:a[0],dark:a[1]}});Wp.set(o,r);let s=Gp.get(o);if(s){for(let e of s)e(r);Gp.delete(o)}}).catch(e=>{console.error(`[Streamdown Code] Failed to highlight code:`,e),Gp.delete(o)}),null)}}}var Zp=Xp();function Qp(e,t){return $p(e,t||{})||{type:`root`,children:[]}}function $p(e,t){let n=em(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function em(e,t){switch(e.nodeType){case 1:return am(e,t);case 3:return rm(e);case 8:return im(e);case 9:return tm(e,t);case 10:return nm();case 11:return tm(e,t);default:return}}function tm(e,t){return{type:`root`,children:om(e,t)}}function nm(){return{type:`doctype`}}function rm(e){return{type:`text`,value:e.nodeValue||``}}function im(e){return{type:`comment`,value:e.nodeValue||``}}function am(e,t){let n=e.namespaceURI,r=n===et.svg?vt:ht,i=n===et.html?e.tagName.toLowerCase():e.tagName,a=n===et.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,om(a,t))}function om(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=$p(n[i],t);e!==void 0&&r.push(e)}return r}var sm=new DOMParser;function cm(e,t){return Qp(t?.fragment?lm(e):sm.parseFromString(e,`text/html`))}function lm(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}var um=(function(e,t,n){let r=st(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),dm=(function(e){if(e==null)return hm;if(typeof e==`string`)return pm(e);if(typeof e==`object`)return fm(e);if(typeof e==`function`)return mm(e);throw Error("Expected function, string, or array as `test`")});function fm(e){let t=[],n=-1;for(;++n<e.length;)t[n]=dm(e[n]);return mm(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function pm(e){return mm(t);function t(t){return t.tagName===e}}function mm(e){return t;function t(t,n,r){return!!(gm(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function hm(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function gm(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var _m=/\n/g,vm=/[\t ]+/g,ym=dm(`br`),bm=dm(Nm),xm=dm(`p`),Sm=dm(`tr`),Cm=dm([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,Mm,Pm]),wm=dm(`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`.split(`.`));function Tm(e,t){let n=t||{},r=`children`in e?e.children:[],i=wm(e),a=jm(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...Om(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...Em(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?ym(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
|
||
`.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function Em(e,t,n){return e.type===`element`?Dm(e,t,n):e.type===`text`?n.whitespace===`normal`?Om(e,n):km(e):[]}function Dm(e,t,n){let r=jm(e,n),i=e.children||[],a=-1,o=[];if(Cm(e))return o;let s,c;for(ym(e)||Sm(e)&&um(t,e,Sm)?c=`
|
||
`:xm(e)?(s=2,c=2):wm(e)&&(s=1,c=1);++a<i.length;)o=o.concat(Em(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?ym(i[a+1]):c}));return bm(e)&&um(t,e,bm)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function Om(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){_m.lastIndex=a;let e=_m.exec(n),i=e&&`index`in e?e.index:n.length;r.push(Am(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a!==0||t.breakBefore,i!==n.length||t.breakAfter)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function km(e){return[String(e.value)]}function Am(e,t,n){let r=[],i=0,a;for(;i<e.length;){vm.lastIndex=i;let n=vm.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function jm(e,t){if(e.type===`element`){let 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 Mm(e){return!!(e.properties||{}).hidden}function Nm(e){return e.tagName===`td`||e.tagName===`th`}function Pm(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var Fm={},Im=[];function Lm(e){let t=e||Fm;return function(e,n){Qe(e,`element`,function(e,r){let i=Array.isArray(e.properties.className)?e.properties.className:Im,a=i.includes(`language-math`),o=i.includes(`math-display`),s=i.includes(`math-inline`),c=o;if(!a&&!o&&!s)return;let l=r[r.length-1],u=e;if(e.tagName===`code`&&a&&l&&l.type===`element`&&l.tagName===`pre`&&(u=l,l=r[r.length-2],c=!0),!l)return;let d=Tm(u,{whitespace:`pre`}),f;try{f=ie.renderToString(d,{...t,displayMode:c,throwOnError:!0})}catch(i){let a=i,o=a.name.toLowerCase();n.message(`Could not render math with KaTeX`,{ancestors:[...r,e],cause:a,place:e.position,ruleId:o,source:`rehype-katex`});try{f=ie.renderToString(d,{...t,displayMode:c,strict:`ignore`,throwOnError:!1})}catch{f=[{type:`element`,tagName:`span`,properties:{className:[`katex-error`],style:`color:`+(t.errorColor||`#cc0000`),title:String(i)},children:[{type:`text`,value:d}]}]}}typeof f==`string`&&(f=cm(f,{fragment:!0}).children);let p=l.children.indexOf(u);return l.children.splice(p,1,...f),Xe})}}function Rm(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function zm(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
|
||
`,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(rt(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
|
||
`,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
|
||
`),i&&(c+=a.move(i+`
|
||
`)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var Bm={tokenize:Hm,concrete:!0,name:`mathFlow`},Vm={tokenize:Um,partial:!0};function Hm(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),pt(e,l,`whitespace`)(t))}function l(t){return t===null||it(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||it(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(Vm,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?pt(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):it(t)?e.attempt(Vm,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||it(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return pt(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),pt(e,c,`whitespace`)(t))}function c(r){return r===null||it(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function Um(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Wm(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:Gm,previous:Km,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):it(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||it(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function Gm(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Km(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function qm(e){return{flow:{36:Bm},text:{36:Wm(e)}}}var Jm={};function Ym(e){let t=this,n=e||Jm,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(qm(n)),a.push(Rm()),o.push(zm(n))}function Xm(e={}){return{name:`katex`,type:`math`,remarkPlugin:[Ym,{singleDollarTextMath:e.singleDollarTextMath??!1}],rehypePlugin:[Lm,{errorColor:e.errorColor??`var(--color-muted-foreground)`}],getStyles(){return`katex/dist/katex.min.css`}}}var Zm=Xm(),Qm=`comm`,$m=`rule`,eh=`decl`,th=`@import`,nh=`@namespace`,rh=`@keyframes`,ih=`@layer`,ah=Math.abs,oh=String.fromCharCode;function sh(e){return e.trim()}function ch(e,t,n){return e.replace(t,n)}function lh(e,t){return e.charCodeAt(t)|0}function uh(e,t,n){return e.slice(t,n)}function dh(e){return e.length}function fh(e){return e.length}function ph(e,t){return t.push(e),e}var mh=1,hh=1,gh=0,_h=0,G=0,vh=``;function yh(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:mh,column:hh,length:o,return:``,siblings:s}}function bh(){return G}function xh(){return G=_h>0?lh(vh,--_h):0,hh--,G===10&&(hh=1,mh--),G}function Sh(){return G=_h<gh?lh(vh,_h++):0,hh++,G===10&&(hh=1,mh++),G}function Ch(){return lh(vh,_h)}function wh(){return _h}function Th(e,t){return uh(vh,e,t)}function Eh(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Dh(e){return mh=hh=1,gh=dh(vh=e),_h=0,[]}function Oh(e){return vh=``,e}function kh(e){return sh(Th(_h-1,Mh(e===91?e+2:e===40?e+1:e)))}function Ah(e){for(;(G=Ch())&&G<33;)Sh();return Eh(e)>2||Eh(G)>3?``:` `}function jh(e,t){for(;--t&&Sh()&&!(G<48||G>102||G>57&&G<65||G>70&&G<97););return Th(e,wh()+(t<6&&Ch()==32&&Sh()==32))}function Mh(e){for(;Sh();)switch(G){case e:return _h;case 34:case 39:e!==34&&e!==39&&Mh(G);break;case 40:e===41&&Mh(e);break;case 92:Sh();break}return _h}function Nh(e,t){for(;Sh()&&e+G!==57&&(e+G!==84||Ch()!==47););return`/*`+Th(t,_h-1)+`*`+oh(e===47?e:Sh())}function Ph(e){for(;!Eh(Ch());)Sh();return Th(e,_h)}function Fh(e){return Oh(Ih(``,null,null,null,[``],e=Dh(e),0,[0],e))}function Ih(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=Sh()){case 40:m!=108&&lh(w,d-1)==58?(v++,w+=`(`):w+=kh(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=kh(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=oh(y);break}w+=Ah(m);break;case 92:w+=jh(wh()-1,7);continue;case 47:switch(Ch()){case 42:case 47:ph(Rh(Nh(Sh(),wh()),t,n,c),c),(Eh(m||1)==5||Eh(Ch()||1)==5)&&dh(w)&&uh(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=dh(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=oh(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=ch(w,/\f/g,``)),p>0&&(dh(w)-d||h===0)&&ph(p>32?zh(w+`;`,r,n,d-1,c):zh(ch(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(ph(C=Lh(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123){if(u===0)Ih(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(lh(w,3)===110)break;case 108:if(lh(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?Ih(e,C,C,r&&ph(Lh(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):Ih(w,C,C,C,[``],S,0,s,S)}}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+dh(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&xh()==125)continue}switch(w+=oh(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(dh(w)-1)*_,_=1;break;case 64:Ch()===45&&(w+=kh(Sh())),f=Ch(),u=d=dh(b=w+=Ph(wh())),y++;break;case 45:m===45&&dh(w)==2&&(h=0)}}return a}function Lh(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=fh(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=uh(e,f+1,f=ah(g=o[h])),b=e;v<m;++v)(b=sh(g>0?p[v]+` `+y:ch(y,/&\f/g,p[v])))&&(c[_++]=b);return yh(e,t,n,i===0?$m:s,c,l,u,d)}function Rh(e,t,n,r){return yh(e,t,n,Qm,oh(bh()),uh(e,2,-2),0,r)}function zh(e,t,n,r,i){return yh(e,t,n,eh,uh(e,0,r),uh(e,r+1,-1),r,i)}function Bh(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function Vh(e,t,n,r){switch(e.type){case ih:if(e.children.length)break;case th:case nh:case eh:return e.return=e.return||e.value;case Qm:return``;case rh:return e.return=e.value+`{`+Bh(e.children,r)+`}`;case $m:if(!dh(e.value=e.props.join(`,`)))return``}return dh(n=Bh(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Hh(e){var t=fh(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}var Uh=`c4`,Wh={id:Uh,detector:A(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./c4Diagram-5PPSVZJV-OczhytfR.js`);return{diagram:e}},__vite__mapDeps([102,103,104,1,105,106,107,108,109]));return{id:Uh,diagram:e}},`loader`)},Gh=`flowchart`,Kh={id:Gh,detector:A((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./flowDiagram-UKHOOZJN-BUBkadfr.js`);return{diagram:e}},__vite__mapDeps([110,104,1,103,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return{id:Gh,diagram:e}},`loader`)},qh=`flowchart-v2`,Jh={id:qh,detector:A((e,t)=>t?.flowchart?.defaultRenderer!==`dagre-d3`&&(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./flowDiagram-UKHOOZJN-BUBkadfr.js`);return{diagram:e}},__vite__mapDeps([110,104,1,103,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return{id:qh,diagram:e}},`loader`)},Yh=`swimlane`,Xh={id:Yh,detector:A(e=>/^\s*swimlane-beta\b/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./swimlanesDiagram-ULZ7WXOC-CrVvBgdm.js`);return{diagram:e}},__vite__mapDeps([129,103,104,1,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return{id:Yh,diagram:e}},`loader`)},Zh=`er`,Qh={id:Zh,detector:A(e=>/^\s*erDiagram/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./erDiagram-JOGREHBK-DSe3_-3x.js`);return{diagram:e}},__vite__mapDeps([130,103,104,1,105,106,127,108,107,111,112,113,114,115,116,117,118,119,120,121,122,123,124]));return{id:Zh,diagram:e}},`loader`)},$h=`gitGraph`,eg={id:$h,detector:A(e=>/^\s*gitGraph/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-DS77QQ5N-CkEDBEZA.js`);return{diagram:e}},__vite__mapDeps([131,103,104,1,105,106,108,107,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150]));return{id:$h,diagram:e}},`loader`)},tg=`gantt`,ng={id:tg,detector:A(e=>/^\s*gantt/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./ganttDiagram-PKOTCBZU-BRE655Yg.js`);return{diagram:e}},__vite__mapDeps([151,1,103,104,105,106,152,153,154,107,108]));return{id:tg,diagram:e}},`loader`)},rg=`info`,ig={id:rg,detector:A(e=>/^\s*info/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./infoDiagram-6WML65LV-DCrOXTRX.js`);return{diagram:e}},__vite__mapDeps([155,103,104,1,105,106,156,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:rg,diagram:e}},`loader`)},ag=`pie`,og={id:ag,detector:A(e=>/^\s*pie/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./pieDiagram-7S7Q4E2Y-DymmotfN.js`);return{diagram:e}},__vite__mapDeps([157,103,104,1,105,106,158,154,122,107,159,123,108,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:ag,diagram:e}},`loader`)},sg=`quadrantChart`,cg={id:sg,detector:A(e=>/^\s*quadrantChart/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./quadrantDiagram-CIZ2JOQS-Bdmf940A.js`);return{diagram:e}},__vite__mapDeps([160,103,104,1,105,106,152,153,154]));return{id:sg,diagram:e}},`loader`)},lg=`xychart`,ug={id:lg,detector:A(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./xychartDiagram-ELKLHX3M-BXEvabM_.js`);return{diagram:e}},__vite__mapDeps([161,103,104,1,105,106,152,153,154,158,108,107,121,122,123,156,111,112]));return{id:lg,diagram:e}},`loader`)},dg=`requirement`,fg={id:dg,detector:A(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./requirementDiagram-LRYGKXZP-DOQHap5a.js`);return{diagram:e}},__vite__mapDeps([162,103,104,1,105,106,108,107,111,112,113,114,115,116,117,118,119,120,121,122,123,124]));return{id:dg,diagram:e}},`loader`)},pg=`sequence`,mg={id:pg,detector:A(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./sequenceDiagram-SI44F4Z6-DZz8CoAK.js`);return{diagram:e}},__vite__mapDeps([163,103,104,1,105,106,107,108,109,150,125]));return{id:pg,diagram:e}},`loader`)},hg=`class`,gg={id:hg,detector:A((e,t)=>t?.class?.defaultRenderer!==`dagre-wrapper`&&/^\s*classDiagram/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./classDiagram-JCYQIIEL-BGtYH_yr.js`);return{diagram:e}},__vite__mapDeps([164,103,104,1,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,165,128]));return{id:hg,diagram:e}},`loader`)},_g=`classDiagram`,vg={id:_g,detector:A((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./classDiagram-v2-OCEON4UE-BGtYH_yr.js`);return{diagram:e}},__vite__mapDeps([166,103,104,1,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,165,128]));return{id:_g,diagram:e}},`loader`)},yg=`state`,bg={id:yg,detector:A((e,t)=>t?.state?.defaultRenderer!==`dagre-wrapper`&&/^\s*stateDiagram/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./stateDiagram-OKZ733FA-Diw1faox.js`);return{diagram:e}},__vite__mapDeps([167,103,104,1,105,106,108,107,121,122,123,111,112,113,114,168,169,170,109,115,116,117,118,119,120,124,171]));return{id:yg,diagram:e}},`loader`)},xg=`stateDiagram`,Sg={id:xg,detector:A((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-UEYNNEHI-CL8rTg3I.js`);return{diagram:e}},__vite__mapDeps([172,103,104,1,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,171]));return{id:xg,diagram:e}},`loader`)},Cg=`journey`,wg={id:Cg,detector:A(e=>/^\s*journey/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./journeyDiagram-NVQOT4AX-DjG_Ivem.js`);return{diagram:e}},__vite__mapDeps([173,103,104,1,105,106,159,122,107,128,109]));return{id:Cg,diagram:e}},`loader`)},Tg={draw:A((e,t,n)=>{j.debug(`rendering svg for syntax error
|
||
`);let r=Ue(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),Ce(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},Eg=Tg,Dg={db:{},renderer:Tg,parser:{parse:A(()=>{},`parse`)}},Og=`flowchart-elk`,kg={id:Og,detector:A((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./flowDiagram-UKHOOZJN-BUBkadfr.js`);return{diagram:e}},__vite__mapDeps([110,104,1,103,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return{id:Og,diagram:e}},`loader`)},Ag=`timeline`,jg={id:Ag,detector:A(e=>/^\s*timeline/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./timeline-definition-Z64GVDOM-CeZF9jb3.js`);return{diagram:e}},__vite__mapDeps([174,103,104,1,105,106,159,122,107,108,156]));return{id:Ag,diagram:e}},`loader`)},Mg=`mindmap`,Ng={id:Mg,detector:A(e=>/^\s*mindmap/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./mindmap-definition-FAOFIHXS-B-zxlH-3.js`);return{diagram:e}},__vite__mapDeps([175,103,104,1,105,106,108,107,111,112,113,114,115,116,117,118,119,120,121,122,123,124]));return{id:Mg,diagram:e}},`loader`)},Pg=`kanban`,Fg={id:Pg,detector:A(e=>/^\s*kanban/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./kanban-definition-27J2QSJJ-DcHXIYS7.js`);return{diagram:e}},__vite__mapDeps([176,103,104,1,105,106,108,107,156,111,112,128,114,117,118,119,125]));return{id:Pg,diagram:e}},`loader`)},Ig=`sankey`,Lg={id:Ig,detector:A(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./sankeyDiagram-W5VNT64P-Bw_JjJMs.js`);return{diagram:e}},__vite__mapDeps([177,103,104,1,105,106,158,154]));return{id:Ig,diagram:e}},`loader`)},Rg=`packet`,zg={id:Rg,detector:A(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./diagram-LBJQPF4R-DX9fn8uM.js`);return{diagram:e}},__vite__mapDeps([178,103,104,1,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:Rg,diagram:e}},`loader`)},Bg=`radar`,Vg={id:Bg,detector:A(e=>/^\s*radar-beta/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./diagram-UB23O5K3-DN2WW8Lf.js`);return{diagram:e}},__vite__mapDeps([179,103,104,1,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:Bg,diagram:e}},`loader`)},Hg=`block`,Ug={id:Hg,detector:A(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./blockDiagram-VBNYF7ZC-DI8mHgDh.js`);return{diagram:e}},__vite__mapDeps([180,103,104,1,105,106,127,108,107,121,122,123,111,112,128,113,114,168]));return{id:Hg,diagram:e}},`loader`)},Wg=`treeView`,Gg={id:Wg,detector:A(e=>/^\s*treeView-beta/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./diagram-7IWD3JNH-CntAMELi.js`);return{diagram:e}},__vite__mapDeps([181,103,104,1,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,111,150]));return{id:Wg,diagram:e}},`loader`)},Kg=`architecture`,qg={id:Kg,detector:A(e=>/^\s*architecture/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./architectureDiagram-T3A2C74G-BRtUBpl-.js`);return{diagram:e}},__vite__mapDeps([182,1,103,104,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,111,112,183]));return{id:Kg,diagram:e}},`loader`)},Jg=`eventmodeling`,Yg={id:Jg,detector:A(e=>/^\s*eventmodeling/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./diagram-B4RE2ZJO-CzK0s5lu.js`);return{diagram:e}},__vite__mapDeps([184,134,103,104,1,105,106,108,107,132,133,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:Jg,diagram:e}},`loader`)},Xg=`ishikawa`,Zg={id:Xg,detector:A(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-WSZJBQD7-Eprw_Axw.js`);return{diagram:e}},__vite__mapDeps([185,103,104,1,105,106,108,107,156,119]));return{id:Xg,diagram:e}},`loader`)},Qg=`venn`,$g={id:Qg,detector:A(e=>/^\s*venn-beta/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./vennDiagram-T6HMQDX7-Bea6zExh.js`);return{diagram:e}},__vite__mapDeps([186,103,104,1,105,106,108,107,156,119]));return{id:Qg,diagram:e}},`loader`)},e_=`treemap`,t_={id:e_,detector:A(e=>/^\s*treemap/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./diagram-Q27KOJAE-__XgFhkl.js`);return{diagram:e}},__vite__mapDeps([187,103,104,1,105,106,158,154,153,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,116,117]));return{id:e_,diagram:e}},`loader`)},n_=`wardley`,r_={id:n_,detector:A(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./wardleyDiagram-T6FBY63Y-fLVlb6T8.js`);return{diagram:e}},__vite__mapDeps([188,103,104,1,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:n_,diagram:e}},`loader`)},i_=`cynefin`,a_={id:i_,detector:A(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./cynefinDiagram-MW4NZA55-BkWmLTXz.js`);return{diagram:e}},__vite__mapDeps([189,103,104,1,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:i_,diagram:e}},`loader`)},o_=`railroad`,s_={id:o_,detector:A(e=>/^\s*railroad-beta/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./railroadDiagram-AXF67PYL-C2_yAAm1.js`);return{diagram:e}},__vite__mapDeps([190,143,134,103,104,1,105,106,156,191,132,133,135,136,137,138,139,140,141,142,144,145,146,147,148,149]));return{id:o_,diagram:e}},`loader`)},c_=`railroadEbnf`,l_={id:c_,detector:A(e=>/^\s*railroad-ebnf-beta/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./ebnfDiagram-BXEA7PRR-BUzfFfXM.js`);return{diagram:e}},__vite__mapDeps([192,145,134,103,104,1,105,106,156,191,132,133,135,136,137,138,139,140,141,142,143,144,146,147,148,149]));return{id:c_,diagram:e}},`loader`)},u_=`railroadAbnf`,d_={id:u_,detector:A(e=>/^\s*railroad-abnf-beta/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./abnfDiagram-N423BO3Z-BXLvdit9.js`);return{diagram:e}},__vite__mapDeps([193,144,134,103,104,1,105,106,156,191,132,133,135,136,137,138,139,140,141,142,143,145,146,147,148,149]));return{id:u_,diagram:e}},`loader`)},f_=`railroadPeg`,p_={id:f_,detector:A(e=>/^\s*railroad-peg-beta/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./pegDiagram-VL7TDLO6-CCulIlRS.js`);return{diagram:e}},__vite__mapDeps([194,146,134,103,104,1,105,106,156,191,132,133,135,136,137,138,139,140,141,142,143,144,145,147,148,149]));return{id:f_,diagram:e}},`loader`)},m_=!1,h_=A(()=>{m_||(m_=!0,fe(`error`,Dg,e=>e.toLowerCase().trim()===`error`),fe(`---`,{db:{clear:A(()=>{},`clear`)},styles:{},renderer:{draw:A(()=>{},`draw`)},parser:{parse:A(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:A(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),pe(kg,Ng,qg),pe(Wh,Fg,vg,gg,Qh,ng,ig,og,fg,mg,Xh,Jh,Kh,jg,eg,Sg,bg,wg,cg,Lg,zg,ug,Ug,Yg,Gg,Vg,Zg,t_,s_,l_,d_,p_,$g,r_,a_))},`addDiagrams`),g_=A(async()=>{j.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(Ee).map(async([e,{detector:t,loader:n}])=>{if(n)try{he(e)}catch{try{let{diagram:e,id:r}=await n();fe(r,e,t)}catch(t){throw j.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete Ee[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){j.error(`Failed to load ${e.length} external diagrams`);for(let t of e)j.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),__=`graphics-document document`;function v_(e,t){e.attr(`role`,__),t!==``&&e.attr(`aria-roledescription`,t)}A(v_,`setA11yDiagramInfo`);function y_(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}A(y_,`addSVGa11yTitleDescription`);var b_=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{A(this,`Diagram`)}static async fromText(t,n={}){let r=Se(),i=Oe(t,r);t=ze(t)+`
|
||
`;try{he(i)}catch{let e=ce(i);if(!e)throw new je(`Diagram ${i} not found.`);let{id:t,diagram:n}=await e();fe(t,n)}let{db:a,parser:o,renderer:s,init:c}=he(i);return o.parser&&(o.parser.yy=a),a.clear?.(),c?.(r),n.title&&a.setDiagramTitle?.(n.title),await o.parse(t),new e(i,t,a,o,s)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},x_=[],S_=A(()=>{x_.forEach(e=>{e()}),x_=[]},`attachFunctions`),C_=A(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function w_(e){let t=e.match(xe);if(!t)return{text:e,metadata:{}};let n=t[1],r=n?t[2].split(`
|
||
`).map(e=>e.startsWith(n)?e.slice(n.length):e).join(`
|
||
`):t[2],i=qe(r,{schema:Je})??{};i=typeof i==`object`&&!Array.isArray(i)?i:{};let a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:e.slice(t[0].length),metadata:a}}A(w_,`extractFrontMatter`);var T_=A(e=>e.replace(/\r\n?/g,`
|
||
`).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),E_=A(e=>{let{text:t,metadata:n}=w_(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),D_=A(e=>{let t=Ie.detectInit(e)??{},n=Ie.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:Le(e),directive:t}},`processDirectives`);function O_(e){let t=E_(T_(e)),n=D_(t.text),r=Re(t.config,n.directive);return e=C_(n.text),{code:e,title:t.title,config:r}}A(O_,`preprocessDiagram`);function k_(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}A(k_,`toBase64`);var A_=5e4,j_=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,M_=`sandbox`,N_=`loose`,P_=`http://www.w3.org/2000/svg`,F_=`http://www.w3.org/1999/xlink`,I_=`http://www.w3.org/1999/xhtml`,L_=`100%`,R_=`100%`,z_=`border:0;margin:0;`,B_=`margin:0`,V_=`allow-top-navigation-by-user-activation allow-popups`,H_=`The "iframe" tag is not supported by your browser.`,U_=[`foreignobject`],W_=[`dominant-baseline`];function G_(e){let t=O_(e);return ue(),De(t.config??{}),t}A(G_,`processAndSetConfigs`);async function K_(e,t){h_();try{let{code:t,config:n}=G_(e);return{diagramType:(await iv(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}A(K_,`parse`);var q_=A((e,t,n=[])=>`.${e} ${t} ${de(`{ ${n.join(` !important; `)} !important; }`)}`,`cssImportantStyles`),J_=A((e,t=new Map)=>{let n=new CSSStyleSheet;if(e.fontFamily!==void 0&&n.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,n.cssRules.length),e.altFontFamily!==void 0&&n.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,n.cssRules.length),t instanceof Map){let r=ge(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{kt(e.styles)||r.forEach(t=>{n.insertRule(q_(e.id,t,e.styles),n.cssRules.length)}),kt(e.textStyles)||n.insertRule(q_(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))),n.cssRules.length)})}let r=``;if(e.themeCSS!==void 0){if(typeof n.replaceSync==`function`){let t=new CSSStyleSheet;t.replaceSync(e.themeCSS),r=Te(t)+`
|
||
`}else r+=`${e.themeCSS}
|
||
`}return r+Te(n)},`createCssStyles`),Y_=A((e,t)=>Bh(Fh(`${e}{${t}}`),Hh([A(function(t,n,r,i){if(t.type===`rule`&&Array.isArray(t.props)){if(t.parent&&t.parent.type===`@keyframes`)return;t.props=t.props.map(n=>n===e&&Array.isArray(t.children)&&t.children.every(e=>e.type===`decl`&&new Set([`font-family`,`font-size`,`fill`]).has(e.props))||(n.startsWith(`${e} `)||n.startsWith(`${e}>`))&&!n.startsWith(`${e} ||`)?n:`${e} ${n}`)}else t.type.startsWith(`@`)&&([`@media`,`@supports`,`@layer`,`@scope`,`@container`,`@starting-style`,`@keyframes`].includes(t.type)||(j.warn(`Removing unsupported at-rule ${t.type} from CSS`),t.type=Qm))},`addNamespace`),Vh])),`compileCSS`),X_=A((e,t,n,r)=>{let i=J_(e,n);return Y_(r,ye(t,i,{...e.themeVariables,theme:e.theme,look:e.look},r))},`createUserStyles`),Z_=A((e=``,t,n)=>{let r=e;return!n&&!t&&(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,`marker-end="url(#`)),r=Pe(r),r=r.replace(/<br>/g,`<br/>`),r},`cleanUpSvgCode`),Q_=A((e=``,t)=>`<iframe style="width:${L_};height:${t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+`px`:R_};${z_}" src="data:text/html;charset=UTF-8;base64,${k_(`<body style="${B_}">${e}</body>`)}" sandbox="${V_}">
|
||
${H_}
|
||
</iframe>`,`putIntoIFrame`),$_=A((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,P_);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function ev(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}A(ev,`sandboxedIframe`);var tv=A((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),nv=A(async function(e,t,n){h_();let r=G_(t);t=r.code;let i=Se();j.debug(i),t.length>(i?.maxTextSize??A_)&&(t=j_);let a=`#${e}`,o=`i`+e,s=`#`+o,c=`d`+e,l=`#`+c,u=A(()=>{let e=oe(f?s:l).node();e&&`remove`in e&&e.remove()},`removeTempElements`),d=oe(document.body),f=i.securityLevel===M_,p=i.securityLevel===N_,m=i.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=``),f){let e=ev(oe(n),o);d=oe(e.nodes()[0].contentDocument.body),d.node().style.margin=`0`}else d=oe(n);$_(d,e,c,`font-family: ${m}`,F_)}else{if(tv(document,e,c,o),f){let e=ev(oe(document.body),o);d=oe(e.nodes()[0].contentDocument.body),d.node().style.margin=`0`}else d=oe(`body`);$_(d,e,c)}let h,g;try{h=await b_.fromText(t,{title:r.title})}catch(e){if(i.suppressErrorRendering)throw u(),e;h=await b_.fromText(`error`),g=e}let _=d.select(l).node(),v=h.type,y=_.firstChild,b=y.firstChild,x=h.renderer.getClasses?.(t,h),S=X_(i,v,x,a),C=document.createElement(`style`);C.innerHTML=S,y.insertBefore(C,b);try{await h.renderer.draw(t,e,`11.16.1`,h)}catch(n){throw i.suppressErrorRendering?u():Eg.draw(t,e,`11.16.1`),n}let w=d.select(`${l} svg`),T=h.db.getAccTitle?.(),ee=h.db.getAccDescription?.();av(v,w,T,ee),d.select(`[id="${e}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,I_);let E=d.select(l).node().innerHTML;if(j.debug(`config.arrowMarkerAbsolute`,i.arrowMarkerAbsolute),E=Z_(E,f,we(i.arrowMarkerAbsolute)),f){let e=d.select(l+` svg`).node();E=Q_(E,e)}else p||(E=se.sanitize(E,{ADD_TAGS:U_,ADD_ATTR:W_,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(S_(),g)throw g;return u(),{diagramType:v,svg:E,bindFunctions:h.db.bindFunctions}},`render`);function rv(e={}){let t=Ae({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||={},t.themeVariables.fontFamily=t.fontFamily),_e(t),t?.theme&&t.theme in be?t.themeVariables=be[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=be.default.getThemeVariables(t.themeVariables));let n=typeof t==`object`?ke(t):le();ae(n.logLevel),h_()}A(rv,`initialize`);var iv=A((e,t={})=>{let{code:n}=O_(e);return b_.fromText(n,t)},`getDiagramFromText`);function av(e,t,n,r){v_(t,e),y_(t,n,r,t.attr(`id`))}A(av,`addA11yInfo`);var ov=Object.freeze({render:nv,parse:K_,getDiagramFromText:iv,initialize:rv,getConfig:Se,setConfig:ve,getSiteConfig:le,updateSiteConfig:me,reset:A(()=>{ue()},`reset`),globalReset:A(()=>{ue(Me)},`globalReset`),defaultConfig:Me});ae(Se().logLevel),ue(Se());var sv=A((e,t,n)=>{j.warn(e),Fe(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),cv=A(async function(e={querySelector:`.mermaid`}){try{await lv(e)}catch(t){if(Fe(t)&&j.error(t.str),bv.parseError&&bv.parseError(t),!e.suppressErrors)throw j.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),lv=A(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:`.mermaid`}){let r=ov.getConfig();j.debug(`${e?``:`No `}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);j.debug(`Found ${i.length} diagrams`),r?.startOnLoad!==void 0&&(j.debug(`Start On Load: `+r?.startOnLoad),ov.updateSiteConfig({startOnLoad:r?.startOnLoad}));let a=new Ie.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed),o,s=[];for(let t of Array.from(i)){if(j.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let n=`mermaid-${a.next()}`;o=t.innerHTML,o=Ge(Ie.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,`<br/>`);let r=Ie.detectInit(o);r&&j.debug(`Detected early reinit: `,r);try{let{svg:r,bindFunctions:i}=await yv(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){sv(e,s,bv.parseError)}}if(s.length>0)throw s[0]},`runThrowsErrors`),uv=A(function(e){ov.initialize(e)},`initialize`),dv=A(async function(e,t,n){j.warn(`mermaid.init is deprecated. Please use run instead.`),e&&uv(e);let r={postRenderCallback:n,querySelector:`.mermaid`};typeof t==`string`?r.querySelector=t:t&&(r.nodes=t instanceof HTMLElement?[t]:t),await cv(r)},`init`),fv=A(async(e,{lazyLoad:t=!0}={})=>{h_(),pe(...e),t===!1&&await g_()},`registerExternalDiagrams`),pv=A(function(){if(bv.startOnLoad){let{startOnLoad:e}=ov.getConfig();e&&bv.run().catch(e=>j.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,pv,!1);var mv=A(function(e){bv.parseError=e},`setParseErrorHandler`),hv=[],gv=!1,_v=A(async()=>{if(!gv){for(gv=!0;hv.length>0;){let e=hv.shift();if(e)try{await e()}catch(e){j.error(`Error executing queue`,e)}}gv=!1}},`executeQueue`),vv=A(async(e,t)=>new Promise((n,r)=>{let i=A(()=>new Promise((i,a)=>{ov.parse(e,t).then(e=>{i(e),n(e)},e=>{j.error(`Error parsing`,e),bv.parseError?.(e),a(e),r(e)})}),`performCall`);hv.push(i),_v().catch(r)}),`parse`),yv=A((e,t,n)=>new Promise((r,i)=>{let a=A(()=>new Promise((a,o)=>{ov.render(e,t,n).then(e=>{a(e),r(e)},e=>{j.error(`Error parsing`,e),bv.parseError?.(e),o(e),i(e)})}),`performCall`);hv.push(a),_v().catch(i)}),`render`),bv={startOnLoad:!0,mermaidAPI:ov,parse:vv,render:yv,init:dv,run:cv,registerExternalDiagrams:fv,registerLayoutLoaders:Ke,initialize:uv,parseError:void 0,contentLoaded:pv,setParseErrorHandler:mv,detectType:Oe,registerIconPacks:We,getRegisteredDiagramsMetadata:A(()=>Object.keys(Ee).map(e=>({id:e})),`getRegisteredDiagramsMetadata`)},xv=bv,Sv={startOnLoad:!1,theme:`default`,securityLevel:`strict`,fontFamily:`monospace`,suppressErrorRendering:!0};function Cv(e={}){let t=!1,n={...Sv,...e.config},r={initialize(r){n={...Sv,...e.config,...r},xv.initialize(n),t=!0},async render(e,r){return t||=(xv.initialize(n),!0),await xv.render(e,r)}};return{name:`mermaid`,type:`diagram`,language:`mermaid`,getMermaid(e){return e&&r.initialize(e),r}}}var wv=Cv(),Tv=e(s(),1),Ev=({className:e,from:t,...n})=>(0,P.jsx)(`div`,{className:l(`group flex w-full max-w-[95%] flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant`,e),...n}),Dv=({children:e,className:t,...n})=>(0,P.jsx)(`div`,{className:l(`is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-foreground`,t),...n,children:e});(0,M.createContext)(null);var Ov={cjk:oa,code:Zp,math:Zm,mermaid:wv};function kv({url:e,isOpen:t,onClose:n,onConfirm:r}){let[i,a]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{t||a(!1)},[t]),!t||typeof document>`u`?null:(0,Tv.createPortal)((0,P.jsx)(`div`,{className:`fixed inset-0 z-[200] flex items-center justify-center bg-black/55 px-4 backdrop-blur-[2px]`,role:`presentation`,onMouseDown:e=>{e.target===e.currentTarget&&n()},children:(0,P.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`wmc-external-link-title`,className:`w-full max-w-xl rounded-3xl border border-border bg-card p-6 text-card-foreground shadow-2xl sm:p-7`,onMouseDown:e=>e.stopPropagation(),children:[(0,P.jsxs)(`div`,{className:`mb-5 flex items-start justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,P.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary`,children:(0,P.jsx)(qt,{className:`size-5`})}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`h2`,{id:`wmc-external-link-title`,className:`text-xl font-bold tracking-tight`,children:`¿Abrir enlace externo?`}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Estás a punto de visitar un sitio web externo.`})]})]}),(0,P.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Cerrar`,className:`grid size-9 shrink-0 place-items-center rounded-lg text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground`,children:(0,P.jsx)(_n,{className:`size-5`})})]}),(0,P.jsx)(`div`,{className:`mb-6 break-all rounded-2xl border border-border bg-secondary/60 px-4 py-3.5 font-mono text-sm leading-relaxed text-foreground`,children:e}),(0,P.jsxs)(`div`,{className:`flex flex-col-reverse gap-3 sm:flex-row sm:justify-end`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e),a(!0),window.setTimeout(()=>a(!1),1600)}catch{}},className:`inline-flex h-11 items-center justify-center gap-2 rounded-xl border border-border bg-card px-5 text-sm font-semibold transition-colors hover:bg-secondary`,children:[(0,P.jsx)(Wt,{className:`size-4`}),i?`Enlace copiado`:`Copiar enlace`]}),(0,P.jsxs)(`button`,{type:`button`,onClick:r,className:`inline-flex h-11 items-center justify-center gap-2 rounded-xl bg-primary px-5 text-sm font-bold text-primary-foreground transition-opacity hover:opacity-90`,children:[(0,P.jsx)(qt,{className:`size-4`}),`Abrir enlace`]})]})]})}),document.body)}var Av={enabled:!0,renderModal:e=>(0,P.jsx)(kv,{...e})},jv=(0,M.memo)(({className:e,...t})=>(0,P.jsx)(ft,{className:l(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),plugins:Ov,linkSafety:Av,...t}),(e,t)=>e.children===t.children&&t.isAnimating===e.isAnimating);jv.displayName=`MessageResponse`;var Mv=(0,M.createContext)({});function Nv(e){let t=(0,M.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Pv=typeof window<`u`?M.useLayoutEffect:M.useEffect,Fv=(0,M.createContext)(null);function Iv(e,t){e.indexOf(t)===-1&&e.push(t)}function Lv(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Rv=(e,t,n)=>n>t?t:n<e?e:n,zv={},Bv=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Vv=e=>typeof e==`object`&&!!e,Hv=e=>/^0[^.\s]+$/u.test(e);function Uv(e){let t;return()=>(t===void 0&&(t=e()),t)}var Wv=e=>e,Gv=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Kv=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},qv=class{constructor(){this.subscriptions=[]}add(e){return Iv(this.subscriptions,e),()=>Lv(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Jv=e=>e*1e3,Yv=e=>e/1e3,Xv=(e,t)=>t?1e3/t*e:0,Zv=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Qv=1e-7,$v=12;function ey(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Zv(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Qv&&++s<$v);return o}function ty(e,t,n,r){if(e===t&&n===r)return Wv;let i=t=>ey(t,0,1,e,n);return e=>e===0||e===1?e:Zv(i(e),t,r)}var ny=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ry=e=>t=>1-e(1-t),iy=ty(.33,1.53,.69,.99),ay=ry(iy),oy=ny(ay),sy=e=>e>=1?1:(e*=2)<1?.5*ay(e):.5*(2-2**(-10*(e-1))),cy=e=>1-Math.sin(Math.acos(e)),ly=ry(cy),uy=ny(cy),dy=ty(.42,0,1,1),fy=ty(0,0,.58,1),py=ty(.42,0,.58,1),my=e=>Array.isArray(e)&&typeof e[0]!=`number`,hy=e=>Array.isArray(e)&&typeof e[0]==`number`,gy={linear:Wv,easeIn:dy,easeInOut:py,easeOut:fy,circIn:cy,circInOut:uy,circOut:ly,backIn:ay,backInOut:oy,backOut:iy,anticipate:sy},_y=e=>typeof e==`string`,vy=e=>{if(hy(e)){e.length;let[t,n,r,i]=e;return ty(t,n,r,i)}return _y(e)?(gy[e],`${e}`,gy[e]):e},yy=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function by(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var xy=40;function Sy(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=yy.reduce((e,t)=>(e[t]=by(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=zv.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,xy),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:yy.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<yy.length;t++)o[yy[t]].cancel(e)},state:i,steps:o}}var{schedule:K,cancel:Cy,state:wy,steps:Ty}=Sy(typeof requestAnimationFrame<`u`?requestAnimationFrame:Wv,!0),Ey;function Dy(){Ey=void 0}var Oy={now:()=>(Ey===void 0&&Oy.set(wy.isProcessing||zv.useManualTiming?wy.timestamp:performance.now()),Ey),set:e=>{Ey=e,queueMicrotask(Dy)}},ky=e=>t=>typeof t==`string`&&t.startsWith(e),Ay=ky(`--`),jy=ky(`var(--`),My=e=>jy(e)?Ny.test(e.split(`/*`)[0].trim()):!1,Ny=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Py(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Fy={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Iy={...Fy,transform:e=>Rv(0,1,e)},Ly={...Fy,default:1},Ry=e=>Math.round(e*1e5)/1e5,zy=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function By(e){return e==null}var Vy=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Hy=(e,t)=>n=>!!(typeof n==`string`&&Vy.test(n)&&n.startsWith(e)||t&&!By(n)&&Object.prototype.hasOwnProperty.call(n,t)),Uy=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(zy);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Wy=e=>Rv(0,255,e),Gy={...Fy,transform:e=>Math.round(Wy(e))},Ky={test:Hy(`rgb`,`red`),parse:Uy(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Gy.transform(e)+`, `+Gy.transform(t)+`, `+Gy.transform(n)+`, `+Ry(Iy.transform(r))+`)`};function qy(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Jy={test:Hy(`#`),parse:qy,transform:Ky.transform},Yy=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Xy=Yy(`deg`),Zy=Yy(`%`),q=Yy(`px`),Qy=Yy(`vh`),$y=Yy(`vw`),eb={...Zy,parse:e=>Zy.parse(e)/100,transform:e=>Zy.transform(e*100)},tb={test:Hy(`hsl`,`hue`),parse:Uy(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Zy.transform(Ry(t))+`, `+Zy.transform(Ry(n))+`, `+Ry(Iy.transform(r))+`)`},J={test:e=>Ky.test(e)||Jy.test(e)||tb.test(e),parse:e=>Ky.test(e)?Ky.parse(e):tb.test(e)?tb.parse(e):Jy.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Ky.transform(e):tb.transform(e),getAnimatableNone:e=>{let t=J.parse(e);return t.alpha=0,J.transform(t)}},nb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function rb(e){return isNaN(e)&&typeof e==`string`&&(e.match(zy)?.length||0)+(e.match(nb)?.length||0)>0}var ib=`number`,ab=`color`,ob=`var`,sb=`var(`,cb="${}",lb=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ub(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(lb,e=>(J.test(e)?(r.color.push(a),i.push(ab),n.push(J.parse(e))):e.startsWith(sb)?(r.var.push(a),i.push(ob),n.push(e)):(r.number.push(a),i.push(ib),n.push(parseFloat(e))),++a,cb)).split(cb),indexes:r,types:i}}function db(e){return ub(e).values}function fb({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===ib?Ry(r[a]):e===ab?J.transform(r[a]):r[a]}return i}}function pb(e){return fb(ub(e))}var mb=e=>typeof e==`number`?0:J.test(e)?J.getAnimatableNone(e):e,hb=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:mb(e);function gb(e){let t=ub(e);return fb(t)(t.values.map((e,n)=>hb(e,t.split[n])))}var _b={test:rb,parse:db,createTransformer:pb,getAnimatableNone:gb};function vb(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function yb({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=vb(s,r,e+1/3),a=vb(s,r,e),o=vb(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function bb(e,t){return n=>n>0?t:e}var Y=(e,t,n)=>e+(t-e)*n,xb=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Sb=[Jy,Ky,tb],Cb=e=>Sb.find(t=>t.test(e));function wb(e){let t=Cb(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===tb&&(n=yb(n)),n}var Tb=(e,t)=>{let n=wb(e),r=wb(t);if(!n||!r)return bb(e,t);let i={...n};return e=>(i.red=xb(n.red,r.red,e),i.green=xb(n.green,r.green,e),i.blue=xb(n.blue,r.blue,e),i.alpha=Y(n.alpha,r.alpha,e),Ky.transform(i))},Eb=new Set([`none`,`hidden`]);function Db(e,t){return Eb.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Ob(e,t){return n=>Y(e,t,n)}function kb(e){return typeof e==`number`?Ob:typeof e==`string`?My(e)?bb:J.test(e)?Tb:Nb:Array.isArray(e)?Ab:typeof e==`object`?J.test(e)?Tb:jb:bb}function Ab(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>kb(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function jb(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=kb(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Mb(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Nb=(e,t)=>{let n=_b.createTransformer(t),r=ub(e),i=ub(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Eb.has(e)&&!i.values.length||Eb.has(t)&&!r.values.length?Db(e,t):Gv(Ab(Mb(r,i),i.values),n):(`${e}${t}`,bb(e,t))};function Pb(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Y(e,t,n):kb(e)(e,t)}var Fb=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>K.update(t,e),stop:()=>Cy(t),now:()=>wy.isProcessing?wy.timestamp:Oy.now()}},Ib=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Lb=2e4;function Rb(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function zb(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Rb(r),Lb);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Yv(i)}}var X={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Bb(e,t){return e*Math.sqrt(1-t*t)}var Vb=12;function Hb(e,t,n){let r=n;for(let n=1;n<Vb;n++)r-=e(r)/t(r);return r}var Ub=.001;function Wb({duration:e=X.duration,bounce:t=X.bounce,velocity:n=X.velocity,mass:r=X.mass}){let i,a;X.maxDuration;let o=1-t;o=Rv(X.minDamping,X.maxDamping,o),e=Rv(X.minDuration,X.maxDuration,Yv(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Bb(t,o),c=Math.exp(-i);return Ub-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Bb(t**2,o);return(-i(t)+Ub>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Hb(i,a,s);if(e=Jv(e),isNaN(c))return{stiffness:X.stiffness,damping:X.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Gb=[`duration`,`bounce`],Kb=[`stiffness`,`damping`,`mass`];function qb(e,t){return t.some(t=>e[t]!==void 0)}function Jb(e){let t={velocity:X.velocity,stiffness:X.stiffness,damping:X.damping,mass:X.mass,isResolvedFromDuration:!1,...e};if(!qb(e,Kb)&&qb(e,Gb)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Rv(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:X.mass,stiffness:i,damping:a}}else{let n=Wb({...e,velocity:0});t={...t,...n,mass:X.mass},t.isResolvedFromDuration=!0}}return t}function Yb(e=X.visualDuration,t=X.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Jb({...n,velocity:-Yv(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Yv(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?X.restSpeed.granular:X.restSpeed.default,i||=v?X.restDelta.granular:X.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Bb(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>Jv(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=Jv(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=Jv(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Rb(T),Lb),t=Ib(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Yb.applyToOptions=e=>{let t=zb(e,100,Yb);return e.ease=t.ease,e.duration=Jv(t.duration),e.type=`keyframes`,e};var Xb=5;function Zb(e,t,n){let r=Math.max(t-Xb,0);return Xv(n-e(r),t-r)}function Qb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Yb({keyframes:[f.value,m(f.value)],velocity:Zb(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function $b(e,t,n){let r=[],i=n||zv.mix||Pb,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Gv(Array.isArray(t)?t[n]||Wv:t,a)),r.push(a)}return r}function ex(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=$b(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Kv(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Rv(e[0],e[a-1],t)):l}function tx(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Kv(0,t,r);e.push(Y(n,1,i))}}function nx(e){let t=[0];return tx(t,e.length-1),t}function rx(e,t){return e.map(e=>e*t)}function ix(e,t){return e.map(()=>t||py).splice(0,e.length-1)}function ax({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=my(r)?r.map(vy):vy(r),a={done:!1,value:t[0]},o=ex(rx(n&&n.length===t.length?n:nx(t),e),t,{ease:Array.isArray(i)?i:ix(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var ox=e=>e!==null;function sx(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(ox),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var cx={decay:Qb,inertia:Qb,tween:ax,keyframes:ax,spring:Yb};function lx(e){typeof e.type==`string`&&(e.type=cx[e.type])}var ux=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},dx=e=>e/100,fx=class extends ux{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Oy.now()&&this.tick(Oy.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;lx(e);let{type:t=ax,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||ax;s!==ax&&typeof o[0]!=`number`&&(this.mixKeyframes=Gv(dx,Pb(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Rb(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=Rv(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Qb&&(b.value=sx(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Yv(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Yv(e)}get time(){return Yv(this.currentTime)}set time(e){e=Jv(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Zb(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Oy.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Yv(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Fb,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Oy.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function px(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var mx=e=>e*180/Math.PI,hx=e=>_x(mx(Math.atan2(e[1],e[0]))),gx={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:hx,rotateZ:hx,skewX:e=>mx(Math.atan(e[1])),skewY:e=>mx(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},_x=e=>(e%=360,e<0&&(e+=360),e),vx=hx,yx=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),bx=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),xx={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:yx,scaleY:bx,scale:e=>(yx(e)+bx(e))/2,rotateX:e=>_x(mx(Math.atan2(e[6],e[5]))),rotateY:e=>_x(mx(Math.atan2(-e[2],e[0]))),rotateZ:vx,rotate:vx,skewX:e=>mx(Math.atan(e[4])),skewY:e=>mx(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Sx(e){return+!!e.includes(`scale`)}function Cx(e,t){if(!e||e===`none`)return Sx(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=xx,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=gx,i=t}if(!i)return Sx(t);let a=r[t],o=i[1].split(`,`).map(Tx);return typeof a==`function`?a(o):o[a]}var wx=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return Cx(n,t)};function Tx(e){return parseFloat(e.trim())}var Ex=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Dx=new Set([...Ex,`pathRotation`]),Ox=e=>e===Fy||e===q,kx=new Set([`x`,`y`,`z`]),Ax=Ex.filter(e=>!kx.has(e));function jx(e){let t=[];return Ax.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var Mx={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Cx(t,`x`),y:(e,{transform:t})=>Cx(t,`y`)};Mx.translateX=Mx.x,Mx.translateY=Mx.y;var Nx=new Set,Px=!1,Fx=!1,Ix=!1;function Lx(){if(Fx){let e=Array.from(Nx).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=jx(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Fx=!1,Px=!1,Nx.forEach(e=>e.complete(Ix)),Nx.clear()}function Rx(){Nx.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Fx=!0)})}function zx(){Ix=!0,Rx(),Lx(),Ix=!1}var Bx=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Nx.add(this),Px||(Px=!0,K.read(Rx),K.resolveKeyframes(Lx))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}px(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Nx.delete(this)}cancel(){this.state===`scheduled`&&(Nx.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Vx=e=>e.startsWith(`--`);function Hx(e,t,n){Vx(t)?e.style.setProperty(t,n):e.style[t]=n}var Ux={};function Wx(e,t){let n=Uv(e);return()=>Ux[t]??n()}var Gx=Wx(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Kx=Wx(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),qx=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Jx={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:qx([0,.65,.55,1]),circOut:qx([.55,0,1,.45]),backIn:qx([.31,.01,.66,-.59]),backOut:qx([.33,1.53,.69,.99])};function Yx(e,t){if(e)return typeof e==`function`?Kx()?Ib(e,t):`ease-out`:hy(e)?qx(e):Array.isArray(e)?e.map(e=>Yx(e,t)||Jx.easeOut):Jx[e]}function Xx(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Yx(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Zx(e){return typeof e==`function`&&`applyToOptions`in e}function Qx({type:e,...t}){return Zx(e)&&Kx()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var $x=class extends ux{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Qx(e);this.animation=Xx(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=sx(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Hx(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Yv(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Yv(e)}get time(){return Yv(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Jv(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Gx()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Wv):r(this)}},eS={anticipate:sy,backInOut:oy,circInOut:uy};function tS(e){return e in eS}function nS(e){typeof e.ease==`string`&&tS(e.ease)&&(e.ease=eS[e.ease])}var rS=10,iS=class extends $x{constructor(e){nS(e),lx(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new fx({...a,autoplay:!1}),s=Math.max(rS,Oy.now()-this.startTime),c=Rv(0,rS,s-rS),l=o.sample(s).value,{name:u}=this.options;i&&u&&Hx(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},aS=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(_b.test(e)||e===`0`)&&!e.startsWith(`url(`));function oS(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function sS(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=aS(i,t),s=aS(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:oS(e)||(n===`spring`||Zx(n))&&r}function cS(e){e.duration=0,e.type=`keyframes`}var lS=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),uS=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function dS(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&uS.test(e[t]))return!0;return!1}var fS=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),pS=Uv(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function mS(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return pS()&&n&&(lS.has(n)||fS.has(n)&&dS(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var hS=40,gS=class extends ux{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Oy.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||Bx;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Oy.now();let u=!0;sS(e,i,a,o)||(u=!1,(zv.instantAnimations||!s)&&l?.(sx(e,n,t)),e[0]=e[e.length-1],cS(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>hS?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&mS(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new iS({...d,element:p})}catch{m=new fx(d)}else m=new fx(d);m.finished.then(()=>{this.notifyFinished()}).catch(Wv),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),zx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function _S(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var vS=30,yS=e=>!isNaN(parseFloat(e)),bS={current:void 0},xS=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Oy.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Oy.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=yS(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new qv);let n=this.events[e].add(t);return e===`change`?()=>{n(),K.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return bS.current&&bS.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Oy.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>vS)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,vS);return Xv(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function SS(e,t){return new xS(e,t)}function CS(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function wS(e,t){let n=e?.[t]??e?.default??e;return n===e?n:CS(n,e)}var TS={type:`spring`,stiffness:500,damping:25,restSpeed:10},ES=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),DS={type:`keyframes`,duration:.8},OS={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},kS=(e,{keyframes:t})=>t.length>2?DS:Dx.has(e)?e.startsWith(`scale`)?ES(t[1]):TS:OS,AS=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function jS(e){for(let t in e)if(!AS.has(t))return!0;return!1}var MS=(e,t,n,r={},i,a)=>o=>{let s=wS(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Jv(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};jS(s)||Object.assign(u,kS(e,u)),u.duration&&=Jv(u.duration),u.repeatDelay&&=Jv(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(cS(u),u.delay===0&&(d=!0)),(zv.instantAnimations||zv.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,cS(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=sx(u.keyframes,s);if(e!==void 0){K.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new fx(u):new gS(u)},NS=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function PS(e){let t=NS.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function FS(e,t,n=1){`${e}`;let[r,i]=PS(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Bv(e)?parseFloat(e):e}return My(i)?FS(i,t,n+1):i}function IS(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function LS(e,t,n,r){if(typeof t==`function`){let[i,a]=IS(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=IS(r);t=t(n===void 0?e.custom:n,i,a)}return t}function RS(e,t,n){let r=e.getProps();return LS(r,t,n===void 0?r.custom:n,e)}var zS=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Ex]),BS=e=>Array.isArray(e);function VS(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,SS(n))}function HS(e){return BS(e)?e[e.length-1]||0:e}function US(e,t){let{transitionEnd:n={},transition:r={},...i}=RS(e,t)||{};i={...i,...n};for(let t in i)VS(e,t,HS(i[t]))}var WS=e=>!!(e&&e.getVelocity);function GS(e){return!!(WS(e)&&e.add)}function KS(e,t){let n=e.getValue(`willChange`);if(GS(n))return n.add(t);if(!n&&zv.WillChange){let n=new zv.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function qS(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var JS=`data-`+qS(`framerAppearId`);function YS(e){return e.props[JS]}function XS({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ZS(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?CS(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&XS(f,t))continue;let o={delay:n,...wS(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){K.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=YS(e);if(n){let e=window.MotionHandoffAnimation(n,t,K);e!==null&&(o.startTime=e,p=!0)}}KS(e,t);let m=l??e.shouldReduceMotion;r.start(MS(t,r,i,m&&zS.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>K.update(()=>{o&&US(e,o)});d.length?Promise.all(d).then(t):t()}return d}function QS(e,t,n={}){let r=RS(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(ZS(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return $S(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function $S(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(QS(c,t,{...o,delay:n+(typeof r==`function`?0:r)+_S(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function eC(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>QS(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=QS(e,t,n);else{let i=typeof t==`function`?RS(e,t,n.custom):t;r=Promise.all(ZS(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var tC={test:e=>e===`auto`,parse:e=>e},nC=e=>t=>t.test(e),rC=[Fy,q,Zy,Xy,$y,Qy,tC],iC=e=>rC.find(nC(e));function aC(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Hv(e)}var oC=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function sC(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(zy)||[];if(!r)return e;let i=n.replace(r,``),a=+!!oC.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var cC=/\b([a-z-]*)\(.*?\)/gu,lC={..._b,getAnimatableNone:e=>{let t=e.match(cC);return t?t.map(sC).join(` `):e}},uC={..._b,getAnimatableNone:e=>{let t=_b.parse(e);return _b.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},dC={...Fy,transform:Math.round},fC={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,rotate:Xy,pathRotation:Xy,rotateX:Xy,rotateY:Xy,rotateZ:Xy,scale:Ly,scaleX:Ly,scaleY:Ly,scaleZ:Ly,skew:Xy,skewX:Xy,skewY:Xy,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:Iy,originX:eb,originY:eb,originZ:q,zIndex:dC,fillOpacity:Iy,strokeOpacity:Iy,numOctaves:dC},pC={...fC,color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,filter:lC,WebkitFilter:lC,mask:uC,WebkitMask:uC},mC=e=>pC[e],hC=new Set([lC,uC]);function gC(e,t){let n=mC(e);return hC.has(n)||(n=_b),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var _C=new Set([`auto`,`none`,`0`]);function vC(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!_C.has(t)&&ub(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=gC(n,i)}var yC=class extends Bx{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),My(r))){let i=FS(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!zS.has(n)||e.length!==2)return;let[r,i]=e,a=iC(r),o=iC(i);if(Py(r)!==Py(i)&&Mx[n]){this.needsMeasurement=!0;return}if(a!==o){if(Ox(a)&&Ox(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Mx[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||aC(e[t]))&&n.push(t);n.length&&vC(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Mx[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Mx[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},bC=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function xC(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var SC=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function CC(e){return Vv(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:wC,cancel:TC}=Sy(queueMicrotask,!1),EC={x:!1,y:!1};function DC(){return EC.x||EC.y}function OC(e){return e===`x`||e===`y`?EC[e]?null:(EC[e]=!0,()=>{EC[e]=!1}):EC.x||EC.y?null:(EC.x=EC.y=!0,()=>{EC.x=EC.y=!1})}function kC(e,t){let n=xC(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function AC(e){return!(e.pointerType===`touch`||DC())}function jC(e,t,n={}){let[r,i,a]=kC(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!AC(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var MC=(e,t)=>t?e===t||MC(e,t.parentElement):!1,NC=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,PC=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function FC(e){return PC.has(e.tagName)||e.isContentEditable===!0}var IC=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function LC(e){return IC.has(e.tagName)||e.isContentEditable===!0}var RC=new WeakSet;function zC(e){return t=>{t.key===`Enter`&&e(t)}}function BC(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var VC=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=zC(()=>{if(RC.has(n))return;BC(n,`down`);let e=zC(()=>{BC(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>BC(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function HC(e){return NC(e)&&!DC()}var UC=new WeakSet;function WC(e,t,n={}){let[r,i,a]=kC(e,n),o=e=>{let r=e.currentTarget;if(!HC(e)||UC.has(e))return;RC.add(r),n.stopPropagation&&UC.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),RC.has(r)&&RC.delete(r),HC(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||MC(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),CC(e)&&(e.addEventListener(`focus`,e=>VC(e,i)),!FC(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function GC(e){return Vv(e)&&`ownerSVGElement`in e}var KC=new WeakMap,qC,JC=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:GC(r)&&`getBBox`in r?r.getBBox()[t]:r[n],YC=JC(`inline`,`width`,`offsetWidth`),XC=JC(`block`,`height`,`offsetHeight`);function ZC({target:e,borderBoxSize:t}){KC.get(e)?.forEach(n=>{n(e,{get width(){return YC(e,t)},get height(){return XC(e,t)}})})}function QC(e){e.forEach(ZC)}function $C(){typeof ResizeObserver>`u`||(qC=new ResizeObserver(QC))}function ew(e,t){qC||$C();let n=xC(e);return n.forEach(e=>{let n=KC.get(e);n||(n=new Set,KC.set(e,n)),n.add(t),qC?.observe(e)}),()=>{n.forEach(e=>{let n=KC.get(e);n?.delete(t),n?.size||qC?.unobserve(e)})}}var tw=new Set,nw;function rw(){nw=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};tw.forEach(t=>t(e))},window.addEventListener(`resize`,nw)}function iw(e){return tw.add(e),nw||rw(),()=>{tw.delete(e),!tw.size&&typeof nw==`function`&&(window.removeEventListener(`resize`,nw),nw=void 0)}}function aw(e,t){return typeof e==`function`?iw(e):ew(e,t)}var ow={value:null,addProjectionMetrics:null};function sw(e){return GC(e)&&e.tagName===`svg`}var cw=[...rC,J,_b],lw=e=>cw.find(nC(e)),uw=()=>({translate:0,scale:1,origin:0,originPoint:0}),dw=()=>({x:uw(),y:uw()}),fw=()=>({min:0,max:0}),Z=()=>({x:fw(),y:fw()}),pw=new WeakMap;function mw(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function hw(e){return typeof e==`string`||Array.isArray(e)}var gw=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],_w=[`initial`,...gw];function vw(e){return mw(e.animate)||_w.some(t=>hw(e[t]))}function yw(e){return!!(vw(e)||e.variants)}function bw(e,t,n){for(let r in t){let i=t[r],a=n[r];if(WS(i))e.addValue(r,i);else if(WS(a))e.addValue(r,SS(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,SS(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var xw={current:null},Sw={current:!1},Cw=typeof window<`u`;function ww(){if(Sw.current=!0,Cw){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>xw.current=e.matches;e.addEventListener(`change`,t),t()}else xw.current=!1}}var Tw=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Ew={};function Dw(e){Ew=e}function Ow(){return Ew}var kw=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Bx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Oy.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,K.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=vw(t),this.isVariantNode=yw(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&WS(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,pw.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Sw.current||ww(),this.shouldReduceMotion=xw.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Cy(this.notifyUpdate),Cy(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&lS.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new $x({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Jv(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Dx.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&K.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Ew){let t=Ew[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Z()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Tw.length;t++){let n=Tw[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=bw(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=SS(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Bv(n)||Hv(n))?n=parseFloat(n):!lw(n)&&_b.test(t)&&(n=gC(e,t)),this.setBaseTarget(e,WS(n)?n.get():n)),WS(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=LS(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!WS(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new qv),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){wC.render(this.render)}},Aw=class extends kw{constructor(){super(...arguments),this.KeyframeResolver=yC}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;WS(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},jw=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Mw({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Nw({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Pw(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Fw(e){return e===void 0||e===1}function Iw({scale:e,scaleX:t,scaleY:n}){return!Fw(e)||!Fw(t)||!Fw(n)}function Lw(e){return Iw(e)||Rw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Rw(e){return zw(e.x)||zw(e.y)}function zw(e){return e&&e!==`0%`}function Bw(e,t,n){return n+t*(e-n)}function Vw(e,t,n,r,i){return i!==void 0&&(e=Bw(e,i,r)),Bw(e,n,r)+t}function Hw(e,t=0,n=1,r,i){e.min=Vw(e.min,t,n,r,i),e.max=Vw(e.max,t,n,r,i)}function Uw(e,{x:t,y:n}){Hw(e.x,t.translate,t.scale,t.originPoint),Hw(e.y,n.translate,n.scale,n.originPoint)}var Ww=.999999999999,Gw=1.0000000000001;function Kw(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(qw(e.x,-a.scroll.offset.x),qw(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Uw(e,o)),r&&Lw(a.latestValues)&&Xw(e,a.latestValues,a.layout?.layoutBox))}t.x<Gw&&t.x>Ww&&(t.x=1),t.y<Gw&&t.y>Ww&&(t.y=1)}function qw(e,t){e.min+=t,e.max+=t}function Jw(e,t,n,r,i=.5){Hw(e,t,n,Y(e.min,e.max,i),r)}function Yw(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Xw(e,t,n){let r=n??e;Jw(e.x,Yw(t.x,r.x),t.scaleX,t.scale,t.originX),Jw(e.y,Yw(t.y,r.y),t.scaleY,t.scale,t.originY)}function Zw(e,t){return Mw(Pw(e.getBoundingClientRect(),t))}function Qw(e,t,n){let r=Zw(e,n),{scroll:i}=t;return i&&(qw(r.x,i.offset.x),qw(r.y,i.offset.y)),r}var $w={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},eT=Ex.length;function tT(e,t,n){let r=``,i=!0;for(let a=0;a<eT;a++){let o=Ex[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=SC(s,fC[o]);if(!c){i=!1;let t=$w[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${SC(a,fC.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function nT(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Dx.has(e)){o=!0;continue}if(Ay(e)){i[e]=n;continue}{let t=SC(n,fC[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=tT(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function rT(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function iT(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var aT={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(q.test(e))e=parseFloat(e);else return e}return`${iT(e,t.target.x)}% ${iT(e,t.target.y)}%`}},oT={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=_b.parse(e);if(i.length>5)return r;let a=_b.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Y(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},sT={borderRadius:{...aT,applyTo:[...bC]},borderTopLeftRadius:aT,borderTopRightRadius:aT,borderBottomLeftRadius:aT,borderBottomRightRadius:aT,boxShadow:oT};function cT(e,{layout:t,layoutId:n}){return Dx.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!sT[e]||e===`opacity`)}function lT(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(WS(r[t])||i&&WS(i[t])||cT(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function uT(e){return window.getComputedStyle(e)}var dT=class extends Aw{constructor(){super(...arguments),this.type=`html`,this.renderInstance=rT}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Dx.has(t))return this.projection?.isProjecting?Sx(t):wx(e,t);{let n=uT(e),r=(Ay(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Zw(e,t)}build(e,t,n){nT(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return lT(e,t,n)}},fT={offset:`stroke-dashoffset`,array:`stroke-dasharray`},pT={offset:`strokeDashoffset`,array:`strokeDasharray`};function mT(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?fT:pT;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var hT=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function gT(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(nT(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of hT)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&mT(d,i,a,o,!1)}var _T=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),vT=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function yT(e,t,n,r){rT(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(_T.has(n)?n:qS(n),t.attrs[n])}function bT(e,t,n){let r=lT(e,t,n);for(let n in e)if(WS(e[n])||WS(t[n])){let t=Ex.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var xT=class extends Aw{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Z}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Dx.has(t)){let e=mC(t);return e&&e.default||0}return t=_T.has(t)?t:qS(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return bT(e,t,n)}build(e,t,n){gT(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){yT(e,t,n,r)}mount(e){this.isSVGTag=vT(e.tagName),super.mount(e)}},ST=_w.length;function CT(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&CT(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<ST;n++){let r=_w[n],i=e.props[r];(hw(i)||i===!1)&&(t[r]=i)}return t}function wT(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var TT=[...gw].reverse(),ET=gw.length;function DT(e){return t=>Promise.all(t.map(({animation:t,options:n})=>eC(e,t,n)))}function OT(e){let t=DT(e),n=jT(),r=!0,i=!1,a=t=>(n,r)=>{let i=RS(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=CT(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<ET;t++){let p=TT[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=hw(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||mw(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=kT(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},ee=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=BS(t)&&BS(n)?!wT(t,n)||y:t!==n,r?t==null?u.add(e):ee(e):t!==void 0&&u.has(e)?ee(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let E=v&&y;b&&(!E||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=RS(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=_S(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=RS(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=jT(),i=!0}}}function kT(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!wT(t,e):!1}function AT(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function jT(){return{animate:AT(!0),whileInView:AT(),whileHover:AT(),whileTap:AT(),whileDrag:AT(),whileFocus:AT(),exit:AT()}}function MT(e,t){e.min=t.min,e.max=t.max}function NT(e,t){MT(e.x,t.x),MT(e.y,t.y)}function PT(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var FT=.9999,IT=1.0001,LT=-.01,RT=.01;function zT(e){return e.max-e.min}function BT(e,t,n){return Math.abs(e-t)<=n}function VT(e,t,n,r=.5){e.origin=r,e.originPoint=Y(t.min,t.max,e.origin),e.scale=zT(n)/zT(t),e.translate=Y(n.min,n.max,e.origin)-e.originPoint,(e.scale>=FT&&e.scale<=IT||isNaN(e.scale))&&(e.scale=1),(e.translate>=LT&&e.translate<=RT||isNaN(e.translate))&&(e.translate=0)}function HT(e,t,n,r){VT(e.x,t.x,n.x,r?r.originX:void 0),VT(e.y,t.y,n.y,r?r.originY:void 0)}function UT(e,t,n,r=0){e.min=(r?Y(n.min,n.max,r):n.min)+t.min,e.max=e.min+zT(t)}function WT(e,t,n,r){UT(e.x,t.x,n.x,r?.x),UT(e.y,t.y,n.y,r?.y)}function GT(e,t,n,r=0){let i=r?Y(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+zT(t)}function KT(e,t,n,r){GT(e.x,t.x,n.x,r?.x),GT(e.y,t.y,n.y,r?.y)}function qT(e,t,n,r,i){return e-=t,e=Bw(e,1/n,r),i!==void 0&&(e=Bw(e,1/i,r)),e}function JT(e,t=0,n=1,r=.5,i,a=e,o=e){if(Zy.test(t)&&(t=parseFloat(t),t=Y(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Y(a.min,a.max,r);e===a&&(s-=t),e.min=qT(e.min,t,n,s,i),e.max=qT(e.max,t,n,s,i)}function YT(e,t,[n,r,i],a,o){JT(e,t[n],t[r],t[i],t.scale,a,o)}var XT=[`x`,`scaleX`,`originX`],ZT=[`y`,`scaleY`,`originY`];function QT(e,t,n,r){YT(e.x,t,XT,n?n.x:void 0,r?r.x:void 0),YT(e.y,t,ZT,n?n.y:void 0,r?r.y:void 0)}function $T(e){return e.translate===0&&e.scale===1}function eE(e){return $T(e.x)&&$T(e.y)}function tE(e,t){return e.min===t.min&&e.max===t.max}function nE(e,t){return tE(e.x,t.x)&&tE(e.y,t.y)}function rE(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function iE(e,t){return rE(e.x,t.x)&&rE(e.y,t.y)}function aE(e){return zT(e.x)/zT(e.y)}function oE(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function sE(e){return[e(`x`),e(`y`)]}function cE(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var lE=bC.length,uE=e=>typeof e==`string`?parseFloat(e):e,dE=e=>typeof e==`number`||q.test(e);function fE(e,t,n,r,i,a){i?(e.opacity=Y(0,n.opacity??1,mE(r)),e.opacityExit=Y(t.opacity??1,0,hE(r))):a&&(e.opacity=Y(t.opacity??1,n.opacity??1,r));for(let i=0;i<lE;i++){let a=bC[i],o=pE(t,a),s=pE(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||dE(o)===dE(s)?(e[a]=Math.max(Y(uE(o),uE(s),r),0),(Zy.test(s)||Zy.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Y(t.rotate||0,n.rotate||0,r))}function pE(e,t){return e[t]===void 0?e.borderRadius:e[t]}var mE=gE(0,.5,ly),hE=gE(.5,.95,Wv);function gE(e,t,n){return r=>r<e?0:r>t?1:n(Kv(e,t,r))}function _E(e,t,n){let r=WS(e)?e:SS(e);return r.start(MS(``,r,t,n)),r.animation}function vE(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var yE=(e,t)=>e.depth-t.depth,bE=class{constructor(){this.children=[],this.isDirty=!1}add(e){Iv(this.children,e),this.isDirty=!0}remove(e){Lv(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(yE),this.isDirty=!1,this.children.forEach(e)}};function xE(e,t){let n=Oy.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Cy(r),e(a-t))};return K.setup(r,!0),()=>Cy(r)}function SE(e){return WS(e)?e.get():e}var CE=class{constructor(){this.members=[]}add(e){Iv(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Lv(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Lv(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},wE={hasAnimatedSinceResize:!0,hasEverUpdated:!1},TE={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},EE=[``,`X`,`Y`,`Z`],DE=1e3,OE=0;function kE(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function AE(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=YS(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,K,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&AE(r)}function jE({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=OE++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ow.value&&(TE.nodes=TE.calculatedTargetDeltas=TE.calculatedProjections=0),this.nodes.forEach(PE),this.nodes.forEach(UE),this.nodes.forEach(WE),this.nodes.forEach(FE),ow.addProjectionMetrics&&ow.addProjectionMetrics(TE)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new bE)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new qv),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=GC(t)&&!sw(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;K.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=xE(i,250),wE.hasAnimatedSinceResize&&(wE.hasAnimatedSinceResize=!1,this.nodes.forEach(HE)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||ZE,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!iE(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...wS(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||HE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Cy(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(GE),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&AE(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(RE),this.nodes.forEach(LE);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(zE);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(BE),this.nodes.forEach(VE),this.nodes.forEach(ME),this.nodes.forEach(NE)):this.nodes.forEach(zE),this.clearAllSnapshots();let e=Oy.now();wy.delta=Rv(0,1e3/60,e-wy.timestamp),wy.timestamp=e,wy.isProcessing=!0,Ty.update.process(wy),Ty.preRender.process(wy),Ty.render.process(wy),wy.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wC.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(IE),this.sharedNodes.forEach(KE)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,K.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){K.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!zT(this.snapshot.measuredBox.x)&&!zT(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=Z(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!eE(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Lw(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),tD(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Z();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(rD))){let{scroll:e}=this.root;e&&(qw(t.x,e.offset.x),qw(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Z();if(NT(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&NT(t,e),qw(t.x,i.offset.x),qw(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Z();NT(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(qw(r.x,-n.scroll.offset.x),qw(r.y,-n.scroll.offset.y)),Lw(n.latestValues)&&Xw(r,n.latestValues,n.layout?.layoutBox)}return Lw(this.latestValues)&&Xw(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Z();NT(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Lw(n.latestValues))continue;let r;n.instance&&(Iw(n.latestValues)&&n.updateSnapshot(),r=Z(),NT(r,n.measurePageBox())),QT(t,n.latestValues,n.snapshot?.layoutBox,r)}return Lw(this.latestValues)&&QT(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==wy.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=wy.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Z(),this.targetWithTransforms=Z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),WT(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):NT(this.target,this.layout.layoutBox),Uw(this.target,this.targetDelta)):NT(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),ow.value&&TE.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Iw(this.parent.latestValues)||Rw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Z(),this.relativeTargetOrigin=Z(),KT(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),NT(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===wy.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;NT(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Kw(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Z());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(PT(this.prevProjectionDelta.x,this.projectionDelta.x),PT(this.prevProjectionDelta.y,this.projectionDelta.y)),HT(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!oE(this.projectionDelta.x,this.prevProjectionDelta.x)||!oE(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),ow.value&&TE.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=dw(),this.projectionDelta=dw(),this.projectionDeltaWithTransform=dw()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=dw();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Z(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(XE));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=Y(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=Y(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(qE(o.x,e.x,n),qE(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(KT(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),YE(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&nE(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Z(),NT(f,this.relativeTarget)),c&&(this.animationValues=a,fE(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Cy(this.pendingAnimation),void 0),this.pendingAnimation=K.update(()=>{wE.hasAnimatedSinceResize=!0,this.motionValue||=SS(0),this.motionValue.jump(0,!1),this.currentAnimation=_E(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(DE),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&nD(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Z();let t=zT(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=zT(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}NT(t,n),Xw(t,i),HT(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new CE),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&kE(`z`,e,r,this.animationValues);for(let t=0;t<EE.length;t++)kE(`rotate${EE[t]}`,e,r,this.animationValues),kE(`skew${EE[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=SE(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=SE(t?.pointerEvents)||``),this.hasProjected&&!Lw(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=cE(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in sT){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=sT[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?SE(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(LE),this.root.sharedNodes.clear()}}}function ME(e){e.updateLayout()}function NE(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)sE(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=zT(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;MT(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else nD(i,t.layoutBox,n)&&sE(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=zT(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=dw();HT(o,n,t.layoutBox);let s=dw();a?HT(s,e.applyTransform(r,!0),t.measuredBox):HT(s,n,t.layoutBox);let c=!eE(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Z();KT(s,t.layoutBox,i.layoutBox,o);let c=Z();KT(c,n,a.layoutBox,o),iE(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function PE(e){ow.value&&TE.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function FE(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function IE(e){e.clearSnapshot()}function LE(e){e.clearMeasurements()}function RE(e){e.isLayoutDirty=!0,e.updateLayout()}function zE(e){e.isLayoutDirty=!1}function BE(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function VE(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function HE(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function UE(e){e.resolveTargetDelta()}function WE(e){e.calcProjection()}function GE(e){e.resetSkewAndRotation()}function KE(e){e.removeLeadSnapshot()}function qE(e,t,n){e.translate=Y(t.translate,0,n),e.scale=Y(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function JE(e,t,n,r){e.min=Y(t.min,n.min,r),e.max=Y(t.max,n.max,r)}function YE(e,t,n,r){JE(e.x,t.x,n.x,r),JE(e.y,t.y,n.y,r)}function XE(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var ZE={duration:.45,ease:[.4,0,.1,1]},QE=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),$E=QE(`applewebkit/`)&&!QE(`chrome/`)?Math.round:Wv;function eD(e){e.min=$E(e.min),e.max=$E(e.max)}function tD(e){eD(e.x),eD(e.y)}function nD(e,t,n){return e===`position`||e===`preserve-aspect`&&!BT(aE(t),aE(n),.2)}function rD(e){return e!==e.root&&e.scroll?.wasRoot}var iD=jE({attachResizeListener:(e,t)=>vE(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),aD={current:void 0},oD=jE({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!aD.current){let e=new iD({});e.mount(window),e.setOptions({layoutScroll:!0}),aD.current=e}return aD.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),sD=(0,M.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function cD(e=!0){let t=(0,M.useContext)(Fv);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,M.useId)();(0,M.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,M.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var lD=(0,M.createContext)({strict:!1}),uD={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},dD=!1;function fD(){if(dD)return;let e={};for(let t in uD)e[t]={isEnabled:e=>uD[t].some(t=>!!e[t])};Dw(e),dD=!0}function pD(){return fD(),Ow()}function mD(e){let t=pD();for(let n in e)t[n]={...t[n],...e[n]};Dw(t)}var hD=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function gD(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||hD.has(e)}var _D=r({default:()=>vD}),vD,yD=n((()=>{throw vD={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),bD=e=>!gD(e);function xD(e){typeof e==`function`&&(bD=t=>t.startsWith(`on`)?!gD(t):e(t))}try{xD((yD(),t(_D)).default)}catch{}function SD(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(WS(e[i])||(bD(i)||n===!0&&gD(i)||!t&&!gD(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}var CD=(0,M.createContext)({});function wD(e,t){if(vw(e)){let{initial:t,animate:n}=e;return{initial:t===!1||hw(t)?t:void 0,animate:hw(n)?n:void 0}}return e.inherit===!1?{}:t}function TD(e){let{initial:t,animate:n}=wD(e,(0,M.useContext)(CD));return(0,M.useMemo)(()=>({initial:t,animate:n}),[ED(t),ED(n)])}function ED(e){return Array.isArray(e)?e.join(` `):e}var DD=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function OD(e,t,n){for(let r in t)!WS(t[r])&&!cT(r,n)&&(e[r]=t[r])}function kD({transformTemplate:e},t){return(0,M.useMemo)(()=>{let n=DD();return nT(n,t,e),Object.assign({},n.vars,n.style)},[t])}function AD(e,t){let n=e.style||{},r={};return OD(r,n,e),Object.assign(r,kD(e,t)),r}function jD(e,t){let n={},r=AD(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var MD=()=>({...DD(),attrs:{}});function ND(e,t,n,r){let i=(0,M.useMemo)(()=>{let n=MD();return gT(n,t,vT(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};OD(t,e.style,e),i.style={...t,...i.style}}return i}var PD=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function FD(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(PD.indexOf(e)>-1||/[A-Z]/u.test(e))}function ID(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??FD(e)?ND:jD)(t,r,i,e),c=SD(t,typeof e==`string`,a),l=e===M.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,M.useMemo)(()=>WS(u)?u.get():u,[u]);return(0,M.createElement)(e,{...l,children:d})}function LD({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:RD(n,r,i,e),renderState:t()}}function RD(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=SE(a[e]);let{initial:o,animate:s}=e,c=vw(e),l=yw(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!mw(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=LS(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var zD=e=>(t,n)=>{let r=(0,M.useContext)(CD),i=(0,M.useContext)(Fv),a=()=>LD(e,t,r,i);return n?a():Nv(a)},BD=zD({scrapeMotionValuesFromProps:lT,createRenderState:DD}),VD=zD({scrapeMotionValuesFromProps:bT,createRenderState:MD}),HD=Symbol.for(`motionComponentSymbol`);function UD(e,t,n){let r=(0,M.useRef)(n);(0,M.useInsertionEffect)(()=>{r.current=n});let i=(0,M.useRef)(null);return(0,M.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var WD=(0,M.createContext)({});function GD(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function KD(e,t,n,r,i,a){let{visualElement:o}=(0,M.useContext)(CD),s=(0,M.useContext)(lD),c=(0,M.useContext)(Fv),l=(0,M.useContext)(sD),u=l.reducedMotion,d=l.skipAnimations,f=(0,M.useRef)(null),p=(0,M.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,M.useContext)(WD);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&qD(f.current,n,i,h);let g=(0,M.useRef)(!1);(0,M.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[JS],v=(0,M.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Pv(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,M.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function qD(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:JD(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&GD(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function JD(e){if(e)return e.options.allowProjection===!1?JD(e.parent):e.projection}function YD(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&mD(r);let a=n?n===`svg`:FD(e),o=a?VD:BD;function s(n,s){let c,l={...(0,M.useContext)(sD),...n,layoutId:XD(n)},{isStatic:u}=l,d=TD(n),f=o(n,u);if(!u&&typeof window<`u`){ZD(l,r);let t=QD(l);c=t.MeasureLayout,d.visualElement=KD(e,f,l,i,t.ProjectionNode,a)}return(0,P.jsxs)(CD.Provider,{value:d,children:[c&&d.visualElement?(0,P.jsx)(c,{visualElement:d.visualElement,...l}):null,ID(e,n,UD(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,M.forwardRef)(s);return c[HD]=e,c}function XD({layoutId:e}){let t=(0,M.useContext)(Mv).id;return t&&e!==void 0?t+`-`+e:e}function ZD(e,t){(0,M.useContext)(lD).strict}function QD(e){let{drag:t,layout:n}=pD();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function $D(e,t){if(typeof Proxy>`u`)return YD;let n=new Map,r=(n,r)=>YD(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,YD(a,void 0,e,t)),n.get(a))})}var eO=(e,t)=>t.isSVG??FD(e)?new xT(t):new dT(t,{allowProjection:e!==M.Fragment}),tO=class extends jw{constructor(e){super(e),e.animationState||=OT(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();mw(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},nO=0,rO={animation:{Feature:tO},exit:{Feature:class extends jw{constructor(){super(...arguments),this.id=nO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=RS(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function iO(e){return{point:{x:e.pageX,y:e.pageY}}}var aO=e=>t=>NC(t)&&e(t,iO(t));function oO(e,t,n,r){return vE(e,t,aO(n),r)}var sO=({current:e})=>e?e.ownerDocument.defaultView:null,cO=(e,t)=>Math.abs(e-t);function lO(e,t){let n=cO(e.x,t.x),r=cO(e.y,t.y);return Math.sqrt(n**2+r**2)}var uO=new Set([`auto`,`scroll`]),dO=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=fO(this.lastRawMoveEventInfo,this.transformPagePoint));let e=mO(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=lO(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=wy;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=fO(t,this.transformPagePoint),K.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=mO(e.type===`pointercancel`?this.lastMoveEventInfo:fO(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!NC(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=fO(iO(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=wy;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,mO(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Gv(oO(this.contextWindow,`pointermove`,this.handlePointerMove,d),oO(this.contextWindow,`pointerup`,this.handlePointerUp,d),oO(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(uO.has(e.overflowX)||uO.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),K.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Cy(this.updatePoint)}};function fO(e,t){return t?{point:t(e.point)}:e}function pO(e,t){return{x:e.x-t.x,y:e.y-t.y}}function mO({point:e},t){return{point:e,delta:pO(e,gO(t)),offset:pO(e,hO(t)),velocity:_O(t,.1)}}function hO(e){return e[0]}function gO(e){return e[e.length-1]}function _O(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=gO(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Jv(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Jv(t)*2&&(r=e[1]);let a=Yv(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function vO(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Y(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Y(n,e,r.max):Math.min(e,n)),e}function yO(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function bO(e,{top:t,left:n,bottom:r,right:i}){return{x:yO(e.x,n,i),y:yO(e.y,t,r)}}function xO(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function SO(e,t){return{x:xO(e.x,t.x),y:xO(e.y,t.y)}}function CO(e,t){let n=.5,r=zT(e),i=zT(t);return i>r?n=Kv(t.min,t.max-r,e.min):r>i&&(n=Kv(e.min,e.max-i,t.min)),Rv(0,1,n)}function wO(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var TO=.35;function EO(e=TO){return e===!1?e=0:e===!0&&(e=TO),{x:DO(e,`left`,`right`),y:DO(e,`top`,`bottom`)}}function DO(e,t,n){return{min:OO(e,t),max:OO(e,n)}}function OO(e,t){return typeof e==`number`?e:e[t]||0}var kO=new WeakMap,AO=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Z(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(iO(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=OC(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),sE(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Zy.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=zT(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&K.update(()=>i(e,t),!1,!0),KS(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=PO(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&K.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new dO(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:sO(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&K.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!NO(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=vO(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&GD(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?bO(n.layoutBox,e):!1,this.elastic=EO(t),r!==this.constraints&&!GD(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&sE(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=wO(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!GD(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Qw(n,r.root,this.visualElement.getTransformPagePoint()),a=SO(r.layout.layoutBox,i);if(t){let e=t(Nw(a));this.hasMutatedConstraints=!!e,e&&(a=Mw(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=sE(o=>{if(!NO(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return KS(this.visualElement,e),n.start(MS(e,n,0,t,this.visualElement,!1))}stopAnimation(){sE(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){sE(t=>{let{drag:n}=this.getProps();if(!NO(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Y(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!GD(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};sE(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=CO({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),sE(t=>{if(!NO(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Y(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;kO.set(this.visualElement,this);let e=this.visualElement.current,t=oO(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&LC(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();GD(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=MO(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),K.read(r);let o=vE(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(sE(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=TO,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function jO(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function MO(e,t,n){let r=aw(e,jO(n)),i=aw(t,jO(n));return()=>{r(),i()}}function NO(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function PO(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var FO=class extends jw{constructor(e){super(e),this.removeGroupControls=Wv,this.removeListeners=Wv,this.controls=new AO(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Wv}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},IO=e=>(t,n)=>{e&&K.update(()=>e(t,n),!1,!0)},LO=class extends jw{constructor(){super(...arguments),this.removePointerDownListener=Wv}onPointerDown(e){this.session=new dO(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sO(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:IO(e),onStart:IO(t),onMove:IO(n),onEnd:(e,t)=>{delete this.session,r&&K.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=oO(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},RO=!1,zO=class extends M.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),RO&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),wE.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),RO=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||K.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),wC.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;RO=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function BO(e){let[t,n]=cD(),r=(0,M.useContext)(Mv);return(0,P.jsx)(zO,{...e,layoutGroup:r,switchLayoutGroup:(0,M.useContext)(WD),isPresent:t,safeToRemove:n})}var VO={pan:{Feature:LO},drag:{Feature:FO,ProjectionNode:oD,MeasureLayout:BO}};function HO(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&K.postRender(()=>i(t,iO(t)))}var UO=class extends jw{mount(){let{current:e}=this.node;e&&(this.unmount=jC(e,(e,t)=>(HO(this.node,t,`Start`),e=>HO(this.node,e,`End`))))}unmount(){}},WO=class extends jw{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Gv(vE(this.node.current,`focus`,()=>this.onFocus()),vE(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function GO(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&K.postRender(()=>i(t,iO(t)))}var KO=class extends jw{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=WC(e,(e,t)=>(GO(this.node,t,`Start`),(e,{success:t})=>GO(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},qO=new WeakMap,JO=new WeakMap,YO=e=>{let t=qO.get(e.target);t&&t(e)},XO=e=>{e.forEach(YO)};function ZO({root:e,...t}){let n=e||document;JO.has(n)||JO.set(n,{});let r=JO.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(XO,{root:e,...t})),r[i]}function QO(e,t,n){let r=ZO(t);return qO.set(e,n),r.observe(e),()=>{qO.delete(e),r.unobserve(e)}}var $O={some:0,all:1},ek=class extends jw{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:$O[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=QO(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(tk(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function tk({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var nk={inView:{Feature:ek},tap:{Feature:KO},focus:{Feature:WO},hover:{Feature:UO}},rk={layout:{ProjectionNode:oD,MeasureLayout:BO}},ik=$D({...rO,...nk,...VO,...rk},eO),ak=new Map,ok=e=>{let t=ak.get(e);return t||(t=ik.create(e),ak.set(e,t)),t},sk=(0,M.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=ok(t),o=(0,M.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,P.jsx)(a,{animate:{backgroundPosition:`0% center`},className:l(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,n),initial:{backgroundPosition:`100% center`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))`},transition:{duration:r,ease:`linear`,repeat:1/0},children:e})}),ck=Object.defineProperty,lk=(e,t)=>ck(e,`name`,{value:t,configurable:!0}),uk=`focusScope.autoFocusOnMount`,dk=`focusScope.autoFocusOnUnmount`,fk={bubbles:!1,cancelable:!0},pk=M.forwardRef(lk(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=M.useState(null),l=ne(i),u=ne(a),d=M.useRef(null),f=D(t,c),p=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:bk(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||bk(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&bk(s)};lk(e,`handleFocusIn`),lk(t,`handleFocusOut`),lk(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),M.useEffect(()=>{if(s){xk.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(uk,fk);s.addEventListener(uk,l),s.dispatchEvent(t),t.defaultPrevented||(mk(wk(gk(s)),{select:!0}),document.activeElement===e&&bk(s))}return()=>{s.removeEventListener(uk,l),setTimeout(()=>{let t=new CustomEvent(dk,fk);s.addEventListener(dk,u),s.dispatchEvent(t),t.defaultPrevented||bk(e??document.body,{select:!0}),s.removeEventListener(dk,u),xk.remove(p)},0)}}},[s,l,u,p]);let m=M.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=hk(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&bk(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&bk(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,P.jsx)(O.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function mk(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(bk(r,{select:t}),document.activeElement!==n)return}lk(mk,`focusFirst`);function hk(e){let t=gk(e);return[_k(t,e),_k(t.reverse(),e)]}lk(hk,`getTabbableEdges`);function gk(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:lk(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}lk(gk,`getTabbableCandidates`);function _k(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):vk(r,{upTo:t})))return r}lk(_k,`findVisible`);function vk(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}lk(vk,`isHidden`);function yk(e){return e instanceof HTMLInputElement&&`select`in e}lk(yk,`isSelectableInput`);function bk(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yk(e)&&t&&e.select()}}lk(bk,`focus`);var xk=Sk();function Sk(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ck(e,t),e.unshift(t)},remove(t){e=Ck(e,t),e[0]?.resume()}}}lk(Sk,`createFocusScopesStack`);function Ck(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}lk(Ck,`arrayRemove`);function wk(e){return e.filter(e=>e.tagName!==`A`)}lk(wk,`removeLinks`);var Tk=Object.defineProperty,Ek=(e,t)=>Tk(e,`name`,{value:t,configurable:!0}),Dk=0,Ok=null;function kk(e){return Ak(),e.children}Ek(kk,`FocusGuards`);function Ak(){M.useEffect(()=>{Ok||={start:jk(),end:jk()};let{start:e,end:t}=Ok;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Dk++,()=>{Dk===1&&(Ok?.start.remove(),Ok?.end.remove(),Ok=null),Dk=Math.max(0,Dk-1)}},[])}Ek(Ak,`useFocusGuards`);function jk(){let 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}Ek(jk,`createFocusGuard`);var Mk=`right-scroll-bar-position`,Nk=`width-before-scroll-bar`,Pk=`with-scroll-bars-hidden`,Fk=`--removed-body-scroll-bar-size`;function Ik(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Lk(e,t){var n=(0,M.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Rk=typeof window<`u`?M.useLayoutEffect:M.useEffect,zk=new WeakMap;function Bk(e,t){var n=Lk(t||null,function(t){return e.forEach(function(e){return Ik(e,t)})});return Rk(function(){var t=zk.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ik(e,null)}),i.forEach(function(e){r.has(e)||Ik(e,a)})}zk.set(n,e)},[e]),n}function Vk(e){return e}function Hk(e,t){t===void 0&&(t=Vk);var n=[],r=!1;return{read:function(){if(r)throw 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(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Uk(e){e===void 0&&(e={});var t=Hk(null);return t.options=St({async:!0,ssr:!1},e),t}var Wk=function(e){var t=e.sideCar,n=Dt(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return M.createElement(r,St({},n))};Wk.isSideCarExport=!0;function Gk(e,t){return e.useMedium(t),Wk}var Kk=Uk(),qk=function(){},Jk=M.forwardRef(function(e,t){var n=M.useRef(null),r=M.useState({onScrollCapture:qk,onWheelCapture:qk,onTouchMoveCapture:qk}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Dt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Bk([n,t]),C=St(St({},b),i);return M.createElement(M.Fragment,null,u&&M.createElement(x,{sideCar:Kk,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?M.cloneElement(M.Children.only(s),St(St({},C),{ref:S})):M.createElement(v,St({},C,{className:c,ref:S}),s))});Jk.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jk.classNames={fullWidth:Nk,zeroRight:Mk};var Yk,Xk=function(){if(Yk)return Yk;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Zk(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Xk();return t&&e.setAttribute(`nonce`,t),e}function Qk(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $k(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var eA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Zk())&&(Qk(t,n),$k(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tA=function(){var e=eA();return function(t,n){M.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nA=function(){var e=tA();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},rA={left:0,top:0,right:0,gap:0},iA=function(e){return parseInt(e||``,10)||0},aA=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[iA(n),iA(r),iA(i)]},oA=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return rA;var t=aA(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])}},sA=nA(),cA=`data-scroll-locked`,lA=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
||
.${Pk} {
|
||
overflow: hidden ${r};
|
||
padding-right: ${s}px ${r};
|
||
}
|
||
body[${cA}] {
|
||
overflow: hidden ${r};
|
||
overscroll-behavior: contain;
|
||
${[t&&`position: relative ${r};`,n===`margin`&&`
|
||
padding-left: ${i}px;
|
||
padding-top: ${a}px;
|
||
padding-right: ${o}px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: ${s}px ${r};
|
||
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
||
}
|
||
|
||
.${Mk} {
|
||
right: ${s}px ${r};
|
||
}
|
||
|
||
.${Nk} {
|
||
margin-right: ${s}px ${r};
|
||
}
|
||
|
||
.${Mk} .${Mk} {
|
||
right: 0 ${r};
|
||
}
|
||
|
||
.${Nk} .${Nk} {
|
||
margin-right: 0 ${r};
|
||
}
|
||
|
||
body[${cA}] {
|
||
${Fk}: ${s}px;
|
||
}
|
||
`},uA=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},dA=function(){M.useEffect(function(){return document.body.setAttribute(cA,(uA()+1).toString()),function(){var e=uA()-1;e<=0?document.body.removeAttribute(cA):document.body.setAttribute(cA,e.toString())}},[])},fA=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;dA();var a=M.useMemo(function(){return oA(i)},[i]);return M.createElement(sA,{styles:lA(a,!t,i,n?``:`!important`)})},pA=!1;if(typeof window<`u`)try{var mA=Object.defineProperty({},"passive",{get:function(){return pA=!0,!0}});window.addEventListener(`test`,mA,mA),window.removeEventListener(`test`,mA,mA)}catch{pA=!1}var hA=pA?{passive:!1}:!1,gA=function(e){return e.tagName===`TEXTAREA`},_A=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!gA(e)&&n[t]===`visible`)},vA=function(e){return _A(e,`overflowY`)},yA=function(e){return _A(e,`overflowX`)},bA=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),CA(e,r)){var i=wA(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xA=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},SA=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},CA=function(e,t){return e===`v`?vA(t):yA(t)},wA=function(e,t){return e===`v`?xA(t):SA(t)},TA=function(e,t){return e===`h`&&t===`rtl`?-1:1},EA=function(e,t,n,r,i){var a=TA(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=wA(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&CA(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},DA=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},OA=function(e){return[e.deltaX,e.deltaY]},kA=function(e){return e&&`current`in e?e.current:e},AA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jA=function(e){return`
|
||
.block-interactivity-${e} {pointer-events: none;}
|
||
.allow-interactivity-${e} {pointer-events: all;}
|
||
`},MA=0,NA=[];function PA(e){var t=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),i=M.useState(MA++)[0],a=M.useState(nA)[0],o=M.useRef(e);M.useEffect(function(){o.current=e},[e]),M.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=bt([e.lockRef.current],(e.shards||[]).map(kA),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=M.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=DA(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=bA(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=bA(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return EA(h,t,e,h===`h`?s:c,!0)},[]),c=M.useCallback(function(e){var n=e;if(!(!NA.length||NA[NA.length-1]!==a)){var r=`deltaY`in n?OA(n):DA(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&AA(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(kA).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=M.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:FA(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=M.useCallback(function(e){n.current=DA(e),r.current=void 0},[]),d=M.useCallback(function(t){l(t.type,OA(t),t.target,s(t,e.lockRef.current))},[]),f=M.useCallback(function(t){l(t.type,DA(t),t.target,s(t,e.lockRef.current))},[]);M.useEffect(function(){return NA.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,hA),document.addEventListener(`touchmove`,c,hA),document.addEventListener(`touchstart`,u,hA),function(){NA=NA.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,hA),document.removeEventListener(`touchmove`,c,hA),document.removeEventListener(`touchstart`,u,hA)}},[]);var p=e.removeScrollBar,m=e.inert;return M.createElement(M.Fragment,null,m?M.createElement(a,{styles:jA(i)}):null,p?M.createElement(fA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function FA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var IA=Gk(Kk,PA),LA=M.forwardRef(function(e,t){return M.createElement(Jk,St({},e,{ref:t,sideCar:IA}))});LA.classNames=Jk.classNames;var RA=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},zA=new WeakMap,BA=new WeakMap,VA={},HA=0,UA=function(e){return e&&(e.host||UA(e.parentNode))},WA=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=UA(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},GA=function(e,t,n,r){var i=WA(t,Array.isArray(e)?e:[e]);VA[n]||(VA[n]=new WeakMap);var a=VA[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(zA.get(e)||0)+1,l=(a.get(e)||0)+1;zA.set(e,c),a.set(e,l),o.push(e),c===1&&i&&BA.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),HA++,function(){o.forEach(function(e){var t=zA.get(e)-1,i=a.get(e)-1;zA.set(e,t),a.set(e,i),t||(BA.has(e)||e.removeAttribute(r),BA.delete(e)),i||e.removeAttribute(n)}),HA--,HA||(zA=new WeakMap,zA=new WeakMap,BA=new WeakMap,VA={})}},KA=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||RA(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),GA(r,i,n,`aria-hidden`)):function(){return null}},qA=Object.defineProperty,JA=(e,t)=>qA(e,`name`,{value:t,configurable:!0}),YA=`Dialog`,[XA,ZA]=u(YA),[QA,$A]=XA(YA),ej=JA(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=M.useRef(null),c=M.useRef(null),[l,u]=E({prop:r,defaultProp:i??!1,onChange:a,caller:YA}),[d,f]=M.useState(0),[p,m]=M.useState(0);return(0,P.jsx)(QA,{scope:t,triggerRef:s,contentRef:c,contentId:S(),titleId:S(),descriptionId:S(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:M.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),tj=`DialogTrigger`,nj=M.forwardRef(JA(function(e,t){let{__scopeDialog:n,...r}=e,i=$A(tj,n),a=D(t,i.triggerRef);return(0,P.jsx)(O.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Sj(i.open),...r,ref:a,onClick:f(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),rj=`DialogPortal`,[ij,aj]=XA(rj,{forceMount:void 0}),oj=JA(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=$A(rj,t);return(0,P.jsx)(ij,{scope:t,forceMount:n,children:M.Children.map(r,e=>(0,P.jsx)(h,{present:n||a.open,children:(0,P.jsx)(x,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),sj=`DialogOverlay`,cj=M.forwardRef(JA(function(e,t){let n=aj(sj,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$A(sj,e.__scopeDialog);return a.modal?(0,P.jsx)(h,{present:r||a.open,children:(0,P.jsx)(uj,{...i,ref:t})}):null},`DialogOverlay`)),lj=d(`DialogOverlay.RemoveScroll`),uj=M.forwardRef(JA(function(e,t){let{__scopeDialog:n,...r}=e,i=$A(sj,n),a=p(),o=D(t,a);return(0,P.jsx)(LA,{as:lj,allowPinchZoom:!0,shards:[i.contentRef],children:(0,P.jsx)(O.div,{"data-state":Sj(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),dj=`DialogContent`,fj=M.forwardRef(JA(function(e,t){let n=aj(dj,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$A(dj,e.__scopeDialog);return(0,P.jsx)(h,{present:r||a.open,children:a.modal?(0,P.jsx)(pj,{...i,ref:t}):(0,P.jsx)(mj,{...i,ref:t})})},`DialogContent`)),pj=M.forwardRef(JA(function(e,t){let n=$A(dj,e.__scopeDialog),r=M.useRef(null),i=D(t,n.contentRef,r);return M.useEffect(()=>{let e=r.current;if(e)return KA(e)},[]),(0,P.jsx)(hj,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:f(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:f(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:f(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),mj=M.forwardRef(JA(function(e,t){let n=$A(dj,e.__scopeDialog),r=M.useRef(!1),i=M.useRef(!1);return(0,P.jsx)(hj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),hj=M.forwardRef(JA(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=$A(dj,n);return Ak(),(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(pk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,P.jsx)(v,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Sj(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),gj=`DialogTitle`,_j=M.forwardRef(JA(function(e,t){let{__scopeDialog:n,...r}=e,i=$A(gj,n),{setTitleCount:a}=i;return y(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,P.jsx)(O.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),vj=`DialogDescription`,yj=M.forwardRef(JA(function(e,t){let{__scopeDialog:n,...r}=e,i=$A(vj,n),{setDescriptionCount:a}=i;return y(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,P.jsx)(O.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),bj=`DialogClose`,xj=M.forwardRef(JA(function(e,t){let{__scopeDialog:n,...r}=e,i=$A(bj,n);return(0,P.jsx)(O.button,{type:`button`,...r,ref:t,onClick:f(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Sj(e){return e?`open`:`closed`}JA(Sj,`getState`);var Cj=ej,wj=nj,Tj=oj,Ej=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(cj,{ref:n,className:l(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));Ej.displayName=cj.displayName;var Dj=M.forwardRef(({className:e,children:t,...n},r)=>(0,P.jsxs)(Tj,{children:[(0,P.jsx)(Ej,{}),(0,P.jsxs)(fj,{ref:r,className:l(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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 sm:rounded-lg`,e),...n,children:[t,(0,P.jsxs)(xj,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background cursor-pointer transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,P.jsx)(_n,{className:`h-4 w-4`}),(0,P.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Dj.displayName=fj.displayName;var Oj=({className:e,...t})=>(0,P.jsx)(`div`,{className:l(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});Oj.displayName=`DialogHeader`;var kj=({className:e,...t})=>(0,P.jsx)(`div`,{className:l(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});kj.displayName=`DialogFooter`;var Aj=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(_j,{ref:n,className:l(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Aj.displayName=_j.displayName;var jj=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(yj,{ref:n,className:l(`text-sm text-muted-foreground`,e),...t}));jj.displayName=yj.displayName;var Mj=Object.defineProperty,Q=(e,t)=>Mj(e,`name`,{value:t,configurable:!0});function Nj(e){let t=e+`CollectionProvider`,[n,r]=u(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Q(e=>{let{scope:t,children:n}=e,r=M.useRef(null),a=M.useRef(new Map).current;return(0,P.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=d(s),l=M.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=D(t,i.collectionRef);return(0,P.jsx)(c,{ref:o,children:r})});l.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=d(f),h=M.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=M.useRef(null),s=D(t,o),c=a(f,n);return M.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,P.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return M.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Q(g,`useCollection`),[{Provider:o,Slot:l,ItemSlot:h},g,r]}Q(Nj,`createCollection`);var Pj=new WeakMap,Fj=class e extends Map{static{Q(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Pj.set(this,!0)}set(e,t){return Pj.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Rj(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Ij(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Ij(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Ij(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Ij(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Lj(e,t);return n===-1?void 0:e[n]}Q(Ij,`at`);function Lj(e,t){let n=e.length,r=Rj(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Q(Lj,`toSafeIndex`);function Rj(e){return e!==e||e===0?0:Math.trunc(e)}Q(Rj,`toSafeInteger`);function zj(e){let t=e+`CollectionProvider`,[n,r]=u(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Fj,setItemMap:Q(()=>void 0,`setItemMap`)}),o=Q(({state:e,...t})=>e?(0,P.jsx)(c,{...t,state:e}):(0,P.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Q(e=>{let t=_();return(0,P.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Q(e=>{let{scope:t,children:n,state:r}=e,a=M.useRef(null),[o,s]=M.useState(null),c=D(a,s),[l,u]=r;return M.useEffect(()=>{if(!o)return;let e=Uj(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,P.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,f=d(l),p=M.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(l,n),o=D(t,i.collectionRef);return(0,P.jsx)(f,{ref:o,children:r})});p.displayName=l;let m=e+`CollectionItemSlot`,h=d(m),g=M.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=M.useRef(null),[s,c]=M.useState(null),l=D(t,o,c),{setItemMap:u}=a(m,n),d=M.useRef(i);Bj(d.current,i)||(d.current=i);let f=d.current;return M.useEffect(()=>{let e=f;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Hj):(t.set(s,{...e,element:s}),t.toSorted(Hj)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Fj(e)))}},[s,f,u]),(0,P.jsx)(h,{"data-radix-collection-item":``,ref:l,children:r})});g.displayName=m;function _(){return M.useState(new Fj)}Q(_,`useInitCollection`);function v(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Q(v,`useCollection`),[{Provider:o,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:v,useInitCollection:_}]}Q(zj,`createCollection`);function Bj(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Q(Bj,`shallowEqual`);function Vj(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Q(Vj,`isElementPreceding`);function Hj(e,t){return!e[1].element||!t[1].element?0:Vj(e[1].element,t[1].element)?-1:1}Q(Hj,`sortByDocumentPosition`);function Uj(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Q(Uj,`getChildListObserver`);var Wj=Object.defineProperty,Gj=(e,t)=>Wj(e,`name`,{value:t,configurable:!0}),Kj=M.createContext(void 0);function qj(e){let t=M.useContext(Kj);return e||t||`ltr`}Gj(qj,`useDirection`);var Jj=Object.defineProperty,Yj=(e,t)=>Jj(e,`name`,{value:t,configurable:!0}),Xj=!1;function Zj(){let[e,t]=M.useState(Xj);return M.useEffect(()=>{Xj||(Xj=!0,t(!0))},[]),e}Yj(Zj,`useIsHydrated`);var Qj=M.useSyncExternalStore;function $j(){return()=>{}}Yj($j,`subscribe`);function eM(){return Qj($j,()=>!0,()=>!1)}Yj(eM,`useIsHydratedModern`);var tM=typeof Qj==`function`?eM:Zj,nM=Object.defineProperty,rM=(e,t)=>nM(e,`name`,{value:t,configurable:!0}),iM=`rovingFocusGroup.onEntryFocus`,aM={bubbles:!1,cancelable:!0},oM=`RovingFocusGroup`,[sM,cM,lM]=Nj(oM),[uM,dM]=u(oM,[lM]),[fM,pM]=uM(oM),mM=M.forwardRef(rM(function(e,t){return(0,P.jsx)(sM.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,P.jsx)(sM.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,P.jsx)(hM,{...e,ref:t})})})},`RovingFocusGroup`)),hM=M.forwardRef(rM(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,p=M.useRef(null),m=D(t,p),h=qj(a),[g,_]=E({prop:o,defaultProp:s??null,onChange:c,caller:oM}),[v,y]=M.useState(!1),b=ne(l),x=cM(n),S=M.useRef(!1),[C,w]=M.useState(0);return M.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(iM,b),()=>e.removeEventListener(iM,b)},[b]),(0,P.jsx)(fM,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:M.useCallback(e=>_(e),[_]),onItemShiftTab:M.useCallback(()=>y(!0),[]),onFocusableItemAdd:M.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:M.useCallback(()=>w(e=>e-1),[]),children:(0,P.jsx)(O.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:`none`,...e.style},onMouseDown:f(e.onMouseDown,()=>{S.current=!0}),onFocus:f(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(iM,aM);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);xM([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:f(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),gM=`RovingFocusGroupItem`,_M=M.forwardRef(rM(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=S(),l=a||c,u=pM(gM,n),d=u.currentTabStopId===l,p=cM(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=u,_=tM();return y(()=>{if(!(!_||!r))return m(),()=>h()},[_,r,m,h]),M.useEffect(()=>{if(!(_||!r))return m(),()=>h()},[_,r,m,h]),(0,P.jsx)(sM.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,P.jsx)(O.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:f(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:f(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:f(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=bM(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?SM(n,r+1):n.slice(r+1)}setTimeout(()=>xM(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),vM={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function yM(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}rM(yM,`getDirectionAwareKey`);function bM(e,t,n){let r=yM(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return vM[r]}rM(bM,`getFocusIntent`);function xM(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}rM(xM,`focusFirst`);function SM(e,t){return e.map((n,r)=>e[(t+r)%e.length])}rM(SM,`wrapArray`);var CM=mM,wM=_M,TM=Object.defineProperty,$=(e,t)=>TM(e,`name`,{value:t,configurable:!0}),EM=[`Enter`,` `],DM=[`ArrowDown`,`PageUp`,`Home`],OM=[`ArrowUp`,`PageDown`,`End`],kM=[...DM,...OM],AM={ltr:[...EM,`ArrowRight`],rtl:[...EM,`ArrowLeft`]},jM={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},MM=`Menu`,[NM,PM,FM]=Nj(MM),[IM,LM]=u(MM,[FM,T,dM]),RM=T(),zM=dM(),[BM,VM]=IM(MM),[HM,UM]=IM(MM),WM=$(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=RM(t),[c,l]=M.useState(null),u=M.useRef(!1),d=ne(a),f=qj(i);return M.useEffect(()=>{let e=$(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=$(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),M.useEffect(()=>{if(!n)return;let e=$(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,P.jsx)(_,{...s,children:(0,P.jsx)(BM,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,P.jsx)(HM,{scope:t,onClose:M.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),GM=M.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e,i=RM(n);return(0,P.jsx)(te,{...i,...r,ref:t})},`MenuAnchor`)),KM=`MenuPortal`,[qM,JM]=IM(KM,{forceMount:void 0}),YM=$(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=VM(KM,t);return(0,P.jsx)(qM,{scope:t,forceMount:n,children:(0,P.jsx)(h,{present:n||a.open,children:(0,P.jsx)(x,{asChild:!0,container:i,children:r})})})},`MenuPortal`),XM=`MenuContent`,[ZM,QM]=IM(XM),$M=M.forwardRef($(function(e,t){let n=JM(XM,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=VM(XM,e.__scopeMenu),o=UM(XM,e.__scopeMenu);return(0,P.jsx)(NM.Provider,{scope:e.__scopeMenu,children:(0,P.jsx)(h,{present:r||a.open,children:(0,P.jsx)(NM.Slot,{scope:e.__scopeMenu,children:o.modal?(0,P.jsx)(eN,{...i,ref:t}):(0,P.jsx)(tN,{...i,ref:t})})})})},`MenuContent`)),eN=M.forwardRef($(function(e,t){let n=VM(XM,e.__scopeMenu),r=M.useRef(null),i=D(t,r);return M.useEffect(()=>{let e=r.current;if(e)return KA(e)},[]),(0,P.jsx)(rN,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:f(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),tN=M.forwardRef($(function(e,t){let n=VM(XM,e.__scopeMenu);return(0,P.jsx)(rN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),nN=d(`MenuContent.ScrollLock`),rN=M.forwardRef($(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:h,..._}=e,y=VM(XM,n),b=UM(XM,n),x=RM(n),S=zM(n),C=PM(n),[w,T]=M.useState(null),ee=M.useRef(null),E=D(t,ee,y.onContentChange),te=M.useRef(0),ne=M.useRef(``),re=M.useRef(0),O=M.useRef(null),k=M.useRef(`right`),ie=M.useRef(0),A=h?LA:M.Fragment,ae=h?{as:nN,allowPinchZoom:!0}:void 0,j=$(e=>{let t=ne.current+e,n=C().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=AN(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;$((function e(t){ne.current=t,window.clearTimeout(te.current),t!==``&&(te.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);M.useEffect(()=>()=>window.clearTimeout(te.current),[]),Ak();let oe=M.useCallback(e=>k.current===O.current?.side&&MN(e,O.current?.area),[]);return(0,P.jsx)(ZM,{scope:n,searchRef:ne,onItemEnter:M.useCallback(e=>{oe(e)&&e.preventDefault()},[oe]),onItemLeave:M.useCallback(e=>{oe(e)||(ee.current?.focus(),T(null))},[oe]),onTriggerLeave:M.useCallback(e=>{oe(e)&&e.preventDefault()},[oe]),pointerGraceTimerRef:re,onPointerGraceIntentChange:M.useCallback(e=>{O.current=e},[]),children:(0,P.jsx)(A,{...ae,children:(0,P.jsx)(pk,{asChild:!0,trapped:i,onMountAutoFocus:f(a,e=>{e.preventDefault(),ee.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,P.jsx)(v,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:(0,P.jsx)(CM,{asChild:!0,...S,dir:b.dir,orientation:`vertical`,loop:r,currentTabStopId:w,onCurrentTabStopIdChange:T,onEntryFocus:f(c,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,P.jsx)(g,{role:`menu`,"aria-orientation":`vertical`,"data-state":TN(y.open),"data-radix-menu-content":``,dir:b.dir,...x,..._,ref:E,style:{outline:`none`,..._.style},onKeyDown:f(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&j(e.key));let i=ee.current;if(e.target!==i||!kM.includes(e.key))return;e.preventDefault();let a=C().filter(e=>!e.disabled).map(e=>e.ref.current);OM.includes(e.key)&&a.reverse(),ON(a)}),onBlur:f(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(te.current),ne.current=``)}),onPointerMove:f(e.onPointerMove,NN(e=>{let t=e.target,n=ie.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>ie.current?`right`:`left`;k.current=t,ie.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),iN=M.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e;return(0,P.jsx)(O.div,{...r,ref:t})},`MenuLabel`)),aN=`MenuItem`,oN=`menu.itemSelect`,sN=M.forwardRef($(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=M.useRef(null),o=UM(aN,e.__scopeMenu),s=QM(aN,e.__scopeMenu),c=D(t,a),l=M.useRef(!1),u=$(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(oN,{bubbles:!0,cancelable:!0});e.addEventListener(oN,e=>r?.(e),{once:!0}),m(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,P.jsx)(cN,{...i,ref:c,disabled:n,onClick:f(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:f(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:f(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&EM.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),cN=M.forwardRef($(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=QM(aN,n),s=zM(n),c=M.useRef(null),l=D(t,c),[u,d]=M.useState(!1),[p,m]=M.useState(``);return M.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,P.jsx)(NM.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,P.jsx)(wM,{asChild:!0,...s,focusable:!r,children:(0,P.jsx)(O.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:f(e.onPointerMove,NN(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:f(e.onPointerLeave,NN(e=>o.onItemLeave(e))),onFocus:f(e.onFocus,()=>d(!0)),onBlur:f(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),lN=M.forwardRef($(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,P.jsx)(hN,{scope:e.__scopeMenu,checked:n,children:(0,P.jsx)(sN,{role:`menuitemcheckbox`,"aria-checked":EN(n)?`mixed`:n,...i,ref:t,"data-state":DN(n),onSelect:f(i.onSelect,()=>r?.(EN(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[uN,dN]=IM(`MenuRadioGroup`,{value:void 0,onValueChange:$(()=>{},`onValueChange`)}),fN=`MenuRadioItem`,pN=M.forwardRef($(function(e,t){let{value:n,...r}=e,i=dN(fN,e.__scopeMenu),a=n===i.value;return(0,P.jsx)(hN,{scope:e.__scopeMenu,checked:a,children:(0,P.jsx)(sN,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":DN(a),onSelect:f(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),mN=`MenuItemIndicator`,[hN,gN]=IM(mN,{checked:!1}),_N=M.forwardRef($(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=gN(mN,n);return(0,P.jsx)(h,{present:r||EN(a.checked)||a.checked===!0,children:(0,P.jsx)(O.span,{...i,ref:t,"data-state":DN(a.checked)})})},`MenuItemIndicator`)),vN=M.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e;return(0,P.jsx)(O.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[yN,bN]=IM(`MenuSub`),xN=`MenuSubTrigger`,SN=M.forwardRef($(function(e,t){let n=VM(xN,e.__scopeMenu),r=UM(xN,e.__scopeMenu),i=bN(xN,e.__scopeMenu),a=QM(xN,e.__scopeMenu),o=M.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=M.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);M.useEffect(()=>u,[u]),M.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=D(t,i.onTriggerChange);return(0,P.jsx)(GM,{asChild:!0,...l,children:(0,P.jsx)(cN,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":TN(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:f(e.onPointerMove,NN(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:f(e.onPointerLeave,NN(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:f(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(a.searchRef.current===``||t.key!==` `)&&AM[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),CN=`MenuSubContent`,wN=M.forwardRef($(function(e,t){let n=JM(XM,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=VM(XM,e.__scopeMenu),s=UM(XM,e.__scopeMenu),c=bN(CN,e.__scopeMenu),l=M.useRef(null),u=D(t,l);return(0,P.jsx)(NM.Provider,{scope:e.__scopeMenu,children:(0,P.jsx)(h,{present:r||o.open,children:(0,P.jsx)(NM.Slot,{scope:e.__scopeMenu,children:(0,P.jsx)(rN,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:f(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:f(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:f(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=jM[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function TN(e){return e?`open`:`closed`}$(TN,`getOpenState`);function EN(e){return e===`indeterminate`}$(EN,`isIndeterminate`);function DN(e){return EN(e)?`indeterminate`:e?`checked`:`unchecked`}$(DN,`getCheckedState`);function ON(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}$(ON,`focusFirst`);function kN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}$(kN,`wrapArray`);function AN(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=kN(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}$(AN,`getNextMatch`);function jN(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}$(jN,`isPointInPolygon`);function MN(e,t){return t?jN({x:e.clientX,y:e.clientY},t):!1}$(MN,`isPointerInGraceArea`);function NN(e){return t=>t.pointerType===`mouse`?e(t):void 0}$(NN,`whenMouse`);var PN=WM,FN=GM,IN=YM,LN=$M,RN=iN,zN=sN,BN=lN,VN=pN,HN=_N,UN=vN,WN=SN,GN=wN,KN=Object.defineProperty,qN=(e,t)=>KN(e,`name`,{value:t,configurable:!0}),JN=`DropdownMenu`,[YN,XN]=u(JN,[LM]),ZN=LM(),[QN,$N]=YN(JN),eP=qN(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=ZN(t),l=M.useRef(null),[u,d]=E({prop:i,defaultProp:a??!1,onChange:o,caller:JN});return(0,P.jsx)(QN,{scope:t,triggerId:S(),triggerRef:l,contentId:S(),open:u,onOpenChange:d,onOpenToggle:M.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,P.jsx)(PN,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),tP=`DropdownMenuTrigger`,nP=M.forwardRef(qN(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=$N(tP,n),o=ZN(n),s=D(t,a.triggerRef);return(0,P.jsx)(FN,{asChild:!0,...o,children:(0,P.jsx)(O.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:f(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:f(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),rP=qN(e=>{let{__scopeDropdownMenu:t,...n}=e,r=ZN(t);return(0,P.jsx)(IN,{...r,...n})},`DropdownMenuPortal`),iP=`DropdownMenuContent`,aP=M.forwardRef(qN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=$N(iP,n),a=ZN(n),o=M.useRef(!1);return(0,P.jsx)(LN,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:f(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:f(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.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)`}})},`DropdownMenuContent`)),oP=M.forwardRef(qN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ZN(n);return(0,P.jsx)(RN,{...i,...r,ref:t})},`DropdownMenuLabel`)),sP=M.forwardRef(qN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ZN(n);return(0,P.jsx)(zN,{...i,...r,ref:t})},`DropdownMenuItem`)),cP=M.forwardRef(qN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ZN(n);return(0,P.jsx)(BN,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),lP=M.forwardRef(qN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ZN(n);return(0,P.jsx)(VN,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),uP=M.forwardRef(qN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ZN(n);return(0,P.jsx)(HN,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),dP=M.forwardRef(qN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ZN(n);return(0,P.jsx)(UN,{...i,...r,ref:t})},`DropdownMenuSeparator`)),fP=M.forwardRef(qN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ZN(n);return(0,P.jsx)(WN,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),pP=M.forwardRef(qN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ZN(n);return(0,P.jsx)(GN,{...i,...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)`}})},`DropdownMenuSubContent`)),mP=eP,hP=nP,gP=rP,_P=aP,vP=oP,yP=sP,bP=cP,xP=lP,SP=uP,CP=dP,wP=fP,TP=pP,EP=mP,DP=hP,OP=M.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,P.jsxs)(wP,{ref:i,className:l(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,P.jsx)(Vt,{className:`ml-auto`})]}));OP.displayName=wP.displayName;var kP=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(TP,{ref:n,className:l(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...t}));kP.displayName=TP.displayName;var AP=M.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,P.jsx)(gP,{children:(0,P.jsx)(_P,{ref:r,sideOffset:t,className:l(`z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md`,`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 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...n})}));AP.displayName=_P.displayName;var jP=M.forwardRef(({className:e,inset:t,...n},r)=>(0,P.jsx)(yP,{ref:r,className:l(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0`,t&&`pl-8`,e),...n}));jP.displayName=yP.displayName;var MP=M.forwardRef(({className:e,children:t,...n},r)=>(0,P.jsxs)(bP,{ref:r,className:l(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,P.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,P.jsx)(SP,{children:(0,P.jsx)(zt,{className:`h-4 w-4`})})}),t]}));MP.displayName=bP.displayName;var NP=M.forwardRef(({className:e,children:t,...n},r)=>(0,P.jsxs)(xP,{ref:r,className:l(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,P.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,P.jsx)(SP,{children:(0,P.jsx)(Ut,{className:`h-2 w-2 fill-current`})})}),t]}));NP.displayName=xP.displayName;var PP=M.forwardRef(({className:e,inset:t,...n},r)=>(0,P.jsx)(vP,{ref:r,className:l(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));PP.displayName=vP.displayName;var FP=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(CP,{ref:n,className:l(`-mx-1 my-1 h-px bg-muted`,e),...t}));FP.displayName=CP.displayName;var IP=M.forwardRef(({className:e,type:t,...n},r)=>(0,P.jsx)(`input`,{type:t,className:l(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:r,...n}));IP.displayName=`Input`;var LP=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(`textarea`,{className:l(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));LP.displayName=`Textarea`;function RP({className:e,...t}){return(0,P.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:l(`group/input-group border-input dark:bg-input/30 shadow-xs relative flex w-full items-center rounded-md border outline-none transition-[color,box-shadow]`,`h-9 has-[>textarea]:h-auto`,`has-[>[data-align=inline-start]]:[&>input]:pl-2`,`has-[>[data-align=inline-end]]:[&>input]:pr-2`,`has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3`,`has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3`,`has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot=input-group-control]:focus-visible]:ring-1`,`has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40`,e),...t})}var zP=bn(`text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]`,"inline-end":`order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]`,"block-start":`[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5`,"block-end":`[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5`}},defaultVariants:{align:`inline-start`}});function BP({className:e,align:t=`inline-start`,...n}){return(0,P.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:l(zP({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var VP=bn(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5`,sm:`h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5`,"icon-xs":`size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function HP({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,P.jsx)(Sn,{type:t,"data-size":r,variant:n,className:l(VP({size:r}),e),...i})}function UP({className:e,...t}){return(0,P.jsx)(LP,{"data-slot":`input-group-control`,className:l(`flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent`,e),...t})}function WP({className:e,...t}){return(0,P.jsx)(Xt,{role:`status`,"aria-label":`Loading`,className:l(`size-4 animate-spin`,e),...t})}var GP=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,KP=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=GP[n[e]&63];return t},qP=async e=>{try{let t=await(await fetch(e)).blob();return new Promise(e=>{let n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>e(null),n.readAsDataURL(t)})}catch{return null}},JP=(0,M.createContext)(null),YP=(0,M.createContext)(null),XP=()=>(0,M.useContext)(JP),ZP=()=>(0,M.useContext)(YP),QP=(0,M.createContext)(null),$P=()=>{let e=ZP(),t=(0,M.useContext)(QP)??e;if(!t)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return t},eF=(0,M.createContext)(null),tF=({className:e,inputGroupClassName:t,accept:n,multiple:r,globalDrop:i,syncHiddenInput:a,maxFiles:o,maxFileSize:s,onError:c,onSubmit:u,children:d,...f})=>{let p=XP(),m=!!p,h=(0,M.useRef)(null),g=(0,M.useRef)(null),[_,v]=(0,M.useState)([]),y=m?p.attachments.files:_,[b,x]=(0,M.useState)([]),S=(0,M.useRef)(y);(0,M.useEffect)(()=>{S.current=y},[y]);let C=(0,M.useCallback)(()=>{h.current?.click()},[]),w=(0,M.useCallback)(e=>!n||n.trim()===``||n.split(`,`).map(e=>e.trim()).filter(Boolean).some(t=>{if(t.endsWith(`/*`)){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t}),[n]),T=(0,M.useCallback)(e=>{let t=[...e],n=t.filter(e=>w(e));if(t.length&&n.length===0){c?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!s||e.size<=s);if(n.length>0&&r.length===0){c?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}v(e=>{let t=typeof o==`number`?Math.max(0,o-e.length):void 0,n=typeof t==`number`?r.slice(0,t):r;typeof t==`number`&&r.length>t&&c?.({code:`max_files`,message:`Too many files. Some were not added.`});let i=[];for(let e of n)i.push({filename:e.name,id:KP(),mediaType:e.type,type:`file`,url:URL.createObjectURL(e)});return[...e,...i]})},[w,o,s,c]),ee=(0,M.useCallback)(e=>v(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),[]),E=(0,M.useCallback)(e=>{let t=[...e],n=t.filter(e=>w(e));if(t.length&&n.length===0){c?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!s||e.size<=s);if(n.length>0&&r.length===0){c?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}let i=y.length,a=typeof o==`number`?Math.max(0,o-i):void 0,l=typeof a==`number`?r.slice(0,a):r;typeof a==`number`&&r.length>a&&c?.({code:`max_files`,message:`Too many files. Some were not added.`}),l.length>0&&p?.attachments.add(l)},[w,s,o,c,y.length,p]),te=(0,M.useCallback)(()=>m?p?.attachments.clear():v(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[m,p]),ne=(0,M.useCallback)(()=>x([]),[]),D=m?E:T,re=m?p.attachments.remove:ee,O=m?p.attachments.openFileDialog:C,k=(0,M.useCallback)(()=>{te(),ne()},[te,ne]);(0,M.useEffect)(()=>{m&&p.__registerFileInput(h,()=>h.current?.click())},[m,p]),(0,M.useEffect)(()=>{a&&h.current&&y.length===0&&(h.current.value=``)},[y,a]),(0,M.useEffect)(()=>{let e=g.current;if(!e||i)return;let t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},n=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[D,i]),(0,M.useEffect)(()=>{if(!i)return;let e=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[D,i]),(0,M.useEffect)(()=>()=>{if(!m)for(let e of S.current)e.url&&URL.revokeObjectURL(e.url)},[m]);let ie=(0,M.useCallback)(e=>{e.currentTarget.files&&D(e.currentTarget.files),e.currentTarget.value=``},[D]),A=(0,M.useMemo)(()=>({add:D,clear:te,fileInputRef:h,files:y.map(e=>({...e,id:e.id})),openFileDialog:O,remove:re}),[y,D,re,te,O]),ae=(0,M.useMemo)(()=>({add:e=>{let t=Array.isArray(e)?e:[e];x(e=>[...e,...t.map(e=>({...e,id:KP()}))])},clear:ne,remove:e=>{x(t=>t.filter(t=>t.id!==e))},sources:b}),[b,ne]),j=(0,M.useCallback)(async e=>{e.preventDefault();let t=e.currentTarget,n=m?p.textInput.value:new FormData(t).get(`message`)||``;m||t.reset();try{let t=u({files:await Promise.all(y.map(async({id:e,...t})=>{if(t.url?.startsWith(`blob:`)){let e=await qP(t.url);return{...t,url:e??t.url}}return t})),text:n},e);if(t instanceof Promise)try{await t,k(),m&&p.textInput.clear()}catch{}else k(),m&&p.textInput.clear()}catch{}},[m,p,y,u,k]),oe=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`input`,{accept:n,"aria-label":`Upload files`,className:`hidden`,multiple:r,onChange:ie,ref:h,title:`Upload files`,type:`file`}),(0,P.jsx)(`form`,{className:l(`w-full`,e),onSubmit:j,ref:g,...f,children:(0,P.jsx)(RP,{className:l(`overflow-hidden`,t),children:d})})]}),se=(0,P.jsx)(eF.Provider,{value:ae,children:oe});return(0,P.jsx)(QP.Provider,{value:A,children:se})},nF=({onChange:e,onKeyDown:t,className:n,placeholder:r=`What would you like to know?`,...i})=>{let a=XP(),o=$P(),[s,c]=(0,M.useState)(!1),u=(0,M.useCallback)(e=>{if(t?.(e),!e.defaultPrevented){if(e.key===`Enter`){if(s||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let{form:t}=e.currentTarget;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}if(e.key===`Backspace`&&e.currentTarget.value===``&&o.files.length>0){e.preventDefault();let t=o.files.at(-1);t&&o.remove(t.id)}}},[t,s,o]),d=(0,M.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t)if(e.kind===`file`){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),o.add(n))},[o]),f=(0,M.useCallback)(()=>c(!1),[]),p=(0,M.useCallback)(()=>c(!0),[]),m=a?{onChange:t=>{a.textInput.setInput(t.currentTarget.value),e?.(t)},value:a.textInput.value}:{onChange:e};return(0,P.jsx)(UP,{className:l(`field-sizing-content max-h-48 min-h-16`,n),name:`message`,onCompositionEnd:f,onCompositionStart:p,onKeyDown:u,onPaste:d,placeholder:r,...i,...m})},rF=({className:e,...t})=>(0,P.jsx)(BP,{align:`block-end`,className:l(`order-first flex-wrap gap-1`,e),...t}),iF=({className:e,...t})=>(0,P.jsx)(BP,{align:`block-end`,className:l(`justify-between gap-1`,e),...t}),aF=({className:e,...t})=>(0,P.jsx)(`div`,{className:l(`flex min-w-0 items-center gap-1`,e),...t}),oF=({variant:e=`ghost`,className:t,size:n,tooltip:r,...i})=>{let a=n??(M.Children.count(i.children)>1?`sm`:`icon-sm`),o=(0,P.jsx)(HP,{className:l(t),size:a,type:`button`,variant:e,...i});if(!r)return o;let s=typeof r==`string`?r:r.content,c=typeof r==`string`?void 0:r.shortcut,u=typeof r==`string`?`top`:r.side??`top`;return(0,P.jsxs)(ee,{children:[(0,P.jsx)(w,{asChild:!0,children:o}),(0,P.jsxs)(b,{side:u,children:[s,c&&(0,P.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:c})]})]})},sF=({className:e,variant:t=`default`,size:n=`icon-sm`,status:r,onStop:i,onClick:a,children:o,...s})=>{let c=r===`submitted`||r===`streaming`,u=(0,P.jsx)(Gt,{className:`size-4`});r===`submitted`?u=(0,P.jsx)(WP,{}):r===`streaming`?u=(0,P.jsx)(fn,{className:`size-4`}):r===`error`&&(u=(0,P.jsx)(_n,{className:`size-4`}));let d=(0,M.useCallback)(e=>{if(c&&i){e.preventDefault(),i();return}a?.(e)},[c,i,a]);return(0,P.jsx)(HP,{"aria-label":c?`Stop`:`Submit`,className:l(e),onClick:d,size:n,type:c&&i?`button`:`submit`,variant:t,...s,children:o??u})};function cF(e){let t=e.lastIndexOf(`.`);return t>-1&&t<e.length-1?e.slice(t+1).toUpperCase():`ARCHIVO`}function lF(e){return!Number.isFinite(e)||e<0?`0:00`:`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}function uF(e){let t=e.match(/nota-de-voz-(\d+)/i);if(!t)return e;let n=new Date(Number(t[1]));return Number.isNaN(n.getTime())?e:`Nota de voz ${`${n.getDate()}/${n.getMonth()+1}/${n.getFullYear()}`} - ${new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,minute:`2-digit`,hour12:!0}).format(n)}`}function dF({filename:e,onRemove:t}){return(0,P.jsx)(`button`,{type:`button`,"aria-label":`Quitar ${e}`,onClick:t,className:`absolute right-2 top-2 z-10 grid size-7 place-items-center rounded-full border border-border/80 bg-card/95 text-muted-foreground shadow-sm transition-colors hover:bg-card hover:text-foreground`,children:(0,P.jsx)(_n,{className:`size-3.5`})})}function fF({src:e}){let t=(0,M.useRef)(null),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(0),[o,s]=(0,M.useState)(0);(0,M.useEffect)(()=>{r(!1),a(0),s(0)},[e]);let c=(0,M.useCallback)(()=>{let e=t.current;if(e){if(Number.isFinite(e.duration)&&e.duration>0){s(e.duration);return}if(e.seekable.length>0){let t=e.seekable.end(e.seekable.length-1);Number.isFinite(t)&&t>0&&s(t)}}},[]),l=(0,M.useCallback)(async()=>{let e=t.current;if(e){if(e.paused)try{await e.play()}catch{r(!1)}else e.pause()}},[]),u=(0,M.useCallback)(e=>{let n=t.current;n&&(n.currentTime=e,a(e))},[]);return(0,P.jsxs)(`div`,{className:`flex w-full items-center gap-2.5`,children:[(0,P.jsx)(`audio`,{ref:t,src:e,preload:`metadata`,onLoadedMetadata:c,onLoadedData:c,onCanPlay:c,onDurationChange:c,onProgress:c,onTimeUpdate:e=>a(e.currentTarget.currentTime),onPlay:()=>r(!0),onPause:()=>r(!1),onEnded:()=>r(!1)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>void l(),"aria-label":n?`Pausar nota de voz`:`Reproducir nota de voz`,className:`grid size-9 shrink-0 place-items-center rounded-full bg-primary text-primary-foreground transition-transform hover:scale-[1.03]`,children:n?(0,P.jsx)(an,{className:`size-4`}):(0,P.jsx)(sn,{className:`ml-0.5 size-4`})}),(0,P.jsx)(`span`,{className:`w-9 shrink-0 text-right text-[0.68rem] tabular-nums text-foreground`,children:lF(i)}),(0,P.jsx)(`input`,{type:`range`,min:0,max:o||0,step:.05,value:Math.min(i,o||0),disabled:!o,onChange:e=>u(Number(e.currentTarget.value)),"aria-label":`Posición de la nota de voz`,className:`voice-note-range min-w-0 flex-1 disabled:cursor-default disabled:opacity-50`}),(0,P.jsx)(`span`,{className:`w-9 shrink-0 text-[0.68rem] tabular-nums text-muted-foreground`,children:lF(o)})]})}function pF({file:e,onRemove:t,compact:n=!1}){let r=e.filename?.trim()||`archivo`,i=e.mediaType||`application/octet-stream`,a=e.url||``,o=i.startsWith(`image/`),s=i.startsWith(`video/`),c=i.startsWith(`audio/`),u=cF(r);if(o)return(0,P.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:l(`group relative overflow-hidden rounded-xl border border-border bg-card shadow-sm`,n?`w-[8.75rem] sm:w-[9.5rem]`:`w-full max-w-[18rem]`),children:[t?(0,P.jsx)(dF,{filename:r,onRemove:t}):null,(0,P.jsxs)(`a`,{href:a,target:`_blank`,rel:`noreferrer`,className:`block`,title:r,children:[(0,P.jsx)(`img`,{src:a,alt:r,className:l(`w-full bg-secondary object-cover transition-transform duration-200 group-hover:scale-[1.015]`,n?`h-20`:`max-h-56 min-h-28`)}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-2.5 py-2`,children:[(0,P.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-lg bg-brand-soft text-primary`,children:(0,P.jsx)(Yt,{className:`size-3.5`})}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`truncate text-xs font-bold text-foreground`,children:r}),(0,P.jsxs)(`p`,{className:`text-[0.65rem] text-muted-foreground`,children:[`Imagen · `,u]})]})]})]})]});if(s)return(0,P.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:l(`relative overflow-hidden rounded-xl border border-border bg-card shadow-sm`,n?`w-[12rem] sm:w-[13rem]`:`w-full max-w-[21rem]`),children:[t?(0,P.jsx)(dF,{filename:r,onRemove:t}):null,(0,P.jsx)(`video`,{src:a,controls:!0,preload:`metadata`,className:l(`w-full bg-black object-contain`,n?`h-20`:`max-h-64`),children:`Tu navegador no puede reproducir este video.`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-2.5 py-2`,children:[(0,P.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-lg bg-brand-soft text-primary`,children:(0,P.jsx)(Yt,{className:`size-3.5`})}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`truncate text-xs font-bold text-foreground`,children:r}),(0,P.jsxs)(`p`,{className:`text-[0.65rem] text-muted-foreground`,children:[`Video · `,u]})]})]})]});if(c){let e=uF(r);return(0,P.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:l(`relative rounded-xl border border-border bg-card p-3 shadow-sm`,n?`w-[20rem] max-w-[82vw]`:`w-full max-w-[34rem]`,t&&`pr-11`),children:[t?(0,P.jsx)(dF,{filename:r,onRemove:t}):null,(0,P.jsxs)(`div`,{className:l(`flex min-w-0 items-center`,n?`gap-2`:`gap-3`),children:[(0,P.jsx)(`span`,{className:l(`grid shrink-0 place-items-center rounded-xl bg-brand-soft text-primary`,n?`size-8`:`size-10`),children:(0,P.jsx)(tn,{className:`size-4`})}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`p`,{className:`text-xs font-bold leading-snug text-foreground`,children:e}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-[0.65rem] text-muted-foreground`,children:[`Audio · `,u]})]})]}),(0,P.jsx)(`div`,{className:l(`w-full`,n?`mt-2`:`mt-3`),children:(0,P.jsx)(fF,{src:a})})]})}return(0,P.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:l(`relative flex items-center gap-3 rounded-xl border border-border bg-card p-3 shadow-sm`,n?`w-[16rem] max-w-[78vw]`:`w-full max-w-[20rem]`,t&&`pr-11`),children:[t?(0,P.jsx)(dF,{filename:r,onRemove:t}):null,(0,P.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-xl bg-secondary text-primary`,children:(0,P.jsx)(Jt,{className:`size-4`})}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`p`,{className:`truncate text-xs font-bold text-foreground`,title:r,children:r}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-[0.65rem] text-muted-foreground`,children:[`Archivo · `,u]})]}),a?(0,P.jsx)(`a`,{href:a,target:`_blank`,rel:`noreferrer`,className:`shrink-0 rounded-lg border border-border bg-background px-2.5 py-1.5 text-[0.68rem] font-bold text-primary transition-colors hover:bg-secondary`,children:`Abrir`}):null]})}function mF(){let e=$P();return e.files.length===0?null:(0,P.jsx)(`div`,{className:`min-w-0 w-full`,children:(0,P.jsx)(`div`,{className:`scrollbar-slim flex min-w-0 max-w-full snap-x snap-proximity flex-nowrap items-stretch gap-2.5 overflow-x-auto overflow-y-hidden overscroll-x-contain pb-1.5 pr-1`,"aria-label":`Archivos adjuntos`,children:e.files.map(t=>(0,P.jsx)(`div`,{className:`shrink-0 snap-start`,children:(0,P.jsx)(pF,{file:t,compact:!0,onRemove:()=>e.remove(t.id)})},t.id))})})}function hF(){let e=$P();return(0,P.jsx)(oF,{type:`button`,onClick:e.openFileDialog,"aria-label":`Adjuntar archivo`,tooltip:`Adjuntar archivo`,children:(0,P.jsx)(rn,{className:`size-4`})})}function gF(e){return`${Math.floor(e/60)}:${(e%60).toString().padStart(2,`0`)}`}function _F(){let e=$P(),t=(0,M.useRef)(null),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(0);(0,M.useEffect)(()=>{if(!n)return;let e=window.setInterval(()=>a(e=>e+1),1e3);return()=>window.clearInterval(e)},[n]);let o=(0,M.useCallback)(()=>{t.current?.stop(),t.current=null,r(!1)},[]),s=(0,M.useCallback)(async()=>{try{let n=await navigator.mediaDevices.getUserMedia({audio:!0}),i=new MediaRecorder(n),o=[];i.ondataavailable=e=>o.push(e.data),i.onstop=()=>{n.getTracks().forEach(e=>e.stop());let t=new Blob(o,{type:i.mimeType||`audio/webm`}),r=new File([t],`nota-de-voz-${Date.now()}.webm`,{type:t.type});e.add([r])},i.start(),t.current=i,a(0),r(!0)}catch{r(!1)}},[e]);return(0,P.jsxs)(oF,{onClick:()=>n?o():void s(),"aria-label":n?`Detener grabación`:`Grabar nota de voz`,tooltip:n?`Detener grabación`:`Grabar nota de voz`,className:l(n&&`bg-destructive/10 text-destructive`),children:[n?(0,P.jsx)(fn,{className:`size-4`}):(0,P.jsx)(tn,{className:`size-4`}),n?(0,P.jsx)(`span`,{className:`tabular-nums`,children:gF(i)}):null]})}function vF({onSend:e,busy:t,onStop:n,draft:r,onDraftChange:i}){return(0,P.jsxs)(tF,{onSubmit:n=>{if(t||!n.text.trim()&&n.files.length===0)return;let r=e(n);return i(``),r},multiple:!0,maxFiles:8,maxFileSize:26214400,className:`rounded-2xl border-0 bg-card shadow-[var(--shadow-soft)] transition-shadow focus-within:shadow-[var(--shadow-lift)]`,inputGroupClassName:`rounded-2xl border-0 shadow-none ring-0 has-[[data-slot=input-group-control]:focus-visible]:ring-0`,children:[(0,P.jsx)(rF,{className:`min-w-0 w-full flex-nowrap empty:hidden`,children:(0,P.jsx)(mF,{})}),(0,P.jsx)(nF,{autoFocus:!0,value:r,onChange:e=>i(e.currentTarget.value),placeholder:`Describe el espacio, las tiendas y las semanas a cotizar...`,className:`min-h-[3.25rem] text-[0.95rem]`}),(0,P.jsxs)(iF,{children:[(0,P.jsxs)(aF,{children:[(0,P.jsx)(hF,{}),(0,P.jsx)(_F,{})]}),(0,P.jsx)(sF,{...t?{status:`streaming`}:{},onStop:n,className:`rounded-lg`})]})]})}var yF=`glm-cotizador-chats-v2`;function bF(e){return`${yF}:${e}`}function xF(){return Math.random().toString(36).slice(2,11)}function SF(e){let t=e.find(e=>e.role===`user`),n=(t?.text.trim()||t?.attachments[0]?.filename?.trim()||`Nuevo chat`).replace(/\s+/g,` `);return n.length>42?`${n.slice(0,39).trimEnd()}...`:n}function CF(e){if(typeof window>`u`||!e)return[];try{let t=window.localStorage.getItem(bF(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(e=>e&&typeof e.id==`string`&&typeof e.title==`string`&&Array.isArray(e.messages)).sort((e,t)=>t.updatedAt-e.updatedAt):[]}catch{return[]}}function wF(e,t){if(!(typeof window>`u`||!e))try{window.localStorage.setItem(bF(e),JSON.stringify(t))}catch{}}var TF=`cotizador_wmc`,EF=`cotizador-wmc-uploads`,DF=`cotizador_wmc_app_session_id`,OF=`cotizador_wmc_app_open_tracked`;function kF(){return`https://agenteit.digitalcompass.agency/webhook/cotizador-wmc-chat`}function AF(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^a-zA-Z0-9._-]+/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``).slice(0,120)||`archivo`}async function jF(e){let{data:{session:t},error:n}=await e.auth.getSession();if(n)throw n;if(t?.access_token)return t.access_token;let{data:r,error:i}=await e.auth.refreshSession();if(i||!r.session?.access_token)throw Error(`Tu sesión expiró. Vuelve a iniciar sesión.`);return r.session.access_token}function MF(){if(typeof window>`u`)return`server-${Date.now()}`;let e=window.sessionStorage.getItem(DF);return e||(e=`wmc-${Date.now()}-${xF()}`,window.sessionStorage.setItem(DF,e)),e}function NF(){typeof window>`u`||(window.sessionStorage.removeItem(DF),window.sessionStorage.removeItem(OF))}async function PF(e,t,n,r={},i,a){try{let{error:o}=await e.rpc(`glm_track_app_event`,{p_app_key:TF,p_event_name:n,p_session_id:MF(),p_metadata:r,p_entity_type:i??null,p_entity_id:a??null,p_display_name:t.name});if(o)throw o;return!0}catch(e){return console.warn(`No se pudo registrar analítica del Cotizador WMC:`,e),!1}}async function FF(e,t){typeof window>`u`||window.sessionStorage.getItem(OF)!==t.id&&await PF(e,t,`app_open`,{path:window.location.pathname,userAgent:navigator.userAgent})&&window.sessionStorage.setItem(OF,t.id)}async function IF(e){let{data:t,error:n}=await e.from(`cotizador_wmc_tariff_items`).select(`id,country_code,country_name,item_code,category,name,detail,mandatory_requirement,format_scope,period,unit_type,base_cost_usd,source_name,effective_from,effective_to,is_active`).eq(`is_active`,!0).order(`country_code`,{ascending:!0}).order(`category`,{ascending:!0}).order(`name`,{ascending:!0});if(n)throw n;return(t??[]).map(e=>({...e,base_cost_usd:Number(e.base_cost_usd??0)}))}async function LF(e,t,n,r){let i=`tarifario-ui-${MF()}`,a={operation:n,tariffItemId:r.id??null,item:{id:r.id??null,countryCode:r.countryCode,country:r.country,itemCode:r.itemCode,category:r.category,name:r.name,detail:r.detail??null,mandatoryRequirement:r.mandatoryRequirement??null,formatScope:r.formatScope??`WM, SP, BF`,period:r.period??null,unitType:r.unitType??null,baseCostUsd:r.baseCostUsd,sourceName:r.sourceName??`Edición manual desde módulo Tarifario`,effectiveFrom:r.effectiveFrom??new Date().toISOString().slice(0,10)},reason:`Cambio realizado manualmente desde el módulo Tarifario del Cotizador WMC`},{data:o,error:s}=await e.rpc(`cotizador_wmc_process_my_agent_action`,{p_action:{action:`tariff_change_proposal`,pendingAction:a},p_conversation_id:i,p_display_name:t.name,p_session_id:MF()});if(s)throw s;if(!o?.ok||!o?.pendingActionId)throw Error(o?.error||`No se pudo preparar el cambio del tarifario.`);let{data:c,error:l}=await e.rpc(`cotizador_wmc_process_my_agent_action`,{p_action:{action:`confirm_tariff_change`,pendingActionId:o.pendingActionId},p_conversation_id:i,p_display_name:t.name,p_session_id:MF()});if(l)throw l;if(!c?.ok)throw Error(c?.error||`No se pudo aplicar el cambio del tarifario.`);return c}function RF(e){if(!e||typeof e!=`object`)return null;let t=e;return{filename:typeof t.filename==`string`?t.filename:`archivo`,mediaType:typeof t.mediaType==`string`?t.mediaType:`application/octet-stream`,url:typeof t.url==`string`?t.url:``,storagePath:typeof t.storagePath==`string`?t.storagePath:null}}async function zF(e,t){return Promise.all(t.map(async t=>{if(!t.storagePath)return t;let{data:n,error:r}=await e.storage.from(EF).createSignedUrl(t.storagePath,3600);return r||!n?.signedUrl?t:{...t,url:n.signedUrl}}))}async function BF(e,t){return Promise.all(t.map(async t=>({...t,attachments:await zF(e,t.attachments)})))}async function VF(e,t){let{data:n,error:r}=await e.from(`cotizador_wmc_conversations`).select(`id,title,created_at,updated_at`).eq(`user_id`,t.id).order(`updated_at`,{ascending:!1}).limit(100);if(r)throw r;if(!n?.length)return[];let i=n.map(e=>e.id),{data:a,error:o}=await e.from(`cotizador_wmc_messages`).select(`id,conversation_id,role,content,attachments,metadata,created_at`).in(`conversation_id`,i).order(`created_at`,{ascending:!0});if(o)throw o;let s=new Map;for(let t of a??[]){let n=await zF(e,(Array.isArray(t.attachments)?t.attachments:[]).map(RF).filter(e=>!!e)),r=t.metadata&&typeof t.metadata==`object`?t.metadata:{},i={id:t.id,role:t.role,text:t.content??``,attachments:n,createdAt:new Date(t.created_at).getTime(),metadata:r},a=s.get(t.conversation_id)??[];a.push(i),s.set(t.conversation_id,a)}return n.map(e=>({id:e.id,title:e.title||`Nuevo chat`,messages:s.get(e.id)??[],createdAt:new Date(e.created_at).getTime(),updatedAt:new Date(e.updated_at).getTime()}))}async function HF(e,t,n,r){let i=new Date().toISOString(),{error:a}=await e.from(`cotizador_wmc_conversations`).upsert({id:n,user_id:t.id,user_email:t.email.toLowerCase(),title:r||`Nuevo chat`,updated_at:i},{onConflict:`id`});if(a)throw a}async function UF(e,t,n,r,i){let a=i?.trim()||SF(r),{error:o}=await e.from(`cotizador_wmc_conversations`).update({title:a,updated_at:new Date().toISOString()}).eq(`id`,n).eq(`user_id`,t.id);if(o)throw o}async function WF(e,t,n,r){let i=r.replace(/\s+/g,` `).trim().slice(0,80);if(!i)throw Error(`El nombre del chat no puede estar vacío.`);let{error:a}=await e.from(`cotizador_wmc_conversations`).update({title:i,updated_at:new Date().toISOString()}).eq(`id`,n).eq(`user_id`,t.id);if(a)throw a}async function GF(e,t,n,r){if(!r.length)return;let i=r.map(e=>({id:e.id,conversation_id:n,user_id:t.id,role:e.role,content:e.text,attachments:e.attachments.map(e=>({filename:e.filename,mediaType:e.mediaType,url:e.url,storagePath:e.storagePath??null})),metadata:e.metadata??{},created_at:new Date(e.createdAt).toISOString()})),{error:a}=await e.from(`cotizador_wmc_messages`).upsert(i,{onConflict:`id`});if(a)throw a}async function KF(e,t){if(!t)return;let n=Array.from(new Set(t.messages.flatMap(e=>e.attachments).map(e=>e.storagePath).filter(e=>!!e)));if(!n.length)return;let{error:r}=await e.storage.from(EF).remove(n);if(r)throw r}async function qF(e,t,n){let{error:r}=await e.from(`cotizador_wmc_conversations`).delete().eq(`id`,n).eq(`user_id`,t.id);if(r)throw r}async function JF(e,t,n,r,i){let a=i.slice(0,8),o=[];for(let i=0;i<a.length;i+=1){let s=a[i],c=s.filename||`archivo-${i+1}`,l=s.mediaType||`application/octet-stream`,u=s.url||``;if(!u)continue;let d=await fetch(u);if(!d.ok)throw Error(`No se pudo preparar ${c} para subirlo.`);let f=await d.blob();if(f.size>26214400)throw Error(`${c} supera el límite de 25 MB.`);let p=`${t.id}/${n}/${r}/${Date.now()}-${i}-${AF(c)}`,{error:m}=await e.storage.from(EF).upload(p,f,{contentType:l,upsert:!1});if(m)throw m;let{data:h,error:g}=await e.storage.from(EF).createSignedUrl(p,3600);if(g||!h?.signedUrl)throw g||Error(`No se pudo crear acceso temporal para ${c}.`);o.push({filename:c,mediaType:l,url:h.signedUrl,storagePath:p})}return o}async function YF(e,t,n,r){let i=await jF(e),a=await fetch(kF(),{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${i}`},body:JSON.stringify({text:n.text,conversationId:n.conversationId,messageId:n.messageId,userEmail:t.email,userName:t.name,appSessionId:MF(),sentAt:new Date().toISOString(),attachments:n.attachments.map(e=>({filename:e.filename,mediaType:e.mediaType,url:e.url,storagePath:e.storagePath??null}))}),...r?{signal:r}:{}}),o=null;try{o=await a.json()}catch{o=null}if(!a.ok||o?.ok===!1){let e=typeof o?.reply==`string`&&o.reply||typeof o?.message==`string`&&o.message||`El agente respondió con HTTP ${a.status}.`;throw Error(e)}if(!o)throw Error(`El agente no devolvió una respuesta válida.`);return o}function XF(e){let t=typeof e.reply==`string`&&e.reply.trim()?e.reply.trim():`Listo.`;return e.artifactUrl?`${t}\n\n[${e.artifactType===`quote`?`Abrir cotización en Google Sheets`:e.artifactType===`monthly_glm`?`Abrir mensualización GLM`:e.artifactType===`proposal`?`Abrir propuesta en Google Slides`:e.artifactType===`image`?`Abrir imagen generada`:`Abrir archivo generado`}](${e.artifactUrl})`:t}function ZF(e){return{action:e.action??`chat`,model:e.model??null,warnings:Array.isArray(e.warnings)?e.warnings:[],confidence:e.confidence??null,requiresConfirmation:!!e.requiresConfirmation,pendingActionId:e.pendingActionId??null,artifactUrl:e.artifactUrl??null,artifactType:e.artifactType??null,quoteId:e.quoteId??null}}var QF=5e3;function $F(){return`https://agenteit.digitalcompass.agency/webhook/cotizador-wmc-reportar`}function eI({user:e}){let[t,n]=(0,M.useState)(!1),[r,i]=(0,M.useState)(``),[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(``),[l,u]=(0,M.useState)(!1),d=()=>{i(``),o(!1),c(``),u(!1)};return(0,P.jsxs)(Cj,{open:t,onOpenChange:e=>{n(e),e&&d()},children:[(0,P.jsx)(wj,{asChild:!0,children:(0,P.jsxs)(`button`,{type:`button`,"aria-label":`Reportar`,title:`Reportar`,className:`inline-flex h-9 items-center gap-1.5 rounded-lg border border-border bg-card px-2.5 text-xs font-bold text-foreground transition-colors hover:bg-secondary sm:px-3`,children:[(0,P.jsx)(en,{className:`size-4`}),(0,P.jsx)(`span`,{className:`hidden sm:inline`,children:`Reportar`})]})}),(0,P.jsxs)(Dj,{className:`overflow-hidden border-border bg-card p-0 sm:max-w-[32rem]`,children:[(0,P.jsx)(`div`,{className:`h-1 bg-brand`}),(0,P.jsx)(`div`,{className:`p-6 pt-5`,children:l?(0,P.jsxs)(`div`,{className:`py-2 text-center`,children:[(0,P.jsx)(`div`,{className:`mx-auto grid size-12 place-items-center rounded-full bg-brand-soft text-brand`,children:(0,P.jsx)(Ht,{className:`size-6`})}),(0,P.jsx)(`h2`,{className:`mt-4 text-lg font-bold text-primary`,children:`Reporte enviado`}),(0,P.jsx)(`p`,{className:`mx-auto mt-2 max-w-sm text-sm leading-relaxed text-muted-foreground`,children:`Tu reporte fue enviado correctamente al equipo de IT.`}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:`mt-5 inline-flex h-9 items-center justify-center rounded-lg bg-primary px-4 text-sm font-bold text-primary-foreground transition-colors hover:bg-primary/90`,children:`Cerrar`})]}):(0,P.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault();let n=r.trim();if(!n){c(`Escribe la descripción del reporte antes de enviarlo.`);return}let a=$F();if(!a){c(`El canal de reportes no está configurado. Contacta a IT para revisar VITE_REPORT_WEBHOOK_URL.`);return}o(!0),c(``);try{let{data:{session:t},error:r}=await wt().auth.getSession();if(r||!t?.access_token)throw Error(`Tu sesión expiró. Vuelve a iniciar sesión.`);let o=await fetch(a,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({userEmail:e.email,userName:e.name,message:n,submittedAt:new Date().toISOString(),appSessionId:MF()})}),s=null;try{s=await o.json()}catch{s=null}if(!o.ok||s?.ok===!1)throw Error(s?.message||`No se pudo enviar el reporte.`);u(!0),i(``)}catch(e){console.error(`No se pudo enviar el reporte de usuario:`,e),c(e instanceof Error&&e.message?e.message:`No se pudo enviar el reporte. Intenta nuevamente.`)}finally{o(!1)}},children:[(0,P.jsxs)(Oj,{className:`gap-0`,children:[(0,P.jsx)(`div`,{className:`mb-2 grid size-10 place-items-center rounded-xl bg-brand-soft text-primary`,children:(0,P.jsx)(en,{className:`size-5`})}),(0,P.jsx)(Aj,{className:`text-xl font-bold text-primary`,children:`Reporte`})]}),(0,P.jsxs)(`div`,{className:`mt-4`,children:[(0,P.jsxs)(`label`,{htmlFor:`report-description`,className:`mb-2 block text-sm font-bold text-foreground`,children:[`Descripción del Reporte `,(0,P.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,P.jsx)(LP,{id:`report-description`,value:r,onChange:e=>{i(e.target.value),s&&c(``)},maxLength:QF,required:!0,autoFocus:!0,disabled:a,placeholder:`Describe claramente lo que ocurrió, qué esperabas que pasara y cualquier detalle que pueda ayudar a revisarlo...`,className:`min-h-36 resize-y rounded-xl bg-background px-3.5 py-3 leading-relaxed`}),(0,P.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between gap-3`,children:[(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`El reporte incluirá automáticamente tu nombre y correo.`}),(0,P.jsxs)(`span`,{className:`shrink-0 text-[0.7rem] text-muted-foreground`,children:[r.length,`/`,QF]})]}),s?(0,P.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm leading-relaxed text-destructive`,children:s}):null]}),(0,P.jsxs)(kj,{className:`mt-6 gap-2 sm:space-x-0`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>n(!1),disabled:a,className:`inline-flex h-9 items-center justify-center rounded-lg border border-border bg-card px-4 text-sm font-bold text-foreground transition-colors hover:bg-secondary disabled:cursor-not-allowed disabled:opacity-50`,children:`Cancelar`}),(0,P.jsxs)(`button`,{type:`submit`,disabled:a||!r.trim(),className:`inline-flex h-9 items-center justify-center gap-2 rounded-lg bg-primary px-4 text-sm font-bold text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50`,children:[a?(0,P.jsx)(`span`,{className:`size-4 animate-spin rounded-full border-2 border-primary-foreground/40 border-t-primary-foreground`}):(0,P.jsx)(un,{className:`size-4`}),a?`Enviando...`:`Enviar reporte`]})]})]})})]})]})}var tI=[{code:`GT`,name:`Guatemala`},{code:`CR`,name:`Costa Rica`},{code:`SV`,name:`El Salvador`},{code:`HN`,name:`Honduras`},{code:`NI`,name:`Nicaragua`}],nI={countryCode:`GT`,country:`Guatemala`,itemCode:``,category:`Personal`,name:``,detail:``,mandatoryRequirement:``,formatScope:`WM, SP, BF`,period:``,unitType:``,baseCostUsd:0,sourceName:`Edición manual desde módulo Tarifario`};function rI(e){return{countryCode:e.country_code,country:e.country_name,itemCode:e.item_code,category:e.category,name:e.name,detail:e.detail??``,mandatoryRequirement:e.mandatory_requirement??``,formatScope:e.format_scope,period:e.period??``,unitType:e.unit_type??``,baseCostUsd:Number(e.base_cost_usd),sourceName:e.source_name,effectiveFrom:e.effective_from}}function iI({user:e}){let[t,n]=(0,M.useState)(!1),[r,i]=(0,M.useState)([]),[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(!1),[l,u]=(0,M.useState)(``),[d,f]=(0,M.useState)(``),[p,m]=(0,M.useState)(``),[h,g]=(0,M.useState)(`TODOS`),[_,v]=(0,M.useState)(null),[y,b]=(0,M.useState)(!1),[x,S]=(0,M.useState)(nI),C=async()=>{o(!0),u(``);try{let e=await IF(wt());i(e)}catch(e){console.error(e),u(`No se pudo cargar el Tarifario desde Supabase.`)}finally{o(!1)}};(0,M.useEffect)(()=>{t&&(C(),PF(wt(),e,`tariff_opened`))},[t,e]);let w=(0,M.useMemo)(()=>{let e=p.trim().toLowerCase();return r.filter(t=>h!==`TODOS`&&t.country_code!==h?!1:!e||[t.name,t.category,t.item_code,t.detail??``,t.country_name].join(` `).toLowerCase().includes(e))},[h,r,p]),T=()=>{v(null),S(nI),u(``),f(``),b(!0)},ee=e=>{v(e),S(rI(e)),u(``),f(``),b(!0)},E=e=>{let t=tI.find(t=>t.code===e)??{code:`GT`,name:`Guatemala`};S(e=>({...e,countryCode:t.code,country:t.name}))},te=async t=>{if(t.preventDefault(),!x.name.trim()||!x.category.trim()||!x.itemCode.trim()){u(`Nombre, código y categoría son obligatorios.`);return}if(!Number.isFinite(Number(x.baseCostUsd))||Number(x.baseCostUsd)<0){u(`El costo USD debe ser un número válido mayor o igual a cero.`);return}let n=_?`actualizar`:`crear`;if(window.confirm(`¿Confirmas ${n} esta tarifa? El cambio quedará auditado en Supabase.`)){c(!0),u(``),f(``);try{await LF(wt(),e,_?`update`:`insert`,_?{...x,id:_.id}:x),f(_?`Tarifa actualizada correctamente.`:`Tarifa creada correctamente.`),b(!1),v(null),await C()}catch(e){console.error(e),u(e instanceof Error?e.message:`No se pudo guardar la tarifa.`)}finally{c(!1)}}},ne=async t=>{if(window.confirm(`¿Confirmas eliminar/desactivar “${t.name}” del tarifario vigente?`)){c(!0),u(``),f(``);try{await LF(wt(),e,`deactivate`,{id:t.id,countryCode:t.country_code,country:t.country_name,itemCode:t.item_code,category:t.category,name:t.name,baseCostUsd:Number(t.base_cost_usd)}),f(`Tarifa desactivada correctamente.`),await C()}catch(e){console.error(e),u(e instanceof Error?e.message:`No se pudo desactivar la tarifa.`)}finally{c(!1)}}};return(0,P.jsxs)(Cj,{open:t,onOpenChange:n,children:[(0,P.jsx)(wj,{asChild:!0,children:(0,P.jsxs)(`button`,{type:`button`,"aria-label":`Tarifario`,className:`inline-flex h-9 items-center gap-1.5 rounded-lg border border-border bg-card px-2.5 text-xs font-bold text-foreground transition-colors hover:bg-secondary sm:px-3`,children:[(0,P.jsx)(Rt,{className:`size-4`}),(0,P.jsx)(`span`,{className:`hidden sm:inline`,children:`Tarifario`})]})}),(0,P.jsxs)(Dj,{className:`flex max-h-[88dvh] w-[min(96vw,70rem)] max-w-none flex-col overflow-hidden border-border bg-card p-0`,children:[(0,P.jsx)(`div`,{className:`h-1 shrink-0 bg-brand`}),(0,P.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col p-5 sm:p-6`,children:[(0,P.jsxs)(Oj,{className:`shrink-0`,children:[(0,P.jsxs)(Aj,{className:`flex items-center gap-2 text-xl font-bold text-primary`,children:[(0,P.jsx)(Rt,{className:`size-5`}),`Tarifario Walmart Connect`]}),(0,P.jsx)(jj,{children:`Consulta, agrega, edita o elimina tarifas vigentes. Cada modificación requiere confirmación y queda auditada.`})]}),(0,P.jsxs)(`div`,{className:`mt-5 flex shrink-0 flex-col gap-2 sm:flex-row`,children:[(0,P.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,P.jsx)(ln,{className:`absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,P.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),placeholder:`Buscar por nombre, código, categoría...`,className:`h-10 w-full rounded-lg border border-border bg-background pl-9 pr-3 text-sm outline-none focus:border-primary`})]}),(0,P.jsxs)(`div`,{className:`relative shrink-0 sm:w-48`,children:[(0,P.jsxs)(`select`,{value:h,onChange:e=>g(e.target.value),className:`h-10 w-full appearance-none rounded-lg border border-border bg-background pl-3 pr-10 text-sm outline-none transition-colors focus:border-primary focus:ring-2 focus:ring-primary/10`,children:[(0,P.jsx)(`option`,{value:`TODOS`,children:`Todos los países`}),tI.map(e=>(0,P.jsx)(`option`,{value:e.code,children:e.name},e.code))]}),(0,P.jsx)(Bt,{className:`pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`})]}),(0,P.jsxs)(`button`,{type:`button`,onClick:T,className:`inline-flex h-10 items-center justify-center gap-2 rounded-lg bg-primary px-4 text-sm font-bold text-primary-foreground hover:bg-primary/90`,children:[(0,P.jsx)(cn,{className:`size-4`}),`Agregar tarifa`]})]}),l?(0,P.jsx)(`p`,{className:`mt-3 shrink-0 text-sm text-destructive`,children:l}):null,d?(0,P.jsxs)(`p`,{className:`mt-3 flex shrink-0 items-center gap-2 text-sm font-medium text-brand`,children:[(0,P.jsx)(Ht,{className:`size-4`}),` `,d]}):null,y?(0,P.jsxs)(`form`,{onSubmit:te,className:`mt-4 shrink-0 rounded-xl border border-border bg-secondary/35 p-4`,children:[(0,P.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-bold text-primary`,children:_?`Editar tarifa`:`Nueva tarifa`}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>b(!1),className:`text-muted-foreground hover:text-foreground`,children:(0,P.jsx)(_n,{className:`size-4`})})]}),(0,P.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`País`,(0,P.jsxs)(`span`,{className:`relative mt-1 block`,children:[(0,P.jsx)(`select`,{value:x.countryCode,onChange:e=>E(e.target.value),className:`h-9 w-full appearance-none rounded-md border border-border bg-background pl-2 pr-9 text-sm font-normal outline-none focus:border-primary`,children:tI.map(e=>(0,P.jsx)(`option`,{value:e.code,children:e.name},e.code))}),(0,P.jsx)(Bt,{className:`pointer-events-none absolute right-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`})]})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Código *`,(0,P.jsx)(`input`,{value:x.itemCode,onChange:e=>S(t=>({...t,itemCode:e.target.value})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Categoría *`,(0,P.jsx)(`input`,{value:x.category,onChange:e=>S(t=>({...t,category:e.target.value})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Costo unitario USD *`,(0,P.jsx)(`input`,{type:`number`,min:`0`,step:`0.01`,value:x.baseCostUsd,onChange:e=>S(t=>({...t,baseCostUsd:Number(e.target.value)})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground sm:col-span-2`,children:[`Nombre *`,(0,P.jsx)(`input`,{value:x.name,onChange:e=>S(t=>({...t,name:e.target.value})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Período`,(0,P.jsx)(`input`,{value:x.period??``,onChange:e=>S(t=>({...t,period:e.target.value})),placeholder:`1 día / Por unidad`,className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Tipo de unidad`,(0,P.jsx)(`input`,{value:x.unitType??``,onChange:e=>S(t=>({...t,unitType:e.target.value})),placeholder:`persona/día / unidad`,className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground sm:col-span-2`,children:[`Detalle`,(0,P.jsx)(`textarea`,{value:x.detail??``,onChange:e=>S(t=>({...t,detail:e.target.value})),rows:2,className:`mt-1 w-full rounded-md border border-border bg-background px-2 py-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Requisito`,(0,P.jsx)(`input`,{value:x.mandatoryRequirement??``,onChange:e=>S(t=>({...t,mandatoryRequirement:e.target.value})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Alcance formato`,(0,P.jsx)(`input`,{value:x.formatScope??``,onChange:e=>S(t=>({...t,formatScope:e.target.value})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>b(!1),disabled:s,className:`h-9 rounded-lg border border-border bg-card px-4 text-sm font-bold hover:bg-secondary`,children:`Cancelar`}),(0,P.jsx)(`button`,{type:`submit`,disabled:s,className:`h-9 rounded-lg bg-primary px-4 text-sm font-bold text-primary-foreground disabled:opacity-50`,children:s?`Guardando...`:_?`Guardar cambios`:`Crear tarifa`})]})]}):null,(0,P.jsx)(`div`,{className:`scrollbar-slim mt-4 min-h-0 flex-1 overflow-auto rounded-xl border border-border`,children:(0,P.jsxs)(`table`,{className:`w-full min-w-[900px] border-collapse text-left text-sm`,children:[(0,P.jsx)(`thead`,{className:`sticky top-0 z-10 bg-secondary text-xs uppercase tracking-wide text-muted-foreground`,children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{className:`px-3 py-3`,children:`País`}),(0,P.jsx)(`th`,{className:`px-3 py-3`,children:`Código`}),(0,P.jsx)(`th`,{className:`px-3 py-3`,children:`Categoría`}),(0,P.jsx)(`th`,{className:`px-3 py-3`,children:`Concepto`}),(0,P.jsx)(`th`,{className:`px-3 py-3`,children:`Unidad / período`}),(0,P.jsx)(`th`,{className:`px-3 py-3 text-right`,children:`USD`}),(0,P.jsx)(`th`,{className:`px-3 py-3 text-right`,children:`Acciones`})]})}),(0,P.jsx)(`tbody`,{children:a?(0,P.jsx)(`tr`,{children:(0,P.jsx)(`td`,{colSpan:7,className:`px-4 py-10 text-center text-muted-foreground`,children:`Cargando tarifario...`})}):w.length===0?(0,P.jsx)(`tr`,{children:(0,P.jsx)(`td`,{colSpan:7,className:`px-4 py-10 text-center text-muted-foreground`,children:`No se encontraron tarifas.`})}):w.map(e=>(0,P.jsxs)(`tr`,{className:`border-t border-border align-top hover:bg-secondary/30`,children:[(0,P.jsx)(`td`,{className:`px-3 py-3 font-bold text-primary`,children:e.country_code}),(0,P.jsx)(`td`,{className:`px-3 py-3 font-mono text-xs`,children:e.item_code}),(0,P.jsx)(`td`,{className:`px-3 py-3`,children:e.category}),(0,P.jsxs)(`td`,{className:`max-w-[24rem] px-3 py-3`,children:[(0,P.jsx)(`div`,{className:`font-semibold text-foreground`,children:e.name}),e.detail?(0,P.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-muted-foreground`,children:e.detail}):null]}),(0,P.jsx)(`td`,{className:`px-3 py-3 text-xs text-muted-foreground`,children:[e.unit_type,e.period].filter(Boolean).join(` · `)||`—`}),(0,P.jsxs)(`td`,{className:`px-3 py-3 text-right font-bold tabular-nums`,children:[`$`,Number(e.base_cost_usd).toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2})]}),(0,P.jsx)(`td`,{className:`px-3 py-3`,children:(0,P.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>ee(e),title:`Editar`,className:`grid size-8 place-items-center rounded-md text-primary hover:bg-primary/10`,children:(0,P.jsx)(on,{className:`size-4`})}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>void ne(e),disabled:s,title:`Eliminar / desactivar`,className:`grid size-8 place-items-center rounded-md text-destructive hover:bg-destructive/10 disabled:opacity-50`,children:(0,P.jsx)(mn,{className:`size-4`})})]})})]},e.id))})]})}),(0,P.jsxs)(`p`,{className:`mt-3 shrink-0 text-xs text-muted-foreground`,children:[w.length,` tarifa(s) visible(s).`]})]})]})]})}var aI=[{icon:gn,title:`Cotizar cabecera de gondola`,prompt:`Cotiza una cabecera de góndola para Guatemala en 3 tiendas Walmart durante 4 semanas.`},{icon:hn,title:`Actualizar el tarifario`,prompt:`Actualiza el tarifario: la Impulsadora A Capital de Guatemala pasa a US$40 por día.`},{icon:Jt,title:`Comparar con cotizaciones previas`,prompt:`Compara esta cotización con cotizaciones históricas similares de Walmart Connect.`},{icon:Yt,title:`Generar arte de propuesta`,prompt:`Genera una referencia visual profesional para una isla promocional de Walmart Connect.`}];function oI({attachments:e}){return e.length===0?null:(0,P.jsx)(`div`,{className:`flex w-full flex-wrap justify-end gap-2.5`,children:e.map((e,t)=>(0,P.jsx)(pF,{file:e},`${e.filename}-${t}`))})}function sI({user:e}){let[t,n]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{n(!1)},[e.avatarUrl]),e.avatarUrl&&!t?(0,P.jsx)(`img`,{src:e.avatarUrl,alt:e.name,referrerPolicy:`no-referrer`,onError:()=>n(!0),className:`size-full rounded-full object-cover`}):(0,P.jsx)(`span`,{children:e.initials})}function cI({chats:e,activeChatId:t,open:n,user:r,onClose:i,onNew:a,onSelect:o,onRename:s,onDelete:c,onSignOut:u}){let[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(``),h=e=>{f(e),m(e.title)},g=()=>{if(!d)return;let e=p.replace(/\s+/g,` `).trim().slice(0,80);e&&(s(d.id,e),f(null),m(``))};return(0,P.jsxs)(P.Fragment,{children:[n?(0,P.jsx)(`button`,{type:`button`,"aria-label":`Cerrar historial de chats`,className:`fixed inset-0 z-40 bg-foreground/15 backdrop-blur-[1px] md:hidden`,onClick:i}):null,(0,P.jsxs)(`aside`,{className:l(`fixed inset-y-0 left-0 z-50 flex w-[17rem] flex-col border-r border-sidebar-border bg-secondary/70 px-3 py-4 shadow-xl transition-transform duration-200 md:static md:z-auto md:translate-x-0 md:shadow-none`,n?`translate-x-0`:`-translate-x-full`),children:[(0,P.jsxs)(`div`,{className:`mb-4 flex items-center gap-2`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:a,className:`flex h-11 flex-1 items-center gap-2.5 rounded-xl border border-primary/20 bg-card px-3.5 text-sm font-bold text-primary shadow-sm transition-colors hover:bg-primary hover:text-primary-foreground`,children:[(0,P.jsx)(cn,{className:`size-4.5`}),`Nuevo chat`]}),(0,P.jsx)(`button`,{type:`button`,onClick:i,"aria-label":`Cerrar historial`,className:`grid size-10 place-items-center rounded-xl text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground md:hidden`,children:(0,P.jsx)(_n,{className:`size-4.5`})})]}),(0,P.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,P.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 px-2 text-xs font-bold uppercase tracking-[0.12em] text-primary/80`,children:[(0,P.jsx)($t,{className:`size-3.5`}),`Chats`]}),(0,P.jsx)(`div`,{className:`scrollbar-slim min-h-0 flex-1 space-y-1 overflow-y-auto pr-1`,children:e.length===0?(0,P.jsx)(`p`,{className:`px-2 py-3 text-xs leading-relaxed text-muted-foreground`,children:`Tus conversaciones aparecerán aquí después de enviar el primer mensaje.`}):e.map(e=>{let n=e.id===t;return(0,P.jsxs)(`div`,{className:l(`group flex min-w-0 items-center rounded-lg transition-colors`,n?`bg-primary/10`:`hover:bg-secondary`),children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>o(e),title:e.title,className:l(`min-w-0 flex-1 truncate px-3 py-2.5 text-left text-sm`,n?`font-bold text-primary`:`font-medium text-sidebar-foreground`),children:e.title}),(0,P.jsxs)(EP,{children:[(0,P.jsx)(DP,{asChild:!0,children:(0,P.jsx)(`button`,{type:`button`,"aria-label":`Opciones de ${e.title}`,onClick:e=>e.stopPropagation(),className:l(`mr-1 grid size-8 shrink-0 place-items-center rounded-md text-muted-foreground opacity-0 transition-all hover:bg-card hover:text-foreground group-hover:opacity-100 group-focus-within:opacity-100`),children:(0,P.jsx)(Kt,{className:`size-4`})})}),(0,P.jsxs)(AP,{align:`end`,side:`right`,className:`min-w-44`,children:[(0,P.jsxs)(jP,{className:`gap-2`,onClick:()=>h(e),children:[(0,P.jsx)(on,{className:`size-4`}),`Cambiar nombre`]}),(0,P.jsxs)(jP,{className:`gap-2 text-destructive focus:text-destructive`,onClick:()=>c(e.id),children:[(0,P.jsx)(mn,{className:`size-4`}),`Eliminar chat`]})]})]})]},e.id)})})]}),(0,P.jsx)(`div`,{className:`mt-3 border-t border-sidebar-border pt-3`,children:(0,P.jsxs)(EP,{children:[(0,P.jsx)(DP,{asChild:!0,children:(0,P.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center gap-3 rounded-xl px-2.5 py-2 text-left transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/45`,"aria-label":`Abrir menú de ${r.name}`,children:[(0,P.jsx)(`div`,{className:`grid size-10 shrink-0 place-items-center overflow-hidden rounded-full bg-[image:var(--gradient-brand)] text-xs font-bold text-primary-foreground ring-1 ring-sidebar-border`,children:(0,P.jsx)(sI,{user:r})}),(0,P.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,P.jsx)(`div`,{className:`truncate text-sm font-bold text-sidebar-foreground`,children:r.name})})]})}),(0,P.jsx)(AP,{align:`start`,side:`top`,sideOffset:8,className:`w-52`,children:(0,P.jsxs)(jP,{className:`gap-2 text-destructive focus:text-destructive`,onClick:u,children:[(0,P.jsx)(Zt,{className:`size-4`}),`Cerrar sesión`]})})]})})]}),(0,P.jsx)(Cj,{open:!!d,onOpenChange:e=>{e||(f(null),m(``))},children:(0,P.jsxs)(Dj,{className:`max-w-md rounded-2xl border-border bg-card p-5 shadow-2xl`,children:[(0,P.jsxs)(Oj,{className:`space-y-2`,children:[(0,P.jsx)(Aj,{className:`text-lg font-bold text-foreground`,children:`Cambiar nombre del chat`}),(0,P.jsx)(jj,{children:`Escribe un nombre corto para identificar esta conversación.`})]}),(0,P.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,P.jsx)(IP,{value:p,onChange:e=>m(e.target.value),maxLength:80,autoFocus:!0,"aria-label":`Nuevo nombre del chat`,className:`h-11 rounded-xl bg-background px-3.5`}),(0,P.jsxs)(`div`,{className:`text-right text-xs text-muted-foreground`,children:[p.length,`/80`]}),(0,P.jsxs)(kj,{className:`gap-2 sm:space-x-0`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>{f(null),m(``)},className:`inline-flex h-10 items-center justify-center rounded-xl border border-border bg-card px-4 text-sm font-semibold text-foreground transition-colors hover:bg-secondary`,children:`Cancelar`}),(0,P.jsx)(`button`,{type:`submit`,disabled:!p.trim(),className:`inline-flex h-10 items-center justify-center rounded-xl bg-primary px-4 text-sm font-bold text-primary-foreground transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-45`,children:`Guardar`})]})]})]})})]})}function lI(){let e=c(),[t,n]=(0,M.useState)(null),[r,i]=(0,M.useState)([]),[a,o]=(0,M.useState)([]),[s,l]=(0,M.useState)(null),[u,d]=(0,M.useState)(``),[f,p]=(0,M.useState)(!1),[m,h]=(0,M.useState)(!1),[g,_]=(0,M.useState)(!1),{theme:v,toggleTheme:y}=C(),b=(0,M.useRef)([]),x=(0,M.useRef)(null);(0,M.useEffect)(()=>{let t=!0,r=!1,a=wt(),s=async r=>{xt(r),await Ct(a),t&&(n(null),_(!1),e({to:`/`,replace:!0}))},c=async c=>{if(!r){r=!0;try{let r=await Et(a);if(!t)return;if(!r.allowed){if(r.reason===`signed_out`){n(null),_(!1),e({to:`/`,replace:!0});return}await s(r.message);return}if(_(r.permissions.canUseTarifario),!c)return;let u=Tt(r.user),f=[];try{f=await VF(a,u)}catch(e){console.warn(`No se pudo cargar el historial remoto; se usará el respaldo local:`,e),f=CF(u.id)}if(f.length===0){let e=CF(u.id);e.length>0&&(f=e)}n(u),b.current=f,o(f),l(null),i([]),d(``),FF(a,u)}catch(e){console.error(e),t&&await s(`No se pudo validar tu acceso en este momento. Intenta nuevamente o contacta a IT.`)}finally{r=!1}}},{data:{subscription:u}}=a.auth.onAuthStateChange(r=>{t&&r===`SIGNED_OUT`&&(n(null),_(!1),l(null),i([]),d(``),e({to:`/`,replace:!0}))}),f=()=>{c(!1)},p=()=>{document.visibilityState===`visible`&&f()};c(!0),window.addEventListener(`focus`,f),document.addEventListener(`visibilitychange`,p);let m=window.setInterval(f,6e4);return()=>{t=!1,u.unsubscribe(),window.removeEventListener(`focus`,f),document.removeEventListener(`visibilitychange`,p),window.clearInterval(m)}},[e]);let S=(0,M.useCallback)(e=>{let n=[...e].sort((e,t)=>t.updatedAt-e.updatedAt);b.current=n,o(n),t&&wF(t.id,n)},[t]),w=(0,M.useCallback)((e,t)=>{i(t);let n=Date.now(),r=b.current.find(t=>t.id===e),a={id:e,title:r?.title||SF(t),messages:t,createdAt:r?.createdAt??t[0]?.createdAt??n,updatedAt:n};S([a,...b.current.filter(t=>t.id!==e)])},[S]),T=(0,M.useCallback)(()=>{x.current?.abort(),x.current=null,p(!1)},[]);(0,M.useEffect)(()=>T,[T]);let ee=(0,M.useCallback)(async e=>{if(!t||f)return;let n=wt(),i=s??xF(),a=xF(),o=e.files.slice(0,8).map(e=>({filename:e.filename??`archivo`,mediaType:e.mediaType??`application/octet-stream`,url:e.url,storagePath:null})),c={id:a,role:`user`,text:e.text.trim(),attachments:o,createdAt:Date.now()},u=[...r],d=[...u,c];s||l(i),w(i,d),p(!0);let m=new AbortController;x.current=m;try{let r=b.current.find(e=>e.id===i)?.title||SF(d);if(await HF(n,t,i,r),u.length>0){let e=await BF(n,u);await GF(n,t,i,e)}let o=e.files.length?await JF(n,t,i,a,e.files):[],l={...c,attachments:o},f=[...u,l];w(i,f),s||PF(n,t,`chat_created`,{},`conversation`,i),PF(n,t,`message_sent`,{hasAttachments:o.length>0,attachmentCount:o.length},`conversation`,i);let p=await YF(n,t,{text:l.text,conversationId:i,messageId:a,attachments:o},m.signal),h={id:xF(),role:`assistant`,text:XF(p),attachments:[],createdAt:Date.now(),metadata:ZF(p)},g=[...f,h];w(i,g);try{await GF(n,t,i,[l,h]),await UF(n,t,i,g,b.current.find(e=>e.id===i)?.title)}catch(e){console.warn(`La respuesta se generó, pero no se pudo sincronizar el historial remoto:`,e)}}catch(e){if(e instanceof DOMException&&e.name===`AbortError`){try{let e=b.current.find(e=>e.id===i)?.messages??d,r=e.find(e=>e.id===a)??c,o={...r,attachments:r.attachments.filter(e=>e.storagePath||!e.url.startsWith(`data:`)&&!e.url.startsWith(`blob:`))};await GF(n,t,i,[o]),await UF(n,t,i,e,b.current.find(e=>e.id===i)?.title)}catch(e){console.warn(`No se pudo guardar el mensaje detenido:`,e)}return}console.error(`Error al comunicarse con el agente WMC:`,e);let r=e instanceof Error&&e.message?e.message:`No se pudo completar la solicitud. Intenta nuevamente.`,o={id:xF(),role:`assistant`,text:`No pude completar la solicitud.\n\n⚠️ ${r}`,attachments:[],createdAt:Date.now(),metadata:{action:`error`,error:r}},s=[...(b.current.find(e=>e.id===i)?.messages??d).filter(e=>e.id!==o.id),o];w(i,s);try{let e=s.find(e=>e.id===a)??c,r={...e,attachments:e.attachments.filter(e=>e.storagePath||!e.url.startsWith(`data:`)&&!e.url.startsWith(`blob:`))};await GF(n,t,i,[r,o]),await UF(n,t,i,s,b.current.find(e=>e.id===i)?.title)}catch(e){console.warn(`No se pudo persistir el error del agente:`,e)}PF(n,t,`agent_error`,{message:r},`conversation`,i)}finally{x.current===m&&(x.current=null),p(!1)}},[s,f,r,w,t]),E=(0,M.useCallback)(()=>{window.requestAnimationFrame(()=>{document.querySelector(`textarea[name="message"]`)?.focus()})},[]),te=(0,M.useCallback)(()=>{T(),l(null),i([]),d(``),h(!1),E()},[E,T]),ne=(0,M.useCallback)(e=>{T(),l(e.id),i(e.messages),d(``),h(!1)},[T]),D=(0,M.useCallback)((e,n)=>{let r=n.replace(/\s+/g,` `).trim().slice(0,80);if(!r)return;let i=b.current.find(t=>t.id===e);if(!i||i.title===r)return;let a={...i,title:r,updatedAt:Date.now()};if(S([a,...b.current.filter(t=>t.id!==e)]),t){let n=wt();(async()=>{try{await WF(n,t,e,r)}catch(e){console.warn(`No se pudo sincronizar el nuevo nombre del chat:`,e)}})(),PF(n,t,`chat_renamed`,{previousTitle:i.title,title:r},`conversation`,e)}},[S,t]),re=(0,M.useCallback)(e=>{let n=b.current.find(t=>t.id===e),r=b.current.filter(t=>t.id!==e);if(S(r),t){let r=wt();(async()=>{try{await KF(r,n),await qF(r,t,e)}catch(e){console.warn(`No se pudo eliminar completamente el chat remoto:`,e)}})(),PF(r,t,`chat_deleted`,{},`conversation`,e)}s===e&&(T(),l(null),i([]),d(``))},[s,S,T,t]),O=(0,M.useCallback)(e=>{d(e),E()},[E]),k=async()=>{T();let r=wt();t&&await PF(r,t,`logout`,{appSessionId:MF()}),NF();let{error:a}=await r.auth.signOut({scope:`local`});a&&console.error(a),n(null),_(!1),l(null),i([]),d(``),e({to:`/`,replace:!0})};if(!t)return(0,P.jsx)(`div`,{className:`min-h-[100dvh] bg-background`});let ie=r.length===0;return(0,P.jsxs)(`div`,{className:`flex h-[100dvh] overflow-hidden bg-background`,children:[(0,P.jsx)(cI,{chats:a,activeChatId:s,open:m,user:t,onClose:()=>h(!1),onNew:te,onSelect:ne,onRename:D,onDelete:re,onSignOut:()=>void k()}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,P.jsx)(`header`,{className:`sticky top-0 z-20 border-b border-border bg-card/85 backdrop-blur`,children:(0,P.jsxs)(`div`,{className:`mx-auto grid w-full max-w-4xl grid-cols-[minmax(0,1fr)_auto] items-center gap-3 px-4 py-3`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>h(!0),"aria-label":`Abrir historial de chats`,className:`grid size-9 shrink-0 place-items-center rounded-lg border border-border bg-card text-primary transition-colors hover:bg-secondary md:hidden`,children:(0,P.jsx)(Qt,{className:`size-4.5`})}),(0,P.jsx)(yt,{className:`h-6 shrink-0 sm:h-7`}),(0,P.jsx)(`span`,{"aria-hidden":`true`,className:`h-6 w-px shrink-0 bg-border`}),(0,P.jsx)(`div`,{className:`min-w-0`,children:(0,P.jsx)(`h1`,{className:`truncate text-sm font-bold leading-tight text-primary sm:text-[0.95rem]`,children:`Cotizador Walmart Connect`})})]}),(0,P.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[g?(0,P.jsx)(iI,{user:t}):null,(0,P.jsxs)(`button`,{type:`button`,onClick:y,"aria-label":v===`dark`?`Cambiar a modo claro`:`Cambiar a modo oscuro`,title:v===`dark`?`Modo claro`:`Modo oscuro`,className:`inline-flex h-9 items-center gap-1.5 rounded-lg border border-border bg-card px-2.5 text-xs font-bold text-foreground transition-colors hover:bg-secondary sm:px-3`,children:[v===`dark`?(0,P.jsx)(pn,{className:`size-4`}):(0,P.jsx)(nn,{className:`size-4`}),(0,P.jsx)(`span`,{className:`hidden lg:inline`,children:v===`dark`?`Claro`:`Oscuro`})]}),(0,P.jsx)(eI,{user:t})]})]})}),(0,P.jsxs)(In,{className:`scrollbar-slim flex-1`,children:[(0,P.jsxs)(Ln,{className:`mx-auto w-full max-w-4xl gap-6 px-4 pb-6 pt-6`,children:[ie?(0,P.jsxs)(`div`,{className:`animate-rise flex flex-col items-center py-8 text-center sm:py-14`,children:[(0,P.jsxs)(`h2`,{className:`text-xl font-bold text-primary sm:text-2xl`,children:[`Hola, `,t.firstName]}),(0,P.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-relaxed text-muted-foreground`,children:`Pídeme una cotización de Walmart Connect y la armo en segundos con el tarifario interno vigente.`}),(0,P.jsx)(`div`,{className:`mt-8 grid w-full gap-3 sm:grid-cols-2`,children:aI.map(e=>(0,P.jsxs)(`button`,{type:`button`,onClick:()=>O(e.prompt),className:`group flex items-start gap-3 rounded-xl border border-border bg-card p-3.5 text-left transition-all hover:-translate-y-px hover:border-brand hover:shadow-[var(--shadow-soft)]`,children:[(0,P.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-brand-soft text-primary transition-colors group-hover:bg-brand group-hover:text-brand-foreground`,children:(0,P.jsx)(e.icon,{className:`size-4`})}),(0,P.jsxs)(`span`,{className:`min-w-0`,children:[(0,P.jsx)(`span`,{className:`block text-sm font-bold text-foreground`,children:e.title}),(0,P.jsx)(`span`,{className:`mt-0.5 block text-xs leading-snug text-muted-foreground`,children:e.prompt})]})]},e.title))})]}):r.map(e=>(0,P.jsxs)(Ev,{from:e.role,children:[e.role===`assistant`?(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-[0.7rem] font-bold uppercase tracking-[0.14em] text-brand`,children:[(0,P.jsx)(dn,{className:`size-3.5`}),`Cotizador`]}):null,(0,P.jsx)(oI,{attachments:e.attachments}),e.text?(0,P.jsx)(Dv,{children:e.role===`assistant`?(0,P.jsx)(jv,{children:e.text}):(0,P.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.text})}):null]},e.id)),f?(0,P.jsx)(Ev,{from:`assistant`,children:(0,P.jsx)(Dv,{children:(0,P.jsx)(sk,{children:`Armando la cotización...`})})}):null]}),(0,P.jsx)(Rn,{})]}),(0,P.jsx)(`div`,{className:`border-t border-border bg-card/85 backdrop-blur`,children:(0,P.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-4 pb-[max(1rem,env(safe-area-inset-bottom))] pt-3`,children:[(0,P.jsx)(`p`,{className:`mb-2.5 text-center text-xs font-normal text-muted-foreground`,children:`Para uso interno de GomezLee Marketing · Verifica siempre las tarifas antes de enviar al cliente.`}),(0,P.jsx)(vF,{onSend:ee,busy:f,onStop:T,draft:u,onDraftChange:d})]})})]})]})}export{lI as component};
|