even-keel 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +3 -3
  3. package/dist/src/agent/scripted.js +32 -3
  4. package/dist/src/badge/collect.js +26 -4
  5. package/dist/src/badge/render.js +2 -1
  6. package/dist/src/chain/conflict.js +41 -0
  7. package/dist/src/chain/forward.js +22 -5
  8. package/dist/src/chain/handover.js +1 -2
  9. package/dist/src/chain/maincheck.js +13 -9
  10. package/dist/src/changelog/drafts.js +4 -3
  11. package/dist/src/changelog/file.js +4 -0
  12. package/dist/src/changelog/limit.js +30 -0
  13. package/dist/src/ci/protection.js +8 -1
  14. package/dist/src/claude/adapter.js +4 -4
  15. package/dist/src/claude/sdk/host.js +10 -3
  16. package/dist/src/copilot/adapter.js +1 -1
  17. package/dist/src/copilot/errors.js +11 -6
  18. package/dist/src/gitlab/adapter.js +1 -0
  19. package/dist/src/limits/chatgpt-seat.js +49 -0
  20. package/dist/src/limits/chatgpt.js +37 -7
  21. package/dist/src/limits/copilot.js +12 -3
  22. package/dist/src/limits/model.js +3 -0
  23. package/dist/src/limits/overage.js +6 -2
  24. package/dist/src/limits/usage.js +42 -4
  25. package/dist/src/limits/watcher.js +1 -1
  26. package/dist/src/notice/en-advice.js +2 -1
  27. package/dist/src/notice/en-values.js +2 -0
  28. package/dist/src/notice/en.js +5 -1
  29. package/dist/src/opencode/adapter.js +1 -1
  30. package/dist/src/opencode/cli.js +10 -2
  31. package/dist/src/packages/service.js +37 -0
  32. package/dist/src/profiles/model.js +1 -0
  33. package/dist/src/profiles/service.js +1 -1
  34. package/dist/src/server.js +1 -0
  35. package/dist/src/service/chain-prompts.js +13 -1
  36. package/dist/src/service/chain.js +17 -12
  37. package/dist/src/service/trackers.js +3 -2
  38. package/dist/src/service.js +1 -1
  39. package/dist/src/sessions/ask.js +6 -0
  40. package/dist/src/sessions/monitor.js +1 -0
  41. package/dist/src/sessions/permission.js +3 -2
  42. package/dist/src/sessions/transcript.js +29 -2
  43. package/dist/src/storage/migrations.js +2 -0
  44. package/dist/src/storage/schema.js +1 -1
  45. package/dist/src/tools/panel.js +7 -9
  46. package/dist/src/tools/projectSettings.js +60 -0
  47. package/dist/src/tools/sessionSettings.js +11 -4
  48. package/dist/src/tracker/questions.js +35 -3
  49. package/dist/web/assets/{BadgeDialog-B8RUL_Ow.js → BadgeDialog-DTnQXw9H.js} +1 -1
  50. package/dist/web/assets/{DescriptionEditor-DUSwRGCZ.js → DescriptionEditor-CpRmzCRQ.js} +1 -1
  51. package/dist/web/assets/{ProjectPackages-BJEPijBV.js → ProjectPackages-BILdF91o.js} +1 -1
  52. package/dist/web/assets/{Select-NXi_Bsw-.js → Select-BkfVMQn9.js} +1 -1
  53. package/dist/web/assets/{TaskCard-DeP8bF9-.js → TaskCard-BdMTPm5U.js} +2 -2
  54. package/dist/web/assets/TranscriptWindow-BNF7AkTM.css +1 -0
  55. package/dist/web/assets/TranscriptWindow-DWmiEsux.js +4 -0
  56. package/dist/web/assets/{accountParts-CNUeXPYn.js → accountParts-BgNHNRlI.js} +1 -1
  57. package/dist/web/assets/blocks-CrABcaPz.js +12 -0
  58. package/dist/web/assets/{cardDrafts-CyzO-ro7.js → cardDrafts-BfmbAV1M.js} +1 -1
  59. package/dist/web/assets/{cardSide-CSmytank.js → cardSide-D2KI5tvT.js} +1 -1
  60. package/dist/web/assets/feedLine-Ba2zSS8M.js +1 -0
  61. package/dist/web/assets/{hooks-CgKVeUg8.js → hooks-JRdbz0x_.js} +1 -1
  62. package/dist/web/assets/index-CLtOpp9i.js +25 -0
  63. package/dist/web/assets/index-gsaRwWJo.css +1 -0
  64. package/dist/web/assets/{lib-DnFFmOv9.js → lib-BWXVCBDM.js} +1 -1
  65. package/dist/web/assets/overview-D3YlvCUL.js +7 -0
  66. package/dist/web/assets/packageGroups-Bp5E3IBW.js +1 -0
  67. package/dist/web/assets/{react-dom-DiYkIXNS.js → react-dom-BrsVbrva.js} +1 -1
  68. package/dist/web/assets/{rules-DLe7kZM5.js → rules-LK65q0Fp.js} +1 -1
  69. package/dist/web/assets/{useFileDrop-CEn6qZnh.js → useFileDrop-uBrD_n1G.js} +1 -1
  70. package/dist/web/assets/{useHeightGlide-BPjzH9PL.js → useHeightGlide-DUlst5w-.js} +1 -1
  71. package/dist/web/assets/useRowFocus-B25YUpUj.js +1 -0
  72. package/dist/web/index.html +15 -15
  73. package/even-keel.config.example.json +1 -1
  74. package/package.json +2 -2
  75. package/tally/tally.config.json +8 -0
  76. package/dist/web/assets/TranscriptWindow-BN6jSpev.css +0 -1
  77. package/dist/web/assets/TranscriptWindow-DVoHtE_o.js +0 -4
  78. package/dist/web/assets/blocks-CiOz7u_W.js +0 -12
  79. package/dist/web/assets/feedLine-txivfLQO.js +0 -1
  80. package/dist/web/assets/index-BT7ooY-T.js +0 -25
  81. package/dist/web/assets/index-hTYDOTAZ.css +0 -1
  82. package/dist/web/assets/overview-0NAogPYB.js +0 -7
  83. package/dist/web/assets/packageGroups-6mYiV3fk.js +0 -1
  84. package/dist/web/assets/useRowFocus-COI8llTH.js +0 -1
@@ -1,4 +1,4 @@
1
- import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{Mr as r,Rr as i,Tr as a,Zr as o,ki as s,ui as c,v as l,xi as u}from"./blocks-CiOz7u_W.js";import{A as d,C as f,D as p,E as m,F as h,I as g,L as _,M as v,N as y,O as b,P as x,S,T as C,_ as w,a as T,b as E,h as D,i as O,j as k,k as ee,m as te,n as A,o as j,p as M,r as ne,s as N,t as re,u as ie,v as ae,w as oe,x as se,y as ce}from"./hooks-CgKVeUg8.js";var P=t(s(),1);P.memo(le);function le({routes:e,manifest:t,state:n,isStatic:r,onError:i}){let a=P.useContext(w);return x(a,`You must render this element inside a <DataRouterContext.Provider> element`),D(e,void 0,{router:a.router,manifest:t,state:n,isStatic:r,onError:i})}function ue({to:e,replace:t,state:n,relative:r}){x(j(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=P.useContext(E);g(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=P.useContext(se),{pathname:s}=N(),c=ie(),l=d(e,m(o),s,r===`path`);C(typeof e==`string`?e:y(e),a.createHref(l),oe(a),`reject`);let u=JSON.stringify(l);return P.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function de(e){x(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function fe({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){x(!j(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=P.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=h(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,_=P.useMemo(()=>{let e=k(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return g(_!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:P.createElement(E.Provider,{value:c},P.createElement(ce.Provider,{children:t,value:_}))}function pe({children:e,location:t}){return te(me(e),t)}P.Component;function me(e,t=[]){let n=[];return P.Children.forEach(e,(e,r)=>{if(!P.isValidElement(e))return;let i=[...t,r];if(e.type===P.Fragment){n.push.apply(n,me(e.props.children,i));return}x(e.type===de,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;x(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=me(a.children,i)),n.push(o)}),n}var he=`application/x-www-form-urlencoded`;function ge(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function _e(e){return ge(e)&&e.tagName.toLowerCase()===`button`}function ve(e){return ge(e)&&e.tagName.toLowerCase()===`form`}function ye(e){return ge(e)&&e.tagName.toLowerCase()===`input`}function be(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xe(e,t){return e.button===0&&(!t||t===`_self`)&&!be(e)}function Se(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Ce(e,t){let n=Se(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var we=null;function Te(){if(we===null)try{new FormData(document.createElement(`form`),0),we=!1}catch{we=!0}return we}var Ee=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function De(e){return e!=null&&!Ee.has(e)?(g(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${he}"`),null):e}function Oe(e,t){let n,r,i,a,o;if(ve(e)){let o=e.getAttribute(`action`);r=o?k(o,t):null,n=e.getAttribute(`method`)||`get`,i=De(e.getAttribute(`enctype`))||he,a=new FormData(e)}else if(_e(e)||ye(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?k(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=De(e.getAttribute(`formenctype`))||De(o.getAttribute(`enctype`))||he,a=new FormData(o,e),!Te()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(ge(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=he,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function ke(e,t){if(e===!1||e==null)throw Error(t)}function Ae(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname=n.pathname.endsWith(`/`)?`${n.pathname}_.${t}`:`${n.pathname}.${t}`,n}async function je(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Me(e){return e!=null&&typeof e.page==`string`}function Ne(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Pe(e,t,n){return ze((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await je(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ne).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Fe(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ie(e,t,{includeHydrateFallback:n}={}){return Le(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Le(e){return[...new Set(e)]}function Re(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ze(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Me(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Re(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var Be=P.createContext(void 0);Be.displayName=`FrameworkContext`;function Ve(){let e=P.useContext(Be);return ke(e,`You must render this element inside a <HydratedRouter> element`),e}function He(e,t){let n=P.useContext(Be),[r,i]=P.useState(!1),[a,o]=P.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=P.useRef(null);P.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),P.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ue(s,p),onBlur:Ue(c,m),onMouseEnter:Ue(l,p),onMouseLeave:Ue(u,m),onTouchStart:Ue(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ue(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function We({page:e,...t}){let n=f(),{nonce:r}=Ve(),{router:i}=A(`PrefetchPageLinks`),a=P.useMemo(()=>i.match(e),[i,i.routes,e]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?P.createElement(Ke,{page:e,matches:a,...t}):P.createElement(qe,{page:e,matches:a,...t})):null}function Ge(e){let{manifest:t,routeModules:n}=Ve(),[r,i]=P.useState([]);return P.useEffect(()=>{let r=!1;return Pe(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ke({page:e,matches:t,...n}){let r=N(),i=P.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Ae(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return P.createElement(P.Fragment,null,i.map(e=>P.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function qe({page:e,matches:t,...n}){let r=N(),{manifest:i,routeModules:a}=Ve(),{matches:o}=O(`PrefetchPageLinks`),{loaderData:s}=ne(`PrefetchPageLinks`),c=P.useMemo(()=>Fe(e,t,o,i,r,`data`),[e,t,o,i,r]),l=P.useMemo(()=>Fe(e,t,o,i,r,`assets`),[e,t,o,i,r]),u=P.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:n.add(e.route.id))}),n.size===0)return[];let l=Ae(e,`data`);return o&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[s,r,i,c,t,e,a]),d=P.useMemo(()=>Ie(l,i),[l,i]),f=Ge(l);return P.createElement(P.Fragment,null,u.map(e=>P.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>P.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>P.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Je(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Ye=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Ye&&(window.__reactRouterVersion=`8`)}catch{}function Xe({basename:e,children:t,useTransitions:n,window:r}){let i=P.useRef(null);i.current??=v({window:r,v5Compat:!0});let a=i.current,[o,s]=P.useState({action:a.action,location:a.location}),c=P.useCallback(e=>{n===!1?s(e):P.startTransition(()=>s(e))},[n]);return P.useLayoutEffect(()=>a.listen(c),[a,c]),P.createElement(fe,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var Ze=P.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:m,...h},g){let{basename:v,navigator:y,useTransitions:b}=P.useContext(E),x=typeof l==`string`&&_.test(l),S=ee(l,v);l=S.to;let C=T(l,{relative:r}),w=N(),D=null;if(o){let e=d(o,[],w.mask?w.mask.pathname:`/`,!0);v!==`/`&&(e.pathname=e.pathname===`/`?v:p([v,e.pathname])),D=y.createHref(e)}let[O,k,te]=He(n,h),A=et(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:f,defaultShouldRevalidate:m,useTransitions:b});function j(t){e&&e(t),t.defaultPrevented||A(t)}let M=!(S.isExternal||i),ne=P.createElement(`a`,{...h,...te,href:(M?D:void 0)||S.absoluteURL||C,onClick:M?j:e,ref:Je(g,k),target:c,"data-discover":!x&&t===`render`?`true`:void 0});return O&&!x?P.createElement(P.Fragment,null,ne,P.createElement(We,{page:C})):ne});Ze.displayName=`Link`;var Qe=P.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=M(a,{relative:c.relative}),d=N(),f=P.useContext(ae),{navigator:p,basename:m}=P.useContext(E),h=f!=null&&ot(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f?.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=k(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(y)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return P.createElement(Ze,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Qe.displayName=`NavLink`;var $e=P.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=P.useContext(E),g=it(),v=at(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&_.test(s);return P.createElement(`form`,{ref:m,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?P.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});$e.displayName=`Form`;function et(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=ie(),d=N(),f=M(e,{relative:o});return P.useCallback(p=>{if(xe(p,t)){p.preventDefault();let t=n===void 0?y(d)===y(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?P.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function tt(e){g(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=P.useRef(Se(e)),n=P.useRef(!1),r=N(),i=P.useMemo(()=>Ce(r.search,n.current?null:t.current),[r.search]),a=ie();return[i,P.useCallback((e,t)=>{let r=Se(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var nt=0,rt=()=>`__${String(++nt)}__`;function it(){let{router:e}=A(`useSubmit`),{basename:t}=P.useContext(E),n=re(`useSubmit`),r=e.fetch,i=e.navigate;return P.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Oe(e,t);a.navigate===!1?await r(a.fetcherKey||rt(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function at(e,{relative:t}={}){let{basename:n}=P.useContext(E),r=P.useContext(se);x(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...M(e||`.`,{relative:t})},o=N();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:p([n,a.pathname])),y(a)}function ot(e,{relative:t}={}){let n=P.useContext(S);x(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=A(`useViewTransitionState`),i=M(e,{relative:t});if(!n.isTransitioning)return!1;let a=k(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=k(n.nextLocation.pathname,r)||n.nextLocation.pathname;return b(i.pathname,o)!=null||b(i.pathname,a)!=null}function st(e){if(e?.month===void 0){let t=[`fiveHour`,`sevenDay`].filter(t=>e?.absent?.includes(t)!==!0),n=t.filter(t=>e?.[t]!=null);return e?.source===`api`&&n.length>0?n:[...t]}return[...[`fiveHour`,`sevenDay`].filter(t=>e[t]!==null),`month`]}var ct=8;function lt(e,t){if(e===void 0)return null;let n=e.accounts.find(e=>e.status?.email===t);return n===void 0?null:e.accounts.map(e=>e.key).sort().indexOf(n.key)%ct+1}function ut(e,t,n){return n!=null&&!(e?.accounts.some(e=>e.status?.email===n&&e.projects.includes(t))??!1)}function dt(e,t){let n=t.status?.email??null,r=n===null?null:lt(e,n);return r===null?e.accounts.map(e=>e.key).sort().indexOf(t.key)%ct+1:r}var ft=[`claude`,`codex`,`opencode`,`copilot`];function pt(e){return e.cloud===void 0?e.apiKey?`apiKey`:`cli`:`cloud`}function mt(e){return e.apiKey||e.cloud!==void 0}var ht=[`zen`,`claudeSubscription`,`chatgpt`,`github`,`anthropicKey`,`openaiKey`,`openrouterKey`,`bedrock`,`vertex`,`foundry`,`other`],gt={claudeSubscription:`anthropic`,anthropicKey:`anthropic`,bedrock:`aws`,vertex:`google`,foundry:`microsoft`,chatgpt:`openai`,openaiKey:`openai`,openrouterKey:`openrouter`,zen:`zen`,github:`github`,other:null};function _t(e){if(e.agent===`copilot`)return`github`;if(e.cloud!==void 0)return e.cloud.cloud;if(e.agent===`claude`)return e.apiKey?`anthropicKey`:`claudeSubscription`;if(e.agent===`codex`)return e.apiKey?`openaiKey`:`chatgpt`;if(e.agent!==`opencode`)return`other`;let t=e.status?.subscriptionType?.split(`,`).map(e=>e.trim())??[];return e.status?.authMethod===`subscription_key`?`zen`:e.apiKey?t.includes(`anthropic`)?`anthropicKey`:t.includes(`openai`)?`openaiKey`:t.includes(`openrouter`)?`openrouterKey`:`zen`:t.includes(`openai`)?`chatgpt`:t.includes(`github-copilot`)?`github`:t.includes(`anthropic`)?`claudeSubscription`:`zen`}function vt(e){return ht.map(t=>({access:t,entries:e.filter(e=>_t(e)===t)})).filter(e=>e.entries.length>0)}function yt({login:e}){return e?.agent===`codex`||e?.agent===`opencode`}function bt(e,t){return e.missing.includes(t)}var xt={claude:`login.claudeMissing`,codex:`login.codexMissing`,opencode:`login.opencodeMissing`,copilot:`login.copilotMissing`};function St(e,t){return e===null?[...a]:a.filter(n=>t.includes(n)||e.accounts.some(e=>e.agent===n))}function Ct(e,t){let n=[...r(e.accounts,t)].sort((t,n)=>Number(n.key===e.active)-Number(t.key===e.active)||Number(wt(e,n))-Number(wt(e,t))),i=[...ft];return[...i,...new Set(n.map(e=>e.agent).filter(e=>!i.includes(e)))].map(e=>({agent:e,entries:n.filter(t=>t.agent===e)})).filter(e=>e.entries.length>0)}function wt(e,t){return e.active===t.key||e.apps.some(e=>e.account===t.key)||t.projects.length>0||t.sessions.length>0}function Tt(e){let t=null;for(let n of st(e)){let r=e?.[n]??null;if(r===null||r.used!==void 0)continue;let i=Math.round(100-Math.min(Math.max(r.usedPercentage,0),100));(t===null||i<t.free)&&(t={span:n,free:i,window:r})}return t}function Et(e,t,n){if(e.missing.includes(t))return{state:`cliMissing`};let r=e.accounts.find(e=>e.key===n&&e.agent===t);return r===void 0?{state:`noAccount`}:o(r)?{state:`unsupported`,entry:r}:{state:r.needsLogin?`signIn`:`ready`,entry:r}}var Dt=[`7d`,`30d`,`month`,`last-month`,`3m`,`year`,`all`],Ot=864e5;function kt(e){return Dt.includes(e)}function At(e){return`${e.getFullYear()}-${jt(e.getMonth()+1)}-${jt(e.getDate())}`}function jt(e){return String(e).padStart(2,`0`)}function F(e){return new Date(`${e}T00:00:00Z`)}function Mt(e){return e.toISOString().slice(0,10)}function I(e,t){return Mt(new Date(F(e).getTime()+t*Ot))}function Nt(e){let t=F(e);return Mt(new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,0)))}function Pt(e,t){let n=F(e),r=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+t,1)),i=Number(Nt(Mt(r)).slice(8));return Mt(new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),Math.min(n.getUTCDate(),i))))}function Ft(e){return Math.round((F(e.to).getTime()-F(e.from).getTime())/Ot)+1}function It(e,t,n){if(!(`preset`in e))return{from:e.from,to:e.to};let r=`${t.slice(0,7)}-01`;switch(e.preset){case`7d`:return{from:I(t,-6),to:t};case`30d`:return{from:I(t,-29),to:t};case`3m`:return{from:I(Pt(t,-3),1),to:t};case`month`:return{from:r,to:t};case`last-month`:{let e=Pt(r,-1);return{from:e,to:Nt(e)}}case`year`:return{from:`${t.slice(0,4)}-01-01`,to:t};case`all`:return{from:n!==null&&n<t?n:t,to:t}}}function Lt(e){let t=F(e.from),n=F(e.to);return(n.getUTCFullYear()-t.getUTCFullYear())*12+n.getUTCMonth()-t.getUTCMonth()+1}function Rt(e,t){return e.from.endsWith(`-01-01`)&&(e.to.endsWith(`-12-31`)||e.to===t&&e.to.slice(0,4)===t.slice(0,4))?Number(e.to.slice(0,4))-Number(e.from.slice(0,4))+1:null}function zt(e,t){return e.from.endsWith(`-01`)&&(e.to===Nt(e.to)||e.to===t)?Lt(e):null}function Bt(e,t,n){let r=Rt(e,n),i=r===null?zt(e,n):r*12;if(i!==null){let r=Pt(e.from,t*i);if(r>n)return e;let a=I(Pt(r,i),-1);return{from:r,to:a>n?n:a}}let a=Ft(e),o={from:I(e.from,t*a),to:I(e.to,t*a)};return o.to<=n?o:{from:I(n,1-a),to:n}}function Vt(e){let t=Ft(e);return{from:I(e.from,-t),to:I(e.from,-1)}}function Ht(e){let t=Ft(e);return t<=62?`day`:t<=366?`week`:`month`}function Ut(e,t){return t===`day`?e:t===`month`?`${e.slice(0,7)}-01`:I(e,-((F(e).getUTCDay()+6)%7))}function Wt(e,t){return t===`day`?I(e,1):t===`week`?I(e,7):Pt(e,1)}function Gt(e,t){let n=[];for(let r=Ut(e.from,t);r<=e.to;r=Wt(r,t))n.push(r);return n}function Kt(e,t=!0){let n=`${Number(e.slice(8))} ${u.stats.period.monthsOfDay[Number(e.slice(5,7))-1]}`;return t?`${n} ${e.slice(0,4)}`:n}function qt(e){if(e.from===e.to)return Kt(e.from);let t=e.from.slice(0,4)===e.to.slice(0,4);return`${Kt(e.from,!t)} — ${Kt(e.to)}`}function Jt(e,t){return t===`month`?`${u.stats.period.monthsShort[Number(e.slice(5,7))-1]} ${e.slice(0,4)}`:Kt(e,!1)}var Yt={opus:`Opus`,sonnet:`Sonnet`,haiku:`Haiku`,fable:`Fable`,sol:`Sol`,luna:`Luna`,astra:`Astra`,terra:`Terra`,gpt:`GPT`,deepseek:`DeepSeek`,qwen:`Qwen`,gemini:`Gemini`,kimi:`Kimi`,glm:`GLM`,mistral:`Mistral`,llama:`Llama`,minimax:`MiniMax`},Xt={chain:`Even Keel`,vscode:`VS Code`,cli:`CLI`,"tally-classify":`Tally`,codex:`Codex`,"codex-exec":`Codex CLI`,"codex-desktop":`Codex Desktop`,opencode:`OpenCode`,copilot:`GitHub Copilot`},Zt=c(e=>new Intl.NumberFormat(e,{maximumFractionDigits:0}));function Qt(e){return e===0?`$0`:e<.01?`< $0.01`:e<100?`$${e.toFixed(2)}`:`$${Zt().format(e).replace(/\s/g,` `)}`}function $t(e,t){if(t<=0)return null;let n=Math.round((e-t)/t*100);return n===0?u.units.percent(`±0`):u.units.percent(n>0?`+${n}`:`−${-n}`)}function en(e){return e===null?`—`:e===0?u.units.percent(`0`):e<1?u.units.percent(`< 1`):u.units.percent(String(Math.round(e)))}function tn(e){if(e===null)return`—`;let{hour:t,minute:n}=u.units;if(e===0)return`0 ${n}`;if(e<30)return`< 1 ${n}`;let r=Math.round(e/60);if(r<60)return`${r} ${n}`;if(r>=600)return`${Math.round(r/60)} ${t}`;let i=r%60;return i===0?`${r/60} ${t}`:`${Math.floor(r/60)} ${t} ${String(i).padStart(2,`0`)} ${n}`}function nn(e){return e===null?`—`:e<10?`${Number(e.toFixed(1))} ${u.units.second}`:e<120?`${Math.round(e)} ${u.units.second}`:e<600?`${Number((e/60).toFixed(1))} ${u.units.minute}`:tn(e)}function rn(e){return e===null?`—`:`×${e>=10?Math.round(e):Number(e.toFixed(1))}`}function an(e){return e===null?u.stats.labels.unsorted:u.stats.labels.reasons[e]??e}function on(e){return u.stats.labels.kinds[e]??e}function sn(e){return e===null?u.stats.labels.outsideChain:u.stats.labels.launches[e]??e}function cn(e){let t=/^claude-([a-z]+)((?:-\d{1,2})+)(?:-\d{8})?$/.exec(e);return t===null?e:`${Yt[t[1]]??t[1]} ${t[2].slice(1).replaceAll(`-`,`.`)}`}function ln(e){return e===`other`?u.stats.labels.otherModels:Yt[e]??e}function un(e){return e===`desktop`?u.stats.labels.desktop:e===`other`?u.stats.labels.otherEntrypoint:Xt[e]??e}function dn(e,t,n){let r=n===null||n.from<t.from?t.from:n.from,i=n===null||n.to>t.to?t.to:n.to;if(n===null||r>i)return{share:null,perWeek:!1,from:null,to:null};let a=Ft({from:r,to:i}),o=e??0;return{share:a>7?o*7/a:o,perWeek:a>7,from:r>t.from?r:null,to:i<t.to?i:null}}function fn(e){let t=new Map;for(let{account:n,peak:r,open:i}of e){let e=t.get(n)??{account:n,closed:[],open:[]};t.set(n,e),(i?e.open:e.closed).push(r)}return[...t.values()]}var L=i();function pn({title:e,question:t,confirm:n,cancel:r,busy:i,failure:a,safe:o=!1,onConfirm:s,onClose:c}){let u=(0,P.useRef)(null),d=l(u,c),f=(0,P.useId)();return(0,P.useEffect)(()=>{u.current?.open===!1&&u.current.showModal()},[]),(0,L.jsx)(`dialog`,{ref:u,className:`add-package add-package--narrow`,"aria-labelledby":f,onCancel:e=>{e.preventDefault(),e.stopPropagation(),c()},...d,children:(0,L.jsxs)(`div`,{className:`add-package__frame`,children:[(0,L.jsx)(`header`,{className:`add-package__head`,children:(0,L.jsx)(`h2`,{id:f,className:`add-package__title`,children:e})}),(0,L.jsx)(`div`,{className:`add-package__body`,children:(0,L.jsx)(`p`,{className:`add-package__question`,children:t})}),a!==void 0&&(0,L.jsx)(`p`,{role:`alert`,className:`notice notice--error add-package__failure`,children:a}),(0,L.jsxs)(`footer`,{className:`add-package__foot`,children:[(0,L.jsx)(`span`,{className:`add-package__spacer`}),(0,L.jsx)(`button`,{type:`button`,className:`button`,disabled:i,onClick:c,children:r}),(0,L.jsx)(`button`,{type:`button`,className:o?`button button--primary`:`button button--danger`,disabled:i,onClick:s,children:n})]})]})})}function mn(){}function hn(){}function gn(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?vn(e.position):`start`in e||`end`in e?vn(e):`line`in e||`column`in e?_n(e):``}function _n(e){return yn(e&&e.line)+`:`+yn(e&&e.column)}function vn(e){return _n(e&&e.start)+`-`+_n(e&&e.end)}function yn(e){return e&&typeof e==`number`?e:1}var R=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=gn(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};R.prototype.file=``,R.prototype.name=``,R.prototype.reason=``,R.prototype.message=``,R.prototype.stack=``,R.prototype.column=void 0,R.prototype.line=void 0,R.prototype.ancestors=void 0,R.prototype.cause=void 0,R.prototype.fatal=void 0,R.prototype.place=void 0,R.prototype.ruleId=void 0,R.prototype.source=void 0;var bn={};function xn(e,t){let n=t||bn;return Sn(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Sn(e,t,n){if(wn(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Cn(e.children,t,n)}return Array.isArray(e)?Cn(e,t,n):``}function Cn(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Sn(e[i],t,n);return r.join(``)}function wn(e){return!!(e&&typeof e==`object`)}var Tn=document.createElement(`i`);function En(e){let t=`&`+e+`;`;Tn.innerHTML=t;let n=Tn.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function z(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function B(e,t){return e.length>0?(z(e,e.length,0,t),e):t}var Dn={}.hasOwnProperty;function On(e){let t={},n=-1;for(;++n<e.length;)kn(t,e[n]);return t}function kn(e,t){let n;for(n in t){let r=(Dn.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Dn.call(r,a)||(r[a]=[]);let e=i[a];An(r[a],Array.isArray(e)?e:e?[e]:[])}}}function An(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);z(e,0,0,r)}function jn(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function V(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var H=q(/[A-Za-z]/),U=q(/[\dA-Za-z]/),Mn=q(/[#-'*+\--9=?A-Z^-~]/);function Nn(e){return e!==null&&(e<32||e===127)}var Pn=q(/\d/),Fn=q(/[\dA-Fa-f]/),In=q(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function K(e){return e===-2||e===-1||e===32}var Ln=q(/\p{P}|\p{S}/u),Rn=q(/\s/);function q(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function J(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return K(r)?(e.enter(n),s(r)):t(r)}function s(r){return K(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function zn(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&K(t)?(e.enter(r),c(t)):l(t)}function c(t){return K(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Bn={tokenize:Vn};function Vn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return W(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Hn=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Un(this,e,t,n,!1)}addBefore(e,t,n){Un(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Un(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var Wn={tokenize:Kn},Gn={tokenize:qn};function Kn(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Hn;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Gn,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Gn,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return W(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Hn;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function qn(e,t,n){return J(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Jn(e){if(e===null||G(e)||Rn(e))return 1;if(Ln(e))return 2}function Yn(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Xn={name:`attention`,resolveAll:Zn,tokenize:Qn};function Zn(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};$n(o,-a),$n(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=B(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=B(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=B(r,Yn(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=B(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=B(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),z(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Qn(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Jn(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Jn(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function $n(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var er={name:`autolink`,tokenize:tr};function tr(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return H(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||U(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||U(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Nn(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Mn(t)?(e.consume(t),l):n(t)}function u(e){return U(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||U(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var nr={partial:!0,tokenize:rr};function rr(e,t,n){return r;function r(t){return K(t)?J(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||W(e)?t(e):n(e)}}var ir={continuation:{tokenize:or},exit:sr,name:`blockQuote`,tokenize:ar};function ar(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return K(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function or(e,t,n){let r=this;return i;function i(t){return K(t)?J(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ir,t,n)(r)}}function sr(e){e.exit(`blockQuote`)}var cr={name:`characterEscape`,tokenize:lr};function lr(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return In(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var ur={name:`characterReference`,tokenize:dr};function dr(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=U,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Fn,u):(e.enter(`characterReferenceValue`),a=7,o=Pn,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===U&&!En(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var fr={partial:!0,tokenize:pr};function pr(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var mr={concrete:!0,name:`codeFenced`,tokenize:hr};function hr(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),K(t)?J(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||W(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(fr,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),J(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||W(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&K(t)?J(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||W(t)?e.check(fr,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||W(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),K(t)?J(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),K(t)?J(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||W(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var gr={name:`codeIndented`,tokenize:vr},_r={partial:!0,tokenize:yr};function vr(e,t,n){return r;function r(t){return e.enter(`codeIndented`),zn(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):W(t)?e.attempt(_r,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||W(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function yr(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):W(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):zn(e,t,a,`linePrefix`,4,4)(o)}function a(e){return W(e)?i(e):n(e)}}var br={name:`codeText`,previous:Sr,resolve:xr,tokenize:Cr};function xr(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Sr(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Cr(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||W(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var wr=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Tr(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Tr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Tr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Tr(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Tr(this.left,t.reverse())}}}};function Tr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Er(e){let t={},n=-1,r,i,a,o,s,c,l,u=new wr(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Dr(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return z(e,0,1/0,u.slice(0)),!l}function Dr(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Or={resolve:Ar,tokenize:jr},kr={partial:!0,tokenize:Mr};function Ar(e){return Er(e),e}function jr(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):W(t)?e.check(kr,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Mr(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,a,`linePrefix`)}function a(i){if(i===null||W(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Nr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Nn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||W(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||G(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Nn(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Pr(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):W(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||W(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!K(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Fr(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||W(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Ir(e,t){let n;return r;function r(i){return W(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):K(i)?J(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Lr={name:`definition`,tokenize:zr},Rr={partial:!0,tokenize:Br};function zr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Pr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=V(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return G(t)?Ir(e,l)(t):l(t)}function l(t){return Nr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Rr,d,d)(t)}function d(t){return K(t)?J(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||W(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Br(e,t,n){return r;function r(t){return G(t)?Ir(e,i)(t):n(t)}function i(t){return Fr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return K(t)?J(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||W(e)?t(e):n(e)}}var Vr={name:`hardBreakEscape`,tokenize:Hr};function Hr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return W(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ur={name:`headingAtx`,resolve:Wr,tokenize:Gr};function Wr(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};z(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Gr(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||G(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||W(n)?(e.exit(`atxHeading`),t(n)):K(n)?J(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||G(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Kr=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),qr=[`pre`,`script`,`style`,`textarea`],Jr={concrete:!0,name:`htmlFlow`,resolveTo:Xr,tokenize:Zr},Yr={partial:!0,tokenize:Qr};function Xr(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Zr(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:N):H(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):H(a)?(e.consume(a),i=4,r.interrupt?t:N):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:N):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return H(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||G(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&qr.includes(l)?(i=1,r.interrupt?t(s):O(s)):Kr.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||U(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return K(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||H(t)?(e.consume(t),b):K(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||U(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):K(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):K(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||W(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||G(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||K(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||W(t)?O(t):K(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),A):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),N):t===93&&i===5?(e.consume(t),ne):W(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Yr,ie,k)(t)):t===null||W(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(fr,ee,ie)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||W(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),N):O(t)}function j(t){return t===47?(e.consume(t),o=``,M):O(t)}function M(t){if(t===62){let n=o.toLowerCase();return qr.includes(n)?(e.consume(t),re):O(t)}return H(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),M):O(t)}function ne(t){return t===93?(e.consume(t),N):O(t)}function N(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),N):O(t)}function re(t){return t===null||W(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function Qr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(nr,t,n)}}var $r={name:`htmlText`,tokenize:ei};function ei(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):H(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):H(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):W(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?A(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):W(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?A(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?A(t):W(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):W(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return H(t)?(e.consume(t),S):n(t)}function S(t){return t===45||U(t)?(e.consume(t),S):C(t)}function C(t){return W(t)?(o=C,j(t)):K(t)?(e.consume(t),C):A(t)}function w(t){return t===45||U(t)?(e.consume(t),w):t===47||t===62||G(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||H(t)?(e.consume(t),E):W(t)?(o=T,j(t)):K(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||U(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):W(t)?(o=D,j(t)):K(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):W(t)?(o=O,j(t)):K(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):W(t)?(o=k,j(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||G(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||G(e)?T(e):n(e)}function A(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),M}function M(t){return K(t)?J(e,ne,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ne(t)}function ne(t){return e.enter(`htmlTextData`),o(t)}}var ti={name:`labelEnd`,resolveAll:ai,resolveTo:oi,tokenize:si},ni={tokenize:ci},ri={tokenize:li},ii={tokenize:ui};function ai(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&z(e,0,e.length,n),e}function oi(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=B(o,e.slice(i+1,i+r+3)),o=B(o,[[`enter`,l,t]]),o=B(o,Yn(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=B(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=B(o,e.slice(a+1)),o=B(o,[[`exit`,s,t]]),z(e,i,e.length,o),e}function si(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(V(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(ni,u,o?u:d)(t):t===91?e.attempt(ri,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(ii,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function ci(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return G(t)?Ir(e,a)(t):a(t)}function a(t){return t===41?u(t):Nr(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return G(t)?Ir(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Fr(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return G(t)?Ir(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function li(e,t,n){let r=this;return i;function i(t){return Pr.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(V(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function ui(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var di={name:`labelStartImage`,resolveAll:ti.resolveAll,tokenize:fi};function fi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var pi={name:`labelStartLink`,resolveAll:ti.resolveAll,tokenize:mi};function mi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var hi={name:`lineEnding`,tokenize:gi};function gi(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}}var _i={name:`thematicBreak`,tokenize:vi};function vi(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||W(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),K(t)?J(e,s,`whitespace`)(t):s(t))}}var Y={continuation:{tokenize:Si},exit:wi,name:`list`,tokenize:xi},yi={partial:!0,tokenize:Ti},bi={partial:!0,tokenize:Ci};function xi(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){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Pn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(_i,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Pn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(nr,r.interrupt?n:u,e.attempt(yi,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return K(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Si(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(nr,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,J(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!K(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(bi,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,J(e,e.attempt(Y,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Ci(e,t,n){let r=this;return J(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function wi(e){e.exit(this.containerState.type)}function Ti(e,t,n){let r=this;return J(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!K(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Ei={name:`setextUnderline`,resolveTo:Di,tokenize:Oi};function Di(e,t){let n=new Hn,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function Oi(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),K(t)?J(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||W(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var ki={tokenize:Ai};function Ai(e){let t=this,n=e.attempt(nr,r,e.attempt(this.parser.constructs.flowInitial,i,J(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Or,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ji={resolveAll:Fi()},Mi=Pi(`string`),Ni=Pi(`text`);function Pi(e){return{resolveAll:Fi(e===`text`?Ii:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Fi(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Ii(e,t){let n=new Hn,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Li=e({attentionMarkers:()=>Gi,contentInitial:()=>zi,disable:()=>Ki,document:()=>Ri,flow:()=>Vi,flowInitial:()=>Bi,insideSpan:()=>Wi,string:()=>Hi,text:()=>Ui}),Ri={42:Y,43:Y,45:Y,48:Y,49:Y,50:Y,51:Y,52:Y,53:Y,54:Y,55:Y,56:Y,57:Y,62:ir},zi={91:Lr},Bi={[-2]:gr,[-1]:gr,32:gr},Vi={35:Ur,42:_i,45:[Ei,_i],60:Jr,61:Ei,95:_i,96:mr,126:mr},Hi={38:ur,92:cr},Ui={[-5]:hi,[-4]:hi,[-3]:hi,33:di,38:ur,42:Xn,60:[er,$r],91:pi,92:[Vr,cr],93:ti,95:Xn,96:br},Wi={null:[Xn,ji]},Gi={null:[42,95]},Ki={null:[]};function qi(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=B(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Yn(a,l.events,l),l.events):[]}function f(e,t){return Yi(p(e),t)}function p(e){return Ji(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){W(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&z(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ji(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Yi(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
1
+ import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{Mr as r,Rr as i,Tr as a,Zr as o,ki as s,ui as c,v as l,xi as u}from"./blocks-CrABcaPz.js";import{A as d,C as f,D as p,E as m,F as h,I as g,L as _,M as v,N as y,O as b,P as x,S,T as C,_ as w,a as T,b as E,h as D,i as O,j as k,k as ee,m as te,n as A,o as j,p as M,r as ne,s as N,t as re,u as ie,v as ae,w as oe,x as se,y as ce}from"./hooks-JRdbz0x_.js";var P=t(s(),1);P.memo(le);function le({routes:e,manifest:t,state:n,isStatic:r,onError:i}){let a=P.useContext(w);return x(a,`You must render this element inside a <DataRouterContext.Provider> element`),D(e,void 0,{router:a.router,manifest:t,state:n,isStatic:r,onError:i})}function ue({to:e,replace:t,state:n,relative:r}){x(j(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=P.useContext(E);g(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=P.useContext(se),{pathname:s}=N(),c=ie(),l=d(e,m(o),s,r===`path`);C(typeof e==`string`?e:y(e),a.createHref(l),oe(a),`reject`);let u=JSON.stringify(l);return P.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function de(e){x(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function fe({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){x(!j(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=P.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=h(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,_=P.useMemo(()=>{let e=k(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return g(_!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:P.createElement(E.Provider,{value:c},P.createElement(ce.Provider,{children:t,value:_}))}function pe({children:e,location:t}){return te(me(e),t)}P.Component;function me(e,t=[]){let n=[];return P.Children.forEach(e,(e,r)=>{if(!P.isValidElement(e))return;let i=[...t,r];if(e.type===P.Fragment){n.push.apply(n,me(e.props.children,i));return}x(e.type===de,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`);let a=e.props;x(!a.index||!a.children,`An index route cannot have child routes.`);let o={id:a.id||i.join(`-`),caseSensitive:a.caseSensitive,element:a.element,Component:a.Component,index:a.index,path:a.path,middleware:a.middleware,loader:a.loader,action:a.action,hydrateFallbackElement:a.hydrateFallbackElement,HydrateFallback:a.HydrateFallback,errorElement:a.errorElement,ErrorBoundary:a.ErrorBoundary,shouldRevalidate:a.shouldRevalidate,handle:a.handle,lazy:a.lazy};a.children&&(o.children=me(a.children,i)),n.push(o)}),n}var he=`application/x-www-form-urlencoded`;function ge(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function _e(e){return ge(e)&&e.tagName.toLowerCase()===`button`}function ve(e){return ge(e)&&e.tagName.toLowerCase()===`form`}function ye(e){return ge(e)&&e.tagName.toLowerCase()===`input`}function be(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xe(e,t){return e.button===0&&(!t||t===`_self`)&&!be(e)}function Se(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Ce(e,t){let n=Se(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var we=null;function Te(){if(we===null)try{new FormData(document.createElement(`form`),0),we=!1}catch{we=!0}return we}var Ee=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function De(e){return e!=null&&!Ee.has(e)?(g(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${he}"`),null):e}function Oe(e,t){let n,r,i,a,o;if(ve(e)){let o=e.getAttribute(`action`);r=o?k(o,t):null,n=e.getAttribute(`method`)||`get`,i=De(e.getAttribute(`enctype`))||he,a=new FormData(e)}else if(_e(e)||ye(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?k(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=De(e.getAttribute(`formenctype`))||De(o.getAttribute(`enctype`))||he,a=new FormData(o,e),!Te()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(ge(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=he,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function ke(e,t){if(e===!1||e==null)throw Error(t)}function Ae(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname=n.pathname.endsWith(`/`)?`${n.pathname}_.${t}`:`${n.pathname}.${t}`,n}async function je(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Me(e){return e!=null&&typeof e.page==`string`}function Ne(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Pe(e,t,n){return ze((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await je(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ne).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Fe(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ie(e,t,{includeHydrateFallback:n}={}){return Le(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Le(e){return[...new Set(e)]}function Re(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ze(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Me(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Re(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var Be=P.createContext(void 0);Be.displayName=`FrameworkContext`;function Ve(){let e=P.useContext(Be);return ke(e,`You must render this element inside a <HydratedRouter> element`),e}function He(e,t){let n=P.useContext(Be),[r,i]=P.useState(!1),[a,o]=P.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=P.useRef(null);P.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),P.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ue(s,p),onBlur:Ue(c,m),onMouseEnter:Ue(l,p),onMouseLeave:Ue(u,m),onTouchStart:Ue(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ue(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function We({page:e,...t}){let n=f(),{nonce:r}=Ve(),{router:i}=A(`PrefetchPageLinks`),a=P.useMemo(()=>i.match(e),[i,i.routes,e]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?P.createElement(Ke,{page:e,matches:a,...t}):P.createElement(qe,{page:e,matches:a,...t})):null}function Ge(e){let{manifest:t,routeModules:n}=Ve(),[r,i]=P.useState([]);return P.useEffect(()=>{let r=!1;return Pe(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ke({page:e,matches:t,...n}){let r=N(),i=P.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Ae(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return P.createElement(P.Fragment,null,i.map(e=>P.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function qe({page:e,matches:t,...n}){let r=N(),{manifest:i,routeModules:a}=Ve(),{matches:o}=O(`PrefetchPageLinks`),{loaderData:s}=ne(`PrefetchPageLinks`),c=P.useMemo(()=>Fe(e,t,o,i,r,`data`),[e,t,o,i,r]),l=P.useMemo(()=>Fe(e,t,o,i,r,`assets`),[e,t,o,i,r]),u=P.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:n.add(e.route.id))}),n.size===0)return[];let l=Ae(e,`data`);return o&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[s,r,i,c,t,e,a]),d=P.useMemo(()=>Ie(l,i),[l,i]),f=Ge(l);return P.createElement(P.Fragment,null,u.map(e=>P.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>P.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>P.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Je(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Ye=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Ye&&(window.__reactRouterVersion=`8`)}catch{}function Xe({basename:e,children:t,useTransitions:n,window:r}){let i=P.useRef(null);i.current??=v({window:r,v5Compat:!0});let a=i.current,[o,s]=P.useState({action:a.action,location:a.location}),c=P.useCallback(e=>{n===!1?s(e):P.startTransition(()=>s(e))},[n]);return P.useLayoutEffect(()=>a.listen(c),[a,c]),P.createElement(fe,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var Ze=P.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:m,...h},g){let{basename:v,navigator:y,useTransitions:b}=P.useContext(E),x=typeof l==`string`&&_.test(l),S=ee(l,v);l=S.to;let C=T(l,{relative:r}),w=N(),D=null;if(o){let e=d(o,[],w.mask?w.mask.pathname:`/`,!0);v!==`/`&&(e.pathname=e.pathname===`/`?v:p([v,e.pathname])),D=y.createHref(e)}let[O,k,te]=He(n,h),A=et(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:f,defaultShouldRevalidate:m,useTransitions:b});function j(t){e&&e(t),t.defaultPrevented||A(t)}let M=!(S.isExternal||i),ne=P.createElement(`a`,{...h,...te,href:(M?D:void 0)||S.absoluteURL||C,onClick:M?j:e,ref:Je(g,k),target:c,"data-discover":!x&&t===`render`?`true`:void 0});return O&&!x?P.createElement(P.Fragment,null,ne,P.createElement(We,{page:C})):ne});Ze.displayName=`Link`;var Qe=P.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=M(a,{relative:c.relative}),d=N(),f=P.useContext(ae),{navigator:p,basename:m}=P.useContext(E),h=f!=null&&ot(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f?.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=k(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(y)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return P.createElement(Ze,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Qe.displayName=`NavLink`;var $e=P.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=P.useContext(E),g=it(),v=at(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&_.test(s);return P.createElement(`form`,{ref:m,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?P.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});$e.displayName=`Form`;function et(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=ie(),d=N(),f=M(e,{relative:o});return P.useCallback(p=>{if(xe(p,t)){p.preventDefault();let t=n===void 0?y(d)===y(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?P.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function tt(e){g(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=P.useRef(Se(e)),n=P.useRef(!1),r=N(),i=P.useMemo(()=>Ce(r.search,n.current?null:t.current),[r.search]),a=ie();return[i,P.useCallback((e,t)=>{let r=Se(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var nt=0,rt=()=>`__${String(++nt)}__`;function it(){let{router:e}=A(`useSubmit`),{basename:t}=P.useContext(E),n=re(`useSubmit`),r=e.fetch,i=e.navigate;return P.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Oe(e,t);a.navigate===!1?await r(a.fetcherKey||rt(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function at(e,{relative:t}={}){let{basename:n}=P.useContext(E),r=P.useContext(se);x(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...M(e||`.`,{relative:t})},o=N();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:p([n,a.pathname])),y(a)}function ot(e,{relative:t}={}){let n=P.useContext(S);x(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=A(`useViewTransitionState`),i=M(e,{relative:t});if(!n.isTransitioning)return!1;let a=k(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=k(n.nextLocation.pathname,r)||n.nextLocation.pathname;return b(i.pathname,o)!=null||b(i.pathname,a)!=null}function st(e){if(e?.month===void 0){let t=[`fiveHour`,`sevenDay`].filter(t=>e?.absent?.includes(t)!==!0),n=t.filter(t=>e?.[t]!=null);return e?.source===`api`&&n.length>0?n:[...t]}return[...[`fiveHour`,`sevenDay`].filter(t=>e[t]!==null),`month`]}var ct=8;function lt(e,t){if(e===void 0)return null;let n=e.accounts.find(e=>e.status?.email===t);return n===void 0?null:e.accounts.map(e=>e.key).sort().indexOf(n.key)%ct+1}function ut(e,t,n){return n!=null&&!(e?.accounts.some(e=>e.status?.email===n&&e.projects.includes(t))??!1)}function dt(e,t){let n=t.status?.email??null,r=n===null?null:lt(e,n);return r===null?e.accounts.map(e=>e.key).sort().indexOf(t.key)%ct+1:r}var ft=[`claude`,`codex`,`opencode`,`copilot`];function pt(e){return e.cloud===void 0?e.apiKey?`apiKey`:`cli`:`cloud`}function mt(e){return e.apiKey||e.cloud!==void 0}var ht=[`zen`,`claudeSubscription`,`chatgpt`,`github`,`anthropicKey`,`openaiKey`,`openrouterKey`,`bedrock`,`vertex`,`foundry`,`other`],gt={claudeSubscription:`anthropic`,anthropicKey:`anthropic`,bedrock:`aws`,vertex:`google`,foundry:`microsoft`,chatgpt:`openai`,openaiKey:`openai`,openrouterKey:`openrouter`,zen:`zen`,github:`github`,other:null};function _t(e){if(e.agent===`copilot`)return`github`;if(e.cloud!==void 0)return e.cloud.cloud;if(e.agent===`claude`)return e.apiKey?`anthropicKey`:`claudeSubscription`;if(e.agent===`codex`)return e.apiKey?`openaiKey`:`chatgpt`;if(e.agent!==`opencode`)return`other`;let t=e.status?.subscriptionType?.split(`,`).map(e=>e.trim())??[];return e.status?.authMethod===`subscription_key`?`zen`:e.apiKey?t.includes(`anthropic`)?`anthropicKey`:t.includes(`openai`)?`openaiKey`:t.includes(`openrouter`)?`openrouterKey`:`zen`:t.includes(`openai`)?`chatgpt`:t.includes(`github-copilot`)?`github`:t.includes(`anthropic`)?`claudeSubscription`:`zen`}function vt(e){return ht.map(t=>({access:t,entries:e.filter(e=>_t(e)===t)})).filter(e=>e.entries.length>0)}function yt({login:e}){return e?.agent===`codex`||e?.agent===`opencode`}function bt(e,t){return e.missing.includes(t)}var xt={claude:`login.claudeMissing`,codex:`login.codexMissing`,opencode:`login.opencodeMissing`,copilot:`login.copilotMissing`};function St(e,t){return e===null?[...a]:a.filter(n=>t.includes(n)||e.accounts.some(e=>e.agent===n))}function Ct(e,t){let n=[...r(e.accounts,t)].sort((t,n)=>Number(n.key===e.active)-Number(t.key===e.active)||Number(wt(e,n))-Number(wt(e,t))),i=[...ft];return[...i,...new Set(n.map(e=>e.agent).filter(e=>!i.includes(e)))].map(e=>({agent:e,entries:n.filter(t=>t.agent===e)})).filter(e=>e.entries.length>0)}function wt(e,t){return e.active===t.key||e.apps.some(e=>e.account===t.key)||t.projects.length>0||t.sessions.length>0}function Tt(e){let t=null;for(let n of st(e)){let r=e?.[n]??null;if(r===null||r.used!==void 0)continue;let i=Math.round(100-Math.min(Math.max(r.usedPercentage,0),100));(t===null||i<t.free)&&(t={span:n,free:i,window:r})}return t}function Et(e,t,n){if(e.missing.includes(t))return{state:`cliMissing`};let r=e.accounts.find(e=>e.key===n&&e.agent===t);return r===void 0?{state:`noAccount`}:o(r)?{state:`unsupported`,entry:r}:{state:r.needsLogin?`signIn`:`ready`,entry:r}}var Dt=[`7d`,`30d`,`month`,`last-month`,`3m`,`year`,`all`],Ot=864e5;function kt(e){return Dt.includes(e)}function At(e){return`${e.getFullYear()}-${jt(e.getMonth()+1)}-${jt(e.getDate())}`}function jt(e){return String(e).padStart(2,`0`)}function F(e){return new Date(`${e}T00:00:00Z`)}function Mt(e){return e.toISOString().slice(0,10)}function I(e,t){return Mt(new Date(F(e).getTime()+t*Ot))}function Nt(e){let t=F(e);return Mt(new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,0)))}function Pt(e,t){let n=F(e),r=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+t,1)),i=Number(Nt(Mt(r)).slice(8));return Mt(new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),Math.min(n.getUTCDate(),i))))}function Ft(e){return Math.round((F(e.to).getTime()-F(e.from).getTime())/Ot)+1}function It(e,t,n){if(!(`preset`in e))return{from:e.from,to:e.to};let r=`${t.slice(0,7)}-01`;switch(e.preset){case`7d`:return{from:I(t,-6),to:t};case`30d`:return{from:I(t,-29),to:t};case`3m`:return{from:I(Pt(t,-3),1),to:t};case`month`:return{from:r,to:t};case`last-month`:{let e=Pt(r,-1);return{from:e,to:Nt(e)}}case`year`:return{from:`${t.slice(0,4)}-01-01`,to:t};case`all`:return{from:n!==null&&n<t?n:t,to:t}}}function Lt(e){let t=F(e.from),n=F(e.to);return(n.getUTCFullYear()-t.getUTCFullYear())*12+n.getUTCMonth()-t.getUTCMonth()+1}function Rt(e,t){return e.from.endsWith(`-01-01`)&&(e.to.endsWith(`-12-31`)||e.to===t&&e.to.slice(0,4)===t.slice(0,4))?Number(e.to.slice(0,4))-Number(e.from.slice(0,4))+1:null}function zt(e,t){return e.from.endsWith(`-01`)&&(e.to===Nt(e.to)||e.to===t)?Lt(e):null}function Bt(e,t,n){let r=Rt(e,n),i=r===null?zt(e,n):r*12;if(i!==null){let r=Pt(e.from,t*i);if(r>n)return e;let a=I(Pt(r,i),-1);return{from:r,to:a>n?n:a}}let a=Ft(e),o={from:I(e.from,t*a),to:I(e.to,t*a)};return o.to<=n?o:{from:I(n,1-a),to:n}}function Vt(e){let t=Ft(e);return{from:I(e.from,-t),to:I(e.from,-1)}}function Ht(e){let t=Ft(e);return t<=62?`day`:t<=366?`week`:`month`}function Ut(e,t){return t===`day`?e:t===`month`?`${e.slice(0,7)}-01`:I(e,-((F(e).getUTCDay()+6)%7))}function Wt(e,t){return t===`day`?I(e,1):t===`week`?I(e,7):Pt(e,1)}function Gt(e,t){let n=[];for(let r=Ut(e.from,t);r<=e.to;r=Wt(r,t))n.push(r);return n}function Kt(e,t=!0){let n=`${Number(e.slice(8))} ${u.stats.period.monthsOfDay[Number(e.slice(5,7))-1]}`;return t?`${n} ${e.slice(0,4)}`:n}function qt(e){if(e.from===e.to)return Kt(e.from);let t=e.from.slice(0,4)===e.to.slice(0,4);return`${Kt(e.from,!t)} — ${Kt(e.to)}`}function Jt(e,t){return t===`month`?`${u.stats.period.monthsShort[Number(e.slice(5,7))-1]} ${e.slice(0,4)}`:Kt(e,!1)}var Yt={opus:`Opus`,sonnet:`Sonnet`,haiku:`Haiku`,fable:`Fable`,sol:`Sol`,luna:`Luna`,astra:`Astra`,terra:`Terra`,gpt:`GPT`,deepseek:`DeepSeek`,qwen:`Qwen`,gemini:`Gemini`,kimi:`Kimi`,glm:`GLM`,mistral:`Mistral`,llama:`Llama`,minimax:`MiniMax`},Xt={chain:`Even Keel`,vscode:`VS Code`,cli:`CLI`,"tally-classify":`Tally`,codex:`Codex`,"codex-exec":`Codex CLI`,"codex-desktop":`Codex Desktop`,opencode:`OpenCode`,copilot:`GitHub Copilot`},Zt=c(e=>new Intl.NumberFormat(e,{maximumFractionDigits:0}));function Qt(e){return e===0?`$0`:e<.01?`< $0.01`:e<100?`$${e.toFixed(2)}`:`$${Zt().format(e).replace(/\s/g,` `)}`}function $t(e,t){if(t<=0)return null;let n=Math.round((e-t)/t*100);return n===0?u.units.percent(`±0`):u.units.percent(n>0?`+${n}`:`−${-n}`)}function en(e){return e===null?`—`:e===0?u.units.percent(`0`):e<1?u.units.percent(`< 1`):u.units.percent(String(Math.round(e)))}function tn(e){if(e===null)return`—`;let{hour:t,minute:n}=u.units;if(e===0)return`0 ${n}`;if(e<30)return`< 1 ${n}`;let r=Math.round(e/60);if(r<60)return`${r} ${n}`;if(r>=600)return`${Math.round(r/60)} ${t}`;let i=r%60;return i===0?`${r/60} ${t}`:`${Math.floor(r/60)} ${t} ${String(i).padStart(2,`0`)} ${n}`}function nn(e){return e===null?`—`:e<10?`${Number(e.toFixed(1))} ${u.units.second}`:e<120?`${Math.round(e)} ${u.units.second}`:e<600?`${Number((e/60).toFixed(1))} ${u.units.minute}`:tn(e)}function rn(e){return e===null?`—`:`×${e>=10?Math.round(e):Number(e.toFixed(1))}`}function an(e){return e===null?u.stats.labels.unsorted:u.stats.labels.reasons[e]??e}function on(e){return u.stats.labels.kinds[e]??e}function sn(e){return e===null?u.stats.labels.outsideChain:u.stats.labels.launches[e]??e}function cn(e){let t=/^claude-([a-z]+)((?:-\d{1,2})+)(?:-\d{8})?$/.exec(e);return t===null?e:`${Yt[t[1]]??t[1]} ${t[2].slice(1).replaceAll(`-`,`.`)}`}function ln(e){return e===`other`?u.stats.labels.otherModels:Yt[e]??e}function un(e){return e===`desktop`?u.stats.labels.desktop:e===`other`?u.stats.labels.otherEntrypoint:Xt[e]??e}function dn(e,t,n){let r=n===null||n.from<t.from?t.from:n.from,i=n===null||n.to>t.to?t.to:n.to;if(n===null||r>i)return{share:null,perWeek:!1,from:null,to:null};let a=Ft({from:r,to:i}),o=e??0;return{share:a>7?o*7/a:o,perWeek:a>7,from:r>t.from?r:null,to:i<t.to?i:null}}function fn(e){let t=new Map;for(let{account:n,peak:r,open:i}of e){let e=t.get(n)??{account:n,closed:[],open:[]};t.set(n,e),(i?e.open:e.closed).push(r)}return[...t.values()]}var L=i();function pn({title:e,question:t,confirm:n,cancel:r,busy:i,failure:a,safe:o=!1,onConfirm:s,onClose:c}){let u=(0,P.useRef)(null),d=l(u,c),f=(0,P.useId)();return(0,P.useEffect)(()=>{u.current?.open===!1&&u.current.showModal()},[]),(0,L.jsx)(`dialog`,{ref:u,className:`add-package add-package--narrow`,"aria-labelledby":f,onCancel:e=>{e.preventDefault(),e.stopPropagation(),c()},...d,children:(0,L.jsxs)(`div`,{className:`add-package__frame`,children:[(0,L.jsx)(`header`,{className:`add-package__head`,children:(0,L.jsx)(`h2`,{id:f,className:`add-package__title`,children:e})}),(0,L.jsx)(`div`,{className:`add-package__body`,children:(0,L.jsx)(`p`,{className:`add-package__question`,children:t})}),a!==void 0&&(0,L.jsx)(`p`,{role:`alert`,className:`notice notice--error add-package__failure`,children:a}),(0,L.jsxs)(`footer`,{className:`add-package__foot`,children:[(0,L.jsx)(`span`,{className:`add-package__spacer`}),(0,L.jsx)(`button`,{type:`button`,className:`button`,disabled:i,onClick:c,children:r}),(0,L.jsx)(`button`,{type:`button`,className:o?`button button--primary`:`button button--danger`,disabled:i,onClick:s,children:n})]})]})})}function mn(){}function hn(){}function gn(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?vn(e.position):`start`in e||`end`in e?vn(e):`line`in e||`column`in e?_n(e):``}function _n(e){return yn(e&&e.line)+`:`+yn(e&&e.column)}function vn(e){return _n(e&&e.start)+`-`+_n(e&&e.end)}function yn(e){return e&&typeof e==`number`?e:1}var R=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=gn(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};R.prototype.file=``,R.prototype.name=``,R.prototype.reason=``,R.prototype.message=``,R.prototype.stack=``,R.prototype.column=void 0,R.prototype.line=void 0,R.prototype.ancestors=void 0,R.prototype.cause=void 0,R.prototype.fatal=void 0,R.prototype.place=void 0,R.prototype.ruleId=void 0,R.prototype.source=void 0;var bn={};function xn(e,t){let n=t||bn;return Sn(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Sn(e,t,n){if(wn(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Cn(e.children,t,n)}return Array.isArray(e)?Cn(e,t,n):``}function Cn(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Sn(e[i],t,n);return r.join(``)}function wn(e){return!!(e&&typeof e==`object`)}var Tn=document.createElement(`i`);function En(e){let t=`&`+e+`;`;Tn.innerHTML=t;let n=Tn.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function z(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function B(e,t){return e.length>0?(z(e,e.length,0,t),e):t}var Dn={}.hasOwnProperty;function On(e){let t={},n=-1;for(;++n<e.length;)kn(t,e[n]);return t}function kn(e,t){let n;for(n in t){let r=(Dn.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Dn.call(r,a)||(r[a]=[]);let e=i[a];An(r[a],Array.isArray(e)?e:e?[e]:[])}}}function An(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);z(e,0,0,r)}function jn(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function V(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var H=q(/[A-Za-z]/),U=q(/[\dA-Za-z]/),Mn=q(/[#-'*+\--9=?A-Z^-~]/);function Nn(e){return e!==null&&(e<32||e===127)}var Pn=q(/\d/),Fn=q(/[\dA-Fa-f]/),In=q(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function K(e){return e===-2||e===-1||e===32}var Ln=q(/\p{P}|\p{S}/u),Rn=q(/\s/);function q(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function J(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return K(r)?(e.enter(n),s(r)):t(r)}function s(r){return K(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function zn(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&K(t)?(e.enter(r),c(t)):l(t)}function c(t){return K(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Bn={tokenize:Vn};function Vn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return W(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Hn=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Un(this,e,t,n,!1)}addBefore(e,t,n){Un(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Un(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var Wn={tokenize:Kn},Gn={tokenize:qn};function Kn(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Hn;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Gn,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Gn,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return W(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Hn;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function qn(e,t,n){return J(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Jn(e){if(e===null||G(e)||Rn(e))return 1;if(Ln(e))return 2}function Yn(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Xn={name:`attention`,resolveAll:Zn,tokenize:Qn};function Zn(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};$n(o,-a),$n(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=B(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=B(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=B(r,Yn(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=B(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=B(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),z(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Qn(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Jn(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Jn(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function $n(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var er={name:`autolink`,tokenize:tr};function tr(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return H(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||U(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||U(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Nn(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Mn(t)?(e.consume(t),l):n(t)}function u(e){return U(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||U(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var nr={partial:!0,tokenize:rr};function rr(e,t,n){return r;function r(t){return K(t)?J(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||W(e)?t(e):n(e)}}var ir={continuation:{tokenize:or},exit:sr,name:`blockQuote`,tokenize:ar};function ar(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return K(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function or(e,t,n){let r=this;return i;function i(t){return K(t)?J(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ir,t,n)(r)}}function sr(e){e.exit(`blockQuote`)}var cr={name:`characterEscape`,tokenize:lr};function lr(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return In(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var ur={name:`characterReference`,tokenize:dr};function dr(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=U,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Fn,u):(e.enter(`characterReferenceValue`),a=7,o=Pn,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===U&&!En(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var fr={partial:!0,tokenize:pr};function pr(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var mr={concrete:!0,name:`codeFenced`,tokenize:hr};function hr(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),K(t)?J(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||W(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(fr,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),J(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||W(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&K(t)?J(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||W(t)?e.check(fr,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||W(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),K(t)?J(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),K(t)?J(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||W(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var gr={name:`codeIndented`,tokenize:vr},_r={partial:!0,tokenize:yr};function vr(e,t,n){return r;function r(t){return e.enter(`codeIndented`),zn(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):W(t)?e.attempt(_r,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||W(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function yr(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):W(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):zn(e,t,a,`linePrefix`,4,4)(o)}function a(e){return W(e)?i(e):n(e)}}var br={name:`codeText`,previous:Sr,resolve:xr,tokenize:Cr};function xr(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Sr(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Cr(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||W(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var wr=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Tr(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Tr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Tr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Tr(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Tr(this.left,t.reverse())}}}};function Tr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Er(e){let t={},n=-1,r,i,a,o,s,c,l,u=new wr(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Dr(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return z(e,0,1/0,u.slice(0)),!l}function Dr(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Or={resolve:Ar,tokenize:jr},kr={partial:!0,tokenize:Mr};function Ar(e){return Er(e),e}function jr(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):W(t)?e.check(kr,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Mr(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,a,`linePrefix`)}function a(i){if(i===null||W(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Nr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Nn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||W(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||G(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Nn(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Pr(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):W(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||W(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!K(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Fr(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||W(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Ir(e,t){let n;return r;function r(i){return W(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):K(i)?J(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Lr={name:`definition`,tokenize:zr},Rr={partial:!0,tokenize:Br};function zr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Pr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=V(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return G(t)?Ir(e,l)(t):l(t)}function l(t){return Nr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Rr,d,d)(t)}function d(t){return K(t)?J(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||W(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Br(e,t,n){return r;function r(t){return G(t)?Ir(e,i)(t):n(t)}function i(t){return Fr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return K(t)?J(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||W(e)?t(e):n(e)}}var Vr={name:`hardBreakEscape`,tokenize:Hr};function Hr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return W(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ur={name:`headingAtx`,resolve:Wr,tokenize:Gr};function Wr(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};z(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Gr(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||G(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||W(n)?(e.exit(`atxHeading`),t(n)):K(n)?J(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||G(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Kr=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),qr=[`pre`,`script`,`style`,`textarea`],Jr={concrete:!0,name:`htmlFlow`,resolveTo:Xr,tokenize:Zr},Yr={partial:!0,tokenize:Qr};function Xr(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Zr(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:N):H(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):H(a)?(e.consume(a),i=4,r.interrupt?t:N):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:N):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return H(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||G(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&qr.includes(l)?(i=1,r.interrupt?t(s):O(s)):Kr.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||U(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return K(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||H(t)?(e.consume(t),b):K(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||U(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):K(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):K(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||W(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||G(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||K(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||W(t)?O(t):K(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),A):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),N):t===93&&i===5?(e.consume(t),ne):W(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Yr,ie,k)(t)):t===null||W(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(fr,ee,ie)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||W(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),N):O(t)}function j(t){return t===47?(e.consume(t),o=``,M):O(t)}function M(t){if(t===62){let n=o.toLowerCase();return qr.includes(n)?(e.consume(t),re):O(t)}return H(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),M):O(t)}function ne(t){return t===93?(e.consume(t),N):O(t)}function N(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),N):O(t)}function re(t){return t===null||W(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function Qr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(nr,t,n)}}var $r={name:`htmlText`,tokenize:ei};function ei(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):H(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):H(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):W(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?A(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):W(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?A(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?A(t):W(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):W(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return H(t)?(e.consume(t),S):n(t)}function S(t){return t===45||U(t)?(e.consume(t),S):C(t)}function C(t){return W(t)?(o=C,j(t)):K(t)?(e.consume(t),C):A(t)}function w(t){return t===45||U(t)?(e.consume(t),w):t===47||t===62||G(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||H(t)?(e.consume(t),E):W(t)?(o=T,j(t)):K(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||U(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):W(t)?(o=D,j(t)):K(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):W(t)?(o=O,j(t)):K(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):W(t)?(o=k,j(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||G(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||G(e)?T(e):n(e)}function A(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),M}function M(t){return K(t)?J(e,ne,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ne(t)}function ne(t){return e.enter(`htmlTextData`),o(t)}}var ti={name:`labelEnd`,resolveAll:ai,resolveTo:oi,tokenize:si},ni={tokenize:ci},ri={tokenize:li},ii={tokenize:ui};function ai(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&z(e,0,e.length,n),e}function oi(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=B(o,e.slice(i+1,i+r+3)),o=B(o,[[`enter`,l,t]]),o=B(o,Yn(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=B(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=B(o,e.slice(a+1)),o=B(o,[[`exit`,s,t]]),z(e,i,e.length,o),e}function si(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(V(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(ni,u,o?u:d)(t):t===91?e.attempt(ri,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(ii,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function ci(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return G(t)?Ir(e,a)(t):a(t)}function a(t){return t===41?u(t):Nr(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return G(t)?Ir(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Fr(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return G(t)?Ir(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function li(e,t,n){let r=this;return i;function i(t){return Pr.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(V(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function ui(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var di={name:`labelStartImage`,resolveAll:ti.resolveAll,tokenize:fi};function fi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var pi={name:`labelStartLink`,resolveAll:ti.resolveAll,tokenize:mi};function mi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var hi={name:`lineEnding`,tokenize:gi};function gi(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}}var _i={name:`thematicBreak`,tokenize:vi};function vi(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||W(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),K(t)?J(e,s,`whitespace`)(t):s(t))}}var Y={continuation:{tokenize:Si},exit:wi,name:`list`,tokenize:xi},yi={partial:!0,tokenize:Ti},bi={partial:!0,tokenize:Ci};function xi(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){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Pn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(_i,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Pn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(nr,r.interrupt?n:u,e.attempt(yi,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return K(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Si(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(nr,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,J(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!K(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(bi,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,J(e,e.attempt(Y,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Ci(e,t,n){let r=this;return J(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function wi(e){e.exit(this.containerState.type)}function Ti(e,t,n){let r=this;return J(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!K(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Ei={name:`setextUnderline`,resolveTo:Di,tokenize:Oi};function Di(e,t){let n=new Hn,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function Oi(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),K(t)?J(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||W(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var ki={tokenize:Ai};function Ai(e){let t=this,n=e.attempt(nr,r,e.attempt(this.parser.constructs.flowInitial,i,J(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Or,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ji={resolveAll:Fi()},Mi=Pi(`string`),Ni=Pi(`text`);function Pi(e){return{resolveAll:Fi(e===`text`?Ii:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Fi(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Ii(e,t){let n=new Hn,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Li=e({attentionMarkers:()=>Gi,contentInitial:()=>zi,disable:()=>Ki,document:()=>Ri,flow:()=>Vi,flowInitial:()=>Bi,insideSpan:()=>Wi,string:()=>Hi,text:()=>Ui}),Ri={42:Y,43:Y,45:Y,48:Y,49:Y,50:Y,51:Y,52:Y,53:Y,54:Y,55:Y,56:Y,57:Y,62:ir},zi={91:Lr},Bi={[-2]:gr,[-1]:gr,32:gr},Vi={35:Ur,42:_i,45:[Ei,_i],60:Jr,61:Ei,95:_i,96:mr,126:mr},Hi={38:ur,92:cr},Ui={[-5]:hi,[-4]:hi,[-3]:hi,33:di,38:ur,42:Xn,60:[er,$r],91:pi,92:[Vr,cr],93:ti,95:Xn,96:br},Wi={null:[Xn,ji]},Gi={null:[42,95]},Ki={null:[]};function qi(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=B(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Yn(a,l.events,l),l.events):[]}function f(e,t){return Yi(p(e),t)}function p(e){return Ji(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){W(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&z(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ji(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Yi(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
2
2
  `;break;case-3:o=`\r
3
3
  `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Xi(e){let t={constructs:On([Li,...(e||{}).extensions||[]]),content:n(Bn),defined:[],document:n(Wn),flow:n(ki),lazy:{},string:n(Mi),text:n(Ni)};return t;function n(e){return n;function n(n){return qi(t,e,n)}}}function Zi(e){for(;!Er(e););return e}var Qi=/[\0\t\n\r]/g;function $i(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){Qi.lastIndex=c;let n=Qi.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var ea=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ta(e){return e.replace(ea,na)}function na(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return jn(n.slice(t?2:1),t?16:10)}return En(n)||e}var ra={}.hasOwnProperty;function ia(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),aa(n)(Zi(Xi(n).document().write($i()(e,t,!0))))}function aa(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(xe),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(_e),blockQuote:o(fe),characterEscape:E,characterReference:E,codeFenced:o(pe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(pe,s),codeText:o(me,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(he),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(ge),hardBreakEscape:o(ve),hardBreakTrailing:o(ve),htmlFlow:o(ye,s),htmlFlowData:E,htmlText:o(ye,s),htmlTextData:E,image:o(be),label:s,link:o(xe),listItem:o(Ce),listItemValue:p,listOrdered:o(Se,f),listUnordered:o(Se),paragraph:o(we),reference:oe,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(_e),strong:o(Te),thematicBreak:o(De)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:P,characterReference:le,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(A),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(ee),htmlFlowData:D,htmlText:l(te),htmlTextData:D,image:l(M),label:N,labelText:ne,lineEnding:O,link:l(j),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:se,resourceDestinationString:re,resourceTitleString:ie,resource:ae,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};oa(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),ra.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||ca).call(o,void 0,e[0])}for(r.position={start:X(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:X(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:X(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+gn({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ca).call(this,e,r[0])),n.position.end=X(e.end)}function d(){return xn(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=V(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=Ee(),n.position={start:X(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=X(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=X(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ne(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=ta(t),n.identifier=V(t).toLowerCase()}function N(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ae(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=V(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function P(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=jn(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=En(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=X(e.end)}function ue(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[],position:void 0}}function pe(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function me(){return{type:`inlineCode`,value:``,position:void 0}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function ge(){return{type:`emphasis`,children:[],position:void 0}}function _e(){return{type:`heading`,depth:0,children:[],position:void 0}}function ve(){return{type:`break`,position:void 0}}function ye(){return{type:`html`,value:``,position:void 0}}function be(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function xe(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function Se(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function Ce(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function we(){return{type:`paragraph`,children:[],position:void 0}}function Te(){return{type:`strong`,children:[],position:void 0}}function Ee(){return{type:`text`,value:``,position:void 0}}function De(){return{type:`thematicBreak`,position:void 0}}}function X(e){return{line:e.line,column:e.column,offset:e.offset}}function oa(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?oa(e,r):sa(e,r)}}function sa(e,t){let n;for(n in t)if(ra.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function ca(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+gn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+gn({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+gn({start:t.start,end:t.end})+`) is still open`)}function la(e){let t=this;t.parser=n;function n(n){return ia(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var ua=(function(e){if(e==null)return ha;if(typeof e==`function`)return ma(e);if(typeof e==`object`)return Array.isArray(e)?da(e):fa(e);if(typeof e==`string`)return pa(e);throw Error(`Expected function, string, or object as test`)});function da(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ua(e[n]);return ma(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function fa(e){let t=e;return ma(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function pa(e){return ma(t);function t(t){return t&&t.type===e}}function ma(e){return t;function t(t,n,r){return!!(ga(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function ha(){return!0}function ga(e){return typeof e==`object`&&!!e&&`type`in e}function _a(e){return e}var va=[];function ya(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=ua(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+_a(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=va,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=ba(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function ba(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?va:[e]}function xa(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),ya(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function Sa(e){if(e)throw e}var Ca=t(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function wa(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ta(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Ea(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Ea(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Z={basename:Da,dirname:Oa,extname:ka,join:Aa,sep:`/`};function Da(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Na(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Oa(e){if(Na(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function ka(e){Na(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Aa(...e){let t=-1,n;for(;++t<e.length;)Na(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:ja(n)}function ja(e){Na(e);let t=e.codePointAt(0)===47,n=Ma(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Ma(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Na(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Pa={cwd:Fa};function Fa(){return`/`}function Ia(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function La(e){if(typeof e==`string`)e=new URL(e);else if(!Ia(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Ra(e)}function Ra(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var za=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Ba=class{constructor(e){let t;t=e?Ia(e)?{path:e}:typeof e==`string`||Wa(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Pa.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<za.length;){let e=za[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)za.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Z.basename(this.path):void 0}set basename(e){Ha(e,`basename`),Va(e,`basename`),this.path=Z.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Z.dirname(this.path):void 0}set dirname(e){Ua(this.basename,`dirname`),this.path=Z.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Z.extname(this.path):void 0}set extname(e){if(Va(e,`extname`),Ua(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Z.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Ia(e)&&(e=La(e)),Ha(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Z.basename(this.path,this.extname):void 0}set stem(e){Ha(e,`stem`),Va(e,`stem`),this.path=Z.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new R(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Va(e,t){if(e&&e.includes(Z.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Z.sep+"`")}function Ha(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Ua(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Wa(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Ga=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Ka={}.hasOwnProperty,qa=new class e extends Ga{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ta()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Ca.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Xa(`data`,this.frozen),this.namespace[e]=t,this):Ka.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Xa(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=$a(e),n=this.parser||this.Parser;return Ja(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Ja(`process`,this.parser||this.Parser),Ya(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=$a(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);to(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Ja(`processSync`,this.parser||this.Parser),Ya(`processSync`,this.compiler||this.Compiler),this.process(e,r),Qa(`processSync`,`process`,t),n;function r(e,r){t=!0,Sa(e),n=r}}run(e,t,n){Za(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=$a(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Qa(`runSync`,`run`,n),r;function i(e,t){Sa(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=$a(t),r=this.compiler||this.Compiler;return Ya(`stringify`,r),Za(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Xa(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Ca.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];wa(o)&&wa(r)&&(r=(0,Ca.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Ja(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Ya(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Xa(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Za(e){if(!wa(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Qa(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function $a(e){return eo(e)?e:new Ba(e)}function eo(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function to(e){return typeof e==`string`||no(e)}function no(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function ro(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function io(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function ao(e,t,n){let r=ua((n||{}).ignore||[]),i=oo(t),a=-1;for(;++a<i.length;)ya(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1)r.lastIndex=n+1;else{if(s!==n&&f({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a))for(let e of a)f(e);else a&&f(a);s=n+d[0].length,l=!0}if(!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&f({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function oo(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([so(e[0]),co(e[1])])}return t}function so(e){return typeof e==`string`?new RegExp(io(e),`g`):e}function co(e){return typeof e==`function`?e:function(){return e}}var lo=`phrasing`,uo=[`autolink`,`link`,`image`,`label`];function fo(){return{transforms:[bo],enter:{literalAutolink:mo,literalAutolinkEmail:ho,literalAutolinkHttp:ho,literalAutolinkWww:ho},exit:{literalAutolink:yo,literalAutolinkEmail:vo,literalAutolinkHttp:go,literalAutolinkWww:_o}}}function po(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:lo,notInConstruct:uo},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:lo,notInConstruct:uo},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:lo,notInConstruct:uo}]}}function mo(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function ho(e){this.config.enter.autolinkProtocol.call(this,e)}function go(e){this.config.exit.autolinkProtocol.call(this,e)}function _o(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function vo(e){this.config.exit.autolinkEmail.call(this,e)}function yo(e){this.exit(e)}function bo(e){ao(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xo],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,So]],{ignore:[`link`,`linkReference`]})}function xo(e,t,n,r,i){let a=``;if(!To(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Co(n)))return!1;let o=wo(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function So(e,t,n,r){return!To(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Co(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function wo(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=ro(e,`(`),a=ro(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function To(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Rn(n)||Ln(n))&&(!t||n!==47)}Fo.peek=Po;function Eo(){this.buffer()}function Do(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Oo(){this.buffer()}function ko(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Ao(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=V(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jo(e){this.exit(e)}function Mo(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=V(this.sliceSerialize(e)).toLowerCase(),n.label=t}function No(e){this.exit(e)}function Po(){return`[`}function Fo(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Io(){return{enter:{gfmFootnoteCallString:Eo,gfmFootnoteCall:Do,gfmFootnoteDefinitionLabelString:Oo,gfmFootnoteDefinition:ko},exit:{gfmFootnoteCallString:Ao,gfmFootnoteCall:jo,gfmFootnoteDefinitionLabelString:Mo,gfmFootnoteDefinition:No}}}function Lo(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Fo},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
4
4
  `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?zo:Ro))),s(),o}}function Ro(e,t,n){return t===0?e:zo(e,t,n)}function zo(e,t,n){return(n?``:` `)+e}var Bo=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Go.attention=Ko,Go.peek=qo;function Vo(){return{canContainEols:[`delete`],enter:{strikethrough:Uo},exit:{strikethrough:Wo}}}function Ho(){return{handlers:{delete:Go},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Bo}]}}function Uo(e){this.enter({type:`delete`,children:[],position:void 0},e)}function Wo(e){this.exit(e)}function Go(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function Ko(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function qo(){return`~`}function Jo(e){return e.length}function Yo(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Jo,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Xo(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Zo(r[d]);else{let e=Zo(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding===!1||n.alignDelimiters===!1&&i===``||n.delimiterStart===!1&&!d||r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`