@cline/cli-linux-arm64 3.0.71-nightly.1792066955 → 3.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cline +2 -2
- package/cline-hub/webview/assets/{Chat-CUFbAnxI.js → Chat-BhcO3lxR.js} +6 -6
- package/cline-hub/webview/assets/{extensions-view-Dky7A0iW.js → extensions-view-CcwDTH9q.js} +1 -1
- package/cline-hub/webview/assets/{highlighted-body-KPVGNVTW-T7KLt8tc.js → highlighted-body-KPVGNVTW-D19paMBO.js} +1 -1
- package/cline-hub/webview/assets/{index-5yJtmJPZ.js → index-DlpuYMzW.js} +2 -2
- package/cline-hub/webview/assets/{label-BPItQ083.js → label-DFsbx3OI.js} +2 -2
- package/cline-hub/webview/assets/mermaid-HWGCJPDP-C7YHt7l6.js +1 -0
- package/cline-hub/webview/assets/{settings-view-BGXQP9BT.js → settings-view-DEIwhwkV.js} +1 -1
- package/cline-hub/webview/index.html +1 -1
- package/package.json +1 -1
- package/cline-hub/webview/assets/mermaid-HWGCJPDP-BlZ0S_7e.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-CNhdxt2h.js","./rolldown-runtime-B0Z9INg1.js","./mermaid-parser-HclGiUj8.js","./mermaid-markup-D01n6Kcj.js","./chunk-Y2CYZVJY-DsF7k-Jl.js","./src-BY_WSiz7.js","./chunk-I66GZJ75-DXqP3B91.js","./chunk-NSK5VX7P-D5026Kzu.js","./dist-BDCdLWk4.js","./chunk-4I5QYGJK-0RNwvBrV.js","./chunk-WRU74C26-BSENSjFs.js","./chunk-7BUUIJ7U-Bb538aSH.js","./chunk-UBXNYLIW-DzzRI8B_.js","./chunk-W5SLKNZC-jIqX_Eb5.js","./chunk-QR6OTTB3-DgKOIk7B.js","./rough.esm-Dy-Kn_BL.js","./chunk-7Z6QIM7H-C6_Ywz3w.js","./line-BImJQVif.js","./path-fybaL0A-.js","./array-BifhSqXX.js","./highlighted-body-KPVGNVTW-
|
|
2
|
-
import{a as e,i as t,n,r,t as i}from"./rolldown-runtime-B0Z9INg1.js";import{a,i as o,n as s,r as c,t as l}from"./bundle-mjs-CyB9GzWm.js";import{Bt as u,C as d,F as f,G as p,Ht as m,I as h,L as g,R as _,T as v,Tn as y,Wn as b,X as x,Z as S,_t as C,an as w,ar as T,c as E,j as ee,jn as D,ln as te,n as O,on as ne,or as k,rn as re,sn as ie,t as ae,un as oe,vt as se,w as A,yt as ce,z as j}from"./vscode-CFosRdBr.js";import{B as le,H as ue,I as de,N as fe,P as pe,U as me,V as he,W as ge,_ as _e,c as ve,g as ye,h as be,i as xe,l as Se,m as Ce,n as we,o as Te,p as Ee,r as De,t as Oe,v as ke,y as Ae}from"./label-BPItQ083.js";import{a as je,i as Me,r as Ne,t as Pe}from"./switch-DrjcFF6_.js";import{t as Fe}from"./mermaid-parser-HclGiUj8.js";import{B as Ie,F as Le,H as Re,L as ze,N as Be,V as Ve,j as He,m as Ue}from"./index-5yJtmJPZ.js";import{n as We,t as Ge}from"./badge-X4W3Q0cc.js";var Ke=_(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),qe=_(`bookmark`,[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]),Je=_(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Ye=_(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Xe=_(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ze=_(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Qe=_(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),$e=_(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),et=_(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),tt=_(`hat-glasses`,[[`path`,{d:`M14 18a2 2 0 0 0-4 0`,key:`1v8fkw`}],[`path`,{d:`m19 11-2.11-6.657a2 2 0 0 0-2.752-1.148l-1.276.61A2 2 0 0 1 12 4H8.5a2 2 0 0 0-1.925 1.456L5 11`,key:`1fkr7p`}],[`path`,{d:`M2 11h20`,key:`3eubbj`}],[`circle`,{cx:`17`,cy:`18`,r:`3`,key:`82mm0e`}],[`circle`,{cx:`7`,cy:`18`,r:`3`,key:`lvkj7j`}]]),nt=_(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),rt=_(`music-2`,[[`circle`,{cx:`8`,cy:`18`,r:`4`,key:`1fc0mg`}],[`path`,{d:`M12 18V2l7 4`,key:`g04rme`}]]),it=_(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),at=_(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),ot=_(`signal-low`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}]]),st=_(`signal-high`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}]]),ct=_(`signal-medium`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}]]),lt=_(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ut=_(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),dt=_(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),ft=_(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),pt=e(o(),1),M=c(),N=e(a(),1);function mt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ht(...e){return t=>{let n=!1,r=e.map(e=>{let r=mt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():mt(e[t],null)}}}}function gt(...e){return N.useCallback(ht(...e),e)}var _t=Symbol.for(`react.lazy`),vt=N.use;function yt(e){return typeof e==`object`&&!!e&&`then`in e}function bt(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===_t&&`_payload`in e&&yt(e._payload)}function xt(e){let t=St(e),n=N.forwardRef((e,n)=>{let{children:r,...i}=e;bt(r)&&typeof vt==`function`&&(r=vt(r._payload));let a=N.Children.toArray(r),o=a.find(wt);if(o){let e=o.props.children,r=a.map(t=>t===o?N.Children.count(e)>1?N.Children.only(null):N.isValidElement(e)?e.props.children:null:t);return(0,M.jsx)(t,{...i,ref:n,children:N.isValidElement(e)?N.cloneElement(e,void 0,r):null})}return(0,M.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function St(e){let t=N.forwardRef((e,t)=>{let{children:n,...r}=e;if(bt(n)&&typeof vt==`function`&&(n=vt(n._payload)),N.isValidElement(n)){let e=Et(n),i=Tt(r,n.props);return n.type!==N.Fragment&&(i.ref=t?ht(t,e):e),N.cloneElement(n,i)}return N.Children.count(n)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ct=Symbol(`radix.slottable`);function wt(e){return N.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ct}function Tt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Et(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Dt(e){if(!(e.length>8388608||!de(e)))try{let t=atob(e),n=new ArrayBuffer(t.length),r=new Uint8Array(n);for(let e=0;e<t.length;e+=1)r[e]=t.charCodeAt(e);return n}catch{return}}var Ot=/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/i;function kt(e){let t=e.mediaType.trim().toLowerCase();if(Ot.test(t))switch(e.modality){case`image`:return fe.includes(t)?t:void 0;case`audio`:return t.startsWith(`audio/`)?t:void 0;case`video`:return t.startsWith(`video/`)?t:void 0;case`file`:return`application/octet-stream`}}function At(e){let t=e.source.type===`base64`?e.source.data:void 0,[n,r]=(0,N.useState)(),i=kt(e);return(0,N.useEffect)(()=>{if(r(void 0),t===void 0||i===void 0)return;let e=Dt(t);if(!e||typeof URL.createObjectURL!=`function`)return;let n;try{n=URL.createObjectURL(new Blob([e],{type:i}))}catch{return}return r(n),()=>URL.revokeObjectURL?.(n)},[i,t]),n}function jt(e){return e.source.type===`artifact`?`Generated ${e.modality} is stored as an artifact (${e.source.artifactId}).`:e.source.type===`url`?`Generated ${e.modality} requires a trusted remote-media resolver.`:`Generated ${e.modality} could not be rendered.`}function Mt({media:e,className:t,classNames:n}){let r=At(e),i=r?.startsWith(`blob:`)?r:void 0;if(!i)return(0,M.jsx)(`div`,{className:n?.unavailable??t,"data-media-id":e.id,"data-testid":`generated-media-unavailable`,children:jt(e)});let a=n?.[e.modality]??t;switch(e.modality){case`image`:return(0,M.jsx)(`img`,{alt:e.name??`Generated image`,className:a,"data-media-id":e.id,src:i});case`audio`:return(0,M.jsx)(`audio`,{className:a,controls:!0,"data-media-id":e.id,src:i});case`video`:return(0,M.jsx)(`video`,{className:a,controls:!0,"data-media-id":e.id,src:i});case`file`:return(0,M.jsx)(`a`,{className:a,"data-media-id":e.id,download:e.name??!0,href:i,children:e.name??`Generated file (${e.mediaType})`})}return null}var Nt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,Pt=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Nt[n[e]&63];return t};function Ft({className:e,orientation:t=`horizontal`,...n}){return(0,M.jsx)(Ue,{"data-slot":`separator`,orientation:t,className:j(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var It=({className:e,children:t,...n})=>(0,M.jsxs)(`div`,{className:j(`flex items-center gap-0.5 overflow-hidden text-muted-foreground`,e),...n,children:[t,(0,M.jsx)(Ft,{})]}),Lt=({className:e,children:t,...n})=>t??(0,M.jsx)(qe,{className:j(`size-4 shrink-0`,e),...n}),Rt=({children:e,variant:t=`ghost`,size:n=`sm`,tooltip:r,...i})=>r?(0,M.jsxs)(Ie,{children:[(0,M.jsx)(Re,{render:(0,M.jsx)(A,{size:n,type:`button`,variant:t,...i}),children:e}),(0,M.jsx)(Ve,{align:`start`,side:`bottom`,children:r})]}):(0,M.jsx)(A,{size:n,type:`button`,variant:t,...i,children:e}),zt={damping:.7,stiffness:.05,mass:1.25},Bt=70,Vt=1e3/60,Ht=350,Ut=!1;globalThis.document?.addEventListener(`mousedown`,()=>{Ut=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{Ut=!1}),globalThis.document?.addEventListener(`click`,()=>{Ut=!1});var Wt=(e={})=>{let[t,n]=(0,N.useState)(!1),[r,i]=(0,N.useState)(e.initial!==!1),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null);s.current=e;let c=(0,N.useCallback)(()=>{if(!Ut)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,N.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,N.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,N.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Bt}}},[]),f=(0,N.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=qt(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/Vt;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:qt(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,N.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,N.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,N.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=Gt(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=Gt(e=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=qt(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:Ht})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function Gt(e,t){let n=(0,N.useCallback)(t=>(n.current=t,e(t)),t);return n}var Kt=new Map;function qt(...e){let t={...zt},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return Kt.has(r)||Kt.set(r,Object.freeze(t)),n?`instant`:Kt.get(r)}var Jt=(0,N.createContext)(null),Yt=typeof window<`u`?N.useLayoutEffect:N.useEffect;function Xt({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,N.useRef)(null),d=Wt({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:N.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,N.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,N.useImperativeHandle)(c,()=>y,[y]),Yt(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),N.createElement(Jt.Provider,{value:y},N.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=Zt();return N.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},N.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(Xt||={});function Zt(){let e=(0,N.useContext)(Jt);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}var Qt=({className:e,...t})=>(0,M.jsx)(Xt,{className:j(`relative flex-1 overflow-y-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),$t=({className:e,...t})=>(0,M.jsx)(Xt.Content,{className:j(`flex flex-col gap-8 p-4`,e),...t}),en=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=Zt(),i=(0,N.useCallback)(()=>{r()},[r]);return!n&&(0,M.jsx)(A,{className:j(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,M.jsx)(Ke,{className:`size-4`})})};v(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});var tn=()=>Fe(()=>import(`./mermaid.core-CNhdxt2h.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url);function nn(e,t,n){return Math.min(n,Math.max(t,e))}function rn(e){let t=e?.trim();if(!t||t===`none`)return 1;let n=t.endsWith(`%`)?Number.parseFloat(t)/100:Number.parseFloat(t);return Number.isFinite(n)?nn(n,0,1):1}function an(e,t){if(e===`none`)return 0;let n=Number.parseFloat(e);return Number.isFinite(n)?e.endsWith(`%`)?n/100*t:n:null}function on(e){if(e===`none`)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?e.endsWith(`turn`)?t*360:e.endsWith(`grad`)?t*.9:e.endsWith(`rad`)?t*180/Math.PI:t:null}function sn(e){let t=nn(e,0,1);return nn(t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055,0,1)*255}function cn(e,t,n){let r=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[sn(4.0767416621*r-3.3077115913*i+.2309699292*a),sn(-1.2684380046*r+2.6097574011*i-.3413193965*a),sn(-.0041960863*r-.7034186147*i+1.707614701*a)]}function ln(e){let t=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.exec(e);if(!t)return null;let n=t[1]??``;n.length<=4&&(n=[...n].map(e=>e+e).join(``));let r=e=>Number.parseInt(n.slice(e,e+2),16);return{a:n.length===8?r(6)/255:1,b:r(4),g:r(2),r:r(0)}}function un(e){let[t=``,n]=e.replace(/,/g,` `).split(`/`);return{alpha:n,tokens:t.trim().split(/\s+/).filter(Boolean)}}function dn(e,t){if(e.length<3)return null;let[n,r,i]=e.slice(0,3).map(e=>an(e,255));return n===null||r===null||i===null||n===void 0||r===void 0||i===void 0?null:{a:t,b:nn(i,0,255),g:nn(r,0,255),r:nn(n,0,255)}}function fn(e,t,n){if(t.length<3)return null;let r=an(t[0]??``,1);if(r===null)return null;let i,a;if(e===`oklch`){let e=an(t[1]??``,.4),n=on(t[2]??``);if(e===null||n===null)return null;let r=n*Math.PI/180;i=e*Math.cos(r),a=e*Math.sin(r)}else i=an(t[1]??``,.4),a=an(t[2]??``,.4);if(i===null||a===null)return null;let[o,s,c]=cn(nn(r,0,1),i,a);return{a:n,b:c,g:s,r:o}}function pn(e,t){if((e[0]??``).toLowerCase()!==`srgb`)return null;let[n,r,i]=e.slice(1,4).map(e=>an(e,1));return n==null||r==null||i==null?null:{a:t,b:nn(i,0,1)*255,g:nn(r,0,1)*255,r:nn(n,0,1)*255}}function mn(e){let t=e.trim();if(!t)return null;let n=ln(t);if(n)return n;let r=/^([a-z-]+)\(([^)]*)\)$/i.exec(t);if(!r)return null;let i=(r[1]??``).toLowerCase(),{alpha:a,tokens:o}=un(r[2]??``),s=rn(a);if(i===`rgb`||i===`rgba`){let e=a===void 0?o[3]:void 0;return dn(o,e?rn(e):s)}return i===`oklch`||i===`oklab`?fn(i,o,s):i===`color`?pn(o,s):null}function hn(e){return Math.round(nn(e,0,255)).toString(16).padStart(2,`0`)}function gn(e){return`#${hn(e.r)}${hn(e.g)}${hn(e.b)}`}function _n(e){let t=mn(e);return t?gn(t):null}function vn(e,t,n){let r=mn(e),i=mn(t);if(!r)return e;if(!i)return gn(r);let a=nn(n,0,1);return gn({b:r.b+(i.b-r.b)*a,g:r.g+(i.g-r.g)*a,r:r.r+(i.r-r.r)*a})}var yn={dark:{background:`#18191b`,border:`#2f2f37`,error:`#e54666`,foreground:`#fcfcfd`,muted:`#212225`,mutedForeground:`#b0b4ba`,primary:`#6e56cf`},light:{background:`#f9f9fb`,border:`#e8e8ec`,error:`#e54666`,foreground:`#1c2024`,muted:`#f0f0f3`,mutedForeground:`#60646c`,primary:`#6e56cf`}},bn=`'Inter Variable', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`,xn=`14px`;function Sn(e){let t=e?.trim().replace(/"/g,`'`)??``;return!t||/\bmonospace\b/i.test(t)?bn:`${t}, ${bn}`}function Cn(e,t,n){let r=n?.(e);return(r?_n(r):null)??_n(e)??t}function wn(e,t,n){let r=yn[t];return{background:Cn(e.background,r.background,n),border:Cn(e.border,r.border,n),error:Cn(e.error,r.error,n),foreground:Cn(e.foreground,r.foreground,n),muted:Cn(e.muted,r.muted,n),mutedForeground:Cn(e.mutedForeground,r.mutedForeground,n),primary:Cn(e.primary,r.primary,n)}}function Tn(e,t,{fontFamily:n=bn,resolveColor:r}={}){let i=wn(e,t,r),a=t===`dark`,o=vn(i.background,i.primary,a?.18:.1),s=vn(i.background,i.primary,a?.6:.5),c=vn(i.background,i.foreground,a?.08:.05),l=vn(i.background,i.foreground,a?.05:.03),u=vn(i.background,i.primary,a?.07:.04),d=vn(i.background,i.error,a?.2:.12);return{activationBkgColor:c,activationBorderColor:i.border,actorBkg:o,actorBorder:s,actorLineColor:i.mutedForeground,actorTextColor:i.foreground,background:i.background,clusterBkg:l,clusterBorder:i.border,darkMode:a,edgeLabelBackground:i.background,errorBkgColor:d,errorTextColor:i.error,fontFamily:n,fontSize:xn,labelBoxBkgColor:c,labelBoxBorderColor:i.border,labelTextColor:i.foreground,lineColor:i.mutedForeground,loopTextColor:i.foreground,mainBkg:o,nodeBorder:s,noteBkgColor:i.muted,noteBorderColor:i.border,noteTextColor:i.foreground,primaryBorderColor:s,primaryColor:o,primaryTextColor:i.foreground,secondaryBorderColor:i.border,secondaryColor:c,secondaryTextColor:i.foreground,sequenceNumberColor:i.background,signalColor:i.mutedForeground,signalTextColor:i.foreground,tertiaryBorderColor:i.border,tertiaryColor:u,tertiaryTextColor:i.foreground,textColor:i.foreground,titleColor:i.foreground}}function En(e,t,n={}){return{fontFamily:n.fontFamily??`'Inter Variable', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`,htmlLabels:!1,securityLevel:`strict`,startOnLoad:!1,suppressErrorRendering:!0,theme:`base`,themeVariables:Tn(e,t,n)}}function Dn(e=`light`){return En(yn[e],e)}var On=`data-cline-diagram-href`,kn=[`href`,`xlink:href`];function An(e){try{let t=new URL(e.trim());return t.protocol===`http:`||t.protocol===`https:`?t.href:null}catch{return null}}function jn(e){if(typeof DOMParser>`u`||typeof XMLSerializer>`u`)return null;try{let t=new DOMParser().parseFromString(e,`image/svg+xml`);if(t.getElementsByTagName(`parsererror`).length>0)return null;for(let e of Array.from(t.getElementsByTagName(`a`))){let t=kn.map(t=>e.getAttribute(t)).find(e=>!!e);for(let t of kn)e.removeAttribute(t);e.removeAttribute(`target`);let n=t?An(t):null;n&&e.setAttribute(On,n)}return new XMLSerializer().serializeToString(t.documentElement)}catch{return null}}var Mn=/<a\b[^>]*>/gi,Nn=/\s(?:xlink:href|href|target)\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;function Pn(e){return e.replace(Mn,e=>{let t=null,n=e.replace(Nn,(e,n,r)=>(/\starget\s*=/i.test(e)||(t??=n??r??null),``)),r=t?An(t):null;return r?n.replace(/\s*\/?>$/,e=>` ${On}="${r.replace(/"/g,`"`)}"${e}`):n})}function Fn(e){return e.includes(`<a`)?jn(e)??Pn(e):e}var In=Promise.resolve();function Ln(e){let t=In.then(e,e);return In=t.catch(()=>void 0),t}var Rn=new WeakMap;function zn(e=tn){let t,n=()=>(t??=e().catch(e=>{throw t=void 0,e}),t);return{async render(e,t,r){let i=(await n()).default;return Ln(async()=>{Rn.get(i)!==r&&(i.initialize(r),Rn.set(i,r));let n=await i.render(e,t);return{...n,svg:Fn(n.svg)}})}}}var Bn={background:`--card`,border:`--border`,error:`--destructive`,foreground:`--foreground`,muted:`--muted`,mutedForeground:`--muted-foreground`,primary:`--primary`},Vn=`--font-sans`;function Hn(e){if(typeof document>`u`)return`light`;let t=document.documentElement;return(e??t).closest(`.dark`)||t.classList.contains(`dark`)||(t.getAttribute(`data-cline-hub-theme`)??t.dataset.theme)===`dark`?`dark`:`light`}var Un;function Wn(e){if(typeof document>`u`)return null;if(Un===void 0){let e=document.createElement(`canvas`);e.width=1,e.height=1,Un=e.getContext(`2d`,{willReadFrequently:!0})}let t=Un;if(!t||(t.fillStyle=`#010203`,t.fillStyle=e,t.fillStyle===`#010203`&&_n(e)===null))return null;t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let[n=0,r=0,i=0,a=255]=t.getImageData(0,0,1,1).data;if(a===0)return null;let o=e=>e.toString(16).padStart(2,`0`);return`#${o(n)}${o(r)}${o(i)}`}function Gn(e,t){let n=e.getPropertyValue(t).trim();return n?_n(n)??Wn(n)??``:``}function Kn(e){if(typeof document>`u`){let e=yn.light,t=Sn(void 0);return{fontFamily:t,key:JSON.stringify([`light`,e,t]),mode:`light`,tokens:e}}let t=e??document.documentElement,n=Hn(t),r=getComputedStyle(t),i=e=>Gn(r,e),a=wn({background:i(Bn.background),border:i(Bn.border),error:i(Bn.error),foreground:i(Bn.foreground),muted:i(Bn.muted),mutedForeground:i(Bn.mutedForeground),primary:i(Bn.primary)},n),o=Sn(r.getPropertyValue(Vn));return{fontFamily:o,key:JSON.stringify([n,a,o]),mode:n,tokens:a}}Dn(`light`);function qn(e=tn){let t=zn(e),n={},r,i={initialize(e){n={...n,...e},r=void 0},render(e,i){let a=Kn();return r?.key!==a.key&&(r={config:{...En(a.tokens,a.mode,{fontFamily:a.fontFamily}),...n,securityLevel:`strict`},key:a.key}),t.render(e,i,r.config)}};return{getMermaid(e){return e&&i.initialize(e),i},language:`mermaid`,name:`mermaid`,type:`diagram`}}var P={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},Jn={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},Yn={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},Xn=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Zn=[12288,12288,65281,65376,65504,65510],Qn=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],$n=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],er=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],tr=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},nr=19968,[rr,ir]=ar(er);function ar(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(nr>=i&&nr<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var or=e=>e<161||e>1114109?!1:tr(Xn,e),sr=e=>e<12288||e>65510?!1:tr(Zn,e),cr=e=>e<8361||e>65518?!1:tr(Qn,e),lr=e=>e<32||e>10630?!1:tr($n,e),ur=e=>e>=rr&&e<=ir?!0:e<4352||e>262141?!1:tr(er,e);function dr(e){return or(e)?`ambiguous`:sr(e)?`fullwidth`:cr(e)?`halfwidth`:lr(e)?`narrow`:ur(e)?`wide`:`neutral`}function fr(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function pr(e){return fr(e),dr(e)}function mr(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function hr(e){if(!e||e<4352)return!1;switch(pr(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!mr(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999&&null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function gr(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function _r(e){return e!==null&&e>=65024&&e<=65038}var vr=br(/\p{P}|\p{S}/u),yr=br(/\s/);function br(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function xr(e){return!!(e&Jn.characterGroupWhitespace)}function Sr(e){return(e&zr.cjkPunctuation)===Jn.characterGroupPunctuation}function Cr(e){return!!(e&zr.cjk)}function wr(e){return e===zr.ivs}function Tr(e){return!!(e&zr.cjkOrIvs)}function Er(e){return e===zr.nonEmojiGeneralUseVS}function Dr(e){return!!(e&zr.spaceOrPunctuation)}var Or=Rr(/[A-Za-z]/),kr=Rr(/[\dA-Za-z]/),Ar=Rr(/[#-'*+\--9=?A-Z^-~]/);function jr(e){return e!==null&&(e<32||e===127)}var Mr=Rr(/\d/),Nr=Rr(/[\dA-Fa-f]/),Pr=Rr(/[!-/:-@[-`{-~]/);function F(e){return e!==null&&e<-2}function Fr(e){return e!==null&&(e<0||e===32)}function I(e){return e===-2||e===-1||e===32}var Ir=Rr(/\p{P}|\p{S}/u),Lr=Rr(/\s/);function Rr(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var zr;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(zr||={});function Br(e){if(e===P.eof||Fr(e)||yr(e))return Jn.characterGroupWhitespace;let t=0;if(e>=4352){if(_r(e))return zr.nonEmojiGeneralUseVS;switch(hr(e)){case null:return zr.ivs;case!0:t|=zr.cjk}}return vr(e)&&(t|=Jn.characterGroupPunctuation),t}function Vr(e,t,n){if(!Er(e))return e;let r=t(),i=Br(r);return!r||xr(i)?e:gr(r,n)?zr.cjkPunctuation:Hr(i)}function Hr(e){return e&~zr.ivs}function Ur(e){return!!(e&&e>=55296&&e<=56319)}function Wr(e){return!!(e&&e>=56320&&e<=57343)}function Gr(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function Kr(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var qr=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=Kr(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function Jr(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}function Yr(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 Xr(e,t){return e.length>0?(Yr(e,e.length,0,t),e):t}function Zr(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 Qr={name:`attention`,resolveAll:$r,tokenize:ei};function $r(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};ti(d,-c),ti(f,c),o={type:c>1?Yn.strongSequence:Yn.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?Yn.strongSequence:Yn.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?Yn.strongText:Yn.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?Yn.strong:Yn.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Xr(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Xr(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=Xr(l,Zr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Xr(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Xr(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Yr(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ei(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=Wr(a)?Gr(a,r(),i):a,s=Br(o),c=new qr(o,r(),i),l=Vr(s,c.value.bind(c),o),u;return d;function d(t){return t===P.asterisk||P.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=Br(Ur(a)?Jr(a,r(),i):a),d=Sr(l),p=d||xr(l),m=Sr(c),h=m||xr(c),g=Tr(l),_=!h||m&&(p||g)||n.includes(a),v=!p||d&&(h||Cr(c))||n.includes(o);return s._open=!!(u===P.asterisk?_:_&&(Dr(l)||!v)),s._close=!!(u===P.asterisk?v:v&&(Dr(c)||!_)),t(a)}}function ti(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function ni(){return{text:{[P.asterisk]:Qr,[P.underscore]:Qr},insideSpan:{null:[Qr]}}}function ri(){let e=this.data();(e.micromarkExtensions||=[]).push(ni())}var ii=`;`.codePointAt(0)??P.eof,ai=`&`.codePointAt(0)??P.eof;function oi(){return{handlers:{emphasis:si,strong:ci,text:fi}}}si.peek=li,ci.peek=ui;function si(e,t,n,r){return di(e,t,n,r,li(e,t,n),1)}function ci(e,t,n,r){return di(e,t,n,r,ui(e,t,n),2)}function li(e,t,n){return n.options.emphasis||`*`}function ui(e,t,n){return n.options.strong||`*`}function di(e,t,n,r,i,a){let o=i.repeat(a),s=n.enter(a===1?`emphasis`:`strong`),c=n.createTracker(r),l=c.move(o),u=c.move(n.containerPhrasing(e,{after:i,before:l,...c.current()})),d=bi(e,t,n,r.before),f=xi(e,t,n,r.after),p=pi(d,Ni(u),i,`open`);p.inside&&u&&(u=Ai(u));let m=pi({current:Pi(u),previous:Mi(u)},f,i,`close`);m.inside&&u&&(u=ji(u));let h=c.move(o);s();let g=m.outside&&Ei(t,n);return n.attentionEncodeSurroundingInfo={after:m.outside&&!g,before:p.outside},Di(n).cjkFriendlyEncodeAfterSupplementaryText=g,l+u+h}function fi(e,t,n,r){let i=Di(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${ki(a.codePointAt(0)??P.eof)}${n.safe(o,{...r,before:`;`})}`}function pi(e,t,n,r){let i=yi(e),a=Br(t);if(!Tr(i)&&!Tr(a))return r===`open`?mi(i,a,n):mi(a,i,n);let o={inside:!1,outside:!1},s={inside:!0,outside:!1},c={inside:!1,outside:!0},l={inside:!0,outside:!0};for(let i of[o,s,c,l]){let a=r===`open`?i.outside?Fi:e:i.inside?Fi:e,o=r===`open`?i.inside?Ii:t:i.outside?Ii:t;if(r===`open`?hi(n,a,o):gi(n,a,o))return i}return l}function mi(e,t,n){return vi(e)?vi(t)?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:xr(e)?vi(t)?{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function hi(e,t,n){let r=yi(t),{close:i,open:a}=_i(r,Br(n));return e===`_`?a&&(Dr(r)||!i):a}function gi(e,t,n){let r=Br(n),{close:i,open:a}=_i(yi(t),r);return e===`_`?i&&(Dr(r)||!a):i}function _i(e,t){let n=Sr(e),r=n||xr(e),i=Sr(t),a=i||xr(t);return{open:!a||i&&(r||Tr(e)),close:!r||n&&(a||Cr(t))}}function vi(e){return!xr(e)&&!Sr(e)}function yi(e){let t=Br(e.current);return e.current===null||!Er(t)?t:Vr(t,()=>e.previous,e.current)}function bi(e,t,n,r){let i=Pi(r),a=Mi(r);if(Si(i)||wi(i,a)){let r=Ti(e,t,n,-1);r&&(i=Pi(r),a=Mi(r))}return{current:i,previous:a}}function xi(e,t,n,r){let i=Ni(r);if(!Ci(i))return i;let a=Ti(e,t,n,1);return a?Ni(a):i}function Si(e){return e!==null&&56320<=e&&e<=57343}function Ci(e){return e!==null&&55296<=e&&e<=56319}function wi(e,t){return Er(Br(e))&&(t===null||t===P.eof)}function Ti(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return Oi(s)||void 0}function Ei(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(Ni(r.value)??0)>65535}function Di(e){return e}function Oi(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(Oi).join(``):``}function ki(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function Ai(e){let[t=``]=[...e];return ki(t.codePointAt(0)??P.eof)+e.slice(t.length)}function ji(e){let t=[...e],n=t.pop();return`${t.join(``)}${ki(n?.codePointAt(0)??P.eof)}`}function Mi(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??P.eof}function Ni(e){return e.codePointAt(0)??P.eof}function Pi(e){return[...e].at(-1)?.codePointAt(0)??P.eof}var Fi={current:ii,previous:P.eof},Ii=ai;function Li(){let e=this.data();(e.toMarkdownExtensions||=[]).push(oi())}function Ri(){ri.call(this),Li.call(this)}var zi=Ri;function Bi(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{[P.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[P.tilde]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Yr(o,o.length,0,Zr(s,e.slice(r+1,n),t)),Yr(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Yr(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=Yn.data);return e}function i(e,n,r){let{now:i,sliceSerialize:a,previous:o}=this,s=Wr(o)?Gr(o,i(),a):o,c=Br(s),l=new qr(s,i(),a),u=Vr(c,l.value.bind(l),s),d=this.events,f=0;return p;function p(t){return P.tilde,s===P.tilde&&d[d.length-1][1].type!==Yn.characterEscape?r(t):(e.enter(`strikethroughSequenceTemporary`),m(t))}function m(o){let c=Br(s);if(o===P.tilde)return f>1?r(o):(e.consume(o),f++,m);if(f<2&&!t)return r(o);let l=e.exit(`strikethroughSequenceTemporary`),d=Br(Ur(o)?Jr(o,i(),a):o),p=Sr(u)||xr(u),h=Sr(d)||xr(d),g=Cr(u)||wr(c);return l._open=!h||d===Jn.attentionSideAfter&&(p||g),l._close=!p||c===Jn.attentionSideAfter&&(h||Cr(d)),n(o)}}}function Vi(e){let t=this.data();(t.micromarkExtensions||=[]).push(Bi(e))}var Hi=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Ui=`;`.codePointAt(0)??P.eof,Wi=`&`.codePointAt(0)??P.eof;function Gi(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Hi}],handlers:{delete:Ki,text:qi}}}Ki.peek=Ji;function Ki(e,t,n,r){let i=n.enter(`strikethrough`),a=n.createTracker(r),o=a.move(`~~`),s=a.move(n.containerPhrasing(e,{after:`~`,before:o,...a.current()})),c=na(e,t,n,r.before),l=ra(e,t,n,r.after),u=Yi(c,ha(s),`open`);u.inside&&s&&(s=fa(s));let d=Yi({current:ga(s),previous:ma(s)},l,`close`);d.inside&&s&&(s=pa(s));let f=a.move(`~~`);i();let p=d.outside&&ca(t,n);return n.attentionEncodeSurroundingInfo={after:d.outside&&!p,before:u.outside},la(n).cjkFriendlyEncodeAfterSupplementaryText=p,o+s+f}function qi(e,t,n,r){let i=la(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${da(a.codePointAt(0)??P.eof)}${n.safe(o,{...r,before:`;`})}`}function Ji(){return`~`}function Yi(e,t,n){let r=ta(e),i=Br(t);if(!Tr(r)&&!Tr(i))return n===`open`?Xi(r,i):Xi(i,r);let a={inside:!1,outside:!1},o={inside:!0,outside:!1},s={inside:!1,outside:!0},c={inside:!0,outside:!0};for(let r of[a,o,s,c]){let i=n===`open`?r.outside?_a:e:r.inside?_a:e,a=n===`open`?r.inside?va:t:r.outside?va:t;if(n===`open`?Zi(i,a):Qi(i,a))return r}return c}function Xi(e,t){return ea(e)?ea(t)?{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:xr(e)?ea(t)?{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Zi(e,t){let{open:n}=$i(ta(e),Br(t));return n}function Qi(e,t){let n=Br(t),{close:r}=$i(ta(e),n);return r}function $i(e,t){let n=Sr(e),r=n||xr(e),i=Sr(t),a=i||xr(t);return{open:!a||i&&(r||Tr(e)),close:!r||n&&(a||Cr(t))}}function ea(e){return!xr(e)&&!Sr(e)}function ta(e){let t=Br(e.current);return e.current===null||!Er(t)?t:Vr(t,()=>e.previous,e.current)}function na(e,t,n,r){let i=ga(r),a=ma(r);if(ia(i)||oa(i,a)){let r=sa(e,t,n,-1);r&&(i=ga(r),a=ma(r))}return{current:i,previous:a}}function ra(e,t,n,r){let i=ha(r);if(!aa(i))return i;let a=sa(e,t,n,1);return a?ha(a):i}function ia(e){return e!==null&&56320<=e&&e<=57343}function aa(e){return e!==null&&55296<=e&&e<=56319}function oa(e,t){return Er(Br(e))&&(t===null||t===P.eof)}function sa(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return ua(s)||void 0}function ca(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(ha(r.value)??0)>65535}function la(e){return e}function ua(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(ua).join(``):``}function da(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function fa(e){let[t=``]=[...e];return da(t.codePointAt(0)??P.eof)+e.slice(t.length)}function pa(e){let t=[...e],n=t.pop();return`${t.join(``)}${da(n?.codePointAt(0)??P.eof)}`}function ma(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??P.eof}function ha(e){return e.codePointAt(0)??P.eof}function ga(e){return[...e].at(-1)?.codePointAt(0)??P.eof}var _a={current:Ui,previous:P.eof},va=Wi;function ya(){let e=this.data();(e.toMarkdownExtensions||=[]).push(Gi())}function ba(e){Vi.call(this,e),ya.call(this)}var xa=ba,Sa=(function(e){if(e==null)return Da;if(typeof e==`function`)return Ea(e);if(typeof e==`object`)return Array.isArray(e)?Ca(e):wa(e);if(typeof e==`string`)return Ta(e);throw Error(`Expected function, string, or object as test`)});function Ca(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Sa(e[n]);return Ea(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function wa(e){let t=e;return Ea(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Ta(e){return Ea(t);function t(t){return t&&t.type===e}}function Ea(e){return t;function t(t,n,r){return!!(Oa(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Da(){return!0}function Oa(e){return typeof e==`object`&&!!e&&`type`in e}function ka(e){return e}var Aa=[],ja=`skip`;function Ma(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Sa(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 (`+ka(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Aa,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Na(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 Na(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Aa:[e]}function Pa(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),Ma(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)}}var Fa=new Set([`。`,`.`,`,`,`、`,`?`,`!`,`:`,`;`,`(`,`)`,`【`,`】`,`「`,`」`,`『`,`』`,`〈`,`〉`,`《`,`》`]),Ia=/^(https?:\/\/|mailto:|www\.)/i,La=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type===`text`&&t.value===e.url},Ra=e=>{let t=0;for(let n of e){if(Fa.has(n))return t;t+=n.length}return null},za=(e,t)=>({...t,url:e,children:[{type:`text`,value:e}]}),Ba=e=>({type:`text`,value:e}),Va=()=>e=>{Pa(e,`link`,(e,t,n)=>{if(!n||typeof t!=`number`||!La(e)||!Ia.test(e.url))return;let r=Ra(e.url);if(r===null||r===0)return;let i=e.url.slice(0,r),a=e.url.slice(r),o=za(i,e),s=Ba(a);return n.children.splice(t,1,o,s),t+1})};function Ha(){let e=[zi],t=[Va,xa];return{name:`cjk`,type:`cjk`,remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:[...e,...t]}}var Ua=Ha(),Wa={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function Ga({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`,linkBlockPolicy:s=Wa.indicator,imageBlockPolicy:c=Wa.indicator}){let l=t.length&&!t.every(e=>e===`*`),u=n.length&&!n.every(e=>e===`*`);if(!e&&(l||u))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let u=to(e,t,n,r,i,a,o,s,c);Za(l),Pa(l,u)}}function Ka(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function qa(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var Ja=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),Ya=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function Xa(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=Ka(e,n);if(!o||Ya.has(o.protocol)||!(Ja.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=qa(e);return o&&t.some(e=>{let t=Ka(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function Za(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)Za(t)}}var Qa=Symbol(`node-seen`);function $a(e,t,n){return t===Wa.remove?{type:`remove`}:t===Wa.textOnly?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[...e.children]}}:{type:`replace`,element:{type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(e.properties.href),class:n},children:[...e.children,{type:`text`,value:` [blocked]`}]}}}function eo(e,t,n){if(t===Wa.remove)return{type:`remove`};if(t===Wa.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{type:`remove`}}return{type:`replace`,element:{type:`element`,tagName:`span`,properties:{class:n},children:[{type:`text`,value:`[Image blocked: `+String(e.properties.alt||`No description`)+`]`}]}}}var to=(e,t,n,r,i,a,o,s,c)=>{let l=(u,d,f)=>{if(u.type!==`element`||u[Qa])return!0;if(u.tagName===`a`){let n=Xa(u.properties.href,t,e,!1,!1,i);if(n===null){if(u[Qa]=!0,Pa(u,l),f&&typeof d==`number`){let e=$a(u,s,o);if(e.type===`remove`)return f.children.splice(d,1),[ja,d];f.children[d]=e.element}return ja}return u.properties.href=n,u.properties.target=`_blank`,u.properties.rel=`noopener noreferrer`,!0}if(u.tagName===`img`){let t=Xa(u.properties.src,n,e,r,!0,i);if(t===null){if(u[Qa]=!0,Pa(u,l),f&&typeof d==`number`){let e=eo(u,c,a);if(e.type===`remove`)return f.children.splice(d,1),[ja,d];f.children[d]=e.element}return ja}return u.properties.src=t,!0}return!0};return l},no=typeof self==`object`?self:globalThis,ro=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new no[e](t)},io=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof no[e]==`function`?ro(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(ro(a,o),i)};return r},ao=e=>io(new Map,e)(0),oo=``,{toString:so}={},{keys:co}=Object,lo=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=so.call(e).slice(8,-1);switch(n){case`Array`:return[1,oo];case`Object`:return[2,oo];case`Date`:return[3,oo];case`RegExp`:return[4,oo];case`Map`:return[5,oo];case`Set`:return[6,oo];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},uo=([e,t])=>e===0&&(t===`function`||t===`symbol`),fo=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=lo(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of co(r))(e||!uo(lo(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?oo:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(uo(lo(n))||uo(lo(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!uo(lo(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},po=(e,{json:t,lossy:n}={})=>{let r=[];return fo(!(t||n),!!t,new Map,r)(e),r},mo=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?ao(po(e,t)):structuredClone(e):(e,t)=>ao(po(e,t)),ho=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ho.prototype.normal={},ho.prototype.property={},ho.prototype.space=void 0;function go(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ho(n,r,t)}function _o(e){return e.toLowerCase()}var vo=class{constructor(e,t){this.attribute=t,this.property=e}};vo.prototype.attribute=``,vo.prototype.booleanish=!1,vo.prototype.boolean=!1,vo.prototype.commaOrSpaceSeparated=!1,vo.prototype.commaSeparated=!1,vo.prototype.defined=!1,vo.prototype.mustUseProperty=!1,vo.prototype.number=!1,vo.prototype.overloadedBoolean=!1,vo.prototype.property=``,vo.prototype.spaceSeparated=!1,vo.prototype.space=void 0;var yo=r({boolean:()=>L,booleanish:()=>xo,commaOrSpaceSeparated:()=>To,commaSeparated:()=>wo,number:()=>R,overloadedBoolean:()=>So,spaceSeparated:()=>Co}),bo=0,L=Eo(),xo=Eo(),So=Eo(),R=Eo(),Co=Eo(),wo=Eo(),To=Eo();function Eo(){return 2**++bo}var Do=Object.keys(yo),Oo=class extends vo{constructor(e,t,n,r){let i=-1;if(super(e,t),ko(this,`space`,r),typeof n==`number`)for(;++i<Do.length;){let e=Do[i];ko(this,Do[i],(n&yo[e])===yo[e])}}};Oo.prototype.defined=!0;function ko(e,t,n){n&&(e[t]=n)}function Ao(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Oo(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[_o(r)]=r,n[_o(a.attribute)]=r}return new ho(t,n,e.space)}var jo=Ao({properties:{ariaActiveDescendant:null,ariaAtomic:xo,ariaAutoComplete:null,ariaBusy:xo,ariaChecked:xo,ariaColCount:R,ariaColIndex:R,ariaColSpan:R,ariaControls:Co,ariaCurrent:null,ariaDescribedBy:Co,ariaDetails:null,ariaDisabled:xo,ariaDropEffect:Co,ariaErrorMessage:null,ariaExpanded:xo,ariaFlowTo:Co,ariaGrabbed:xo,ariaHasPopup:null,ariaHidden:xo,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Co,ariaLevel:R,ariaLive:null,ariaModal:xo,ariaMultiLine:xo,ariaMultiSelectable:xo,ariaOrientation:null,ariaOwns:Co,ariaPlaceholder:null,ariaPosInSet:R,ariaPressed:xo,ariaReadOnly:xo,ariaRelevant:null,ariaRequired:xo,ariaRoleDescription:Co,ariaRowCount:R,ariaRowIndex:R,ariaRowSpan:R,ariaSelected:xo,ariaSetSize:R,ariaSort:null,ariaValueMax:R,ariaValueMin:R,ariaValueNow:R,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Mo(e,t){return t in e?e[t]:t}function No(e,t){return Mo(e,t.toLowerCase())}var Po=Ao({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:wo,acceptCharset:Co,accessKey:Co,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alpha:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:Co,autoFocus:L,autoPlay:L,blocking:Co,capture:null,charSet:null,checked:L,cite:null,className:Co,closedBy:null,colorSpace:null,cols:R,colSpan:R,command:null,commandFor:null,content:null,contentEditable:xo,controls:L,controlsList:Co,coords:R|wo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:So,draggable:xo,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:Co,height:R,hidden:So,high:R,href:null,hrefLang:null,htmlFor:Co,httpEquiv:Co,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:Co,itemRef:Co,itemScope:L,itemType:Co,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:R,manifest:null,max:null,maxLength:R,media:null,method:null,min:null,minLength:R,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:L,optimum:R,pattern:null,ping:Co,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:Co,required:L,reversed:L,rows:R,rowSpan:R,sandbox:Co,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootCustomElementRegistry:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shadowRootSerializable:L,shape:null,size:R,sizes:null,slot:null,span:R,spellCheck:xo,src:null,srcDoc:null,srcLang:null,srcSet:null,start:R,step:null,style:null,tabIndex:R,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:xo,width:R,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Co,axis:null,background:null,bgColor:null,border:R,borderColor:null,bottomMargin:R,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:R,leftMargin:R,link:null,longDesc:null,lowSrc:null,marginHeight:R,marginWidth:R,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:R,rules:null,scheme:null,scrolling:xo,standby:null,summary:null,text:null,topMargin:R,valueType:null,version:null,vAlign:null,vLink:null,vSpace:R,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:L,disablePictureInPicture:L,disableRemotePlayback:L,exportParts:wo,part:Co,prefix:null,property:null,results:R,security:null,unselectable:null},space:`html`,transform:No}),Fo=Ao({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:To,accentHeight:R,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:R,amplitude:R,arabicForm:null,ascent:R,attributeName:null,attributeType:null,azimuth:R,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:R,by:null,calcMode:null,capHeight:R,className:Co,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:R,diffuseConstant:R,direction:null,display:null,dur:null,divisor:R,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:R,enableBackground:null,end:null,event:null,exponent:R,externalResourcesRequired:null,fill:null,fillOpacity:R,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:wo,g2:wo,glyphName:wo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:R,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:R,horizOriginX:R,horizOriginY:R,id:null,ideographic:R,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:R,k:R,k1:R,k2:R,k3:R,k4:R,kernelMatrix:To,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:R,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:R,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:R,overlineThickness:R,paintOrder:null,panose1:null,path:null,pathLength:R,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Co,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:R,pointsAtY:R,pointsAtZ:R,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:To,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:To,rev:To,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:To,requiredFeatures:To,requiredFonts:To,requiredFormats:To,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:R,specularExponent:R,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:R,strikethroughThickness:R,string:null,stroke:null,strokeDashArray:To,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:R,strokeOpacity:R,strokeWidth:null,style:null,surfaceScale:R,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:To,tabIndex:R,tableValues:null,target:null,targetX:R,targetY:R,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:To,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:R,underlineThickness:R,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:R,values:null,vAlphabetic:R,vMathematical:R,vectorEffect:null,vHanging:R,vIdeographic:R,version:null,vertAdvY:R,vertOriginX:R,vertOriginY:R,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:R,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Mo}),Io=Ao({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Lo=Ao({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:No}),Ro=Ao({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),zo={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Bo=/[A-Z]/g,Vo=/-[a-z]/g,Ho=/^data[-\w.:]+$/i;function Uo(e,t){let n=_o(t),r=t,i=vo;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ho.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Vo,Go);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Vo.test(e)){let n=e.replace(Bo,Wo);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Oo}return new i(r,t)}function Wo(e){return`-`+e.toLowerCase()}function Go(e){return e.charAt(1).toUpperCase()}var Ko=go([jo,Po,Io,Lo,Ro],`html`),qo=go([jo,Fo,Io,Lo,Ro],`svg`);function Jo(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Yo(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Xo=/[#.]/g;function Zo(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){Xo.lastIndex=i;let e=Xo.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function Qo(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function $o(e){return e.join(` `).trim()}function es(e,t,n){let r=n?os(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=Zo(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,ts(i))a.unshift(i);else for(let[t,n]of Object.entries(i))ns(e,o.properties,t,n)}for(let e of a)rs(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function ts(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function ns(e,t,n,r){let i=Uo(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?Qo(r):i.commaSeparated?Jo(r):i.commaOrSpaceSeparated?Qo(Jo(r).join(` `)):is(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?as(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(is(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function rs(e,t){if(t!=null){if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)rs(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?rs(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function is(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||_o(n)===_o(t)))return!0}return n}function as(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function os(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var ss=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),cs=es(Ko,`div`),ls=es(qo,`g`,ss);function us(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=ds(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=ds(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function ds(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-CNhdxt2h.js","./rolldown-runtime-B0Z9INg1.js","./mermaid-parser-HclGiUj8.js","./mermaid-markup-D01n6Kcj.js","./chunk-Y2CYZVJY-DsF7k-Jl.js","./src-BY_WSiz7.js","./chunk-I66GZJ75-DXqP3B91.js","./chunk-NSK5VX7P-D5026Kzu.js","./dist-BDCdLWk4.js","./chunk-4I5QYGJK-0RNwvBrV.js","./chunk-WRU74C26-BSENSjFs.js","./chunk-7BUUIJ7U-Bb538aSH.js","./chunk-UBXNYLIW-DzzRI8B_.js","./chunk-W5SLKNZC-jIqX_Eb5.js","./chunk-QR6OTTB3-DgKOIk7B.js","./rough.esm-Dy-Kn_BL.js","./chunk-7Z6QIM7H-C6_Ywz3w.js","./line-BImJQVif.js","./path-fybaL0A-.js","./array-BifhSqXX.js","./highlighted-body-KPVGNVTW-D19paMBO.js","./bundle-mjs-CyB9GzWm.js","./bash-B7CDPTg5.js","./shellscript-CLZ0U2zV.js","./html-BY76lXLH.js","./css-BsVw1vtW.js","./javascript-BgS3c2Ky.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,n,r,t as i}from"./rolldown-runtime-B0Z9INg1.js";import{a,i as o,n as s,r as c,t as l}from"./bundle-mjs-CyB9GzWm.js";import{Bt as u,C as d,F as f,G as p,Ht as m,I as h,L as g,R as _,T as v,Tn as y,Wn as b,X as x,Z as S,_t as C,an as w,ar as T,c as E,j as ee,jn as D,ln as te,n as O,on as ne,or as k,rn as re,sn as ie,t as ae,un as oe,vt as se,w as A,yt as ce,z as j}from"./vscode-CFosRdBr.js";import{B as le,H as ue,L as de,N as fe,U as pe,V as me,W as he,_ as ge,c as _e,g as ve,h as ye,i as be,l as xe,m as Se,n as Ce,o as we,p as Te,r as Ee,t as De,v as Oe,y as ke,z as Ae}from"./label-DFsbx3OI.js";import{a as je,i as Me,r as Ne,t as Pe}from"./switch-DrjcFF6_.js";import{t as Fe}from"./mermaid-parser-HclGiUj8.js";import{B as Ie,F as Le,H as Re,L as ze,N as Be,V as Ve,j as He,m as Ue}from"./index-DlpuYMzW.js";import{n as We,t as Ge}from"./badge-X4W3Q0cc.js";var Ke=_(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),qe=_(`bookmark`,[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]),Je=_(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Ye=_(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Xe=_(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ze=_(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Qe=_(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),$e=_(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),et=_(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),tt=_(`hat-glasses`,[[`path`,{d:`M14 18a2 2 0 0 0-4 0`,key:`1v8fkw`}],[`path`,{d:`m19 11-2.11-6.657a2 2 0 0 0-2.752-1.148l-1.276.61A2 2 0 0 1 12 4H8.5a2 2 0 0 0-1.925 1.456L5 11`,key:`1fkr7p`}],[`path`,{d:`M2 11h20`,key:`3eubbj`}],[`circle`,{cx:`17`,cy:`18`,r:`3`,key:`82mm0e`}],[`circle`,{cx:`7`,cy:`18`,r:`3`,key:`lvkj7j`}]]),nt=_(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),rt=_(`music-2`,[[`circle`,{cx:`8`,cy:`18`,r:`4`,key:`1fc0mg`}],[`path`,{d:`M12 18V2l7 4`,key:`g04rme`}]]),it=_(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),at=_(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),ot=_(`signal-low`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}]]),st=_(`signal-high`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}]]),ct=_(`signal-medium`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}]]),lt=_(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ut=_(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),dt=_(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),ft=_(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),pt=e(o(),1),M=c(),N=e(a(),1);function mt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ht(...e){return t=>{let n=!1,r=e.map(e=>{let r=mt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():mt(e[t],null)}}}}function gt(...e){return N.useCallback(ht(...e),e)}var _t=Symbol.for(`react.lazy`),vt=N.use;function yt(e){return typeof e==`object`&&!!e&&`then`in e}function bt(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===_t&&`_payload`in e&&yt(e._payload)}function xt(e){let t=St(e),n=N.forwardRef((e,n)=>{let{children:r,...i}=e;bt(r)&&typeof vt==`function`&&(r=vt(r._payload));let a=N.Children.toArray(r),o=a.find(wt);if(o){let e=o.props.children,r=a.map(t=>t===o?N.Children.count(e)>1?N.Children.only(null):N.isValidElement(e)?e.props.children:null:t);return(0,M.jsx)(t,{...i,ref:n,children:N.isValidElement(e)?N.cloneElement(e,void 0,r):null})}return(0,M.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function St(e){let t=N.forwardRef((e,t)=>{let{children:n,...r}=e;if(bt(n)&&typeof vt==`function`&&(n=vt(n._payload)),N.isValidElement(n)){let e=Et(n),i=Tt(r,n.props);return n.type!==N.Fragment&&(i.ref=t?ht(t,e):e),N.cloneElement(n,i)}return N.Children.count(n)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ct=Symbol(`radix.slottable`);function wt(e){return N.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ct}function Tt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Et(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Dt(e){if(!(e.length>8388608||!Ae(e)))try{let t=atob(e),n=new ArrayBuffer(t.length),r=new Uint8Array(n);for(let e=0;e<t.length;e+=1)r[e]=t.charCodeAt(e);return n}catch{return}}var Ot=/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/i;function kt(e){let t=e.mediaType.trim().toLowerCase();if(Ot.test(t))switch(e.modality){case`image`:return fe.includes(t)?t:void 0;case`audio`:return t.startsWith(`audio/`)?t:void 0;case`video`:return t.startsWith(`video/`)?t:void 0;case`file`:return`application/octet-stream`}}function At(e){let t=e.source.type===`base64`?e.source.data:void 0,[n,r]=(0,N.useState)(),i=kt(e);return(0,N.useEffect)(()=>{if(r(void 0),t===void 0||i===void 0)return;let e=Dt(t);if(!e||typeof URL.createObjectURL!=`function`)return;let n;try{n=URL.createObjectURL(new Blob([e],{type:i}))}catch{return}return r(n),()=>URL.revokeObjectURL?.(n)},[i,t]),n}function jt(e){return e.source.type===`artifact`?`Generated ${e.modality} is stored as an artifact (${e.source.artifactId}).`:e.source.type===`url`?`Generated ${e.modality} requires a trusted remote-media resolver.`:`Generated ${e.modality} could not be rendered.`}function Mt({media:e,className:t,classNames:n}){let r=At(e),i=r?.startsWith(`blob:`)?r:void 0;if(!i)return(0,M.jsx)(`div`,{className:n?.unavailable??t,"data-media-id":e.id,"data-testid":`generated-media-unavailable`,children:jt(e)});let a=n?.[e.modality]??t;switch(e.modality){case`image`:return(0,M.jsx)(`img`,{alt:e.name??`Generated image`,className:a,"data-media-id":e.id,src:i});case`audio`:return(0,M.jsx)(`audio`,{className:a,controls:!0,"data-media-id":e.id,src:i});case`video`:return(0,M.jsx)(`video`,{className:a,controls:!0,"data-media-id":e.id,src:i});case`file`:return(0,M.jsx)(`a`,{className:a,"data-media-id":e.id,download:e.name??!0,href:i,children:e.name??`Generated file (${e.mediaType})`})}return null}var Nt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,Pt=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Nt[n[e]&63];return t};function Ft({className:e,orientation:t=`horizontal`,...n}){return(0,M.jsx)(Ue,{"data-slot":`separator`,orientation:t,className:j(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var It=({className:e,children:t,...n})=>(0,M.jsxs)(`div`,{className:j(`flex items-center gap-0.5 overflow-hidden text-muted-foreground`,e),...n,children:[t,(0,M.jsx)(Ft,{})]}),Lt=({className:e,children:t,...n})=>t??(0,M.jsx)(qe,{className:j(`size-4 shrink-0`,e),...n}),Rt=({children:e,variant:t=`ghost`,size:n=`sm`,tooltip:r,...i})=>r?(0,M.jsxs)(Ie,{children:[(0,M.jsx)(Re,{render:(0,M.jsx)(A,{size:n,type:`button`,variant:t,...i}),children:e}),(0,M.jsx)(Ve,{align:`start`,side:`bottom`,children:r})]}):(0,M.jsx)(A,{size:n,type:`button`,variant:t,...i,children:e}),zt={damping:.7,stiffness:.05,mass:1.25},Bt=70,Vt=1e3/60,Ht=350,Ut=!1;globalThis.document?.addEventListener(`mousedown`,()=>{Ut=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{Ut=!1}),globalThis.document?.addEventListener(`click`,()=>{Ut=!1});var Wt=(e={})=>{let[t,n]=(0,N.useState)(!1),[r,i]=(0,N.useState)(e.initial!==!1),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null);s.current=e;let c=(0,N.useCallback)(()=>{if(!Ut)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,N.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,N.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,N.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Bt}}},[]),f=(0,N.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=qt(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/Vt;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:qt(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,N.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,N.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,N.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=Gt(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=Gt(e=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=qt(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:Ht})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function Gt(e,t){let n=(0,N.useCallback)(t=>(n.current=t,e(t)),t);return n}var Kt=new Map;function qt(...e){let t={...zt},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return Kt.has(r)||Kt.set(r,Object.freeze(t)),n?`instant`:Kt.get(r)}var Jt=(0,N.createContext)(null),Yt=typeof window<`u`?N.useLayoutEffect:N.useEffect;function Xt({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,N.useRef)(null),d=Wt({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:N.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,N.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,N.useImperativeHandle)(c,()=>y,[y]),Yt(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),N.createElement(Jt.Provider,{value:y},N.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=Zt();return N.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},N.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(Xt||={});function Zt(){let e=(0,N.useContext)(Jt);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}var Qt=({className:e,...t})=>(0,M.jsx)(Xt,{className:j(`relative flex-1 overflow-y-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),$t=({className:e,...t})=>(0,M.jsx)(Xt.Content,{className:j(`flex flex-col gap-8 p-4`,e),...t}),en=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=Zt(),i=(0,N.useCallback)(()=>{r()},[r]);return!n&&(0,M.jsx)(A,{className:j(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,M.jsx)(Ke,{className:`size-4`})})};v(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});var tn=()=>Fe(()=>import(`./mermaid.core-CNhdxt2h.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url);function nn(e,t,n){return Math.min(n,Math.max(t,e))}function rn(e){let t=e?.trim();if(!t||t===`none`)return 1;let n=t.endsWith(`%`)?Number.parseFloat(t)/100:Number.parseFloat(t);return Number.isFinite(n)?nn(n,0,1):1}function an(e,t){if(e===`none`)return 0;let n=Number.parseFloat(e);return Number.isFinite(n)?e.endsWith(`%`)?n/100*t:n:null}function on(e){if(e===`none`)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?e.endsWith(`turn`)?t*360:e.endsWith(`grad`)?t*.9:e.endsWith(`rad`)?t*180/Math.PI:t:null}function sn(e){let t=nn(e,0,1);return nn(t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055,0,1)*255}function cn(e,t,n){let r=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[sn(4.0767416621*r-3.3077115913*i+.2309699292*a),sn(-1.2684380046*r+2.6097574011*i-.3413193965*a),sn(-.0041960863*r-.7034186147*i+1.707614701*a)]}function ln(e){let t=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.exec(e);if(!t)return null;let n=t[1]??``;n.length<=4&&(n=[...n].map(e=>e+e).join(``));let r=e=>Number.parseInt(n.slice(e,e+2),16);return{a:n.length===8?r(6)/255:1,b:r(4),g:r(2),r:r(0)}}function un(e){let[t=``,n]=e.replace(/,/g,` `).split(`/`);return{alpha:n,tokens:t.trim().split(/\s+/).filter(Boolean)}}function dn(e,t){if(e.length<3)return null;let[n,r,i]=e.slice(0,3).map(e=>an(e,255));return n===null||r===null||i===null||n===void 0||r===void 0||i===void 0?null:{a:t,b:nn(i,0,255),g:nn(r,0,255),r:nn(n,0,255)}}function fn(e,t,n){if(t.length<3)return null;let r=an(t[0]??``,1);if(r===null)return null;let i,a;if(e===`oklch`){let e=an(t[1]??``,.4),n=on(t[2]??``);if(e===null||n===null)return null;let r=n*Math.PI/180;i=e*Math.cos(r),a=e*Math.sin(r)}else i=an(t[1]??``,.4),a=an(t[2]??``,.4);if(i===null||a===null)return null;let[o,s,c]=cn(nn(r,0,1),i,a);return{a:n,b:c,g:s,r:o}}function pn(e,t){if((e[0]??``).toLowerCase()!==`srgb`)return null;let[n,r,i]=e.slice(1,4).map(e=>an(e,1));return n==null||r==null||i==null?null:{a:t,b:nn(i,0,1)*255,g:nn(r,0,1)*255,r:nn(n,0,1)*255}}function mn(e){let t=e.trim();if(!t)return null;let n=ln(t);if(n)return n;let r=/^([a-z-]+)\(([^)]*)\)$/i.exec(t);if(!r)return null;let i=(r[1]??``).toLowerCase(),{alpha:a,tokens:o}=un(r[2]??``),s=rn(a);if(i===`rgb`||i===`rgba`){let e=a===void 0?o[3]:void 0;return dn(o,e?rn(e):s)}return i===`oklch`||i===`oklab`?fn(i,o,s):i===`color`?pn(o,s):null}function hn(e){return Math.round(nn(e,0,255)).toString(16).padStart(2,`0`)}function gn(e){return`#${hn(e.r)}${hn(e.g)}${hn(e.b)}`}function _n(e){let t=mn(e);return t?gn(t):null}function vn(e,t,n){let r=mn(e),i=mn(t);if(!r)return e;if(!i)return gn(r);let a=nn(n,0,1);return gn({b:r.b+(i.b-r.b)*a,g:r.g+(i.g-r.g)*a,r:r.r+(i.r-r.r)*a})}var yn={dark:{background:`#18191b`,border:`#2f2f37`,error:`#e54666`,foreground:`#fcfcfd`,muted:`#212225`,mutedForeground:`#b0b4ba`,primary:`#6e56cf`},light:{background:`#f9f9fb`,border:`#e8e8ec`,error:`#e54666`,foreground:`#1c2024`,muted:`#f0f0f3`,mutedForeground:`#60646c`,primary:`#6e56cf`}},bn=`'Inter Variable', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`,xn=`14px`;function Sn(e){let t=e?.trim().replace(/"/g,`'`)??``;return!t||/\bmonospace\b/i.test(t)?bn:`${t}, ${bn}`}function Cn(e,t,n){let r=n?.(e);return(r?_n(r):null)??_n(e)??t}function wn(e,t,n){let r=yn[t];return{background:Cn(e.background,r.background,n),border:Cn(e.border,r.border,n),error:Cn(e.error,r.error,n),foreground:Cn(e.foreground,r.foreground,n),muted:Cn(e.muted,r.muted,n),mutedForeground:Cn(e.mutedForeground,r.mutedForeground,n),primary:Cn(e.primary,r.primary,n)}}function Tn(e,t,{fontFamily:n=bn,resolveColor:r}={}){let i=wn(e,t,r),a=t===`dark`,o=vn(i.background,i.primary,a?.18:.1),s=vn(i.background,i.primary,a?.6:.5),c=vn(i.background,i.foreground,a?.08:.05),l=vn(i.background,i.foreground,a?.05:.03),u=vn(i.background,i.primary,a?.07:.04),d=vn(i.background,i.error,a?.2:.12);return{activationBkgColor:c,activationBorderColor:i.border,actorBkg:o,actorBorder:s,actorLineColor:i.mutedForeground,actorTextColor:i.foreground,background:i.background,clusterBkg:l,clusterBorder:i.border,darkMode:a,edgeLabelBackground:i.background,errorBkgColor:d,errorTextColor:i.error,fontFamily:n,fontSize:xn,labelBoxBkgColor:c,labelBoxBorderColor:i.border,labelTextColor:i.foreground,lineColor:i.mutedForeground,loopTextColor:i.foreground,mainBkg:o,nodeBorder:s,noteBkgColor:i.muted,noteBorderColor:i.border,noteTextColor:i.foreground,primaryBorderColor:s,primaryColor:o,primaryTextColor:i.foreground,secondaryBorderColor:i.border,secondaryColor:c,secondaryTextColor:i.foreground,sequenceNumberColor:i.background,signalColor:i.mutedForeground,signalTextColor:i.foreground,tertiaryBorderColor:i.border,tertiaryColor:u,tertiaryTextColor:i.foreground,textColor:i.foreground,titleColor:i.foreground}}function En(e,t,n={}){return{fontFamily:n.fontFamily??`'Inter Variable', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`,htmlLabels:!1,securityLevel:`strict`,startOnLoad:!1,suppressErrorRendering:!0,theme:`base`,themeVariables:Tn(e,t,n)}}function Dn(e=`light`){return En(yn[e],e)}var On=`data-cline-diagram-href`,kn=[`href`,`xlink:href`];function An(e){try{let t=new URL(e.trim());return t.protocol===`http:`||t.protocol===`https:`?t.href:null}catch{return null}}function jn(e){if(typeof DOMParser>`u`||typeof XMLSerializer>`u`)return null;try{let t=new DOMParser().parseFromString(e,`image/svg+xml`);if(t.getElementsByTagName(`parsererror`).length>0)return null;for(let e of Array.from(t.getElementsByTagName(`a`))){let t=kn.map(t=>e.getAttribute(t)).find(e=>!!e);for(let t of kn)e.removeAttribute(t);e.removeAttribute(`target`);let n=t?An(t):null;n&&e.setAttribute(On,n)}return new XMLSerializer().serializeToString(t.documentElement)}catch{return null}}var Mn=/<a\b[^>]*>/gi,Nn=/\s(?:xlink:href|href|target)\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;function Pn(e){return e.replace(Mn,e=>{let t=null,n=e.replace(Nn,(e,n,r)=>(/\starget\s*=/i.test(e)||(t??=n??r??null),``)),r=t?An(t):null;return r?n.replace(/\s*\/?>$/,e=>` ${On}="${r.replace(/"/g,`"`)}"${e}`):n})}function Fn(e){return e.includes(`<a`)?jn(e)??Pn(e):e}var In=Promise.resolve();function Ln(e){let t=In.then(e,e);return In=t.catch(()=>void 0),t}var Rn=new WeakMap;function zn(e=tn){let t,n=()=>(t??=e().catch(e=>{throw t=void 0,e}),t);return{async render(e,t,r){let i=(await n()).default;return Ln(async()=>{Rn.get(i)!==r&&(i.initialize(r),Rn.set(i,r));let n=await i.render(e,t);return{...n,svg:Fn(n.svg)}})}}}var Bn={background:`--card`,border:`--border`,error:`--destructive`,foreground:`--foreground`,muted:`--muted`,mutedForeground:`--muted-foreground`,primary:`--primary`},Vn=`--font-sans`;function Hn(e){if(typeof document>`u`)return`light`;let t=document.documentElement;return(e??t).closest(`.dark`)||t.classList.contains(`dark`)||(t.getAttribute(`data-cline-hub-theme`)??t.dataset.theme)===`dark`?`dark`:`light`}var Un;function Wn(e){if(typeof document>`u`)return null;if(Un===void 0){let e=document.createElement(`canvas`);e.width=1,e.height=1,Un=e.getContext(`2d`,{willReadFrequently:!0})}let t=Un;if(!t||(t.fillStyle=`#010203`,t.fillStyle=e,t.fillStyle===`#010203`&&_n(e)===null))return null;t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let[n=0,r=0,i=0,a=255]=t.getImageData(0,0,1,1).data;if(a===0)return null;let o=e=>e.toString(16).padStart(2,`0`);return`#${o(n)}${o(r)}${o(i)}`}function Gn(e,t){let n=e.getPropertyValue(t).trim();return n?_n(n)??Wn(n)??``:``}function Kn(e){if(typeof document>`u`){let e=yn.light,t=Sn(void 0);return{fontFamily:t,key:JSON.stringify([`light`,e,t]),mode:`light`,tokens:e}}let t=e??document.documentElement,n=Hn(t),r=getComputedStyle(t),i=e=>Gn(r,e),a=wn({background:i(Bn.background),border:i(Bn.border),error:i(Bn.error),foreground:i(Bn.foreground),muted:i(Bn.muted),mutedForeground:i(Bn.mutedForeground),primary:i(Bn.primary)},n),o=Sn(r.getPropertyValue(Vn));return{fontFamily:o,key:JSON.stringify([n,a,o]),mode:n,tokens:a}}Dn(`light`);function qn(e=tn){let t=zn(e),n={},r,i={initialize(e){n={...n,...e},r=void 0},render(e,i){let a=Kn();return r?.key!==a.key&&(r={config:{...En(a.tokens,a.mode,{fontFamily:a.fontFamily}),...n,securityLevel:`strict`},key:a.key}),t.render(e,i,r.config)}};return{getMermaid(e){return e&&i.initialize(e),i},language:`mermaid`,name:`mermaid`,type:`diagram`}}var P={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},Jn={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},Yn={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},Xn=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Zn=[12288,12288,65281,65376,65504,65510],Qn=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],$n=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],er=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],tr=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},nr=19968,[rr,ir]=ar(er);function ar(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(nr>=i&&nr<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var or=e=>e<161||e>1114109?!1:tr(Xn,e),sr=e=>e<12288||e>65510?!1:tr(Zn,e),cr=e=>e<8361||e>65518?!1:tr(Qn,e),lr=e=>e<32||e>10630?!1:tr($n,e),ur=e=>e>=rr&&e<=ir?!0:e<4352||e>262141?!1:tr(er,e);function dr(e){return or(e)?`ambiguous`:sr(e)?`fullwidth`:cr(e)?`halfwidth`:lr(e)?`narrow`:ur(e)?`wide`:`neutral`}function fr(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function pr(e){return fr(e),dr(e)}function mr(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function hr(e){if(!e||e<4352)return!1;switch(pr(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!mr(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999&&null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function gr(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function _r(e){return e!==null&&e>=65024&&e<=65038}var vr=br(/\p{P}|\p{S}/u),yr=br(/\s/);function br(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function xr(e){return!!(e&Jn.characterGroupWhitespace)}function Sr(e){return(e&zr.cjkPunctuation)===Jn.characterGroupPunctuation}function Cr(e){return!!(e&zr.cjk)}function wr(e){return e===zr.ivs}function Tr(e){return!!(e&zr.cjkOrIvs)}function Er(e){return e===zr.nonEmojiGeneralUseVS}function Dr(e){return!!(e&zr.spaceOrPunctuation)}var Or=Rr(/[A-Za-z]/),kr=Rr(/[\dA-Za-z]/),Ar=Rr(/[#-'*+\--9=?A-Z^-~]/);function jr(e){return e!==null&&(e<32||e===127)}var Mr=Rr(/\d/),Nr=Rr(/[\dA-Fa-f]/),Pr=Rr(/[!-/:-@[-`{-~]/);function F(e){return e!==null&&e<-2}function Fr(e){return e!==null&&(e<0||e===32)}function I(e){return e===-2||e===-1||e===32}var Ir=Rr(/\p{P}|\p{S}/u),Lr=Rr(/\s/);function Rr(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var zr;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(zr||={});function Br(e){if(e===P.eof||Fr(e)||yr(e))return Jn.characterGroupWhitespace;let t=0;if(e>=4352){if(_r(e))return zr.nonEmojiGeneralUseVS;switch(hr(e)){case null:return zr.ivs;case!0:t|=zr.cjk}}return vr(e)&&(t|=Jn.characterGroupPunctuation),t}function Vr(e,t,n){if(!Er(e))return e;let r=t(),i=Br(r);return!r||xr(i)?e:gr(r,n)?zr.cjkPunctuation:Hr(i)}function Hr(e){return e&~zr.ivs}function Ur(e){return!!(e&&e>=55296&&e<=56319)}function Wr(e){return!!(e&&e>=56320&&e<=57343)}function Gr(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function Kr(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var qr=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=Kr(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function Jr(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}function Yr(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 Xr(e,t){return e.length>0?(Yr(e,e.length,0,t),e):t}function Zr(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 Qr={name:`attention`,resolveAll:$r,tokenize:ei};function $r(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};ti(d,-c),ti(f,c),o={type:c>1?Yn.strongSequence:Yn.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?Yn.strongSequence:Yn.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?Yn.strongText:Yn.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?Yn.strong:Yn.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Xr(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Xr(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=Xr(l,Zr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Xr(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Xr(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Yr(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ei(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=Wr(a)?Gr(a,r(),i):a,s=Br(o),c=new qr(o,r(),i),l=Vr(s,c.value.bind(c),o),u;return d;function d(t){return t===P.asterisk||P.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=Br(Ur(a)?Jr(a,r(),i):a),d=Sr(l),p=d||xr(l),m=Sr(c),h=m||xr(c),g=Tr(l),_=!h||m&&(p||g)||n.includes(a),v=!p||d&&(h||Cr(c))||n.includes(o);return s._open=!!(u===P.asterisk?_:_&&(Dr(l)||!v)),s._close=!!(u===P.asterisk?v:v&&(Dr(c)||!_)),t(a)}}function ti(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function ni(){return{text:{[P.asterisk]:Qr,[P.underscore]:Qr},insideSpan:{null:[Qr]}}}function ri(){let e=this.data();(e.micromarkExtensions||=[]).push(ni())}var ii=`;`.codePointAt(0)??P.eof,ai=`&`.codePointAt(0)??P.eof;function oi(){return{handlers:{emphasis:si,strong:ci,text:fi}}}si.peek=li,ci.peek=ui;function si(e,t,n,r){return di(e,t,n,r,li(e,t,n),1)}function ci(e,t,n,r){return di(e,t,n,r,ui(e,t,n),2)}function li(e,t,n){return n.options.emphasis||`*`}function ui(e,t,n){return n.options.strong||`*`}function di(e,t,n,r,i,a){let o=i.repeat(a),s=n.enter(a===1?`emphasis`:`strong`),c=n.createTracker(r),l=c.move(o),u=c.move(n.containerPhrasing(e,{after:i,before:l,...c.current()})),d=bi(e,t,n,r.before),f=xi(e,t,n,r.after),p=pi(d,Ni(u),i,`open`);p.inside&&u&&(u=Ai(u));let m=pi({current:Pi(u),previous:Mi(u)},f,i,`close`);m.inside&&u&&(u=ji(u));let h=c.move(o);s();let g=m.outside&&Ei(t,n);return n.attentionEncodeSurroundingInfo={after:m.outside&&!g,before:p.outside},Di(n).cjkFriendlyEncodeAfterSupplementaryText=g,l+u+h}function fi(e,t,n,r){let i=Di(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${ki(a.codePointAt(0)??P.eof)}${n.safe(o,{...r,before:`;`})}`}function pi(e,t,n,r){let i=yi(e),a=Br(t);if(!Tr(i)&&!Tr(a))return r===`open`?mi(i,a,n):mi(a,i,n);let o={inside:!1,outside:!1},s={inside:!0,outside:!1},c={inside:!1,outside:!0},l={inside:!0,outside:!0};for(let i of[o,s,c,l]){let a=r===`open`?i.outside?Fi:e:i.inside?Fi:e,o=r===`open`?i.inside?Ii:t:i.outside?Ii:t;if(r===`open`?hi(n,a,o):gi(n,a,o))return i}return l}function mi(e,t,n){return vi(e)?vi(t)?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:xr(e)?vi(t)?{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function hi(e,t,n){let r=yi(t),{close:i,open:a}=_i(r,Br(n));return e===`_`?a&&(Dr(r)||!i):a}function gi(e,t,n){let r=Br(n),{close:i,open:a}=_i(yi(t),r);return e===`_`?i&&(Dr(r)||!a):i}function _i(e,t){let n=Sr(e),r=n||xr(e),i=Sr(t),a=i||xr(t);return{open:!a||i&&(r||Tr(e)),close:!r||n&&(a||Cr(t))}}function vi(e){return!xr(e)&&!Sr(e)}function yi(e){let t=Br(e.current);return e.current===null||!Er(t)?t:Vr(t,()=>e.previous,e.current)}function bi(e,t,n,r){let i=Pi(r),a=Mi(r);if(Si(i)||wi(i,a)){let r=Ti(e,t,n,-1);r&&(i=Pi(r),a=Mi(r))}return{current:i,previous:a}}function xi(e,t,n,r){let i=Ni(r);if(!Ci(i))return i;let a=Ti(e,t,n,1);return a?Ni(a):i}function Si(e){return e!==null&&56320<=e&&e<=57343}function Ci(e){return e!==null&&55296<=e&&e<=56319}function wi(e,t){return Er(Br(e))&&(t===null||t===P.eof)}function Ti(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return Oi(s)||void 0}function Ei(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(Ni(r.value)??0)>65535}function Di(e){return e}function Oi(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(Oi).join(``):``}function ki(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function Ai(e){let[t=``]=[...e];return ki(t.codePointAt(0)??P.eof)+e.slice(t.length)}function ji(e){let t=[...e],n=t.pop();return`${t.join(``)}${ki(n?.codePointAt(0)??P.eof)}`}function Mi(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??P.eof}function Ni(e){return e.codePointAt(0)??P.eof}function Pi(e){return[...e].at(-1)?.codePointAt(0)??P.eof}var Fi={current:ii,previous:P.eof},Ii=ai;function Li(){let e=this.data();(e.toMarkdownExtensions||=[]).push(oi())}function Ri(){ri.call(this),Li.call(this)}var zi=Ri;function Bi(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{[P.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[P.tilde]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Yr(o,o.length,0,Zr(s,e.slice(r+1,n),t)),Yr(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Yr(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=Yn.data);return e}function i(e,n,r){let{now:i,sliceSerialize:a,previous:o}=this,s=Wr(o)?Gr(o,i(),a):o,c=Br(s),l=new qr(s,i(),a),u=Vr(c,l.value.bind(l),s),d=this.events,f=0;return p;function p(t){return P.tilde,s===P.tilde&&d[d.length-1][1].type!==Yn.characterEscape?r(t):(e.enter(`strikethroughSequenceTemporary`),m(t))}function m(o){let c=Br(s);if(o===P.tilde)return f>1?r(o):(e.consume(o),f++,m);if(f<2&&!t)return r(o);let l=e.exit(`strikethroughSequenceTemporary`),d=Br(Ur(o)?Jr(o,i(),a):o),p=Sr(u)||xr(u),h=Sr(d)||xr(d),g=Cr(u)||wr(c);return l._open=!h||d===Jn.attentionSideAfter&&(p||g),l._close=!p||c===Jn.attentionSideAfter&&(h||Cr(d)),n(o)}}}function Vi(e){let t=this.data();(t.micromarkExtensions||=[]).push(Bi(e))}var Hi=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Ui=`;`.codePointAt(0)??P.eof,Wi=`&`.codePointAt(0)??P.eof;function Gi(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Hi}],handlers:{delete:Ki,text:qi}}}Ki.peek=Ji;function Ki(e,t,n,r){let i=n.enter(`strikethrough`),a=n.createTracker(r),o=a.move(`~~`),s=a.move(n.containerPhrasing(e,{after:`~`,before:o,...a.current()})),c=na(e,t,n,r.before),l=ra(e,t,n,r.after),u=Yi(c,ha(s),`open`);u.inside&&s&&(s=fa(s));let d=Yi({current:ga(s),previous:ma(s)},l,`close`);d.inside&&s&&(s=pa(s));let f=a.move(`~~`);i();let p=d.outside&&ca(t,n);return n.attentionEncodeSurroundingInfo={after:d.outside&&!p,before:u.outside},la(n).cjkFriendlyEncodeAfterSupplementaryText=p,o+s+f}function qi(e,t,n,r){let i=la(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${da(a.codePointAt(0)??P.eof)}${n.safe(o,{...r,before:`;`})}`}function Ji(){return`~`}function Yi(e,t,n){let r=ta(e),i=Br(t);if(!Tr(r)&&!Tr(i))return n===`open`?Xi(r,i):Xi(i,r);let a={inside:!1,outside:!1},o={inside:!0,outside:!1},s={inside:!1,outside:!0},c={inside:!0,outside:!0};for(let r of[a,o,s,c]){let i=n===`open`?r.outside?_a:e:r.inside?_a:e,a=n===`open`?r.inside?va:t:r.outside?va:t;if(n===`open`?Zi(i,a):Qi(i,a))return r}return c}function Xi(e,t){return ea(e)?ea(t)?{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:xr(e)?ea(t)?{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Zi(e,t){let{open:n}=$i(ta(e),Br(t));return n}function Qi(e,t){let n=Br(t),{close:r}=$i(ta(e),n);return r}function $i(e,t){let n=Sr(e),r=n||xr(e),i=Sr(t),a=i||xr(t);return{open:!a||i&&(r||Tr(e)),close:!r||n&&(a||Cr(t))}}function ea(e){return!xr(e)&&!Sr(e)}function ta(e){let t=Br(e.current);return e.current===null||!Er(t)?t:Vr(t,()=>e.previous,e.current)}function na(e,t,n,r){let i=ga(r),a=ma(r);if(ia(i)||oa(i,a)){let r=sa(e,t,n,-1);r&&(i=ga(r),a=ma(r))}return{current:i,previous:a}}function ra(e,t,n,r){let i=ha(r);if(!aa(i))return i;let a=sa(e,t,n,1);return a?ha(a):i}function ia(e){return e!==null&&56320<=e&&e<=57343}function aa(e){return e!==null&&55296<=e&&e<=56319}function oa(e,t){return Er(Br(e))&&(t===null||t===P.eof)}function sa(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return ua(s)||void 0}function ca(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(ha(r.value)??0)>65535}function la(e){return e}function ua(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(ua).join(``):``}function da(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function fa(e){let[t=``]=[...e];return da(t.codePointAt(0)??P.eof)+e.slice(t.length)}function pa(e){let t=[...e],n=t.pop();return`${t.join(``)}${da(n?.codePointAt(0)??P.eof)}`}function ma(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??P.eof}function ha(e){return e.codePointAt(0)??P.eof}function ga(e){return[...e].at(-1)?.codePointAt(0)??P.eof}var _a={current:Ui,previous:P.eof},va=Wi;function ya(){let e=this.data();(e.toMarkdownExtensions||=[]).push(Gi())}function ba(e){Vi.call(this,e),ya.call(this)}var xa=ba,Sa=(function(e){if(e==null)return Da;if(typeof e==`function`)return Ea(e);if(typeof e==`object`)return Array.isArray(e)?Ca(e):wa(e);if(typeof e==`string`)return Ta(e);throw Error(`Expected function, string, or object as test`)});function Ca(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Sa(e[n]);return Ea(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function wa(e){let t=e;return Ea(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Ta(e){return Ea(t);function t(t){return t&&t.type===e}}function Ea(e){return t;function t(t,n,r){return!!(Oa(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Da(){return!0}function Oa(e){return typeof e==`object`&&!!e&&`type`in e}function ka(e){return e}var Aa=[],ja=`skip`;function Ma(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Sa(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 (`+ka(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Aa,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Na(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 Na(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Aa:[e]}function Pa(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),Ma(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)}}var Fa=new Set([`。`,`.`,`,`,`、`,`?`,`!`,`:`,`;`,`(`,`)`,`【`,`】`,`「`,`」`,`『`,`』`,`〈`,`〉`,`《`,`》`]),Ia=/^(https?:\/\/|mailto:|www\.)/i,La=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type===`text`&&t.value===e.url},Ra=e=>{let t=0;for(let n of e){if(Fa.has(n))return t;t+=n.length}return null},za=(e,t)=>({...t,url:e,children:[{type:`text`,value:e}]}),Ba=e=>({type:`text`,value:e}),Va=()=>e=>{Pa(e,`link`,(e,t,n)=>{if(!n||typeof t!=`number`||!La(e)||!Ia.test(e.url))return;let r=Ra(e.url);if(r===null||r===0)return;let i=e.url.slice(0,r),a=e.url.slice(r),o=za(i,e),s=Ba(a);return n.children.splice(t,1,o,s),t+1})};function Ha(){let e=[zi],t=[Va,xa];return{name:`cjk`,type:`cjk`,remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:[...e,...t]}}var Ua=Ha(),Wa={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function Ga({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`,linkBlockPolicy:s=Wa.indicator,imageBlockPolicy:c=Wa.indicator}){let l=t.length&&!t.every(e=>e===`*`),u=n.length&&!n.every(e=>e===`*`);if(!e&&(l||u))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let u=to(e,t,n,r,i,a,o,s,c);Za(l),Pa(l,u)}}function Ka(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function qa(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var Ja=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),Ya=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function Xa(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=Ka(e,n);if(!o||Ya.has(o.protocol)||!(Ja.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=qa(e);return o&&t.some(e=>{let t=Ka(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function Za(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)Za(t)}}var Qa=Symbol(`node-seen`);function $a(e,t,n){return t===Wa.remove?{type:`remove`}:t===Wa.textOnly?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[...e.children]}}:{type:`replace`,element:{type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(e.properties.href),class:n},children:[...e.children,{type:`text`,value:` [blocked]`}]}}}function eo(e,t,n){if(t===Wa.remove)return{type:`remove`};if(t===Wa.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{type:`remove`}}return{type:`replace`,element:{type:`element`,tagName:`span`,properties:{class:n},children:[{type:`text`,value:`[Image blocked: `+String(e.properties.alt||`No description`)+`]`}]}}}var to=(e,t,n,r,i,a,o,s,c)=>{let l=(u,d,f)=>{if(u.type!==`element`||u[Qa])return!0;if(u.tagName===`a`){let n=Xa(u.properties.href,t,e,!1,!1,i);if(n===null){if(u[Qa]=!0,Pa(u,l),f&&typeof d==`number`){let e=$a(u,s,o);if(e.type===`remove`)return f.children.splice(d,1),[ja,d];f.children[d]=e.element}return ja}return u.properties.href=n,u.properties.target=`_blank`,u.properties.rel=`noopener noreferrer`,!0}if(u.tagName===`img`){let t=Xa(u.properties.src,n,e,r,!0,i);if(t===null){if(u[Qa]=!0,Pa(u,l),f&&typeof d==`number`){let e=eo(u,c,a);if(e.type===`remove`)return f.children.splice(d,1),[ja,d];f.children[d]=e.element}return ja}return u.properties.src=t,!0}return!0};return l},no=typeof self==`object`?self:globalThis,ro=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new no[e](t)},io=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof no[e]==`function`?ro(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(ro(a,o),i)};return r},ao=e=>io(new Map,e)(0),oo=``,{toString:so}={},{keys:co}=Object,lo=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=so.call(e).slice(8,-1);switch(n){case`Array`:return[1,oo];case`Object`:return[2,oo];case`Date`:return[3,oo];case`RegExp`:return[4,oo];case`Map`:return[5,oo];case`Set`:return[6,oo];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},uo=([e,t])=>e===0&&(t===`function`||t===`symbol`),fo=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=lo(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of co(r))(e||!uo(lo(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?oo:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(uo(lo(n))||uo(lo(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!uo(lo(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},po=(e,{json:t,lossy:n}={})=>{let r=[];return fo(!(t||n),!!t,new Map,r)(e),r},mo=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?ao(po(e,t)):structuredClone(e):(e,t)=>ao(po(e,t)),ho=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ho.prototype.normal={},ho.prototype.property={},ho.prototype.space=void 0;function go(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ho(n,r,t)}function _o(e){return e.toLowerCase()}var vo=class{constructor(e,t){this.attribute=t,this.property=e}};vo.prototype.attribute=``,vo.prototype.booleanish=!1,vo.prototype.boolean=!1,vo.prototype.commaOrSpaceSeparated=!1,vo.prototype.commaSeparated=!1,vo.prototype.defined=!1,vo.prototype.mustUseProperty=!1,vo.prototype.number=!1,vo.prototype.overloadedBoolean=!1,vo.prototype.property=``,vo.prototype.spaceSeparated=!1,vo.prototype.space=void 0;var yo=r({boolean:()=>L,booleanish:()=>xo,commaOrSpaceSeparated:()=>To,commaSeparated:()=>wo,number:()=>R,overloadedBoolean:()=>So,spaceSeparated:()=>Co}),bo=0,L=Eo(),xo=Eo(),So=Eo(),R=Eo(),Co=Eo(),wo=Eo(),To=Eo();function Eo(){return 2**++bo}var Do=Object.keys(yo),Oo=class extends vo{constructor(e,t,n,r){let i=-1;if(super(e,t),ko(this,`space`,r),typeof n==`number`)for(;++i<Do.length;){let e=Do[i];ko(this,Do[i],(n&yo[e])===yo[e])}}};Oo.prototype.defined=!0;function ko(e,t,n){n&&(e[t]=n)}function Ao(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Oo(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[_o(r)]=r,n[_o(a.attribute)]=r}return new ho(t,n,e.space)}var jo=Ao({properties:{ariaActiveDescendant:null,ariaAtomic:xo,ariaAutoComplete:null,ariaBusy:xo,ariaChecked:xo,ariaColCount:R,ariaColIndex:R,ariaColSpan:R,ariaControls:Co,ariaCurrent:null,ariaDescribedBy:Co,ariaDetails:null,ariaDisabled:xo,ariaDropEffect:Co,ariaErrorMessage:null,ariaExpanded:xo,ariaFlowTo:Co,ariaGrabbed:xo,ariaHasPopup:null,ariaHidden:xo,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Co,ariaLevel:R,ariaLive:null,ariaModal:xo,ariaMultiLine:xo,ariaMultiSelectable:xo,ariaOrientation:null,ariaOwns:Co,ariaPlaceholder:null,ariaPosInSet:R,ariaPressed:xo,ariaReadOnly:xo,ariaRelevant:null,ariaRequired:xo,ariaRoleDescription:Co,ariaRowCount:R,ariaRowIndex:R,ariaRowSpan:R,ariaSelected:xo,ariaSetSize:R,ariaSort:null,ariaValueMax:R,ariaValueMin:R,ariaValueNow:R,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Mo(e,t){return t in e?e[t]:t}function No(e,t){return Mo(e,t.toLowerCase())}var Po=Ao({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:wo,acceptCharset:Co,accessKey:Co,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alpha:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:Co,autoFocus:L,autoPlay:L,blocking:Co,capture:null,charSet:null,checked:L,cite:null,className:Co,closedBy:null,colorSpace:null,cols:R,colSpan:R,command:null,commandFor:null,content:null,contentEditable:xo,controls:L,controlsList:Co,coords:R|wo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:So,draggable:xo,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:Co,height:R,hidden:So,high:R,href:null,hrefLang:null,htmlFor:Co,httpEquiv:Co,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:Co,itemRef:Co,itemScope:L,itemType:Co,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:R,manifest:null,max:null,maxLength:R,media:null,method:null,min:null,minLength:R,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:L,optimum:R,pattern:null,ping:Co,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:Co,required:L,reversed:L,rows:R,rowSpan:R,sandbox:Co,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootCustomElementRegistry:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shadowRootSerializable:L,shape:null,size:R,sizes:null,slot:null,span:R,spellCheck:xo,src:null,srcDoc:null,srcLang:null,srcSet:null,start:R,step:null,style:null,tabIndex:R,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:xo,width:R,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Co,axis:null,background:null,bgColor:null,border:R,borderColor:null,bottomMargin:R,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:R,leftMargin:R,link:null,longDesc:null,lowSrc:null,marginHeight:R,marginWidth:R,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:R,rules:null,scheme:null,scrolling:xo,standby:null,summary:null,text:null,topMargin:R,valueType:null,version:null,vAlign:null,vLink:null,vSpace:R,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:L,disablePictureInPicture:L,disableRemotePlayback:L,exportParts:wo,part:Co,prefix:null,property:null,results:R,security:null,unselectable:null},space:`html`,transform:No}),Fo=Ao({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:To,accentHeight:R,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:R,amplitude:R,arabicForm:null,ascent:R,attributeName:null,attributeType:null,azimuth:R,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:R,by:null,calcMode:null,capHeight:R,className:Co,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:R,diffuseConstant:R,direction:null,display:null,dur:null,divisor:R,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:R,enableBackground:null,end:null,event:null,exponent:R,externalResourcesRequired:null,fill:null,fillOpacity:R,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:wo,g2:wo,glyphName:wo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:R,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:R,horizOriginX:R,horizOriginY:R,id:null,ideographic:R,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:R,k:R,k1:R,k2:R,k3:R,k4:R,kernelMatrix:To,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:R,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:R,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:R,overlineThickness:R,paintOrder:null,panose1:null,path:null,pathLength:R,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Co,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:R,pointsAtY:R,pointsAtZ:R,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:To,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:To,rev:To,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:To,requiredFeatures:To,requiredFonts:To,requiredFormats:To,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:R,specularExponent:R,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:R,strikethroughThickness:R,string:null,stroke:null,strokeDashArray:To,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:R,strokeOpacity:R,strokeWidth:null,style:null,surfaceScale:R,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:To,tabIndex:R,tableValues:null,target:null,targetX:R,targetY:R,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:To,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:R,underlineThickness:R,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:R,values:null,vAlphabetic:R,vMathematical:R,vectorEffect:null,vHanging:R,vIdeographic:R,version:null,vertAdvY:R,vertOriginX:R,vertOriginY:R,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:R,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Mo}),Io=Ao({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Lo=Ao({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:No}),Ro=Ao({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),zo={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Bo=/[A-Z]/g,Vo=/-[a-z]/g,Ho=/^data[-\w.:]+$/i;function Uo(e,t){let n=_o(t),r=t,i=vo;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ho.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Vo,Go);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Vo.test(e)){let n=e.replace(Bo,Wo);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Oo}return new i(r,t)}function Wo(e){return`-`+e.toLowerCase()}function Go(e){return e.charAt(1).toUpperCase()}var Ko=go([jo,Po,Io,Lo,Ro],`html`),qo=go([jo,Fo,Io,Lo,Ro],`svg`);function Jo(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Yo(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Xo=/[#.]/g;function Zo(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){Xo.lastIndex=i;let e=Xo.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function Qo(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function $o(e){return e.join(` `).trim()}function es(e,t,n){let r=n?os(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=Zo(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,ts(i))a.unshift(i);else for(let[t,n]of Object.entries(i))ns(e,o.properties,t,n)}for(let e of a)rs(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function ts(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function ns(e,t,n,r){let i=Uo(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?Qo(r):i.commaSeparated?Jo(r):i.commaOrSpaceSeparated?Qo(Jo(r).join(` `)):is(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?as(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(is(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function rs(e,t){if(t!=null){if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)rs(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?rs(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function is(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||_o(n)===_o(t)))return!0}return n}function as(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function os(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var ss=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),cs=es(Ko,`div`),ls=es(qo,`g`,ss);function us(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=ds(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=ds(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function ds(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
3
3
|
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var fs={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},ps={}.hasOwnProperty,ms=Object.prototype;function hs(e,t){let n=t||{};return gs({file:n.file||void 0,location:!1,schema:n.space===`svg`?qo:Ko,verbose:n.verbose||!1},e)}function gs(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},ys(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:_s(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=us(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},ys(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},ys(e,r,n),n}default:return n=vs(e,t),n}}function _s(e,t){let n=-1,r=[];for(;++n<t.length;){let i=gs(e,t[n]);r.push(i)}return r}function vs(e,t){let n=e.schema;e.schema=t.namespaceURI===fs.svg?qo:Ko;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;ps.call(ms,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?ls:cs)(t.tagName,i,_s(e,t.childNodes));if(ys(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&xs(r.startTag),o=r&&r.endTag&&xs(r.endTag),s=gs(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function ys(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=bs(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function bs(e,t,n){let r=xs(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)ps.call(n.attrs,i)&&(r[Uo(e.schema,i).property]=xs(n.attrs[i]));n.startTag;let a=xs(n.startTag),o=n.endTag?xs(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function xs(e){let t=Ss({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Ss({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Ss(e){return e.line&&e.column?e:void 0}var Cs={}.hasOwnProperty;function ws(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Cs.call(t,e)){let n=String(t[e]);i=Cs.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Ts={},Es={}.hasOwnProperty,Ds=ws(`type`,{handlers:{root:ks,element:Ps,text:Ms,comment:Ns,doctype:js}});function Os(e,t){let n=(t||Ts).space;return Ds(e,n===`svg`?qo:Ko)}function ks(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=Is(e.children,n,t),Ls(e,n),n}function As(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=Is(e.children,n,t),Ls(e,n),n}function js(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return Ls(e,t),t}function Ms(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return Ls(e,t),t}function Ns(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return Ls(e,t),t}function Ps(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=qo);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&Es.call(e.properties,a)){let t=Fs(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:fs[o],childNodes:[],parentNode:null};return s.childNodes=Is(e.children,s,r),Ls(e,s),e.tagName===`template`&&e.content&&(s.content=As(e.content,r)),s}function Fs(e,t,n){let r=Uo(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Yo(n):$o(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=fs[r.space]}return i}function Is(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=Ds(e[r],n);a.parentNode=t,i.push(a)}return i}function Ls(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var Rs=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],zs=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),z;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(z||={});var Bs={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function Vs(e){return e>=55296&&e<=57343}function Hs(e){return e>=56320&&e<=57343}function Us(e,t){return(e-55296)*1024+9216+t}function Ws(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Gs(e){return e>=64976&&e<=65007||zs.has(e)}var B;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(B||={});var Ks=65536,qs=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Ks,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(Hs(t))return this.pos++,this._addGap(),Us(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,z.EOF;return this._err(B.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,z.EOF;let n=this.html.charCodeAt(t);return n===z.CARRIAGE_RETURN?z.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,z.EOF;let e=this.html.charCodeAt(this.pos);return e===z.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,z.LINE_FEED):e===z.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Vs(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===z.LINE_FEED||e===z.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Ws(e)?this._err(B.controlCharacterInInputStream):Gs(e)&&this._err(B.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},V;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(V||={});function Js(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var Ys=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),Xs=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function Zs(e){return e>=55296&&e<=57343||e>1114111?65533:Xs.get(e)??e}var Qs;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(Qs||={});var $s=32,ec;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(ec||={});function tc(e){return e>=Qs.ZERO&&e<=Qs.NINE}function nc(e){return e>=Qs.UPPER_A&&e<=Qs.UPPER_F||e>=Qs.LOWER_A&&e<=Qs.LOWER_F}function rc(e){return e>=Qs.UPPER_A&&e<=Qs.UPPER_Z||e>=Qs.LOWER_A&&e<=Qs.LOWER_Z||tc(e)}function ic(e){return e===Qs.EQUALS||rc(e)}var ac;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(ac||={});var oc;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(oc||={});var sc=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ac.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=oc.Strict}startEntity(e){this.decodeMode=e,this.state=ac.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ac.EntityStart:return e.charCodeAt(t)===Qs.NUM?(this.state=ac.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ac.NamedEntity,this.stateNamedEntity(e,t));case ac.NumericStart:return this.stateNumericStart(e,t);case ac.NumericDecimal:return this.stateNumericDecimal(e,t);case ac.NumericHex:return this.stateNumericHex(e,t);case ac.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|$s)===Qs.LOWER_X?(this.state=ac.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ac.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(tc(r)||nc(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(tc(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Qs.SEMI)this.consumed+=1;else if(this.decodeMode===oc.Strict)return 0;return this.emitCodePoint(Zs(this.result),this.consumed),this.errors&&(e!==Qs.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&ec.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=cc(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===oc.Attribute&&(i===0||ic(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&ec.VALUE_LENGTH)>>14,i!==0){if(a===Qs.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==oc.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&ec.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~ec.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ac.NamedEntity:return this.result!==0&&(this.decodeMode!==oc.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ac.NumericDecimal:return this.emitNumericEntity(0,2);case ac.NumericHex:return this.emitNumericEntity(0,3);case ac.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ac.EntityStart:return 0}}};function cc(e,t,n,r){let i=(t&ec.BRANCH_LENGTH)>>7,a=t&ec.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var H;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(H||={});var lc;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(lc||={});var uc;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(uc||={});var U;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(U||={});var W;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(W||={});var dc=new Map([[U.A,W.A],[U.ADDRESS,W.ADDRESS],[U.ANNOTATION_XML,W.ANNOTATION_XML],[U.APPLET,W.APPLET],[U.AREA,W.AREA],[U.ARTICLE,W.ARTICLE],[U.ASIDE,W.ASIDE],[U.B,W.B],[U.BASE,W.BASE],[U.BASEFONT,W.BASEFONT],[U.BGSOUND,W.BGSOUND],[U.BIG,W.BIG],[U.BLOCKQUOTE,W.BLOCKQUOTE],[U.BODY,W.BODY],[U.BR,W.BR],[U.BUTTON,W.BUTTON],[U.CAPTION,W.CAPTION],[U.CENTER,W.CENTER],[U.CODE,W.CODE],[U.COL,W.COL],[U.COLGROUP,W.COLGROUP],[U.DD,W.DD],[U.DESC,W.DESC],[U.DETAILS,W.DETAILS],[U.DIALOG,W.DIALOG],[U.DIR,W.DIR],[U.DIV,W.DIV],[U.DL,W.DL],[U.DT,W.DT],[U.EM,W.EM],[U.EMBED,W.EMBED],[U.FIELDSET,W.FIELDSET],[U.FIGCAPTION,W.FIGCAPTION],[U.FIGURE,W.FIGURE],[U.FONT,W.FONT],[U.FOOTER,W.FOOTER],[U.FOREIGN_OBJECT,W.FOREIGN_OBJECT],[U.FORM,W.FORM],[U.FRAME,W.FRAME],[U.FRAMESET,W.FRAMESET],[U.H1,W.H1],[U.H2,W.H2],[U.H3,W.H3],[U.H4,W.H4],[U.H5,W.H5],[U.H6,W.H6],[U.HEAD,W.HEAD],[U.HEADER,W.HEADER],[U.HGROUP,W.HGROUP],[U.HR,W.HR],[U.HTML,W.HTML],[U.I,W.I],[U.IMG,W.IMG],[U.IMAGE,W.IMAGE],[U.INPUT,W.INPUT],[U.IFRAME,W.IFRAME],[U.KEYGEN,W.KEYGEN],[U.LABEL,W.LABEL],[U.LI,W.LI],[U.LINK,W.LINK],[U.LISTING,W.LISTING],[U.MAIN,W.MAIN],[U.MALIGNMARK,W.MALIGNMARK],[U.MARQUEE,W.MARQUEE],[U.MATH,W.MATH],[U.MENU,W.MENU],[U.META,W.META],[U.MGLYPH,W.MGLYPH],[U.MI,W.MI],[U.MO,W.MO],[U.MN,W.MN],[U.MS,W.MS],[U.MTEXT,W.MTEXT],[U.NAV,W.NAV],[U.NOBR,W.NOBR],[U.NOFRAMES,W.NOFRAMES],[U.NOEMBED,W.NOEMBED],[U.NOSCRIPT,W.NOSCRIPT],[U.OBJECT,W.OBJECT],[U.OL,W.OL],[U.OPTGROUP,W.OPTGROUP],[U.OPTION,W.OPTION],[U.P,W.P],[U.PARAM,W.PARAM],[U.PLAINTEXT,W.PLAINTEXT],[U.PRE,W.PRE],[U.RB,W.RB],[U.RP,W.RP],[U.RT,W.RT],[U.RTC,W.RTC],[U.RUBY,W.RUBY],[U.S,W.S],[U.SCRIPT,W.SCRIPT],[U.SEARCH,W.SEARCH],[U.SECTION,W.SECTION],[U.SELECT,W.SELECT],[U.SOURCE,W.SOURCE],[U.SMALL,W.SMALL],[U.SPAN,W.SPAN],[U.STRIKE,W.STRIKE],[U.STRONG,W.STRONG],[U.STYLE,W.STYLE],[U.SUB,W.SUB],[U.SUMMARY,W.SUMMARY],[U.SUP,W.SUP],[U.TABLE,W.TABLE],[U.TBODY,W.TBODY],[U.TEMPLATE,W.TEMPLATE],[U.TEXTAREA,W.TEXTAREA],[U.TFOOT,W.TFOOT],[U.TD,W.TD],[U.TH,W.TH],[U.THEAD,W.THEAD],[U.TITLE,W.TITLE],[U.TR,W.TR],[U.TRACK,W.TRACK],[U.TT,W.TT],[U.U,W.U],[U.UL,W.UL],[U.SVG,W.SVG],[U.VAR,W.VAR],[U.WBR,W.WBR],[U.XMP,W.XMP]]);function fc(e){return dc.get(e)??W.UNKNOWN}var G=W,pc={[H.HTML]:new Set([G.ADDRESS,G.APPLET,G.AREA,G.ARTICLE,G.ASIDE,G.BASE,G.BASEFONT,G.BGSOUND,G.BLOCKQUOTE,G.BODY,G.BR,G.BUTTON,G.CAPTION,G.CENTER,G.COL,G.COLGROUP,G.DD,G.DETAILS,G.DIR,G.DIV,G.DL,G.DT,G.EMBED,G.FIELDSET,G.FIGCAPTION,G.FIGURE,G.FOOTER,G.FORM,G.FRAME,G.FRAMESET,G.H1,G.H2,G.H3,G.H4,G.H5,G.H6,G.HEAD,G.HEADER,G.HGROUP,G.HR,G.HTML,G.IFRAME,G.IMG,G.INPUT,G.LI,G.LINK,G.LISTING,G.MAIN,G.MARQUEE,G.MENU,G.META,G.NAV,G.NOEMBED,G.NOFRAMES,G.NOSCRIPT,G.OBJECT,G.OL,G.P,G.PARAM,G.PLAINTEXT,G.PRE,G.SCRIPT,G.SECTION,G.SELECT,G.SOURCE,G.STYLE,G.SUMMARY,G.TABLE,G.TBODY,G.TD,G.TEMPLATE,G.TEXTAREA,G.TFOOT,G.TH,G.THEAD,G.TITLE,G.TR,G.TRACK,G.UL,G.WBR,G.XMP]),[H.MATHML]:new Set([G.MI,G.MO,G.MN,G.MS,G.MTEXT,G.ANNOTATION_XML]),[H.SVG]:new Set([G.TITLE,G.FOREIGN_OBJECT,G.DESC]),[H.XLINK]:new Set,[H.XML]:new Set,[H.XMLNS]:new Set},mc=new Set([G.H1,G.H2,G.H3,G.H4,G.H5,G.H6]);U.STYLE,U.SCRIPT,U.XMP,U.IFRAME,U.NOEMBED,U.NOFRAMES,U.PLAINTEXT;var K;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(K||={});var hc={DATA:K.DATA,RCDATA:K.RCDATA,RAWTEXT:K.RAWTEXT,SCRIPT_DATA:K.SCRIPT_DATA,PLAINTEXT:K.PLAINTEXT,CDATA_SECTION:K.CDATA_SECTION};function gc(e){return e>=z.DIGIT_0&&e<=z.DIGIT_9}function _c(e){return e>=z.LATIN_CAPITAL_A&&e<=z.LATIN_CAPITAL_Z}function vc(e){return e>=z.LATIN_SMALL_A&&e<=z.LATIN_SMALL_Z}function yc(e){return vc(e)||_c(e)}function bc(e){return yc(e)||gc(e)}function xc(e){return e+32}function Sc(e){return e===z.SPACE||e===z.LINE_FEED||e===z.TABULATION||e===z.FORM_FEED}function Cc(e){return Sc(e)||e===z.SOLIDUS||e===z.GREATER_THAN_SIGN}function wc(e){return e===z.NULL?B.nullCharacterReference:e>1114111?B.characterReferenceOutsideUnicodeRange:Vs(e)?B.surrogateCharacterReference:Gs(e)?B.noncharacterCharacterReference:Ws(e)||e===z.CARRIAGE_RETURN?B.controlCharacterReference:null}var Tc=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=K.DATA,this.returnState=K.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new qs(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new sc(Ys,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(B.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(B.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=wc(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:V.START_TAG,tagName:``,tagID:W.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:V.END_TAG,tagName:``,tagID:W.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:V.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:V.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(Js(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(B.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=fc(e.tagName),e.type===V.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(B.endTagWithAttributes),e.selfClosing&&this._err(B.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case V.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case V.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case V.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:V.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=Sc(e)?V.WHITESPACE_CHARACTER:e===z.NULL?V.NULL_CHARACTER:V.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(V.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=K.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?oc.Attribute:oc.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===K.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case K.DATA:this._stateData(e);break;case K.RCDATA:this._stateRcdata(e);break;case K.RAWTEXT:this._stateRawtext(e);break;case K.SCRIPT_DATA:this._stateScriptData(e);break;case K.PLAINTEXT:this._statePlaintext(e);break;case K.TAG_OPEN:this._stateTagOpen(e);break;case K.END_TAG_OPEN:this._stateEndTagOpen(e);break;case K.TAG_NAME:this._stateTagName(e);break;case K.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case K.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case K.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case K.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case K.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case K.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case K.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case K.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case K.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case K.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case K.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case K.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case K.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case K.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case K.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case K.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case K.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case K.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case K.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case K.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case K.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case K.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case K.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case K.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case K.BOGUS_COMMENT:this._stateBogusComment(e);break;case K.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case K.COMMENT_START:this._stateCommentStart(e);break;case K.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case K.COMMENT:this._stateComment(e);break;case K.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case K.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case K.COMMENT_END:this._stateCommentEnd(e);break;case K.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case K.DOCTYPE:this._stateDoctype(e);break;case K.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case K.DOCTYPE_NAME:this._stateDoctypeName(e);break;case K.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case K.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case K.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case K.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case K.CDATA_SECTION:this._stateCdataSection(e);break;case K.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case K.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case K.CHARACTER_REFERENCE:this._stateCharacterReference();break;case K.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case z.LESS_THAN_SIGN:this.state=K.TAG_OPEN;break;case z.AMPERSAND:this._startCharacterReference();break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitCodePoint(e);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case z.AMPERSAND:this._startCharacterReference();break;case z.LESS_THAN_SIGN:this.state=K.RCDATA_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case z.LESS_THAN_SIGN:this.state=K.RAWTEXT_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(yc(e))this._createStartTagToken(),this.state=K.TAG_NAME,this._stateTagName(e);else switch(e){case z.EXCLAMATION_MARK:this.state=K.MARKUP_DECLARATION_OPEN;break;case z.SOLIDUS:this.state=K.END_TAG_OPEN;break;case z.QUESTION_MARK:this._err(B.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e);break;case z.EOF:this._err(B.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(B.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=K.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(yc(e))this._createEndTagToken(),this.state=K.TAG_NAME,this._stateTagName(e);else switch(e){case z.GREATER_THAN_SIGN:this._err(B.missingEndTagName),this.state=K.DATA;break;case z.EOF:this._err(B.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(B.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_ATTRIBUTE_NAME;break;case z.SOLIDUS:this.state=K.SELF_CLOSING_START_TAG;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentTagToken();break;case z.NULL:this._err(B.unexpectedNullCharacter),t.tagName+=`�`;break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(_c(e)?xc(e):e)}}_stateRcdataLessThanSign(e){e===z.SOLIDUS?this.state=K.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=K.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){yc(e)?(this.state=K.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=K.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=K.BEFORE_ATTRIBUTE_NAME,!1;case z.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=K.SELF_CLOSING_START_TAG,!1;case z.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=K.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===z.SOLIDUS?this.state=K.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){yc(e)?(this.state=K.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case z.SOLIDUS:this.state=K.SCRIPT_DATA_END_TAG_OPEN;break;case z.EXCLAMATION_MARK:this.state=K.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=K.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){yc(e)?(this.state=K.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===z.HYPHEN_MINUS?(this.state=K.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===z.HYPHEN_MINUS?(this.state=K.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case z.HYPHEN_MINUS:this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case z.GREATER_THAN_SIGN:this.state=K.SCRIPT_DATA,this._emitChars(`>`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===z.SOLIDUS?this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:yc(e)?(this._emitChars(`<`),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){yc(e)?(this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Bs.SCRIPT,!1)&&Cc(this.preprocessor.peek(Bs.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<Bs.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case z.HYPHEN_MINUS:this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case z.GREATER_THAN_SIGN:this.state=K.SCRIPT_DATA,this._emitChars(`>`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===z.SOLIDUS?(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Bs.SCRIPT,!1)&&Cc(this.preprocessor.peek(Bs.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<Bs.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=K.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.SOLIDUS:case z.GREATER_THAN_SIGN:case z.EOF:this.state=K.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case z.EQUALS_SIGN:this._err(B.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=K.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=K.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:case z.SOLIDUS:case z.GREATER_THAN_SIGN:case z.EOF:this._leaveAttrName(),this.state=K.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case z.EQUALS_SIGN:this._leaveAttrName(),this.state=K.BEFORE_ATTRIBUTE_VALUE;break;case z.QUOTATION_MARK:case z.APOSTROPHE:case z.LESS_THAN_SIGN:this._err(B.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(_c(e)?xc(e):e)}}_stateAfterAttributeName(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.SOLIDUS:this.state=K.SELF_CLOSING_START_TAG;break;case z.EQUALS_SIGN:this.state=K.BEFORE_ATTRIBUTE_VALUE;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentTagToken();break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=K.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.QUOTATION_MARK:this.state=K.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case z.APOSTROPHE:this.state=K.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingAttributeValue),this.state=K.DATA,this.emitCurrentTagToken();break;default:this.state=K.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case z.QUOTATION_MARK:this.state=K.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case z.AMPERSAND:this._startCharacterReference();break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case z.APOSTROPHE:this.state=K.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case z.AMPERSAND:this._startCharacterReference();break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this._leaveAttrValue(),this.state=K.BEFORE_ATTRIBUTE_NAME;break;case z.AMPERSAND:this._startCharacterReference();break;case z.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=K.DATA,this.emitCurrentTagToken();break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case z.QUOTATION_MARK:case z.APOSTROPHE:case z.LESS_THAN_SIGN:case z.EQUALS_SIGN:case z.GRAVE_ACCENT:this._err(B.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this._leaveAttrValue(),this.state=K.BEFORE_ATTRIBUTE_NAME;break;case z.SOLIDUS:this._leaveAttrValue(),this.state=K.SELF_CLOSING_START_TAG;break;case z.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=K.DATA,this.emitCurrentTagToken();break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this._err(B.missingWhitespaceBetweenAttributes),this.state=K.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case z.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=K.DATA,this.emitCurrentTagToken();break}case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this._err(B.unexpectedSolidusInTag),this.state=K.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentComment(t);break;case z.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case z.NULL:this._err(B.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Bs.DASH_DASH,!0)?(this._createCommentToken(Bs.DASH_DASH.length+1),this.state=K.COMMENT_START):this._consumeSequenceIfMatch(Bs.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Bs.DOCTYPE.length+1),this.state=K.DOCTYPE):this._consumeSequenceIfMatch(Bs.CDATA_START,!0)?this.inForeignNode?this.state=K.CDATA_SECTION:(this._err(B.cdataInHtmlContent),this._createCommentToken(Bs.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=K.BOGUS_COMMENT):this._ensureHibernation()||(this._err(B.incorrectlyOpenedComment),this._createCommentToken(2),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_START_DASH;break;case z.GREATER_THAN_SIGN:{this._err(B.abruptClosingOfEmptyComment),this.state=K.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=K.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_END;break;case z.GREATER_THAN_SIGN:this._err(B.abruptClosingOfEmptyComment),this.state=K.DATA,this.emitCurrentComment(t);break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=K.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_END_DASH;break;case z.LESS_THAN_SIGN:t.data+=`<`,this.state=K.COMMENT_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.data+=`�`;break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case z.EXCLAMATION_MARK:t.data+=`!`,this.state=K.COMMENT_LESS_THAN_SIGN_BANG;break;case z.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=K.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===z.HYPHEN_MINUS?this.state=K.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=K.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===z.HYPHEN_MINUS?this.state=K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=K.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==z.GREATER_THAN_SIGN&&e!==z.EOF&&this._err(B.nestedComment),this.state=K.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_END;break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=K.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentComment(t);break;case z.EXCLAMATION_MARK:this.state=K.COMMENT_END_BANG;break;case z.HYPHEN_MINUS:t.data+=`-`;break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=K.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:t.data+=`--!`,this.state=K.COMMENT_END_DASH;break;case z.GREATER_THAN_SIGN:this._err(B.incorrectlyClosedComment),this.state=K.DATA,this.emitCurrentComment(t);break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=K.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_DOCTYPE_NAME;break;case z.GREATER_THAN_SIGN:this.state=K.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case z.EOF:{this._err(B.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(B.missingWhitespaceBeforeDoctypeName),this.state=K.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(_c(e))this._createDoctypeToken(String.fromCharCode(xc(e))),this.state=K.DOCTYPE_NAME;else switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.NULL:this._err(B.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=K.DOCTYPE_NAME;break;case z.GREATER_THAN_SIGN:{this._err(B.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=K.DATA;break}case z.EOF:{this._err(B.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=K.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.AFTER_DOCTYPE_NAME;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.NULL:this._err(B.unexpectedNullCharacter),t.name+=`�`;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(_c(e)?xc(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(Bs.PUBLIC,!1)?this.state=K.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Bs.SYSTEM,!1)?this.state=K.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(B.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case z.QUOTATION_MARK:this._err(B.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:this._err(B.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.QUOTATION_MARK:t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case z.QUOTATION_MARK:this.state=K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.publicId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case z.APOSTROPHE:this.state=K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.publicId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.QUOTATION_MARK:this._err(B.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:this._err(B.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.QUOTATION_MARK:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case z.QUOTATION_MARK:this._err(B.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:this._err(B.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.QUOTATION_MARK:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case z.QUOTATION_MARK:this.state=K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.systemId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case z.APOSTROPHE:this.state=K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.systemId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case z.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.NULL:this._err(B.unexpectedNullCharacter);break;case z.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case z.RIGHT_SQUARE_BRACKET:this.state=K.CDATA_SECTION_BRACKET;break;case z.EOF:this._err(B.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===z.RIGHT_SQUARE_BRACKET?this.state=K.CDATA_SECTION_END:(this._emitChars(`]`),this.state=K.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case z.GREATER_THAN_SIGN:this.state=K.DATA;break;case z.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=K.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(z.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&bc(this.preprocessor.peek(1))?K.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){bc(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===z.SEMICOLON&&this._err(B.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},Ec=new Set([W.DD,W.DT,W.LI,W.OPTGROUP,W.OPTION,W.P,W.RB,W.RP,W.RT,W.RTC]),Dc=new Set([...Ec,W.CAPTION,W.COLGROUP,W.TBODY,W.TD,W.TFOOT,W.TH,W.THEAD,W.TR]),Oc=new Set([W.APPLET,W.CAPTION,W.HTML,W.MARQUEE,W.OBJECT,W.TABLE,W.TD,W.TEMPLATE,W.TH]),kc=new Set([...Oc,W.OL,W.UL]),Ac=new Set([...Oc,W.BUTTON]),jc=new Set([W.ANNOTATION_XML,W.MI,W.MN,W.MO,W.MS,W.MTEXT]),Mc=new Set([W.DESC,W.FOREIGN_OBJECT,W.TITLE]),Nc=new Set([W.TR,W.TEMPLATE,W.HTML]),Pc=new Set([W.TBODY,W.TFOOT,W.THEAD,W.TEMPLATE,W.HTML]),Fc=new Set([W.TABLE,W.TEMPLATE,W.HTML]),Ic=new Set([W.TD,W.TH]),Lc=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=W.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===W.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===H.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==H.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(mc,H.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Ic,H.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(Fc,H.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Pc,H.HTML)}clearBackToTableRowContext(){this.clearBackTo(Nc,H.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===W.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===W.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case H.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case H.SVG:if(Mc.has(r))return!1;break;case H.MATHML:if(jc.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Oc)}hasInListItemScope(e){return this.hasInDynamicScope(e,kc)}hasInButtonScope(e){return this.hasInDynamicScope(e,Ac)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case H.HTML:if(mc.has(t))return!0;if(Oc.has(t))return!1;break;case H.SVG:if(Mc.has(t))return!1;break;case H.MATHML:if(jc.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===H.HTML)switch(this.tagIDs[t]){case e:return!0;case W.TABLE:case W.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===H.HTML)switch(this.tagIDs[e]){case W.TBODY:case W.THEAD:case W.TFOOT:return!0;case W.TABLE:case W.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===H.HTML)switch(this.tagIDs[t]){case e:return!0;case W.OPTION:case W.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Ec.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Dc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Dc.has(this.currentTagId);)this.pop()}},Rc=3,zc;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(zc||={});var Bc={type:zc.Marker},Vc=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===zc.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<Rc)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<Rc)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=Rc&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(Bc)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:zc.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:zc.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(Bc);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===zc.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===zc.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===zc.Element&&t.element===e)}},Hc={createDocument(){return{nodeName:`#document`,mode:uc.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};Hc.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(Hc.isTextNode(n)){n.value+=t;return}}Hc.appendChild(e,Hc.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Hc.isTextNode(r)?r.value+=t:Hc.insertBefore(e,Hc.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Uc=`html`,Wc=`about:legacy-compat`,Gc=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,Kc=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),qc=[...Kc,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],Jc=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),Yc=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],Xc=[...Yc,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function Zc(e,t){return t.some(t=>e.startsWith(t))}function Qc(e){return e.name===Uc&&e.publicId===null&&(e.systemId===null||e.systemId===Wc)}function $c(e){if(e.name!==Uc)return uc.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===Gc)return uc.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Jc.has(n))return uc.QUIRKS;let e=t===null?qc:Kc;if(Zc(n,e))return uc.QUIRKS;if(e=t===null?Yc:Xc,Zc(n,e))return uc.LIMITED_QUIRKS}return uc.NO_QUIRKS}var el={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},tl=`definitionurl`,nl=`definitionURL`,rl=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),il=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:H.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:H.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:H.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:H.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:H.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:H.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:H.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:H.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:H.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:H.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:H.XMLNS}]]),al=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),ol=new Set([W.B,W.BIG,W.BLOCKQUOTE,W.BODY,W.BR,W.CENTER,W.CODE,W.DD,W.DIV,W.DL,W.DT,W.EM,W.EMBED,W.H1,W.H2,W.H3,W.H4,W.H5,W.H6,W.HEAD,W.HR,W.I,W.IMG,W.LI,W.LISTING,W.MENU,W.META,W.NOBR,W.OL,W.P,W.PRE,W.RUBY,W.S,W.SMALL,W.SPAN,W.STRONG,W.STRIKE,W.SUB,W.SUP,W.TABLE,W.TT,W.U,W.UL,W.VAR]);function sl(e){let t=e.tagID;return t===W.FONT&&e.attrs.some(({name:e})=>e===lc.COLOR||e===lc.SIZE||e===lc.FACE)||ol.has(t)}function cl(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===tl){e.attrs[t].name=nl;break}}function ll(e){for(let t=0;t<e.attrs.length;t++){let n=rl.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function ul(e){for(let t=0;t<e.attrs.length;t++){let n=il.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function dl(e){let t=al.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=fc(e.tagName))}function fl(e,t){return t===H.MATHML&&(e===W.MI||e===W.MO||e===W.MN||e===W.MS||e===W.MTEXT)}function pl(e,t,n){if(t===H.MATHML&&e===W.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===lc.ENCODING){let t=n[e].value.toLowerCase();return t===el.TEXT_HTML||t===el.APPLICATION_XML}}return t===H.SVG&&(e===W.FOREIGN_OBJECT||e===W.DESC||e===W.TITLE)}function ml(e,t,n,r){return(!r||r===H.HTML)&&pl(e,t,n)||(!r||r===H.MATHML)&&fl(e,t)}var hl=`hidden`,gl=8,_l=3,q;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(q||={});var vl={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},yl=new Set([W.TABLE,W.TBODY,W.TFOOT,W.THEAD,W.TR]),bl={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Hc,onParseError:null},xl=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=q.INITIAL,this.originalInsertionMode=q.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...bl,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new Tc(this.options,this),this.activeFormattingElements=new Vc(this.treeAdapter),this.fragmentContextID=n?fc(this.treeAdapter.getTagName(n)):W.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new Lc(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...bl,...t};e??=n.treeAdapter.createElement(U.TEMPLATE,H.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,H.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===W.TEMPLATE&&i.tmplInsertionModeStack.unshift(q.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??vl,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===H.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,H.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=q.TEXT}switchToPlaintextParsing(){this.insertionMode=q.TEXT,this.originalInsertionMode=q.IN_BODY,this.tokenizer.state=hc.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===U.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==H.HTML))switch(this.fragmentContextID){case W.TITLE:case W.TEXTAREA:this.tokenizer.state=hc.RCDATA;break;case W.STYLE:case W.XMP:case W.IFRAME:case W.NOEMBED:case W.NOFRAMES:case W.NOSCRIPT:this.tokenizer.state=hc.RAWTEXT;break;case W.SCRIPT:this.tokenizer.state=hc.SCRIPT_DATA;break;case W.PLAINTEXT:this.tokenizer.state=hc.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,H.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,H.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(U.HTML,H.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,W.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===V.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===W.SVG&&this.treeAdapter.getTagName(t)===U.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===H.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===W.MGLYPH||e.tagID===W.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,H.HTML)}_processToken(e){switch(e.type){case V.CHARACTER:this.onCharacter(e);break;case V.NULL_CHARACTER:this.onNullCharacter(e);break;case V.COMMENT:this.onComment(e);break;case V.DOCTYPE:this.onDoctype(e);break;case V.START_TAG:this._processStartTag(e);break;case V.END_TAG:this.onEndTag(e);break;case V.EOF:this.onEof(e);break;case V.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return ml(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===zc.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=q.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(W.P),this.openElements.popUntilTagNamePopped(W.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case W.TR:this.insertionMode=q.IN_ROW;return;case W.TBODY:case W.THEAD:case W.TFOOT:this.insertionMode=q.IN_TABLE_BODY;return;case W.CAPTION:this.insertionMode=q.IN_CAPTION;return;case W.COLGROUP:this.insertionMode=q.IN_COLUMN_GROUP;return;case W.TABLE:this.insertionMode=q.IN_TABLE;return;case W.BODY:this.insertionMode=q.IN_BODY;return;case W.FRAMESET:this.insertionMode=q.IN_FRAMESET;return;case W.SELECT:this._resetInsertionModeForSelect(e);return;case W.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case W.HTML:this.insertionMode=this.headElement?q.AFTER_HEAD:q.BEFORE_HEAD;return;case W.TD:case W.TH:if(e>0){this.insertionMode=q.IN_CELL;return}break;case W.HEAD:if(e>0){this.insertionMode=q.IN_HEAD;return}}this.insertionMode=q.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===W.TEMPLATE)break;if(e===W.TABLE){this.insertionMode=q.IN_SELECT_IN_TABLE;return}}this.insertionMode=q.IN_SELECT}_isElementCausesFosterParenting(e){return yl.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case W.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===H.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case W.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return pc[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){zd(this,e);return}switch(this.insertionMode){case q.INITIAL:Pl(this,e);break;case q.BEFORE_HTML:Ll(this,e);break;case q.BEFORE_HEAD:Bl(this,e);break;case q.IN_HEAD:Wl(this,e);break;case q.IN_HEAD_NO_SCRIPT:ql(this,e);break;case q.AFTER_HEAD:Xl(this,e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:$l(this,e);break;case q.TEXT:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:Ju(this,e);break;case q.IN_TABLE_TEXT:sd(this,e);break;case q.IN_COLUMN_GROUP:md(this,e);break;case q.AFTER_BODY:Ad(this,e);break;case q.AFTER_AFTER_BODY:Id(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Rd(this,e);return}switch(this.insertionMode){case q.INITIAL:Pl(this,e);break;case q.BEFORE_HTML:Ll(this,e);break;case q.BEFORE_HEAD:Bl(this,e);break;case q.IN_HEAD:Wl(this,e);break;case q.IN_HEAD_NO_SCRIPT:ql(this,e);break;case q.AFTER_HEAD:Xl(this,e);break;case q.TEXT:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:Ju(this,e);break;case q.IN_COLUMN_GROUP:md(this,e);break;case q.AFTER_BODY:Ad(this,e);break;case q.AFTER_AFTER_BODY:Id(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){kl(this,e);return}switch(this.insertionMode){case q.INITIAL:case q.BEFORE_HTML:case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_TEMPLATE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:kl(this,e);break;case q.IN_TABLE_TEXT:cd(this,e);break;case q.AFTER_BODY:Al(this,e);break;case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:jl(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case q.INITIAL:Nl(this,e);break;case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:this._err(e,B.misplacedDoctype);break;case q.IN_TABLE_TEXT:cd(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,B.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Vd(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:Pl(this,e);break;case q.BEFORE_HTML:Fl(this,e);break;case q.BEFORE_HEAD:Rl(this,e);break;case q.IN_HEAD:Vl(this,e);break;case q.IN_HEAD_NO_SCRIPT:Gl(this,e);break;case q.AFTER_HEAD:Jl(this,e);break;case q.IN_BODY:Mu(this,e);break;case q.IN_TABLE:rd(this,e);break;case q.IN_TABLE_TEXT:cd(this,e);break;case q.IN_CAPTION:ud(this,e);break;case q.IN_COLUMN_GROUP:fd(this,e);break;case q.IN_TABLE_BODY:hd(this,e);break;case q.IN_ROW:_d(this,e);break;case q.IN_CELL:yd(this,e);break;case q.IN_SELECT:xd(this,e);break;case q.IN_SELECT_IN_TABLE:Cd(this,e);break;case q.IN_TEMPLATE:Td(this,e);break;case q.AFTER_BODY:Od(this,e);break;case q.IN_FRAMESET:jd(this,e);break;case q.AFTER_FRAMESET:Nd(this,e);break;case q.AFTER_AFTER_BODY:Fd(this,e);break;case q.AFTER_AFTER_FRAMESET:Ld(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Hd(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:Pl(this,e);break;case q.BEFORE_HTML:Il(this,e);break;case q.BEFORE_HEAD:zl(this,e);break;case q.IN_HEAD:Hl(this,e);break;case q.IN_HEAD_NO_SCRIPT:Kl(this,e);break;case q.AFTER_HEAD:Yl(this,e);break;case q.IN_BODY:Wu(this,e);break;case q.TEXT:Ku(this,e);break;case q.IN_TABLE:id(this,e);break;case q.IN_TABLE_TEXT:cd(this,e);break;case q.IN_CAPTION:dd(this,e);break;case q.IN_COLUMN_GROUP:pd(this,e);break;case q.IN_TABLE_BODY:gd(this,e);break;case q.IN_ROW:vd(this,e);break;case q.IN_CELL:bd(this,e);break;case q.IN_SELECT:Sd(this,e);break;case q.IN_SELECT_IN_TABLE:wd(this,e);break;case q.IN_TEMPLATE:Ed(this,e);break;case q.AFTER_BODY:kd(this,e);break;case q.IN_FRAMESET:Md(this,e);break;case q.AFTER_FRAMESET:Pd(this,e);break;case q.AFTER_AFTER_BODY:Id(this,e)}}onEof(e){switch(this.insertionMode){case q.INITIAL:Pl(this,e);break;case q.BEFORE_HTML:Ll(this,e);break;case q.BEFORE_HEAD:Bl(this,e);break;case q.IN_HEAD:Wl(this,e);break;case q.IN_HEAD_NO_SCRIPT:ql(this,e);break;case q.AFTER_HEAD:Xl(this,e);break;case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:Gu(this,e);break;case q.TEXT:qu(this,e);break;case q.IN_TABLE_TEXT:cd(this,e);break;case q.IN_TEMPLATE:Dd(this,e);break;case q.AFTER_BODY:case q.IN_FRAMESET:case q.AFTER_FRAMESET:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:Ml(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===z.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.TEXT:case q.IN_COLUMN_GROUP:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:this._insertCharacters(e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:case q.AFTER_BODY:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:Ql(this,e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:Ju(this,e);break;case q.IN_TABLE_TEXT:od(this,e)}}};function Sl(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Uu(e,t),n}function Cl(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function wl(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=_l;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Tl(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function Tl(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function El(e,t,n){let r=fc(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===W.TEMPLATE&&i===H.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Dl(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function Ol(e,t){for(let n=0;n<gl;n++){let n=Sl(e,t);if(!n)break;let r=Cl(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=wl(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&El(e,a,i),Dl(e,r,n)}}function kl(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Al(e,t){e._appendCommentNode(t,e.openElements.items[0])}function jl(e,t){e._appendCommentNode(t,e.document)}function Ml(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function Nl(e,t){e._setDocumentType(t);let n=t.forceQuirks?uc.QUIRKS:$c(t);Qc(t)||e._err(t,B.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=q.BEFORE_HTML}function Pl(e,t){e._err(t,B.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,uc.QUIRKS),e.insertionMode=q.BEFORE_HTML,e._processToken(t)}function Fl(e,t){t.tagID===W.HTML?(e._insertElement(t,H.HTML),e.insertionMode=q.BEFORE_HEAD):Ll(e,t)}function Il(e,t){let n=t.tagID;(n===W.HTML||n===W.HEAD||n===W.BODY||n===W.BR)&&Ll(e,t)}function Ll(e,t){e._insertFakeRootElement(),e.insertionMode=q.BEFORE_HEAD,e._processToken(t)}function Rl(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.HEAD:e._insertElement(t,H.HTML),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD;break;default:Bl(e,t)}}function zl(e,t){let n=t.tagID;n===W.HEAD||n===W.BODY||n===W.HTML||n===W.BR?Bl(e,t):e._err(t,B.endTagWithoutMatchingOpenElement)}function Bl(e,t){e._insertFakeElement(U.HEAD,W.HEAD),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD,e._processToken(t)}function Vl(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.TITLE:e._switchToTextParsing(t,hc.RCDATA);break;case W.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,hc.RAWTEXT):(e._insertElement(t,H.HTML),e.insertionMode=q.IN_HEAD_NO_SCRIPT);break;case W.NOFRAMES:case W.STYLE:e._switchToTextParsing(t,hc.RAWTEXT);break;case W.SCRIPT:e._switchToTextParsing(t,hc.SCRIPT_DATA);break;case W.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(q.IN_TEMPLATE);break;case W.HEAD:e._err(t,B.misplacedStartTagForHeadElement);break;default:Wl(e,t)}}function Hl(e,t){switch(t.tagID){case W.HEAD:e.openElements.pop(),e.insertionMode=q.AFTER_HEAD;break;case W.BODY:case W.BR:case W.HTML:Wl(e,t);break;case W.TEMPLATE:Ul(e,t);break;default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function Ul(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==W.TEMPLATE&&e._err(t,B.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(W.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,B.endTagWithoutMatchingOpenElement)}function Wl(e,t){e.openElements.pop(),e.insertionMode=q.AFTER_HEAD,e._processToken(t)}function Gl(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.BASEFONT:case W.BGSOUND:case W.HEAD:case W.LINK:case W.META:case W.NOFRAMES:case W.STYLE:Vl(e,t);break;case W.NOSCRIPT:e._err(t,B.nestedNoscriptInHead);break;default:ql(e,t)}}function Kl(e,t){switch(t.tagID){case W.NOSCRIPT:e.openElements.pop(),e.insertionMode=q.IN_HEAD;break;case W.BR:ql(e,t);break;default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function ql(e,t){let n=t.type===V.EOF?B.openElementsLeftAfterEof:B.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=q.IN_HEAD,e._processToken(t)}function Jl(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.BODY:e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=q.IN_BODY;break;case W.FRAMESET:e._insertElement(t,H.HTML),e.insertionMode=q.IN_FRAMESET;break;case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:e._err(t,B.abandonedHeadElementChild),e.openElements.push(e.headElement,W.HEAD),Vl(e,t),e.openElements.remove(e.headElement);break;case W.HEAD:e._err(t,B.misplacedStartTagForHeadElement);break;default:Xl(e,t)}}function Yl(e,t){switch(t.tagID){case W.BODY:case W.HTML:case W.BR:Xl(e,t);break;case W.TEMPLATE:Ul(e,t);break;default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function Xl(e,t){e._insertFakeElement(U.BODY,W.BODY),e.insertionMode=q.IN_BODY,Zl(e,t)}function Zl(e,t){switch(t.type){case V.CHARACTER:$l(e,t);break;case V.WHITESPACE_CHARACTER:Ql(e,t);break;case V.COMMENT:kl(e,t);break;case V.START_TAG:Mu(e,t);break;case V.END_TAG:Wu(e,t);break;case V.EOF:Gu(e,t)}}function Ql(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function $l(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function eu(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function tu(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function nu(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_FRAMESET)}function ru(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML)}function iu(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&mc.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,H.HTML)}function au(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function ou(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),n||(e.formElement=e.openElements.current))}function su(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===W.LI&&r===W.LI||(n===W.DD||n===W.DT)&&(r===W.DD||r===W.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==W.ADDRESS&&r!==W.DIV&&r!==W.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML)}function cu(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.tokenizer.state=hc.PLAINTEXT}function lu(e,t){e.openElements.hasInScope(W.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.framesetOk=!1}function uu(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(U.A);n&&(Ol(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function du(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function fu(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(W.NOBR)&&(Ol(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function pu(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function mu(e,t){e.treeAdapter.getDocumentMode(e.document)!==uc.QUIRKS&&e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=q.IN_TABLE}function hu(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,H.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function gu(e){let t=Js(e,lc.TYPE);return t!=null&&t.toLowerCase()===hl}function _u(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,H.HTML),gu(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function vu(e,t){e._appendElement(t,H.HTML),t.ackSelfClosing=!0}function yu(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._appendElement(t,H.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function bu(e,t){t.tagName=U.IMG,t.tagID=W.IMG,hu(e,t)}function xu(e,t){e._insertElement(t,H.HTML),e.skipNextNewLine=!0,e.tokenizer.state=hc.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=q.TEXT}function Su(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,hc.RAWTEXT)}function Cu(e,t){e.framesetOk=!1,e._switchToTextParsing(t,hc.RAWTEXT)}function wu(e,t){e._switchToTextParsing(t,hc.RAWTEXT)}function Tu(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===q.IN_TABLE||e.insertionMode===q.IN_CAPTION||e.insertionMode===q.IN_TABLE_BODY||e.insertionMode===q.IN_ROW||e.insertionMode===q.IN_CELL?q.IN_SELECT_IN_TABLE:q.IN_SELECT}function Eu(e,t){e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML)}function Du(e,t){e.openElements.hasInScope(W.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,H.HTML)}function Ou(e,t){e.openElements.hasInScope(W.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(W.RTC),e._insertElement(t,H.HTML)}function ku(e,t){e._reconstructActiveFormattingElements(),cl(t),ul(t),t.selfClosing?e._appendElement(t,H.MATHML):e._insertElement(t,H.MATHML),t.ackSelfClosing=!0}function Au(e,t){e._reconstructActiveFormattingElements(),ll(t),ul(t),t.selfClosing?e._appendElement(t,H.SVG):e._insertElement(t,H.SVG),t.ackSelfClosing=!0}function ju(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML)}function Mu(e,t){switch(t.tagID){case W.I:case W.S:case W.B:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.SMALL:case W.STRIKE:case W.STRONG:du(e,t);break;case W.A:uu(e,t);break;case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:iu(e,t);break;case W.P:case W.DL:case W.OL:case W.UL:case W.DIV:case W.DIR:case W.NAV:case W.MAIN:case W.MENU:case W.ASIDE:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.DETAILS:case W.ADDRESS:case W.ARTICLE:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:ru(e,t);break;case W.LI:case W.DD:case W.DT:su(e,t);break;case W.BR:case W.IMG:case W.WBR:case W.AREA:case W.EMBED:case W.KEYGEN:hu(e,t);break;case W.HR:yu(e,t);break;case W.RB:case W.RTC:Du(e,t);break;case W.RT:case W.RP:Ou(e,t);break;case W.PRE:case W.LISTING:au(e,t);break;case W.XMP:Su(e,t);break;case W.SVG:Au(e,t);break;case W.HTML:eu(e,t);break;case W.BASE:case W.LINK:case W.META:case W.STYLE:case W.TITLE:case W.SCRIPT:case W.BGSOUND:case W.BASEFONT:case W.TEMPLATE:Vl(e,t);break;case W.BODY:tu(e,t);break;case W.FORM:ou(e,t);break;case W.NOBR:fu(e,t);break;case W.MATH:ku(e,t);break;case W.TABLE:mu(e,t);break;case W.INPUT:_u(e,t);break;case W.PARAM:case W.TRACK:case W.SOURCE:vu(e,t);break;case W.IMAGE:bu(e,t);break;case W.BUTTON:lu(e,t);break;case W.APPLET:case W.OBJECT:case W.MARQUEE:pu(e,t);break;case W.IFRAME:Cu(e,t);break;case W.SELECT:Tu(e,t);break;case W.OPTION:case W.OPTGROUP:Eu(e,t);break;case W.NOEMBED:case W.NOFRAMES:wu(e,t);break;case W.FRAMESET:nu(e,t);break;case W.TEXTAREA:xu(e,t);break;case W.NOSCRIPT:e.options.scriptingEnabled?wu(e,t):ju(e,t);break;case W.PLAINTEXT:cu(e,t);break;case W.COL:case W.TH:case W.TD:case W.TR:case W.HEAD:case W.FRAME:case W.TBODY:case W.TFOOT:case W.THEAD:case W.CAPTION:case W.COLGROUP:break;default:ju(e,t)}}function Nu(e,t){if(e.openElements.hasInScope(W.BODY)&&(e.insertionMode=q.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Pu(e,t){e.openElements.hasInScope(W.BODY)&&(e.insertionMode=q.AFTER_BODY,kd(e,t))}function Fu(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Iu(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(W.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(W.FORM):n&&e.openElements.remove(n))}function Lu(e){e.openElements.hasInButtonScope(W.P)||e._insertFakeElement(U.P,W.P),e._closePElement()}function Ru(e){e.openElements.hasInListItemScope(W.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(W.LI),e.openElements.popUntilTagNamePopped(W.LI))}function zu(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Bu(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Vu(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Hu(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(U.BR,W.BR),e.openElements.pop(),e.framesetOk=!1}function Uu(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==W.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function Wu(e,t){switch(t.tagID){case W.A:case W.B:case W.I:case W.S:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.NOBR:case W.SMALL:case W.STRIKE:case W.STRONG:Ol(e,t);break;case W.P:Lu(e);break;case W.DL:case W.UL:case W.OL:case W.DIR:case W.DIV:case W.NAV:case W.PRE:case W.MAIN:case W.MENU:case W.ASIDE:case W.BUTTON:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.ADDRESS:case W.ARTICLE:case W.DETAILS:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.LISTING:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:Fu(e,t);break;case W.LI:Ru(e);break;case W.DD:case W.DT:zu(e,t);break;case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:Bu(e);break;case W.BR:Hu(e);break;case W.BODY:Nu(e,t);break;case W.HTML:Pu(e,t);break;case W.FORM:Iu(e);break;case W.APPLET:case W.OBJECT:case W.MARQUEE:Vu(e,t);break;case W.TEMPLATE:Ul(e,t);break;default:Uu(e,t)}}function Gu(e,t){e.tmplInsertionModeStack.length>0?Dd(e,t):Ml(e,t)}function Ku(e,t){var n;t.tagID===W.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function qu(e,t){e._err(t,B.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Ju(e,t){if(e.openElements.currentTagId!==void 0&&yl.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=q.IN_TABLE_TEXT,t.type){case V.CHARACTER:sd(e,t);break;case V.WHITESPACE_CHARACTER:od(e,t)}else ad(e,t)}function Yu(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_CAPTION}function Xu(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_COLUMN_GROUP}function Zu(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(U.COLGROUP,W.COLGROUP),e.insertionMode=q.IN_COLUMN_GROUP,fd(e,t)}function Qu(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_TABLE_BODY}function $u(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(U.TBODY,W.TBODY),e.insertionMode=q.IN_TABLE_BODY,hd(e,t)}function ed(e,t){e.openElements.hasInTableScope(W.TABLE)&&(e.openElements.popUntilTagNamePopped(W.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function td(e,t){gu(t)?e._appendElement(t,H.HTML):ad(e,t),t.ackSelfClosing=!0}function nd(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,H.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function rd(e,t){switch(t.tagID){case W.TD:case W.TH:case W.TR:$u(e,t);break;case W.STYLE:case W.SCRIPT:case W.TEMPLATE:Vl(e,t);break;case W.COL:Zu(e,t);break;case W.FORM:nd(e,t);break;case W.TABLE:ed(e,t);break;case W.TBODY:case W.TFOOT:case W.THEAD:Qu(e,t);break;case W.INPUT:td(e,t);break;case W.CAPTION:Yu(e,t);break;case W.COLGROUP:Xu(e,t);break;default:ad(e,t)}}function id(e,t){switch(t.tagID){case W.TABLE:e.openElements.hasInTableScope(W.TABLE)&&(e.openElements.popUntilTagNamePopped(W.TABLE),e._resetInsertionMode());break;case W.TEMPLATE:Ul(e,t);break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:ad(e,t)}}function ad(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Zl(e,t),e.fosterParentingEnabled=n}function od(e,t){e.pendingCharacterTokens.push(t)}function sd(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function cd(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)ad(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var ld=new Set([W.CAPTION,W.COL,W.COLGROUP,W.TBODY,W.TD,W.TFOOT,W.TH,W.THEAD,W.TR]);function ud(e,t){let n=t.tagID;ld.has(n)?e.openElements.hasInTableScope(W.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,rd(e,t)):Mu(e,t)}function dd(e,t){let n=t.tagID;switch(n){case W.CAPTION:case W.TABLE:e.openElements.hasInTableScope(W.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,n===W.TABLE&&id(e,t));break;case W.BODY:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:Wu(e,t)}}function fd(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.COL:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.TEMPLATE:Vl(e,t);break;default:md(e,t)}}function pd(e,t){switch(t.tagID){case W.COLGROUP:e.openElements.currentTagId===W.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case W.TEMPLATE:Ul(e,t);break;case W.COL:break;default:md(e,t)}}function md(e,t){e.openElements.currentTagId===W.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE,e._processToken(t))}function hd(e,t){switch(t.tagID){case W.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_ROW;break;case W.TH:case W.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(U.TR,W.TR),e.insertionMode=q.IN_ROW,_d(e,t);break;case W.CAPTION:case W.COL:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,rd(e,t));break;default:rd(e,t)}}function gd(e,t){let n=t.tagID;switch(t.tagID){case W.TBODY:case W.TFOOT:case W.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case W.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,id(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TD:case W.TH:case W.TR:break;default:id(e,t)}}function _d(e,t){switch(t.tagID){case W.TH:case W.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_CELL,e.activeFormattingElements.insertMarker();break;case W.CAPTION:case W.COL:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:case W.TR:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,hd(e,t));break;default:rd(e,t)}}function vd(e,t){switch(t.tagID){case W.TR:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY);break;case W.TABLE:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,gd(e,t));break;case W.TBODY:case W.TFOOT:case W.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(W.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,gd(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TD:case W.TH:break;default:id(e,t)}}function yd(e,t){let n=t.tagID;ld.has(n)?(e.openElements.hasInTableScope(W.TD)||e.openElements.hasInTableScope(W.TH))&&(e._closeTableCell(),_d(e,t)):Mu(e,t)}function bd(e,t){let n=t.tagID;switch(n){case W.TD:case W.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_ROW);break;case W.TABLE:case W.TBODY:case W.TFOOT:case W.THEAD:case W.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),vd(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:break;default:Wu(e,t)}}function xd(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.OPTION:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e._insertElement(t,H.HTML);break;case W.OPTGROUP:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop(),e._insertElement(t,H.HTML);break;case W.HR:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop(),e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.INPUT:case W.KEYGEN:case W.TEXTAREA:case W.SELECT:e.openElements.hasInSelectScope(W.SELECT)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),t.tagID!==W.SELECT&&e._processStartTag(t));break;case W.SCRIPT:case W.TEMPLATE:Vl(e,t)}}function Sd(e,t){switch(t.tagID){case W.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===W.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===W.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop();break;case W.OPTION:e.openElements.currentTagId===W.OPTION&&e.openElements.pop();break;case W.SELECT:e.openElements.hasInSelectScope(W.SELECT)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode());break;case W.TEMPLATE:Ul(e,t)}}function Cd(e,t){let n=t.tagID;n===W.CAPTION||n===W.TABLE||n===W.TBODY||n===W.TFOOT||n===W.THEAD||n===W.TR||n===W.TD||n===W.TH?(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),e._processStartTag(t)):xd(e,t)}function wd(e,t){let n=t.tagID;n===W.CAPTION||n===W.TABLE||n===W.TBODY||n===W.TFOOT||n===W.THEAD||n===W.TR||n===W.TD||n===W.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Sd(e,t)}function Td(e,t){switch(t.tagID){case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:Vl(e,t);break;case W.CAPTION:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:e.tmplInsertionModeStack[0]=q.IN_TABLE,e.insertionMode=q.IN_TABLE,rd(e,t);break;case W.COL:e.tmplInsertionModeStack[0]=q.IN_COLUMN_GROUP,e.insertionMode=q.IN_COLUMN_GROUP,fd(e,t);break;case W.TR:e.tmplInsertionModeStack[0]=q.IN_TABLE_BODY,e.insertionMode=q.IN_TABLE_BODY,hd(e,t);break;case W.TD:case W.TH:e.tmplInsertionModeStack[0]=q.IN_ROW,e.insertionMode=q.IN_ROW,_d(e,t);break;default:e.tmplInsertionModeStack[0]=q.IN_BODY,e.insertionMode=q.IN_BODY,Mu(e,t)}}function Ed(e,t){t.tagID===W.TEMPLATE&&Ul(e,t)}function Dd(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(W.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ml(e,t)}function Od(e,t){t.tagID===W.HTML?Mu(e,t):Ad(e,t)}function kd(e,t){if(t.tagID===W.HTML){if(e.fragmentContext||(e.insertionMode=q.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===W.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else Ad(e,t)}function Ad(e,t){e.insertionMode=q.IN_BODY,Zl(e,t)}function jd(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.FRAMESET:e._insertElement(t,H.HTML);break;case W.FRAME:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.NOFRAMES:Vl(e,t)}}function Md(e,t){t.tagID===W.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==W.FRAMESET&&(e.insertionMode=q.AFTER_FRAMESET))}function Nd(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.NOFRAMES:Vl(e,t)}}function Pd(e,t){t.tagID===W.HTML&&(e.insertionMode=q.AFTER_AFTER_FRAMESET)}function Fd(e,t){t.tagID===W.HTML?Mu(e,t):Id(e,t)}function Id(e,t){e.insertionMode=q.IN_BODY,Zl(e,t)}function Ld(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.NOFRAMES:Vl(e,t)}}function Rd(e,t){t.chars=`�`,e._insertCharacters(t)}function zd(e,t){e._insertCharacters(t),e.framesetOk=!1}function Bd(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==H.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Vd(e,t){if(sl(t))Bd(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===H.MATHML?cl(t):r===H.SVG&&(dl(t),ll(t)),ul(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Hd(e,t){if(t.tagID===W.P||t.tagID===W.BR){Bd(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===H.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}U.AREA,U.BASE,U.BASEFONT,U.BGSOUND,U.BR,U.COL,U.EMBED,U.FRAME,U.HR,U.IMG,U.INPUT,U.KEYGEN,U.LINK,U.META,U.PARAM,U.SOURCE,U.TRACK,U.WBR;var Ud=Gd(`end`),Wd=Gd(`start`);function Gd(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Kd(e){let t=Wd(e),n=Ud(e);if(t&&n)return{start:t,end:n}}var qd=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Jd=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),Yd={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Xd(e,t){let n=df(e),r=ws(`type`,{handlers:{root:Qd,element:$d,text:ef,comment:rf,doctype:tf,raw:af},unknown:of}),i={parser:n?new xl(Yd):xl.getFragmentParser(void 0,Yd),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),sf(i,Wd());let a=hs(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&Pa(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function Zd(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Qd(e,t){Zd(e.children,t)}function $d(e,t){lf(e,t),Zd(e.children,t),uf(e,t)}function ef(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:V.CHARACTER,chars:e.value,location:ff(e)};sf(t,Wd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function tf(e,t){let n={type:V.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:ff(e)};sf(t,Wd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function nf(e,t){t.stitches=!0;let n=pf(e);`children`in e&&`children`in n&&(n.children=Xd({type:`root`,children:e.children},t.options).children),rf({type:`comment`,value:{stitch:n}},t)}function rf(e,t){let n=e.value,r={type:V.COMMENT,data:n,location:ff(e)};sf(t,Wd(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function af(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,cf(t,Wd(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(qd,`<$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function of(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))nf(n,t);else{let e=``;throw Jd.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function sf(e,t){cf(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=hc.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function cf(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function lf(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===hc.PLAINTEXT)return;sf(t,Wd(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:fs.html;i===fs.html&&n===`svg`&&(i=fs.svg);let a=Os({...e,children:[]},{space:i===fs.svg?`svg`:`html`}),o={type:V.START_TAG,tagName:n,tagID:fc(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:ff(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function uf(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Rs.includes(n)||t.parser.tokenizer.state===hc.PLAINTEXT)return;sf(t,Ud(e));let r={type:V.END_TAG,tagName:n,tagID:fc(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:ff(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===hc.RCDATA||t.parser.tokenizer.state===hc.RAWTEXT||t.parser.tokenizer.state===hc.SCRIPT_DATA)&&(t.parser.tokenizer.state=hc.DATA)}function df(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function ff(e){let t=Wd(e)||{line:void 0,column:void 0,offset:void 0},n=Ud(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function pf(e){return`children`in e?mo({...e,children:[]}):mo(e)}function mf(e){return function(t,n){return Xd(t,{...e,file:n})}}var hf=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],gf={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...hf,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...hf],h2:[[`className`,`sr-only`]],img:[...hf,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...hf,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...hf],table:[...hf],ul:[...hf,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},_f={}.hasOwnProperty;function vf(e,t){let n={type:`root`,children:[]},r=yf({schema:t?{...gf,...t}:gf,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function yf(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return bf(e,n);case`doctype`:return xf(e,n);case`element`:return Sf(e,n);case`root`:return Cf(e,n);case`text`:return wf(e,n)}}}function bf(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return jf(r,t),r}}function xf(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return jf(e,t),e}}function Sf(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=Tf(e,t.children),i=Ef(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&_f.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return jf(o,t),o}function Cf(e,t){let n={type:`root`,children:Tf(e,t.children)};return jf(n,t),n}function wf(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return jf(n,t),n}function Tf(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=yf(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Ef(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&_f.call(r,n)?r[n]:void 0,o=r&&_f.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(_f.call(s,l)){let t=s[l],n=Df(e,Mf(a,l),l,t);n??=Df(e,Mf(o,l),l,t),n!=null&&(c[l]=n)}if(i&&_f.call(i,n)){let e=i[n];for(l in e)_f.call(e,l)&&!_f.call(c,l)&&(c[l]=e[l])}return c}function Df(e,t,n,r){return t?Array.isArray(r)?Of(e,t,n,r):kf(e,t,n,r):void 0}function Of(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=kf(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function kf(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&Af(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Af(e,t,n){let r=e.schema.protocols&&_f.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function jf(e,t){let n=Kd(t);t.data&&(e.data=mo(t.data)),n&&(e.position=n)}function Mf(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function Nf(e){return function(t){return vf(t,e)}}function Pf(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 Ff(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function If(e,t,n){let r=Sa((n||{}).ignore||[]),i=Lf(t),a=-1;for(;++a<i.length;)Ma(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:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Lf(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Rf(e[0]),zf(e[1])])}return t}function Rf(e){return typeof e==`string`?new RegExp(Ff(e),`g`):e}function zf(e){return typeof e==`function`?e:function(){return e}}var Bf=`phrasing`,Vf=[`autolink`,`link`,`image`,`label`];function Hf(){return{transforms:[Xf],enter:{literalAutolink:Wf,literalAutolinkEmail:Gf,literalAutolinkHttp:Gf,literalAutolinkWww:Gf},exit:{literalAutolink:Yf,literalAutolinkEmail:Jf,literalAutolinkHttp:Kf,literalAutolinkWww:qf}}}function Uf(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Bf,notInConstruct:Vf},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Bf,notInConstruct:Vf},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Bf,notInConstruct:Vf}]}}function Wf(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Gf(e){this.config.enter.autolinkProtocol.call(this,e)}function Kf(e){this.config.exit.autolinkProtocol.call(this,e)}function qf(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 Jf(e){this.config.exit.autolinkEmail.call(this,e)}function Yf(e){this.exit(e)}function Xf(e){If(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Zf],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Qf]],{ignore:[`link`,`linkReference`]})}function Zf(e,t,n,r,i){let a=``;if(!tp(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!$f(n)))return!1;let o=ep(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 Qf(e,t,n,r){return!tp(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function $f(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 ep(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=Pf(e,`(`),a=Pf(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 tp(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Lr(n)||Ir(n))&&(!t||n!==47)}function np(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}fp.peek=dp;function rp(){this.buffer()}function ip(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function ap(){this.buffer()}function op(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function sp(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=np(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cp(e){this.exit(e)}function lp(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=np(this.sliceSerialize(e)).toLowerCase(),n.label=t}function up(e){this.exit(e)}function dp(){return`[`}function fp(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 pp(){return{enter:{gfmFootnoteCallString:rp,gfmFootnoteCall:ip,gfmFootnoteDefinitionLabelString:ap,gfmFootnoteDefinition:op},exit:{gfmFootnoteCallString:sp,gfmFootnoteCall:cp,gfmFootnoteDefinitionLabelString:lp,gfmFootnoteDefinition:up}}}function mp(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:fp},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?gp:hp))),s(),o}}function hp(e,t,n){return t===0?e:gp(e,t,n)}function gp(e,t,n){return(n?``:` `)+e}var _p=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Sp.peek=Cp;function vp(){return{canContainEols:[`delete`],enter:{strikethrough:bp},exit:{strikethrough:xp}}}function yp(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:_p}],handlers:{delete:Sp}}}function bp(e){this.enter({type:`delete`,children:[]},e)}function xp(e){this.exit(e)}function Sp(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Cp(){return`~`}function wp(e){return e.length}function Tp(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||wp,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=Ep(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]=Dp(r[d]);else{let e=Dp(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(`
|
|
5
5
|
`)}function Ep(e){return e==null?``:String(e)}function Dp(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Op(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),kp);return i(),o}function kp(e,t,n){return`>`+(n?``:` `)+e}function Ap(e,t){return jp(e,t.inConstruct,!0)&&!jp(e,t.notInConstruct,!1)}function jp(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Mp(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
@@ -108,7 +108,7 @@ ${e}</tr>
|
|
|
108
108
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${RC(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=zC(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+RC(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=zC(e);if(i===null)return RC(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${RC(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:RC(e.text)}},JC=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},YC=class e{options;renderer;textRenderer;constructor(e){this.options=e||OS,this.options.renderer=this.options.renderer||new qC,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new JC}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},XC=class{options;block;constructor(e){this.options=e||OS}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?KC.lex:KC.lexInline}provideParser(){return this.block?YC.parse:YC.parseInline}},ZC=new class{defaults=DS();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=YC;Renderer=qC;TextRenderer=JC;Lexer=KC;Tokenizer=GC;Hooks=XC;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new qC(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new GC(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new XC;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=XC.passThroughHooks.has(n)?e=>{if(this.defaults.async&&XC.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return KC.lex(e,t??this.defaults)}parser(e,t){return YC.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?KC.lex:KC.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?YC.parse:YC.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?KC.lex:KC.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?YC.parse:YC.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
109
109
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+RC(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function QC(e,t){return ZC.parse(e,t)}QC.options=QC.setOptions=function(e){return ZC.setOptions(e),QC.defaults=ZC.defaults,kS(QC.defaults),QC},QC.getDefaults=DS,QC.defaults=OS,QC.use=function(...e){return ZC.use(...e),QC.defaults=ZC.defaults,kS(QC.defaults),QC},QC.walkTokens=function(e,t){return ZC.walkTokens(e,t)},QC.parseInline=ZC.parseInline,QC.Parser=YC,QC.parser=YC.parse,QC.Renderer=qC,QC.TextRenderer=JC,QC.Lexer=KC,QC.lexer=KC.lex,QC.Tokenizer=GC,QC.Hooks=XC,QC.parse=QC,QC.options,QC.setOptions,QC.use,QC.walkTokens,QC.parseInline,YC.parse,KC.lex;var $C=300,ew=`300px`,tw=500;function nw(e={}){let{immediate:t=!1,debounceDelay:n=$C,rootMargin:r=ew,idleTimeout:i=tw}=e,[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null),c=(0,N.useRef)(null),l=(0,N.useRef)(null),u=(0,N.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,N.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,N.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,N.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var rw=320,iw=4,aw=()=>typeof performance>`u`?Date.now():performance.now();function ow(e){let t=e?.now??aw,n=e?.maxBacklogMs??rw,r=0,i=0;return{now:t,beginPass(e){i=Math.min(Math.max(r,e),e+n)},mark(){return i},rewind(e){i=e},take(e,t,r){if(e<=0)return{baseDelay:0,step:Math.max(0,t)};let a=Math.max(0,t),o=a===0?0:Math.min(a,iw),s=Math.max(i,r),c=r+n,l=s+Math.max(0,e-1)*a,u=a;if(l>c&&e>1){if(s<c){let t=c-s;u=Math.max(o,t/(e-1))}else u=o}let d=Math.max(0,Math.round(s-r));return i=s+e*u,{baseDelay:d,step:u}},commitPass(){r=i}}}var sw=/\s/,cw=/^\s+$/,lw=new Set([`pre`,`svg`,`math`,`annotation`]),uw=new Set([`img`,`hr`]),dw=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,fw=e=>e.some(e=>dw(e)&&lw.has(e.tagName)),pw=e=>{for(let t=e.length-1;t>=0;t--){let n=e[t];if(dw(n)&&n.tagName===`li`)return n}},mw=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate-marker`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(n)}ms;--sd-marker-easing:${r}`},hw=new Set([`ul`,`ol`,`li`]),gw=e=>{for(let t of e.children)if(dw(t)){if(t.tagName===`input`)return t;if(hw.has(t.tagName))continue;let e=gw(t);if(e)return e}},_w=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-animation:sd-${t.animation};--sd-duration:${n}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(r)}ms`},vw=(e,t,n,r)=>{let i=gw(e);i&&_w(i,t,n,r)},yw=(e,t,n,r,i,a)=>{if(fw(t))return;let o=r.prevContentLength,s=i.count;i.count+=1;let c=o>0&&s<o,l=c?0:a.baseDelay+i.newIndex++*a.step;_w(e,n,c?0:n.duration,l)},bw=e=>{var t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(dw(r)){if((t=r.properties)!=null&&t[`data-sd-animated`])break;r.properties={...r.properties,"data-sd-animated":!0}}}},xw=e=>{let t=[],n=``,r=!1;for(let i of e){let e=sw.test(i);if(e!==r&&n){if(e){n+=i,r=!0;continue}t.push(n),n=``}n+=i,r=e}return n&&t.push(n),t},Sw=e=>{let t=[],n=``;for(let r of e)sw.test(r)?t.length>0&&!cw.test(t.at(-1))?t[t.length-1]+=r:n+=r:(n&&=(t.push(n),``),t.push(r));return n&&(t.length>0?t[t.length-1]+=n:t.push(n)),t},Cw=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${Math.round(a)}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},ww=(e,t)=>!(e>0&&t<e),Tw=e=>dw(e)&&uw.has(e.tagName),Ew=(e,t,n)=>{let r=0,i=0;return Ma(e,e=>e.type===`text`||Tw(e),(e,a)=>{if(fw(a))return ja;if(Tw(e)){ww(n,i)&&(r+=1),i+=1;return}let o=e.value;if(!o.trim()){i+=o.length;return}let s=t.sep===`char`?Sw(o):xw(o);for(let e of s){let t=i;i+=e.length,!cw.test(e)&&ww(n,t)&&(r+=1)}}),r},Dw=(e,t,n,r,i,a)=>{var o;let s=t.at(-1);if(!(s&&`children`in s))return;if(fw(t))return ja;let c=s,l=c.children.indexOf(e);if(l===-1)return;let u=e.value;if(!u.trim()){i.count+=u.length;return}let d=n.sep===`char`?Sw(u):xw(u),f=r.prevContentLength,p=!1,m=pw(t),h=!!(m&&!((o=m.properties)!=null&&o[`data-sd-animate-marker`])),g=!1,_=d.map(e=>{let t=i.count;if(i.count+=e.length,cw.test(e))return{type:`text`,value:e};let r=f>0&&t<f,o=r?0:a.baseDelay+i.newIndex++*a.step;if(p=!0,m&&h&&!g){let e=r?0:n.duration;mw(m,e,o,n.easing),vw(m,n,e,o),g=!0}return Cw(e,n.animation,n.duration,n.easing,r,o)});return p&&bw(t),c.children.splice(l,1,..._),l+_.length},Ow=0;function kw(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40,timeline:e?.timeline},n={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},r=Ow++,i=()=>e=>{let r={count:0,newIndex:0};n.prevContentLength=n.committedCharCount;let i=t.timeline,a=i?.now()??aw();i&&(n.pendingMark===null?n.pendingMark=i.mark():i.rewind(n.pendingMark));let o=i?i.take(Ew(e,t,n.prevContentLength),t.stagger,a):{baseDelay:0,step:t.stagger};Ma(e,e=>e.type===`text`||Tw(e),(e,i)=>{if(e.type===`text`)return Dw(e,i,t,n,r,o);yw(e,i,t,n,r,o)}),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,"name",{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.committedCharCount=e,n.prevContentLength=e},getLastRenderCharCount(){return n.lastRenderCharCount},commit(){n.committedCharCount=n.lastRenderCharCount,n.pendingMark=null}}}kw();var Aw=(0,N.createContext)(!1),jw=()=>(0,N.useContext)(Aw),Mw=(...e)=>l(s(e)),Nw=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},Pw=e=>e?(...t)=>Nw(e,l(s(t))):Mw,Fw=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},Iw=(0,N.createContext)(Mw),X=()=>(0,N.useContext)(Iw),Lw=8,Rw=e=>{if(e!==void 0&&e!==0&&e!==1/0){if(typeof e==`number`)return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(e!==`0`&&e!==`none`&&e!==`Infinity`)return e}},zw=(e,t,n)=>{let r=(0,N.useRef)(null),i=(0,N.useRef)(!0),a=(0,N.useRef)(!1);return(0,N.useEffect)(()=>{let e=r.current;if(!(e&&t))return;let n=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<Lw;i.current=t};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},[t]),(0,N.useEffect)(()=>{e&&!a.current&&(i.current=!0),e||(i.current=!0),a.current=e},[e]),(0,N.useEffect)(()=>{let n=r.current;n&&t&&e&&i.current&&n.scrollTo({top:n.scrollHeight,behavior:`instant`})},[e,t,n]),r},Bw=Mw(`block`),Vw=Mw(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),Hw=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},Uw=(0,N.memo)(({children:e,result:t,language:n,className:r,maxHeight:i,startLine:a,lineNumbers:o=!0,...s})=>{let c=X(),{isAnimating:l}=(0,N.useContext)(ED),u=Rw(i),d=zw(l,!!u,t),f=(0,N.useMemo)(()=>c(Vw),[c]),p=(0,N.useMemo)(()=>c(Bw),[c]),m=(0,N.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,Hw(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,M.jsx)(`div`,{className:c(r,u?`overflow-y-auto`:null,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,ref:d,style:u?{maxHeight:u}:void 0,...s,children:(0,M.jsx)(`pre`,{className:c(r,`bg-[var(--sdm-bg,inherit)]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]`),style:m,children:(0,M.jsx)(`code`,{className:o?c(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:o&&a&&a>1?{counterReset:`line ${a-1}`}:void 0,children:t.tokens.map((e,t)=>(0,M.jsx)(`span`,{className:o?f:p,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
110
110
|
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,M.jsx)(`span`,{className:c(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})}),Ww=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=X();return(0,M.jsx)(`div`,{className:a(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i})},Gw=(0,N.createContext)({code:``}),Kw=()=>(0,N.useContext)(Gw),qw=({language:e})=>{let t=X();return(0,M.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,M.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},Jw=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
111
|
-
`;)t--;return e.slice(0,t)},Yw=(0,N.lazy)(()=>Fe(()=>import(`./highlighted-body-KPVGNVTW-
|
|
111
|
+
`;)t--;return e.slice(0,t)},Yw=(0,N.lazy)(()=>Fe(()=>import(`./highlighted-body-KPVGNVTW-D19paMBO.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([20,1,21]),import.meta.url)),Xw=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=X(),{codeBlockMaxHeight:l}=(0,N.useContext)(ED),u=(0,N.useMemo)(()=>Jw(e),[e]),d=(0,N.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:u.split(`
|
|
112
112
|
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[u]);return(0,M.jsx)(Gw.Provider,{value:{code:e},children:(0,M.jsxs)(Ww,{dir:`ltr`,isIncomplete:i,language:t,children:[(0,M.jsx)(qw,{language:t}),r?(0,M.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,M.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(Uw,{className:n,language:t,lineNumbers:o,maxHeight:l,result:d,startLine:a,...s}),children:(0,M.jsx)(Yw,{className:n,code:u,language:t,lineNumbers:o,maxHeight:l,raw:d,startLine:a,...s})})]})})},Zw={CheckIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,M.jsxs)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,M.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},Qw=(0,N.createContext)(Zw),$w=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])},eT=({icons:e,children:t})=>{let n=(0,N.useRef)(e),r=(0,N.useRef)(e?{...Zw,...e}:Zw);$w(n.current,e)||(n.current=e,r.current=e?{...Zw,...e}:Zw);let i=r.current;return(0,M.jsx)(Qw.Provider,{value:i,children:t})},tT=()=>(0,N.useContext)(Qw),nT={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,resetView:`Reset zoom and pan`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},rT=(0,N.createContext)(nT),iT=()=>(0,N.useContext)(rT),aT=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=X(),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(0),{code:d}=Kw(),{isAnimating:f}=(0,N.useContext)(ED),p=iT(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,N.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=tT(),_=c?g.CheckIcon:g.CopyIcon;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{"aria-label":p.copyCode,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,M.jsx)(_,{"aria-hidden":`true`,size:14})}),c&&(0,M.jsx)(`output`,{"aria-live":`polite`,className:`sr-only`,children:p.copied})]})},oT=(e,t,n)=>{if(typeof e==`boolean`)return n;let r=e[t];if(typeof r!=`object`)return n;let i=r.download;return typeof i==`object`&&i.filename||n},sT={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},cT=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=X(),{code:c}=Kw(),{isAnimating:l,controls:u}=(0,N.useContext)(ED),d=iT(),f=tT(),p=a??c,m=n&&n in sT?sT[n]:`txt`,h=`${oT(u,`code`,`file`)}.${m}`;return(0,M.jsx)(`button`,{"aria-label":d.downloadFile,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{Fw(h,p,`text/plain`),e?.()}catch(e){t?.(e)}},title:d.downloadFile,type:`button`,...o,children:r??(0,M.jsx)(f.DownloadIcon,{size:14})})},lT=()=>{let{Loader2Icon:e}=tT(),t=X();return(0,M.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,M.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,M.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,M.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},uT=/\.[^/.]+$/,dT=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:o=!0,showDownloadControl:s=!0,...c})=>{let{DownloadIcon:l}=tT(),u=X(),d=(0,N.useRef)(null),[f,p]=(0,N.useState)(!1),[m,h]=(0,N.useState)(!1),g=iT(),_=c.width!=null||c.height!=null,v=(f||_)&&!m&&o&&s,y=m&&!_;(0,N.useEffect)(()=>{let e=d.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;p(t),h(!t)}},[]);let b=(0,N.useCallback)(e=>{p(!0),h(!1),i?.(e)},[i]),x=(0,N.useCallback)(e=>{p(!1),h(!0),a?.(e)},[a]),S=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(uT,``)}.${i}`}Fw(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,M.jsxs)(`div`,{className:u(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,M.jsx)(`img`,{alt:r,className:u(`max-w-full rounded-lg`,y&&`hidden`,t),"data-streamdown":`image`,onError:x,onLoad:b,ref:d,src:n,...c}),y&&(0,M.jsx)(`span`,{className:u(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:g.imageNotAvailable}),o&&(0,M.jsx)(`div`,{className:u(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`),"data-streamdown":`image-overlay`}),v&&(0,M.jsx)(`button`,{className:u(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:S,title:g.downloadImage,type:`button`,children:(0,M.jsx)(l,{size:14})})]}):null},fT=0,pT=()=>{fT+=1,fT===1&&(document.body.style.overflow=`hidden`)},mT=()=>{fT=Math.max(0,fT-1),fT===0&&(document.body.style.overflow=``)},hT=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=tT(),c=X(),[l,u]=(0,N.useState)(!1),d=iT(),f=(0,N.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,N.useCallback)(()=>{r(),n()},[r,n]);if((0,N.useEffect)(()=>{if(t){pT();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),mT()}}},[t,n]),!t||typeof document>`u`)return null;let m=(0,M.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,M.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,M.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,M.jsx)(s,{size:16})}),(0,M.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,M.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,M.jsx)(o,{size:20}),(0,M.jsx)(`span`,{children:d.openExternalLink})]}),(0,M.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,M.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,M.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,M.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(i,{size:14}),(0,M.jsx)(`span`,{children:d.copied})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(a,{size:14}),(0,M.jsx)(`span`,{children:d.copyLink})]})}),(0,M.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,M.jsx)(o,{size:14}),(0,M.jsx)(`span`,{children:d.openLink})]})]})]})});return(0,pt.createPortal)(m,document.body)},gT=(0,N.createContext)(null),_T=()=>(0,N.useContext)(gT),vT=()=>_T()?.code??null,yT=()=>_T()?.mermaid??null,bT=e=>{var t;let n=_T();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},xT=e=>{if(typeof DOMParser>`u`||typeof XMLSerializer>`u`)return e;let t=new DOMParser().parseFromString(e,`text/html`).querySelector(`svg`);return t?new XMLSerializer().serializeToString(t):e},ST=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),CT=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=X(),[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),{isAnimating:u,controls:d}=(0,N.useContext)(ED),f=tT(),p=yT(),m=iT(),h=oT(d,`mermaid`,`diagram`),g=async t=>{try{if(t===`mmd`){Fw(`${h}.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!p){a?.(Error(`Mermaid plugin not available`));return}let n=p.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}let u=xT(l);if(t===`svg`){Fw(`${h}.svg`,u,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){let e=await ST(u);Fw(`${h}.png`,e,`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,M.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,M.jsx)(`button`,{"aria-label":m.downloadDiagram,className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:m.downloadDiagram,type:`button`,children:t??(0,M.jsx)(f.DownloadIcon,{"aria-hidden":`true`,size:14})}),s?(0,M.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{"aria-label":m.downloadDiagramAsSvg,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`svg`),title:m.downloadDiagramAsSvg,type:`button`,children:m.mermaidFormatSvg}),(0,M.jsx)(`button`,{"aria-label":m.downloadDiagramAsPng,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`png`),title:m.downloadDiagramAsPng,type:`button`,children:m.mermaidFormatPng}),(0,M.jsx)(`button`,{"aria-label":m.downloadDiagramAsMmd,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`mmd`),title:m.downloadDiagramAsMmd,type:`button`,children:m.mermaidFormatMmd})]}):null]})},wT=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=tT(),c=X(),[l,u]=(0,N.useState)(!1),{isAnimating:d,controls:f}=(0,N.useContext)(ED),p=iT(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.panZoom!==!1})(),h=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.download!==!1})(),g=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.copy!==!1})(),_=()=>{u(!l)};return(0,N.useEffect)(()=>{if(l){pT();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),mT()}}},[l]),(0,N.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:_,title:p.viewFullscreen,type:`button`,...a,"aria-label":p.viewFullscreen,children:(0,M.jsx)(o,{"aria-hidden":`true`,size:14})}),l?(0,pt.createPortal)((0,M.jsxs)(`div`,{"aria-label":p.viewFullscreen,"aria-modal":`true`,className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),"data-streamdown":`mermaid-fullscreen`,onClick:_,onKeyDown:e=>{e.key===`Escape`&&_()},role:`dialog`,children:[(0,M.jsxs)(`div`,{className:c(`absolute top-4 right-4 z-10 flex items-center gap-1`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[h?(0,M.jsx)(CT,{chart:e,config:t}):null,g?(0,M.jsx)(aT,{code:e}):null,(0,M.jsx)(`button`,{"aria-label":p.exitFullscreen,className:c(`rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:_,title:p.exitFullscreen,type:`button`,children:(0,M.jsx)(s,{"aria-hidden":`true`,size:20})})]}),(0,M.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,M.jsx)(AD,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})};function TT(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent??``;if(e.nodeType!==Node.ELEMENT_NODE)return``;let t=e;return t.tagName===`BR`?`
|
|
113
113
|
`:Array.from(t.childNodes).map(TT).join(``)}var ET=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(TT(e).trim());let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(TT(e).trim());n.push(t)}return{headers:t,rows:n}},DT=e=>{if(typeof e!=`object`)return`,`;let t=e.table;return typeof t==`object`?t.csvSeparator??`,`:`,`},OT=(e,t=`,`)=>{let n;n=t===`auto`?Intl.NumberFormat().format(1.1).includes(`,`)?`;`:`,`:t;let{headers:r,rows:i}=e,a=e=>{let t=!1;for(let r of e)if(r===n||r===`"`||r===`
|
|
114
114
|
`||r===`\r`){t=!0;break}return t?`"${e.replace(/"/g,`""`)}"`:e},o=r.length>0?i.length+1:i.length,s=Array(o),c=0;r.length>0&&(s[c]=r.map(a).join(n),c+=1);for(let e of i)s[c]=e.map(a).join(n),c+=1;return s.join(`
|
|
@@ -118,7 +118,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
118
118
|
`)},AT=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`||n===`
|
|
119
119
|
`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):t===`
|
|
120
120
|
`?n.push(`<br>`):n.push(t);return n.join(``)},jT=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0,a=t.map(e=>AT(e));r[i]=`| ${a.join(` | `)} |`,i+=1;let o=Array(t.length);for(let e=0;e<t.length;e+=1)o[e]=`---`;r[i]=`| ${o.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?AT(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else{let t=e.map(e=>AT(e));r[i]=`| ${t.join(` | `)} |`,i+=1}return r.join(`
|
|
121
|
-
`)},MT=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=X(),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(null),d=(0,N.useRef)(0),{isAnimating:f,controls:p}=(0,N.useContext)(ED),m=iT(),h=DT(p),g=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=ET(t),o=``;o=e===`csv`?OT(a,h):e===`tsv`?kT(a):jT(a);let c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let _=tT(),v=c?_.CheckIcon:_.CopyIcon;return(0,M.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,M.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:m.copyTable,type:`button`,children:e??(0,M.jsx)(v,{height:14,width:14})}),o?(0,M.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`md`),title:m.copyTableAsMarkdown,type:`button`,children:m.tableFormatMarkdown}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`csv`),title:m.copyTableAsCsv,type:`button`,children:m.tableFormatCsv}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`tsv`),title:m.copyTableAsTsv,type:`button`,children:m.tableFormatTsv})]}):null]})},NT=({children:e,className:t,onDownload:n,onError:r})=>{let i=X(),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null),{isAnimating:c,controls:l}=(0,N.useContext)(ED),u=iT(),d=tT(),f=DT(l),p=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=ET(t),a=e===`csv`?OT(i,f):jT(i),c=e===`csv`?`csv`:`md`;Fw(`${oT(l,`table`,`table`)}.${c}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,M.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,M.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:`button`,children:e??(0,M.jsx)(d.DownloadIcon,{size:14})}),a?(0,M.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`csv`),title:u.downloadTableAsCsv,type:`button`,children:u.tableFormatCsv}),(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`markdown`),title:u.downloadTableAsMarkdown,type:`button`,children:u.tableFormatMarkdown})]}):null]})},PT=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=tT(),o=X(),[s,c]=(0,N.useState)(!1),{isAnimating:l}=(0,N.useContext)(ED),u=iT(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,N.useEffect)(()=>{if(s){pT();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),mT()}}},[s]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,M.jsx)(i,{size:14})}),s?(0,pt.createPortal)((0,M.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,M.jsxs)(`div`,{className:o(`flex h-full flex-col`),"data-streamdown":`table-wrapper`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,M.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,M.jsx)(MT,{}):null,r?(0,M.jsx)(NT,{}):null,(0,M.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,M.jsx)(a,{size:20})})]}),(0,M.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,M.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},FT=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=X(),{isAnimating:l}=(0,N.useContext)(ED),u=Rw(n),d=zw(l,!!u,e),f=r&&i,p=r&&a,m=r&&o,h=f||p||m;return(0,M.jsxs)(`div`,{className:c(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[h?(0,M.jsxs)(`div`,{className:c(`flex items-center justify-end gap-1`),children:[f?(0,M.jsx)(MT,{}):null,p?(0,M.jsx)(NT,{}):null,m?(0,M.jsx)(PT,{showCopy:f,showDownload:p,children:e}):null]}):null,(0,M.jsx)(`div`,{className:c(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),ref:d,style:u?{maxHeight:u}:void 0,children:(0,M.jsx)(`table`,{className:c(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...s,children:e})})]})},IT=/startLine=(\d+)/,LT=/\bnoLineNumbers\b/,RT=(0,N.lazy)(()=>Fe(()=>import(`./mermaid-HWGCJPDP-BlZ0S_7e.js`).then(e=>({default:e.Mermaid})),[],import.meta.url)),zT=/language-([^\s]+)/,BT=`node`;function VT(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let e of n)if(e!==BT&&!Object.is(r[e],i[e]))return!1;return!0}function HT(e,t){return e?.properties?.metastring===t?.properties?.metastring}var UT=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,WT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},GT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},KT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},qT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.image;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},JT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`ol`,{className:i(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e})},(e,t)=>VT(e,t));JT.displayName=`MarkdownOl`;var YT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>VT(e,t));YT.displayName=`MarkdownLi`;var XT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`ul`,{className:i(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e})},(e,t)=>VT(e,t));XT.displayName=`MarkdownUl`;var ZT=(0,N.memo)(({className:e,node:t,...n})=>{let r=X();return(0,M.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>VT(e,t));ZT.displayName=`MarkdownHr`;var QT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>VT(e,t));QT.displayName=`MarkdownStrong`;var $T=(0,N.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=X(),{linkSafety:o}=(0,N.useContext)(ED),[s,c]=(0,N.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,N.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,N.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,N.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,M.jsx)(hT,{...p})]}):(0,M.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>VT(e,t));$T.displayName=`MarkdownA`;var eE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h1`,{className:i(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e})},(e,t)=>VT(e,t));eE.displayName=`MarkdownH1`;var tE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h2`,{className:i(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e})},(e,t)=>VT(e,t));tE.displayName=`MarkdownH2`;var nE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h3`,{className:i(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e})},(e,t)=>VT(e,t));nE.displayName=`MarkdownH3`;var rE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h4`,{className:i(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e})},(e,t)=>VT(e,t));rE.displayName=`MarkdownH4`;var iE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h5`,{className:i(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e})},(e,t)=>VT(e,t));iE.displayName=`MarkdownH5`;var aE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h6`,{className:i(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e})},(e,t)=>VT(e,t));aE.displayName=`MarkdownH6`;var oE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,N.useContext)(ED),o=UT(i,`table`),s=WT(i,`copy`),c=WT(i,`download`),l=WT(i,`fullscreen`);return(0,M.jsx)(FT,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>VT(e,t));oE.displayName=`MarkdownTable`;var sE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>VT(e,t));sE.displayName=`MarkdownThead`;var cE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>VT(e,t));cE.displayName=`MarkdownTbody`;var lE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>VT(e,t));lE.displayName=`MarkdownTr`;var uE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`th`,{className:i(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e})},(e,t)=>VT(e,t));uE.displayName=`MarkdownTh`;var dE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>VT(e,t));dE.displayName=`MarkdownTd`;var fE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`blockquote`,{className:i(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e})},(e,t)=>VT(e,t));fE.displayName=`MarkdownBlockquote`;var pE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>VT(e,t));pE.displayName=`MarkdownSup`;var mE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>VT(e,t));mE.displayName=`MarkdownSub`;var hE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,N.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,N.isValidElement)(e)){if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,N.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,N.isValidElement)(e))return e;if(e.type===JT){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,M.jsx)(`section`,{className:t,...r,children:i}):null}return(0,M.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>VT(e,t));hE.displayName=`MarkdownSection`;var gE=(0,N.memo)(({node:e,className:t,children:n,...r})=>{let i=X(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,N.useContext)(ED),l=yT(),u=jw(),d=(t?.match(zT))?.at(1)??``,f=bT(d);if(a)return(0,M.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(IT),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&<.test(p))&&c!==!1,v=``;if((0,N.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(lT,{}),children:(0,M.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=UT(s,`mermaid`),n=KT(s,`download`),r=KT(s,`copy`),a=KT(s,`fullscreen`),c=KT(s,`panZoom`),l=e&&(n||r||a);return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(lT,{}),children:(0,M.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,M.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,M.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,M.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,M.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,M.jsx)(CT,{chart:v,config:o?.config}):null,r?(0,M.jsx)(aT,{code:v}):null,a?(0,M.jsx)(wT,{chart:v,config:o?.config}):null]})}):null,(0,M.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,M.jsx)(RT,{chart:v,config:o?.config,showControls:c})})]})})}let y=UT(s,`code`),b=GT(s,`download`),x=GT(s,`copy`),{"data-block":S,...C}=r;return(0,M.jsx)(Xw,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,...C,children:y?(0,M.jsxs)(M.Fragment,{children:[b?(0,M.jsx)(cT,{code:v,language:d}):null,x?(0,M.jsx)(aT,{}):null]}):null})},(e,t)=>VT(e,t)&&HT(e.node,t.node));gE.displayName=`MarkdownCode`;var _E=(0,N.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,N.useContext)(ED),i=UT(r,`image`),a=i&&qT(r,`download`);return(0,M.jsx)(dT,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>VT(e,t));_E.displayName=`MarkdownImg`;var vE=(0,N.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,N.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,M.jsx)(M.Fragment,{children:e})}return(0,M.jsx)(`p`,{...n,children:e})},(e,t)=>VT(e,t));vE.displayName=`MarkdownParagraph`;var yE={ol:JT,li:YT,ul:XT,hr:ZT,strong:QT,a:$T,h1:eE,h2:tE,h3:nE,h4:rE,h5:iE,h6:aE,table:oE,thead:sE,tbody:cE,tr:lE,th:uE,td:dE,blockquote:fE,code:gE,img:_E,pre:({children:e})=>(0,N.isValidElement)(e)?(0,N.cloneElement)(e,{"data-block":`true`}):e,sup:pE,sub:mE,p:vE,section:hE},bE=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,xE=/\p{L}/u;function SE(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,``).replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``),n,r=0,i=0;for(let e of t){if(bE.test(e)){n??=`rtl`,i+=1;continue}xE.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var CE=/^[ \t]{0,3}(`{3,}|~{3,})/,wE=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,TE=e=>{let t=e.split(`
|
|
121
|
+
`)},MT=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=X(),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(null),d=(0,N.useRef)(0),{isAnimating:f,controls:p}=(0,N.useContext)(ED),m=iT(),h=DT(p),g=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=ET(t),o=``;o=e===`csv`?OT(a,h):e===`tsv`?kT(a):jT(a);let c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let _=tT(),v=c?_.CheckIcon:_.CopyIcon;return(0,M.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,M.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:m.copyTable,type:`button`,children:e??(0,M.jsx)(v,{height:14,width:14})}),o?(0,M.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`md`),title:m.copyTableAsMarkdown,type:`button`,children:m.tableFormatMarkdown}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`csv`),title:m.copyTableAsCsv,type:`button`,children:m.tableFormatCsv}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`tsv`),title:m.copyTableAsTsv,type:`button`,children:m.tableFormatTsv})]}):null]})},NT=({children:e,className:t,onDownload:n,onError:r})=>{let i=X(),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null),{isAnimating:c,controls:l}=(0,N.useContext)(ED),u=iT(),d=tT(),f=DT(l),p=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=ET(t),a=e===`csv`?OT(i,f):jT(i),c=e===`csv`?`csv`:`md`;Fw(`${oT(l,`table`,`table`)}.${c}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,M.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,M.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:`button`,children:e??(0,M.jsx)(d.DownloadIcon,{size:14})}),a?(0,M.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`csv`),title:u.downloadTableAsCsv,type:`button`,children:u.tableFormatCsv}),(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`markdown`),title:u.downloadTableAsMarkdown,type:`button`,children:u.tableFormatMarkdown})]}):null]})},PT=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=tT(),o=X(),[s,c]=(0,N.useState)(!1),{isAnimating:l}=(0,N.useContext)(ED),u=iT(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,N.useEffect)(()=>{if(s){pT();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),mT()}}},[s]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,M.jsx)(i,{size:14})}),s?(0,pt.createPortal)((0,M.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,M.jsxs)(`div`,{className:o(`flex h-full flex-col`),"data-streamdown":`table-wrapper`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,M.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,M.jsx)(MT,{}):null,r?(0,M.jsx)(NT,{}):null,(0,M.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,M.jsx)(a,{size:20})})]}),(0,M.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,M.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},FT=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=X(),{isAnimating:l}=(0,N.useContext)(ED),u=Rw(n),d=zw(l,!!u,e),f=r&&i,p=r&&a,m=r&&o,h=f||p||m;return(0,M.jsxs)(`div`,{className:c(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[h?(0,M.jsxs)(`div`,{className:c(`flex items-center justify-end gap-1`),children:[f?(0,M.jsx)(MT,{}):null,p?(0,M.jsx)(NT,{}):null,m?(0,M.jsx)(PT,{showCopy:f,showDownload:p,children:e}):null]}):null,(0,M.jsx)(`div`,{className:c(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),ref:d,style:u?{maxHeight:u}:void 0,children:(0,M.jsx)(`table`,{className:c(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...s,children:e})})]})},IT=/startLine=(\d+)/,LT=/\bnoLineNumbers\b/,RT=(0,N.lazy)(()=>Fe(()=>import(`./mermaid-HWGCJPDP-C7YHt7l6.js`).then(e=>({default:e.Mermaid})),[],import.meta.url)),zT=/language-([^\s]+)/,BT=`node`;function VT(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let e of n)if(e!==BT&&!Object.is(r[e],i[e]))return!1;return!0}function HT(e,t){return e?.properties?.metastring===t?.properties?.metastring}var UT=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,WT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},GT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},KT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},qT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.image;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},JT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`ol`,{className:i(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e})},(e,t)=>VT(e,t));JT.displayName=`MarkdownOl`;var YT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>VT(e,t));YT.displayName=`MarkdownLi`;var XT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`ul`,{className:i(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e})},(e,t)=>VT(e,t));XT.displayName=`MarkdownUl`;var ZT=(0,N.memo)(({className:e,node:t,...n})=>{let r=X();return(0,M.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>VT(e,t));ZT.displayName=`MarkdownHr`;var QT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>VT(e,t));QT.displayName=`MarkdownStrong`;var $T=(0,N.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=X(),{linkSafety:o}=(0,N.useContext)(ED),[s,c]=(0,N.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,N.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,N.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,N.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,M.jsx)(hT,{...p})]}):(0,M.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>VT(e,t));$T.displayName=`MarkdownA`;var eE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h1`,{className:i(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e})},(e,t)=>VT(e,t));eE.displayName=`MarkdownH1`;var tE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h2`,{className:i(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e})},(e,t)=>VT(e,t));tE.displayName=`MarkdownH2`;var nE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h3`,{className:i(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e})},(e,t)=>VT(e,t));nE.displayName=`MarkdownH3`;var rE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h4`,{className:i(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e})},(e,t)=>VT(e,t));rE.displayName=`MarkdownH4`;var iE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h5`,{className:i(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e})},(e,t)=>VT(e,t));iE.displayName=`MarkdownH5`;var aE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h6`,{className:i(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e})},(e,t)=>VT(e,t));aE.displayName=`MarkdownH6`;var oE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,N.useContext)(ED),o=UT(i,`table`),s=WT(i,`copy`),c=WT(i,`download`),l=WT(i,`fullscreen`);return(0,M.jsx)(FT,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>VT(e,t));oE.displayName=`MarkdownTable`;var sE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>VT(e,t));sE.displayName=`MarkdownThead`;var cE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>VT(e,t));cE.displayName=`MarkdownTbody`;var lE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>VT(e,t));lE.displayName=`MarkdownTr`;var uE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`th`,{className:i(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e})},(e,t)=>VT(e,t));uE.displayName=`MarkdownTh`;var dE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>VT(e,t));dE.displayName=`MarkdownTd`;var fE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`blockquote`,{className:i(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e})},(e,t)=>VT(e,t));fE.displayName=`MarkdownBlockquote`;var pE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>VT(e,t));pE.displayName=`MarkdownSup`;var mE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>VT(e,t));mE.displayName=`MarkdownSub`;var hE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,N.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,N.isValidElement)(e)){if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,N.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,N.isValidElement)(e))return e;if(e.type===JT){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,M.jsx)(`section`,{className:t,...r,children:i}):null}return(0,M.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>VT(e,t));hE.displayName=`MarkdownSection`;var gE=(0,N.memo)(({node:e,className:t,children:n,...r})=>{let i=X(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,N.useContext)(ED),l=yT(),u=jw(),d=(t?.match(zT))?.at(1)??``,f=bT(d);if(a)return(0,M.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(IT),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&<.test(p))&&c!==!1,v=``;if((0,N.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(lT,{}),children:(0,M.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=UT(s,`mermaid`),n=KT(s,`download`),r=KT(s,`copy`),a=KT(s,`fullscreen`),c=KT(s,`panZoom`),l=e&&(n||r||a);return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(lT,{}),children:(0,M.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,M.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,M.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,M.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,M.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,M.jsx)(CT,{chart:v,config:o?.config}):null,r?(0,M.jsx)(aT,{code:v}):null,a?(0,M.jsx)(wT,{chart:v,config:o?.config}):null]})}):null,(0,M.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,M.jsx)(RT,{chart:v,config:o?.config,showControls:c})})]})})}let y=UT(s,`code`),b=GT(s,`download`),x=GT(s,`copy`),{"data-block":S,...C}=r;return(0,M.jsx)(Xw,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,...C,children:y?(0,M.jsxs)(M.Fragment,{children:[b?(0,M.jsx)(cT,{code:v,language:d}):null,x?(0,M.jsx)(aT,{}):null]}):null})},(e,t)=>VT(e,t)&&HT(e.node,t.node));gE.displayName=`MarkdownCode`;var _E=(0,N.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,N.useContext)(ED),i=UT(r,`image`),a=i&&qT(r,`download`);return(0,M.jsx)(dT,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>VT(e,t));_E.displayName=`MarkdownImg`;var vE=(0,N.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,N.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,M.jsx)(M.Fragment,{children:e})}return(0,M.jsx)(`p`,{...n,children:e})},(e,t)=>VT(e,t));vE.displayName=`MarkdownParagraph`;var yE={ol:JT,li:YT,ul:XT,hr:ZT,strong:QT,a:$T,h1:eE,h2:tE,h3:nE,h4:rE,h5:iE,h6:aE,table:oE,thead:sE,tbody:cE,tr:lE,th:uE,td:dE,blockquote:fE,code:gE,img:_E,pre:({children:e})=>(0,N.isValidElement)(e)?(0,N.cloneElement)(e,{"data-block":`true`}):e,sup:pE,sub:mE,p:vE,section:hE},bE=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,xE=/\p{L}/u;function SE(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,``).replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``),n,r=0,i=0;for(let e of t){if(bE.test(e)){n??=`rtl`,i+=1;continue}xE.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var CE=/^[ \t]{0,3}(`{3,}|~{3,})/,wE=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,TE=e=>{let t=e.split(`
|
|
122
122
|
`),n=null,r=0;for(let e of t){let t=CE.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},EE=e=>{let t=e.split(`
|
|
123
123
|
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&wE.test(t))return!0}return!1},DE=()=>e=>{Pa(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},OE=[],kE={allowDangerousHtml:!0},AE=new WeakMap,jE=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=AE.get(e);n||(n=e.name,AE.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=AE.get(r);e||(e=r.name,AE.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},ME=e=>{let t=NE(e),n=e.children||``;return BE(t.runSync(t.parse(n),n),e)},NE=e=>{let t=jE.get(e);if(t)return t;let n=FE(e);return jE.set(e,n),n},PE=e=>e.some(e=>Array.isArray(e)?e[0]===mf:e===mf),FE=e=>{let t=e.rehypePlugins||OE,n=e.remarkPlugins||OE,r=PE(t)?n:[...n,DE],i=e.remarkRehypeOptions?{...kE,...e.remarkRehypeOptions}:kE;return _S().use(Qb).use(r).use(Ux,i).use(t)},IE=e=>e,LE=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},RE=(e,t)=>{for(let n in pb)if(Object.hasOwn(pb,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=pb[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},zE=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},BE=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||IE;Pa(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return LE(c,s,a,e.value),s;if(e.type===`element`&&(RE(e,t),zE(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return Gy(e,{Fragment:M.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:M.jsx,jsxs:M.jsxs,passKeys:!0,passNode:!0})},VE=/\[\^[\w-]{1,200}\](?!:)/,HE=/\[\^[\w-]{1,200}\]:/,UE=/<([A-Za-z][\w:-]*)[\s>/]/,WE=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),GE=new Map,KE=new Map,qE=e=>{let t=e.toLowerCase(),n=GE.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return GE.set(t,r),r},JE=e=>{let t=e.toLowerCase(),n=KE.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return KE.set(t,r),r},YE=(e,t)=>{if(WE.has(t.toLowerCase()))return 0;let n=e.match(qE(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},XE=(e,t)=>{let n=e.match(JE(t));return n?n.length:0},ZE=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},QE=e=>{let t=VE.test(e),n=HE.test(e);if(t||n)return[e];let r=KC.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=YE(t,e),o=XE(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(UE);if(e){let n=e[1];YE(t,n)>XE(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(ZE(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},$E=/^\n*/,eD=/\n*$/,tD=/\n\n/g,nD=(e,t,n)=>t.includes(`
|
|
124
124
|
`)?`${e}${t.replace(tD,`
|
|
@@ -337,6 +337,6 @@ XID_Start XIDS`.split(/\s/).map(e=>[IN(e),e])),kP=new Map([[`s`,mP(383)],[mP(383
|
|
|
337
337
|
|
|
338
338
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
339
339
|
|
|
340
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Lz=`DialogDescriptionWarning`,Rz=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fz(Lz).contentName}}.`;return N.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},zz=uz,Bz=gz,Vz=vz,Hz=Sz,Uz=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=xt(`Primitive.${t}`),r=N.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Wz=`[cmdk-group=""]`,Gz=`[cmdk-group-items=""]`,Kz=`[cmdk-group-heading=""]`,qz=`[cmdk-item=""]`,Jz=`${qz}:not([aria-disabled="true"])`,Yz=`cmdk-item-select`,Xz=`data-value`,Zz=(e,t,n)=>PI(e,t,n),Qz=N.createContext(void 0),$z=()=>N.useContext(Qz),eB=N.createContext(void 0),tB=()=>N.useContext(eB),nB=N.createContext(void 0),rB=N.forwardRef((e,t)=>{let n=_B(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=_B(()=>new Set),i=_B(()=>new Map),a=_B(()=>new Map),o=_B(()=>new Set),s=hB(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=HI(),y=HI(),b=HI(),x=N.useRef(null),S=bB();gB(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),gB(()=>{S(6,te)},[]);let C=N.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)D(),E(),S(1,ee);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=O()?.id,C.emit()}),r||S(5,te),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=N.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{D(),E(),n.current.value||ee(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=O();S(4,()=>{D(),t?.getAttribute(`id`)===e&&ee(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??Zz;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;ne().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Gz);t?t.appendChild(e.parentElement===t?e:e.closest(`${Gz} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Gz} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Wz}[${Xz}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function ee(){let e=ne().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Xz);C.setState(`value`,e||void 0)}function D(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function te(){var e;let t=O();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Wz)?.querySelector(Kz))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function O(){return x.current?.querySelector(`${qz}[aria-selected="true"]`)}function ne(){return Array.from(x.current?.querySelectorAll(Jz)||[])}function k(e){let t=ne()[e];t&&C.setState(`value`,t.getAttribute(Xz))}function re(e){var t;let n=O(),r=ne(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(Xz))}function ie(e){let t=O()?.closest(Wz),n;for(;t&&!n;)t=e>0?pB(t,Wz):mB(t,Wz),n=t?.querySelector(Jz);n?C.setState(`value`,n.getAttribute(Xz)):re(e)}let ae=()=>k(ne().length-1),oe=e=>{e.preventDefault(),e.metaKey?ae():e.altKey?ie(1):re(1)},se=e=>{e.preventDefault(),e.metaKey?k(0):e.altKey?ie(-1):re(-1)};return N.createElement(Uz.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&oe(e);break;case`ArrowDown`:oe(e);break;case`p`:case`k`:g&&e.ctrlKey&&se(e);break;case`ArrowUp`:se(e);break;case`Home`:e.preventDefault(),k(0);break;case`End`:e.preventDefault(),ae();break;case`Enter`:{e.preventDefault();let t=O();if(t){let e=new Event(Yz);t.dispatchEvent(e)}}}}},N.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:CB},c),SB(e,e=>N.createElement(eB.Provider,{value:C},N.createElement(Qz.Provider,{value:w},e))))}),iB=N.forwardRef((e,t)=>{let n=HI(),r=N.useRef(null),i=N.useContext(nB),a=$z(),o=hB(e),s=o.current?.forceMount??i?.forceMount;gB(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=yB(n,r,[e.value,e.children,r],e.keywords),l=tB(),u=vB(e=>e.value&&e.value===c.current),d=vB(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);N.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Yz,f),()=>t.removeEventListener(Yz,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return N.createElement(Uz.div,{ref:ht(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),aB=N.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=HI(),s=N.useRef(null),c=N.useRef(null),l=HI(),u=$z(),d=vB(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));gB(()=>u.group(o),[]),yB(o,s,[e.value,e.heading,c]);let f=N.useMemo(()=>({id:o,forceMount:i}),[i]);return N.createElement(Uz.div,{ref:ht(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&N.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),SB(e,e=>N.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},N.createElement(nB.Provider,{value:f},e))))}),oB=N.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=N.useRef(null),a=vB(e=>!e.search);return!n&&!a?null:N.createElement(Uz.div,{ref:ht(i,t),...r,"cmdk-separator":``,role:`separator`})}),sB=N.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=tB(),o=vB(e=>e.search),s=vB(e=>e.selectedItemId),c=$z();return N.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),N.createElement(Uz.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),cB=N.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=N.useRef(null),o=N.useRef(null),s=vB(e=>e.selectedItemId),c=$z();return N.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),N.createElement(Uz.div,{ref:ht(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},SB(e,e=>N.createElement(`div`,{ref:ht(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),lB=N.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return N.createElement(zz,{open:n,onOpenChange:r},N.createElement(Bz,{container:o},N.createElement(Vz,{"cmdk-overlay":``,className:i}),N.createElement(Hz,{"aria-label":e.label,"cmdk-dialog":``,className:a},N.createElement(rB,{ref:t,...s}))))}),uB=N.forwardRef((e,t)=>vB(e=>e.filtered.count===0)?N.createElement(Uz.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),dB=N.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return N.createElement(Uz.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},SB(e,e=>N.createElement(`div`,{"aria-hidden":!0},e)))}),fB=Object.assign(rB,{List:cB,Item:iB,Input:sB,Group:aB,Separator:oB,Dialog:lB,Empty:uB,Loading:dB});function pB(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function mB(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function hB(e){let t=N.useRef(e);return gB(()=>{t.current=e}),t}var gB=typeof window>`u`?N.useEffect:N.useLayoutEffect;function _B(e){let t=N.useRef();return t.current===void 0&&(t.current=e()),t}function vB(e){let t=tB(),n=()=>e(t.snapshot());return N.useSyncExternalStore(t.subscribe,n,n)}function yB(e,t,n,r=[]){let i=N.useRef(),a=$z();return gB(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Xz,s),i.current=s}),i}var bB=()=>{let[e,t]=N.useState(),n=_B(()=>new Map);return gB(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function xB(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function SB({asChild:e,children:t},n){return e&&N.isValidElement(t)?N.cloneElement(xB(t),{ref:t.ref},n(t.props.children)):n(t)}var CB={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function wB({className:e,...t}){return(0,M.jsx)(fB,{"data-slot":`command`,className:j(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,e),...t})}function TB({className:e,...t}){return(0,M.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,M.jsxs)(we,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,M.jsx)(fB.Input,{"data-slot":`command-input`,className:j(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,M.jsx)(De,{children:(0,M.jsx)(h,{className:`size-4 shrink-0 opacity-50`})})]})})}function EB({className:e,...t}){return(0,M.jsx)(fB.List,{"data-slot":`command-list`,className:j(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function DB({className:e,...t}){return(0,M.jsx)(fB.Empty,{"data-slot":`command-empty`,className:j(`py-6 text-center text-sm`,e),...t})}function OB({className:e,...t}){return(0,M.jsx)(fB.Group,{"data-slot":`command-group`,className:j(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function kB({className:e,children:t,...n}){return(0,M.jsxs)(fB.Item,{"data-slot":`command-item`,className:j(`group/command-item relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,M.jsx)(g,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}var AB=async e=>{try{let t=await(await fetch(e)).blob();return new Promise(e=>{let n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>e(null),n.readAsDataURL(t)})}catch{return null}},jB=async e=>await new Promise(t=>{let n=new FileReader;n.onloadend=()=>t(n.result??null),n.onerror=()=>t(null),n.readAsDataURL(e)}),MB=(0,N.createContext)(null),NB=(0,N.createContext)(null),PB=()=>{let e=(0,N.useContext)(MB);if(!e)throw Error(`Wrap your component inside <PromptInputProvider> to use usePromptInputController().`);return e},FB=()=>(0,N.useContext)(MB),IB=()=>(0,N.useContext)(NB),LB=({initialInput:e=``,children:t})=>{let[n,r]=(0,N.useState)(e),i=(0,N.useCallback)(()=>r(``),[]),[a,o]=(0,N.useState)([]),s=(0,N.useRef)(null),c=(0,N.useRef)(()=>{}),l=(0,N.useCallback)(e=>{let t=[...e];t.length!==0&&o(e=>[...e,...t.map(e=>({filename:e.name,id:Pt(),mediaType:e.type,rawFile:e,type:`file`,url:URL.createObjectURL(e)}))])},[]),u=(0,N.useCallback)(e=>{o(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)})},[]),d=(0,N.useCallback)(()=>{o(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]})},[]),f=(0,N.useRef)(a);(0,N.useEffect)(()=>{f.current=a},[a]),(0,N.useEffect)(()=>()=>{for(let e of f.current)e.url&&URL.revokeObjectURL(e.url)},[]);let p=(0,N.useCallback)(()=>{c.current?.()},[]),m=(0,N.useMemo)(()=>({add:l,clear:d,fileInputRef:s,files:a,openFileDialog:p,remove:u}),[a,l,u,d,p]),h=(0,N.useCallback)((e,t)=>{s.current=e.current,c.current=t},[]),g=(0,N.useMemo)(()=>({__registerFileInput:h,attachments:m,textInput:{clear:i,setInput:r,value:n}}),[n,i,m,h]);return(0,M.jsx)(MB.Provider,{value:g,children:(0,M.jsx)(NB.Provider,{value:m,children:t})})},RB=(0,N.createContext)(null),zB=()=>{let e=IB(),t=(0,N.useContext)(RB)??e;if(!t)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return t},BB=(0,N.createContext)(null),VB=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:o,onError:s,onSubmit:c,children:l,...u})=>{let d=FB(),f=!!d,p=(0,N.useRef)(null),m=(0,N.useRef)(null),[h,g]=(0,N.useState)([]),_=f?d.attachments.files:h,[v,y]=(0,N.useState)([]),b=(0,N.useRef)(_);(0,N.useEffect)(()=>{b.current=_},[_]);let x=(0,N.useCallback)(()=>{p.current?.click()},[]),S=(0,N.useCallback)(e=>!t||t.trim()===``||t.split(`,`).map(e=>e.trim()).filter(Boolean).some(t=>{if(t.endsWith(`/*`)){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t}),[t]),C=(0,N.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!o||e.size<=o);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}g(e=>{let t=typeof a==`number`?Math.max(0,a-e.length):void 0,n=typeof t==`number`?r.slice(0,t):r;typeof t==`number`&&r.length>t&&s?.({code:`max_files`,message:`Too many files. Some were not added.`});let i=[];for(let e of n)i.push({filename:e.name,id:Pt(),mediaType:e.type,rawFile:e,type:`file`,url:URL.createObjectURL(e)});return[...e,...i]})},[S,a,o,s]),w=(0,N.useCallback)(e=>g(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),[]),T=(0,N.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!o||e.size<=o);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}let i=_.length,c=typeof a==`number`?Math.max(0,a-i):void 0,l=typeof c==`number`?r.slice(0,c):r;typeof c==`number`&&r.length>c&&s?.({code:`max_files`,message:`Too many files. Some were not added.`}),l.length>0&&d?.attachments.add(l)},[S,o,a,s,_.length,d]),E=(0,N.useCallback)(()=>f?d?.attachments.clear():g(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[f,d]),ee=(0,N.useCallback)(()=>y([]),[]),D=f?T:C,te=f?d.attachments.remove:w,O=f?d.attachments.openFileDialog:x,ne=(0,N.useCallback)(()=>{E(),ee()},[E,ee]);(0,N.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,N.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value=``)},[_,i]),(0,N.useEffect)(()=>{let e=m.current;if(!e||r)return;let t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},n=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[D,r]),(0,N.useEffect)(()=>{if(!r)return;let e=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[D,r]),(0,N.useEffect)(()=>()=>{if(!f)for(let e of b.current)e.url&&URL.revokeObjectURL(e.url)},[f]);let k=(0,N.useCallback)(e=>{e.currentTarget.files&&D(e.currentTarget.files),e.currentTarget.value=``},[D]),re=(0,N.useMemo)(()=>({add:D,clear:E,fileInputRef:p,files:_.map(e=>({...e,id:e.id})),openFileDialog:O,remove:te}),[_,D,te,E,O]),ie=(0,N.useMemo)(()=>({add:e=>{let t=Array.isArray(e)?e:[e];y(e=>[...e,...t.map(e=>({...e,id:Pt()}))])},clear:ee,remove:e=>{y(t=>t.filter(t=>t.id!==e))},sources:v}),[v,ee]),ae=(0,N.useCallback)(async e=>{e.preventDefault();let t=e.currentTarget,n=f?d.textInput.value:new FormData(t).get(`message`)||``;f||t.reset();try{let t=c({files:await Promise.all(_.map(async({id:e,rawFile:t,...n})=>{if(t){let e=await jB(t);return{...n,url:e??n.url}}if(n.url?.startsWith(`blob:`)){let e=await AB(n.url);return{...n,url:e??n.url}}return n})),text:n},e);if(t instanceof Promise)try{await t,ne(),f&&d.textInput.clear()}catch{}else ne(),f&&d.textInput.clear()}catch{}},[f,d,_,c,ne]),oe=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`input`,{accept:t,"aria-label":`Upload files`,className:`hidden`,multiple:n,onChange:k,ref:p,title:`Upload files`,type:`file`}),(0,M.jsx)(`form`,{className:j(`w-full`,e),onSubmit:ae,ref:m,...u,children:(0,M.jsx)(we,{className:`overflow-hidden`,children:l})})]}),se=(0,M.jsx)(BB.Provider,{value:ie,children:oe});return(0,M.jsx)(RB.Provider,{value:re,children:se})},HB=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`contents`,e),...t}),UB=({onChange:e,onKeyDown:t,className:n,placeholder:r=`How can I help you?`,...i})=>{let a=FB(),o=zB(),[s,c]=(0,N.useState)(!1),l=(0,N.useCallback)(e=>{if(t?.(e),!e.defaultPrevented){if(e.key===`Enter`){if(s||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let{form:t}=e.currentTarget;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}if(e.key===`Backspace`&&e.currentTarget.value===``&&o.files.length>0){e.preventDefault();let t=o.files.at(-1);t&&o.remove(t.id)}}},[t,s,o]),u=(0,N.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t)if(e.kind===`file`){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),o.add(n))},[o]),d=(0,N.useCallback)(()=>c(!1),[]),f=(0,N.useCallback)(()=>c(!0),[]),p=a?{onChange:t=>{a.textInput.setInput(t.currentTarget.value),e?.(t)},value:a.textInput.value}:{onChange:e};return(0,M.jsx)(Te,{className:j(`field-sizing-content max-h-48 min-h-16`,n),name:`message`,onCompositionEnd:d,onCompositionStart:f,onKeyDown:l,onPaste:u,placeholder:r,...i,...p})},WB=({className:e,...t})=>(0,M.jsx)(De,{align:`block-end`,className:j(`order-first flex-wrap gap-1`,e),...t}),GB=({className:e,...t})=>(0,M.jsx)(De,{align:`block-end`,className:j(`justify-between gap-1`,e),...t}),KB=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`flex min-w-0 items-center gap-1`,e),...t}),qB=({variant:e=`ghost`,className:t,size:n,tooltip:r,...i})=>{let a=n??(N.Children.count(i.children)>1?`sm`:`icon-sm`),o=(0,M.jsx)(xe,{className:j(t),size:a,type:`button`,variant:e,...i});if(!r)return o;let s=typeof r==`string`?r:r.content,c=typeof r==`string`?void 0:r.shortcut,l=typeof r==`string`?`top`:r.side??`top`;return(0,M.jsxs)(Ie,{children:[(0,M.jsx)(Re,{children:o}),(0,M.jsxs)(Ve,{side:l,children:[s,c&&(0,M.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:c})]})]})},JB=({className:e,variant:t=`default`,size:n=`icon-sm`,status:r,onStop:i,onClick:a,children:o,...s})=>{let c=r===`submitted`||r===`streaming`,l=(0,M.jsx)(Ze,{className:`size-3`});r===`submitted`?l=(0,M.jsx)(We,{}):r===`streaming`?l=(0,M.jsx)(lt,{className:`size-3`}):r===`error`&&(l=(0,M.jsx)(le,{className:`size-3`}));let u=(0,N.useCallback)(e=>{if(c&&i){e.preventDefault(),i();return}a?.(e)},[c,i,a]);return(0,M.jsx)(xe,{"aria-label":c?`Stop`:`Submit`,className:j(e),onClick:u,size:n,type:c&&i?`button`:`submit`,variant:t,...s,children:o??l})},YB=globalThis?.document?N.useLayoutEffect:()=>{},XB=Object.defineProperty,ZB=(e,t)=>XB(e,`name`,{value:t,configurable:!0}),QB=N.useEffectEvent,$B=N.useInsertionEffect;function eV(e){if(typeof QB==`function`)return QB(e);let t=N.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof $B==`function`?$B(()=>{t.current=e}):YB(()=>{t.current=e}),N.useMemo(()=>((...e)=>t.current?.(...e)),[])}ZB(eV,`useEffectEvent`);var tV=Object.defineProperty,nV=(e,t)=>tV(e,`name`,{value:t,configurable:!0}),rV=N.useInsertionEffect||YB;function iV({prop:e,defaultProp:t,onChange:n=nV(()=>{},`onChange`),caller:r}){let[i,a,o]=aV({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,N.useCallback(t=>{if(s){let n=oV(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}nV(iV,`useControllableState`);function aV({defaultProp:e,onChange:t}){let[n,r]=N.useState(e),i=N.useRef(n),a=N.useRef(t);return rV(()=>{a.current=t},[t]),N.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}nV(aV,`useUncontrolledState`);function oV(e){return typeof e==`function`}nV(oV,`isFunction`);var sV=Symbol(`RADIX:SYNC_STATE`);function cV(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=eV(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=N.useReducer((t,n)=>{if(n.type===sV)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=N.useRef(p);N.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=N.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return N.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:sV,state:i})},[i,d.state,c]),[h,f]}nV(cV,`useControllableStateReducer`);function lV(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,[a,o]=d({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=ce(a,!0,!0),u=p(),[f,m]=N.useState(),h=f===null?void 0:f??u,g=w(e=>{let t=!a,n=oe(D,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return N.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:g,mounted:s,open:a,panelId:h,setMounted:c,setOpen:o,setPanelIdState:m,transitionStatus:l}),[u,i,g,s,a,h,c,o,m,l])}var uV=N.createContext(void 0);function dV(){let e=N.useContext(uV);if(e===void 0)throw Error(T(15));return e}var fV=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=x.startingStyle]=`startingStyle`,e[e.endingStyle=x.endingStyle]=`endingStyle`,e}({}),pV=function(e){return e.panelOpen=`data-panel-open`,e}({}),mV={[fV.open]:``},hV={[fV.closed]:``},gV={open(e){return e?{[pV.panelOpen]:``}:null}},_V={open(e){return e?mV:hV},...S},vV=N.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,d=w(o),f=lV({open:s,defaultOpen:i,onOpenChange:d,disabled:a}),p=N.useMemo(()=>({open:f.open,disabled:f.disabled,transitionStatus:f.transitionStatus}),[f.open,f.disabled,f.transitionStatus]),m=N.useMemo(()=>({...f,onOpenChange:d,state:p}),[f,d,p]),h=u(`div`,e,{state:p,ref:t,props:l,stateAttributesMapping:_V});return(0,M.jsx)(uV.Provider,{value:m,children:h})}),yV={...gV,...S},bV=N.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=dV(),{className:s,disabled:c=o,render:l,nativeButton:d=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=ee({disabled:c,focusableWhenDisabled:!0,native:d});return u(`button`,e,{state:a,ref:[t,h],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},p,m],stateAttributesMapping:yV})}),xV={height:void 0,width:void 0};function SV(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=N.useRef(null),f=N.useRef(null),[p,m]=N.useState(xV),h=N.useRef(xV),g=N.useRef(!1),_=N.useRef(s),v=N.useRef(!1),[b,x]=N.useState(!1),S=N.useRef(null),T=ie(t,d),E=ne(s),ee=se(d),D=!s&&!a,O=b?`idle`:u,ae=s&&(_.current||v.current),A=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,ce=n&&D&&f.current!==`css-animation`,j=w((e,t=!0)=>{t&&(h.current=e),m(e)}),le=w(()=>{S.current?.(),S.current=null}),ue=w(e=>{le(),S.current=()=>{S.current=null,e()}}),de=w(()=>{s&&a&&f.current===`css-animation`&&(v.current=!0)});k(()=>{!b||u===`starting`||x(!1)},[b,u]),N.useEffect(()=>()=>{de(),le()},[de,le]),k(()=>{let e=d.current;if(!e)return;!s&&S.current&&le();let t=wV(e,ae);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=CV(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){j(CV(e)),x(!0);return}if(t===`css-transition`){let t=DV(e);if(j(CV(e)),!n)return t;let r=EV(e,`transition-duration`,`0s`);return ue(r),x(!0),t}j(CV(e));let r=EV(e,`animation-name`,`none`);if(!n){r();return}let i=EV(e,`animation-duration`,`0s`);r(),ue(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(_.current=!1,v.current=!1,t===`none`){j(xV,!1),c(!1);return}j(CV(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=CV(e);if(!(n.height>0||n.width>0)){c(!1);return}j(n),t===`css-animation`&&EV(e,`animation-name`,`none`)()},[a,s,le,j,c,ue,ae,u]),C({enabled:s&&a&&O===`idle`,open:!0,ref:d,onComplete(){s&&j(xV,!1)}}),N.useEffect(()=>{if(s||!a||O!==`ending`||!d.current)return;let e=new AbortController,t=-1;function n(){E.current||(c(!1),j(xV,!1))}return t=re.request(()=>{ee(n,e.signal)}),()=>{re.cancel(t),e.abort()}},[E,a,s,O,ee,j,c]),k(()=>{let e=d.current;!e||!n||!D||e.setAttribute(`hidden`,`until-found`)},[D,n]),N.useEffect(function(){let e=d.current;if(!e)return;function t(e){let t=oe(y,e);o(!0,t),!t.isCanceled&&(g.current=!0,l(!0))}return te(e,`beforematch`,t)},[o,l]);let fe=i||n||a||s;return{height:A.height,props:{...ce?{[fV.startingStyle]:``}:void 0,hidden:D,id:r},ref:T,shouldPreventOpenAnimation:ae,shouldRender:fe,transitionStatus:O,width:A.width}}function CV(e){return{height:e.scrollHeight,width:e.scrollWidth}}function wV(e,t){let n=b(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&TV(n.animationDuration),i=TV(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function TV(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function EV(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function DV(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=re.request(n);return()=>{re.cancel(r),n()}}var OV=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),kV=N.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:d,onOpenChange:f,open:p,setMounted:h,setPanelIdState:g,setOpen:_,state:v,transitionStatus:y}=dV(),b=r??!1,x=i??!1,S=o||void 0,C=S??l;k(()=>(g(e=>S??(e===null?void 0:e)),()=>{g(e=>e===S?null:e)}),[S,g]);let{height:w,props:T,ref:E,shouldPreventOpenAnimation:ee,shouldRender:D,transitionStatus:te,width:O}=SV({externalRef:t,hiddenUntilFound:b,id:C,keepMounted:x,mounted:d,onOpenChange:f,open:p,setMounted:h,setOpen:_,transitionStatus:y}),ne={...v,transitionStatus:te},re=m(s,ne),ie=u(`div`,{...e,style:void 0},{state:ne,ref:E,props:[T,{style:{[OV.collapsiblePanelHeight]:w===void 0?`auto`:`${w}px`,[OV.collapsiblePanelWidth]:O===void 0?`auto`:`${O}px`}},c,re?{style:re}:void 0,ee?{style:{animationName:`none`}}:void 0],stateAttributesMapping:_V});return D?ie:null});function AV({...e}){return(0,M.jsx)(vV,{"data-slot":`collapsible`,...e})}function jV({...e}){return(0,M.jsx)(bV,{"data-slot":`collapsible-trigger`,...e})}function MV({...e}){return(0,M.jsx)(kV,{"data-slot":`collapsible-content`,...e})}var NV=(0,N.createContext)({});function PV(e){let t=(0,N.useRef)(null);return t.current===null&&(t.current=e()),t.current}var FV=typeof window<`u`?N.useLayoutEffect:N.useEffect,IV=(0,N.createContext)(null);function LV(e,t){e.indexOf(t)===-1&&e.push(t)}function RV(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var zV=(e,t,n)=>n>t?t:n<e?e:n,BV={},VV=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),HV=e=>typeof e==`object`&&!!e,UV=e=>/^0[^.\s]+$/u.test(e);function WV(e){let t;return()=>(t===void 0&&(t=e()),t)}var GV=e=>e,KV=(...e)=>e.reduce((e,t)=>n=>t(e(n))),qV=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},JV=class{constructor(){this.subscriptions=[]}add(e){return LV(this.subscriptions,e),()=>RV(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},YV=e=>e*1e3,XV=e=>e/1e3,ZV=(e,t)=>t?1e3/t*e:0,QV=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,$V=1e-7,eH=12;function tH(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=QV(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>$V&&++s<eH);return o}function nH(e,t,n,r){if(e===t&&n===r)return GV;let i=t=>tH(t,0,1,e,n);return e=>e===0||e===1?e:QV(i(e),t,r)}var rH=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,iH=e=>t=>1-e(1-t),aH=nH(.33,1.53,.69,.99),oH=iH(aH),sH=rH(oH),cH=e=>e>=1?1:(e*=2)<1?.5*oH(e):.5*(2-2**(-10*(e-1))),lH=e=>1-Math.sin(Math.acos(e)),uH=iH(lH),dH=rH(lH),fH=nH(.42,0,1,1),pH=nH(0,0,.58,1),mH=nH(.42,0,.58,1),hH=e=>Array.isArray(e)&&typeof e[0]!=`number`,gH=e=>Array.isArray(e)&&typeof e[0]==`number`,_H={linear:GV,easeIn:fH,easeInOut:mH,easeOut:pH,circIn:lH,circInOut:dH,circOut:uH,backIn:oH,backInOut:sH,backOut:aH,anticipate:cH},vH=e=>typeof e==`string`,yH=e=>{if(gH(e)){e.length;let[t,n,r,i]=e;return nH(t,n,r,i)}return vH(e)?(_H[e],`${e}`,_H[e]):e},bH=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function xH(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var SH=40;function CH(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=bH.reduce((e,t)=>(e[t]=xH(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=BV.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,SH),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:bH.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<bH.length;t++)o[bH[t]].cancel(e)},state:i,steps:o}}var{schedule:wH,cancel:TH,state:EH,steps:DH}=CH(typeof requestAnimationFrame<`u`?requestAnimationFrame:GV,!0),OH;function kH(){OH=void 0}var AH={now:()=>(OH===void 0&&AH.set(EH.isProcessing||BV.useManualTiming?EH.timestamp:performance.now()),OH),set:e=>{OH=e,queueMicrotask(kH)}},jH=e=>t=>typeof t==`string`&&t.startsWith(e),MH=jH(`--`),NH=jH(`var(--`),PH=e=>NH(e)?FH.test(e.split(`/*`)[0].trim()):!1,FH=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function IH(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var LH={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},RH={...LH,transform:e=>zV(0,1,e)},zH={...LH,default:1},BH=e=>Math.round(e*1e5)/1e5,VH=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function HH(e){return e==null}var UH=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,WH=(e,t)=>n=>!!(typeof n==`string`&&UH.test(n)&&n.startsWith(e)||t&&!HH(n)&&Object.prototype.hasOwnProperty.call(n,t)),GH=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(VH);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},KH=e=>zV(0,255,e),qH={...LH,transform:e=>Math.round(KH(e))},JH={test:WH(`rgb`,`red`),parse:GH(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+qH.transform(e)+`, `+qH.transform(t)+`, `+qH.transform(n)+`, `+BH(RH.transform(r))+`)`};function YH(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var XH={test:WH(`#`),parse:YH,transform:JH.transform},ZH=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),QH=ZH(`deg`),$H=ZH(`%`),Q=ZH(`px`),eU=ZH(`vh`),tU=ZH(`vw`),nU={...$H,parse:e=>$H.parse(e)/100,transform:e=>$H.transform(e*100)},rU={test:WH(`hsl`,`hue`),parse:GH(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+$H.transform(BH(t))+`, `+$H.transform(BH(n))+`, `+BH(RH.transform(r))+`)`},iU={test:e=>JH.test(e)||XH.test(e)||rU.test(e),parse:e=>JH.test(e)?JH.parse(e):rU.test(e)?rU.parse(e):XH.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?JH.transform(e):rU.transform(e),getAnimatableNone:e=>{let t=iU.parse(e);return t.alpha=0,iU.transform(t)}},aU=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function oU(e){return isNaN(e)&&typeof e==`string`&&(e.match(VH)?.length||0)+(e.match(aU)?.length||0)>0}var sU=`number`,cU=`color`,lU=`var`,uU=`var(`,dU="${}",fU=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function pU(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(fU,e=>(iU.test(e)?(r.color.push(a),i.push(cU),n.push(iU.parse(e))):e.startsWith(uU)?(r.var.push(a),i.push(lU),n.push(e)):(r.number.push(a),i.push(sU),n.push(parseFloat(e))),++a,dU)).split(dU),indexes:r,types:i}}function mU(e){return pU(e).values}function hU({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===sU?BH(r[a]):e===cU?iU.transform(r[a]):r[a]}return i}}function gU(e){return hU(pU(e))}var _U=e=>typeof e==`number`?0:iU.test(e)?iU.getAnimatableNone(e):e,vU=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:_U(e);function yU(e){let t=pU(e);return hU(t)(t.values.map((e,n)=>vU(e,t.split[n])))}var bU={test:oU,parse:mU,createTransformer:gU,getAnimatableNone:yU};function xU(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function SU({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=xU(s,r,e+1/3),a=xU(s,r,e),o=xU(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function CU(e,t){return n=>n>0?t:e}var wU=(e,t,n)=>e+(t-e)*n,TU=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},EU=[XH,JH,rU],DU=e=>EU.find(t=>t.test(e));function OU(e){let t=DU(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===rU&&(n=SU(n)),n}var kU=(e,t)=>{let n=OU(e),r=OU(t);if(!n||!r)return CU(e,t);let i={...n};return e=>(i.red=TU(n.red,r.red,e),i.green=TU(n.green,r.green,e),i.blue=TU(n.blue,r.blue,e),i.alpha=wU(n.alpha,r.alpha,e),JH.transform(i))},AU=new Set([`none`,`hidden`]);function jU(e,t){return AU.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function MU(e,t){return n=>wU(e,t,n)}function NU(e){return typeof e==`number`?MU:typeof e==`string`?PH(e)?CU:iU.test(e)?kU:LU:Array.isArray(e)?PU:typeof e==`object`?iU.test(e)?kU:FU:CU}function PU(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>NU(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function FU(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=NU(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function IU(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var LU=(e,t)=>{let n=bU.createTransformer(t),r=pU(e),i=pU(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?AU.has(e)&&!i.values.length||AU.has(t)&&!r.values.length?jU(e,t):KV(PU(IU(r,i),i.values),n):(`${e}${t}`,CU(e,t))};function RU(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?wU(e,t,n):NU(e)(e,t)}var zU=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>wH.update(t,e),stop:()=>TH(t),now:()=>EH.isProcessing?EH.timestamp:AH.now()}},BU=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},VU=2e4;function HU(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function UU(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(HU(r),VU);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:XV(i)}}var WU={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function GU(e,t){return e*Math.sqrt(1-t*t)}var KU=12;function qU(e,t,n){let r=n;for(let n=1;n<KU;n++)r-=e(r)/t(r);return r}var JU=.001;function YU({duration:e=WU.duration,bounce:t=WU.bounce,velocity:n=WU.velocity,mass:r=WU.mass}){let i,a;WU.maxDuration;let o=1-t;o=zV(WU.minDamping,WU.maxDamping,o),e=zV(WU.minDuration,WU.maxDuration,XV(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=GU(t,o),c=Math.exp(-i);return JU-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=GU(t**2,o);return(-i(t)+JU>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=qU(i,a,s);if(e=YV(e),isNaN(c))return{stiffness:WU.stiffness,damping:WU.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var XU=[`duration`,`bounce`],ZU=[`stiffness`,`damping`,`mass`];function QU(e,t){return t.some(t=>e[t]!==void 0)}function $U(e){let t={velocity:WU.velocity,stiffness:WU.stiffness,damping:WU.damping,mass:WU.mass,isResolvedFromDuration:!1,...e};if(!QU(e,ZU)&&QU(e,XU)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*zV(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:WU.mass,stiffness:i,damping:a}}else{let n=YU({...e,velocity:0});t={...t,...n,mass:WU.mass},t.isResolvedFromDuration=!0}}return t}function eW(e=WU.visualDuration,t=WU.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=$U({...n,velocity:-XV(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=XV(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?WU.restSpeed.granular:WU.restSpeed.default,i||=v?WU.restDelta.granular:WU.restDelta.default;let y,b,x,S,C,w;if(h<1)x=GU(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>YV(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=YV(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=YV(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(HU(T),VU),t=BU(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}eW.applyToOptions=e=>{let t=UU(e,100,eW);return e.ease=t.ease,e.duration=YV(t.duration),e.type=`keyframes`,e};var tW=5;function nW(e,t,n){let r=Math.max(t-tW,0);return ZV(n-e(r),t-r)}function rW({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=eW({keyframes:[f.value,m(f.value)],velocity:nW(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function iW(e,t,n){let r=[],i=n||BV.mix||RU,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=KV(Array.isArray(t)?t[n]||GV:t,a)),r.push(a)}return r}function aW(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=iW(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=qV(e[r],e[r+1],n);return s[r](i)};return n?t=>l(zV(e[0],e[a-1],t)):l}function oW(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=qV(0,t,r);e.push(wU(n,1,i))}}function sW(e){let t=[0];return oW(t,e.length-1),t}function cW(e,t){return e.map(e=>e*t)}function lW(e,t){return e.map(()=>t||mH).splice(0,e.length-1)}function uW({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=hH(r)?r.map(yH):yH(r),a={done:!1,value:t[0]},o=aW(cW(n&&n.length===t.length?n:sW(t),e),t,{ease:Array.isArray(i)?i:lW(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var dW=e=>e!==null;function fW(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(dW),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var pW={decay:rW,inertia:rW,tween:uW,keyframes:uW,spring:eW};function mW(e){typeof e.type==`string`&&(e.type=pW[e.type])}var hW=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},gW=e=>e/100,_W=class extends hW{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==AH.now()&&this.tick(AH.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;mW(e);let{type:t=uW,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||uW;s!==uW&&typeof o[0]!=`number`&&(this.mixKeyframes=KV(gW,RU(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=HU(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=zV(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==rW&&(b.value=fW(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return XV(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+XV(e)}get time(){return XV(this.currentTime)}set time(e){e=YV(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return nW(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(AH.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=XV(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=zU,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(AH.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function vW(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var yW=e=>e*180/Math.PI,bW=e=>SW(yW(Math.atan2(e[1],e[0]))),xW={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bW,rotateZ:bW,skewX:e=>yW(Math.atan(e[1])),skewY:e=>yW(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},SW=e=>(e%=360,e<0&&(e+=360),e),CW=bW,wW=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),TW=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),EW={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wW,scaleY:TW,scale:e=>(wW(e)+TW(e))/2,rotateX:e=>SW(yW(Math.atan2(e[6],e[5]))),rotateY:e=>SW(yW(Math.atan2(-e[2],e[0]))),rotateZ:CW,rotate:CW,skewX:e=>yW(Math.atan(e[4])),skewY:e=>yW(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function DW(e){return+!!e.includes(`scale`)}function OW(e,t){if(!e||e===`none`)return DW(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=EW,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=xW,i=t}if(!i)return DW(t);let a=r[t],o=i[1].split(`,`).map(AW);return typeof a==`function`?a(o):o[a]}var kW=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return OW(n,t)};function AW(e){return parseFloat(e.trim())}var jW=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],MW=new Set([...jW,`pathRotation`]),NW=e=>e===LH||e===Q,PW=new Set([`x`,`y`,`z`]),FW=jW.filter(e=>!PW.has(e));function IW(e){let t=[];return FW.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var LW={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>OW(t,`x`),y:(e,{transform:t})=>OW(t,`y`)};LW.translateX=LW.x,LW.translateY=LW.y;var RW=new Set,zW=!1,BW=!1,VW=!1;function HW(){if(BW){let e=Array.from(RW).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=IW(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}BW=!1,zW=!1,RW.forEach(e=>e.complete(VW)),RW.clear()}function UW(){RW.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(BW=!0)})}function WW(){VW=!0,UW(),HW(),VW=!1}var GW=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(RW.add(this),zW||(zW=!0,wH.read(UW),wH.resolveKeyframes(HW))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}vW(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),RW.delete(this)}cancel(){this.state===`scheduled`&&(RW.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},KW=e=>e.startsWith(`--`);function qW(e,t,n){KW(t)?e.style.setProperty(t,n):e.style[t]=n}var JW={};function YW(e,t){let n=WV(e);return()=>JW[t]??n()}var XW=YW(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),ZW=YW(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),QW=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,$W={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:QW([0,.65,.55,1]),circOut:QW([.55,0,1,.45]),backIn:QW([.31,.01,.66,-.59]),backOut:QW([.33,1.53,.69,.99])};function eG(e,t){if(e)return typeof e==`function`?ZW()?BU(e,t):`ease-out`:gH(e)?QW(e):Array.isArray(e)?e.map(e=>eG(e,t)||$W.easeOut):$W[e]}function tG(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=eG(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function nG(e){return typeof e==`function`&&`applyToOptions`in e}function rG({type:e,...t}){return nG(e)&&ZW()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var iG=class extends hW{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=rG(e);this.animation=tG(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=fW(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),qW(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return XV(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+XV(e)}get time(){return XV(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=YV(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&XW()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),GV):r(this)}},aG={anticipate:cH,backInOut:sH,circInOut:dH};function oG(e){return e in aG}function sG(e){typeof e.ease==`string`&&oG(e.ease)&&(e.ease=aG[e.ease])}var cG=10,lG=class extends iG{constructor(e){sG(e),mW(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new _W({...a,autoplay:!1}),s=Math.max(cG,AH.now()-this.startTime),c=zV(0,cG,s-cG),l=o.sample(s).value,{name:u}=this.options;i&&u&&qW(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},uG=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(bU.test(e)||e===`0`)&&!e.startsWith(`url(`));function dG(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function fG(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=uG(i,t),s=uG(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:dG(e)||(n===`spring`||nG(n))&&r}function pG(e){e.duration=0,e.type=`keyframes`}var mG=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),hG=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function gG(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&hG.test(e[t]))return!0;return!1}var _G=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),vG=WV(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function yG(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return vG()&&n&&(mG.has(n)||_G.has(n)&&gG(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var bG=40,xG=class extends hW{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=AH.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||GW;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=AH.now();let u=!0;fG(e,i,a,o)||(u=!1,(BV.instantAnimations||!s)&&l?.(fW(e,n,t)),e[0]=e[e.length-1],pG(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>bG?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&yG(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new lG({...d,element:p})}catch{m=new _W(d)}else m=new _W(d);m.finished.then(()=>{this.notifyFinished()}).catch(GV),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),WW()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function SG(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var CG=30,wG=e=>!isNaN(parseFloat(e)),TG={current:void 0},EG=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=AH.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=AH.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wG(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new JV);let n=this.events[e].add(t);return e===`change`?()=>{n(),wH.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return TG.current&&TG.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=AH.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>CG)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,CG);return ZV(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function DG(e,t){return new EG(e,t)}function OG(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function kG(e,t){let n=e?.[t]??e?.default??e;return n===e?n:OG(n,e)}var AG={type:`spring`,stiffness:500,damping:25,restSpeed:10},jG=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),MG={type:`keyframes`,duration:.8},NG={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},PG=(e,{keyframes:t})=>t.length>2?MG:MW.has(e)?e.startsWith(`scale`)?jG(t[1]):AG:NG,FG=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function IG(e){for(let t in e)if(!FG.has(t))return!0;return!1}var LG=(e,t,n,r={},i,a)=>o=>{let s=kG(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=YV(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};IG(s)||Object.assign(u,PG(e,u)),u.duration&&=YV(u.duration),u.repeatDelay&&=YV(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(pG(u),u.delay===0&&(d=!0)),(BV.instantAnimations||BV.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,pG(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=fW(u.keyframes,s);if(e!==void 0){wH.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new _W(u):new xG(u)},RG=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zG(e){let t=RG.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function BG(e,t,n=1){`${e}`;let[r,i]=zG(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return VV(e)?parseFloat(e):e}return PH(i)?BG(i,t,n+1):i}function VG(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function HG(e,t,n,r){if(typeof t==`function`){let[i,a]=VG(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=VG(r);t=t(n===void 0?e.custom:n,i,a)}return t}function UG(e,t,n){let r=e.getProps();return HG(r,t,n===void 0?r.custom:n,e)}var WG=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...jW]),GG=e=>Array.isArray(e);function KG(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,DG(n))}function qG(e){return GG(e)?e[e.length-1]||0:e}function JG(e,t){let{transitionEnd:n={},transition:r={},...i}=UG(e,t)||{};i={...i,...n};for(let t in i)KG(e,t,qG(i[t]))}var YG=e=>!!(e&&e.getVelocity);function XG(e){return!!(YG(e)&&e.add)}function ZG(e,t){let n=e.getValue(`willChange`);if(XG(n))return n.add(t);if(!n&&BV.WillChange){let n=new BV.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function QG(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var $G=`data-`+QG(`framerAppearId`);function eK(e){return e.props[$G]}function tK({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function nK(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?OG(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&tK(f,t))continue;let o={delay:n,...kG(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){wH.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=eK(e);if(n){let e=window.MotionHandoffAnimation(n,t,wH);e!==null&&(o.startTime=e,p=!0)}}ZG(e,t);let m=l??e.shouldReduceMotion;r.start(LG(t,r,i,m&&WG.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>wH.update(()=>{o&&JG(e,o)});d.length?Promise.all(d).then(t):t()}return d}function rK(e,t,n={}){let r=UG(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(nK(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return iK(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function iK(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(rK(c,t,{...o,delay:n+(typeof r==`function`?0:r)+SG(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function aK(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>rK(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=rK(e,t,n);else{let i=typeof t==`function`?UG(e,t,n.custom):t;r=Promise.all(nK(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var oK={test:e=>e===`auto`,parse:e=>e},sK=e=>t=>t.test(e),cK=[LH,Q,$H,QH,tU,eU,oK],lK=e=>cK.find(sK(e));function uK(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||UV(e)}var dK=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function fK(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(VH)||[];if(!r)return e;let i=n.replace(r,``),a=+!!dK.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var pK=/\b([a-z-]*)\(.*?\)/gu,mK={...bU,getAnimatableNone:e=>{let t=e.match(pK);return t?t.map(fK).join(` `):e}},hK={...bU,getAnimatableNone:e=>{let t=bU.parse(e);return bU.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},gK={...LH,transform:Math.round},_K={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,inset:Q,insetBlock:Q,insetBlockStart:Q,insetBlockEnd:Q,insetInline:Q,insetInlineStart:Q,insetInlineEnd:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,paddingBlock:Q,paddingBlockStart:Q,paddingBlockEnd:Q,paddingInline:Q,paddingInlineStart:Q,paddingInlineEnd:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,marginBlock:Q,marginBlockStart:Q,marginBlockEnd:Q,marginInline:Q,marginInlineStart:Q,marginInlineEnd:Q,fontSize:Q,backgroundPositionX:Q,backgroundPositionY:Q,rotate:QH,pathRotation:QH,rotateX:QH,rotateY:QH,rotateZ:QH,scale:zH,scaleX:zH,scaleY:zH,scaleZ:zH,skew:QH,skewX:QH,skewY:QH,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:RH,originX:nU,originY:nU,originZ:Q,zIndex:gK,fillOpacity:RH,strokeOpacity:RH,numOctaves:gK},vK={..._K,color:iU,backgroundColor:iU,outlineColor:iU,fill:iU,stroke:iU,borderColor:iU,borderTopColor:iU,borderRightColor:iU,borderBottomColor:iU,borderLeftColor:iU,filter:mK,WebkitFilter:mK,mask:hK,WebkitMask:hK},yK=e=>vK[e],bK=new Set([mK,hK]);function xK(e,t){let n=yK(e);return bK.has(n)||(n=bU),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var SK=new Set([`auto`,`none`,`0`]);function CK(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!SK.has(t)&&pU(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=xK(n,i)}var wK=class extends GW{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),PH(r))){let i=BG(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!WG.has(n)||e.length!==2)return;let[r,i]=e,a=lK(r),o=lK(i);if(IH(r)!==IH(i)&&LW[n]){this.needsMeasurement=!0;return}if(a!==o){if(NW(a)&&NW(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else LW[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||uK(e[t]))&&n.push(t);n.length&&CK(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=LW[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=LW[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},TK=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function EK(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var DK=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function OK(e){return HV(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:kK,cancel:AK}=CH(queueMicrotask,!1),jK={x:!1,y:!1};function MK(){return jK.x||jK.y}function NK(e){return e===`x`||e===`y`?jK[e]?null:(jK[e]=!0,()=>{jK[e]=!1}):jK.x||jK.y?null:(jK.x=jK.y=!0,()=>{jK.x=jK.y=!1})}function PK(e,t){let n=EK(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function FK(e){return!(e.pointerType===`touch`||MK())}function IK(e,t,n={}){let[r,i,a]=PK(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!FK(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var LK=(e,t)=>t?e===t||LK(e,t.parentElement):!1,RK=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,zK=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function BK(e){return zK.has(e.tagName)||e.isContentEditable===!0}var VK=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function HK(e){return VK.has(e.tagName)||e.isContentEditable===!0}var UK=new WeakSet;function WK(e){return t=>{t.key===`Enter`&&e(t)}}function GK(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var KK=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=WK(()=>{if(UK.has(n))return;GK(n,`down`);let e=WK(()=>{GK(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>GK(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function qK(e){return RK(e)&&!MK()}var JK=new WeakSet;function YK(e,t,n={}){let[r,i,a]=PK(e,n),o=e=>{let r=e.currentTarget;if(!qK(e)||JK.has(e))return;UK.add(r),n.stopPropagation&&JK.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),UK.has(r)&&UK.delete(r),qK(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||LK(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),OK(e)&&(e.addEventListener(`focus`,e=>KK(e,i)),!BK(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function XK(e){return HV(e)&&`ownerSVGElement`in e}var ZK=new WeakMap,QK,$K=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:XK(r)&&`getBBox`in r?r.getBBox()[t]:r[n],eq=$K(`inline`,`width`,`offsetWidth`),tq=$K(`block`,`height`,`offsetHeight`);function nq({target:e,borderBoxSize:t}){ZK.get(e)?.forEach(n=>{n(e,{get width(){return eq(e,t)},get height(){return tq(e,t)}})})}function rq(e){e.forEach(nq)}function iq(){typeof ResizeObserver>`u`||(QK=new ResizeObserver(rq))}function aq(e,t){QK||iq();let n=EK(e);return n.forEach(e=>{let n=ZK.get(e);n||(n=new Set,ZK.set(e,n)),n.add(t),QK?.observe(e)}),()=>{n.forEach(e=>{let n=ZK.get(e);n?.delete(t),n?.size||QK?.unobserve(e)})}}var oq=new Set,sq;function cq(){sq=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};oq.forEach(t=>t(e))},window.addEventListener(`resize`,sq)}function lq(e){return oq.add(e),sq||cq(),()=>{oq.delete(e),!oq.size&&typeof sq==`function`&&(window.removeEventListener(`resize`,sq),sq=void 0)}}function uq(e,t){return typeof e==`function`?lq(e):aq(e,t)}var dq={value:null,addProjectionMetrics:null};function fq(e){return XK(e)&&e.tagName===`svg`}var pq=[...cK,iU,bU],mq=e=>pq.find(sK(e)),hq=()=>({translate:0,scale:1,origin:0,originPoint:0}),gq=()=>({x:hq(),y:hq()}),_q=()=>({min:0,max:0}),vq=()=>({x:_q(),y:_q()}),yq=new WeakMap;function bq(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function xq(e){return typeof e==`string`||Array.isArray(e)}var Sq=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Cq=[`initial`,...Sq];function wq(e){return bq(e.animate)||Cq.some(t=>xq(e[t]))}function Tq(e){return!!(wq(e)||e.variants)}function Eq(e,t,n){for(let r in t){let i=t[r],a=n[r];if(YG(i))e.addValue(r,i);else if(YG(a))e.addValue(r,DG(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,DG(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Dq={current:null},Oq={current:!1},kq=typeof window<`u`;function Aq(){if(Oq.current=!0,kq){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Dq.current=e.matches;e.addEventListener(`change`,t),t()}else Dq.current=!1}}var jq=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Mq={};function Nq(e){Mq=e}function Pq(){return Mq}var Fq=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=GW,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=AH.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,wH.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=wq(t),this.isVariantNode=Tq(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&YG(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,yq.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Oq.current||Aq(),this.shouldReduceMotion=Dq.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),TH(this.notifyUpdate),TH(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&mG.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new iG({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:YV(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=MW.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&wH.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Mq){let t=Mq[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):vq()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<jq.length;t++){let n=jq[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Eq(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=DG(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(VV(n)||UV(n))?n=parseFloat(n):!mq(n)&&bU.test(t)&&(n=xK(e,t)),this.setBaseTarget(e,YG(n)?n.get():n)),YG(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=HG(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!YG(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new JV),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){kK.render(this.render)}},Iq=class extends Fq{constructor(){super(...arguments),this.KeyframeResolver=wK}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;YG(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Lq=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Rq({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function zq({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Bq(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Vq(e){return e===void 0||e===1}function Hq({scale:e,scaleX:t,scaleY:n}){return!Vq(e)||!Vq(t)||!Vq(n)}function Uq(e){return Hq(e)||Wq(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Wq(e){return Gq(e.x)||Gq(e.y)}function Gq(e){return e&&e!==`0%`}function Kq(e,t,n){return n+t*(e-n)}function qq(e,t,n,r,i){return i!==void 0&&(e=Kq(e,i,r)),Kq(e,n,r)+t}function Jq(e,t=0,n=1,r,i){e.min=qq(e.min,t,n,r,i),e.max=qq(e.max,t,n,r,i)}function Yq(e,{x:t,y:n}){Jq(e.x,t.translate,t.scale,t.originPoint),Jq(e.y,n.translate,n.scale,n.originPoint)}var Xq=.999999999999,Zq=1.0000000000001;function Qq(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&($q(e.x,-a.scroll.offset.x),$q(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Yq(e,o)),r&&Uq(a.latestValues)&&nJ(e,a.latestValues,a.layout?.layoutBox))}t.x<Zq&&t.x>Xq&&(t.x=1),t.y<Zq&&t.y>Xq&&(t.y=1)}function $q(e,t){e.min+=t,e.max+=t}function eJ(e,t,n,r,i=.5){Jq(e,t,n,wU(e.min,e.max,i),r)}function tJ(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function nJ(e,t,n){let r=n??e;eJ(e.x,tJ(t.x,r.x),t.scaleX,t.scale,t.originX),eJ(e.y,tJ(t.y,r.y),t.scaleY,t.scale,t.originY)}function rJ(e,t){return Rq(Bq(e.getBoundingClientRect(),t))}function iJ(e,t,n){let r=rJ(e,n),{scroll:i}=t;return i&&($q(r.x,i.offset.x),$q(r.y,i.offset.y)),r}var aJ={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},oJ=jW.length;function sJ(e,t,n){let r=``,i=!0;for(let a=0;a<oJ;a++){let o=jW[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=DK(s,_K[o]);if(!c){i=!1;let t=aJ[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${DK(a,_K.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function cJ(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(MW.has(e)){o=!0;continue}if(MH(e)){i[e]=n;continue}{let t=DK(n,_K[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=sJ(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function lJ(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function uJ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var dJ={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(Q.test(e))e=parseFloat(e);else return e}return`${uJ(e,t.target.x)}% ${uJ(e,t.target.y)}%`}},fJ={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=bU.parse(e);if(i.length>5)return r;let a=bU.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=wU(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},pJ={borderRadius:{...dJ,applyTo:[...TK]},borderTopLeftRadius:dJ,borderTopRightRadius:dJ,borderBottomLeftRadius:dJ,borderBottomRightRadius:dJ,boxShadow:fJ};function mJ(e,{layout:t,layoutId:n}){return MW.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!pJ[e]||e===`opacity`)}function hJ(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(YG(r[t])||i&&YG(i[t])||mJ(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function gJ(e){return window.getComputedStyle(e)}var _J=class extends Iq{constructor(){super(...arguments),this.type=`html`,this.renderInstance=lJ}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(MW.has(t))return this.projection?.isProjecting?DW(t):kW(e,t);{let n=gJ(e),r=(MH(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return rJ(e,t)}build(e,t,n){cJ(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return hJ(e,t,n)}},vJ={offset:`stroke-dashoffset`,array:`stroke-dasharray`},yJ={offset:`strokeDashoffset`,array:`strokeDasharray`};function bJ(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?vJ:yJ;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var xJ=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function SJ(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(cJ(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of xJ)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&bJ(d,i,a,o,!1)}var CJ=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),wJ=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function TJ(e,t,n,r){lJ(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(CJ.has(n)?n:QG(n),t.attrs[n])}function EJ(e,t,n){let r=hJ(e,t,n);for(let n in e)if(YG(e[n])||YG(t[n])){let t=jW.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var DJ=class extends Iq{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=vq}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(MW.has(t)){let e=yK(t);return e&&e.default||0}return t=CJ.has(t)?t:QG(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return EJ(e,t,n)}build(e,t,n){SJ(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){TJ(e,t,n,r)}mount(e){this.isSVGTag=wJ(e.tagName),super.mount(e)}},OJ=Cq.length;function kJ(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&kJ(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<OJ;n++){let r=Cq[n],i=e.props[r];(xq(i)||i===!1)&&(t[r]=i)}return t}function AJ(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var jJ=[...Sq].reverse(),MJ=Sq.length;function NJ(e){return t=>Promise.all(t.map(({animation:t,options:n})=>aK(e,t,n)))}function PJ(e){let t=NJ(e),n=LJ(),r=!0,i=!1,a=t=>(n,r)=>{let i=UG(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=kJ(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<MJ;t++){let p=jJ[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=xq(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||bq(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=FJ(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=GG(t)&&GG(n)?!AJ(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let ee=v&&y;b&&(!ee||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!ee&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=UG(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=SG(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=UG(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=LJ(),i=!0}}}function FJ(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!AJ(t,e):!1}function IJ(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function LJ(){return{animate:IJ(!0),whileInView:IJ(),whileHover:IJ(),whileTap:IJ(),whileDrag:IJ(),whileFocus:IJ(),exit:IJ()}}function RJ(e,t){e.min=t.min,e.max=t.max}function zJ(e,t){RJ(e.x,t.x),RJ(e.y,t.y)}function BJ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var VJ=.9999,HJ=1.0001,UJ=-.01,WJ=.01;function GJ(e){return e.max-e.min}function KJ(e,t,n){return Math.abs(e-t)<=n}function qJ(e,t,n,r=.5){e.origin=r,e.originPoint=wU(t.min,t.max,e.origin),e.scale=GJ(n)/GJ(t),e.translate=wU(n.min,n.max,e.origin)-e.originPoint,(e.scale>=VJ&&e.scale<=HJ||isNaN(e.scale))&&(e.scale=1),(e.translate>=UJ&&e.translate<=WJ||isNaN(e.translate))&&(e.translate=0)}function JJ(e,t,n,r){qJ(e.x,t.x,n.x,r?r.originX:void 0),qJ(e.y,t.y,n.y,r?r.originY:void 0)}function YJ(e,t,n,r=0){e.min=(r?wU(n.min,n.max,r):n.min)+t.min,e.max=e.min+GJ(t)}function XJ(e,t,n,r){YJ(e.x,t.x,n.x,r?.x),YJ(e.y,t.y,n.y,r?.y)}function ZJ(e,t,n,r=0){let i=r?wU(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+GJ(t)}function QJ(e,t,n,r){ZJ(e.x,t.x,n.x,r?.x),ZJ(e.y,t.y,n.y,r?.y)}function $J(e,t,n,r,i){return e-=t,e=Kq(e,1/n,r),i!==void 0&&(e=Kq(e,1/i,r)),e}function eY(e,t=0,n=1,r=.5,i,a=e,o=e){if($H.test(t)&&(t=parseFloat(t),t=wU(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=wU(a.min,a.max,r);e===a&&(s-=t),e.min=$J(e.min,t,n,s,i),e.max=$J(e.max,t,n,s,i)}function tY(e,t,[n,r,i],a,o){eY(e,t[n],t[r],t[i],t.scale,a,o)}var nY=[`x`,`scaleX`,`originX`],rY=[`y`,`scaleY`,`originY`];function iY(e,t,n,r){tY(e.x,t,nY,n?n.x:void 0,r?r.x:void 0),tY(e.y,t,rY,n?n.y:void 0,r?r.y:void 0)}function aY(e){return e.translate===0&&e.scale===1}function oY(e){return aY(e.x)&&aY(e.y)}function sY(e,t){return e.min===t.min&&e.max===t.max}function cY(e,t){return sY(e.x,t.x)&&sY(e.y,t.y)}function lY(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uY(e,t){return lY(e.x,t.x)&&lY(e.y,t.y)}function dY(e){return GJ(e.x)/GJ(e.y)}function fY(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function pY(e){return[e(`x`),e(`y`)]}function mY(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var hY=TK.length,gY=e=>typeof e==`string`?parseFloat(e):e,_Y=e=>typeof e==`number`||Q.test(e);function vY(e,t,n,r,i,a){i?(e.opacity=wU(0,n.opacity??1,bY(r)),e.opacityExit=wU(t.opacity??1,0,xY(r))):a&&(e.opacity=wU(t.opacity??1,n.opacity??1,r));for(let i=0;i<hY;i++){let a=TK[i],o=yY(t,a),s=yY(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||_Y(o)===_Y(s)?(e[a]=Math.max(wU(gY(o),gY(s),r),0),($H.test(s)||$H.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=wU(t.rotate||0,n.rotate||0,r))}function yY(e,t){return e[t]===void 0?e.borderRadius:e[t]}var bY=SY(0,.5,uH),xY=SY(.5,.95,GV);function SY(e,t,n){return r=>r<e?0:r>t?1:n(qV(e,t,r))}function CY(e,t,n){let r=YG(e)?e:DG(e);return r.start(LG(``,r,t,n)),r.animation}function wY(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var TY=(e,t)=>e.depth-t.depth,EY=class{constructor(){this.children=[],this.isDirty=!1}add(e){LV(this.children,e),this.isDirty=!0}remove(e){RV(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(TY),this.isDirty=!1,this.children.forEach(e)}};function DY(e,t){let n=AH.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(TH(r),e(a-t))};return wH.setup(r,!0),()=>TH(r)}function OY(e){return YG(e)?e.get():e}var kY=class{constructor(){this.members=[]}add(e){LV(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(RV(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(RV(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},AY={hasAnimatedSinceResize:!0,hasEverUpdated:!1},jY={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},MY=[``,`X`,`Y`,`Z`],NY=1e3,PY=0;function FY(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function IY(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=eK(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,wH,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&IY(r)}function LY({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=PY++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,dq.value&&(jY.nodes=jY.calculatedTargetDeltas=jY.calculatedProjections=0),this.nodes.forEach(BY),this.nodes.forEach(YY),this.nodes.forEach(XY),this.nodes.forEach(VY),dq.addProjectionMetrics&&dq.addProjectionMetrics(jY)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new EY)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new JV),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=XK(t)&&!fq(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;wH.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=DY(i,250),AY.hasAnimatedSinceResize&&(AY.hasAnimatedSinceResize=!1,this.nodes.forEach(JY)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||rX,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!uY(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...kG(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||JY(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),TH(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ZY),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&IY(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(WY),this.nodes.forEach(UY);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(GY);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(KY),this.nodes.forEach(qY),this.nodes.forEach(RY),this.nodes.forEach(zY)):this.nodes.forEach(GY),this.clearAllSnapshots();let e=AH.now();EH.delta=zV(0,1e3/60,e-EH.timestamp),EH.timestamp=e,EH.isProcessing=!0,DH.update.process(EH),DH.preRender.process(EH),DH.render.process(EH),EH.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,kK.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(HY),this.sharedNodes.forEach(QY)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wH.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wH.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!GJ(this.snapshot.measuredBox.x)&&!GJ(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=vq(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!oY(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Uq(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),sX(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return vq();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(lX))){let{scroll:e}=this.root;e&&($q(t.x,e.offset.x),$q(t.y,e.offset.y))}return t}removeElementScroll(e){let t=vq();if(zJ(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&zJ(t,e),$q(t.x,i.offset.x),$q(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||vq();zJ(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&($q(r.x,-n.scroll.offset.x),$q(r.y,-n.scroll.offset.y)),Uq(n.latestValues)&&nJ(r,n.latestValues,n.layout?.layoutBox)}return Uq(this.latestValues)&&nJ(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=vq();zJ(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Uq(n.latestValues))continue;let r;n.instance&&(Hq(n.latestValues)&&n.updateSnapshot(),r=vq(),zJ(r,n.measurePageBox())),iY(t,n.latestValues,n.snapshot?.layoutBox,r)}return Uq(this.latestValues)&&iY(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==EH.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=EH.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=vq(),this.targetWithTransforms=vq()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),XJ(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):zJ(this.target,this.layout.layoutBox),Yq(this.target,this.targetDelta)):zJ(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),dq.value&&jY.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Hq(this.parent.latestValues)||Wq(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vq(),this.relativeTargetOrigin=vq(),QJ(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),zJ(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===EH.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;zJ(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Qq(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=vq());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(BJ(this.prevProjectionDelta.x,this.projectionDelta.x),BJ(this.prevProjectionDelta.y,this.projectionDelta.y)),JJ(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!fY(this.projectionDelta.x,this.prevProjectionDelta.x)||!fY(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),dq.value&&jY.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=gq(),this.projectionDelta=gq(),this.projectionDeltaWithTransform=gq()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=gq();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=vq(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(nX));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=wU(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=wU(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):($Y(o.x,e.x,n),$Y(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(QJ(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),tX(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&cY(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=vq(),zJ(f,this.relativeTarget)),c&&(this.animationValues=a,vY(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(TH(this.pendingAnimation),void 0),this.pendingAnimation=wH.update(()=>{AY.hasAnimatedSinceResize=!0,this.motionValue||=DG(0),this.motionValue.jump(0,!1),this.currentAnimation=CY(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(NY),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&cX(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||vq();let t=GJ(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=GJ(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}zJ(t,n),nJ(t,i),JJ(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new kY),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&FY(`z`,e,r,this.animationValues);for(let t=0;t<MY.length;t++)FY(`rotate${MY[t]}`,e,r,this.animationValues),FY(`skew${MY[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=OY(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=OY(t?.pointerEvents)||``),this.hasProjected&&!Uq(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=mY(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in pJ){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=pJ[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?OY(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(UY),this.root.sharedNodes.clear()}}}function RY(e){e.updateLayout()}function zY(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)pY(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=GJ(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;RJ(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else cX(i,t.layoutBox,n)&&pY(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=GJ(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=gq();JJ(o,n,t.layoutBox);let s=gq();a?JJ(s,e.applyTransform(r,!0),t.measuredBox):JJ(s,n,t.layoutBox);let c=!oY(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=vq();QJ(s,t.layoutBox,i.layoutBox,o);let c=vq();QJ(c,n,a.layoutBox,o),uY(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function BY(e){dq.value&&jY.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function VY(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function HY(e){e.clearSnapshot()}function UY(e){e.clearMeasurements()}function WY(e){e.isLayoutDirty=!0,e.updateLayout()}function GY(e){e.isLayoutDirty=!1}function KY(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function qY(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function JY(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YY(e){e.resolveTargetDelta()}function XY(e){e.calcProjection()}function ZY(e){e.resetSkewAndRotation()}function QY(e){e.removeLeadSnapshot()}function $Y(e,t,n){e.translate=wU(t.translate,0,n),e.scale=wU(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function eX(e,t,n,r){e.min=wU(t.min,n.min,r),e.max=wU(t.max,n.max,r)}function tX(e,t,n,r){eX(e.x,t.x,n.x,r),eX(e.y,t.y,n.y,r)}function nX(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var rX={duration:.45,ease:[.4,0,.1,1]},iX=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),aX=iX(`applewebkit/`)&&!iX(`chrome/`)?Math.round:GV;function oX(e){e.min=aX(e.min),e.max=aX(e.max)}function sX(e){oX(e.x),oX(e.y)}function cX(e,t,n){return e===`position`||e===`preserve-aspect`&&!KJ(dY(t),dY(n),.2)}function lX(e){return e!==e.root&&e.scroll?.wasRoot}var uX=LY({attachResizeListener:(e,t)=>wY(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),dX={current:void 0},fX=LY({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!dX.current){let e=new uX({});e.mount(window),e.setOptions({layoutScroll:!0}),dX.current=e}return dX.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),pX=(0,N.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function mX(e=!0){let t=(0,N.useContext)(IV);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,N.useId)();(0,N.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,N.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var hX=(0,N.createContext)({strict:!1}),gX={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},_X=!1;function vX(){if(_X)return;let e={};for(let t in gX)e[t]={isEnabled:e=>gX[t].some(t=>!!e[t])};Nq(e),_X=!0}function yX(){return vX(),Pq()}function bX(e){let t=yX();for(let n in e)t[n]={...t[n],...e[n]};Nq(t)}var xX=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function SX(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||xX.has(e)}function CX(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var wX=n((()=>{})),TX=r({default:()=>DX}),EX,DX,OX=n((()=>{wX(),EX=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,DX=CX(function(e){return EX.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),kX=e=>!SX(e);function AX(e){typeof e==`function`&&(kX=t=>t.startsWith(`on`)?!SX(t):e(t))}try{AX((OX(),t(TX)).default)}catch{}function jX(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(YG(e[i])||(kX(i)||n===!0&&SX(i)||!t&&!SX(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}var MX=(0,N.createContext)({});function NX(e,t){if(wq(e)){let{initial:t,animate:n}=e;return{initial:t===!1||xq(t)?t:void 0,animate:xq(n)?n:void 0}}return e.inherit===!1?{}:t}function PX(e){let{initial:t,animate:n}=NX(e,(0,N.useContext)(MX));return(0,N.useMemo)(()=>({initial:t,animate:n}),[FX(t),FX(n)])}function FX(e){return Array.isArray(e)?e.join(` `):e}var IX=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function LX(e,t,n){for(let r in t)!YG(t[r])&&!mJ(r,n)&&(e[r]=t[r])}function RX({transformTemplate:e},t){return(0,N.useMemo)(()=>{let n=IX();return cJ(n,t,e),Object.assign({},n.vars,n.style)},[t])}function zX(e,t){let n=e.style||{},r={};return LX(r,n,e),Object.assign(r,RX(e,t)),r}function BX(e,t){let n={},r=zX(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var VX=()=>({...IX(),attrs:{}});function HX(e,t,n,r){let i=(0,N.useMemo)(()=>{let n=VX();return SJ(n,t,wJ(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};LX(t,e.style,e),i.style={...t,...i.style}}return i}var UX=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function WX(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(UX.indexOf(e)>-1||/[A-Z]/u.test(e))}function GX(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??WX(e)?HX:BX)(t,r,i,e),c=jX(t,typeof e==`string`,a),l=e===N.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,N.useMemo)(()=>YG(u)?u.get():u,[u]);return(0,N.createElement)(e,{...l,children:d})}function KX({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:qX(n,r,i,e),renderState:t()}}function qX(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=OY(a[e]);let{initial:o,animate:s}=e,c=wq(e),l=Tq(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!bq(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=HG(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var JX=e=>(t,n)=>{let r=(0,N.useContext)(MX),i=(0,N.useContext)(IV),a=()=>KX(e,t,r,i);return n?a():PV(a)},YX=JX({scrapeMotionValuesFromProps:hJ,createRenderState:IX}),XX=JX({scrapeMotionValuesFromProps:EJ,createRenderState:VX}),ZX=Symbol.for(`motionComponentSymbol`);function QX(e,t,n){let r=(0,N.useRef)(n);(0,N.useInsertionEffect)(()=>{r.current=n});let i=(0,N.useRef)(null);return(0,N.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var $X=(0,N.createContext)({});function eZ(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function tZ(e,t,n,r,i,a){let{visualElement:o}=(0,N.useContext)(MX),s=(0,N.useContext)(hX),c=(0,N.useContext)(IV),l=(0,N.useContext)(pX),u=l.reducedMotion,d=l.skipAnimations,f=(0,N.useRef)(null),p=(0,N.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,N.useContext)($X);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&nZ(f.current,n,i,h);let g=(0,N.useRef)(!1);(0,N.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[$G],v=(0,N.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return FV(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,N.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function nZ(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:rZ(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&eZ(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function rZ(e){if(e)return e.options.allowProjection===!1?rZ(e.parent):e.projection}function iZ(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&bX(r);let a=n?n===`svg`:WX(e),o=a?XX:YX;function s(n,s){let c,l={...(0,N.useContext)(pX),...n,layoutId:aZ(n)},{isStatic:u}=l,d=PX(n),f=o(n,u);if(!u&&typeof window<`u`){oZ(l,r);let t=sZ(l);c=t.MeasureLayout,d.visualElement=tZ(e,f,l,i,t.ProjectionNode,a)}return(0,M.jsxs)(MX.Provider,{value:d,children:[c&&d.visualElement?(0,M.jsx)(c,{visualElement:d.visualElement,...l}):null,GX(e,n,QX(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,N.forwardRef)(s);return c[ZX]=e,c}function aZ({layoutId:e}){let t=(0,N.useContext)(NV).id;return t&&e!==void 0?t+`-`+e:e}function oZ(e,t){(0,N.useContext)(hX).strict}function sZ(e){let{drag:t,layout:n}=yX();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function cZ(e,t){if(typeof Proxy>`u`)return iZ;let n=new Map,r=(n,r)=>iZ(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,iZ(a,void 0,e,t)),n.get(a))})}var lZ=(e,t)=>t.isSVG??WX(e)?new DJ(t):new _J(t,{allowProjection:e!==N.Fragment}),uZ=class extends Lq{constructor(e){super(e),e.animationState||=PJ(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();bq(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},dZ=0,fZ={animation:{Feature:uZ},exit:{Feature:class extends Lq{constructor(){super(...arguments),this.id=dZ++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=UG(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function pZ(e){return{point:{x:e.pageX,y:e.pageY}}}var mZ=e=>t=>RK(t)&&e(t,pZ(t));function hZ(e,t,n,r){return wY(e,t,mZ(n),r)}var gZ=({current:e})=>e?e.ownerDocument.defaultView:null,_Z=(e,t)=>Math.abs(e-t);function vZ(e,t){let n=_Z(e.x,t.x),r=_Z(e.y,t.y);return Math.sqrt(n**2+r**2)}var yZ=new Set([`auto`,`scroll`]),bZ=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=xZ(this.lastRawMoveEventInfo,this.transformPagePoint));let e=CZ(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=vZ(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=EH;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=xZ(t,this.transformPagePoint),wH.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=CZ(e.type===`pointercancel`?this.lastMoveEventInfo:xZ(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!RK(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=xZ(pZ(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=EH;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,CZ(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=KV(hZ(this.contextWindow,`pointermove`,this.handlePointerMove,d),hZ(this.contextWindow,`pointerup`,this.handlePointerUp,d),hZ(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(yZ.has(e.overflowX)||yZ.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),wH.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),TH(this.updatePoint)}};function xZ(e,t){return t?{point:t(e.point)}:e}function SZ(e,t){return{x:e.x-t.x,y:e.y-t.y}}function CZ({point:e},t){return{point:e,delta:SZ(e,TZ(t)),offset:SZ(e,wZ(t)),velocity:EZ(t,.1)}}function wZ(e){return e[0]}function TZ(e){return e[e.length-1]}function EZ(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=TZ(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>YV(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>YV(t)*2&&(r=e[1]);let a=XV(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function DZ(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?wU(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?wU(n,e,r.max):Math.min(e,n)),e}function OZ(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function kZ(e,{top:t,left:n,bottom:r,right:i}){return{x:OZ(e.x,n,i),y:OZ(e.y,t,r)}}function AZ(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function jZ(e,t){return{x:AZ(e.x,t.x),y:AZ(e.y,t.y)}}function MZ(e,t){let n=.5,r=GJ(e),i=GJ(t);return i>r?n=qV(t.min,t.max-r,e.min):r>i&&(n=qV(e.min,e.max-i,t.min)),zV(0,1,n)}function NZ(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var PZ=.35;function FZ(e=PZ){return e===!1?e=0:e===!0&&(e=PZ),{x:IZ(e,`left`,`right`),y:IZ(e,`top`,`bottom`)}}function IZ(e,t,n){return{min:LZ(e,t),max:LZ(e,n)}}function LZ(e,t){return typeof e==`number`?e:e[t]||0}var RZ=new WeakMap,zZ=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=vq(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(pZ(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=NK(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pY(e=>{let t=this.getAxisMotionValue(e).get()||0;if($H.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=GJ(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&wH.update(()=>i(e,t),!1,!0),ZG(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=UZ(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&wH.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new bZ(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:gZ(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&wH.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!HZ(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=DZ(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&eZ(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?kZ(n.layoutBox,e):!1,this.elastic=FZ(t),r!==this.constraints&&!eZ(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&pY(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=NZ(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!eZ(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=iJ(n,r.root,this.visualElement.getTransformPagePoint()),a=jZ(r.layout.layoutBox,i);if(t){let e=t(zq(a));this.hasMutatedConstraints=!!e,e&&(a=Rq(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=pY(o=>{if(!HZ(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return ZG(this.visualElement,e),n.start(LG(e,n,0,t,this.visualElement,!1))}stopAnimation(){pY(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){pY(t=>{let{drag:n}=this.getProps();if(!HZ(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-wU(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!eZ(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};pY(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=MZ({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),pY(t=>{if(!HZ(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(wU(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;RZ.set(this.visualElement,this);let e=this.visualElement.current,t=hZ(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&HK(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();eZ(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=VZ(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),wH.read(r);let o=wY(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(pY(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=PZ,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function BZ(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function VZ(e,t,n){let r=uq(e,BZ(n)),i=uq(t,BZ(n));return()=>{r(),i()}}function HZ(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function UZ(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var WZ=class extends Lq{constructor(e){super(e),this.removeGroupControls=GV,this.removeListeners=GV,this.controls=new zZ(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||GV}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},GZ=e=>(t,n)=>{e&&wH.update(()=>e(t,n),!1,!0)},KZ=class extends Lq{constructor(){super(...arguments),this.removePointerDownListener=GV}onPointerDown(e){this.session=new bZ(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gZ(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:GZ(e),onStart:GZ(t),onMove:GZ(n),onEnd:(e,t)=>{delete this.session,r&&wH.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=hZ(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},qZ=!1,JZ=class extends N.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),qZ&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),AY.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),qZ=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||wH.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),kK.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;qZ=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function YZ(e){let[t,n]=mX(),r=(0,N.useContext)(NV);return(0,M.jsx)(JZ,{...e,layoutGroup:r,switchLayoutGroup:(0,N.useContext)($X),isPresent:t,safeToRemove:n})}var XZ={pan:{Feature:KZ},drag:{Feature:WZ,ProjectionNode:fX,MeasureLayout:YZ}};function ZZ(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&wH.postRender(()=>i(t,pZ(t)))}var QZ=class extends Lq{mount(){let{current:e}=this.node;e&&(this.unmount=IK(e,(e,t)=>(ZZ(this.node,t,`Start`),e=>ZZ(this.node,e,`End`))))}unmount(){}},$Z=class extends Lq{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=KV(wY(this.node.current,`focus`,()=>this.onFocus()),wY(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function eQ(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&wH.postRender(()=>i(t,pZ(t)))}var tQ=class extends Lq{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=YK(e,(e,t)=>(eQ(this.node,t,`Start`),(e,{success:t})=>eQ(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},nQ=new WeakMap,rQ=new WeakMap,iQ=e=>{let t=nQ.get(e.target);t&&t(e)},aQ=e=>{e.forEach(iQ)};function oQ({root:e,...t}){let n=e||document;rQ.has(n)||rQ.set(n,{});let r=rQ.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(aQ,{root:e,...t})),r[i]}function sQ(e,t,n){let r=oQ(t);return nQ.set(e,n),r.observe(e),()=>{nQ.delete(e),r.unobserve(e)}}var cQ={some:0,all:1},lQ=class extends Lq{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:cQ[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=sQ(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(uQ(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function uQ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var dQ={inView:{Feature:lQ},tap:{Feature:tQ},focus:{Feature:$Z},hover:{Feature:QZ}},fQ={layout:{ProjectionNode:fX,MeasureLayout:YZ}},pQ=cZ({...fZ,...dQ,...XZ,...fQ},lZ),mQ=new Map,hQ=e=>{let t=mQ.get(e);return t||(t=pQ.create(e),mQ.set(e,t)),t},gQ=(0,N.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=hQ(t),o=(0,N.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,M.jsx)(a,{animate:{backgroundPosition:`0% center`},className:j(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,n),initial:{backgroundPosition:`100% center`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))`},transition:{duration:r,ease:`linear`,repeat:1/0},children:e})}),_Q=(0,N.createContext)(null),vQ=()=>{let e=(0,N.useContext)(_Q);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e},yQ=1e3,bQ=1e3,xQ=(0,N.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r,onOpenChange:i,duration:a,children:o,...s})=>{let c=r??t,l=r===!1,[u,d]=iV({defaultProp:c,onChange:i,prop:n}),[f,p]=iV({defaultProp:void 0,prop:a}),m=(0,N.useRef)(t),[h,g]=(0,N.useState)(!1),_=(0,N.useRef)(null);(0,N.useEffect)(()=>{t?(m.current=!0,_.current===null&&(_.current=Date.now())):_.current!==null&&(p(Math.ceil((Date.now()-_.current)/bQ)),_.current=null)},[t,p]),(0,N.useEffect)(()=>{t&&!u&&!l&&d(!0)},[t,u,d,l]),(0,N.useEffect)(()=>{if(m.current&&!t&&u&&!h){let e=setTimeout(()=>{d(!1),g(!0)},yQ);return()=>clearTimeout(e)}},[t,u,d,h]);let v=(0,N.useCallback)(e=>{d(e)},[d]),y=(0,N.useMemo)(()=>({duration:f,isOpen:u,isStreaming:t,setIsOpen:d}),[f,u,t,d]);return(0,M.jsx)(_Q.Provider,{value:y,children:(0,M.jsx)(AV,{className:j(`not-prose mb-4`,e),onOpenChange:v,open:u,...s,children:o})})}),SQ=(e,t)=>e||t===0?(0,M.jsx)(gQ,{duration:1,children:`Thinking...`}):t===void 0?(0,M.jsx)(`p`,{children:`Thought for a few seconds`}):(0,M.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]}),CQ=(0,N.memo)(({className:e,children:t,getThinkingMessage:n=SQ,...r})=>{let{isStreaming:i,isOpen:a,duration:o}=vQ();return(0,M.jsx)(jV,{className:j(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...r,children:t??(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Je,{className:`size-4`}),n(i,o),(0,M.jsx)(ge,{className:j(`size-4 transition-transform`,a?`rotate-180`:`rotate-0`)})]})})}),wQ=(0,N.memo)(({className:e,children:t,...n})=>(0,M.jsx)(MV,{className:j(`mt-4 text-sm`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n,children:(0,M.jsx)(gI,{children:t})}));xQ.displayName=`Reasoning`,CQ.displayName=`ReasoningTrigger`,wQ.displayName=`ReasoningContent`;var TQ={"approval-requested":(0,M.jsx)(ze,{className:`size-4 text-yellow-600`}),"approval-responded":(0,M.jsx)(Ye,{className:`size-4 text-blue-600`}),"input-available":(0,M.jsx)(ze,{className:`size-4 animate-pulse`}),"input-streaming":(0,M.jsx)(me,{className:`size-4`}),"output-available":(0,M.jsx)(Ye,{className:`size-4 text-green-600`}),"output-denied":(0,M.jsx)(Xe,{className:`size-4 text-orange-600`}),"output-error":(0,M.jsx)(Xe,{className:`size-4 text-red-600`})};function EQ(e){return(0,M.jsx)(Ge,{className:`gap-1.5 text-xs`,variant:`secondary`,children:TQ[e]})}var DQ=({className:e,...t})=>(0,M.jsx)(AV,{className:j(`group not-prose mb-4 w-full rounded-sm border`,e),...t}),OQ={run_commands:(0,M.jsx)(ut,{className:`size-4`}),read_files:(0,M.jsx)(Qe,{className:`size-4`}),editor:(0,M.jsx)(Be,{className:`size-4`}),ask_question:(0,M.jsx)(nt,{className:`size-4`})},kQ=e=>(0,M.jsx)(Ge,{className:`text-xs`,variant:`ghost`,children:e&&OQ[e]||(0,M.jsx)(He,{className:`size-4`})}),AQ=({className:e,title:t,type:n,state:r,toolName:i,...a})=>{let o=t?.split(`:`),s=o?.[0]||i,c=o?.[1],l=s||t||n.split(`-`).slice(1).join(`-`);return(0,M.jsx)(jV,{className:j(`flex w-full overflow-hidden items-center justify-between gap-4 p-3 cursor-pointer`,e),...a,children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[kQ(l),(0,M.jsx)(`span`,{className:`font-light text-muted-foreground text-sm truncated wrap-break-word ellipses`,children:c}),EQ(r)]})})},jQ=({className:e,...t})=>(0,M.jsx)(MV,{className:j(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-1 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in overflow-hidden font-mono`,e),...t}),MQ=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let i=(0,M.jsx)(`div`,{children:t});return typeof t==`object`&&!(0,N.isValidElement)(t)?i=(0,M.jsx)(cI,{code:JSON.stringify(t,null,2),language:`json`}):typeof t==`string`&&(i=(0,M.jsx)(cI,{code:t,language:`json`})),(0,M.jsx)(`div`,{className:j(`space-y-2`,e),...r,children:(0,M.jsxs)(`div`,{className:j(`overflow-auto rounded-md text-xs [&_table]:w-full max-h-20`,n?`bg-destructive/10 text-destructive`:`bg-muted/50 text-foreground`),children:[n&&(0,M.jsx)(`div`,{children:n}),i]})})},NQ=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`text-muted-foreground text-sm`,t),...n,children:e}),PQ=({defaultOpen:e=!0,className:t,...n})=>(0,M.jsx)(AV,{className:j(t),defaultOpen:e,...n}),FQ=({children:e,className:t,title:n,...r})=>(0,M.jsx)(jV,{className:j(`group`,t),...r,children:e??(0,M.jsxs)(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,children:[(0,M.jsx)(h,{className:`size-4`}),(0,M.jsx)(`p`,{className:`text-sm`,children:n}),(0,M.jsx)(ge,{className:`size-4 transition-transform group-data-[state=open]:rotate-180`})]})}),IQ=({children:e,className:t,...n})=>(0,M.jsx)(MV,{className:j(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,t),...n,children:(0,M.jsx)(`div`,{className:`mt-4 space-y-2 border-muted border-l-2 pl-4`,children:e})});function LQ(e){return typeof e==`object`&&e?e:void 0}function $(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function RQ(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):void 0}function zQ(e){return e===`output-error`?`Failed`:e===`output-available`?`Done`:`Running`}function BQ(e){let t=LQ(e.input),n=LQ(e.output),r=zQ(e.state);switch(e.name){case`team_spawn_teammate`:return`${r} spawn teammate ${$(t?.agentId)??$(n?.agentId)??`agent`}`;case`team_shutdown_teammate`:return`${r} shutdown teammate ${$(t?.agentId)??$(n?.agentId)??`agent`}`;case`team_status`:return`${r} fetch team status`;case`team_task`:{let e=$(t?.action);return e===`create`?`${r} create task ${$(n?.taskId)??``}${$(t?.title)?`: ${$(t?.title)}`:``}`.trim():e===`list`?`${r} list team tasks`:e===`claim`?`${r} claim task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():e===`complete`?`${r} complete task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():e===`block`?`${r} block task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():`${r} update team task`}case`team_run_task`:{let e=$(t?.agentId)??$(n?.agentId)??`agent`,i=$(n?.mode)??$(t?.runMode),a=$(n?.status),o=$(t?.task),s=o?`: ${o}`:``;return`${r} ${i===`async`?`queue`:a===`joined`?`join`:`run`} task with ${e}${a?` (${a})`:``}${s}`}case`team_cancel_run`:return`${r} cancel run ${$(t?.runId)??$(n?.runId)??``}`.trim();case`team_list_runs`:return`${r} list teammate runs`;case`team_await_run`:return`${r} await run ${$(t?.runId)??``}`.trim();case`team_await_all_runs`:return`${r} await all active runs`;case`team_send_message`:return`${r} message ${$(t?.toAgentId)??$(n?.toAgentId)??`agent`}${$(t?.subject)?`: ${$(t?.subject)}`:``}`;case`team_broadcast`:return`${r} broadcast${$(t?.subject)?`: ${$(t?.subject)}`:``}`;case`team_read_mailbox`:return`${r} read mailbox`;case`team_mission_log`:return`${r} log ${$(t?.kind)??`update`}${$(t?.summary)?`: ${$(t?.summary)}`:``}`;case`team_cleanup`:return`${r} clean up team runtime`;case`team_create_outcome`:return`${r} create outcome${$(t?.title)?`: ${$(t?.title)}`:``}`;case`team_attach_outcome_fragment`:return`${r} attach fragment to ${$(t?.section)??`section`}`;case`team_review_outcome_fragment`:return`${r} ${t?.approved===!1?`reject`:`review`} fragment ${$(t?.fragmentId)??``}`.trim();case`team_finalize_outcome`:return`${r} finalize outcome ${$(t?.outcomeId)??$(n?.outcomeId)??``}`.trim();case`team_list_outcomes`:return`${r} list outcomes`;default:return`${r} ${e.name.replace(/^team_/,``).replaceAll(`_`,` `)}`}}function VQ(e){if(e.error)return e.error;let t=LQ(e.input),n=LQ(e.output);switch(e.name){case`team_task`:{let e=$(t?.action);if(e===`create`)return $(t?.description);if(e===`block`)return $(t?.reason);if(e===`list`){let e=Array.isArray(n?.tasks)?n.tasks.length:void 0;return typeof e==`number`?`${e} task${e===1?``:`s`}`:void 0}return}case`team_run_task`:return $(n?.message)??$(n?.runId)??$(n?.text);case`team_send_message`:case`team_broadcast`:return $(t?.body);case`team_mission_log`:return $(t?.nextAction)??$(t?.summary);case`team_attach_outcome_fragment`:return $(t?.content);case`team_status`:{let e=Array.isArray(n?.members)?n.members.length:void 0,t=Array.isArray(n?.tasks)?n.tasks.length:void 0,r=Array.isArray(n?.runs)?n.runs.length:void 0;return[typeof e==`number`?`${e} members`:void 0,typeof t==`number`?`${t} tasks`:void 0,typeof r==`number`?`${r} runs`:void 0].filter(Boolean).join(` • `)||void 0}case`team_list_runs`:{let t=Array.isArray(e.output)?e.output:void 0;return t?.length?`${t.length} run${t.length===1?``:`s`}`:`No runs`}case`team_read_mailbox`:{let t=Array.isArray(e.output)?e.output:void 0;return t?.length?`${t.length} message${t.length===1?``:`s`}`:`No messages`}case`team_create_outcome`:{let e=RQ(t?.requiredSections);return e?.length?e.join(`, `):void 0}default:return}}function HQ({className:e,defaultOpen:t=!0,events:n,...r}){if(n.length===0)return null;let i=n.length===1?`Team activity`:`Team activity (${n.length})`;return(0,M.jsxs)(PQ,{className:e,defaultOpen:t,...r,children:[(0,M.jsx)(FQ,{title:i,children:(0,M.jsxs)(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,children:[(0,M.jsx)(dt,{className:`size-4`}),(0,M.jsx)(`p`,{className:`text-sm`,children:i})]})}),(0,M.jsx)(IQ,{children:n.map(e=>{let t=VQ(e);return(0,M.jsxs)(NQ,{className:`space-y-1`,children:[(0,M.jsx)(`div`,{children:BQ(e)}),t?(0,M.jsx)(`div`,{className:`line-clamp-3 text-xs text-muted-foreground/90`,children:t}):null]},e.id)})})]})}function UQ(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);var WQ=1,GQ=100,KQ=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:WQ++,qQ=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-GQ;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=KQ(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],N.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(YQ(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=KQ(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},JQ=(e,t)=>qQ.message(e,t),YQ=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,XQ=Object.assign(JQ,{success:qQ.success,info:qQ.info,warning:qQ.warning,error:qQ.error,custom:qQ.custom,message:qQ.message,promise:qQ.promise,dismiss:qQ.dismiss,loading:qQ.loading},{getHistory:()=>qQ.toasts,getToasts:()=>qQ.getActiveToasts()});UQ(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);var ZQ={audio:rt,document:Le,image:ue,source:et,unknown:it,video:ft},QQ=e=>{if(e.type===`source-document`)return`source`;let t=e.mediaType??``;return t.startsWith(`image/`)?`image`:t.startsWith(`video/`)?`video`:t.startsWith(`audio/`)?`audio`:t.startsWith(`application/`)||t.startsWith(`text/`)?`document`:`unknown`},$Q=(e,t,n)=>n?(0,M.jsx)(`img`,{alt:t||`Image`,className:`size-full object-cover`,height:96,src:e,width:96}):(0,M.jsx)(`img`,{alt:t||`Image`,className:`size-full rounded object-cover`,height:20,src:e,width:20}),e$=(0,N.createContext)(null),t$=(0,N.createContext)(null),n$=()=>(0,N.useContext)(e$)??{variant:`grid`},r$=()=>{let e=(0,N.useContext)(t$);if(!e)throw Error(`Attachment components must be used within <Attachment>`);return e},i$=({variant:e=`grid`,className:t,children:n,...r})=>{let i=(0,N.useMemo)(()=>({variant:e}),[e]);return(0,M.jsx)(e$.Provider,{value:i,children:(0,M.jsx)(`div`,{className:j(`flex items-start`,e===`list`?`flex-col gap-2`:`flex-wrap gap-2`,e===`grid`&&`ml-auto w-fit`,t),...r,children:n})})},a$=({data:e,onRemove:t,className:n,children:r,...i})=>{let{variant:a}=n$(),o=QQ(e),s=(0,N.useMemo)(()=>({data:e,mediaCategory:o,onRemove:t,variant:a}),[e,o,t,a]);return(0,M.jsx)(t$.Provider,{value:s,children:(0,M.jsx)(`div`,{className:j(`group relative`,a===`grid`&&`size-24 overflow-hidden rounded-lg`,a===`inline`&&[`flex h-8 cursor-pointer select-none items-center gap-1.5`,`rounded-md border border-border px-1.5`,`font-medium text-sm transition-all`,`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`],a===`list`&&[`flex w-full items-center gap-3 rounded-lg border p-3`,`hover:bg-accent/50`],n),...i,children:r})})},o$=({fallbackIcon:e,className:t,...n})=>{let{data:r,mediaCategory:i,variant:a}=r$(),o=a===`inline`?`size-3`:`size-4`,s=e=>(0,M.jsx)(e,{className:j(o,`text-muted-foreground`)}),c=()=>{if(i===`image`&&r.type===`file`&&r.url)return $Q(r.url,r.filename,a===`grid`);if(i===`video`&&r.type===`file`&&r.url)return(0,M.jsx)(`video`,{className:`size-full object-cover`,muted:!0,src:r.url});let t=ZQ[i];return e??s(t)};return(0,M.jsx)(`div`,{className:j(`flex shrink-0 items-center justify-center overflow-hidden`,a===`grid`&&`size-full bg-muted`,a===`inline`&&`size-5 rounded bg-background`,a===`list`&&`size-12 rounded bg-muted`,t),...n,children:c()})},s$=({label:e=`Remove`,className:t,children:n,...r})=>{let{onRemove:i,variant:a}=r$(),o=(0,N.useCallback)(e=>{e.stopPropagation(),i?.()},[i]);return i?(0,M.jsxs)(A,{"aria-label":e,className:j(a===`grid`&&[`absolute top-2 right-2 size-6 rounded-full p-0`,`bg-background/80 backdrop-blur-sm`,`opacity-0 transition-opacity group-hover:opacity-100`,`hover:bg-background`,`[&>svg]:size-3`],a===`inline`&&[`size-5 rounded p-0`,`opacity-0 transition-opacity group-hover:opacity-100`,`[&>svg]:size-2.5`],a===`list`&&[`size-8 shrink-0 rounded p-0`,`[&>svg]:size-4`],t),onClick:o,type:`button`,variant:`ghost`,...r,children:[n??(0,M.jsx)(le,{}),(0,M.jsx)(`span`,{className:`sr-only`,children:e})]}):null},c$=e=>(0,M.jsx)(ve,{...e}),l$=e=>(0,M.jsx)(Ce,{...e}),u$=({className:e,children:t,title:n=`Model Selector`,...r})=>(0,M.jsxs)(Se,{"aria-describedby":void 0,className:j(`outline! border-none! p-0 outline-border! outline-solid!`,e),...r,children:[(0,M.jsx)(Ee,{className:`sr-only`,children:n}),(0,M.jsx)(wB,{className:`**:data-[slot=command-input-wrapper]:h-auto`,children:t})]}),d$=({className:e,...t})=>(0,M.jsx)(TB,{className:j(`h-auto py-3.5`,e),...t}),f$=e=>(0,M.jsx)(EB,{...e}),p$=e=>(0,M.jsx)(DB,{...e}),m$=e=>(0,M.jsx)(OB,{...e}),h$=e=>(0,M.jsx)(kB,{...e}),g$=({provider:e,className:t,...n})=>(0,M.jsx)(`img`,{...n,alt:`${e} logo`,className:j(`size-3 dark:invert`,t),height:12,src:`https://models.dev/logos/${e}.svg`,width:12}),_$=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`flex shrink-0 items-center -space-x-1 [&>img]:rounded-full [&>img]:bg-background [&>img]:p-px [&>img]:ring-1 dark:[&>img]:bg-foreground`,e),...t}),v$=({className:e,...t})=>(0,M.jsx)(`span`,{className:j(`flex-1 truncate text-left`,e),...t});function y$(){let e=zB();return e.files.length===0?null:(0,M.jsx)(i$,{variant:`inline`,children:e.files.map(t=>(0,M.jsxs)(a$,{data:t,onRemove:()=>e.remove(t.id),children:[(0,M.jsx)(o$,{}),(0,M.jsx)(s$,{})]},t.id))})}function b$({autoApproveTools:e,enableSpawn:t,enableTeams:n,model:r,modelSelectorOpen:i,models:a,onAutoApproveToolsChange:o,onEnableSpawnChange:s,onEnableTeamsChange:c,onModelChange:l,onModelSelectorOpenChange:u,onProviderChange:d,provider:f,providers:p,workspaceRoot:m}){let h=p.find(e=>e.id===f),_=a.find(e=>e.id===r)??a[0]??void 0;return(0,M.jsxs)(`div`,{className:`grid gap-3 bg-background/70 p-3`,children:[(0,M.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(Oe,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,children:`Provider`}),(0,M.jsxs)(be,{onValueChange:e=>{e&&d(e)},value:f,children:[(0,M.jsx)(ke,{className:`w-full`,children:(0,M.jsx)(Ae,{placeholder:`Select provider`})}),(0,M.jsx)(ye,{children:p.map(e=>(0,M.jsx)(_e,{value:e.id,children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x$(e.id),(0,M.jsx)(`span`,{children:e.name})]})},e.id))})]})]}),(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(Oe,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,children:`Model`}),(0,M.jsxs)(c$,{onOpenChange:u,open:i,children:[(0,M.jsx)(l$,{children:(0,M.jsx)(A,{className:`w-full justify-between`,variant:`outline`,children:(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[h&&x$(h.id),(0,M.jsx)(`span`,{className:`truncate`,children:_?.name||_?.id||`Select model`})]})})}),(0,M.jsxs)(u$,{children:[(0,M.jsx)(d$,{placeholder:`Search models...`}),(0,M.jsxs)(f$,{children:[(0,M.jsx)(p$,{children:`No models found.`}),(0,M.jsx)(m$,{heading:h?.name||`Models`,children:a.map(e=>(0,M.jsxs)(h$,{onSelect:()=>{l(e.id),u(!1)},value:e.id,children:[h&&x$(h.id),(0,M.jsx)(v$,{children:e.name||e.id}),(0,M.jsx)(_$,{children:h&&x$(h.id)}),r===e.id?(0,M.jsx)(g,{className:`ml-auto size-4`}):(0,M.jsx)(`div`,{className:`ml-auto size-4`})]},e.id))})]})]})]})]})]}),(0,M.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(Oe,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,htmlFor:`workspace-root`,children:`Workspace`}),(0,M.jsx)(E,{id:`workspace-root`,readOnly:!0,value:m})]})}),(0,M.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,M.jsx)(S$,{checked:t,label:`Subagents`,onChange:s}),(0,M.jsx)(S$,{checked:n,label:`Agent Teams`,onChange:c}),(0,M.jsx)(S$,{checked:e,label:`Auto-approves`,onChange:o})]})]})}function x$(e){return(0,M.jsx)(g$,{className:`size-3.5`,provider:e||`openai`})}function S$({checked:e,label:t,onChange:n,disabled:r}){return(0,M.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border bg-background/60 px-3 py-2`,children:[(0,M.jsx)(Oe,{className:`text-sm`,htmlFor:t,children:t}),(0,M.jsx)(Pe,{checked:e,id:t,onCheckedChange:e=>n(e),disabled:r})]})}var C$={None:`none`,Low:`low`,Medium:`medium`,High:`high`},w$=[{value:C$.None,label:`Thinking Off`,icon:st},{value:C$.Low,label:`Low`,icon:ot},{value:C$.Medium,label:`Medium`,icon:ct},{value:C$.High,label:`High`,icon:st}];function T$({autoApproveTools:e,disabled:t=!1,enableSpawn:n,enableTeams:r,enableTools:i,maxIterations:a,model:o,mode:s,modelSelectorOpen:c,models:l,onAbort:u,onAutoApproveToolsChange:d,onEnableSpawnChange:f,onEnableTeamsChange:p,onEnableToolsChange:m,onModeChange:h,onMaxIterationsChange:g,onModelChange:_,onModelSelectorOpenChange:v,onProviderChange:y,onSend:b,onSystemPromptChange:x,onReasonLevelChange:S,provider:C,providers:w,sending:T,status:E,systemPrompt:ee,reasonLevel:D,workspaceRoot:te}){let[O,ne]=(0,N.useState)(!1),k=PB(),re=zB(),ie=l.find(e=>e.id===o)?.supportsThinking===!0,ae=ie?D:C$.None,oe=Math.max(w$.findIndex(e=>e.value===ae),0),se=w$[oe].icon;return(0,M.jsx)(`div`,{className:`border-t bg-background`,children:(0,M.jsxs)(VB,{accept:`image/*,.txt,.md,.json,.ts,.tsx,.js,.jsx`,globalDrop:!0,className:`rounded-none [&>[data-slot=input-group]]:border-0! [&>[data-slot=input-group]]:ring-0! [&>[data-slot=input-group]]:has-[[data-slot=input-group-control]:focus-visible]:border-0! [&>[data-slot=input-group]]:has-[[data-slot=input-group-control]:focus-visible]:ring-0!`,maxFiles:8,multiple:!0,onError:e=>XQ.error(e.message),onSubmit:async e=>{let t=e.text.trim();if(!t&&!e.files.length)return;let n;if(e.files.length>0){let t=(await Promise.all(e.files.map(e=>E$(e.url)))).filter(e=>!!e);t.length>0&&(n={userImages:t}),t.length!==e.files.length&&XQ.warning(`Only image attachments are currently sent in the VS Code chat runtime.`)}!t&&!n?.userImages?.length||b({prompt:t,attachments:n,attachmentCount:e.files.length})},children:[(0,M.jsx)(WB,{children:(0,M.jsx)(y$,{})}),(0,M.jsx)(HB,{children:(0,M.jsx)(UB,{disabled:t||E.includes(`Failed`),onChange:e=>k.textInput.setInput(e.target.value),placeholder:`Type @ for context and / for skills`,value:k.textInput.value,className:`text-sm outline-none ring-0`})}),(0,M.jsxs)(GB,{className:`flex-col items-stretch gap-1 px-0`,children:[O?(0,M.jsx)(b$,{autoApproveTools:e,enableSpawn:n,enableTeams:r,enableTools:i,maxIterations:a,model:o,modelSelectorOpen:c,models:l,onAutoApproveToolsChange:d,onEnableSpawnChange:f,onEnableTeamsChange:p,onEnableToolsChange:m,onMaxIterationsChange:g,onModelChange:_,onModelSelectorOpenChange:v,onProviderChange:y,onSystemPromptChange:x,provider:C,providers:w,systemPrompt:ee,workspaceRoot:te}):null,(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,M.jsxs)(KB,{className:`shrink-0`,children:[(0,M.jsx)(qB,{disabled:t,onClick:()=>re.openFileDialog(),type:`button`,variant:`ghost`,children:(0,M.jsx)(it,{className:`size-3`})}),(0,M.jsxs)(qB,{disabled:t,onClick:()=>ne(e=>!e),type:`button`,variant:O?`default`:`ghost`,children:[(0,M.jsx)(at,{className:`size-3`}),(0,M.jsxs)(`span`,{children:[C,`:`,o]})]}),(0,M.jsx)(qB,{disabled:t||!ie,onClick:()=>{S(w$[(oe+1)%w$.length].value)},type:`button`,title:w$[oe].label,variant:ae===C$.None?`ghost`:`default`,children:(0,M.jsx)(se,{className:`size-3`})}),(0,M.jsxs)(qB,{disabled:t,onClick:()=>h(s===`act`?`plan`:`act`),type:`button`,variant:s===`plan`?`default`:`ghost`,className:`hidden`,children:[s===`act`?(0,M.jsx)(Ne,{className:`size-3`}):(0,M.jsx)(tt,{className:`size-3`}),s]}),(0,M.jsx)(Ge,{className:`rounded-sm px-3 py-1 text-xs hidden`,variant:E.includes(`Error`)?`destructive`:`secondary`,children:E})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[T?(0,M.jsx)(A,{onClick:u,type:`button`,variant:`destructive`,children:`Abort`}):null,(0,M.jsx)(JB,{disabled:t||E.includes(`Failed`),status:T?`submitted`:`ready`,variant:`ghost`})]})]})]})]})})}async function E$(e){if(e){if(e.startsWith(`data:image/`))return e;if(e.startsWith(`blob:`))try{let t=await(await fetch(e)).blob();return t.type.startsWith(`image/`)?await new Promise(e=>{let n=new FileReader;n.onloadend=()=>{e(typeof n.result==`string`?n.result:void 0)},n.onerror=()=>e(void 0),n.readAsDataURL(t)}):void 0}catch{return}}}var D$=r({default:()=>r1}),O$={lastProvider:``,lastModelByProvider:{}};function k$(){try{let e=ae()?.getState();if(e?.modelSelection)return e.modelSelection}catch{}return O$}function A$(e){try{let t=ae();if(!t)return;let n=t.getState()??{};t.setState({...n,modelSelection:e})}catch{}}function j$(e){let t=Number.parseInt(e,10);return Number.isInteger(t)&&t>0?t:void 0}function M$(e,t,n){return{id:`${Date.now()}-${Math.random().toString(16).slice(2)}`,role:e,text:t,...n}}function N$(e,t,n=0){let r=n||(t?.userImages?.length??0);return r===0?e:`${e}${e.length>0?`
|
|
340
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Lz=`DialogDescriptionWarning`,Rz=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fz(Lz).contentName}}.`;return N.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},zz=uz,Bz=gz,Vz=vz,Hz=Sz,Uz=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=xt(`Primitive.${t}`),r=N.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Wz=`[cmdk-group=""]`,Gz=`[cmdk-group-items=""]`,Kz=`[cmdk-group-heading=""]`,qz=`[cmdk-item=""]`,Jz=`${qz}:not([aria-disabled="true"])`,Yz=`cmdk-item-select`,Xz=`data-value`,Zz=(e,t,n)=>PI(e,t,n),Qz=N.createContext(void 0),$z=()=>N.useContext(Qz),eB=N.createContext(void 0),tB=()=>N.useContext(eB),nB=N.createContext(void 0),rB=N.forwardRef((e,t)=>{let n=_B(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=_B(()=>new Set),i=_B(()=>new Map),a=_B(()=>new Map),o=_B(()=>new Set),s=hB(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=HI(),y=HI(),b=HI(),x=N.useRef(null),S=bB();gB(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),gB(()=>{S(6,te)},[]);let C=N.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)D(),E(),S(1,ee);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=O()?.id,C.emit()}),r||S(5,te),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=N.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{D(),E(),n.current.value||ee(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=O();S(4,()=>{D(),t?.getAttribute(`id`)===e&&ee(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??Zz;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;ne().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Gz);t?t.appendChild(e.parentElement===t?e:e.closest(`${Gz} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Gz} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Wz}[${Xz}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function ee(){let e=ne().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Xz);C.setState(`value`,e||void 0)}function D(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function te(){var e;let t=O();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Wz)?.querySelector(Kz))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function O(){return x.current?.querySelector(`${qz}[aria-selected="true"]`)}function ne(){return Array.from(x.current?.querySelectorAll(Jz)||[])}function k(e){let t=ne()[e];t&&C.setState(`value`,t.getAttribute(Xz))}function re(e){var t;let n=O(),r=ne(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(Xz))}function ie(e){let t=O()?.closest(Wz),n;for(;t&&!n;)t=e>0?pB(t,Wz):mB(t,Wz),n=t?.querySelector(Jz);n?C.setState(`value`,n.getAttribute(Xz)):re(e)}let ae=()=>k(ne().length-1),oe=e=>{e.preventDefault(),e.metaKey?ae():e.altKey?ie(1):re(1)},se=e=>{e.preventDefault(),e.metaKey?k(0):e.altKey?ie(-1):re(-1)};return N.createElement(Uz.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&oe(e);break;case`ArrowDown`:oe(e);break;case`p`:case`k`:g&&e.ctrlKey&&se(e);break;case`ArrowUp`:se(e);break;case`Home`:e.preventDefault(),k(0);break;case`End`:e.preventDefault(),ae();break;case`Enter`:{e.preventDefault();let t=O();if(t){let e=new Event(Yz);t.dispatchEvent(e)}}}}},N.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:CB},c),SB(e,e=>N.createElement(eB.Provider,{value:C},N.createElement(Qz.Provider,{value:w},e))))}),iB=N.forwardRef((e,t)=>{let n=HI(),r=N.useRef(null),i=N.useContext(nB),a=$z(),o=hB(e),s=o.current?.forceMount??i?.forceMount;gB(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=yB(n,r,[e.value,e.children,r],e.keywords),l=tB(),u=vB(e=>e.value&&e.value===c.current),d=vB(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);N.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Yz,f),()=>t.removeEventListener(Yz,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return N.createElement(Uz.div,{ref:ht(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),aB=N.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=HI(),s=N.useRef(null),c=N.useRef(null),l=HI(),u=$z(),d=vB(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));gB(()=>u.group(o),[]),yB(o,s,[e.value,e.heading,c]);let f=N.useMemo(()=>({id:o,forceMount:i}),[i]);return N.createElement(Uz.div,{ref:ht(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&N.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),SB(e,e=>N.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},N.createElement(nB.Provider,{value:f},e))))}),oB=N.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=N.useRef(null),a=vB(e=>!e.search);return!n&&!a?null:N.createElement(Uz.div,{ref:ht(i,t),...r,"cmdk-separator":``,role:`separator`})}),sB=N.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=tB(),o=vB(e=>e.search),s=vB(e=>e.selectedItemId),c=$z();return N.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),N.createElement(Uz.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),cB=N.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=N.useRef(null),o=N.useRef(null),s=vB(e=>e.selectedItemId),c=$z();return N.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),N.createElement(Uz.div,{ref:ht(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},SB(e,e=>N.createElement(`div`,{ref:ht(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),lB=N.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return N.createElement(zz,{open:n,onOpenChange:r},N.createElement(Bz,{container:o},N.createElement(Vz,{"cmdk-overlay":``,className:i}),N.createElement(Hz,{"aria-label":e.label,"cmdk-dialog":``,className:a},N.createElement(rB,{ref:t,...s}))))}),uB=N.forwardRef((e,t)=>vB(e=>e.filtered.count===0)?N.createElement(Uz.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),dB=N.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return N.createElement(Uz.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},SB(e,e=>N.createElement(`div`,{"aria-hidden":!0},e)))}),fB=Object.assign(rB,{List:cB,Item:iB,Input:sB,Group:aB,Separator:oB,Dialog:lB,Empty:uB,Loading:dB});function pB(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function mB(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function hB(e){let t=N.useRef(e);return gB(()=>{t.current=e}),t}var gB=typeof window>`u`?N.useEffect:N.useLayoutEffect;function _B(e){let t=N.useRef();return t.current===void 0&&(t.current=e()),t}function vB(e){let t=tB(),n=()=>e(t.snapshot());return N.useSyncExternalStore(t.subscribe,n,n)}function yB(e,t,n,r=[]){let i=N.useRef(),a=$z();return gB(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Xz,s),i.current=s}),i}var bB=()=>{let[e,t]=N.useState(),n=_B(()=>new Map);return gB(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function xB(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function SB({asChild:e,children:t},n){return e&&N.isValidElement(t)?N.cloneElement(xB(t),{ref:t.ref},n(t.props.children)):n(t)}var CB={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function wB({className:e,...t}){return(0,M.jsx)(fB,{"data-slot":`command`,className:j(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,e),...t})}function TB({className:e,...t}){return(0,M.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,M.jsxs)(Ce,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,M.jsx)(fB.Input,{"data-slot":`command-input`,className:j(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,M.jsx)(Ee,{children:(0,M.jsx)(h,{className:`size-4 shrink-0 opacity-50`})})]})})}function EB({className:e,...t}){return(0,M.jsx)(fB.List,{"data-slot":`command-list`,className:j(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function DB({className:e,...t}){return(0,M.jsx)(fB.Empty,{"data-slot":`command-empty`,className:j(`py-6 text-center text-sm`,e),...t})}function OB({className:e,...t}){return(0,M.jsx)(fB.Group,{"data-slot":`command-group`,className:j(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function kB({className:e,children:t,...n}){return(0,M.jsxs)(fB.Item,{"data-slot":`command-item`,className:j(`group/command-item relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,M.jsx)(g,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}var AB=async e=>{try{let t=await(await fetch(e)).blob();return new Promise(e=>{let n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>e(null),n.readAsDataURL(t)})}catch{return null}},jB=async e=>await new Promise(t=>{let n=new FileReader;n.onloadend=()=>t(n.result??null),n.onerror=()=>t(null),n.readAsDataURL(e)}),MB=(0,N.createContext)(null),NB=(0,N.createContext)(null),PB=()=>{let e=(0,N.useContext)(MB);if(!e)throw Error(`Wrap your component inside <PromptInputProvider> to use usePromptInputController().`);return e},FB=()=>(0,N.useContext)(MB),IB=()=>(0,N.useContext)(NB),LB=({initialInput:e=``,children:t})=>{let[n,r]=(0,N.useState)(e),i=(0,N.useCallback)(()=>r(``),[]),[a,o]=(0,N.useState)([]),s=(0,N.useRef)(null),c=(0,N.useRef)(()=>{}),l=(0,N.useCallback)(e=>{let t=[...e];t.length!==0&&o(e=>[...e,...t.map(e=>({filename:e.name,id:Pt(),mediaType:e.type,rawFile:e,type:`file`,url:URL.createObjectURL(e)}))])},[]),u=(0,N.useCallback)(e=>{o(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)})},[]),d=(0,N.useCallback)(()=>{o(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]})},[]),f=(0,N.useRef)(a);(0,N.useEffect)(()=>{f.current=a},[a]),(0,N.useEffect)(()=>()=>{for(let e of f.current)e.url&&URL.revokeObjectURL(e.url)},[]);let p=(0,N.useCallback)(()=>{c.current?.()},[]),m=(0,N.useMemo)(()=>({add:l,clear:d,fileInputRef:s,files:a,openFileDialog:p,remove:u}),[a,l,u,d,p]),h=(0,N.useCallback)((e,t)=>{s.current=e.current,c.current=t},[]),g=(0,N.useMemo)(()=>({__registerFileInput:h,attachments:m,textInput:{clear:i,setInput:r,value:n}}),[n,i,m,h]);return(0,M.jsx)(MB.Provider,{value:g,children:(0,M.jsx)(NB.Provider,{value:m,children:t})})},RB=(0,N.createContext)(null),zB=()=>{let e=IB(),t=(0,N.useContext)(RB)??e;if(!t)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return t},BB=(0,N.createContext)(null),VB=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:o,onError:s,onSubmit:c,children:l,...u})=>{let d=FB(),f=!!d,p=(0,N.useRef)(null),m=(0,N.useRef)(null),[h,g]=(0,N.useState)([]),_=f?d.attachments.files:h,[v,y]=(0,N.useState)([]),b=(0,N.useRef)(_);(0,N.useEffect)(()=>{b.current=_},[_]);let x=(0,N.useCallback)(()=>{p.current?.click()},[]),S=(0,N.useCallback)(e=>!t||t.trim()===``||t.split(`,`).map(e=>e.trim()).filter(Boolean).some(t=>{if(t.endsWith(`/*`)){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t}),[t]),C=(0,N.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!o||e.size<=o);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}g(e=>{let t=typeof a==`number`?Math.max(0,a-e.length):void 0,n=typeof t==`number`?r.slice(0,t):r;typeof t==`number`&&r.length>t&&s?.({code:`max_files`,message:`Too many files. Some were not added.`});let i=[];for(let e of n)i.push({filename:e.name,id:Pt(),mediaType:e.type,rawFile:e,type:`file`,url:URL.createObjectURL(e)});return[...e,...i]})},[S,a,o,s]),w=(0,N.useCallback)(e=>g(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),[]),T=(0,N.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!o||e.size<=o);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}let i=_.length,c=typeof a==`number`?Math.max(0,a-i):void 0,l=typeof c==`number`?r.slice(0,c):r;typeof c==`number`&&r.length>c&&s?.({code:`max_files`,message:`Too many files. Some were not added.`}),l.length>0&&d?.attachments.add(l)},[S,o,a,s,_.length,d]),E=(0,N.useCallback)(()=>f?d?.attachments.clear():g(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[f,d]),ee=(0,N.useCallback)(()=>y([]),[]),D=f?T:C,te=f?d.attachments.remove:w,O=f?d.attachments.openFileDialog:x,ne=(0,N.useCallback)(()=>{E(),ee()},[E,ee]);(0,N.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,N.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value=``)},[_,i]),(0,N.useEffect)(()=>{let e=m.current;if(!e||r)return;let t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},n=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[D,r]),(0,N.useEffect)(()=>{if(!r)return;let e=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[D,r]),(0,N.useEffect)(()=>()=>{if(!f)for(let e of b.current)e.url&&URL.revokeObjectURL(e.url)},[f]);let k=(0,N.useCallback)(e=>{e.currentTarget.files&&D(e.currentTarget.files),e.currentTarget.value=``},[D]),re=(0,N.useMemo)(()=>({add:D,clear:E,fileInputRef:p,files:_.map(e=>({...e,id:e.id})),openFileDialog:O,remove:te}),[_,D,te,E,O]),ie=(0,N.useMemo)(()=>({add:e=>{let t=Array.isArray(e)?e:[e];y(e=>[...e,...t.map(e=>({...e,id:Pt()}))])},clear:ee,remove:e=>{y(t=>t.filter(t=>t.id!==e))},sources:v}),[v,ee]),ae=(0,N.useCallback)(async e=>{e.preventDefault();let t=e.currentTarget,n=f?d.textInput.value:new FormData(t).get(`message`)||``;f||t.reset();try{let t=c({files:await Promise.all(_.map(async({id:e,rawFile:t,...n})=>{if(t){let e=await jB(t);return{...n,url:e??n.url}}if(n.url?.startsWith(`blob:`)){let e=await AB(n.url);return{...n,url:e??n.url}}return n})),text:n},e);if(t instanceof Promise)try{await t,ne(),f&&d.textInput.clear()}catch{}else ne(),f&&d.textInput.clear()}catch{}},[f,d,_,c,ne]),oe=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`input`,{accept:t,"aria-label":`Upload files`,className:`hidden`,multiple:n,onChange:k,ref:p,title:`Upload files`,type:`file`}),(0,M.jsx)(`form`,{className:j(`w-full`,e),onSubmit:ae,ref:m,...u,children:(0,M.jsx)(Ce,{className:`overflow-hidden`,children:l})})]}),se=(0,M.jsx)(BB.Provider,{value:ie,children:oe});return(0,M.jsx)(RB.Provider,{value:re,children:se})},HB=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`contents`,e),...t}),UB=({onChange:e,onKeyDown:t,className:n,placeholder:r=`How can I help you?`,...i})=>{let a=FB(),o=zB(),[s,c]=(0,N.useState)(!1),l=(0,N.useCallback)(e=>{if(t?.(e),!e.defaultPrevented){if(e.key===`Enter`){if(s||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let{form:t}=e.currentTarget;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}if(e.key===`Backspace`&&e.currentTarget.value===``&&o.files.length>0){e.preventDefault();let t=o.files.at(-1);t&&o.remove(t.id)}}},[t,s,o]),u=(0,N.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t)if(e.kind===`file`){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),o.add(n))},[o]),d=(0,N.useCallback)(()=>c(!1),[]),f=(0,N.useCallback)(()=>c(!0),[]),p=a?{onChange:t=>{a.textInput.setInput(t.currentTarget.value),e?.(t)},value:a.textInput.value}:{onChange:e};return(0,M.jsx)(we,{className:j(`field-sizing-content max-h-48 min-h-16`,n),name:`message`,onCompositionEnd:d,onCompositionStart:f,onKeyDown:l,onPaste:u,placeholder:r,...i,...p})},WB=({className:e,...t})=>(0,M.jsx)(Ee,{align:`block-end`,className:j(`order-first flex-wrap gap-1`,e),...t}),GB=({className:e,...t})=>(0,M.jsx)(Ee,{align:`block-end`,className:j(`justify-between gap-1`,e),...t}),KB=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`flex min-w-0 items-center gap-1`,e),...t}),qB=({variant:e=`ghost`,className:t,size:n,tooltip:r,...i})=>{let a=n??(N.Children.count(i.children)>1?`sm`:`icon-sm`),o=(0,M.jsx)(be,{className:j(t),size:a,type:`button`,variant:e,...i});if(!r)return o;let s=typeof r==`string`?r:r.content,c=typeof r==`string`?void 0:r.shortcut,l=typeof r==`string`?`top`:r.side??`top`;return(0,M.jsxs)(Ie,{children:[(0,M.jsx)(Re,{children:o}),(0,M.jsxs)(Ve,{side:l,children:[s,c&&(0,M.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:c})]})]})},JB=({className:e,variant:t=`default`,size:n=`icon-sm`,status:r,onStop:i,onClick:a,children:o,...s})=>{let c=r===`submitted`||r===`streaming`,l=(0,M.jsx)(Ze,{className:`size-3`});r===`submitted`?l=(0,M.jsx)(We,{}):r===`streaming`?l=(0,M.jsx)(lt,{className:`size-3`}):r===`error`&&(l=(0,M.jsx)(le,{className:`size-3`}));let u=(0,N.useCallback)(e=>{if(c&&i){e.preventDefault(),i();return}a?.(e)},[c,i,a]);return(0,M.jsx)(be,{"aria-label":c?`Stop`:`Submit`,className:j(e),onClick:u,size:n,type:c&&i?`button`:`submit`,variant:t,...s,children:o??l})},YB=globalThis?.document?N.useLayoutEffect:()=>{},XB=Object.defineProperty,ZB=(e,t)=>XB(e,`name`,{value:t,configurable:!0}),QB=N.useEffectEvent,$B=N.useInsertionEffect;function eV(e){if(typeof QB==`function`)return QB(e);let t=N.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof $B==`function`?$B(()=>{t.current=e}):YB(()=>{t.current=e}),N.useMemo(()=>((...e)=>t.current?.(...e)),[])}ZB(eV,`useEffectEvent`);var tV=Object.defineProperty,nV=(e,t)=>tV(e,`name`,{value:t,configurable:!0}),rV=N.useInsertionEffect||YB;function iV({prop:e,defaultProp:t,onChange:n=nV(()=>{},`onChange`),caller:r}){let[i,a,o]=aV({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,N.useCallback(t=>{if(s){let n=oV(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}nV(iV,`useControllableState`);function aV({defaultProp:e,onChange:t}){let[n,r]=N.useState(e),i=N.useRef(n),a=N.useRef(t);return rV(()=>{a.current=t},[t]),N.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}nV(aV,`useUncontrolledState`);function oV(e){return typeof e==`function`}nV(oV,`isFunction`);var sV=Symbol(`RADIX:SYNC_STATE`);function cV(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=eV(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=N.useReducer((t,n)=>{if(n.type===sV)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=N.useRef(p);N.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=N.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return N.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:sV,state:i})},[i,d.state,c]),[h,f]}nV(cV,`useControllableStateReducer`);function lV(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,[a,o]=d({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=ce(a,!0,!0),u=p(),[f,m]=N.useState(),h=f===null?void 0:f??u,g=w(e=>{let t=!a,n=oe(D,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return N.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:g,mounted:s,open:a,panelId:h,setMounted:c,setOpen:o,setPanelIdState:m,transitionStatus:l}),[u,i,g,s,a,h,c,o,m,l])}var uV=N.createContext(void 0);function dV(){let e=N.useContext(uV);if(e===void 0)throw Error(T(15));return e}var fV=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=x.startingStyle]=`startingStyle`,e[e.endingStyle=x.endingStyle]=`endingStyle`,e}({}),pV=function(e){return e.panelOpen=`data-panel-open`,e}({}),mV={[fV.open]:``},hV={[fV.closed]:``},gV={open(e){return e?{[pV.panelOpen]:``}:null}},_V={open(e){return e?mV:hV},...S},vV=N.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,d=w(o),f=lV({open:s,defaultOpen:i,onOpenChange:d,disabled:a}),p=N.useMemo(()=>({open:f.open,disabled:f.disabled,transitionStatus:f.transitionStatus}),[f.open,f.disabled,f.transitionStatus]),m=N.useMemo(()=>({...f,onOpenChange:d,state:p}),[f,d,p]),h=u(`div`,e,{state:p,ref:t,props:l,stateAttributesMapping:_V});return(0,M.jsx)(uV.Provider,{value:m,children:h})}),yV={...gV,...S},bV=N.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=dV(),{className:s,disabled:c=o,render:l,nativeButton:d=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=ee({disabled:c,focusableWhenDisabled:!0,native:d});return u(`button`,e,{state:a,ref:[t,h],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},p,m],stateAttributesMapping:yV})}),xV={height:void 0,width:void 0};function SV(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=N.useRef(null),f=N.useRef(null),[p,m]=N.useState(xV),h=N.useRef(xV),g=N.useRef(!1),_=N.useRef(s),v=N.useRef(!1),[b,x]=N.useState(!1),S=N.useRef(null),T=ie(t,d),E=ne(s),ee=se(d),D=!s&&!a,O=b?`idle`:u,ae=s&&(_.current||v.current),A=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,ce=n&&D&&f.current!==`css-animation`,j=w((e,t=!0)=>{t&&(h.current=e),m(e)}),le=w(()=>{S.current?.(),S.current=null}),ue=w(e=>{le(),S.current=()=>{S.current=null,e()}}),de=w(()=>{s&&a&&f.current===`css-animation`&&(v.current=!0)});k(()=>{!b||u===`starting`||x(!1)},[b,u]),N.useEffect(()=>()=>{de(),le()},[de,le]),k(()=>{let e=d.current;if(!e)return;!s&&S.current&&le();let t=wV(e,ae);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=CV(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){j(CV(e)),x(!0);return}if(t===`css-transition`){let t=DV(e);if(j(CV(e)),!n)return t;let r=EV(e,`transition-duration`,`0s`);return ue(r),x(!0),t}j(CV(e));let r=EV(e,`animation-name`,`none`);if(!n){r();return}let i=EV(e,`animation-duration`,`0s`);r(),ue(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(_.current=!1,v.current=!1,t===`none`){j(xV,!1),c(!1);return}j(CV(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=CV(e);if(!(n.height>0||n.width>0)){c(!1);return}j(n),t===`css-animation`&&EV(e,`animation-name`,`none`)()},[a,s,le,j,c,ue,ae,u]),C({enabled:s&&a&&O===`idle`,open:!0,ref:d,onComplete(){s&&j(xV,!1)}}),N.useEffect(()=>{if(s||!a||O!==`ending`||!d.current)return;let e=new AbortController,t=-1;function n(){E.current||(c(!1),j(xV,!1))}return t=re.request(()=>{ee(n,e.signal)}),()=>{re.cancel(t),e.abort()}},[E,a,s,O,ee,j,c]),k(()=>{let e=d.current;!e||!n||!D||e.setAttribute(`hidden`,`until-found`)},[D,n]),N.useEffect(function(){let e=d.current;if(!e)return;function t(e){let t=oe(y,e);o(!0,t),!t.isCanceled&&(g.current=!0,l(!0))}return te(e,`beforematch`,t)},[o,l]);let fe=i||n||a||s;return{height:A.height,props:{...ce?{[fV.startingStyle]:``}:void 0,hidden:D,id:r},ref:T,shouldPreventOpenAnimation:ae,shouldRender:fe,transitionStatus:O,width:A.width}}function CV(e){return{height:e.scrollHeight,width:e.scrollWidth}}function wV(e,t){let n=b(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&TV(n.animationDuration),i=TV(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function TV(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function EV(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function DV(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=re.request(n);return()=>{re.cancel(r),n()}}var OV=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),kV=N.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:d,onOpenChange:f,open:p,setMounted:h,setPanelIdState:g,setOpen:_,state:v,transitionStatus:y}=dV(),b=r??!1,x=i??!1,S=o||void 0,C=S??l;k(()=>(g(e=>S??(e===null?void 0:e)),()=>{g(e=>e===S?null:e)}),[S,g]);let{height:w,props:T,ref:E,shouldPreventOpenAnimation:ee,shouldRender:D,transitionStatus:te,width:O}=SV({externalRef:t,hiddenUntilFound:b,id:C,keepMounted:x,mounted:d,onOpenChange:f,open:p,setMounted:h,setOpen:_,transitionStatus:y}),ne={...v,transitionStatus:te},re=m(s,ne),ie=u(`div`,{...e,style:void 0},{state:ne,ref:E,props:[T,{style:{[OV.collapsiblePanelHeight]:w===void 0?`auto`:`${w}px`,[OV.collapsiblePanelWidth]:O===void 0?`auto`:`${O}px`}},c,re?{style:re}:void 0,ee?{style:{animationName:`none`}}:void 0],stateAttributesMapping:_V});return D?ie:null});function AV({...e}){return(0,M.jsx)(vV,{"data-slot":`collapsible`,...e})}function jV({...e}){return(0,M.jsx)(bV,{"data-slot":`collapsible-trigger`,...e})}function MV({...e}){return(0,M.jsx)(kV,{"data-slot":`collapsible-content`,...e})}var NV=(0,N.createContext)({});function PV(e){let t=(0,N.useRef)(null);return t.current===null&&(t.current=e()),t.current}var FV=typeof window<`u`?N.useLayoutEffect:N.useEffect,IV=(0,N.createContext)(null);function LV(e,t){e.indexOf(t)===-1&&e.push(t)}function RV(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var zV=(e,t,n)=>n>t?t:n<e?e:n,BV={},VV=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),HV=e=>typeof e==`object`&&!!e,UV=e=>/^0[^.\s]+$/u.test(e);function WV(e){let t;return()=>(t===void 0&&(t=e()),t)}var GV=e=>e,KV=(...e)=>e.reduce((e,t)=>n=>t(e(n))),qV=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},JV=class{constructor(){this.subscriptions=[]}add(e){return LV(this.subscriptions,e),()=>RV(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},YV=e=>e*1e3,XV=e=>e/1e3,ZV=(e,t)=>t?1e3/t*e:0,QV=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,$V=1e-7,eH=12;function tH(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=QV(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>$V&&++s<eH);return o}function nH(e,t,n,r){if(e===t&&n===r)return GV;let i=t=>tH(t,0,1,e,n);return e=>e===0||e===1?e:QV(i(e),t,r)}var rH=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,iH=e=>t=>1-e(1-t),aH=nH(.33,1.53,.69,.99),oH=iH(aH),sH=rH(oH),cH=e=>e>=1?1:(e*=2)<1?.5*oH(e):.5*(2-2**(-10*(e-1))),lH=e=>1-Math.sin(Math.acos(e)),uH=iH(lH),dH=rH(lH),fH=nH(.42,0,1,1),pH=nH(0,0,.58,1),mH=nH(.42,0,.58,1),hH=e=>Array.isArray(e)&&typeof e[0]!=`number`,gH=e=>Array.isArray(e)&&typeof e[0]==`number`,_H={linear:GV,easeIn:fH,easeInOut:mH,easeOut:pH,circIn:lH,circInOut:dH,circOut:uH,backIn:oH,backInOut:sH,backOut:aH,anticipate:cH},vH=e=>typeof e==`string`,yH=e=>{if(gH(e)){e.length;let[t,n,r,i]=e;return nH(t,n,r,i)}return vH(e)?(_H[e],`${e}`,_H[e]):e},bH=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function xH(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var SH=40;function CH(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=bH.reduce((e,t)=>(e[t]=xH(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=BV.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,SH),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:bH.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<bH.length;t++)o[bH[t]].cancel(e)},state:i,steps:o}}var{schedule:wH,cancel:TH,state:EH,steps:DH}=CH(typeof requestAnimationFrame<`u`?requestAnimationFrame:GV,!0),OH;function kH(){OH=void 0}var AH={now:()=>(OH===void 0&&AH.set(EH.isProcessing||BV.useManualTiming?EH.timestamp:performance.now()),OH),set:e=>{OH=e,queueMicrotask(kH)}},jH=e=>t=>typeof t==`string`&&t.startsWith(e),MH=jH(`--`),NH=jH(`var(--`),PH=e=>NH(e)?FH.test(e.split(`/*`)[0].trim()):!1,FH=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function IH(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var LH={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},RH={...LH,transform:e=>zV(0,1,e)},zH={...LH,default:1},BH=e=>Math.round(e*1e5)/1e5,VH=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function HH(e){return e==null}var UH=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,WH=(e,t)=>n=>!!(typeof n==`string`&&UH.test(n)&&n.startsWith(e)||t&&!HH(n)&&Object.prototype.hasOwnProperty.call(n,t)),GH=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(VH);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},KH=e=>zV(0,255,e),qH={...LH,transform:e=>Math.round(KH(e))},JH={test:WH(`rgb`,`red`),parse:GH(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+qH.transform(e)+`, `+qH.transform(t)+`, `+qH.transform(n)+`, `+BH(RH.transform(r))+`)`};function YH(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var XH={test:WH(`#`),parse:YH,transform:JH.transform},ZH=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),QH=ZH(`deg`),$H=ZH(`%`),Q=ZH(`px`),eU=ZH(`vh`),tU=ZH(`vw`),nU={...$H,parse:e=>$H.parse(e)/100,transform:e=>$H.transform(e*100)},rU={test:WH(`hsl`,`hue`),parse:GH(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+$H.transform(BH(t))+`, `+$H.transform(BH(n))+`, `+BH(RH.transform(r))+`)`},iU={test:e=>JH.test(e)||XH.test(e)||rU.test(e),parse:e=>JH.test(e)?JH.parse(e):rU.test(e)?rU.parse(e):XH.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?JH.transform(e):rU.transform(e),getAnimatableNone:e=>{let t=iU.parse(e);return t.alpha=0,iU.transform(t)}},aU=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function oU(e){return isNaN(e)&&typeof e==`string`&&(e.match(VH)?.length||0)+(e.match(aU)?.length||0)>0}var sU=`number`,cU=`color`,lU=`var`,uU=`var(`,dU="${}",fU=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function pU(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(fU,e=>(iU.test(e)?(r.color.push(a),i.push(cU),n.push(iU.parse(e))):e.startsWith(uU)?(r.var.push(a),i.push(lU),n.push(e)):(r.number.push(a),i.push(sU),n.push(parseFloat(e))),++a,dU)).split(dU),indexes:r,types:i}}function mU(e){return pU(e).values}function hU({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===sU?BH(r[a]):e===cU?iU.transform(r[a]):r[a]}return i}}function gU(e){return hU(pU(e))}var _U=e=>typeof e==`number`?0:iU.test(e)?iU.getAnimatableNone(e):e,vU=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:_U(e);function yU(e){let t=pU(e);return hU(t)(t.values.map((e,n)=>vU(e,t.split[n])))}var bU={test:oU,parse:mU,createTransformer:gU,getAnimatableNone:yU};function xU(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function SU({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=xU(s,r,e+1/3),a=xU(s,r,e),o=xU(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function CU(e,t){return n=>n>0?t:e}var wU=(e,t,n)=>e+(t-e)*n,TU=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},EU=[XH,JH,rU],DU=e=>EU.find(t=>t.test(e));function OU(e){let t=DU(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===rU&&(n=SU(n)),n}var kU=(e,t)=>{let n=OU(e),r=OU(t);if(!n||!r)return CU(e,t);let i={...n};return e=>(i.red=TU(n.red,r.red,e),i.green=TU(n.green,r.green,e),i.blue=TU(n.blue,r.blue,e),i.alpha=wU(n.alpha,r.alpha,e),JH.transform(i))},AU=new Set([`none`,`hidden`]);function jU(e,t){return AU.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function MU(e,t){return n=>wU(e,t,n)}function NU(e){return typeof e==`number`?MU:typeof e==`string`?PH(e)?CU:iU.test(e)?kU:LU:Array.isArray(e)?PU:typeof e==`object`?iU.test(e)?kU:FU:CU}function PU(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>NU(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function FU(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=NU(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function IU(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var LU=(e,t)=>{let n=bU.createTransformer(t),r=pU(e),i=pU(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?AU.has(e)&&!i.values.length||AU.has(t)&&!r.values.length?jU(e,t):KV(PU(IU(r,i),i.values),n):(`${e}${t}`,CU(e,t))};function RU(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?wU(e,t,n):NU(e)(e,t)}var zU=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>wH.update(t,e),stop:()=>TH(t),now:()=>EH.isProcessing?EH.timestamp:AH.now()}},BU=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},VU=2e4;function HU(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function UU(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(HU(r),VU);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:XV(i)}}var WU={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function GU(e,t){return e*Math.sqrt(1-t*t)}var KU=12;function qU(e,t,n){let r=n;for(let n=1;n<KU;n++)r-=e(r)/t(r);return r}var JU=.001;function YU({duration:e=WU.duration,bounce:t=WU.bounce,velocity:n=WU.velocity,mass:r=WU.mass}){let i,a;WU.maxDuration;let o=1-t;o=zV(WU.minDamping,WU.maxDamping,o),e=zV(WU.minDuration,WU.maxDuration,XV(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=GU(t,o),c=Math.exp(-i);return JU-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=GU(t**2,o);return(-i(t)+JU>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=qU(i,a,s);if(e=YV(e),isNaN(c))return{stiffness:WU.stiffness,damping:WU.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var XU=[`duration`,`bounce`],ZU=[`stiffness`,`damping`,`mass`];function QU(e,t){return t.some(t=>e[t]!==void 0)}function $U(e){let t={velocity:WU.velocity,stiffness:WU.stiffness,damping:WU.damping,mass:WU.mass,isResolvedFromDuration:!1,...e};if(!QU(e,ZU)&&QU(e,XU)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*zV(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:WU.mass,stiffness:i,damping:a}}else{let n=YU({...e,velocity:0});t={...t,...n,mass:WU.mass},t.isResolvedFromDuration=!0}}return t}function eW(e=WU.visualDuration,t=WU.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=$U({...n,velocity:-XV(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=XV(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?WU.restSpeed.granular:WU.restSpeed.default,i||=v?WU.restDelta.granular:WU.restDelta.default;let y,b,x,S,C,w;if(h<1)x=GU(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>YV(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=YV(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=YV(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(HU(T),VU),t=BU(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}eW.applyToOptions=e=>{let t=UU(e,100,eW);return e.ease=t.ease,e.duration=YV(t.duration),e.type=`keyframes`,e};var tW=5;function nW(e,t,n){let r=Math.max(t-tW,0);return ZV(n-e(r),t-r)}function rW({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=eW({keyframes:[f.value,m(f.value)],velocity:nW(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function iW(e,t,n){let r=[],i=n||BV.mix||RU,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=KV(Array.isArray(t)?t[n]||GV:t,a)),r.push(a)}return r}function aW(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=iW(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=qV(e[r],e[r+1],n);return s[r](i)};return n?t=>l(zV(e[0],e[a-1],t)):l}function oW(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=qV(0,t,r);e.push(wU(n,1,i))}}function sW(e){let t=[0];return oW(t,e.length-1),t}function cW(e,t){return e.map(e=>e*t)}function lW(e,t){return e.map(()=>t||mH).splice(0,e.length-1)}function uW({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=hH(r)?r.map(yH):yH(r),a={done:!1,value:t[0]},o=aW(cW(n&&n.length===t.length?n:sW(t),e),t,{ease:Array.isArray(i)?i:lW(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var dW=e=>e!==null;function fW(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(dW),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var pW={decay:rW,inertia:rW,tween:uW,keyframes:uW,spring:eW};function mW(e){typeof e.type==`string`&&(e.type=pW[e.type])}var hW=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},gW=e=>e/100,_W=class extends hW{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==AH.now()&&this.tick(AH.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;mW(e);let{type:t=uW,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||uW;s!==uW&&typeof o[0]!=`number`&&(this.mixKeyframes=KV(gW,RU(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=HU(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=zV(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==rW&&(b.value=fW(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return XV(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+XV(e)}get time(){return XV(this.currentTime)}set time(e){e=YV(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return nW(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(AH.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=XV(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=zU,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(AH.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function vW(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var yW=e=>e*180/Math.PI,bW=e=>SW(yW(Math.atan2(e[1],e[0]))),xW={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bW,rotateZ:bW,skewX:e=>yW(Math.atan(e[1])),skewY:e=>yW(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},SW=e=>(e%=360,e<0&&(e+=360),e),CW=bW,wW=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),TW=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),EW={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wW,scaleY:TW,scale:e=>(wW(e)+TW(e))/2,rotateX:e=>SW(yW(Math.atan2(e[6],e[5]))),rotateY:e=>SW(yW(Math.atan2(-e[2],e[0]))),rotateZ:CW,rotate:CW,skewX:e=>yW(Math.atan(e[4])),skewY:e=>yW(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function DW(e){return+!!e.includes(`scale`)}function OW(e,t){if(!e||e===`none`)return DW(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=EW,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=xW,i=t}if(!i)return DW(t);let a=r[t],o=i[1].split(`,`).map(AW);return typeof a==`function`?a(o):o[a]}var kW=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return OW(n,t)};function AW(e){return parseFloat(e.trim())}var jW=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],MW=new Set([...jW,`pathRotation`]),NW=e=>e===LH||e===Q,PW=new Set([`x`,`y`,`z`]),FW=jW.filter(e=>!PW.has(e));function IW(e){let t=[];return FW.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var LW={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>OW(t,`x`),y:(e,{transform:t})=>OW(t,`y`)};LW.translateX=LW.x,LW.translateY=LW.y;var RW=new Set,zW=!1,BW=!1,VW=!1;function HW(){if(BW){let e=Array.from(RW).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=IW(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}BW=!1,zW=!1,RW.forEach(e=>e.complete(VW)),RW.clear()}function UW(){RW.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(BW=!0)})}function WW(){VW=!0,UW(),HW(),VW=!1}var GW=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(RW.add(this),zW||(zW=!0,wH.read(UW),wH.resolveKeyframes(HW))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}vW(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),RW.delete(this)}cancel(){this.state===`scheduled`&&(RW.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},KW=e=>e.startsWith(`--`);function qW(e,t,n){KW(t)?e.style.setProperty(t,n):e.style[t]=n}var JW={};function YW(e,t){let n=WV(e);return()=>JW[t]??n()}var XW=YW(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),ZW=YW(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),QW=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,$W={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:QW([0,.65,.55,1]),circOut:QW([.55,0,1,.45]),backIn:QW([.31,.01,.66,-.59]),backOut:QW([.33,1.53,.69,.99])};function eG(e,t){if(e)return typeof e==`function`?ZW()?BU(e,t):`ease-out`:gH(e)?QW(e):Array.isArray(e)?e.map(e=>eG(e,t)||$W.easeOut):$W[e]}function tG(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=eG(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function nG(e){return typeof e==`function`&&`applyToOptions`in e}function rG({type:e,...t}){return nG(e)&&ZW()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var iG=class extends hW{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=rG(e);this.animation=tG(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=fW(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),qW(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return XV(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+XV(e)}get time(){return XV(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=YV(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&XW()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),GV):r(this)}},aG={anticipate:cH,backInOut:sH,circInOut:dH};function oG(e){return e in aG}function sG(e){typeof e.ease==`string`&&oG(e.ease)&&(e.ease=aG[e.ease])}var cG=10,lG=class extends iG{constructor(e){sG(e),mW(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new _W({...a,autoplay:!1}),s=Math.max(cG,AH.now()-this.startTime),c=zV(0,cG,s-cG),l=o.sample(s).value,{name:u}=this.options;i&&u&&qW(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},uG=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(bU.test(e)||e===`0`)&&!e.startsWith(`url(`));function dG(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function fG(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=uG(i,t),s=uG(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:dG(e)||(n===`spring`||nG(n))&&r}function pG(e){e.duration=0,e.type=`keyframes`}var mG=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),hG=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function gG(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&hG.test(e[t]))return!0;return!1}var _G=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),vG=WV(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function yG(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return vG()&&n&&(mG.has(n)||_G.has(n)&&gG(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var bG=40,xG=class extends hW{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=AH.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||GW;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=AH.now();let u=!0;fG(e,i,a,o)||(u=!1,(BV.instantAnimations||!s)&&l?.(fW(e,n,t)),e[0]=e[e.length-1],pG(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>bG?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&yG(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new lG({...d,element:p})}catch{m=new _W(d)}else m=new _W(d);m.finished.then(()=>{this.notifyFinished()}).catch(GV),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),WW()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function SG(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var CG=30,wG=e=>!isNaN(parseFloat(e)),TG={current:void 0},EG=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=AH.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=AH.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wG(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new JV);let n=this.events[e].add(t);return e===`change`?()=>{n(),wH.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return TG.current&&TG.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=AH.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>CG)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,CG);return ZV(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function DG(e,t){return new EG(e,t)}function OG(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function kG(e,t){let n=e?.[t]??e?.default??e;return n===e?n:OG(n,e)}var AG={type:`spring`,stiffness:500,damping:25,restSpeed:10},jG=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),MG={type:`keyframes`,duration:.8},NG={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},PG=(e,{keyframes:t})=>t.length>2?MG:MW.has(e)?e.startsWith(`scale`)?jG(t[1]):AG:NG,FG=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function IG(e){for(let t in e)if(!FG.has(t))return!0;return!1}var LG=(e,t,n,r={},i,a)=>o=>{let s=kG(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=YV(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};IG(s)||Object.assign(u,PG(e,u)),u.duration&&=YV(u.duration),u.repeatDelay&&=YV(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(pG(u),u.delay===0&&(d=!0)),(BV.instantAnimations||BV.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,pG(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=fW(u.keyframes,s);if(e!==void 0){wH.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new _W(u):new xG(u)},RG=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zG(e){let t=RG.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function BG(e,t,n=1){`${e}`;let[r,i]=zG(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return VV(e)?parseFloat(e):e}return PH(i)?BG(i,t,n+1):i}function VG(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function HG(e,t,n,r){if(typeof t==`function`){let[i,a]=VG(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=VG(r);t=t(n===void 0?e.custom:n,i,a)}return t}function UG(e,t,n){let r=e.getProps();return HG(r,t,n===void 0?r.custom:n,e)}var WG=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...jW]),GG=e=>Array.isArray(e);function KG(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,DG(n))}function qG(e){return GG(e)?e[e.length-1]||0:e}function JG(e,t){let{transitionEnd:n={},transition:r={},...i}=UG(e,t)||{};i={...i,...n};for(let t in i)KG(e,t,qG(i[t]))}var YG=e=>!!(e&&e.getVelocity);function XG(e){return!!(YG(e)&&e.add)}function ZG(e,t){let n=e.getValue(`willChange`);if(XG(n))return n.add(t);if(!n&&BV.WillChange){let n=new BV.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function QG(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var $G=`data-`+QG(`framerAppearId`);function eK(e){return e.props[$G]}function tK({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function nK(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?OG(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&tK(f,t))continue;let o={delay:n,...kG(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){wH.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=eK(e);if(n){let e=window.MotionHandoffAnimation(n,t,wH);e!==null&&(o.startTime=e,p=!0)}}ZG(e,t);let m=l??e.shouldReduceMotion;r.start(LG(t,r,i,m&&WG.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>wH.update(()=>{o&&JG(e,o)});d.length?Promise.all(d).then(t):t()}return d}function rK(e,t,n={}){let r=UG(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(nK(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return iK(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function iK(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(rK(c,t,{...o,delay:n+(typeof r==`function`?0:r)+SG(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function aK(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>rK(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=rK(e,t,n);else{let i=typeof t==`function`?UG(e,t,n.custom):t;r=Promise.all(nK(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var oK={test:e=>e===`auto`,parse:e=>e},sK=e=>t=>t.test(e),cK=[LH,Q,$H,QH,tU,eU,oK],lK=e=>cK.find(sK(e));function uK(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||UV(e)}var dK=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function fK(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(VH)||[];if(!r)return e;let i=n.replace(r,``),a=+!!dK.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var pK=/\b([a-z-]*)\(.*?\)/gu,mK={...bU,getAnimatableNone:e=>{let t=e.match(pK);return t?t.map(fK).join(` `):e}},hK={...bU,getAnimatableNone:e=>{let t=bU.parse(e);return bU.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},gK={...LH,transform:Math.round},_K={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,inset:Q,insetBlock:Q,insetBlockStart:Q,insetBlockEnd:Q,insetInline:Q,insetInlineStart:Q,insetInlineEnd:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,paddingBlock:Q,paddingBlockStart:Q,paddingBlockEnd:Q,paddingInline:Q,paddingInlineStart:Q,paddingInlineEnd:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,marginBlock:Q,marginBlockStart:Q,marginBlockEnd:Q,marginInline:Q,marginInlineStart:Q,marginInlineEnd:Q,fontSize:Q,backgroundPositionX:Q,backgroundPositionY:Q,rotate:QH,pathRotation:QH,rotateX:QH,rotateY:QH,rotateZ:QH,scale:zH,scaleX:zH,scaleY:zH,scaleZ:zH,skew:QH,skewX:QH,skewY:QH,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:RH,originX:nU,originY:nU,originZ:Q,zIndex:gK,fillOpacity:RH,strokeOpacity:RH,numOctaves:gK},vK={..._K,color:iU,backgroundColor:iU,outlineColor:iU,fill:iU,stroke:iU,borderColor:iU,borderTopColor:iU,borderRightColor:iU,borderBottomColor:iU,borderLeftColor:iU,filter:mK,WebkitFilter:mK,mask:hK,WebkitMask:hK},yK=e=>vK[e],bK=new Set([mK,hK]);function xK(e,t){let n=yK(e);return bK.has(n)||(n=bU),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var SK=new Set([`auto`,`none`,`0`]);function CK(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!SK.has(t)&&pU(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=xK(n,i)}var wK=class extends GW{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),PH(r))){let i=BG(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!WG.has(n)||e.length!==2)return;let[r,i]=e,a=lK(r),o=lK(i);if(IH(r)!==IH(i)&&LW[n]){this.needsMeasurement=!0;return}if(a!==o){if(NW(a)&&NW(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else LW[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||uK(e[t]))&&n.push(t);n.length&&CK(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=LW[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=LW[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},TK=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function EK(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var DK=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function OK(e){return HV(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:kK,cancel:AK}=CH(queueMicrotask,!1),jK={x:!1,y:!1};function MK(){return jK.x||jK.y}function NK(e){return e===`x`||e===`y`?jK[e]?null:(jK[e]=!0,()=>{jK[e]=!1}):jK.x||jK.y?null:(jK.x=jK.y=!0,()=>{jK.x=jK.y=!1})}function PK(e,t){let n=EK(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function FK(e){return!(e.pointerType===`touch`||MK())}function IK(e,t,n={}){let[r,i,a]=PK(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!FK(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var LK=(e,t)=>t?e===t||LK(e,t.parentElement):!1,RK=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,zK=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function BK(e){return zK.has(e.tagName)||e.isContentEditable===!0}var VK=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function HK(e){return VK.has(e.tagName)||e.isContentEditable===!0}var UK=new WeakSet;function WK(e){return t=>{t.key===`Enter`&&e(t)}}function GK(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var KK=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=WK(()=>{if(UK.has(n))return;GK(n,`down`);let e=WK(()=>{GK(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>GK(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function qK(e){return RK(e)&&!MK()}var JK=new WeakSet;function YK(e,t,n={}){let[r,i,a]=PK(e,n),o=e=>{let r=e.currentTarget;if(!qK(e)||JK.has(e))return;UK.add(r),n.stopPropagation&&JK.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),UK.has(r)&&UK.delete(r),qK(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||LK(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),OK(e)&&(e.addEventListener(`focus`,e=>KK(e,i)),!BK(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function XK(e){return HV(e)&&`ownerSVGElement`in e}var ZK=new WeakMap,QK,$K=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:XK(r)&&`getBBox`in r?r.getBBox()[t]:r[n],eq=$K(`inline`,`width`,`offsetWidth`),tq=$K(`block`,`height`,`offsetHeight`);function nq({target:e,borderBoxSize:t}){ZK.get(e)?.forEach(n=>{n(e,{get width(){return eq(e,t)},get height(){return tq(e,t)}})})}function rq(e){e.forEach(nq)}function iq(){typeof ResizeObserver>`u`||(QK=new ResizeObserver(rq))}function aq(e,t){QK||iq();let n=EK(e);return n.forEach(e=>{let n=ZK.get(e);n||(n=new Set,ZK.set(e,n)),n.add(t),QK?.observe(e)}),()=>{n.forEach(e=>{let n=ZK.get(e);n?.delete(t),n?.size||QK?.unobserve(e)})}}var oq=new Set,sq;function cq(){sq=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};oq.forEach(t=>t(e))},window.addEventListener(`resize`,sq)}function lq(e){return oq.add(e),sq||cq(),()=>{oq.delete(e),!oq.size&&typeof sq==`function`&&(window.removeEventListener(`resize`,sq),sq=void 0)}}function uq(e,t){return typeof e==`function`?lq(e):aq(e,t)}var dq={value:null,addProjectionMetrics:null};function fq(e){return XK(e)&&e.tagName===`svg`}var pq=[...cK,iU,bU],mq=e=>pq.find(sK(e)),hq=()=>({translate:0,scale:1,origin:0,originPoint:0}),gq=()=>({x:hq(),y:hq()}),_q=()=>({min:0,max:0}),vq=()=>({x:_q(),y:_q()}),yq=new WeakMap;function bq(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function xq(e){return typeof e==`string`||Array.isArray(e)}var Sq=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Cq=[`initial`,...Sq];function wq(e){return bq(e.animate)||Cq.some(t=>xq(e[t]))}function Tq(e){return!!(wq(e)||e.variants)}function Eq(e,t,n){for(let r in t){let i=t[r],a=n[r];if(YG(i))e.addValue(r,i);else if(YG(a))e.addValue(r,DG(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,DG(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Dq={current:null},Oq={current:!1},kq=typeof window<`u`;function Aq(){if(Oq.current=!0,kq){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Dq.current=e.matches;e.addEventListener(`change`,t),t()}else Dq.current=!1}}var jq=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Mq={};function Nq(e){Mq=e}function Pq(){return Mq}var Fq=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=GW,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=AH.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,wH.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=wq(t),this.isVariantNode=Tq(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&YG(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,yq.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Oq.current||Aq(),this.shouldReduceMotion=Dq.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),TH(this.notifyUpdate),TH(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&mG.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new iG({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:YV(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=MW.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&wH.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Mq){let t=Mq[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):vq()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<jq.length;t++){let n=jq[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Eq(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=DG(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(VV(n)||UV(n))?n=parseFloat(n):!mq(n)&&bU.test(t)&&(n=xK(e,t)),this.setBaseTarget(e,YG(n)?n.get():n)),YG(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=HG(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!YG(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new JV),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){kK.render(this.render)}},Iq=class extends Fq{constructor(){super(...arguments),this.KeyframeResolver=wK}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;YG(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Lq=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Rq({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function zq({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Bq(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Vq(e){return e===void 0||e===1}function Hq({scale:e,scaleX:t,scaleY:n}){return!Vq(e)||!Vq(t)||!Vq(n)}function Uq(e){return Hq(e)||Wq(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Wq(e){return Gq(e.x)||Gq(e.y)}function Gq(e){return e&&e!==`0%`}function Kq(e,t,n){return n+t*(e-n)}function qq(e,t,n,r,i){return i!==void 0&&(e=Kq(e,i,r)),Kq(e,n,r)+t}function Jq(e,t=0,n=1,r,i){e.min=qq(e.min,t,n,r,i),e.max=qq(e.max,t,n,r,i)}function Yq(e,{x:t,y:n}){Jq(e.x,t.translate,t.scale,t.originPoint),Jq(e.y,n.translate,n.scale,n.originPoint)}var Xq=.999999999999,Zq=1.0000000000001;function Qq(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&($q(e.x,-a.scroll.offset.x),$q(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Yq(e,o)),r&&Uq(a.latestValues)&&nJ(e,a.latestValues,a.layout?.layoutBox))}t.x<Zq&&t.x>Xq&&(t.x=1),t.y<Zq&&t.y>Xq&&(t.y=1)}function $q(e,t){e.min+=t,e.max+=t}function eJ(e,t,n,r,i=.5){Jq(e,t,n,wU(e.min,e.max,i),r)}function tJ(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function nJ(e,t,n){let r=n??e;eJ(e.x,tJ(t.x,r.x),t.scaleX,t.scale,t.originX),eJ(e.y,tJ(t.y,r.y),t.scaleY,t.scale,t.originY)}function rJ(e,t){return Rq(Bq(e.getBoundingClientRect(),t))}function iJ(e,t,n){let r=rJ(e,n),{scroll:i}=t;return i&&($q(r.x,i.offset.x),$q(r.y,i.offset.y)),r}var aJ={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},oJ=jW.length;function sJ(e,t,n){let r=``,i=!0;for(let a=0;a<oJ;a++){let o=jW[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=DK(s,_K[o]);if(!c){i=!1;let t=aJ[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${DK(a,_K.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function cJ(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(MW.has(e)){o=!0;continue}if(MH(e)){i[e]=n;continue}{let t=DK(n,_K[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=sJ(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function lJ(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function uJ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var dJ={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(Q.test(e))e=parseFloat(e);else return e}return`${uJ(e,t.target.x)}% ${uJ(e,t.target.y)}%`}},fJ={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=bU.parse(e);if(i.length>5)return r;let a=bU.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=wU(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},pJ={borderRadius:{...dJ,applyTo:[...TK]},borderTopLeftRadius:dJ,borderTopRightRadius:dJ,borderBottomLeftRadius:dJ,borderBottomRightRadius:dJ,boxShadow:fJ};function mJ(e,{layout:t,layoutId:n}){return MW.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!pJ[e]||e===`opacity`)}function hJ(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(YG(r[t])||i&&YG(i[t])||mJ(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function gJ(e){return window.getComputedStyle(e)}var _J=class extends Iq{constructor(){super(...arguments),this.type=`html`,this.renderInstance=lJ}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(MW.has(t))return this.projection?.isProjecting?DW(t):kW(e,t);{let n=gJ(e),r=(MH(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return rJ(e,t)}build(e,t,n){cJ(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return hJ(e,t,n)}},vJ={offset:`stroke-dashoffset`,array:`stroke-dasharray`},yJ={offset:`strokeDashoffset`,array:`strokeDasharray`};function bJ(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?vJ:yJ;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var xJ=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function SJ(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(cJ(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of xJ)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&bJ(d,i,a,o,!1)}var CJ=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),wJ=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function TJ(e,t,n,r){lJ(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(CJ.has(n)?n:QG(n),t.attrs[n])}function EJ(e,t,n){let r=hJ(e,t,n);for(let n in e)if(YG(e[n])||YG(t[n])){let t=jW.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var DJ=class extends Iq{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=vq}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(MW.has(t)){let e=yK(t);return e&&e.default||0}return t=CJ.has(t)?t:QG(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return EJ(e,t,n)}build(e,t,n){SJ(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){TJ(e,t,n,r)}mount(e){this.isSVGTag=wJ(e.tagName),super.mount(e)}},OJ=Cq.length;function kJ(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&kJ(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<OJ;n++){let r=Cq[n],i=e.props[r];(xq(i)||i===!1)&&(t[r]=i)}return t}function AJ(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var jJ=[...Sq].reverse(),MJ=Sq.length;function NJ(e){return t=>Promise.all(t.map(({animation:t,options:n})=>aK(e,t,n)))}function PJ(e){let t=NJ(e),n=LJ(),r=!0,i=!1,a=t=>(n,r)=>{let i=UG(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=kJ(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<MJ;t++){let p=jJ[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=xq(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||bq(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=FJ(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=GG(t)&&GG(n)?!AJ(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let ee=v&&y;b&&(!ee||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!ee&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=UG(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=SG(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=UG(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=LJ(),i=!0}}}function FJ(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!AJ(t,e):!1}function IJ(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function LJ(){return{animate:IJ(!0),whileInView:IJ(),whileHover:IJ(),whileTap:IJ(),whileDrag:IJ(),whileFocus:IJ(),exit:IJ()}}function RJ(e,t){e.min=t.min,e.max=t.max}function zJ(e,t){RJ(e.x,t.x),RJ(e.y,t.y)}function BJ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var VJ=.9999,HJ=1.0001,UJ=-.01,WJ=.01;function GJ(e){return e.max-e.min}function KJ(e,t,n){return Math.abs(e-t)<=n}function qJ(e,t,n,r=.5){e.origin=r,e.originPoint=wU(t.min,t.max,e.origin),e.scale=GJ(n)/GJ(t),e.translate=wU(n.min,n.max,e.origin)-e.originPoint,(e.scale>=VJ&&e.scale<=HJ||isNaN(e.scale))&&(e.scale=1),(e.translate>=UJ&&e.translate<=WJ||isNaN(e.translate))&&(e.translate=0)}function JJ(e,t,n,r){qJ(e.x,t.x,n.x,r?r.originX:void 0),qJ(e.y,t.y,n.y,r?r.originY:void 0)}function YJ(e,t,n,r=0){e.min=(r?wU(n.min,n.max,r):n.min)+t.min,e.max=e.min+GJ(t)}function XJ(e,t,n,r){YJ(e.x,t.x,n.x,r?.x),YJ(e.y,t.y,n.y,r?.y)}function ZJ(e,t,n,r=0){let i=r?wU(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+GJ(t)}function QJ(e,t,n,r){ZJ(e.x,t.x,n.x,r?.x),ZJ(e.y,t.y,n.y,r?.y)}function $J(e,t,n,r,i){return e-=t,e=Kq(e,1/n,r),i!==void 0&&(e=Kq(e,1/i,r)),e}function eY(e,t=0,n=1,r=.5,i,a=e,o=e){if($H.test(t)&&(t=parseFloat(t),t=wU(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=wU(a.min,a.max,r);e===a&&(s-=t),e.min=$J(e.min,t,n,s,i),e.max=$J(e.max,t,n,s,i)}function tY(e,t,[n,r,i],a,o){eY(e,t[n],t[r],t[i],t.scale,a,o)}var nY=[`x`,`scaleX`,`originX`],rY=[`y`,`scaleY`,`originY`];function iY(e,t,n,r){tY(e.x,t,nY,n?n.x:void 0,r?r.x:void 0),tY(e.y,t,rY,n?n.y:void 0,r?r.y:void 0)}function aY(e){return e.translate===0&&e.scale===1}function oY(e){return aY(e.x)&&aY(e.y)}function sY(e,t){return e.min===t.min&&e.max===t.max}function cY(e,t){return sY(e.x,t.x)&&sY(e.y,t.y)}function lY(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uY(e,t){return lY(e.x,t.x)&&lY(e.y,t.y)}function dY(e){return GJ(e.x)/GJ(e.y)}function fY(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function pY(e){return[e(`x`),e(`y`)]}function mY(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var hY=TK.length,gY=e=>typeof e==`string`?parseFloat(e):e,_Y=e=>typeof e==`number`||Q.test(e);function vY(e,t,n,r,i,a){i?(e.opacity=wU(0,n.opacity??1,bY(r)),e.opacityExit=wU(t.opacity??1,0,xY(r))):a&&(e.opacity=wU(t.opacity??1,n.opacity??1,r));for(let i=0;i<hY;i++){let a=TK[i],o=yY(t,a),s=yY(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||_Y(o)===_Y(s)?(e[a]=Math.max(wU(gY(o),gY(s),r),0),($H.test(s)||$H.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=wU(t.rotate||0,n.rotate||0,r))}function yY(e,t){return e[t]===void 0?e.borderRadius:e[t]}var bY=SY(0,.5,uH),xY=SY(.5,.95,GV);function SY(e,t,n){return r=>r<e?0:r>t?1:n(qV(e,t,r))}function CY(e,t,n){let r=YG(e)?e:DG(e);return r.start(LG(``,r,t,n)),r.animation}function wY(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var TY=(e,t)=>e.depth-t.depth,EY=class{constructor(){this.children=[],this.isDirty=!1}add(e){LV(this.children,e),this.isDirty=!0}remove(e){RV(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(TY),this.isDirty=!1,this.children.forEach(e)}};function DY(e,t){let n=AH.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(TH(r),e(a-t))};return wH.setup(r,!0),()=>TH(r)}function OY(e){return YG(e)?e.get():e}var kY=class{constructor(){this.members=[]}add(e){LV(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(RV(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(RV(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},AY={hasAnimatedSinceResize:!0,hasEverUpdated:!1},jY={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},MY=[``,`X`,`Y`,`Z`],NY=1e3,PY=0;function FY(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function IY(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=eK(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,wH,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&IY(r)}function LY({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=PY++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,dq.value&&(jY.nodes=jY.calculatedTargetDeltas=jY.calculatedProjections=0),this.nodes.forEach(BY),this.nodes.forEach(YY),this.nodes.forEach(XY),this.nodes.forEach(VY),dq.addProjectionMetrics&&dq.addProjectionMetrics(jY)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new EY)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new JV),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=XK(t)&&!fq(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;wH.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=DY(i,250),AY.hasAnimatedSinceResize&&(AY.hasAnimatedSinceResize=!1,this.nodes.forEach(JY)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||rX,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!uY(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...kG(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||JY(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),TH(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ZY),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&IY(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(WY),this.nodes.forEach(UY);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(GY);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(KY),this.nodes.forEach(qY),this.nodes.forEach(RY),this.nodes.forEach(zY)):this.nodes.forEach(GY),this.clearAllSnapshots();let e=AH.now();EH.delta=zV(0,1e3/60,e-EH.timestamp),EH.timestamp=e,EH.isProcessing=!0,DH.update.process(EH),DH.preRender.process(EH),DH.render.process(EH),EH.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,kK.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(HY),this.sharedNodes.forEach(QY)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wH.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wH.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!GJ(this.snapshot.measuredBox.x)&&!GJ(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=vq(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!oY(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Uq(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),sX(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return vq();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(lX))){let{scroll:e}=this.root;e&&($q(t.x,e.offset.x),$q(t.y,e.offset.y))}return t}removeElementScroll(e){let t=vq();if(zJ(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&zJ(t,e),$q(t.x,i.offset.x),$q(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||vq();zJ(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&($q(r.x,-n.scroll.offset.x),$q(r.y,-n.scroll.offset.y)),Uq(n.latestValues)&&nJ(r,n.latestValues,n.layout?.layoutBox)}return Uq(this.latestValues)&&nJ(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=vq();zJ(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Uq(n.latestValues))continue;let r;n.instance&&(Hq(n.latestValues)&&n.updateSnapshot(),r=vq(),zJ(r,n.measurePageBox())),iY(t,n.latestValues,n.snapshot?.layoutBox,r)}return Uq(this.latestValues)&&iY(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==EH.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=EH.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=vq(),this.targetWithTransforms=vq()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),XJ(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):zJ(this.target,this.layout.layoutBox),Yq(this.target,this.targetDelta)):zJ(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),dq.value&&jY.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Hq(this.parent.latestValues)||Wq(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vq(),this.relativeTargetOrigin=vq(),QJ(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),zJ(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===EH.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;zJ(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Qq(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=vq());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(BJ(this.prevProjectionDelta.x,this.projectionDelta.x),BJ(this.prevProjectionDelta.y,this.projectionDelta.y)),JJ(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!fY(this.projectionDelta.x,this.prevProjectionDelta.x)||!fY(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),dq.value&&jY.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=gq(),this.projectionDelta=gq(),this.projectionDeltaWithTransform=gq()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=gq();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=vq(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(nX));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=wU(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=wU(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):($Y(o.x,e.x,n),$Y(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(QJ(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),tX(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&cY(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=vq(),zJ(f,this.relativeTarget)),c&&(this.animationValues=a,vY(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(TH(this.pendingAnimation),void 0),this.pendingAnimation=wH.update(()=>{AY.hasAnimatedSinceResize=!0,this.motionValue||=DG(0),this.motionValue.jump(0,!1),this.currentAnimation=CY(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(NY),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&cX(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||vq();let t=GJ(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=GJ(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}zJ(t,n),nJ(t,i),JJ(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new kY),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&FY(`z`,e,r,this.animationValues);for(let t=0;t<MY.length;t++)FY(`rotate${MY[t]}`,e,r,this.animationValues),FY(`skew${MY[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=OY(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=OY(t?.pointerEvents)||``),this.hasProjected&&!Uq(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=mY(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in pJ){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=pJ[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?OY(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(UY),this.root.sharedNodes.clear()}}}function RY(e){e.updateLayout()}function zY(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)pY(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=GJ(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;RJ(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else cX(i,t.layoutBox,n)&&pY(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=GJ(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=gq();JJ(o,n,t.layoutBox);let s=gq();a?JJ(s,e.applyTransform(r,!0),t.measuredBox):JJ(s,n,t.layoutBox);let c=!oY(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=vq();QJ(s,t.layoutBox,i.layoutBox,o);let c=vq();QJ(c,n,a.layoutBox,o),uY(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function BY(e){dq.value&&jY.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function VY(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function HY(e){e.clearSnapshot()}function UY(e){e.clearMeasurements()}function WY(e){e.isLayoutDirty=!0,e.updateLayout()}function GY(e){e.isLayoutDirty=!1}function KY(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function qY(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function JY(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YY(e){e.resolveTargetDelta()}function XY(e){e.calcProjection()}function ZY(e){e.resetSkewAndRotation()}function QY(e){e.removeLeadSnapshot()}function $Y(e,t,n){e.translate=wU(t.translate,0,n),e.scale=wU(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function eX(e,t,n,r){e.min=wU(t.min,n.min,r),e.max=wU(t.max,n.max,r)}function tX(e,t,n,r){eX(e.x,t.x,n.x,r),eX(e.y,t.y,n.y,r)}function nX(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var rX={duration:.45,ease:[.4,0,.1,1]},iX=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),aX=iX(`applewebkit/`)&&!iX(`chrome/`)?Math.round:GV;function oX(e){e.min=aX(e.min),e.max=aX(e.max)}function sX(e){oX(e.x),oX(e.y)}function cX(e,t,n){return e===`position`||e===`preserve-aspect`&&!KJ(dY(t),dY(n),.2)}function lX(e){return e!==e.root&&e.scroll?.wasRoot}var uX=LY({attachResizeListener:(e,t)=>wY(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),dX={current:void 0},fX=LY({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!dX.current){let e=new uX({});e.mount(window),e.setOptions({layoutScroll:!0}),dX.current=e}return dX.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),pX=(0,N.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function mX(e=!0){let t=(0,N.useContext)(IV);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,N.useId)();(0,N.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,N.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var hX=(0,N.createContext)({strict:!1}),gX={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},_X=!1;function vX(){if(_X)return;let e={};for(let t in gX)e[t]={isEnabled:e=>gX[t].some(t=>!!e[t])};Nq(e),_X=!0}function yX(){return vX(),Pq()}function bX(e){let t=yX();for(let n in e)t[n]={...t[n],...e[n]};Nq(t)}var xX=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function SX(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||xX.has(e)}function CX(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var wX=n((()=>{})),TX=r({default:()=>DX}),EX,DX,OX=n((()=>{wX(),EX=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,DX=CX(function(e){return EX.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),kX=e=>!SX(e);function AX(e){typeof e==`function`&&(kX=t=>t.startsWith(`on`)?!SX(t):e(t))}try{AX((OX(),t(TX)).default)}catch{}function jX(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(YG(e[i])||(kX(i)||n===!0&&SX(i)||!t&&!SX(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}var MX=(0,N.createContext)({});function NX(e,t){if(wq(e)){let{initial:t,animate:n}=e;return{initial:t===!1||xq(t)?t:void 0,animate:xq(n)?n:void 0}}return e.inherit===!1?{}:t}function PX(e){let{initial:t,animate:n}=NX(e,(0,N.useContext)(MX));return(0,N.useMemo)(()=>({initial:t,animate:n}),[FX(t),FX(n)])}function FX(e){return Array.isArray(e)?e.join(` `):e}var IX=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function LX(e,t,n){for(let r in t)!YG(t[r])&&!mJ(r,n)&&(e[r]=t[r])}function RX({transformTemplate:e},t){return(0,N.useMemo)(()=>{let n=IX();return cJ(n,t,e),Object.assign({},n.vars,n.style)},[t])}function zX(e,t){let n=e.style||{},r={};return LX(r,n,e),Object.assign(r,RX(e,t)),r}function BX(e,t){let n={},r=zX(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var VX=()=>({...IX(),attrs:{}});function HX(e,t,n,r){let i=(0,N.useMemo)(()=>{let n=VX();return SJ(n,t,wJ(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};LX(t,e.style,e),i.style={...t,...i.style}}return i}var UX=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function WX(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(UX.indexOf(e)>-1||/[A-Z]/u.test(e))}function GX(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??WX(e)?HX:BX)(t,r,i,e),c=jX(t,typeof e==`string`,a),l=e===N.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,N.useMemo)(()=>YG(u)?u.get():u,[u]);return(0,N.createElement)(e,{...l,children:d})}function KX({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:qX(n,r,i,e),renderState:t()}}function qX(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=OY(a[e]);let{initial:o,animate:s}=e,c=wq(e),l=Tq(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!bq(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=HG(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var JX=e=>(t,n)=>{let r=(0,N.useContext)(MX),i=(0,N.useContext)(IV),a=()=>KX(e,t,r,i);return n?a():PV(a)},YX=JX({scrapeMotionValuesFromProps:hJ,createRenderState:IX}),XX=JX({scrapeMotionValuesFromProps:EJ,createRenderState:VX}),ZX=Symbol.for(`motionComponentSymbol`);function QX(e,t,n){let r=(0,N.useRef)(n);(0,N.useInsertionEffect)(()=>{r.current=n});let i=(0,N.useRef)(null);return(0,N.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var $X=(0,N.createContext)({});function eZ(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function tZ(e,t,n,r,i,a){let{visualElement:o}=(0,N.useContext)(MX),s=(0,N.useContext)(hX),c=(0,N.useContext)(IV),l=(0,N.useContext)(pX),u=l.reducedMotion,d=l.skipAnimations,f=(0,N.useRef)(null),p=(0,N.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,N.useContext)($X);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&nZ(f.current,n,i,h);let g=(0,N.useRef)(!1);(0,N.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[$G],v=(0,N.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return FV(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,N.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function nZ(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:rZ(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&eZ(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function rZ(e){if(e)return e.options.allowProjection===!1?rZ(e.parent):e.projection}function iZ(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&bX(r);let a=n?n===`svg`:WX(e),o=a?XX:YX;function s(n,s){let c,l={...(0,N.useContext)(pX),...n,layoutId:aZ(n)},{isStatic:u}=l,d=PX(n),f=o(n,u);if(!u&&typeof window<`u`){oZ(l,r);let t=sZ(l);c=t.MeasureLayout,d.visualElement=tZ(e,f,l,i,t.ProjectionNode,a)}return(0,M.jsxs)(MX.Provider,{value:d,children:[c&&d.visualElement?(0,M.jsx)(c,{visualElement:d.visualElement,...l}):null,GX(e,n,QX(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,N.forwardRef)(s);return c[ZX]=e,c}function aZ({layoutId:e}){let t=(0,N.useContext)(NV).id;return t&&e!==void 0?t+`-`+e:e}function oZ(e,t){(0,N.useContext)(hX).strict}function sZ(e){let{drag:t,layout:n}=yX();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function cZ(e,t){if(typeof Proxy>`u`)return iZ;let n=new Map,r=(n,r)=>iZ(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,iZ(a,void 0,e,t)),n.get(a))})}var lZ=(e,t)=>t.isSVG??WX(e)?new DJ(t):new _J(t,{allowProjection:e!==N.Fragment}),uZ=class extends Lq{constructor(e){super(e),e.animationState||=PJ(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();bq(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},dZ=0,fZ={animation:{Feature:uZ},exit:{Feature:class extends Lq{constructor(){super(...arguments),this.id=dZ++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=UG(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function pZ(e){return{point:{x:e.pageX,y:e.pageY}}}var mZ=e=>t=>RK(t)&&e(t,pZ(t));function hZ(e,t,n,r){return wY(e,t,mZ(n),r)}var gZ=({current:e})=>e?e.ownerDocument.defaultView:null,_Z=(e,t)=>Math.abs(e-t);function vZ(e,t){let n=_Z(e.x,t.x),r=_Z(e.y,t.y);return Math.sqrt(n**2+r**2)}var yZ=new Set([`auto`,`scroll`]),bZ=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=xZ(this.lastRawMoveEventInfo,this.transformPagePoint));let e=CZ(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=vZ(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=EH;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=xZ(t,this.transformPagePoint),wH.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=CZ(e.type===`pointercancel`?this.lastMoveEventInfo:xZ(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!RK(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=xZ(pZ(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=EH;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,CZ(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=KV(hZ(this.contextWindow,`pointermove`,this.handlePointerMove,d),hZ(this.contextWindow,`pointerup`,this.handlePointerUp,d),hZ(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(yZ.has(e.overflowX)||yZ.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),wH.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),TH(this.updatePoint)}};function xZ(e,t){return t?{point:t(e.point)}:e}function SZ(e,t){return{x:e.x-t.x,y:e.y-t.y}}function CZ({point:e},t){return{point:e,delta:SZ(e,TZ(t)),offset:SZ(e,wZ(t)),velocity:EZ(t,.1)}}function wZ(e){return e[0]}function TZ(e){return e[e.length-1]}function EZ(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=TZ(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>YV(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>YV(t)*2&&(r=e[1]);let a=XV(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function DZ(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?wU(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?wU(n,e,r.max):Math.min(e,n)),e}function OZ(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function kZ(e,{top:t,left:n,bottom:r,right:i}){return{x:OZ(e.x,n,i),y:OZ(e.y,t,r)}}function AZ(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function jZ(e,t){return{x:AZ(e.x,t.x),y:AZ(e.y,t.y)}}function MZ(e,t){let n=.5,r=GJ(e),i=GJ(t);return i>r?n=qV(t.min,t.max-r,e.min):r>i&&(n=qV(e.min,e.max-i,t.min)),zV(0,1,n)}function NZ(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var PZ=.35;function FZ(e=PZ){return e===!1?e=0:e===!0&&(e=PZ),{x:IZ(e,`left`,`right`),y:IZ(e,`top`,`bottom`)}}function IZ(e,t,n){return{min:LZ(e,t),max:LZ(e,n)}}function LZ(e,t){return typeof e==`number`?e:e[t]||0}var RZ=new WeakMap,zZ=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=vq(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(pZ(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=NK(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pY(e=>{let t=this.getAxisMotionValue(e).get()||0;if($H.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=GJ(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&wH.update(()=>i(e,t),!1,!0),ZG(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=UZ(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&wH.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new bZ(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:gZ(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&wH.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!HZ(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=DZ(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&eZ(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?kZ(n.layoutBox,e):!1,this.elastic=FZ(t),r!==this.constraints&&!eZ(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&pY(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=NZ(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!eZ(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=iJ(n,r.root,this.visualElement.getTransformPagePoint()),a=jZ(r.layout.layoutBox,i);if(t){let e=t(zq(a));this.hasMutatedConstraints=!!e,e&&(a=Rq(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=pY(o=>{if(!HZ(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return ZG(this.visualElement,e),n.start(LG(e,n,0,t,this.visualElement,!1))}stopAnimation(){pY(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){pY(t=>{let{drag:n}=this.getProps();if(!HZ(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-wU(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!eZ(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};pY(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=MZ({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),pY(t=>{if(!HZ(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(wU(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;RZ.set(this.visualElement,this);let e=this.visualElement.current,t=hZ(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&HK(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();eZ(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=VZ(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),wH.read(r);let o=wY(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(pY(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=PZ,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function BZ(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function VZ(e,t,n){let r=uq(e,BZ(n)),i=uq(t,BZ(n));return()=>{r(),i()}}function HZ(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function UZ(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var WZ=class extends Lq{constructor(e){super(e),this.removeGroupControls=GV,this.removeListeners=GV,this.controls=new zZ(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||GV}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},GZ=e=>(t,n)=>{e&&wH.update(()=>e(t,n),!1,!0)},KZ=class extends Lq{constructor(){super(...arguments),this.removePointerDownListener=GV}onPointerDown(e){this.session=new bZ(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gZ(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:GZ(e),onStart:GZ(t),onMove:GZ(n),onEnd:(e,t)=>{delete this.session,r&&wH.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=hZ(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},qZ=!1,JZ=class extends N.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),qZ&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),AY.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),qZ=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||wH.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),kK.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;qZ=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function YZ(e){let[t,n]=mX(),r=(0,N.useContext)(NV);return(0,M.jsx)(JZ,{...e,layoutGroup:r,switchLayoutGroup:(0,N.useContext)($X),isPresent:t,safeToRemove:n})}var XZ={pan:{Feature:KZ},drag:{Feature:WZ,ProjectionNode:fX,MeasureLayout:YZ}};function ZZ(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&wH.postRender(()=>i(t,pZ(t)))}var QZ=class extends Lq{mount(){let{current:e}=this.node;e&&(this.unmount=IK(e,(e,t)=>(ZZ(this.node,t,`Start`),e=>ZZ(this.node,e,`End`))))}unmount(){}},$Z=class extends Lq{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=KV(wY(this.node.current,`focus`,()=>this.onFocus()),wY(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function eQ(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&wH.postRender(()=>i(t,pZ(t)))}var tQ=class extends Lq{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=YK(e,(e,t)=>(eQ(this.node,t,`Start`),(e,{success:t})=>eQ(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},nQ=new WeakMap,rQ=new WeakMap,iQ=e=>{let t=nQ.get(e.target);t&&t(e)},aQ=e=>{e.forEach(iQ)};function oQ({root:e,...t}){let n=e||document;rQ.has(n)||rQ.set(n,{});let r=rQ.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(aQ,{root:e,...t})),r[i]}function sQ(e,t,n){let r=oQ(t);return nQ.set(e,n),r.observe(e),()=>{nQ.delete(e),r.unobserve(e)}}var cQ={some:0,all:1},lQ=class extends Lq{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:cQ[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=sQ(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(uQ(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function uQ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var dQ={inView:{Feature:lQ},tap:{Feature:tQ},focus:{Feature:$Z},hover:{Feature:QZ}},fQ={layout:{ProjectionNode:fX,MeasureLayout:YZ}},pQ=cZ({...fZ,...dQ,...XZ,...fQ},lZ),mQ=new Map,hQ=e=>{let t=mQ.get(e);return t||(t=pQ.create(e),mQ.set(e,t)),t},gQ=(0,N.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=hQ(t),o=(0,N.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,M.jsx)(a,{animate:{backgroundPosition:`0% center`},className:j(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,n),initial:{backgroundPosition:`100% center`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))`},transition:{duration:r,ease:`linear`,repeat:1/0},children:e})}),_Q=(0,N.createContext)(null),vQ=()=>{let e=(0,N.useContext)(_Q);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e},yQ=1e3,bQ=1e3,xQ=(0,N.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r,onOpenChange:i,duration:a,children:o,...s})=>{let c=r??t,l=r===!1,[u,d]=iV({defaultProp:c,onChange:i,prop:n}),[f,p]=iV({defaultProp:void 0,prop:a}),m=(0,N.useRef)(t),[h,g]=(0,N.useState)(!1),_=(0,N.useRef)(null);(0,N.useEffect)(()=>{t?(m.current=!0,_.current===null&&(_.current=Date.now())):_.current!==null&&(p(Math.ceil((Date.now()-_.current)/bQ)),_.current=null)},[t,p]),(0,N.useEffect)(()=>{t&&!u&&!l&&d(!0)},[t,u,d,l]),(0,N.useEffect)(()=>{if(m.current&&!t&&u&&!h){let e=setTimeout(()=>{d(!1),g(!0)},yQ);return()=>clearTimeout(e)}},[t,u,d,h]);let v=(0,N.useCallback)(e=>{d(e)},[d]),y=(0,N.useMemo)(()=>({duration:f,isOpen:u,isStreaming:t,setIsOpen:d}),[f,u,t,d]);return(0,M.jsx)(_Q.Provider,{value:y,children:(0,M.jsx)(AV,{className:j(`not-prose mb-4`,e),onOpenChange:v,open:u,...s,children:o})})}),SQ=(e,t)=>e||t===0?(0,M.jsx)(gQ,{duration:1,children:`Thinking...`}):t===void 0?(0,M.jsx)(`p`,{children:`Thought for a few seconds`}):(0,M.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]}),CQ=(0,N.memo)(({className:e,children:t,getThinkingMessage:n=SQ,...r})=>{let{isStreaming:i,isOpen:a,duration:o}=vQ();return(0,M.jsx)(jV,{className:j(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...r,children:t??(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Je,{className:`size-4`}),n(i,o),(0,M.jsx)(he,{className:j(`size-4 transition-transform`,a?`rotate-180`:`rotate-0`)})]})})}),wQ=(0,N.memo)(({className:e,children:t,...n})=>(0,M.jsx)(MV,{className:j(`mt-4 text-sm`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n,children:(0,M.jsx)(gI,{children:t})}));xQ.displayName=`Reasoning`,CQ.displayName=`ReasoningTrigger`,wQ.displayName=`ReasoningContent`;var TQ={"approval-requested":(0,M.jsx)(ze,{className:`size-4 text-yellow-600`}),"approval-responded":(0,M.jsx)(Ye,{className:`size-4 text-blue-600`}),"input-available":(0,M.jsx)(ze,{className:`size-4 animate-pulse`}),"input-streaming":(0,M.jsx)(pe,{className:`size-4`}),"output-available":(0,M.jsx)(Ye,{className:`size-4 text-green-600`}),"output-denied":(0,M.jsx)(Xe,{className:`size-4 text-orange-600`}),"output-error":(0,M.jsx)(Xe,{className:`size-4 text-red-600`})};function EQ(e){return(0,M.jsx)(Ge,{className:`gap-1.5 text-xs`,variant:`secondary`,children:TQ[e]})}var DQ=({className:e,...t})=>(0,M.jsx)(AV,{className:j(`group not-prose mb-4 w-full rounded-sm border`,e),...t}),OQ={run_commands:(0,M.jsx)(ut,{className:`size-4`}),read_files:(0,M.jsx)(Qe,{className:`size-4`}),editor:(0,M.jsx)(Be,{className:`size-4`}),ask_question:(0,M.jsx)(nt,{className:`size-4`})},kQ=e=>(0,M.jsx)(Ge,{className:`text-xs`,variant:`ghost`,children:e&&OQ[e]||(0,M.jsx)(He,{className:`size-4`})}),AQ=({className:e,title:t,type:n,state:r,toolName:i,...a})=>{let o=t?.split(`:`),s=o?.[0]||i,c=o?.[1],l=s||t||n.split(`-`).slice(1).join(`-`);return(0,M.jsx)(jV,{className:j(`flex w-full overflow-hidden items-center justify-between gap-4 p-3 cursor-pointer`,e),...a,children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[kQ(l),(0,M.jsx)(`span`,{className:`font-light text-muted-foreground text-sm truncated wrap-break-word ellipses`,children:c}),EQ(r)]})})},jQ=({className:e,...t})=>(0,M.jsx)(MV,{className:j(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-1 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in overflow-hidden font-mono`,e),...t}),MQ=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let i=(0,M.jsx)(`div`,{children:t});return typeof t==`object`&&!(0,N.isValidElement)(t)?i=(0,M.jsx)(cI,{code:JSON.stringify(t,null,2),language:`json`}):typeof t==`string`&&(i=(0,M.jsx)(cI,{code:t,language:`json`})),(0,M.jsx)(`div`,{className:j(`space-y-2`,e),...r,children:(0,M.jsxs)(`div`,{className:j(`overflow-auto rounded-md text-xs [&_table]:w-full max-h-20`,n?`bg-destructive/10 text-destructive`:`bg-muted/50 text-foreground`),children:[n&&(0,M.jsx)(`div`,{children:n}),i]})})},NQ=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`text-muted-foreground text-sm`,t),...n,children:e}),PQ=({defaultOpen:e=!0,className:t,...n})=>(0,M.jsx)(AV,{className:j(t),defaultOpen:e,...n}),FQ=({children:e,className:t,title:n,...r})=>(0,M.jsx)(jV,{className:j(`group`,t),...r,children:e??(0,M.jsxs)(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,children:[(0,M.jsx)(h,{className:`size-4`}),(0,M.jsx)(`p`,{className:`text-sm`,children:n}),(0,M.jsx)(he,{className:`size-4 transition-transform group-data-[state=open]:rotate-180`})]})}),IQ=({children:e,className:t,...n})=>(0,M.jsx)(MV,{className:j(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,t),...n,children:(0,M.jsx)(`div`,{className:`mt-4 space-y-2 border-muted border-l-2 pl-4`,children:e})});function LQ(e){return typeof e==`object`&&e?e:void 0}function $(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function RQ(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):void 0}function zQ(e){return e===`output-error`?`Failed`:e===`output-available`?`Done`:`Running`}function BQ(e){let t=LQ(e.input),n=LQ(e.output),r=zQ(e.state);switch(e.name){case`team_spawn_teammate`:return`${r} spawn teammate ${$(t?.agentId)??$(n?.agentId)??`agent`}`;case`team_shutdown_teammate`:return`${r} shutdown teammate ${$(t?.agentId)??$(n?.agentId)??`agent`}`;case`team_status`:return`${r} fetch team status`;case`team_task`:{let e=$(t?.action);return e===`create`?`${r} create task ${$(n?.taskId)??``}${$(t?.title)?`: ${$(t?.title)}`:``}`.trim():e===`list`?`${r} list team tasks`:e===`claim`?`${r} claim task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():e===`complete`?`${r} complete task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():e===`block`?`${r} block task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():`${r} update team task`}case`team_run_task`:{let e=$(t?.agentId)??$(n?.agentId)??`agent`,i=$(n?.mode)??$(t?.runMode),a=$(n?.status),o=$(t?.task),s=o?`: ${o}`:``;return`${r} ${i===`async`?`queue`:a===`joined`?`join`:`run`} task with ${e}${a?` (${a})`:``}${s}`}case`team_cancel_run`:return`${r} cancel run ${$(t?.runId)??$(n?.runId)??``}`.trim();case`team_list_runs`:return`${r} list teammate runs`;case`team_await_run`:return`${r} await run ${$(t?.runId)??``}`.trim();case`team_await_all_runs`:return`${r} await all active runs`;case`team_send_message`:return`${r} message ${$(t?.toAgentId)??$(n?.toAgentId)??`agent`}${$(t?.subject)?`: ${$(t?.subject)}`:``}`;case`team_broadcast`:return`${r} broadcast${$(t?.subject)?`: ${$(t?.subject)}`:``}`;case`team_read_mailbox`:return`${r} read mailbox`;case`team_mission_log`:return`${r} log ${$(t?.kind)??`update`}${$(t?.summary)?`: ${$(t?.summary)}`:``}`;case`team_cleanup`:return`${r} clean up team runtime`;case`team_create_outcome`:return`${r} create outcome${$(t?.title)?`: ${$(t?.title)}`:``}`;case`team_attach_outcome_fragment`:return`${r} attach fragment to ${$(t?.section)??`section`}`;case`team_review_outcome_fragment`:return`${r} ${t?.approved===!1?`reject`:`review`} fragment ${$(t?.fragmentId)??``}`.trim();case`team_finalize_outcome`:return`${r} finalize outcome ${$(t?.outcomeId)??$(n?.outcomeId)??``}`.trim();case`team_list_outcomes`:return`${r} list outcomes`;default:return`${r} ${e.name.replace(/^team_/,``).replaceAll(`_`,` `)}`}}function VQ(e){if(e.error)return e.error;let t=LQ(e.input),n=LQ(e.output);switch(e.name){case`team_task`:{let e=$(t?.action);if(e===`create`)return $(t?.description);if(e===`block`)return $(t?.reason);if(e===`list`){let e=Array.isArray(n?.tasks)?n.tasks.length:void 0;return typeof e==`number`?`${e} task${e===1?``:`s`}`:void 0}return}case`team_run_task`:return $(n?.message)??$(n?.runId)??$(n?.text);case`team_send_message`:case`team_broadcast`:return $(t?.body);case`team_mission_log`:return $(t?.nextAction)??$(t?.summary);case`team_attach_outcome_fragment`:return $(t?.content);case`team_status`:{let e=Array.isArray(n?.members)?n.members.length:void 0,t=Array.isArray(n?.tasks)?n.tasks.length:void 0,r=Array.isArray(n?.runs)?n.runs.length:void 0;return[typeof e==`number`?`${e} members`:void 0,typeof t==`number`?`${t} tasks`:void 0,typeof r==`number`?`${r} runs`:void 0].filter(Boolean).join(` • `)||void 0}case`team_list_runs`:{let t=Array.isArray(e.output)?e.output:void 0;return t?.length?`${t.length} run${t.length===1?``:`s`}`:`No runs`}case`team_read_mailbox`:{let t=Array.isArray(e.output)?e.output:void 0;return t?.length?`${t.length} message${t.length===1?``:`s`}`:`No messages`}case`team_create_outcome`:{let e=RQ(t?.requiredSections);return e?.length?e.join(`, `):void 0}default:return}}function HQ({className:e,defaultOpen:t=!0,events:n,...r}){if(n.length===0)return null;let i=n.length===1?`Team activity`:`Team activity (${n.length})`;return(0,M.jsxs)(PQ,{className:e,defaultOpen:t,...r,children:[(0,M.jsx)(FQ,{title:i,children:(0,M.jsxs)(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,children:[(0,M.jsx)(dt,{className:`size-4`}),(0,M.jsx)(`p`,{className:`text-sm`,children:i})]})}),(0,M.jsx)(IQ,{children:n.map(e=>{let t=VQ(e);return(0,M.jsxs)(NQ,{className:`space-y-1`,children:[(0,M.jsx)(`div`,{children:BQ(e)}),t?(0,M.jsx)(`div`,{className:`line-clamp-3 text-xs text-muted-foreground/90`,children:t}):null]},e.id)})})]})}function UQ(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);var WQ=1,GQ=100,KQ=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:WQ++,qQ=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-GQ;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=KQ(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],N.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(YQ(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=KQ(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},JQ=(e,t)=>qQ.message(e,t),YQ=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,XQ=Object.assign(JQ,{success:qQ.success,info:qQ.info,warning:qQ.warning,error:qQ.error,custom:qQ.custom,message:qQ.message,promise:qQ.promise,dismiss:qQ.dismiss,loading:qQ.loading},{getHistory:()=>qQ.toasts,getToasts:()=>qQ.getActiveToasts()});UQ(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);var ZQ={audio:rt,document:Le,image:ue,source:et,unknown:it,video:ft},QQ=e=>{if(e.type===`source-document`)return`source`;let t=e.mediaType??``;return t.startsWith(`image/`)?`image`:t.startsWith(`video/`)?`video`:t.startsWith(`audio/`)?`audio`:t.startsWith(`application/`)||t.startsWith(`text/`)?`document`:`unknown`},$Q=(e,t,n)=>n?(0,M.jsx)(`img`,{alt:t||`Image`,className:`size-full object-cover`,height:96,src:e,width:96}):(0,M.jsx)(`img`,{alt:t||`Image`,className:`size-full rounded object-cover`,height:20,src:e,width:20}),e$=(0,N.createContext)(null),t$=(0,N.createContext)(null),n$=()=>(0,N.useContext)(e$)??{variant:`grid`},r$=()=>{let e=(0,N.useContext)(t$);if(!e)throw Error(`Attachment components must be used within <Attachment>`);return e},i$=({variant:e=`grid`,className:t,children:n,...r})=>{let i=(0,N.useMemo)(()=>({variant:e}),[e]);return(0,M.jsx)(e$.Provider,{value:i,children:(0,M.jsx)(`div`,{className:j(`flex items-start`,e===`list`?`flex-col gap-2`:`flex-wrap gap-2`,e===`grid`&&`ml-auto w-fit`,t),...r,children:n})})},a$=({data:e,onRemove:t,className:n,children:r,...i})=>{let{variant:a}=n$(),o=QQ(e),s=(0,N.useMemo)(()=>({data:e,mediaCategory:o,onRemove:t,variant:a}),[e,o,t,a]);return(0,M.jsx)(t$.Provider,{value:s,children:(0,M.jsx)(`div`,{className:j(`group relative`,a===`grid`&&`size-24 overflow-hidden rounded-lg`,a===`inline`&&[`flex h-8 cursor-pointer select-none items-center gap-1.5`,`rounded-md border border-border px-1.5`,`font-medium text-sm transition-all`,`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`],a===`list`&&[`flex w-full items-center gap-3 rounded-lg border p-3`,`hover:bg-accent/50`],n),...i,children:r})})},o$=({fallbackIcon:e,className:t,...n})=>{let{data:r,mediaCategory:i,variant:a}=r$(),o=a===`inline`?`size-3`:`size-4`,s=e=>(0,M.jsx)(e,{className:j(o,`text-muted-foreground`)}),c=()=>{if(i===`image`&&r.type===`file`&&r.url)return $Q(r.url,r.filename,a===`grid`);if(i===`video`&&r.type===`file`&&r.url)return(0,M.jsx)(`video`,{className:`size-full object-cover`,muted:!0,src:r.url});let t=ZQ[i];return e??s(t)};return(0,M.jsx)(`div`,{className:j(`flex shrink-0 items-center justify-center overflow-hidden`,a===`grid`&&`size-full bg-muted`,a===`inline`&&`size-5 rounded bg-background`,a===`list`&&`size-12 rounded bg-muted`,t),...n,children:c()})},s$=({label:e=`Remove`,className:t,children:n,...r})=>{let{onRemove:i,variant:a}=r$(),o=(0,N.useCallback)(e=>{e.stopPropagation(),i?.()},[i]);return i?(0,M.jsxs)(A,{"aria-label":e,className:j(a===`grid`&&[`absolute top-2 right-2 size-6 rounded-full p-0`,`bg-background/80 backdrop-blur-sm`,`opacity-0 transition-opacity group-hover:opacity-100`,`hover:bg-background`,`[&>svg]:size-3`],a===`inline`&&[`size-5 rounded p-0`,`opacity-0 transition-opacity group-hover:opacity-100`,`[&>svg]:size-2.5`],a===`list`&&[`size-8 shrink-0 rounded p-0`,`[&>svg]:size-4`],t),onClick:o,type:`button`,variant:`ghost`,...r,children:[n??(0,M.jsx)(le,{}),(0,M.jsx)(`span`,{className:`sr-only`,children:e})]}):null},c$=e=>(0,M.jsx)(_e,{...e}),l$=e=>(0,M.jsx)(Se,{...e}),u$=({className:e,children:t,title:n=`Model Selector`,...r})=>(0,M.jsxs)(xe,{"aria-describedby":void 0,className:j(`outline! border-none! p-0 outline-border! outline-solid!`,e),...r,children:[(0,M.jsx)(Te,{className:`sr-only`,children:n}),(0,M.jsx)(wB,{className:`**:data-[slot=command-input-wrapper]:h-auto`,children:t})]}),d$=({className:e,...t})=>(0,M.jsx)(TB,{className:j(`h-auto py-3.5`,e),...t}),f$=e=>(0,M.jsx)(EB,{...e}),p$=e=>(0,M.jsx)(DB,{...e}),m$=e=>(0,M.jsx)(OB,{...e}),h$=e=>(0,M.jsx)(kB,{...e}),g$=({provider:e,className:t,...n})=>(0,M.jsx)(`img`,{...n,alt:`${e} logo`,className:j(`size-3 dark:invert`,t),height:12,src:`https://models.dev/logos/${e}.svg`,width:12}),_$=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`flex shrink-0 items-center -space-x-1 [&>img]:rounded-full [&>img]:bg-background [&>img]:p-px [&>img]:ring-1 dark:[&>img]:bg-foreground`,e),...t}),v$=({className:e,...t})=>(0,M.jsx)(`span`,{className:j(`flex-1 truncate text-left`,e),...t});function y$(){let e=zB();return e.files.length===0?null:(0,M.jsx)(i$,{variant:`inline`,children:e.files.map(t=>(0,M.jsxs)(a$,{data:t,onRemove:()=>e.remove(t.id),children:[(0,M.jsx)(o$,{}),(0,M.jsx)(s$,{})]},t.id))})}function b$({autoApproveTools:e,enableSpawn:t,enableTeams:n,model:r,modelSelectorOpen:i,models:a,onAutoApproveToolsChange:o,onEnableSpawnChange:s,onEnableTeamsChange:c,onModelChange:l,onModelSelectorOpenChange:u,onProviderChange:d,provider:f,providers:p,workspaceRoot:m}){let h=p.find(e=>e.id===f),_=a.find(e=>e.id===r)??a[0]??void 0;return(0,M.jsxs)(`div`,{className:`grid gap-3 bg-background/70 p-3`,children:[(0,M.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(De,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,children:`Provider`}),(0,M.jsxs)(ye,{onValueChange:e=>{e&&d(e)},value:f,children:[(0,M.jsx)(Oe,{className:`w-full`,children:(0,M.jsx)(ke,{placeholder:`Select provider`})}),(0,M.jsx)(ve,{children:p.map(e=>(0,M.jsx)(ge,{value:e.id,children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x$(e.id),(0,M.jsx)(`span`,{children:e.name})]})},e.id))})]})]}),(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(De,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,children:`Model`}),(0,M.jsxs)(c$,{onOpenChange:u,open:i,children:[(0,M.jsx)(l$,{children:(0,M.jsx)(A,{className:`w-full justify-between`,variant:`outline`,children:(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[h&&x$(h.id),(0,M.jsx)(`span`,{className:`truncate`,children:_?.name||_?.id||`Select model`})]})})}),(0,M.jsxs)(u$,{children:[(0,M.jsx)(d$,{placeholder:`Search models...`}),(0,M.jsxs)(f$,{children:[(0,M.jsx)(p$,{children:`No models found.`}),(0,M.jsx)(m$,{heading:h?.name||`Models`,children:a.map(e=>(0,M.jsxs)(h$,{onSelect:()=>{l(e.id),u(!1)},value:e.id,children:[h&&x$(h.id),(0,M.jsx)(v$,{children:e.name||e.id}),(0,M.jsx)(_$,{children:h&&x$(h.id)}),r===e.id?(0,M.jsx)(g,{className:`ml-auto size-4`}):(0,M.jsx)(`div`,{className:`ml-auto size-4`})]},e.id))})]})]})]})]})]}),(0,M.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(De,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,htmlFor:`workspace-root`,children:`Workspace`}),(0,M.jsx)(E,{id:`workspace-root`,readOnly:!0,value:m})]})}),(0,M.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,M.jsx)(S$,{checked:t,label:`Subagents`,onChange:s}),(0,M.jsx)(S$,{checked:n,label:`Agent Teams`,onChange:c}),(0,M.jsx)(S$,{checked:e,label:`Auto-approves`,onChange:o})]})]})}function x$(e){return(0,M.jsx)(g$,{className:`size-3.5`,provider:e||`openai`})}function S$({checked:e,label:t,onChange:n,disabled:r}){return(0,M.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border bg-background/60 px-3 py-2`,children:[(0,M.jsx)(De,{className:`text-sm`,htmlFor:t,children:t}),(0,M.jsx)(Pe,{checked:e,id:t,onCheckedChange:e=>n(e),disabled:r})]})}var C$={None:`none`,Low:`low`,Medium:`medium`,High:`high`},w$=[{value:C$.None,label:`Thinking Off`,icon:st},{value:C$.Low,label:`Low`,icon:ot},{value:C$.Medium,label:`Medium`,icon:ct},{value:C$.High,label:`High`,icon:st}];function T$({autoApproveTools:e,disabled:t=!1,enableSpawn:n,enableTeams:r,enableTools:i,maxIterations:a,model:o,mode:s,modelSelectorOpen:c,models:l,onAbort:u,onAutoApproveToolsChange:d,onEnableSpawnChange:f,onEnableTeamsChange:p,onEnableToolsChange:m,onModeChange:h,onMaxIterationsChange:g,onModelChange:_,onModelSelectorOpenChange:v,onProviderChange:y,onSend:b,onSystemPromptChange:x,onReasonLevelChange:S,provider:C,providers:w,sending:T,status:E,systemPrompt:ee,reasonLevel:D,workspaceRoot:te}){let[O,ne]=(0,N.useState)(!1),k=PB(),re=zB(),ie=l.find(e=>e.id===o)?.supportsThinking===!0,ae=ie?D:C$.None,oe=Math.max(w$.findIndex(e=>e.value===ae),0),se=w$[oe].icon;return(0,M.jsx)(`div`,{className:`border-t bg-background`,children:(0,M.jsxs)(VB,{accept:`image/*,.txt,.md,.json,.ts,.tsx,.js,.jsx`,globalDrop:!0,className:`rounded-none [&>[data-slot=input-group]]:border-0! [&>[data-slot=input-group]]:ring-0! [&>[data-slot=input-group]]:has-[[data-slot=input-group-control]:focus-visible]:border-0! [&>[data-slot=input-group]]:has-[[data-slot=input-group-control]:focus-visible]:ring-0!`,maxFiles:8,multiple:!0,onError:e=>XQ.error(e.message),onSubmit:async e=>{let t=e.text.trim();if(!t&&!e.files.length)return;let n;if(e.files.length>0){let t=(await Promise.all(e.files.map(e=>E$(e.url)))).filter(e=>!!e);t.length>0&&(n={userImages:t}),t.length!==e.files.length&&XQ.warning(`Only image attachments are currently sent in the VS Code chat runtime.`)}!t&&!n?.userImages?.length||b({prompt:t,attachments:n,attachmentCount:e.files.length})},children:[(0,M.jsx)(WB,{children:(0,M.jsx)(y$,{})}),(0,M.jsx)(HB,{children:(0,M.jsx)(UB,{disabled:t||E.includes(`Failed`),onChange:e=>k.textInput.setInput(e.target.value),placeholder:`Type @ for context and / for skills`,value:k.textInput.value,className:`text-sm outline-none ring-0`})}),(0,M.jsxs)(GB,{className:`flex-col items-stretch gap-1 px-0`,children:[O?(0,M.jsx)(b$,{autoApproveTools:e,enableSpawn:n,enableTeams:r,enableTools:i,maxIterations:a,model:o,modelSelectorOpen:c,models:l,onAutoApproveToolsChange:d,onEnableSpawnChange:f,onEnableTeamsChange:p,onEnableToolsChange:m,onMaxIterationsChange:g,onModelChange:_,onModelSelectorOpenChange:v,onProviderChange:y,onSystemPromptChange:x,provider:C,providers:w,systemPrompt:ee,workspaceRoot:te}):null,(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,M.jsxs)(KB,{className:`shrink-0`,children:[(0,M.jsx)(qB,{disabled:t,onClick:()=>re.openFileDialog(),type:`button`,variant:`ghost`,children:(0,M.jsx)(it,{className:`size-3`})}),(0,M.jsxs)(qB,{disabled:t,onClick:()=>ne(e=>!e),type:`button`,variant:O?`default`:`ghost`,children:[(0,M.jsx)(at,{className:`size-3`}),(0,M.jsxs)(`span`,{children:[C,`:`,o]})]}),(0,M.jsx)(qB,{disabled:t||!ie,onClick:()=>{S(w$[(oe+1)%w$.length].value)},type:`button`,title:w$[oe].label,variant:ae===C$.None?`ghost`:`default`,children:(0,M.jsx)(se,{className:`size-3`})}),(0,M.jsxs)(qB,{disabled:t,onClick:()=>h(s===`act`?`plan`:`act`),type:`button`,variant:s===`plan`?`default`:`ghost`,className:`hidden`,children:[s===`act`?(0,M.jsx)(Ne,{className:`size-3`}):(0,M.jsx)(tt,{className:`size-3`}),s]}),(0,M.jsx)(Ge,{className:`rounded-sm px-3 py-1 text-xs hidden`,variant:E.includes(`Error`)?`destructive`:`secondary`,children:E})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[T?(0,M.jsx)(A,{onClick:u,type:`button`,variant:`destructive`,children:`Abort`}):null,(0,M.jsx)(JB,{disabled:t||E.includes(`Failed`),status:T?`submitted`:`ready`,variant:`ghost`})]})]})]})]})})}async function E$(e){if(e){if(e.startsWith(`data:image/`))return e;if(e.startsWith(`blob:`))try{let t=await(await fetch(e)).blob();return t.type.startsWith(`image/`)?await new Promise(e=>{let n=new FileReader;n.onloadend=()=>{e(typeof n.result==`string`?n.result:void 0)},n.onerror=()=>e(void 0),n.readAsDataURL(t)}):void 0}catch{return}}}var D$=r({default:()=>r1}),O$={lastProvider:``,lastModelByProvider:{}};function k$(){try{let e=ae()?.getState();if(e?.modelSelection)return e.modelSelection}catch{}return O$}function A$(e){try{let t=ae();if(!t)return;let n=t.getState()??{};t.setState({...n,modelSelection:e})}catch{}}function j$(e){let t=Number.parseInt(e,10);return Number.isInteger(t)&&t>0?t:void 0}function M$(e,t,n){return{id:`${Date.now()}-${Math.random().toString(16).slice(2)}`,role:e,text:t,...n}}function N$(e,t,n=0){let r=n||(t?.userImages?.length??0);return r===0?e:`${e}${e.length>0?`
|
|
341
341
|
|
|
342
|
-
`:``}[attached ${r} file${r===1?``:`s`}]`}function P$(e){if(typeof e==`string`)return e;try{return JSON.stringify(e??null,null,2)}catch{return String(e)}}function F$(e,t,n){if(!t)return e;let r=n.current;if(r){let n=e.findIndex(e=>e.id===r);if(n>=0)return e.map((e,r)=>r===n?{...e,text:`${e.text}${t}`,blocks:I$(e.blocks,t)}:e)}let i=e.at(-1);if(i?.role===`assistant`)return n.current=i.id,[...e.slice(0,-1),{...i,text:`${i.text}${t}`,blocks:I$(i.blocks,t)}];let a=M$(`assistant`,t,{blocks:[{id:Pt(),type:`text`,text:t}]});return n.current=a.id,[...e,a]}function I$(e,t){let n=e??[];return n.at(-1)?.type===`text`?n.map((e,r)=>r===n.length-1&&e.type===`text`?{...e,text:`${e.text}${t}`}:e):[...n,{id:Pt(),type:`text`,text:t}]}function L$(e,t,n){let r=e??[];return r.at(-1)?.type===`reasoning`?r.map((e,i)=>i===r.length-1&&e.type===`reasoning`?{...e,text:`${e.text}${t}`,redacted:e.redacted||n}:e):[...r,{id:Pt(),type:`reasoning`,text:t,redacted:n}]}function R$(e,t){let n=e??[],r=n.findIndex(e=>e.type===`tool`&&(e.toolEvent.toolCallId&&t.toolCallId&&e.toolEvent.toolCallId===t.toolCallId||!e.toolEvent.toolCallId&&!t.toolCallId&&e.toolEvent.name===t.name&&e.toolEvent.state===`input-available`&&t.state!==`input-available`));return r===-1?[...n,{id:Pt(),type:`tool`,toolEvent:t}]:n.map((e,n)=>n===r&&e.type===`tool`?{...e,toolEvent:{...e.toolEvent,...t}}:e)}function z$(e,t,n,r){let i=t||(n?`[redacted]`:``);if(!i)return e;let a=r.current;if(a){let t=e.findIndex(e=>e.id===a);if(t>=0)return e.map((e,r)=>r===t?{...e,reasoning:`${e.reasoning??``}${i}`,reasoningRedacted:e.reasoningRedacted||n,blocks:L$(e.blocks,i,n)}:e)}let o=e.at(-1);if(o?.role===`assistant`)return r.current=o.id,[...e.slice(0,-1),{...o,reasoning:`${o.reasoning??``}${i}`,reasoningRedacted:o.reasoningRedacted||n,blocks:L$(o.blocks,i,n)}];let s=M$(`assistant`,``,{reasoning:i,reasoningRedacted:n,blocks:[{id:Pt(),type:`reasoning`,text:i,redacted:n}]});return r.current=s.id,[...e,s]}function B$(e,t,n){return e.some(e=>e.blocks?.some(e=>e.type===`media`&&e.media.id===t.id))?e:(n.current=void 0,[...e,M$(`assistant`,``,{blocks:[{id:`media:${t.id}`,type:`media`,media:t}]})])}function V$(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`object`&&e[0]!==null&&`result`in e[0]}function H$(e){return e==null?``:typeof e==`string`?e:typeof e==`object`?Object.values(e).filter(e=>typeof e==`string`||typeof e==`number`).map(String).join(` `):String(e)}function U$(e,t){return e==null?t:typeof e==`string`?e:JSON.stringify(e,null,2)}function W$(e){if(V$(e.output))return e.output.map((t,n)=>{let r=t.query??``,i=r?`${e.name}: ${r}`:e.name,a=t.success===!1?`output-error`:e.state,o=t.result??(t.success===!1?`(failed)`:`(no output)`),s=t.success===!1?t.result??`failed`:void 0;return{id:`${e.id}-${n}`,name:e.name,title:i,state:a,output:o,error:s}});let t=H$(e.input),n=t?`${e.name}: ${t}`:e.name;return[{id:e.id,name:e.name,title:n,state:e.state,output:e.error??U$(e.output,e.text),error:e.error}]}function G$(e){let t=/^Running (.+)\.\.\.$/.exec(e);return t?.[1]?t[1]:/^(.+?) (completed|failed:.*)$/.exec(e)?.[1]??`tool`}function K$(e){return e.includes(`failed:`)?`output-error`:e.endsWith(`completed`)?`output-available`:`input-available`}function q$(e,t){return e?.status===`failed`?`output-error`:e?.status===`completed`?`output-available`:e?.status===`running`?`input-available`:K$(t??``)}function J$(e,t){let n=e.findIndex(e=>e.toolCallId&&t.toolCallId&&e.toolCallId===t.toolCallId||!e.toolCallId&&!t.toolCallId&&e.name===t.name&&e.state===`input-available`&&t.state!==`input-available`);return n===-1?[...e,t]:e.map((e,r)=>r===n?{...e,text:t.text,state:t.state,output:t.output,error:t.error}:e)}function Y$(e,t,n,r){let i=r.current,a={id:Pt(),toolCallId:n?.toolCallId,name:n?.toolName??G$(t),state:q$(n,t),text:t,input:n?.input,output:n?.output,error:n?.error};return i?e.map(e=>e.id===i?{...e,toolEvents:J$(e.toolEvents??[],a),blocks:R$(e.blocks,a)}:e):[...e,M$(`meta`,t,{toolEvents:[a],blocks:[{id:Pt(),type:`tool`,toolEvent:a}]})]}function X$(e,t){if(t.length===0)return e;let n=[...e];for(let e of t){let t=n.at(-1);if(e.role===`assistant`&&t?.role===`assistant`){n[n.length-1]={...t,text:`${t.text}${e.text}`,reasoning:`${t.reasoning??``}${e.reasoning??``}`||void 0,reasoningRedacted:t.reasoningRedacted||e.reasoningRedacted||void 0,toolEvents:[...t.toolEvents??[],...e.toolEvents??[]],blocks:[...t.blocks??[],...e.blocks??[]]};continue}if(e.role===`meta`&&t?.role===`meta`&&(e.toolEvents?.length??0)>0){n[n.length-1]={...t,text:e.text||t.text,toolEvents:[...t.toolEvents??[],...e.toolEvents??[]],blocks:[...t.blocks??[],...e.blocks??[]]};continue}n.push(e)}return n}function Z$(e,t){return W$(e).map(e=>(0,M.jsxs)(DQ,{className:t,children:[(0,M.jsx)(AQ,{state:e.state,title:e.title,type:`dynamic-tool`,toolName:e.name}),(0,M.jsx)(jQ,{children:(0,M.jsx)(MQ,{errorText:e.error,output:e.output})})]},e.id))}function Q$(e){let t=[];for(let n of e.toolEvents??[])t.push({id:`legacy-tool-${n.id}`,type:`tool`,toolEvent:n});return e.reasoning&&t.push({id:`legacy-reasoning-${e.id}`,type:`reasoning`,text:e.reasoning,redacted:e.reasoningRedacted}),e.text&&t.push({id:`legacy-text-${e.id}`,type:`text`,text:e.text}),t}function $$(e,t){return(e.blocks?.length?e.blocks:Q$(e)).flatMap(e=>{switch(e.type){case`tool`:return e.toolEvent.name.startsWith(`team_`)?[(0,M.jsx)(HQ,{className:t.isMeta?`mt-3 w-full`:`mb-3 w-full`,events:[e.toolEvent]},e.id)]:Z$(e.toolEvent,t.isMeta?`mt-3`:`mb-3`);case`reasoning`:return[(0,M.jsxs)(xQ,{className:t.isMeta?`mt-3`:`mb-3`,defaultOpen:!1,children:[(0,M.jsx)(CQ,{}),(0,M.jsx)(wQ,{children:e.text})]},e.id)];case`media`:return[(0,M.jsx)(Mt,{classNames:{image:`max-h-96 max-w-full rounded-md`,audio:`w-full`,video:`max-h-96 max-w-full`,unavailable:`rounded-md border p-3 text-sm`},media:e.media},e.id)];case`text`:return t.isMeta?[(0,M.jsx)(`pre`,{className:`whitespace-pre-wrap font-inherit`,children:e.text},e.id)]:[(0,M.jsx)(vI,{children:(0,M.jsx)(yI,{children:e.text})},e.id)]}return[]})}function e1(e,t,n,r){return[...e,M$(`meta`,`Done (${t}) • iterations=${n} • input=${r?.inputTokens??0} output=${r?.outputTokens??0}`)]}function t1(e){return[e.title?.trim()||e.sessionId.slice(0,12),e.workspaceRoot?.trim()?e.workspaceRoot.trim().split(`/`).pop():void 0].filter(Boolean).join(` • `)}function n1(e){try{return new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(new Date(e))}catch{return`Checkpoint`}}function r1({initialSessionId:e,onSessionSelected:t}){let[n,r]=(0,N.useState)([]),[i,a]=(0,N.useState)(`Waiting for RPC initialization...`),[o,s]=(0,N.useState)(),[c,l]=(0,N.useState)(),[u,d]=(0,N.useState)(!1),[p,m]=(0,N.useState)([]),[h,_]=(0,N.useState)({}),[v,y]=(0,N.useState)({workspaceRoot:``,cwd:``}),[b,x]=(0,N.useState)([]),[S,C]=(0,N.useState)(``),[w,T]=(0,N.useState)(k$),[E,ee]=(0,N.useState)(()=>w.lastProvider),[D,te]=(0,N.useState)(()=>w.lastModelByProvider[w.lastProvider]??``),[ne,k]=(0,N.useState)(``),[re,ie]=(0,N.useState)(``),[ae,oe]=(0,N.useState)(`act`),[se,ce]=(0,N.useState)(`none`),[ue,de]=(0,N.useState)(!0),[fe,me]=(0,N.useState)(!1),[ge,_e]=(0,N.useState)(!0),[ve,ye]=(0,N.useState)(!0),[be,xe]=(0,N.useState)([]),[Se,Ce]=(0,N.useState)(!1),[we,Te]=(0,N.useState)(!1),[Ee,De]=(0,N.useState)(!1),[Oe,ke]=(0,N.useState)(null),Ae=(0,N.useRef)(void 0),je=(0,N.useRef)(void 0),Ne=(0,N.useRef)(void 0),Pe=(0,N.useRef)(void 0),Fe=(0,N.useRef)(t),Ie=(0,N.useRef)(w),Le=(0,N.useRef)(b),Re=(0,N.useRef)(v),ze=(0,N.useCallback)(e=>{Ne.current===e||Pe.current===e&&!Ne.current||(Pe.current=e,Ne.current=e,s(e),l(e),r([]),d(!1),xe([]),Ae.current=void 0,a(`Loading chat history for ${e}...`),t?.(e),O({type:`attachSession`,sessionId:e}))},[t]);(0,N.useEffect)(()=>{Ne.current=c},[c]),(0,N.useEffect)(()=>{Pe.current=o},[o]),(0,N.useEffect)(()=>{Fe.current=t},[t]),(0,N.useEffect)(()=>{Le.current=b},[b]),(0,N.useEffect)(()=>{Re.current=v},[v]),(0,N.useEffect)(()=>{let e=e=>{let t=e.data;if(!(!t||typeof t!=`object`||!(`type`in t)))switch(t.type){case`status`:a(t.text);return;case`error`:if(t.recoverable){a(`Recoverable error (run continues): ${t.text}`);return}a(`Error: ${t.text}`),d(!1),l(void 0),Ne.current=void 0,Ae.current=void 0,r(e=>{if(e.length===0)return e;let n=`Error: ${t.text}`,r=e.at(-1);return r?.role===`error`&&r.text===n?e:[...e,M$(`error`,n)]});return;case`defaults`:y(t.defaults),t.defaults.provider&&ee(t.defaults.provider),t.defaults.model&&te(t.defaults.model);return;case`sessions`:x(t.sessions);return;case`providers`:m(t.providers),ee(e=>{let n=e&&t.providers.some(t=>t.id===e)?e:``,r=k$().lastProvider,i=n||(r&&t.providers.some(e=>e.id===r)?r:``)||t.providers.find(e=>e.enabled)?.id||t.providers[0]?.id||``;return i&&O({type:`loadModels`,providerId:i}),i});return;case`models`:_(e=>({...e,[t.providerId]:t.models})),te(e=>{if(e&&t.models.some(t=>t.id===e))return e;let n=Re.current;if(n.provider===t.providerId&&n.model&&t.models.some(e=>e.id===n.model))return n.model;let r=k$().lastModelByProvider[t.providerId];return r&&t.models.some(e=>e.id===r)?r:t.models[0]?.id||``});return;case`session_started`:Pe.current=t.sessionId,s(t.sessionId),Fe.current?.(t.sessionId),Te(!1),C(``);return;case`session_hydrated`:if(Ne.current&&Ne.current!==t.sessionId)return;if(Pe.current=t.sessionId,Ne.current=void 0,s(t.sessionId),l(void 0),d(t.status===`running`),t.providerId&&ee(t.providerId),t.providerId&&t.modelId){let e={lastProvider:t.providerId,lastModelByProvider:{...Ie.current.lastModelByProvider,[t.providerId]:t.modelId}};Ie.current=e,T(e),A$(e),te(t.modelId)}Te(!1),C(Le.current.find(e=>e.sessionId===t.sessionId)?.title?.trim()||``),r(e=>{let n=t.status===`running`?X$(t.messages,e):t.messages;return Ae.current=t.status===`running`?[...n].reverse().find(e=>e.role===`assistant`)?.id:void 0,n}),a(t.status===`running`?`Attached to ${t.sessionId} (running)`:`Attached to ${t.sessionId}`);return;case`assistant_delta`:r(e=>F$(e,t.text,Ae));return;case`reasoning_delta`:r(e=>z$(e,t.text,t.redacted,Ae));return;case`assistant_media`:r(e=>B$(e,t.media,Ae));return;case`tool_event`:r(e=>Y$(e,t.text,t.event,Ae));return;case`approval_request`:xe(e=>{let n=e.findIndex(e=>e.approvalId===t.approvalId),r={...t,responding:!1};return n===-1?[...e,r]:e.map((e,t)=>t===n?r:e)}),a(`Waiting for approval: ${t.toolName}`);return;case`approval_resolved`:xe(e=>e.filter(e=>e.approvalId!==t.approvalId));return;case`turn_done`:a(`Done (${t.finishReason})`),d(!1),xe([]),Ae.current=void 0,r(e=>e1(e,t.finishReason,t.iterations,t.usage));return;case`reset_done`:Pe.current=void 0,Ne.current=void 0,s(void 0),l(void 0),d(!1),xe([]),Te(!1),C(``),Ae.current=void 0,Fe.current?.(void 0),a(`Started a new chat session.`),r([]);return;case`fork_done`:De(!1),ke(null),a(`Forked → new session ${t.newSessionId}`);return;case`fork_error`:De(!1),ke(t.text),a(`Fork failed: ${t.text}`);return}};return window.addEventListener(`message`,e),O({type:`ready`}),()=>{window.removeEventListener(`message`,e)}},[]),(0,N.useEffect)(()=>{!e||je.current===e||(je.current=e,ze(e))},[ze,e]),(0,N.useEffect)(()=>{E&&O({type:`loadModels`,providerId:E})},[E]),(0,N.useEffect)(()=>{if(!E||!D)return;let e=Ie.current;if(e.lastProvider===E&&e.lastModelByProvider[E]===D)return;let t={lastProvider:E,lastModelByProvider:{...e.lastModelByProvider,[E]:D}};Ie.current=t,T(t),A$(t)},[E,D]);let Be=h[E]??[],Ve=!!c,He=Be.find(e=>e.id===D)?.supportsThinking===!0?se:`none`,Ue=(0,N.useMemo)(()=>n.filter(e=>e.role!==`meta`||e.text),[n]),We=o&&typeof b.find(e=>e.sessionId===o)?.title==`string`&&b.find(e=>e.sessionId===o)?.title?.trim()||``,Ge=we?S:We,Ke=()=>{if(!o){Te(!1);return}let e=S.replace(/\s+/g,` `).trim();Te(!1),e!==We&&(C(e),O({type:`updateSessionMetadata`,sessionId:o,metadata:{title:e}}))},qe=(e,t)=>{xe(t=>t.map(t=>t.approvalId===e?{...t,responding:!0}:t)),O({type:`approval_response`,approvalId:e,approved:t,reason:t?`Approved in Cline Hub.`:pe}),a(t?`Approval sent.`:`Rejection sent.`)};return(0,M.jsx)(LB,{children:(0,M.jsxs)(`div`,{className:`relative flex h-screen flex-col overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b px-4 py-3`,children:[(0,M.jsxs)(`div`,{className:`min-w-0`,children:[b.length>0?(0,M.jsxs)(`select`,{className:`max-w-48 rounded-md border bg-background px-2 py-1 text-xs`,disabled:Ve,onChange:e=>{let t=e.target.value;if(!t){O({type:`reset`}),a(`Resetting session...`),xe([]);return}ze(t)},value:o??``,children:[(0,M.jsx)(`option`,{value:``,children:`New session`}),b.map(e=>(0,M.jsx)(`option`,{value:e.sessionId,children:t1(e)},e.sessionId))]}):null,Ve?(0,M.jsxs)(`span`,{className:`ml-2 inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,M.jsx)(Me,{className:`size-3 animate-spin`}),`Loading history`]}):null,o?(0,M.jsx)(`input`,{className:`min-w-0 max-w-56 rounded-md border bg-muted px-2 py-1 text-xs`,disabled:Ve,onBlur:Ke,onChange:e=>C(e.target.value),onFocus:()=>{Te(!0),C(We)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),Ke())},placeholder:`Session title`,value:Ge}):null,o?(0,M.jsxs)(A,{disabled:Ve,onClick:()=>{a(`Deleting ${o}...`),O({type:`deleteSession`,sessionId:o})},size:`icon-sm`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(f,{className:`size-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Delete session`})]}):null]}),(0,M.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,M.jsxs)(A,{disabled:Ve,onClick:()=>{O({type:`reset`}),a(`Resetting session...`),xe([])},size:`icon-sm`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(he,{className:`size-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`New chat`})]})})]}),(0,M.jsxs)(Qt,{className:`min-h-0 flex-1`,children:[(0,M.jsxs)($t,{className:`px-4 py-5`,children:[Ve?(0,M.jsx)(`div`,{className:`flex h-full items-center justify-center rounded-xl border border-dashed px-6 py-16 text-center text-sm text-muted-foreground`,children:(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,M.jsx)(Me,{className:`size-4 animate-spin`}),`Loading chat history...`]})}):Ue.length===0?(0,M.jsx)(`div`,{className:`flex h-full items-center align-middle justify-center rounded-xl border border-dashed px-6 py-16 text-center text-sm text-muted-foreground`,children:`How can I help you?`}):null,Ue.map(e=>e.role===`meta`||e.role===`error`?(0,M.jsx)(`div`,{className:j(`w-full rounded-lg border px-4 py-3 text-sm`,e.role===`error`?`border-destructive/40 bg-destructive/10 text-destructive`:`bg-muted/40 text-muted-foreground`),children:$$(e,{isMeta:!0})},e.id):(0,M.jsx)(_I,{from:e.role,children:(0,M.jsxs)(`div`,{children:[$$(e,{sending:u}),e.role===`user`&&e.checkpoint?(0,M.jsx)(It,{className:`mt-1 justify-end`,children:(0,M.jsxs)(Rt,{className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground`,disabled:u,onClick:()=>{e.checkpoint&&O({type:`restore`,checkpointRunCount:e.checkpoint.runCount})},tooltip:`Checkpoint from run ${e.checkpoint.runCount}`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(Lt,{className:`size-3`}),n1(e.checkpoint.createdAt)]})}):null,e.role===`assistant`&&e.text&&!u?(0,M.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,M.jsxs)(A,{className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground`,disabled:Ee,onClick:()=>{De(!0),ke(null),O({type:`forkSession`})},size:`sm`,title:`Fork session — copy full message history into a new session`,type:`button`,variant:`ghost`,children:[Ee?(0,M.jsx)(Me,{className:`size-3 animate-spin`}):(0,M.jsx)($e,{className:`size-3`}),`Fork`]}),Oe?(0,M.jsx)(`span`,{className:`text-[11px] text-destructive`,children:Oe}):null]}):null]})},e.id))]}),(0,M.jsx)(en,{})]}),be.length>0?(0,M.jsx)(`div`,{className:`grid max-h-72 gap-2 overflow-auto border-t bg-background/95 px-4 py-3`,children:be.map(e=>(0,M.jsxs)(`div`,{className:`grid gap-2 rounded-lg border bg-card p-3 text-sm`,children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsx)(`p`,{className:`font-semibold`,children:`Approve tool call?`}),(0,M.jsx)(`p`,{className:`break-all text-muted-foreground text-xs`,children:e.toolName})]}),(0,M.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,M.jsxs)(A,{disabled:e.responding,onClick:()=>qe(e.approvalId,!1),size:`sm`,type:`button`,variant:`destructive`,children:[(0,M.jsx)(le,{className:`size-4`}),`Reject`]}),(0,M.jsxs)(A,{disabled:e.responding,onClick:()=>qe(e.approvalId,!0),size:`sm`,type:`button`,children:[e.responding?(0,M.jsx)(Me,{className:`size-4 animate-spin`}):(0,M.jsx)(g,{className:`size-4`}),`Approve`]})]})]}),(0,M.jsx)(`pre`,{className:`max-h-32 overflow-auto rounded-md border bg-background p-2 text-[11px]`,children:P$(e.input)})]},e.approvalId))}):null,(0,M.jsx)(T$,{autoApproveTools:ve,disabled:Ve,enableSpawn:fe,enableTeams:ge,enableTools:ue,maxIterations:re,model:D,mode:ae,modelSelectorOpen:Se,models:Be,onAbort:()=>{O({type:`abort`}),a(`Abort requested...`)},onAutoApproveToolsChange:ye,onEnableSpawnChange:me,onEnableTeamsChange:_e,onEnableToolsChange:de,onModeChange:oe,onMaxIterationsChange:ie,onModelChange:te,onModelSelectorOpenChange:Ce,onProviderChange:e=>{ee(e);let t=w.lastModelByProvider[e],n=(h[e]??[]).map(e=>e.id);if(t&&n.includes(t)){te(t);return}te(``)},onSend:({prompt:e,attachments:t,attachmentCount:n})=>{if(Ve)return;let i=M$(`assistant`,``);Ae.current=i.id,r(r=>[...r,M$(`user`,N$(e,t,n)),i]),d(!0),a(`Running...`),O({type:`send`,prompt:e,attachments:t,config:{autoApproveTools:ve,enableSpawn:fe,enableTeams:ge,enableTools:ue,maxIterations:j$(re),model:D||void 0,mode:ae,provider:E||void 0,reasonLevel:He,systemPrompt:ne.trim()||void 0}})},onSystemPromptChange:k,onReasonLevelChange:ce,provider:E,providers:p,sending:u,status:i,systemPrompt:ne,reasonLevel:He,workspaceRoot:v.workspaceRoot})]})})}export{Uw as a,r1 as default,AD as i,vT as n,ED as r,D$ as t};
|
|
342
|
+
`:``}[attached ${r} file${r===1?``:`s`}]`}function P$(e){if(typeof e==`string`)return e;try{return JSON.stringify(e??null,null,2)}catch{return String(e)}}function F$(e,t,n){if(!t)return e;let r=n.current;if(r){let n=e.findIndex(e=>e.id===r);if(n>=0)return e.map((e,r)=>r===n?{...e,text:`${e.text}${t}`,blocks:I$(e.blocks,t)}:e)}let i=e.at(-1);if(i?.role===`assistant`)return n.current=i.id,[...e.slice(0,-1),{...i,text:`${i.text}${t}`,blocks:I$(i.blocks,t)}];let a=M$(`assistant`,t,{blocks:[{id:Pt(),type:`text`,text:t}]});return n.current=a.id,[...e,a]}function I$(e,t){let n=e??[];return n.at(-1)?.type===`text`?n.map((e,r)=>r===n.length-1&&e.type===`text`?{...e,text:`${e.text}${t}`}:e):[...n,{id:Pt(),type:`text`,text:t}]}function L$(e,t,n){let r=e??[];return r.at(-1)?.type===`reasoning`?r.map((e,i)=>i===r.length-1&&e.type===`reasoning`?{...e,text:`${e.text}${t}`,redacted:e.redacted||n}:e):[...r,{id:Pt(),type:`reasoning`,text:t,redacted:n}]}function R$(e,t){let n=e??[],r=n.findIndex(e=>e.type===`tool`&&(e.toolEvent.toolCallId&&t.toolCallId&&e.toolEvent.toolCallId===t.toolCallId||!e.toolEvent.toolCallId&&!t.toolCallId&&e.toolEvent.name===t.name&&e.toolEvent.state===`input-available`&&t.state!==`input-available`));return r===-1?[...n,{id:Pt(),type:`tool`,toolEvent:t}]:n.map((e,n)=>n===r&&e.type===`tool`?{...e,toolEvent:{...e.toolEvent,...t}}:e)}function z$(e,t,n,r){let i=t||(n?`[redacted]`:``);if(!i)return e;let a=r.current;if(a){let t=e.findIndex(e=>e.id===a);if(t>=0)return e.map((e,r)=>r===t?{...e,reasoning:`${e.reasoning??``}${i}`,reasoningRedacted:e.reasoningRedacted||n,blocks:L$(e.blocks,i,n)}:e)}let o=e.at(-1);if(o?.role===`assistant`)return r.current=o.id,[...e.slice(0,-1),{...o,reasoning:`${o.reasoning??``}${i}`,reasoningRedacted:o.reasoningRedacted||n,blocks:L$(o.blocks,i,n)}];let s=M$(`assistant`,``,{reasoning:i,reasoningRedacted:n,blocks:[{id:Pt(),type:`reasoning`,text:i,redacted:n}]});return r.current=s.id,[...e,s]}function B$(e,t,n){return e.some(e=>e.blocks?.some(e=>e.type===`media`&&e.media.id===t.id))?e:(n.current=void 0,[...e,M$(`assistant`,``,{blocks:[{id:`media:${t.id}`,type:`media`,media:t}]})])}function V$(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`object`&&e[0]!==null&&`result`in e[0]}function H$(e){return e==null?``:typeof e==`string`?e:typeof e==`object`?Object.values(e).filter(e=>typeof e==`string`||typeof e==`number`).map(String).join(` `):String(e)}function U$(e,t){return e==null?t:typeof e==`string`?e:JSON.stringify(e,null,2)}function W$(e){if(V$(e.output))return e.output.map((t,n)=>{let r=t.query??``,i=r?`${e.name}: ${r}`:e.name,a=t.success===!1?`output-error`:e.state,o=t.result??(t.success===!1?`(failed)`:`(no output)`),s=t.success===!1?t.result??`failed`:void 0;return{id:`${e.id}-${n}`,name:e.name,title:i,state:a,output:o,error:s}});let t=H$(e.input),n=t?`${e.name}: ${t}`:e.name;return[{id:e.id,name:e.name,title:n,state:e.state,output:e.error??U$(e.output,e.text),error:e.error}]}function G$(e){let t=/^Running (.+)\.\.\.$/.exec(e);return t?.[1]?t[1]:/^(.+?) (completed|failed:.*)$/.exec(e)?.[1]??`tool`}function K$(e){return e.includes(`failed:`)?`output-error`:e.endsWith(`completed`)?`output-available`:`input-available`}function q$(e,t){return e?.status===`failed`?`output-error`:e?.status===`completed`?`output-available`:e?.status===`running`?`input-available`:K$(t??``)}function J$(e,t){let n=e.findIndex(e=>e.toolCallId&&t.toolCallId&&e.toolCallId===t.toolCallId||!e.toolCallId&&!t.toolCallId&&e.name===t.name&&e.state===`input-available`&&t.state!==`input-available`);return n===-1?[...e,t]:e.map((e,r)=>r===n?{...e,text:t.text,state:t.state,output:t.output,error:t.error}:e)}function Y$(e,t,n,r){let i=r.current,a={id:Pt(),toolCallId:n?.toolCallId,name:n?.toolName??G$(t),state:q$(n,t),text:t,input:n?.input,output:n?.output,error:n?.error};return i?e.map(e=>e.id===i?{...e,toolEvents:J$(e.toolEvents??[],a),blocks:R$(e.blocks,a)}:e):[...e,M$(`meta`,t,{toolEvents:[a],blocks:[{id:Pt(),type:`tool`,toolEvent:a}]})]}function X$(e,t){if(t.length===0)return e;let n=[...e];for(let e of t){let t=n.at(-1);if(e.role===`assistant`&&t?.role===`assistant`){n[n.length-1]={...t,text:`${t.text}${e.text}`,reasoning:`${t.reasoning??``}${e.reasoning??``}`||void 0,reasoningRedacted:t.reasoningRedacted||e.reasoningRedacted||void 0,toolEvents:[...t.toolEvents??[],...e.toolEvents??[]],blocks:[...t.blocks??[],...e.blocks??[]]};continue}if(e.role===`meta`&&t?.role===`meta`&&(e.toolEvents?.length??0)>0){n[n.length-1]={...t,text:e.text||t.text,toolEvents:[...t.toolEvents??[],...e.toolEvents??[]],blocks:[...t.blocks??[],...e.blocks??[]]};continue}n.push(e)}return n}function Z$(e,t){return W$(e).map(e=>(0,M.jsxs)(DQ,{className:t,children:[(0,M.jsx)(AQ,{state:e.state,title:e.title,type:`dynamic-tool`,toolName:e.name}),(0,M.jsx)(jQ,{children:(0,M.jsx)(MQ,{errorText:e.error,output:e.output})})]},e.id))}function Q$(e){let t=[];for(let n of e.toolEvents??[])t.push({id:`legacy-tool-${n.id}`,type:`tool`,toolEvent:n});return e.reasoning&&t.push({id:`legacy-reasoning-${e.id}`,type:`reasoning`,text:e.reasoning,redacted:e.reasoningRedacted}),e.text&&t.push({id:`legacy-text-${e.id}`,type:`text`,text:e.text}),t}function $$(e,t){return(e.blocks?.length?e.blocks:Q$(e)).flatMap(e=>{switch(e.type){case`tool`:return e.toolEvent.name.startsWith(`team_`)?[(0,M.jsx)(HQ,{className:t.isMeta?`mt-3 w-full`:`mb-3 w-full`,events:[e.toolEvent]},e.id)]:Z$(e.toolEvent,t.isMeta?`mt-3`:`mb-3`);case`reasoning`:return[(0,M.jsxs)(xQ,{className:t.isMeta?`mt-3`:`mb-3`,defaultOpen:!1,children:[(0,M.jsx)(CQ,{}),(0,M.jsx)(wQ,{children:e.text})]},e.id)];case`media`:return[(0,M.jsx)(Mt,{classNames:{image:`max-h-96 max-w-full rounded-md`,audio:`w-full`,video:`max-h-96 max-w-full`,unavailable:`rounded-md border p-3 text-sm`},media:e.media},e.id)];case`text`:return t.isMeta?[(0,M.jsx)(`pre`,{className:`whitespace-pre-wrap font-inherit`,children:e.text},e.id)]:[(0,M.jsx)(vI,{children:(0,M.jsx)(yI,{children:e.text})},e.id)]}return[]})}function e1(e,t,n,r){return[...e,M$(`meta`,`Done (${t}) • iterations=${n} • input=${r?.inputTokens??0} output=${r?.outputTokens??0}`)]}function t1(e){return[e.title?.trim()||e.sessionId.slice(0,12),e.workspaceRoot?.trim()?e.workspaceRoot.trim().split(`/`).pop():void 0].filter(Boolean).join(` • `)}function n1(e){try{return new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(new Date(e))}catch{return`Checkpoint`}}function r1({initialSessionId:e,onSessionSelected:t}){let[n,r]=(0,N.useState)([]),[i,a]=(0,N.useState)(`Waiting for RPC initialization...`),[o,s]=(0,N.useState)(),[c,l]=(0,N.useState)(),[u,d]=(0,N.useState)(!1),[p,m]=(0,N.useState)([]),[h,_]=(0,N.useState)({}),[v,y]=(0,N.useState)({workspaceRoot:``,cwd:``}),[b,x]=(0,N.useState)([]),[S,C]=(0,N.useState)(``),[w,T]=(0,N.useState)(k$),[E,ee]=(0,N.useState)(()=>w.lastProvider),[D,te]=(0,N.useState)(()=>w.lastModelByProvider[w.lastProvider]??``),[ne,k]=(0,N.useState)(``),[re,ie]=(0,N.useState)(``),[ae,oe]=(0,N.useState)(`act`),[se,ce]=(0,N.useState)(`none`),[ue,fe]=(0,N.useState)(!0),[pe,he]=(0,N.useState)(!1),[ge,_e]=(0,N.useState)(!0),[ve,ye]=(0,N.useState)(!0),[be,xe]=(0,N.useState)([]),[Se,Ce]=(0,N.useState)(!1),[we,Te]=(0,N.useState)(!1),[Ee,De]=(0,N.useState)(!1),[Oe,ke]=(0,N.useState)(null),Ae=(0,N.useRef)(void 0),je=(0,N.useRef)(void 0),Ne=(0,N.useRef)(void 0),Pe=(0,N.useRef)(void 0),Fe=(0,N.useRef)(t),Ie=(0,N.useRef)(w),Le=(0,N.useRef)(b),Re=(0,N.useRef)(v),ze=(0,N.useCallback)(e=>{Ne.current===e||Pe.current===e&&!Ne.current||(Pe.current=e,Ne.current=e,s(e),l(e),r([]),d(!1),xe([]),Ae.current=void 0,a(`Loading chat history for ${e}...`),t?.(e),O({type:`attachSession`,sessionId:e}))},[t]);(0,N.useEffect)(()=>{Ne.current=c},[c]),(0,N.useEffect)(()=>{Pe.current=o},[o]),(0,N.useEffect)(()=>{Fe.current=t},[t]),(0,N.useEffect)(()=>{Le.current=b},[b]),(0,N.useEffect)(()=>{Re.current=v},[v]),(0,N.useEffect)(()=>{let e=e=>{let t=e.data;if(!(!t||typeof t!=`object`||!(`type`in t)))switch(t.type){case`status`:a(t.text);return;case`error`:if(t.recoverable){a(`Recoverable error (run continues): ${t.text}`);return}a(`Error: ${t.text}`),d(!1),l(void 0),Ne.current=void 0,Ae.current=void 0,r(e=>{if(e.length===0)return e;let n=`Error: ${t.text}`,r=e.at(-1);return r?.role===`error`&&r.text===n?e:[...e,M$(`error`,n)]});return;case`defaults`:y(t.defaults),t.defaults.provider&&ee(t.defaults.provider),t.defaults.model&&te(t.defaults.model);return;case`sessions`:x(t.sessions);return;case`providers`:m(t.providers),ee(e=>{let n=e&&t.providers.some(t=>t.id===e)?e:``,r=k$().lastProvider,i=n||(r&&t.providers.some(e=>e.id===r)?r:``)||t.providers.find(e=>e.enabled)?.id||t.providers[0]?.id||``;return i&&O({type:`loadModels`,providerId:i}),i});return;case`models`:_(e=>({...e,[t.providerId]:t.models})),te(e=>{if(e&&t.models.some(t=>t.id===e))return e;let n=Re.current;if(n.provider===t.providerId&&n.model&&t.models.some(e=>e.id===n.model))return n.model;let r=k$().lastModelByProvider[t.providerId];return r&&t.models.some(e=>e.id===r)?r:t.models[0]?.id||``});return;case`session_started`:Pe.current=t.sessionId,s(t.sessionId),Fe.current?.(t.sessionId),Te(!1),C(``);return;case`session_hydrated`:if(Ne.current&&Ne.current!==t.sessionId)return;if(Pe.current=t.sessionId,Ne.current=void 0,s(t.sessionId),l(void 0),d(t.status===`running`),t.providerId&&ee(t.providerId),t.providerId&&t.modelId){let e={lastProvider:t.providerId,lastModelByProvider:{...Ie.current.lastModelByProvider,[t.providerId]:t.modelId}};Ie.current=e,T(e),A$(e),te(t.modelId)}Te(!1),C(Le.current.find(e=>e.sessionId===t.sessionId)?.title?.trim()||``),r(e=>{let n=t.status===`running`?X$(t.messages,e):t.messages;return Ae.current=t.status===`running`?[...n].reverse().find(e=>e.role===`assistant`)?.id:void 0,n}),a(t.status===`running`?`Attached to ${t.sessionId} (running)`:`Attached to ${t.sessionId}`);return;case`assistant_delta`:r(e=>F$(e,t.text,Ae));return;case`reasoning_delta`:r(e=>z$(e,t.text,t.redacted,Ae));return;case`assistant_media`:r(e=>B$(e,t.media,Ae));return;case`tool_event`:r(e=>Y$(e,t.text,t.event,Ae));return;case`approval_request`:xe(e=>{let n=e.findIndex(e=>e.approvalId===t.approvalId),r={...t,responding:!1};return n===-1?[...e,r]:e.map((e,t)=>t===n?r:e)}),a(`Waiting for approval: ${t.toolName}`);return;case`approval_resolved`:xe(e=>e.filter(e=>e.approvalId!==t.approvalId));return;case`turn_done`:a(`Done (${t.finishReason})`),d(!1),xe([]),Ae.current=void 0,r(e=>e1(e,t.finishReason,t.iterations,t.usage));return;case`reset_done`:Pe.current=void 0,Ne.current=void 0,s(void 0),l(void 0),d(!1),xe([]),Te(!1),C(``),Ae.current=void 0,Fe.current?.(void 0),a(`Started a new chat session.`),r([]);return;case`fork_done`:De(!1),ke(null),a(`Forked → new session ${t.newSessionId}`);return;case`fork_error`:De(!1),ke(t.text),a(`Fork failed: ${t.text}`);return}};return window.addEventListener(`message`,e),O({type:`ready`}),()=>{window.removeEventListener(`message`,e)}},[]),(0,N.useEffect)(()=>{!e||je.current===e||(je.current=e,ze(e))},[ze,e]),(0,N.useEffect)(()=>{E&&O({type:`loadModels`,providerId:E})},[E]),(0,N.useEffect)(()=>{if(!E||!D)return;let e=Ie.current;if(e.lastProvider===E&&e.lastModelByProvider[E]===D)return;let t={lastProvider:E,lastModelByProvider:{...e.lastModelByProvider,[E]:D}};Ie.current=t,T(t),A$(t)},[E,D]);let Be=h[E]??[],Ve=!!c,He=Be.find(e=>e.id===D)?.supportsThinking===!0?se:`none`,Ue=(0,N.useMemo)(()=>n.filter(e=>e.role!==`meta`||e.text),[n]),We=o&&typeof b.find(e=>e.sessionId===o)?.title==`string`&&b.find(e=>e.sessionId===o)?.title?.trim()||``,Ge=we?S:We,Ke=()=>{if(!o){Te(!1);return}let e=S.replace(/\s+/g,` `).trim();Te(!1),e!==We&&(C(e),O({type:`updateSessionMetadata`,sessionId:o,metadata:{title:e}}))},qe=(e,t)=>{xe(t=>t.map(t=>t.approvalId===e?{...t,responding:!0}:t)),O({type:`approval_response`,approvalId:e,approved:t,reason:t?`Approved in Cline Hub.`:de}),a(t?`Approval sent.`:`Rejection sent.`)};return(0,M.jsx)(LB,{children:(0,M.jsxs)(`div`,{className:`relative flex h-screen flex-col overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b px-4 py-3`,children:[(0,M.jsxs)(`div`,{className:`min-w-0`,children:[b.length>0?(0,M.jsxs)(`select`,{className:`max-w-48 rounded-md border bg-background px-2 py-1 text-xs`,disabled:Ve,onChange:e=>{let t=e.target.value;if(!t){O({type:`reset`}),a(`Resetting session...`),xe([]);return}ze(t)},value:o??``,children:[(0,M.jsx)(`option`,{value:``,children:`New session`}),b.map(e=>(0,M.jsx)(`option`,{value:e.sessionId,children:t1(e)},e.sessionId))]}):null,Ve?(0,M.jsxs)(`span`,{className:`ml-2 inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,M.jsx)(Me,{className:`size-3 animate-spin`}),`Loading history`]}):null,o?(0,M.jsx)(`input`,{className:`min-w-0 max-w-56 rounded-md border bg-muted px-2 py-1 text-xs`,disabled:Ve,onBlur:Ke,onChange:e=>C(e.target.value),onFocus:()=>{Te(!0),C(We)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),Ke())},placeholder:`Session title`,value:Ge}):null,o?(0,M.jsxs)(A,{disabled:Ve,onClick:()=>{a(`Deleting ${o}...`),O({type:`deleteSession`,sessionId:o})},size:`icon-sm`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(f,{className:`size-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Delete session`})]}):null]}),(0,M.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,M.jsxs)(A,{disabled:Ve,onClick:()=>{O({type:`reset`}),a(`Resetting session...`),xe([])},size:`icon-sm`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(me,{className:`size-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`New chat`})]})})]}),(0,M.jsxs)(Qt,{className:`min-h-0 flex-1`,children:[(0,M.jsxs)($t,{className:`px-4 py-5`,children:[Ve?(0,M.jsx)(`div`,{className:`flex h-full items-center justify-center rounded-xl border border-dashed px-6 py-16 text-center text-sm text-muted-foreground`,children:(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,M.jsx)(Me,{className:`size-4 animate-spin`}),`Loading chat history...`]})}):Ue.length===0?(0,M.jsx)(`div`,{className:`flex h-full items-center align-middle justify-center rounded-xl border border-dashed px-6 py-16 text-center text-sm text-muted-foreground`,children:`How can I help you?`}):null,Ue.map(e=>e.role===`meta`||e.role===`error`?(0,M.jsx)(`div`,{className:j(`w-full rounded-lg border px-4 py-3 text-sm`,e.role===`error`?`border-destructive/40 bg-destructive/10 text-destructive`:`bg-muted/40 text-muted-foreground`),children:$$(e,{isMeta:!0})},e.id):(0,M.jsx)(_I,{from:e.role,children:(0,M.jsxs)(`div`,{children:[$$(e,{sending:u}),e.role===`user`&&e.checkpoint?(0,M.jsx)(It,{className:`mt-1 justify-end`,children:(0,M.jsxs)(Rt,{className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground`,disabled:u,onClick:()=>{e.checkpoint&&O({type:`restore`,checkpointRunCount:e.checkpoint.runCount})},tooltip:`Checkpoint from run ${e.checkpoint.runCount}`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(Lt,{className:`size-3`}),n1(e.checkpoint.createdAt)]})}):null,e.role===`assistant`&&e.text&&!u?(0,M.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,M.jsxs)(A,{className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground`,disabled:Ee,onClick:()=>{De(!0),ke(null),O({type:`forkSession`})},size:`sm`,title:`Fork session — copy full message history into a new session`,type:`button`,variant:`ghost`,children:[Ee?(0,M.jsx)(Me,{className:`size-3 animate-spin`}):(0,M.jsx)($e,{className:`size-3`}),`Fork`]}),Oe?(0,M.jsx)(`span`,{className:`text-[11px] text-destructive`,children:Oe}):null]}):null]})},e.id))]}),(0,M.jsx)(en,{})]}),be.length>0?(0,M.jsx)(`div`,{className:`grid max-h-72 gap-2 overflow-auto border-t bg-background/95 px-4 py-3`,children:be.map(e=>(0,M.jsxs)(`div`,{className:`grid gap-2 rounded-lg border bg-card p-3 text-sm`,children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsx)(`p`,{className:`font-semibold`,children:`Approve tool call?`}),(0,M.jsx)(`p`,{className:`break-all text-muted-foreground text-xs`,children:e.toolName})]}),(0,M.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,M.jsxs)(A,{disabled:e.responding,onClick:()=>qe(e.approvalId,!1),size:`sm`,type:`button`,variant:`destructive`,children:[(0,M.jsx)(le,{className:`size-4`}),`Reject`]}),(0,M.jsxs)(A,{disabled:e.responding,onClick:()=>qe(e.approvalId,!0),size:`sm`,type:`button`,children:[e.responding?(0,M.jsx)(Me,{className:`size-4 animate-spin`}):(0,M.jsx)(g,{className:`size-4`}),`Approve`]})]})]}),(0,M.jsx)(`pre`,{className:`max-h-32 overflow-auto rounded-md border bg-background p-2 text-[11px]`,children:P$(e.input)})]},e.approvalId))}):null,(0,M.jsx)(T$,{autoApproveTools:ve,disabled:Ve,enableSpawn:pe,enableTeams:ge,enableTools:ue,maxIterations:re,model:D,mode:ae,modelSelectorOpen:Se,models:Be,onAbort:()=>{O({type:`abort`}),a(`Abort requested...`)},onAutoApproveToolsChange:ye,onEnableSpawnChange:he,onEnableTeamsChange:_e,onEnableToolsChange:fe,onModeChange:oe,onMaxIterationsChange:ie,onModelChange:te,onModelSelectorOpenChange:Ce,onProviderChange:e=>{ee(e);let t=w.lastModelByProvider[e],n=(h[e]??[]).map(e=>e.id);if(t&&n.includes(t)){te(t);return}te(``)},onSend:({prompt:e,attachments:t,attachmentCount:n})=>{if(Ve)return;let i=M$(`assistant`,``);Ae.current=i.id,r(r=>[...r,M$(`user`,N$(e,t,n)),i]),d(!0),a(`Running...`),O({type:`send`,prompt:e,attachments:t,config:{autoApproveTools:ve,enableSpawn:pe,enableTeams:ge,enableTools:ue,maxIterations:j$(re),model:D||void 0,mode:ae,provider:E||void 0,reasonLevel:He,systemPrompt:ne.trim()||void 0}})},onSystemPromptChange:k,onReasonLevelChange:ce,provider:E,providers:p,sending:u,status:i,systemPrompt:ne,reasonLevel:He,workspaceRoot:v.workspaceRoot})]})})}export{Uw as a,r1 as default,AD as i,vT as n,ED as r,D$ as t};
|