@economic/agents-playground 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -173,7 +173,7 @@ ${e.themeCSS}`),e.fontFamily!==void 0&&(n+=`
|
|
|
173
173
|
:root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(n+=`
|
|
174
174
|
:root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){let r=xe(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{Le(e.styles)||r.forEach(t=>{n+=CT(e.id,t,e.styles)}),Le(e.textStyles)||(n+=CT(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))))})}return n},`createCssStyles`),TT=I((e,t,n,r)=>jC(EC(`${r}{${ae(t,wT(e,n),{...e.themeVariables,theme:e.theme,look:e.look},r)}}`),MC),`createUserStyles`),ET=I((e=``,t,n)=>{let r=e;return!n&&!t&&(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,`marker-end="url(#`)),r=Oe(r),r=r.replace(/<br>/g,`<br/>`),r},`cleanUpSvgCode`),DT=I((e=``,t)=>`<iframe style="width:${pT};height:${t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+`px`:mT};${hT}" src="data:text/html;charset=UTF-8;base64,${aT(`<body style="${gT}">${e}</body>`)}" sandbox="${_T}">
|
|
175
175
|
${vT}
|
|
176
|
-
</iframe>`,`putIntoIFrame`),OT=I((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,uT);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function kT(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}I(kT,`sandboxedIframe`);var AT=I((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),jT=I(async function(e,t,n){Gw();let r=xT(t);t=r.code;let i=Ce();te.debug(i),t.length>(i?.maxTextSize??oT)&&(t=sT);let a=`#`+e,o=`i`+e,s=`#`+o,c=`d`+e,l=`#`+c,u=I(()=>{let e=ne(f?s:l).node();e&&`remove`in e&&e.remove()},`removeTempElements`),d=ne(`body`),f=i.securityLevel===cT,p=i.securityLevel===lT,m=i.fontFamily;n===void 0?(AT(document,e,c,o),f?(d=ne(kT(ne(`body`),o).nodes()[0].contentDocument.body),d.node().style.margin=0):d=ne(`body`),OT(d,e,c)):(n&&(n.innerHTML=``),f?(d=ne(kT(ne(n),o).nodes()[0].contentDocument.body),d.node().style.margin=0):d=ne(n),OT(d,e,c,`font-family: ${m}`,dT));let h,g;try{h=await Xw.fromText(t,{title:r.title})}catch(e){if(i.suppressErrorRendering)throw u(),e;h=await Xw.fromText(`error`),g=e}let _=d.select(l).node(),v=h.type,y=_.firstChild,b=y.firstChild,x=h.renderer.getClasses?.(t,h),S=TT(i,v,x,a),C=document.createElement(`style`);C.innerHTML=S,y.insertBefore(C,b);try{await h.renderer.draw(t,e,`11.14.0`,h)}catch(n){throw i.suppressErrorRendering?u():mw.draw(t,e,`11.14.0`),n}let w=d.select(`${l} svg`),T=h.db.getAccTitle?.(),E=h.db.getAccDescription?.();PT(v,w,T,E),d.select(`[id="${e}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,fT);let D=d.select(l).node().innerHTML;if(te.debug(`config.arrowMarkerAbsolute`,i.arrowMarkerAbsolute),D=ET(D,f,he(i.arrowMarkerAbsolute)),f){let e=d.select(l+` svg`).node();D=DT(D,e)}else p||(D=de.sanitize(D,{ADD_TAGS:yT,ADD_ATTR:bT,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Qw(),g)throw g;return u(),{diagramType:v,svg:D,bindFunctions:h.db.bindFunctions}},`render`);function MT(e={}){let t=ye({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||={},t.themeVariables.fontFamily=t.fontFamily),we(t),t?.theme&&t.theme in ue?t.themeVariables=ue[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=ue.default.getThemeVariables(t.themeVariables)),F((typeof t==`object`?ie(t):ce()).logLevel),Gw()}I(MT,`initialize`);var NT=I((e,t={})=>{let{code:n}=iT(e);return Xw.fromText(n,t)},`getDiagramFromText`);function PT(e,t,n,r){Jw(t,e),Yw(t,n,r,t.attr(`id`))}I(PT,`addA11yInfo`);var FT=Object.freeze({render:jT,parse:ST,getDiagramFromText:NT,initialize:MT,getConfig:Ce,setConfig:L,getSiteConfig:ce,updateSiteConfig:le,reset:I(()=>{re()},`reset`),globalReset:I(()=>{re(ge)},`globalReset`),defaultConfig:ge});F(Ce().logLevel),re(Ce());var IT=I((e,t,n)=>{te.warn(e),Ee(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),LT=I(async function(e={querySelector:`.mermaid`}){try{await RT(e)}catch(t){if(Ee(t)&&te.error(t.str),YT.parseError&&YT.parseError(t),!e.suppressErrors)throw te.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),RT=I(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:`.mermaid`}){let r=FT.getConfig();te.debug(`${e?``:`No `}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);te.debug(`Found ${i.length} diagrams`),r?.startOnLoad!==void 0&&(te.debug(`Start On Load: `+r?.startOnLoad),FT.updateSiteConfig({startOnLoad:r?.startOnLoad}));let a=new De.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed),o,s=[];for(let t of Array.from(i)){if(te.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let n=`mermaid-${a.next()}`;o=t.innerHTML,o=Fe(De.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,`<br/>`);let r=De.detectInit(o);r&&te.debug(`Detected early reinit: `,r);try{let{svg:r,bindFunctions:i}=await JT(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){IT(e,s,YT.parseError)}}if(s.length>0)throw s[0]},`runThrowsErrors`),zT=I(function(e){FT.initialize(e)},`initialize`),BT=I(async function(e,t,n){te.warn(`mermaid.init is deprecated. Please use run instead.`),e&&zT(e);let r={postRenderCallback:n,querySelector:`.mermaid`};typeof t==`string`?r.querySelector=t:t&&(t instanceof HTMLElement?r.nodes=[t]:r.nodes=t),await LT(r)},`init`),VT=I(async(e,{lazyLoad:t=!0}={})=>{Gw(),oe(...e),t===!1&&await Kw()},`registerExternalDiagrams`),HT=I(function(){if(YT.startOnLoad){let{startOnLoad:e}=FT.getConfig();e&&YT.run().catch(e=>te.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,HT,!1);var UT=I(function(e){YT.parseError=e},`setParseErrorHandler`),WT=[],GT=!1,KT=I(async()=>{if(!GT){for(GT=!0;WT.length>0;){let e=WT.shift();if(e)try{await e()}catch(e){te.error(`Error executing queue`,e)}}GT=!1}},`executeQueue`),qT=I(async(e,t)=>new Promise((n,r)=>{let i=I(()=>new Promise((i,a)=>{FT.parse(e,t).then(e=>{i(e),n(e)},e=>{te.error(`Error parsing`,e),YT.parseError?.(e),a(e),r(e)})}),`performCall`);WT.push(i),KT().catch(r)}),`parse`),JT=I((e,t,n)=>new Promise((r,i)=>{let a=I(()=>new Promise((a,o)=>{FT.render(e,t,n).then(e=>{a(e),r(e)},e=>{te.error(`Error parsing`,e),YT.parseError?.(e),o(e),i(e)})}),`performCall`);WT.push(a),KT().catch(i)}),`render`),YT={startOnLoad:!0,mermaidAPI:FT,parse:qT,render:JT,init:BT,run:LT,registerExternalDiagrams:VT,registerLayoutLoaders:Ie,initialize:zT,parseError:void 0,contentLoaded:HT,setParseErrorHandler:UT,detectType:pe,registerIconPacks:Pe,getRegisteredDiagramsMetadata:I(()=>Object.keys(ve).map(e=>({id:e})),`getRegisteredDiagramsMetadata`)},XT=YT,ZT={startOnLoad:!1,theme:`default`,securityLevel:`strict`,fontFamily:`monospace`,suppressErrorRendering:!0};function QT(e={}){let t=!1,n={...ZT,...e.config},r={initialize(r){n={...ZT,...e.config,...r},XT.initialize(n),t=!0},async render(e,r){return t||=(XT.initialize(n),!0),await XT.render(e,r)}};return{name:`mermaid`,type:`diagram`,language:`mermaid`,getMermaid(e){return e&&r.initialize(e),r}}}var $T=QT(),eE=({className:e,from:t,...n})=>(0,U.jsx)(`div`,{className:H(`group flex w-full max-w-[95%] flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant self-start`,e),...n}),tE=({children:e,className:t,...n})=>(0,U.jsx)(`div`,{className:H(`is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-left group-[.is-assistant]:text-foreground`,t),...n,children:e}),nE=({className:e,children:t,...n})=>(0,U.jsx)(`div`,{className:H(`flex items-center gap-1`,e),...n,children:t}),rE=({tooltip:e,children:t,label:n,variant:r=`ghost`,size:i=`icon-sm`,...a})=>{let o=(0,U.jsxs)($n,{size:i,type:`button`,variant:r,...a,children:[t,(0,U.jsx)(`span`,{className:`sr-only`,children:n||e})]});return e?(0,U.jsx)(vd,{children:(0,U.jsxs)(yd,{children:[(0,U.jsx)(bd,{children:o}),(0,U.jsx)(xd,{children:(0,U.jsx)(`p`,{children:e})})]})}):o},iE=(0,z.createContext)(null),aE=()=>{let e=(0,z.useContext)(iE);if(!e)throw Error(`MessageBranch components must be used within MessageBranch`);return e},oE=({defaultBranch:e=0,onBranchChange:t,className:n,...r})=>{let[i,a]=(0,z.useState)(e),[o,s]=(0,z.useState)([]),c=(0,z.useCallback)(e=>{a(e),t?.(e)},[t]),l=(0,z.useCallback)(()=>{c(i>0?i-1:o.length-1)},[i,o.length,c]),u=(0,z.useCallback)(()=>{c(i<o.length-1?i+1:0)},[i,o.length,c]),d=(0,z.useMemo)(()=>({branches:o,currentBranch:i,goToNext:u,goToPrevious:l,setBranches:s,totalBranches:o.length}),[o,i,u,l]);return(0,U.jsx)(iE.Provider,{value:d,children:(0,U.jsx)(`div`,{className:H(`grid w-full gap-2 [&>div]:pb-0`,n),...r})})},sE=({children:e,...t})=>{let{currentBranch:n,setBranches:r,branches:i}=aE(),a=(0,z.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return(0,z.useEffect)(()=>{i.length!==a.length&&r(a)},[a,i,r]),a.map((e,r)=>(0,U.jsx)(`div`,{className:H(`grid gap-2 overflow-hidden [&>div]:pb-0`,r===n?`block`:`hidden`),...t,children:e},e.key))},cE={cjk:Bf,code:Bx,math:BS,mermaid:$T},lE=(0,z.memo)(({className:e,...t})=>(0,U.jsx)(D,{className:H(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),plugins:cE,...t}),(e,t)=>e.children===t.children&&t.isAnimating===e.isAnimating);lE.displayName=`MessageResponse`;var uE=({messageId:e,rating:t,onRate:n,disabled:r})=>(0,U.jsxs)(nE,{className:`mt-2`,children:[(0,U.jsx)(rE,{tooltip:`Thumbs up`,onClick:()=>n(e,t===1?0:1),variant:t===1?`default`:`ghost`,disabled:r,children:(0,U.jsx)(gu,{className:`size-4`})}),(0,U.jsx)(rE,{tooltip:`Thumbs down`,onClick:()=>n(e,t===-1?0:-1),variant:t===-1?`default`:`ghost`,disabled:r,children:(0,U.jsx)(hu,{className:`size-4`})})]}),dE=globalThis?.document?z.useLayoutEffect:()=>{},fE=z.useInsertionEffect||dE;function pE({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=mE({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=z.useRef(e!==void 0);z.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,z.useCallback(t=>{if(s){let n=hE(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function mE({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return fE(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function hE(e){return typeof e==`function`}var gE=z.createContext(void 0);function _E(e){let t=z.useContext(gE);if(e===!1&&t===void 0)throw Error(hn(27));return t}var vE={..._l,...mc},yE=z.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=_E(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Hn(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:vE,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),bE=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{store:c}=_E(),l=c.useState(`open`);function u(e){l&&c.setOpen(!1,Ur(Fr,e.nativeEvent))}let{getButtonProps:d,buttonRef:f}=yn({disabled:i,native:a});return Hn(`button`,e,{state:{disabled:i},ref:[t,f],props:[{onClick:u},s,d]})}),xE=z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=_E(),c=vl(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Hn(`p`,e,{ref:t,props:[{id:c},o]})}),SE=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),CE=function(e){return e[e.open=cl.open]=`open`,e[e.closed=cl.closed]=`closed`,e[e.startingStyle=cl.startingStyle]=`startingStyle`,e[e.endingStyle=cl.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),wE=z.createContext(void 0);function TE(){let e=z.useContext(wE);if(e===void 0)throw Error(hn(26));return e}var EE=`ArrowUp`,DE=`ArrowDown`,OE=`ArrowLeft`,kE=`ArrowRight`,AE=`Home`,jE=new Set([OE,kE]),ME=new Set([EE,DE]),NE=new Set([...jE,...ME]);new Set([...NE,AE,`End`]);var PE=new Set([EE,DE,OE,kE,AE,`End`]),FE={..._l,...mc,nestedDialogOpen(e){return e?{[CE.nestedDialogOpen]:``}:null}},IE=z.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,style:o,...s}=e,{store:c}=_E(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`);TE(),gc({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});function S(e){return e===`touch`?c.context.popupRef.current:!0}let C=i===void 0?S:i,w=Hn(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:g>0},props:[f,{"aria-labelledby":y??void 0,"aria-describedby":l??void 0,role:x,tabIndex:-1,hidden:!m,onKeyDown(e){PE.has(e.key)&&e.stopPropagation()},style:{[SE.nestedDialogs]:g}},s],ref:[t,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:FE});return(0,U.jsx)(wo,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:r,modal:p!==!1,restoreFocus:`popup`,children:w})}),LE=z.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,U.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),RE=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=_E(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,U.jsx)(wE.Provider,{value:n,children:(0,U.jsxs)(ro,{ref:t,...r,children:[a&&o===!0&&(0,U.jsx)(LE,{ref:i.context.internalBackdropRef,inert:Ml(!s)}),e.children]})}):null}),zE={},BE={},VE=``;function HE(e){if(typeof document>`u`)return!1;let t=ti(e);return xt(t).innerWidth-t.documentElement.clientWidth>0}function UE(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=ti(e),n=t.documentElement,r=t.body,i=Dt(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function WE(e){let t=ti(e),n=t.documentElement,r=t.body,i=Dt(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function GE(e){let t=ti(e),n=t.documentElement,r=t.body,i=xt(n),a=0,o=0,s=!1,c=$r.create();if(ur&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,zE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},VE=n.style.scrollBehavior,BE={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Dt(n)?n:r;if(s=UE(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,zE),Object.assign(r.style,BE),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=VE)}function d(){u(),c.request(l)}l();let f=qr(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var KE=new class{lockCount=0;restore=null;timeoutLock=ir.create();timeoutUnlock=ir.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=ti(e).documentElement,n=xt(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=Pn;return}this.restore=dr||!HE(e)?WE(e):GE(e)}};function qE(e=!0,t=null){V(()=>{if(e)return KE.acquire(t)},[e,t])}function JE(e){let t=z.useRef(``),n=z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:z.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function YE(e,t){let n=z.useRef(e),r=B(t);V(()=>{n.current!==e&&r(n.current)},[e,r]),V(()=>{n.current=e},[e])}function XE(e){let[t,n]=z.useState(null),r=B((t,r)=>{e||n(r||(dr?`touch`:``))});YE(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=JE(r);return z.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function ZE(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`),o=t.useState(`disablePointerDismissal`),s=t.useState(`modal`),c=t.useState(`popupElement`),{openMethod:l,triggerProps:u}=XE(a);yc(t);let{forceUnmount:d}=bc(a,t),f=B(e=>{let n=Ur(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=z.useCallback(()=>{t.setOpen(!1,f(Hr))},[t,f]);z.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Oc({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[h,g]=z.useState(0),[_,v]=z.useState(0),y=h===0,b=Zc(m),x=Mo(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=mi(e);if(y&&!o){let e=n;return s&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||pi(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:y});qE(a&&s===!0,c);let{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=zc([b,x]);t.useContextCallback(`onNestedDialogOpen`,(e,t)=>{g(e),v(t)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0),v(0)}),z.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(h+1,_+ +!!i),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[i,a,h,_,n]);let T=z.useMemo(()=>S(u),[S,u]),E=z.useMemo(()=>w(u),[w,u]),D=z.useMemo(()=>C(),[C]);t.useSyncedValues({openMethod:l,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:m,nestedOpenDialogCount:h,nestedOpenDrawerCount:_})}var QE={...Tc,modal:W(e=>e.modal),nested:W(e=>e.nested),nestedOpenDialogCount:W(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:W(e=>e.nestedOpenDrawerCount),disablePointerDismissal:W(e=>e.disablePointerDismissal),openMethod:W(e=>e.openMethod),descriptionElementId:W(e=>e.descriptionElementId),titleElementId:W(e=>e.titleElementId),viewportElement:W(e=>e.viewportElement),role:W(e=>e.role)},$E=class e extends sc{constructor(e){super(eD(e),{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new xc,onOpenChange:void 0,onOpenChangeComplete:void 0},QE)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};static useStore(t,n){let r=Gt(()=>new e(n)).current;return t??r}};function eD(e={}){return{...Cc(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}var tD=z.createContext(!1);function nD(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=_E(!0),p=z.useContext(tD),m=!!f,h=$E.useStore(l?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:m});er(()=>{n===void 0&&h.state.open===!1&&r===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp(`openProp`,n),h.useControlledProp(`triggerIdProp`,u),h.useSyncedValues({disablePointerDismissal:o,nested:m,modal:s}),h.useContextCallback(`onOpenChange`,i),h.useContextCallback(`onOpenChangeComplete`,a);let g=h.useState(`payload`);ZE({store:h,actionsRef:c,parentContext:f?.store.context,isDrawer:p,onOpenChange:i,triggerIdProp:u});let _=z.useMemo(()=>({store:h}),[h]);return(0,U.jsx)(tD.Provider,{value:!1,children:(0,U.jsx)(gE.Provider,{value:_,children:typeof t==`function`?t({payload:g}):t})})}var rD=z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=_E(),c=vl(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Hn(`h2`,e,{ref:t,props:[{id:c},o]})}),iD=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,payload:s,handle:c,style:l,...u}=e,d=_E(!0),f=c?.store??d?.store;if(!f)throw Error(hn(79));let p=vl(o),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=z.useRef(null),{registerTrigger:_,isMountedByThisTrigger:v}=vc(p,g,f,{payload:s}),{getButtonProps:y,buttonRef:b}=yn({disabled:i,native:a}),x=zc([To(m,{enabled:m!=null})]),S={disabled:i,open:h},C=f.useState(`triggerProps`,v);return Hn(`button`,e,{state:S,ref:[b,t,_,g],props:[x.getReferenceProps(),C,{[Rn]:``,id:p},u,y],stateAttributesMapping:hl})});function aD({...e}){return(0,U.jsx)(nD,{"data-slot":`dialog`,...e})}function oD({...e}){return(0,U.jsx)(iD,{"data-slot":`dialog-trigger`,...e})}function sD({...e}){return(0,U.jsx)(RE,{"data-slot":`dialog-portal`,...e})}function cD({className:e,...t}){return(0,U.jsx)(yE,{"data-slot":`dialog-overlay`,className:H(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function lD({className:e,children:t,showCloseButton:n=!0,...r}){return(0,U.jsxs)(sD,{children:[(0,U.jsx)(cD,{}),(0,U.jsxs)(IE,{"data-slot":`dialog-content`,className:H(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,U.jsxs)(bE,{"data-slot":`dialog-close`,render:(0,U.jsx)($n,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,U.jsx)(bu,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function uD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-header`,className:H(`flex flex-col gap-2`,e),...t})}function dD({className:e,showCloseButton:t=!1,children:n,...r}){return(0,U.jsxs)(`div`,{"data-slot":`dialog-footer`,className:H(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,U.jsx)(bE,{render:(0,U.jsx)($n,{variant:`outline`}),children:`Close`})]})}function fD({className:e,...t}){return(0,U.jsx)(rD,{"data-slot":`dialog-title`,className:H(`text-base leading-none font-medium`,e),...t})}var pD=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),mD={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},hD={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},gD={disabled:!1,...hD},_D={valid(e){return e===null?null:e?{[pD.valid]:``}:{[pD.invalid]:``}}},vD=z.createContext({invalid:void 0,name:void 0,validityData:{state:mD,errors:[],error:``,value:``,initialValue:null},setValidityData:Pn,disabled:void 0,touched:hD.touched,setTouched:Pn,dirty:hD.dirty,setDirty:Pn,filled:hD.filled,setFilled:Pn,focused:hD.focused,setFocused:Pn,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:gD,markedDirtyRef:{current:!1},registerFieldControl:Pn,validation:{getValidationProps:(e=In)=>e,getInputValidationProps:(e=In)=>e,inputRef:{current:null},commit:async()=>{}}});function yD(e=!0){let t=z.useContext(vD);if(t.setValidityData===Pn&&!e)throw Error(hn(28));return t}var bD=z.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Pn,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function xD(){return z.useContext(bD)}var SD=z.createContext({controlId:void 0,registerControlId:Pn,labelId:void 0,setLabelId:Pn,messageIds:[],setMessageIds:Pn,getDescriptionProps:e=>e});function CD(){return z.useContext(SD)}function wD({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=z.useRef(e!==void 0),[a,o]=z.useState(t);return[i?e:a,z.useCallback(e=>{i||o(e)},[])]}function TD(e,t){let{enabled:n=!0,getValue:r,id:i,value:a}=t,{registerFieldControl:o}=yD(),s=z.useRef(null);s.current||=Symbol(),V(()=>{let t=s.current;if(!(!t||!n))return o(t,{controlRef:e,getValue:r,id:i,value:a}),()=>{o(t,void 0)}},[e,n,r,i,o,a])}function ED(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=CD(),o=vl(t),s=n?i:void 0,c=Gt(()=>Symbol(`labelable-control`)),l=z.useRef(!1),u=z.useRef(t!=null),d=B(()=>{!l.current||a===Pn||(l.current=!1,a(c.current,void 0))});return V(()=>{if(a===Pn)return;let e;if(n){let n=r?.current;e=wt(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),z.useEffect(()=>d,[d]),i??o}var DD=z.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:S}=yD(),C=h||s,w=m??a,T={...p,disabled:C},{labelId:E}=CD(),D=ED({id:i});V(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?b(!0):e&&o===``&&b(!1)},[S.inputRef,b,o]);let O=z.useRef(null);V(()=>{u&&O.current===fi(ti(O.current))&&y(!0)},[u,y]);let[k]=wD({controlled:o,default:l,name:`FieldControl`,state:`value`}),A=o!==void 0,j=A?k:void 0,M=B(()=>S.inputRef.current?.value);return TD(S.inputRef,{id:D,value:j,getValue:M}),Hn(`input`,e,{ref:[t,O],state:T,props:[{id:D,disabled:C,name:w,ref:S.inputRef,"aria-labelledby":E,autoFocus:u,...A?{value:j}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,Ur(kr,e.nativeEvent)),_(t!==v.initialValue),b(t!==``)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),S.commit(e.currentTarget.value))}},S.getInputValidationProps(),f],stateAttributesMapping:_D})}),OD=z.forwardRef(function(e,t){return(0,U.jsx)(DD,{ref:t,...e})});function kD({className:e,type:t,...n}){return(0,U.jsx)(OD,{type:t,"data-slot":`input`,className:H(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function AD({className:e,...t}){return(0,U.jsx)(`textarea`,{"data-slot":`textarea`,className:H(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function jD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:H(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var MD=Zn(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function ND({className:e,align:t=`inline-start`,...n}){return(0,U.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:H(MD({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var PD=Zn(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function FD({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,U.jsx)($n,{type:t,"data-size":r,variant:n,className:H(PD({size:r}),e),...i})}function ID({className:e,...t}){return(0,U.jsx)(AD,{"data-slot":`input-group-control`,className:H(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}var LD=z.createContext(void 0);function RD(e){let t=z.useContext(LD);if(t===void 0&&!e)throw Error(hn(33));return t}var zD=z.createContext(void 0);function BD(e){let t=z.useContext(zD);if(t===void 0&&!e)throw Error(hn(36));return t}var VD=z.createContext(void 0);function HD(e=!0){let t=z.useContext(VD);if(t===void 0&&!e)throw Error(hn(25));return t}function UD(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=HD(!0),d=u!==void 0;return z.useMemo(()=>({id:r,role:`menuitem`,tabIndex:n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:Pr})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||d&&!mr&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!d||e.button===2)&&(!c||c.type===`regular-item`)&&s.current.click()}}),[t,n,r,l,i,a,o,s,u,d,c])}var WD={type:`regular-item`};function GD(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=z.useRef(null),{getButtonProps:d,buttonRef:f}=yn({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=UD({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=z.useCallback(e=>$t(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=Sn(u,f);return z.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var KD=z.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function qD(){return z.useContext(KD)}var JD=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function YD(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=qD(),f=z.useRef(-1),[p,m]=z.useState(a??(i===JD.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=z.useRef(null),g=z.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return V(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),V(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),z.useMemo(()=>({ref:g,index:p}),[p,g])}var XD=z.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=YD({label:a}),f=RD(!0),p=vl(i),{store:m}=BD(),h=m.useState(`isActive`,d.index),g=m.useState(`itemProps`),{getItemProps:_,itemRef:v}=GD({closeOnClick:c,disabled:s,highlighted:h,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:WD});return Hn(`div`,e,{state:{disabled:s,highlighted:h},props:[g,u,_],ref:[v,t,d.ref]})}),ZD=z.createContext(void 0);function QD(e){let t=z.useContext(ZD);if(t===void 0&&!e)throw Error(hn(69));return t}var $D={..._l,...mc},eO=z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=BD(),{side:c,align:l}=RD(),u=QD(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`activeTriggerElement`),w=_.type===`context-menu`;gc({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),z.useEffect(()=>{function e(e){s.setOpen(!1,Ur(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]);let T=s.useState(`hoverEnabled`),E=s.useState(`disabled`);Ic(b,{enabled:T&&!E&&!w&&_.type!==`menubar`,closeDelay:S});let D={transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},O=z.useCallback(e=>{s.set(`popupElement`,e)},[s]),k=Hn(`div`,e,{state:D,ref:[t,s.context.popupRef,O],stateAttributesMapping:$D,props:[p,{onKeyDown(e){u&&PE.has(e.key)&&e.stopPropagation()}},Al(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||w;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),(0,U.jsx)(wo,{context:b,modal:w,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:C,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),tO=z.createContext(void 0);function nO(){let e=z.useContext(tO);if(e===void 0)throw Error(hn(32));return e}var rO=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=BD();return i.useState(`mounted`)||n?(0,U.jsx)(tO.Provider,{value:n,children:(0,U.jsx)(ro,{ref:t,...r})}):null});function iO(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=B(i),o=z.useRef(0),s=Gt(oO).current,c=Gt(aO).current,[l,u]=z.useState(0),d=z.useRef(l),f=B((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=B(e=>{c.delete(e),d.current+=1,u(d.current)}),m=z.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(sO).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);V(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),V(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),V(()=>()=>{n.current=[]},[n]),V(()=>()=>{r&&(r.current=[])},[r]);let h=B(e=>(s.add(e),()=>{s.delete(e)}));V(()=>{s.forEach(e=>e(m))},[s,m]);let g=z.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,U.jsx)(KD.Provider,{value:g,children:t})}function aO(){return new Map}function oO(){return new Set}function sO(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var cO=20;function lO(e,t,n,r){let[i,a]=z.useState(!1);V(()=>{if(!e||!t||n==null){a(!1);return}let r=ti(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-cO)},[e,t,n]),qE(e&&(!t||i),r)}var uO=z.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=zn,style:g,..._}=e,{store:v}=BD(),y=nO(),b=HD(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`hasViewport`),ee=v.useState(`lastOpenChangeReason`),N=v.useState(`floatingNodeId`),P=v.useState(`floatingParentNodeId`),F=S.useState(`domReferenceElement`),te=z.useRef(null),I=hc(A,!1,!1),ne=n,re=c,ie=l,L=s,ae=h;x.type===`context-menu`&&(ne=n??x.context?.anchor,L??=`start`,!o&&L!==`center`&&(ie=e.alignOffset??2,re=e.sideOffset??-5));let R=o,oe=L;x.type===`menu`?(R??=`inline-end`,oe??=`start`,ae=e.collisionAvoidance??Bn):x.type===`menubar`&&(R??=`bottom`,oe??=`start`);let se=x.type===`context-menu`,ce=Ol({anchor:ne,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:R,sideOffset:re,align:oe,alignOffset:ie,arrowPadding:se?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:N,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:ae,shiftCrossAxis:se&&!(`side`in ae&&ae.side===`flip`),externalTree:C,adaptiveOrigin:M?Tl:void 0});z.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===N&&v.set(`hoverEnabled`,!1),e.nodeId!==N&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,Ur(Br)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,N]),z.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,Ur(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let le=ar();z.useEffect(()=>{T||le.clear()},[T,le]),z.useEffect(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`)))if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?le.isStarted()||le.start(e,()=>{v.setOpen(!1,Ur(Br))}):v.setOpen(!1,Ur(Br))}else le.clear()}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,le]),z.useEffect(()=>{let e={open:T,nodeId:N,parentNodeId:P,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,N,P]),V(()=>{let e=F,t=te.current;if(e&&(te.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return I(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[F,I,v]);let ue={open:T,side:ce.side,align:ce.align,anchorHidden:ce.anchorHidden,nested:x.type===`menu`,instant:j},de=x.type===`menubar`&&x.context.modal;lO(T&&(de||E&&ee!==`trigger-hover`),D===`touch`,A,O);let fe=jl(e,ue,{styles:ce.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),pe=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&ee!==`trigger-hover`||x.type===`menubar`&&x.context.modal),me=null;return x.type===`menubar`?me=x.context.contentElement:x.type===void 0&&(me=O),(0,U.jsxs)(LD.Provider,{value:ce,children:[pe&&(0,U.jsx)(LE,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:Ml(!T),cutout:me}),(0,U.jsx)(fo,{id:N,children:(0,U.jsx)(iO,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:fe})})]})}),dO=z.createContext(null);function fO(e){let t=z.useContext(dO);if(t===null&&!e)throw Error(hn(5));return t}var pO={...Tc,disabled:W(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:W(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),openMethod:W(e=>e.openMethod),allowMouseEnter:W(e=>e.allowMouseEnter),stickIfOpen:W(e=>e.stickIfOpen),parent:W(e=>e.parent),rootId:W(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:W(e=>e.activeIndex),isActive:W((e,t)=>e.activeIndex===t),hoverEnabled:W(e=>e.hoverEnabled),instantType:W(e=>e.instantType),lastOpenChangeReason:W(e=>e.openChangeReason),floatingTreeRoot:W(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:W(e=>e.floatingNodeId),floatingParentNodeId:W(e=>e.floatingParentNodeId),itemProps:W(e=>e.itemProps),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport),keyboardEventRelay:W(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},mO=class e extends sc{constructor(e){super({...hO(),...e},{positionerRef:z.createRef(),popupRef:z.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:z.createRef(),beforeContentFocusGuardRef:z.createRef(),onOpenChangeComplete:void 0,triggerElements:new xc},pO),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);t===i&&n===a&&r===o||(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=Gt(()=>new e(n)).current;return t??r}unsubscribeParentListener=null};function hO(){return{...Cc(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ao,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:In,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}var gO=z.createContext(void 0);function _O(){return z.useContext(gO)}var vO=Xs(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=HD(!0),_=BD(!0),v=fO(!0),y=_O(),b=z.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=mO.useStore(f?.store,{open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b});er(()=>{n===void 0&&x.state.open===!1&&a===!0&&x.update({open:!0,activeTriggerId:m})}),x.useControlledProp(`openProp`,n),x.useControlledProp(`triggerIdProp`,p),x.useContextCallback(`onOpenChangeComplete`,i);let S=x.useState(`floatingTreeRoot`),C=uo(S),w=co();V(()=>{g&&!_?x.update({parent:{type:`context-menu`,context:g},floatingNodeId:C,floatingParentNodeId:w}):_&&x.update({floatingNodeId:C,floatingParentNodeId:w})},[g,_,C,w,x]);let T=x.useState(`open`),E=x.useState(`activeTriggerElement`),D=x.useState(`positionerElement`),O=x.useState(`hoverEnabled`),k=x.useState(`disabled`),A=x.useState(`lastOpenChangeReason`),j=x.useState(`parent`),M=x.useState(`activeIndex`),ee=x.useState(`payload`),N=x.useState(`floatingParentNodeId`),P=z.useRef(null),F=N!=null,{openMethod:te,triggerProps:I}=XE(T);x.useSyncedValues({disabled:o,modal:j.type===void 0?s:void 0,openMethod:te,rootId:Qa()}),yc(x);let{forceUnmount:ne}=bc(T,x,()=>{x.update({allowMouseEnter:!1,stickIfOpen:!0})}),re=z.useRef(j.type!==`context-menu`),ie=ar();z.useEffect(()=>{if(T||(P.current=null),j.type===`context-menu`){if(!T){ie.clear(),re.current=!1;return}ie.start(500,()=>{re.current=!0})}},[ie,T,j.type]),V(()=>{!T&&!O&&x.set(`hoverEnabled`,!0)},[T,O,x]);let L=z.useRef(!0),ae=ar(),R=B((e,t)=>{let n=t.reason;if(T===e&&t.trigger===E&&A===n||(t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=E??void 0),r?.(e,t),t.isCanceled))return;x.state.floatingRootContext.dispatchOpenChange(e,t);let i=t.event;if(e===!1&&i?.type===`click`&&i.pointerType===`touch`&&!L.current)return;if(!e&&M!==null){let e=x.context.itemDomElements.current[M];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===`trigger-focus`?(L.current=!1,ae.start(300,()=>{L.current=!0})):(L.current=!0,ae.clear());let a=(n===`trigger-press`||n===`item-press`)&&i.detail===0&&i?.isTrusted,o=!e&&(n===`escape-key`||n==null),s={open:e,openChangeReason:n};P.current=t.event??null;let c=t.trigger?.id??null;(c||e)&&(s.activeTriggerId=c,s.activeTriggerElement=t.trigger??null),x.update(s),j.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?x.set(`instantType`,`group`):a||o?x.set(`instantType`,a?`click`:`dismiss`):x.set(`instantType`,void 0)}),oe=z.useCallback(e=>{let t=Ur(e);return t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},t},[x]),se=z.useCallback(()=>{x.setOpen(!1,oe(Hr))},[x,oe]);z.useImperativeHandle(u,()=>({unmount:ne,close:se}),[ne,se]);let ce;j.type===`context-menu`&&(ce=j.context),z.useImperativeHandle(ce?.positionerRef,()=>D,[D]),z.useImperativeHandle(ce?.actionsRef,()=>({setOpen:R}),[R]);let le=Oc({popupStore:x,onOpenChange:R}),ue=le.context.events;z.useEffect(()=>{let e=({open:e,eventDetails:t})=>R(e,t);return ue.on(`setOpen`,e),()=>{ue?.off(`setOpen`,e)}},[ue,R]);let de=Mo(le,{enabled:!k,bubbles:{escapeKey:d&&j.type===`menu`},outsidePress(){return j.type!==`context-menu`||P.current?.type===`contextmenu`?!0:re.current},externalTree:F?S:void 0}),fe=Zc(le,{role:`menu`}),pe=bl(),me=z.useCallback(e=>{x.select(`activeIndex`)!==e&&x.set(`activeIndex`,e)},[x]),he=Yc(le,{enabled:!k,listRef:x.context.itemDomElements,activeIndex:M,nested:j.type!==void 0,loopFocus:c,orientation:l,parentOrientation:j.type===`menubar`?j.context.orientation:void 0,rtl:pe===`rtl`,disabledIndices:Fn,onNavigate:me,openOnArrowKeyDown:j.type!==`context-menu`,externalTree:F?S:void 0,focusItemOnHover:h}),ge=z.useCallback(e=>{x.context.typingRef.current=e},[x]),{getReferenceProps:_e,getFloatingProps:ve,getItemProps:ye,getTriggerProps:be}=zc([de,fe,he,Qc(le,{listRef:x.context.itemLabels,elementsRef:x.context.itemDomElements,activeIndex:M,resetMs:500,onMatch:e=>{T&&e!==M&&x.set(`activeIndex`,e)},onTypingChange:ge})]),xe=z.useMemo(()=>{let e=$t(_e(),{onMouseMove(){x.set(`allowMouseEnter`,!0)}},I);return delete e.role,e},[_e,x,I]),Se=z.useMemo(()=>{let e=be();if(!e)return e;let t=$t(e,I);return delete t.role,delete t[`aria-controls`],t},[be,I]),Ce=z.useMemo(()=>ve({onMouseMove(){x.set(`allowMouseEnter`,!0),j.type===`menu`&&x.set(`hoverEnabled`,!1)},onClick(){x.select(`hoverEnabled`)&&x.set(`hoverEnabled`,!1)},onKeyDown(e){let t=x.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}}),[ve,j.type,x]),we=z.useMemo(()=>ye(),[ye]);x.useSyncedValues({floatingRootContext:le,activeTriggerProps:xe,inactiveTriggerProps:Se,popupProps:Ce,itemProps:we});let Te=z.useMemo(()=>({store:x,parent:b}),[x,b]),Ee=(0,U.jsx)(zD.Provider,{value:Te,children:typeof t==`function`?t({payload:ee}):t});return j.type===void 0||j.type===`context-menu`?(0,U.jsx)(po,{externalTree:S,children:Ee}):Ee});function yO(e){let t=e.getBoundingClientRect(),n=xt(e),r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function bO(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=_n(),{ref:i,index:a}=YD(e),o=n===a,s=z.useRef(null),c=Sn(i,s);return{compositeProps:z.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}function xO(e){let{render:t,className:n,style:r,state:i=In,props:a=Fn,refs:o=Fn,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=bO({metadata:s});return Hn(l,e,{state:i,ref:[...o,f],props:[d,...a,u],stateAttributesMapping:c})}function SO(e){if(Tt(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!Lt(e))return SO(Bt(e))}function CO(e,t){let n=z.useRef(null);return{preFocusGuardRef:n,handlePreFocusGuardFocus:B(t=>{He.flushSync(()=>{e.setOpen(!1,Ur(Ir,t.nativeEvent,t.currentTarget))}),Oa(n.current)?.focus()}),handleFocusTargetFocus:B(n=>{let r=e.select(`positionerElement`);if(r&&ka(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{He.flushSync(()=>{e.setOpen(!1,Ur(Ir,n.nativeEvent,n.currentTarget))});let i=Da(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&pi(r,i);){let e=i;if(i=wa(i),i===e)break}i?.focus()}})}}function wO(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=z.useRef(!1);return z.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,ti(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:In,[t,n,r])}var TO=2,EO=Zs(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,openOnHover:s,delay:c=100,closeDelay:l=0,handle:u,payload:d,style:f,...p}=e,m=BD(!0),h=u?.store??m?.store;if(!h)throw Error(hn(85));let g=vl(o),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=z.useRef(null),x=OO(),S=_n(!0),C=lo(),w=z.useMemo(()=>C??new ao,[C]),{registerTrigger:T,isMountedByThisTrigger:E}=vc(g,b,h,{payload:d,closeDelay:l,parent:x,floatingTreeRoot:w,floatingNodeId:uo(w),floatingParentNodeId:co(),keyboardEventRelay:S?.relayKeyboardEvent}),D=x.type===`menubar`,O=h.useState(`disabled`),k=i||O||D&&x.context.disabled,{getButtonProps:A,buttonRef:j}=yn({disabled:k,native:a});z.useEffect(()=>{!y&&x.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,x.type]);let M=z.useRef(null),ee=ar(),N=B(e=>{if(!M.current)return;ee.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(pi(M.current,t)||pi(h.select(`positionerElement`),t)||t===M.current||t!=null&&SO(t)===h.select(`rootId`))return;let n=yO(M.current);e.clientX>=n.left-TO&&e.clientX<=n.right+TO&&e.clientY>=n.top-TO&&e.clientY<=n.bottom+TO||w.events.emit(`close`,{domEvent:e,reason:zr})});z.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&ti(M.current).addEventListener(`mouseup`,N,{once:!0})},[y,N,h]);let P=D&&x.context.hasSubmenuOpen,F=Rc(v,{enabled:(s??P)&&!k&&x.type!==`context-menu`&&(!D||P&&!E),handleClose:ol({blockPointerEvents:!D}),mouseOnly:!0,move:!1,restMs:x.type===void 0?c:void 0,delay:{close:l},triggerElementRef:b,externalTree:w,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),te=DO(y,h.select(`lastOpenChangeReason`)),I=To(v,{enabled:!k&&x.type!==`context-menu`,event:y&&D?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:x.type===void 0?te:!1}),ne=Ac(v,{enabled:!k&&P}),re=wO({open:y,enabled:D,mouseDownAction:`open`}),ie=zc([I,ne]),L={disabled:k,open:y},ae=h.useState(`triggerProps`,E),R=[M,t,j,T,b],oe=[ie.getReferenceProps(),F??In,ae,{"aria-haspopup":`menu`,id:g,onMouseDown:e=>{h.select(`open`)||(ee.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),ti(e.currentTarget).addEventListener(`mouseup`,N,{once:!0}))}},D?{role:`menuitem`}:{},re,p,A],{preFocusGuardRef:se,handlePreFocusGuardFocus:ce,handleFocusTargetFocus:le}=CO(h,b),ue=Hn(`button`,e,{enabled:!D,stateAttributesMapping:gl,state:L,ref:R,props:oe});return D?(0,U.jsx)(xO,{tag:`button`,render:n,className:r,style:f,state:L,refs:R,props:oe,stateAttributesMapping:gl}):y?(0,U.jsxs)(z.Fragment,{children:[(0,U.jsx)(ai,{ref:se,onFocus:ce},`${g}-pre-focus-guard`),(0,U.jsx)(z.Fragment,{children:ue},g),(0,U.jsx)(ai,{ref:h.context.triggerFocusTargetRef,onFocus:le},`${g}-post-focus-guard`)]}):(0,U.jsx)(z.Fragment,{children:ue},g)});function DO(e,t){let n=ar(),[r,i]=z.useState(!1);return V(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function OO(){let e=HD(!0),t=BD(!0),n=fO(!0);return z.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}function kO({...e}){return(0,U.jsx)(vO,{"data-slot":`dropdown-menu`,...e})}function AO({...e}){return(0,U.jsx)(EO,{"data-slot":`dropdown-menu-trigger`,...e})}function jO({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,U.jsx)(rO,{children:(0,U.jsx)(uO,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,U.jsx)(eO,{"data-slot":`dropdown-menu-content`,className:H(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function MO({className:e,inset:t,variant:n=`default`,...r}){return(0,U.jsx)(XD,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:H(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function NO(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function PO(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function FO(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function IO(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(FO(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function LO(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?PO(e.value):PO(e)}W(e=>e.id),W(e=>e.labelId),W(e=>e.modal),W(e=>e.multiple),W(e=>e.items),W(e=>e.itemToStringLabel),W(e=>e.itemToStringValue),W(e=>e.isItemEqualToValue),W(e=>e.value),W(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:LO(t,r)!==``}),W((e,t)=>t?IO(e.items):!1),W(e=>e.open),W(e=>e.mounted),W(e=>e.forceMount),W(e=>e.transitionStatus),W(e=>e.openMethod),W(e=>e.activeIndex),W(e=>e.selectedIndex),W((e,t)=>e.activeIndex===t),W((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>NO(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:NO(n,i,r)}),W((e,t)=>e.selectedIndex===t),W(e=>e.popupProps),W(e=>e.triggerProps),W(e=>e.triggerElement),W(e=>e.positionerElement),W(e=>e.listElement),W(e=>e.scrollUpArrowVisible),W(e=>e.scrollDownArrowVisible),W(e=>e.hasScrollArrows);function RO({className:e,...t}){return(0,U.jsx)(iu,{role:`status`,"aria-label":`Loading`,className:H(`size-4 animate-spin`,e),...t})}var zO=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,BO=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=zO[n[e]&63];return t},VO=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}},HO=(0,z.createContext)(null),UO=(0,z.createContext)(null),WO=()=>(0,z.useContext)(HO),GO=()=>(0,z.useContext)(UO),KO=(0,z.createContext)(null),qO=()=>{let e=GO(),t=(0,z.useContext)(KO)??e;if(!t)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return t},JO=(0,z.createContext)(null),YO=({label:e=`Add photos or files`,...t})=>{let n=qO(),r=(0,z.useCallback)(()=>{n.openFileDialog()},[n]);return(0,U.jsxs)(MO,{...t,closeOnClick:!1,onClick:r,children:[(0,U.jsx)(nu,{className:`mr-2 size-4`}),` `,e]})},XO=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:o,onError:s,onSubmit:c,children:l,...u})=>{let d=WO(),f=!!d,p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)([]),_=f?d.attachments.files:h,[v,y]=(0,z.useState)([]),b=(0,z.useRef)(_);(0,z.useEffect)(()=>{b.current=_},[_]);let x=(0,z.useCallback)(()=>{p.current?.click()},[]),S=(0,z.useCallback)(e=>!t||t.trim()===``?!0: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,z.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:!0);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:BO(),mediaType:e.type,type:`file`,url:URL.createObjectURL(e)});return[...e,...i]})},[S,a,o,s]),w=(0,z.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,z.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:!0);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,z.useCallback)(()=>f?d?.attachments.clear():g(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[f,d]),D=(0,z.useCallback)(()=>y([]),[]),O=f?T:C,k=f?d.attachments.remove:w,A=f?d.attachments.openFileDialog:x,j=(0,z.useCallback)(()=>{E(),D()},[E,D]);(0,z.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,z.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value=``)},[_,i]),(0,z.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&&O(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[O,r]),(0,z.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&&O(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[O,r]),(0,z.useEffect)(()=>()=>{if(!f)for(let e of b.current)e.url&&URL.revokeObjectURL(e.url)},[f]);let M=(0,z.useCallback)(e=>{e.currentTarget.files&&O(e.currentTarget.files),e.currentTarget.value=``},[O]),ee=(0,z.useMemo)(()=>({add:O,clear:E,fileInputRef:p,files:_.map(e=>({...e,id:e.id})),openFileDialog:A,remove:k}),[_,O,k,E,A]),N=(0,z.useMemo)(()=>({add:e=>{let t=Array.isArray(e)?e:[e];y(e=>[...e,...t.map(e=>({...e,id:BO()}))])},clear:D,remove:e=>{y(t=>t.filter(t=>t.id!==e))},sources:v}),[v,D]),P=(0,z.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,...t})=>{if(t.url?.startsWith(`blob:`)){let e=await VO(t.url);return{...t,url:e??t.url}}return t})),text:n},e);if(t instanceof Promise)try{await t,j(),f&&d.textInput.clear()}catch{}else j(),f&&d.textInput.clear()}catch{}},[f,d,_,c,j]),F=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{accept:t,"aria-label":`Upload files`,className:`hidden`,multiple:n,onChange:M,ref:p,title:`Upload files`,type:`file`}),(0,U.jsx)(`form`,{className:H(`w-full`,e),onSubmit:P,ref:m,...u,children:(0,U.jsx)(jD,{className:`overflow-hidden`,children:l})})]}),te=(0,U.jsx)(JO.Provider,{value:N,children:F});return(0,U.jsx)(KO.Provider,{value:ee,children:te})},ZO=({className:e,...t})=>(0,U.jsx)(`div`,{className:H(`contents`,e),...t}),QO=({onChange:e,onKeyDown:t,className:n,placeholder:r=`What would you like to know?`,...i})=>{let a=WO(),o=qO(),[s,c]=(0,z.useState)(!1),l=(0,z.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,z.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,z.useCallback)(()=>c(!1),[]),f=(0,z.useCallback)(()=>c(!0),[]),p=a?{onChange:t=>{a.textInput.setInput(t.currentTarget.value),e?.(t)},value:a.textInput.value}:{onChange:e};return(0,U.jsx)(ID,{className:H(`field-sizing-content max-h-48 min-h-16`,n),name:`message`,onCompositionEnd:d,onCompositionStart:f,onKeyDown:l,onPaste:u,placeholder:r,...i,...p})},$O=({className:e,...t})=>(0,U.jsx)(ND,{align:`block-end`,className:H(`order-first flex-wrap gap-1`,e),...t}),ek=({className:e,...t})=>(0,U.jsx)(ND,{align:`block-end`,className:H(`justify-between gap-1`,e),...t}),tk=({className:e,...t})=>(0,U.jsx)(`div`,{className:H(`flex min-w-0 items-center gap-1`,e),...t}),nk=({variant:e=`ghost`,className:t,size:n,tooltip:r,...i})=>{let a=n??(z.Children.count(i.children)>1?`sm`:`icon-sm`),o=(0,U.jsx)(FD,{className:H(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,U.jsxs)(yd,{children:[(0,U.jsx)(bd,{children:o}),(0,U.jsxs)(xd,{side:l,children:[s,c&&(0,U.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:c})]})]})},rk=e=>(0,U.jsx)(kO,{...e}),ik=({className:e,children:t,...n})=>(0,U.jsx)(AO,{render:(0,U.jsx)(nk,{className:e,...n}),children:t??(0,U.jsx)(uu,{className:`size-4`})}),ak=({className:e,...t})=>(0,U.jsx)(jO,{align:`start`,className:H(e),...t}),ok=({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,U.jsx)(Zl,{className:`size-4`});r===`submitted`?l=(0,U.jsx)(RO,{}):r===`streaming`?l=(0,U.jsx)(mu,{className:`size-4`}):r===`error`&&(l=(0,U.jsx)(bu,{className:`size-4`}));let u=(0,z.useCallback)(e=>{if(c&&i){e.preventDefault(),i();return}a?.(e)},[c,i,a]);return(0,U.jsx)(FD,{"aria-label":c?`Stop`:`Submit`,className:H(e),onClick:u,size:n,type:c&&i?`button`:`submit`,variant:t,...s,children:o??l})};function sk(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,a=t!==void 0,[o,s]=wD({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:c,setMounted:l,transitionStatus:u}=uc(o,!0,!0),[d,f]=z.useState(o),[{height:p,width:m},h]=z.useState({height:void 0,width:void 0}),g=vl(),[_,v]=z.useState(),y=_??g,[b,x]=z.useState(!1),[S,C]=z.useState(!1),w=z.useRef(null),T=z.useRef(null),E=z.useRef(null),D=z.useRef(null),O=hc(D,!1),k=B(e=>{let t=!o,n=Ur(Ar,e.nativeEvent);if(r(t,n),n.isCanceled)return;let i=D.current;T.current===`css-animation`&&i!=null&&i.style.removeProperty(`animation-name`),!b&&!S&&(T.current!=null&&T.current!==`css-animation`&&!c&&t&&l(!0),T.current===`css-animation`&&(!d&&t&&f(!0),!c&&t&&l(!0))),s(t),T.current===`none`&&c&&!t&&l(!1)});return V(()=>{a&&T.current===`none`&&!o&&l(!1)},[a,o,t,l]),z.useMemo(()=>({abortControllerRef:w,animationTypeRef:T,disabled:i,handleTrigger:k,height:p,mounted:c,open:o,panelId:y,panelRef:D,runOnceAnimationsFinish:O,setDimensions:h,setHiddenUntilFound:x,setKeepMounted:C,setMounted:l,setOpen:s,setPanelIdState:v,setVisible:f,transitionDimensionRef:E,transitionStatus:u,visible:d,width:m}),[w,T,i,k,p,c,o,y,D,O,h,x,C,l,s,f,E,u,d,m])}var ck=z.createContext(void 0);function lk(){let e=z.useContext(ck);if(e===void 0)throw Error(hn(15));return e}var uk=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=dc.startingStyle]=`startingStyle`,e[e.endingStyle=dc.endingStyle]=`endingStyle`,e}({}),dk=function(e){return e.panelOpen=`data-panel-open`,e}({}),fk={[uk.open]:``},pk={[uk.closed]:``},mk={open(e){return e?{[dk.panelOpen]:``}:null}},hk={open(e){return e?fk:pk},...mc},gk=z.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=B(o),d=sk({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=z.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=z.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=Hn(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:hk});return(0,U.jsx)(ck.Provider,{value:p,children:m})}),_k={...mk,...mc},vk=z.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=lk(),{className:s,disabled:c=o,id:l,render:u,nativeButton:d=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=yn({disabled:c,focusableWhenDisabled:!0,native:d}),g=z.useMemo(()=>({"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i}),[n,r,i]);return Hn(`button`,e,{state:a,ref:[t,h],props:[g,p,m],stateAttributesMapping:_k})}),yk=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e}({});function bk(e){let{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:i,hiddenUntilFound:a,keepMounted:o,id:s,mounted:c,onOpenChange:l,open:u,panelRef:d,runOnceAnimationsFinish:f,setDimensions:p,setMounted:m,setOpen:h,setVisible:g,transitionDimensionRef:_,visible:v,width:y}=e,b=z.useRef(!1),x=z.useRef(null),S=z.useRef(u),C=z.useRef(u),w=ei(),T=z.useMemo(()=>n.current===`css-animation`?!v:!u&&!c,[u,c,v,n]),E=Sn(r,d,B(e=>{if(!e)return;if(n.current==null||_.current==null){let t=getComputedStyle(e),r=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;r&&i||(t.animationName===`none`&&t.transitionDuration!==`0s`?n.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?n.current=`css-animation`:n.current=`none`),e.getAttribute(yk.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?_.current=`width`:_.current=`height`}if(n.current!==`css-transition`)return;(i===void 0||y===void 0)&&(p({height:e.scrollHeight,width:e.scrollWidth}),C.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,r=-1;return t=$r.request(()=>{C.current=!1,r=$r.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{$r.cancel(t),$r.cancel(r)}}));return V(()=>{if(n.current!==`css-transition`)return;let e=d.current;if(!e)return;let r=-1;if(t.current!=null&&(t.current.abort(),t.current=null),u){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`)}),!C.current&&!o&&e.setAttribute(uk.startingStyle,``),p({height:e.scrollHeight,width:e.scrollWidth}),r=$r.request(()=>{Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;p({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let r=n.signal,i=null,a=uk.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,f(()=>{p({height:0,width:0}),e.style.removeProperty(`content-visibility`),m(!1),t.current===n&&(t.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),w.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{$r.cancel(r)}},[t,n,w,a,o,c,u,d,f,p,m]),V(()=>{if(n.current!==`css-animation`)return;let e=d.current;e&&(x.current=e.style.animationName||x.current,e.style.setProperty(`animation-name`,`none`),p({height:e.scrollHeight,width:e.scrollWidth}),!S.current&&!b.current&&e.style.removeProperty(`animation-name`),u?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),g(!0)):(t.current=new AbortController,f(()=>{m(!1),g(!1),t.current=null},t.current.signal)))},[t,n,u,d,f,p,m,g,v]),nr(()=>{let e=$r.request(()=>{S.current=!1});return()=>$r.cancel(e)}),V(()=>{if(!a)return;let e=d.current;if(!e)return;let t=-1,n=-1;return u&&b.current&&(e.style.transitionDuration=`0s`,p({height:e.scrollHeight,width:e.scrollWidth}),t=$r.request(()=>{b.current=!1,n=$r.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{$r.cancel(t),$r.cancel(n)}},[a,u,d,p]),V(()=>{let e=d.current;e&&a&&T&&(e.setAttribute(`hidden`,`until-found`),n.current===`css-transition`&&e.setAttribute(uk.startingStyle,``))},[a,T,n,d]),z.useEffect(function(){let e=d.current;if(!e)return;function t(e){b.current=!0,h(!0),l(!0,Ur(kr,e))}return qr(e,`beforematch`,t)},[l,d,h]),z.useMemo(()=>({props:{hidden:T,id:s,ref:E}}),[T,s,E])}var xk=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),Sk=z.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{abortControllerRef:l,animationTypeRef:u,height:d,mounted:f,onOpenChange:p,open:m,panelId:h,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setHiddenUntilFound:y,setKeepMounted:b,setMounted:x,setPanelIdState:S,setOpen:C,setVisible:w,state:T,transitionDimensionRef:E,visible:D,width:O,transitionStatus:k}=lk(),A=r??!1,j=i??!1;V(()=>{if(o)return S(o),()=>{S(void 0)}},[o,S]),V(()=>{y(A)},[y,A]),V(()=>{b(j)},[b,j]);let{props:M}=bk({abortControllerRef:l,animationTypeRef:u,externalRef:t,height:d,hiddenUntilFound:A,id:h,keepMounted:j,mounted:f,onOpenChange:p,open:m,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setMounted:x,setOpen:C,setVisible:w,transitionDimensionRef:E,visible:D,width:O});gc({open:m&&k===`idle`,ref:g,onComplete(){m&&v({height:void 0,width:void 0})}});let ee=Hn(`div`,e,{state:z.useMemo(()=>({...T,transitionStatus:k}),[T,k]),ref:[t,g],props:[M,{style:{[xk.collapsiblePanelHeight]:d===void 0?`auto`:`${d}px`,[xk.collapsiblePanelWidth]:O===void 0?`auto`:`${O}px`}},c],stateAttributesMapping:hk});return j||A||f?ee:null});function Ck({...e}){return(0,U.jsx)(gk,{"data-slot":`collapsible`,...e})}function wk({...e}){return(0,U.jsx)(vk,{"data-slot":`collapsible-trigger`,...e})}function Tk({...e}){return(0,U.jsx)(Sk,{"data-slot":`collapsible-content`,...e})}var Ek=(0,z.createContext)({});function Dk(e){let t=(0,z.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ok=typeof window<`u`?z.useLayoutEffect:z.useEffect,kk=(0,z.createContext)(null);function Ak(e,t){e.indexOf(t)===-1&&e.push(t)}function jk(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Mk=(e,t,n)=>n>t?t:n<e?e:n,Nk={},Pk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Fk(e){return typeof e==`object`&&!!e}var Ik=e=>/^0[^.\s]+$/u.test(e);function Lk(e){let t;return()=>(t===void 0&&(t=e()),t)}var Rk=e=>e,zk=(e,t)=>n=>t(e(n)),Bk=(...e)=>e.reduce(zk),Vk=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},Hk=class{constructor(){this.subscriptions=[]}add(e){return Ak(this.subscriptions,e),()=>jk(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}},Uk=e=>e*1e3,Wk=e=>e/1e3;function Gk(e,t){return t?1e3/t*e:0}var Kk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,qk=1e-7,Jk=12;function Yk(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Kk(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>qk&&++s<Jk);return o}function Xk(e,t,n,r){if(e===t&&n===r)return Rk;let i=t=>Yk(t,0,1,e,n);return e=>e===0||e===1?e:Kk(i(e),t,r)}var Zk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Qk=e=>t=>1-e(1-t),$k=Xk(.33,1.53,.69,.99),eA=Qk($k),tA=Zk(eA),nA=e=>e>=1?1:(e*=2)<1?.5*eA(e):.5*(2-2**(-10*(e-1))),rA=e=>1-Math.sin(Math.acos(e)),iA=Qk(rA),aA=Zk(rA),oA=Xk(.42,0,1,1),sA=Xk(0,0,.58,1),cA=Xk(.42,0,.58,1),lA=e=>Array.isArray(e)&&typeof e[0]!=`number`,uA=e=>Array.isArray(e)&&typeof e[0]==`number`,dA={linear:Rk,easeIn:oA,easeInOut:cA,easeOut:sA,circIn:rA,circInOut:aA,circOut:iA,backIn:eA,backInOut:tA,backOut:$k,anticipate:nA},fA=e=>typeof e==`string`,pA=e=>{if(uA(e)){e.length;let[t,n,r,i]=e;return Xk(t,n,r,i)}else if(fA(e))return dA[e],`${e}`,dA[e];return e},mA=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],hA={value:null,addProjectionMetrics:null};function gA(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&hA.value&&hA.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var _A=40;function vA(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=mA.reduce((e,n)=>(e[n]=gA(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Nk.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,_A),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:mA.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<mA.length;t++)o[mA[t]].cancel(e)},state:i,steps:o}}var{schedule:yA,cancel:bA,state:xA,steps:SA}=vA(typeof requestAnimationFrame<`u`?requestAnimationFrame:Rk,!0),CA;function wA(){CA=void 0}var TA={now:()=>(CA===void 0&&TA.set(xA.isProcessing||Nk.useManualTiming?xA.timestamp:performance.now()),CA),set:e=>{CA=e,queueMicrotask(wA)}},EA={layout:0,mainThread:0,waapi:0},DA=e=>t=>typeof t==`string`&&t.startsWith(e),OA=DA(`--`),kA=DA(`var(--`),AA=e=>kA(e)?jA.test(e.split(`/*`)[0].trim()):!1,jA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function MA(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var NA={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},PA={...NA,transform:e=>Mk(0,1,e)},FA={...NA,default:1},IA=e=>Math.round(e*1e5)/1e5,LA=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function RA(e){return e==null}var zA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,BA=(e,t)=>n=>!!(typeof n==`string`&&zA.test(n)&&n.startsWith(e)||t&&!RA(n)&&Object.prototype.hasOwnProperty.call(n,t)),VA=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(LA);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},HA=e=>Mk(0,255,e),UA={...NA,transform:e=>Math.round(HA(e))},WA={test:BA(`rgb`,`red`),parse:VA(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+UA.transform(e)+`, `+UA.transform(t)+`, `+UA.transform(n)+`, `+IA(PA.transform(r))+`)`};function GA(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 KA={test:BA(`#`),parse:GA,transform:WA.transform},qA=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),JA=qA(`deg`),YA=qA(`%`),K=qA(`px`),XA=qA(`vh`),ZA=qA(`vw`),QA={...YA,parse:e=>YA.parse(e)/100,transform:e=>YA.transform(e*100)},$A={test:BA(`hsl`,`hue`),parse:VA(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+YA.transform(IA(t))+`, `+YA.transform(IA(n))+`, `+IA(PA.transform(r))+`)`},ej={test:e=>WA.test(e)||KA.test(e)||$A.test(e),parse:e=>WA.test(e)?WA.parse(e):$A.test(e)?$A.parse(e):KA.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?WA.transform(e):$A.transform(e),getAnimatableNone:e=>{let t=ej.parse(e);return t.alpha=0,ej.transform(t)}},tj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function nj(e){return isNaN(e)&&typeof e==`string`&&(e.match(LA)?.length||0)+(e.match(tj)?.length||0)>0}var rj=`number`,ij=`color`,aj=`var`,oj=`var(`,sj="${}",cj=/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 lj(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(cj,e=>(ej.test(e)?(r.color.push(a),i.push(ij),n.push(ej.parse(e))):e.startsWith(oj)?(r.var.push(a),i.push(aj),n.push(e)):(r.number.push(a),i.push(rj),n.push(parseFloat(e))),++a,sj)).split(sj),indexes:r,types:i}}function uj(e){return lj(e).values}function dj({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];e===rj?i+=IA(r[a]):e===ij?i+=ej.transform(r[a]):i+=r[a]}return i}}function fj(e){return dj(lj(e))}var pj=e=>typeof e==`number`?0:ej.test(e)?ej.getAnimatableNone(e):e,mj=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:pj(e);function hj(e){let t=lj(e);return dj(t)(t.values.map((e,n)=>mj(e,t.split[n])))}var gj={test:nj,parse:uj,createTransformer:fj,getAnimatableNone:hj};function _j(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 vj({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=_j(s,r,e+1/3),a=_j(s,r,e),o=_j(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function yj(e,t){return n=>n>0?t:e}var bj=(e,t,n)=>e+(t-e)*n,xj=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Sj=[KA,WA,$A],Cj=e=>Sj.find(t=>t.test(e));function wj(e){let t=Cj(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===$A&&(n=vj(n)),n}var Tj=(e,t)=>{let n=wj(e),r=wj(t);if(!n||!r)return yj(e,t);let i={...n};return e=>(i.red=xj(n.red,r.red,e),i.green=xj(n.green,r.green,e),i.blue=xj(n.blue,r.blue,e),i.alpha=bj(n.alpha,r.alpha,e),WA.transform(i))},Ej=new Set([`none`,`hidden`]);function Dj(e,t){return Ej.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Oj(e,t){return n=>bj(e,t,n)}function kj(e){return typeof e==`number`?Oj:typeof e==`string`?AA(e)?yj:ej.test(e)?Tj:Nj:Array.isArray(e)?Aj:typeof e==`object`?ej.test(e)?Tj:jj:yj}function Aj(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>kj(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function jj(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=kj(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Mj(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]];n[i]=e.values[o]??0,r[a]++}return n}var Nj=(e,t)=>{let n=gj.createTransformer(t),r=lj(e),i=lj(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?Ej.has(e)&&!i.values.length||Ej.has(t)&&!r.values.length?Dj(e,t):Bk(Aj(Mj(r,i),i.values),n):(`${e}${t}`,yj(e,t))};function Pj(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?bj(e,t,n):kj(e)(e,t)}var Fj=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>yA.update(t,e),stop:()=>bA(t),now:()=>xA.isProcessing?xA.timestamp:TA.now()}},Ij=(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)})`},Lj=2e4;function Rj(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 zj(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Rj(r),Lj);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Wk(i)}}var Bj={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 Vj(e,t){return e*Math.sqrt(1-t*t)}var Hj=12;function Uj(e,t,n){let r=n;for(let n=1;n<Hj;n++)r-=e(r)/t(r);return r}var Wj=.001;function Gj({duration:e=Bj.duration,bounce:t=Bj.bounce,velocity:n=Bj.velocity,mass:r=Bj.mass}){let i,a;Bj.maxDuration;let o=1-t;o=Mk(Bj.minDamping,Bj.maxDamping,o),e=Mk(Bj.minDuration,Bj.maxDuration,Wk(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Vj(t,o),c=Math.exp(-i);return Wj-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=Vj(t**2,o);return(-i(t)+Wj>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-Wj+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Uj(i,a,s);if(e=Uk(e),isNaN(c))return{stiffness:Bj.stiffness,damping:Bj.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Kj=[`duration`,`bounce`],qj=[`stiffness`,`damping`,`mass`];function Jj(e,t){return t.some(t=>e[t]!==void 0)}function Yj(e){let t={velocity:Bj.velocity,stiffness:Bj.stiffness,damping:Bj.damping,mass:Bj.mass,isResolvedFromDuration:!1,...e};if(!Jj(e,qj)&&Jj(e,Kj))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Mk(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Bj.mass,stiffness:i,damping:a}}else{let n=Gj({...e,velocity:0});t={...t,...n,mass:Bj.mass},t.isResolvedFromDuration=!0}return t}function Xj(e=Bj.visualDuration,t=Bj.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}=Yj({...n,velocity:-Wk(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Wk(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?Bj.restSpeed.granular:Bj.restSpeed.default,i||=v?Bj.restDelta.granular:Bj.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Vj(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(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=>Uk(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=Uk(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=Uk(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(Rj(T),Lj),t=Ij(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Xj.applyToOptions=e=>{let t=zj(e,100,Xj);return e.ease=t.ease,e.duration=Uk(t.duration),e.type=`keyframes`,e};var Zj=5;function Qj(e,t,n){let r=Math.max(t-Zj,0);return Gk(n-e(r),t-r)}function $j({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=Xj({keyframes:[f.value,m(f.value)],velocity:Qj(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 eM(e,t,n){let r=[],i=n||Nk.mix||Pj,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Bk(Array.isArray(t)?t[n]||Rk:t,a)),r.push(a)}return r}function tM(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=eM(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=Vk(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Mk(e[0],e[a-1],t)):l}function nM(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Vk(0,t,r);e.push(bj(n,1,i))}}function rM(e){let t=[0];return nM(t,e.length-1),t}function iM(e,t){return e.map(e=>e*t)}function aM(e,t){return e.map(()=>t||cA).splice(0,e.length-1)}function oM({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=lA(r)?r.map(pA):pA(r),a={done:!1,value:t[0]},o=tM(iM(n&&n.length===t.length?n:rM(t),e),t,{ease:Array.isArray(i)?i:aM(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var sM=e=>e!==null;function cM(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(sM),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var lM={decay:$j,inertia:$j,tween:oM,keyframes:oM,spring:Xj};function uM(e){typeof e.type==`string`&&(e.type=lM[e.type])}var dM=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)}},fM=e=>e/100,pM=class extends dM{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!==TA.now()&&this.tick(TA.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},EA.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;uM(e);let{type:t=oM,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||oM;s!==oM&&typeof o[0]!=`number`&&(this.mixKeyframes=Bk(fM,Pj(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=Rj(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.holdTime===null?this.currentTime=t:this.currentTime=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=Mk(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!==$j&&(b.value=cM(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 Wk(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Wk(e)}get time(){return Wk(this.currentTime)}set time(e){e=Uk(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 Qj(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(TA.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Wk(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Fj,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(TA.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,EA.mainThread--}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 mM(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var hM=e=>e*180/Math.PI,gM=e=>vM(hM(Math.atan2(e[1],e[0]))),_M={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gM,rotateZ:gM,skewX:e=>hM(Math.atan(e[1])),skewY:e=>hM(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vM=e=>(e%=360,e<0&&(e+=360),e),yM=gM,bM=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xM=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),SM={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bM,scaleY:xM,scale:e=>(bM(e)+xM(e))/2,rotateX:e=>vM(hM(Math.atan2(e[6],e[5]))),rotateY:e=>vM(hM(Math.atan2(-e[2],e[0]))),rotateZ:yM,rotate:yM,skewX:e=>hM(Math.atan(e[4])),skewY:e=>hM(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function CM(e){return+!!e.includes(`scale`)}function wM(e,t){if(!e||e===`none`)return CM(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=SM,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_M,i=t}if(!i)return CM(t);let a=r[t],o=i[1].split(`,`).map(EM);return typeof a==`function`?a(o):o[a]}var TM=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return wM(n,t)};function EM(e){return parseFloat(e.trim())}var DM=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],OM=new Set(DM),kM=e=>e===NA||e===K,AM=new Set([`x`,`y`,`z`]),jM=DM.filter(e=>!AM.has(e));function MM(e){let t=[];return jM.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var NM={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})=>wM(t,`x`),y:(e,{transform:t})=>wM(t,`y`)};NM.translateX=NM.x,NM.translateY=NM.y;var PM=new Set,FM=!1,IM=!1,LM=!1;function RM(){if(IM){let e=Array.from(PM).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=MM(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)})}IM=!1,FM=!1,PM.forEach(e=>e.complete(LM)),PM.clear()}function zM(){PM.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(IM=!0)})}function BM(){LM=!0,zM(),RM(),LM=!1}var VM=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?(PM.add(this),FM||(FM=!0,yA.read(zM),yA.resolveKeyframes(RM))):(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])}mM(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),PM.delete(this)}cancel(){this.state===`scheduled`&&(PM.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},HM=e=>e.startsWith(`--`);function UM(e,t,n){HM(t)?e.style.setProperty(t,n):e.style[t]=n}var WM={};function GM(e,t){let n=Lk(e);return()=>WM[t]??n()}var KM=GM(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),qM=GM(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),JM=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,YM={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:JM([0,.65,.55,1]),circOut:JM([.55,0,1,.45]),backIn:JM([.31,.01,.66,-.59]),backOut:JM([.33,1.53,.69,.99])};function XM(e,t){if(e)return typeof e==`function`?qM()?Ij(e,t):`ease-out`:uA(e)?JM(e):Array.isArray(e)?e.map(e=>XM(e,t)||YM.easeOut):YM[e]}function ZM(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=XM(s,i);Array.isArray(d)&&(u.easing=d),hA.value&&EA.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return hA.value&&p.finished.finally(()=>{EA.waapi--}),p}function QM(e){return typeof e==`function`&&`applyToOptions`in e}function $M({type:e,...t}){return QM(e)&&qM()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var eN=class extends dM{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=$M(e);this.animation=ZM(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=cM(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),UM(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 Wk(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Wk(e)}get time(){return Wk(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Uk(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&&KM()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Rk):r(this)}},tN={anticipate:nA,backInOut:tA,circInOut:aA};function nN(e){return e in tN}function rN(e){typeof e.ease==`string`&&nN(e.ease)&&(e.ease=tN[e.ease])}var iN=10,aN=class extends eN{constructor(e){rN(e),uM(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 pM({...a,autoplay:!1}),s=Math.max(iN,TA.now()-this.startTime),c=Mk(0,iN,s-iN),l=o.sample(s).value,{name:u}=this.options;i&&u&&UM(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},oN=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(gj.test(e)||e===`0`)&&!e.startsWith(`url(`));function sN(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 cN(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=oN(i,t),s=oN(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:sN(e)||(n===`spring`||QM(n))&&r}function lN(e){e.duration=0,e.type=`keyframes`}var uN=new Set([`opacity`,`clipPath`,`filter`,`transform`]),dN=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function fN(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&dN.test(e[t]))return!0;return!1}var pN=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),mN=Lk(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function hN(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return mN()&&n&&(uN.has(n)||pN.has(n)&&fN(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var gN=40,_N=class extends dM{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=TA.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||VM)(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=TA.now();let u=!0;cN(e,i,a,o)||(u=!1,(Nk.instantAnimations||!s)&&l?.(cM(e,n,t)),e[0]=e[e.length-1],lN(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>gN?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&hN(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new aN({...d,element:p})}catch{m=new pM(d)}else m=new pM(d);m.finished.then(()=>{this.notifyFinished()}).catch(Rk),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(),BM()),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 vN(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 yN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bN(e){let t=yN.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function xN(e,t,n=1){`${e}`;let[r,i]=bN(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Pk(e)?parseFloat(e):e}return AA(i)?xN(i,t,n+1):i}var SN={type:`spring`,stiffness:500,damping:25,restSpeed:10},CN=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),wN={type:`keyframes`,duration:.8},TN={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},EN=(e,{keyframes:t})=>t.length>2?wN:OM.has(e)?e.startsWith(`scale`)?CN(t[1]):SN:TN;function DN(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function ON(e,t){let n=e?.[t]??e?.default??e;return n===e?n:DN(n,e)}var kN=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function AN(e){for(let t in e)if(!kN.has(t))return!0;return!1}var jN=(e,t,n,r={},i,a)=>o=>{let s=ON(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Uk(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};AN(s)||Object.assign(u,EN(e,u)),u.duration&&=Uk(u.duration),u.repeatDelay&&=Uk(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(lN(u),u.delay===0&&(d=!0)),(Nk.instantAnimations||Nk.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,lN(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=cM(u.keyframes,s);if(e!==void 0){yA.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new pM(u):new _N(u)};function MN(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function NN(e,t,n,r){if(typeof t==`function`){let[i,a]=MN(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]=MN(r);t=t(n===void 0?e.custom:n,i,a)}return t}function PN(e,t,n){let r=e.getProps();return NN(r,t,n===void 0?r.custom:n,e)}var FN=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...DM]),IN=30,LN=e=>!isNaN(parseFloat(e)),RN={current:void 0},zN=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=TA.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=TA.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=LN(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 Hk);let n=this.events[e].add(t);return e===`change`?()=>{n(),yA.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 RN.current&&RN.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=TA.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>IN)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,IN);return Gk(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 BN(e,t){return new zN(e,t)}var VN=e=>Array.isArray(e);function HN(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,BN(n))}function UN(e){return VN(e)?e[e.length-1]||0:e}function WN(e,t){let{transitionEnd:n={},transition:r={},...i}=PN(e,t)||{};i={...i,...n};for(let t in i)HN(e,t,UN(i[t]))}var GN=e=>!!(e&&e.getVelocity);function KN(e){return!!(GN(e)&&e.add)}function qN(e,t){let n=e.getValue(`willChange`);if(KN(n))return n.add(t);if(!n&&Nk.WillChange){let n=new Nk.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function JN(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var YN=`data-`+JN(`framerAppearId`);function XN(e){return e.props[YN]}function ZN({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function QN(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?DN(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&ZN(d,t))continue;let o={delay:n,...ON(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){yA.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=XN(e);if(n){let e=window.MotionHandoffAnimation(n,t,yA);e!==null&&(o.startTime=e,f=!0)}}qN(e,t);let p=l??e.shouldReduceMotion;r.start(jN(t,r,i,p&&FN.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>yA.update(()=>{o&&WN(e,o)});u.length?Promise.all(u).then(t):t()}return u}function $N(e,t,n={}){let r=PN(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(QN(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return eP(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())}else return Promise.all([a(),o(n.delay)])}function eP(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($N(c,t,{...o,delay:n+(typeof r==`function`?0:r)+vN(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function tP(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>$N(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=$N(e,t,n);else{let i=typeof t==`function`?PN(e,t,n.custom):t;r=Promise.all(QN(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var nP={test:e=>e===`auto`,parse:e=>e},rP=e=>t=>t.test(e),iP=[NA,K,YA,JA,ZA,XA,nP],aP=e=>iP.find(rP(e));function oP(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||Ik(e)}var sP=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function cP(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(LA)||[];if(!r)return e;let i=n.replace(r,``),a=+!!sP.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var lP=/\b([a-z-]*)\(.*?\)/gu,uP={...gj,getAnimatableNone:e=>{let t=e.match(lP);return t?t.map(cP).join(` `):e}},dP={...gj,getAnimatableNone:e=>{let t=gj.parse(e);return gj.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},fP={...NA,transform:Math.round},pP={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,top:K,right:K,bottom:K,left:K,inset:K,insetBlock:K,insetBlockStart:K,insetBlockEnd:K,insetInline:K,insetInlineStart:K,insetInlineEnd:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,paddingBlock:K,paddingBlockStart:K,paddingBlockEnd:K,paddingInline:K,paddingInlineStart:K,paddingInlineEnd:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,marginBlock:K,marginBlockStart:K,marginBlockEnd:K,marginInline:K,marginInlineStart:K,marginInlineEnd:K,fontSize:K,backgroundPositionX:K,backgroundPositionY:K,rotate:JA,rotateX:JA,rotateY:JA,rotateZ:JA,scale:FA,scaleX:FA,scaleY:FA,scaleZ:FA,skew:JA,skewX:JA,skewY:JA,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:PA,originX:QA,originY:QA,originZ:K,zIndex:fP,fillOpacity:PA,strokeOpacity:PA,numOctaves:fP},mP={...pP,color:ej,backgroundColor:ej,outlineColor:ej,fill:ej,stroke:ej,borderColor:ej,borderTopColor:ej,borderRightColor:ej,borderBottomColor:ej,borderLeftColor:ej,filter:uP,WebkitFilter:uP,mask:dP,WebkitMask:dP},hP=e=>mP[e],gP=new Set([uP,dP]);function _P(e,t){let n=hP(e);return gP.has(n)||(n=gj),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var vP=new Set([`auto`,`none`,`0`]);function yP(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!vP.has(t)&&lj(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=_P(n,i)}var bP=class extends VM{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(),AA(r))){let i=xN(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!FN.has(n)||e.length!==2)return;let[r,i]=e,a=aP(r),o=aP(i);if(MA(r)!==MA(i)&&NM[n]){this.needsMeasurement=!0;return}if(a!==o)if(kM(a)&&kM(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else NM[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||oP(e[t]))&&n.push(t);n.length&&yP(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=NM[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]=NM[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()}};function xP(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 SP=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function CP(e){return Fk(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:wP,cancel:TP}=vA(queueMicrotask,!1),EP={x:!1,y:!1};function DP(){return EP.x||EP.y}function OP(e){return e===`x`||e===`y`?EP[e]?null:(EP[e]=!0,()=>{EP[e]=!1}):EP.x||EP.y?null:(EP.x=EP.y=!0,()=>{EP.x=EP.y=!1})}function kP(e,t){let n=xP(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function AP(e){return!(e.pointerType===`touch`||DP())}function jP(e,t,n={}){let[r,i,a]=kP(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(!AP(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 MP=(e,t)=>t?e===t?!0:MP(e,t.parentElement):!1,NP=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,PP=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function FP(e){return PP.has(e.tagName)||e.isContentEditable===!0}var IP=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function LP(e){return IP.has(e.tagName)||e.isContentEditable===!0}var RP=new WeakSet;function zP(e){return t=>{t.key===`Enter`&&e(t)}}function BP(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var VP=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=zP(()=>{if(RP.has(n))return;BP(n,`down`);let e=zP(()=>{BP(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>BP(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function HP(e){return NP(e)&&!DP()}var UP=new WeakSet;function WP(e,t,n={}){let[r,i,a]=kP(e,n),o=e=>{let r=e.currentTarget;if(!HP(e)||UP.has(e))return;RP.add(r),n.stopPropagation&&UP.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),RP.has(r)&&RP.delete(r),HP(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||MP(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),CP(e)&&(e.addEventListener(`focus`,e=>VP(e,i)),!FP(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function GP(e){return Fk(e)&&`ownerSVGElement`in e}var KP=new WeakMap,qP,JP=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:GP(r)&&`getBBox`in r?r.getBBox()[t]:r[n],YP=JP(`inline`,`width`,`offsetWidth`),XP=JP(`block`,`height`,`offsetHeight`);function ZP({target:e,borderBoxSize:t}){KP.get(e)?.forEach(n=>{n(e,{get width(){return YP(e,t)},get height(){return XP(e,t)}})})}function QP(e){e.forEach(ZP)}function $P(){typeof ResizeObserver>`u`||(qP=new ResizeObserver(QP))}function eF(e,t){qP||$P();let n=xP(e);return n.forEach(e=>{let n=KP.get(e);n||(n=new Set,KP.set(e,n)),n.add(t),qP?.observe(e)}),()=>{n.forEach(e=>{let n=KP.get(e);n?.delete(t),n?.size||qP?.unobserve(e)})}}var tF=new Set,nF;function rF(){nF=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};tF.forEach(t=>t(e))},window.addEventListener(`resize`,nF)}function iF(e){return tF.add(e),nF||rF(),()=>{tF.delete(e),!tF.size&&typeof nF==`function`&&(window.removeEventListener(`resize`,nF),nF=void 0)}}function aF(e,t){return typeof e==`function`?iF(e):eF(e,t)}function oF(e){return GP(e)&&e.tagName===`svg`}var sF=[...iP,ej,gj],cF=e=>sF.find(rP(e)),lF=()=>({translate:0,scale:1,origin:0,originPoint:0}),uF=()=>({x:lF(),y:lF()}),dF=()=>({min:0,max:0}),fF=()=>({x:dF(),y:dF()}),pF=new WeakMap;function mF(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function hF(e){return typeof e==`string`||Array.isArray(e)}var gF=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],_F=[`initial`,...gF];function vF(e){return mF(e.animate)||_F.some(t=>hF(e[t]))}function yF(e){return!!(vF(e)||e.variants)}function bF(e,t,n){for(let r in t){let i=t[r],a=n[r];if(GN(i))e.addValue(r,i);else if(GN(a))e.addValue(r,BN(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,BN(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var xF={current:null},SF={current:!1},CF=typeof window<`u`;function wF(){if(SF.current=!0,CF)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>xF.current=e.matches;e.addEventListener(`change`,t),t()}else xF.current=!1}var TF=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],EF={};function DF(e){EF=e}function OF(){return EF}var kF=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=VM,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=TA.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,yA.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=vF(t),this.isVariantNode=yF(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&&GN(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,pF.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:(SF.current||wF(),this.shouldReduceMotion=xF.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(),bA(this.notifyUpdate),bA(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&&uN.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new eN({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Uk(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=OM.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&yA.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(),t.owner&&t.stop()})}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 EF){let t=EF[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):fF()}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<TF.length;t++){let n=TF[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=bF(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=BN(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`&&(Pk(n)||Ik(n))?n=parseFloat(n):!cF(n)&&gj.test(t)&&(n=_P(e,t)),this.setBaseTarget(e,GN(n)?n.get():n)),GN(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=NN(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&&!GN(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 Hk),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){wP.render(this.render)}},AF=class extends kF{constructor(){super(...arguments),this.KeyframeResolver=bP}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;GN(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},jF=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function MF({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function NF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function PF(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 FF(e){return e===void 0||e===1}function IF({scale:e,scaleX:t,scaleY:n}){return!FF(e)||!FF(t)||!FF(n)}function LF(e){return IF(e)||RF(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function RF(e){return zF(e.x)||zF(e.y)}function zF(e){return e&&e!==`0%`}function BF(e,t,n){return n+t*(e-n)}function VF(e,t,n,r,i){return i!==void 0&&(e=BF(e,i,r)),BF(e,n,r)+t}function HF(e,t=0,n=1,r,i){e.min=VF(e.min,t,n,r,i),e.max=VF(e.max,t,n,r,i)}function UF(e,{x:t,y:n}){HF(e.x,t.translate,t.scale,t.originPoint),HF(e.y,n.translate,n.scale,n.originPoint)}var WF=.999999999999,GF=1.0000000000001;function KF(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&&(qF(e.x,-a.scroll.offset.x),qF(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,UF(e,o)),r&&LF(a.latestValues)&&XF(e,a.latestValues,a.layout?.layoutBox))}t.x<GF&&t.x>WF&&(t.x=1),t.y<GF&&t.y>WF&&(t.y=1)}function qF(e,t){e.min+=t,e.max+=t}function JF(e,t,n,r,i=.5){HF(e,t,n,bj(e.min,e.max,i),r)}function YF(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function XF(e,t,n){let r=n??e;JF(e.x,YF(t.x,r.x),t.scaleX,t.scale,t.originX),JF(e.y,YF(t.y,r.y),t.scaleY,t.scale,t.originY)}function ZF(e,t){return MF(PF(e.getBoundingClientRect(),t))}function QF(e,t,n){let r=ZF(e,n),{scroll:i}=t;return i&&(qF(r.x,i.offset.x),qF(r.y,i.offset.y)),r}var $F={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},eI=DM.length;function tI(e,t,n){let r=``,i=!0;for(let a=0;a<eI;a++){let o=DM[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=SP(s,pP[o]);if(!c){i=!1;let t=$F[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function nI(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(OM.has(e)){o=!0;continue}else if(OA(e)){i[e]=n;continue}else{let t=SP(n,pP[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=tI(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 rI(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 iI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var aI={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(K.test(e))e=parseFloat(e);else return e;return`${iI(e,t.target.x)}% ${iI(e,t.target.y)}%`}},oI={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=gj.parse(e);if(i.length>5)return r;let a=gj.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=bj(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},sI={borderRadius:{...aI,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:aI,borderTopRightRadius:aI,borderBottomLeftRadius:aI,borderBottomRightRadius:aI,boxShadow:oI};function cI(e,{layout:t,layoutId:n}){return OM.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!sI[e]||e===`opacity`)}function lI(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(GN(r[t])||i&&GN(i[t])||cI(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function uI(e){return window.getComputedStyle(e)}var dI=class extends AF{constructor(){super(...arguments),this.type=`html`,this.renderInstance=rI}readValueFromInstance(e,t){if(OM.has(t))return this.projection?.isProjecting?CM(t):TM(e,t);{let n=uI(e),r=(OA(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return ZF(e,t)}build(e,t,n){nI(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return lI(e,t,n)}},fI={offset:`stroke-dashoffset`,array:`stroke-dasharray`},pI={offset:`strokeDashoffset`,array:`strokeDasharray`};function mI(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?fI:pI;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var hI=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function gI(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(nI(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 hI)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&&mI(d,i,a,o,!1)}var _I=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`]),vI=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function yI(e,t,n,r){rI(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(_I.has(n)?n:JN(n),t.attrs[n])}function bI(e,t,n){let r=lI(e,t,n);for(let n in e)if(GN(e[n])||GN(t[n])){let t=DM.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var xI=class extends AF{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=fF}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(OM.has(t)){let e=hP(t);return e&&e.default||0}return t=_I.has(t)?t:JN(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return bI(e,t,n)}build(e,t,n){gI(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){yI(e,t,n,r)}mount(e){this.isSVGTag=vI(e.tagName),super.mount(e)}},SI=_F.length;function CI(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&CI(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<SI;n++){let r=_F[n],i=e.props[r];(hF(i)||i===!1)&&(t[r]=i)}return t}function wI(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 TI=[...gF].reverse(),EI=gF.length;function DI(e){return t=>Promise.all(t.map(({animation:t,options:n})=>tP(e,t,n)))}function OI(e){let t=DI(e),n=jI(),r=!0,i=!1,a=t=>(n,r)=>{let i=PN(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=CI(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<EI;t++){let p=TI[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=hF(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||mF(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=kI(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=VN(t)&&VN(n)?!wI(t,n):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 D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=PN(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=vN(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=PN(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=jI(),i=!0}}}function kI(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!wI(t,e):!1}function AI(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function jI(){return{animate:AI(!0),whileInView:AI(),whileHover:AI(),whileTap:AI(),whileDrag:AI(),whileFocus:AI(),exit:AI()}}function MI(e,t){e.min=t.min,e.max=t.max}function NI(e,t){MI(e.x,t.x),MI(e.y,t.y)}function PI(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var FI=1e-4,II=1-FI,LI=1+FI,RI=.01,zI=0-RI,BI=0+RI;function VI(e){return e.max-e.min}function HI(e,t,n){return Math.abs(e-t)<=n}function UI(e,t,n,r=.5){e.origin=r,e.originPoint=bj(t.min,t.max,e.origin),e.scale=VI(n)/VI(t),e.translate=bj(n.min,n.max,e.origin)-e.originPoint,(e.scale>=II&&e.scale<=LI||isNaN(e.scale))&&(e.scale=1),(e.translate>=zI&&e.translate<=BI||isNaN(e.translate))&&(e.translate=0)}function WI(e,t,n,r){UI(e.x,t.x,n.x,r?r.originX:void 0),UI(e.y,t.y,n.y,r?r.originY:void 0)}function GI(e,t,n,r=0){e.min=(r?bj(n.min,n.max,r):n.min)+t.min,e.max=e.min+VI(t)}function KI(e,t,n,r){GI(e.x,t.x,n.x,r?.x),GI(e.y,t.y,n.y,r?.y)}function qI(e,t,n,r=0){let i=r?bj(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+VI(t)}function JI(e,t,n,r){qI(e.x,t.x,n.x,r?.x),qI(e.y,t.y,n.y,r?.y)}function YI(e,t,n,r,i){return e-=t,e=BF(e,1/n,r),i!==void 0&&(e=BF(e,1/i,r)),e}function XI(e,t=0,n=1,r=.5,i,a=e,o=e){if(YA.test(t)&&(t=parseFloat(t),t=bj(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=bj(a.min,a.max,r);e===a&&(s-=t),e.min=YI(e.min,t,n,s,i),e.max=YI(e.max,t,n,s,i)}function ZI(e,t,[n,r,i],a,o){XI(e,t[n],t[r],t[i],t.scale,a,o)}var QI=[`x`,`scaleX`,`originX`],$I=[`y`,`scaleY`,`originY`];function eL(e,t,n,r){ZI(e.x,t,QI,n?n.x:void 0,r?r.x:void 0),ZI(e.y,t,$I,n?n.y:void 0,r?r.y:void 0)}function tL(e){return e.translate===0&&e.scale===1}function nL(e){return tL(e.x)&&tL(e.y)}function rL(e,t){return e.min===t.min&&e.max===t.max}function iL(e,t){return rL(e.x,t.x)&&rL(e.y,t.y)}function aL(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oL(e,t){return aL(e.x,t.x)&&aL(e.y,t.y)}function sL(e){return VI(e.x)/VI(e.y)}function cL(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function lL(e){return[e(`x`),e(`y`)]}function uL(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,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}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 dL=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],fL=dL.length,pL=e=>typeof e==`string`?parseFloat(e):e,mL=e=>typeof e==`number`||K.test(e);function hL(e,t,n,r,i,a){i?(e.opacity=bj(0,n.opacity??1,_L(r)),e.opacityExit=bj(t.opacity??1,0,vL(r))):a&&(e.opacity=bj(t.opacity??1,n.opacity??1,r));for(let i=0;i<fL;i++){let a=dL[i],o=gL(t,a),s=gL(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||mL(o)===mL(s)?(e[a]=Math.max(bj(pL(o),pL(s),r),0),(YA.test(s)||YA.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=bj(t.rotate||0,n.rotate||0,r))}function gL(e,t){return e[t]===void 0?e.borderRadius:e[t]}var _L=yL(0,.5,iA),vL=yL(.5,.95,Rk);function yL(e,t,n){return r=>r<e?0:r>t?1:n(Vk(e,t,r))}function bL(e,t,n){let r=GN(e)?e:BN(e);return r.start(jN(``,r,t,n)),r.animation}function xL(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var SL=(e,t)=>e.depth-t.depth,CL=class{constructor(){this.children=[],this.isDirty=!1}add(e){Ak(this.children,e),this.isDirty=!0}remove(e){jk(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(SL),this.isDirty=!1,this.children.forEach(e)}};function wL(e,t){let n=TA.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(bA(r),e(a-t))};return yA.setup(r,!0),()=>bA(r)}function TL(e){return GN(e)?e.get():e}var EL=class{constructor(){this.members=[]}add(e){Ak(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&&(jk(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(jk(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)}},DL={hasAnimatedSinceResize:!0,hasEverUpdated:!1},OL={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},kL=[``,`X`,`Y`,`Z`],AL=1e3,jL=0;function ML(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function NL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=XN(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,yA,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&NL(r)}function PL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=jL++,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,hA.value&&(OL.nodes=OL.calculatedTargetDeltas=OL.calculatedProjections=0),this.nodes.forEach(LL),this.nodes.forEach(KL),this.nodes.forEach(qL),this.nodes.forEach(RL),hA.addProjectionMetrics&&hA.addProjectionMetrics(OL)},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 CL)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Hk),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=GP(t)&&!oF(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;yA.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=wL(i,250),DL.hasAnimatedSinceResize&&(DL.hasAnimatedSinceResize=!1,this.nodes.forEach(GL)))})}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()||eR,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!oL(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={...ON(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||GL(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(),bA(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(JL),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&&NL(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(VL),this.nodes.forEach(BL);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(HL);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(UL),this.nodes.forEach(WL),this.nodes.forEach(FL),this.nodes.forEach(IL)):this.nodes.forEach(HL),this.clearAllSnapshots();let e=TA.now();xA.delta=Mk(0,1e3/60,e-xA.timestamp),xA.timestamp=e,xA.isProcessing=!0,SA.update.process(xA),SA.preRender.process(xA),SA.render.process(xA),xA.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wP.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zL),this.sharedNodes.forEach(YL)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,yA.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){yA.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!VI(this.snapshot.measuredBox.x)&&!VI(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||=fF(),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&&!nL(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||LF(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)),iR(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return fF();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(oR))){let{scroll:e}=this.root;e&&(qF(t.x,e.offset.x),qF(t.y,e.offset.y))}return t}removeElementScroll(e){let t=fF();if(NI(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&&NI(t,e),qF(t.x,i.offset.x),qF(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||fF();NI(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&&(qF(r.x,-n.scroll.offset.x),qF(r.y,-n.scroll.offset.y)),LF(n.latestValues)&&XF(r,n.latestValues,n.layout?.layoutBox)}return LF(this.latestValues)&&XF(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=fF();NI(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!LF(n.latestValues))continue;let r;n.instance&&(IF(n.latestValues)&&n.updateSnapshot(),r=fF(),NI(r,n.measurePageBox())),eL(t,n.latestValues,n.snapshot?.layoutBox,r)}return LF(this.latestValues)&&eL(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?!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!==xA.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=xA.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=fF(),this.targetWithTransforms=fF()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),KI(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):NI(this.target,this.layout.layoutBox),UF(this.target,this.targetDelta)):NI(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),hA.value&&OL.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||IF(this.parent.latestValues)||RF(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=fF(),this.relativeTargetOrigin=fF(),JI(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),NI(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===xA.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;NI(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;KF(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=fF());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(PI(this.prevProjectionDelta.x,this.projectionDelta.x),PI(this.prevProjectionDelta.y,this.projectionDelta.y)),WI(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!cL(this.projectionDelta.x,this.prevProjectionDelta.x)||!cL(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),hA.value&&OL.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=uF(),this.projectionDelta=uF(),this.projectionDeltaWithTransform=uF()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=uF();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=fF(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some($L));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;XL(a.x,e.x,n),XL(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(JI(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),QL(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&iL(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=fF(),NI(d,this.relativeTarget)),s&&(this.animationValues=i,hL(i,r,this.latestValues,n,u,l)),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&&=(bA(this.pendingAnimation),void 0),this.pendingAnimation=yA.update(()=>{DL.hasAnimatedSinceResize=!0,EA.layout++,this.motionValue||=BN(0),this.motionValue.jump(0,!1),this.currentAnimation=bL(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{EA.layout--},onComplete:()=>{EA.layout--,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(AL),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&&aR(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||fF();let t=VI(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=VI(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}NI(t,n),XF(t,i),WI(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new EL),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:!0}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&&ML(`z`,e,r,this.animationValues);for(let t=0;t<kL.length;t++)ML(`rotate${kL[t]}`,e,r,this.animationValues),ML(`skew${kL[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=TL(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=TL(t?.pointerEvents)||``),this.hasProjected&&!LF(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=uL(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`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in sI){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=sI[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?TL(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(BL),this.root.sharedNodes.clear()}}}function FL(e){e.updateLayout()}function IL(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`)lL(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=VI(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;MI(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else aR(i,t.layoutBox,n)&&lL(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=VI(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=uF();WI(o,n,t.layoutBox);let s=uF();a?WI(s,e.applyTransform(r,!0),t.measuredBox):WI(s,n,t.layoutBox);let c=!nL(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=fF();JI(s,t.layoutBox,i.layoutBox,o);let c=fF();JI(c,n,a.layoutBox,o),oL(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 LL(e){hA.value&&OL.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 RL(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zL(e){e.clearSnapshot()}function BL(e){e.clearMeasurements()}function VL(e){e.isLayoutDirty=!0,e.updateLayout()}function HL(e){e.isLayoutDirty=!1}function UL(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function WL(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function GL(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function KL(e){e.resolveTargetDelta()}function qL(e){e.calcProjection()}function JL(e){e.resetSkewAndRotation()}function YL(e){e.removeLeadSnapshot()}function XL(e,t,n){e.translate=bj(t.translate,0,n),e.scale=bj(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ZL(e,t,n,r){e.min=bj(t.min,n.min,r),e.max=bj(t.max,n.max,r)}function QL(e,t,n,r){ZL(e.x,t.x,n.x,r),ZL(e.y,t.y,n.y,r)}function $L(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var eR={duration:.45,ease:[.4,0,.1,1]},tR=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nR=tR(`applewebkit/`)&&!tR(`chrome/`)?Math.round:Rk;function rR(e){e.min=nR(e.min),e.max=nR(e.max)}function iR(e){rR(e.x),rR(e.y)}function aR(e,t,n){return e===`position`||e===`preserve-aspect`&&!HI(sL(t),sL(n),.2)}function oR(e){return e!==e.root&&e.scroll?.wasRoot}var sR=PL({attachResizeListener:(e,t)=>xL(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),cR={current:void 0},lR=PL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!cR.current){let e=new sR({});e.mount(window),e.setOptions({layoutScroll:!0}),cR.current=e}return cR.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),uR=(0,z.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function dR(e=!0){let t=(0,z.useContext)(kk);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,z.useId)();(0,z.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,z.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var fR=(0,z.createContext)({strict:!1}),pR={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`]},mR=!1;function hR(){if(mR)return;let e={};for(let t in pR)e[t]={isEnabled:e=>pR[t].some(t=>!!e[t])};DF(e),mR=!0}function gR(){return hR(),OF()}function _R(e){let t=gR();for(let n in e)t[n]={...t[n],...e[n]};DF(t)}var vR=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 yR(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||vR.has(e)}var bR=r({default:()=>xR}),xR,SR=t((()=>{throw xR={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),CR=e=>!yR(e);function wR(e){typeof e==`function`&&(CR=t=>t.startsWith(`on`)?!yR(t):e(t))}try{wR((SR(),e(bR)).default)}catch{}function TR(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||GN(e[i])||(CR(i)||n===!0&&yR(i)||!t&&!yR(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var ER=(0,z.createContext)({});function DR(e,t){if(vF(e)){let{initial:t,animate:n}=e;return{initial:t===!1||hF(t)?t:void 0,animate:hF(n)?n:void 0}}return e.inherit===!1?{}:t}function OR(e){let{initial:t,animate:n}=DR(e,(0,z.useContext)(ER));return(0,z.useMemo)(()=>({initial:t,animate:n}),[kR(t),kR(n)])}function kR(e){return Array.isArray(e)?e.join(` `):e}var AR=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jR(e,t,n){for(let r in t)!GN(t[r])&&!cI(r,n)&&(e[r]=t[r])}function MR({transformTemplate:e},t){return(0,z.useMemo)(()=>{let n=AR();return nI(n,t,e),Object.assign({},n.vars,n.style)},[t])}function NR(e,t){let n=e.style||{},r={};return jR(r,n,e),Object.assign(r,MR(e,t)),r}function PR(e,t){let n={},r=NR(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 FR=()=>({...AR(),attrs:{}});function IR(e,t,n,r){let i=(0,z.useMemo)(()=>{let n=FR();return gI(n,t,vI(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};jR(t,e.style,e),i.style={...t,...i.style}}return i}var LR=[`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 RR(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(LR.indexOf(e)>-1||/[A-Z]/u.test(e))}function zR(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??RR(e)?IR:PR)(t,r,i,e),c=TR(t,typeof e==`string`,a),l=e===z.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,z.useMemo)(()=>GN(u)?u.get():u,[u]);return(0,z.createElement)(e,{...l,children:d})}function BR({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:VR(n,r,i,e),renderState:t()}}function VR(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=TL(a[e]);let{initial:o,animate:s}=e,c=vF(e),l=yF(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`&&!mF(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=NN(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 HR=e=>(t,n)=>{let r=(0,z.useContext)(ER),i=(0,z.useContext)(kk),a=()=>BR(e,t,r,i);return n?a():Dk(a)},UR=HR({scrapeMotionValuesFromProps:lI,createRenderState:AR}),WR=HR({scrapeMotionValuesFromProps:bI,createRenderState:FR}),GR=Symbol.for(`motionComponentSymbol`);function KR(e,t,n){let r=(0,z.useRef)(n);(0,z.useInsertionEffect)(()=>{r.current=n});let i=(0,z.useRef)(null);return(0,z.useCallback)(n=>{n&&e.onMount?.(n);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&&(n?t.mount(n):t.unmount())},[t])}var qR=(0,z.createContext)({});function JR(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function YR(e,t,n,r,i,a){let{visualElement:o}=(0,z.useContext)(ER),s=(0,z.useContext)(fR),c=(0,z.useContext)(kk),l=(0,z.useContext)(uR),u=l.reducedMotion,d=l.skipAnimations,f=(0,z.useRef)(null),p=(0,z.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,z.useContext)(qR);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&XR(f.current,n,i,h);let g=(0,z.useRef)(!1);(0,z.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[YN],v=(0,z.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Ok(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,z.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function XR(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:ZR(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&JR(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function ZR(e){if(e)return e.options.allowProjection===!1?ZR(e.parent):e.projection}function QR(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&_R(r);let a=n?n===`svg`:RR(e),o=a?WR:UR;function s(n,s){let c,l={...(0,z.useContext)(uR),...n,layoutId:$R(n)},{isStatic:u}=l,d=OR(n),f=o(n,u);if(!u&&typeof window<`u`){ez(l,r);let t=tz(l);c=t.MeasureLayout,d.visualElement=YR(e,f,l,i,t.ProjectionNode,a)}return(0,U.jsxs)(ER.Provider,{value:d,children:[c&&d.visualElement?(0,U.jsx)(c,{visualElement:d.visualElement,...l}):null,zR(e,n,KR(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,z.forwardRef)(s);return c[GR]=e,c}function $R({layoutId:e}){let t=(0,z.useContext)(Ek).id;return t&&e!==void 0?t+`-`+e:e}function ez(e,t){(0,z.useContext)(fR).strict}function tz(e){let{drag:t,layout:n}=gR();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function nz(e,t){if(typeof Proxy>`u`)return QR;let n=new Map,r=(n,r)=>QR(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,QR(a,void 0,e,t)),n.get(a))})}var rz=(e,t)=>t.isSVG??RR(e)?new xI(t):new dI(t,{allowProjection:e!==z.Fragment}),iz=class extends jF{constructor(e){super(e),e.animationState||=OI(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();mF(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?.()}},az=0,oz={animation:{Feature:iz},exit:{Feature:class extends jF{constructor(){super(...arguments),this.id=az++,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`){let n=PN(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 sz(e){return{point:{x:e.pageX,y:e.pageY}}}var cz=e=>t=>NP(t)&&e(t,sz(t));function lz(e,t,n,r){return xL(e,t,cz(n),r)}var uz=({current:e})=>e?e.ownerDocument.defaultView:null,dz=(e,t)=>Math.abs(e-t);function fz(e,t){let n=dz(e.x,t.x),r=dz(e.y,t.y);return Math.sqrt(n**2+r**2)}var pz=new Set([`auto`,`scroll`]),mz=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=hz(this.lastRawMoveEventInfo,this.transformPagePoint));let e=_z(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=fz(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=xA;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=hz(t,this.transformPagePoint),yA.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=_z(e.type===`pointercancel`?this.lastMoveEventInfo:hz(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!NP(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=hz(sz(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=xA;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,_z(s,this.history)),this.removeListeners=Bk(lz(this.contextWindow,`pointermove`,this.handlePointerMove),lz(this.contextWindow,`pointerup`,this.handlePointerUp),lz(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(pz.has(e.overflowX)||pz.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),yA.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),bA(this.updatePoint)}};function hz(e,t){return t?{point:t(e.point)}:e}function gz(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _z({point:e},t){return{point:e,delta:gz(e,yz(t)),offset:gz(e,vz(t)),velocity:bz(t,.1)}}function vz(e){return e[0]}function yz(e){return e[e.length-1]}function bz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=yz(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Uk(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Uk(t)*2&&(r=e[1]);let a=Wk(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 xz(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?bj(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?bj(n,e,r.max):Math.min(e,n)),e}function Sz(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 Cz(e,{top:t,left:n,bottom:r,right:i}){return{x:Sz(e.x,n,i),y:Sz(e.y,t,r)}}function wz(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 Tz(e,t){return{x:wz(e.x,t.x),y:wz(e.y,t.y)}}function Ez(e,t){let n=.5,r=VI(e),i=VI(t);return i>r?n=Vk(t.min,t.max-r,e.min):r>i&&(n=Vk(e.min,e.max-i,t.min)),Mk(0,1,n)}function Dz(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 Oz=.35;function kz(e=Oz){return e===!1?e=0:e===!0&&(e=Oz),{x:Az(e,`left`,`right`),y:Az(e,`top`,`bottom`)}}function Az(e,t,n){return{min:jz(e,t),max:jz(e,n)}}function jz(e,t){return typeof e==`number`?e:e[t]||0}var Mz=new WeakMap,Nz=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=fF(),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(sz(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=OP(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),lL(e=>{let t=this.getAxisMotionValue(e).get()||0;if(YA.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=VI(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&yA.update(()=>i(e,t),!1,!0),qN(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=Lz(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&&yA.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 mz(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:uz(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&&yA.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||!Iz(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=xz(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&&JR(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Cz(n.layoutBox,e):this.constraints=!1,this.elastic=kz(t),r!==this.constraints&&!JR(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&lL(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Dz(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!JR(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=QF(n,r.root,this.visualElement.getTransformPagePoint()),a=Tz(r.layout.layoutBox,i);if(t){let e=t(NF(a));this.hasMutatedConstraints=!!e,e&&(a=MF(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=lL(o=>{if(!Iz(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 qN(this.visualElement,e),n.start(jN(e,n,0,t,this.visualElement,!1))}stopAnimation(){lL(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){lL(t=>{let{drag:n}=this.getProps();if(!Iz(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]-bj(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!JR(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};lL(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Ez({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(),lL(t=>{if(!Iz(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(bj(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Mz.set(this.visualElement,this);let e=this.visualElement.current,t=lz(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&LP(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();JR(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Fz(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),yA.read(r);let o=xL(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(lL(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=Oz,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Pz(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Fz(e,t,n){let r=aF(e,Pz(n)),i=aF(t,Pz(n));return()=>{r(),i()}}function Iz(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Lz(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Rz=class extends jF{constructor(e){super(e),this.removeGroupControls=Rk,this.removeListeners=Rk,this.controls=new Nz(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Rk}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()}},zz=e=>(t,n)=>{e&&yA.update(()=>e(t,n),!1,!0)},Bz=class extends jF{constructor(){super(...arguments),this.removePointerDownListener=Rk}onPointerDown(e){this.session=new mz(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:uz(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:zz(e),onStart:zz(t),onMove:zz(n),onEnd:(e,t)=>{delete this.session,r&&yA.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=lz(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Vz=!1,Hz=class extends z.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),Vz&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),DL.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}),Vz=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||yA.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(),wP.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Vz=!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 Uz(e){let[t,n]=dR(),r=(0,z.useContext)(Ek);return(0,U.jsx)(Hz,{...e,layoutGroup:r,switchLayoutGroup:(0,z.useContext)(qR),isPresent:t,safeToRemove:n})}var Wz={pan:{Feature:Bz},drag:{Feature:Rz,ProjectionNode:lR,MeasureLayout:Uz}};function Gz(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&yA.postRender(()=>i(t,sz(t)))}var Kz=class extends jF{mount(){let{current:e}=this.node;e&&(this.unmount=jP(e,(e,t)=>(Gz(this.node,t,`Start`),e=>Gz(this.node,e,`End`))))}unmount(){}},qz=class extends jF{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=Bk(xL(this.node.current,`focus`,()=>this.onFocus()),xL(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Jz(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&&yA.postRender(()=>i(t,sz(t)))}var Yz=class extends jF{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=WP(e,(e,t)=>(Jz(this.node,t,`Start`),(e,{success:t})=>Jz(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Xz=new WeakMap,Zz=new WeakMap,Qz=e=>{let t=Xz.get(e.target);t&&t(e)},$z=e=>{e.forEach(Qz)};function eB({root:e,...t}){let n=e||document;Zz.has(n)||Zz.set(n,{});let r=Zz.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver($z,{root:e,...t})),r[i]}function tB(e,t,n){let r=eB(t);return Xz.set(e,n),r.observe(e),()=>{Xz.delete(e),r.unobserve(e)}}var nB={some:0,all:1},rB=class extends jF{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:nB[r]};this.stopObserver=tB(this.node.current,a,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)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(iB(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function iB({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var aB={inView:{Feature:rB},tap:{Feature:Yz},focus:{Feature:qz},hover:{Feature:Kz}},oB={layout:{ProjectionNode:lR,MeasureLayout:Uz}},sB=nz({...oz,...aB,...Wz,...oB},rz),cB=new Map,lB=e=>{let t=cB.get(e);return t||(t=sB.create(e),cB.set(e,t)),t},uB=(0,z.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=lB(t),o=(0,z.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,U.jsx)(a,{animate:{backgroundPosition:`0% center`},className:H(`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})}),dB=(0,z.createContext)(null),fB=()=>{let e=(0,z.useContext)(dB);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e},pB=1e3,mB=1e3,hB=(0,z.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]=pE({defaultProp:c,onChange:i,prop:n}),[f,p]=pE({defaultProp:void 0,prop:a}),m=(0,z.useRef)(t),[h,g]=(0,z.useState)(!1),_=(0,z.useRef)(null);(0,z.useEffect)(()=>{t?(m.current=!0,_.current===null&&(_.current=Date.now())):_.current!==null&&(p(Math.ceil((Date.now()-_.current)/mB)),_.current=null)},[t,p]),(0,z.useEffect)(()=>{t&&!u&&!l&&d(!0)},[t,u,d,l]),(0,z.useEffect)(()=>{if(m.current&&!t&&u&&!h){let e=setTimeout(()=>{d(!1),g(!0)},pB);return()=>clearTimeout(e)}},[t,u,d,h]);let v=(0,z.useCallback)(e=>{d(e)},[d]),y=(0,z.useMemo)(()=>({duration:f,isOpen:u,isStreaming:t,setIsOpen:d}),[f,u,t,d]);return(0,U.jsx)(dB.Provider,{value:y,children:(0,U.jsx)(Ck,{className:H(`not-prose mb-4`,e),onOpenChange:v,open:u,...s,children:o})})}),gB=(e,t)=>e||t===0?(0,U.jsx)(uB,{duration:1,children:`Thinking...`}):t===void 0?(0,U.jsx)(`p`,{children:`Thought for a few seconds`}):(0,U.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]}),_B=(0,z.memo)(({className:e,children:t,getThinkingMessage:n=gB,...r})=>{let{isStreaming:i,isOpen:a,duration:o}=fB();return(0,U.jsx)(wk,{className:H(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...r,children:t??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Wl,{className:`size-4`}),n(i,o),(0,U.jsx)(Gl,{className:H(`size-4 transition-transform`,a?`rotate-180`:`rotate-0`)})]})})}),vB={cjk:Bf,code:Bx,math:BS,mermaid:$T},yB=(0,z.memo)(({className:e,children:t,...n})=>(0,U.jsx)(Tk,{className:H(`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,U.jsx)(D,{plugins:vB,children:t})}));hB.displayName=`Reasoning`,_B.displayName=`ReasoningTrigger`,yB.displayName=`ReasoningContent`;var bB=({className:e,...t})=>(0,U.jsx)(Ck,{className:H(`not-prose mb-4 text-primary text-xs`,e),...t}),xB=({className:e,count:t,children:n,...r})=>(0,U.jsx)(wk,{className:H(`flex items-center gap-2`,e),...r,children:n??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`font-medium`,children:[`Used `,t,` sources`]}),(0,U.jsx)(Gl,{className:`h-4 w-4`})]})}),SB=({className:e,...t})=>(0,U.jsx)(Tk,{className:H(`mt-3 flex w-fit flex-col gap-2`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),CB=({href:e,title:t,children:n,...r})=>(0,U.jsx)(`a`,{className:`flex items-center gap-2`,href:e,rel:`noreferrer`,target:`_blank`,...r,children:n??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ul,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`block font-medium`,children:t})]})}),wB=()=>typeof window>`u`?`none`:`SpeechRecognition`in window||`webkitSpeechRecognition`in window?`speech-recognition`:`MediaRecorder`in window&&`mediaDevices`in navigator?`media-recorder`:`none`,TB=({className:e,onTranscriptionChange:t,onAudioRecorded:n,lang:r=`en-US`,...i})=>{let[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(!1),[l]=(0,z.useState)(wB),[u,d]=(0,z.useState)(!1),f=(0,z.useRef)(null),p=(0,z.useRef)(null),m=(0,z.useRef)(null),h=(0,z.useRef)([]),g=(0,z.useRef)(t),_=(0,z.useRef)(n);g.current=t,_.current=n,(0,z.useEffect)(()=>{if(l!==`speech-recognition`)return;let e=new(window.SpeechRecognition||window.webkitSpeechRecognition);e.continuous=!0,e.interimResults=!0,e.lang=r;let t=()=>{o(!0)},n=()=>{o(!1)},i=e=>{let t=e,n=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let r=t.results[e];r.isFinal&&(n+=r[0]?.transcript??``)}n&&g.current?.(n)},a=()=>{o(!1)};return e.addEventListener(`start`,t),e.addEventListener(`end`,n),e.addEventListener(`result`,i),e.addEventListener(`error`,a),f.current=e,d(!0),()=>{e.removeEventListener(`start`,t),e.removeEventListener(`end`,n),e.removeEventListener(`result`,i),e.removeEventListener(`error`,a),e.stop(),f.current=null,d(!1)}},[l,r]),(0,z.useEffect)(()=>()=>{if(p.current?.state===`recording`&&p.current.stop(),m.current)for(let e of m.current.getTracks())e.stop()},[]);let v=(0,z.useCallback)(async()=>{if(_.current)try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});m.current=e;let t=new MediaRecorder(e);h.current=[],t.addEventListener(`dataavailable`,e=>{e.data.size>0&&h.current.push(e.data)}),t.addEventListener(`stop`,async()=>{for(let t of e.getTracks())t.stop();m.current=null;let t=new Blob(h.current,{type:`audio/webm`});if(t.size>0&&_.current){c(!0);try{let e=await _.current(t);e&&g.current?.(e)}catch{}finally{c(!1)}}}),t.addEventListener(`error`,()=>{o(!1);for(let t of e.getTracks())t.stop();m.current=null}),p.current=t,t.start(),o(!0)}catch{o(!1)}},[]),y=(0,z.useCallback)(()=>{p.current?.state===`recording`&&p.current.stop(),o(!1)},[]),b=(0,z.useCallback)(()=>{l===`speech-recognition`&&f.current?a?f.current.stop():f.current.start():l===`media-recorder`&&(a?y():v())},[l,a,v,y]),x=l===`none`||l===`speech-recognition`&&!u||l===`media-recorder`&&!n||s;return(0,U.jsxs)(`div`,{className:`relative inline-flex items-center justify-center`,children:[a&&[0,1,2].map(e=>(0,U.jsx)(`div`,{className:`absolute inset-0 animate-ping rounded-full border-2 border-red-400/30`,style:{animationDelay:`${e*.3}s`,animationDuration:`2s`}},e)),(0,U.jsxs)($n,{className:H(`relative z-10 rounded-full transition-all duration-300`,a?`bg-destructive text-white hover:bg-destructive/80 hover:text-white`:`bg-primary text-primary-foreground hover:bg-primary/80 hover:text-primary-foreground`,e),disabled:x,onClick:b,...i,children:[s&&(0,U.jsx)(RO,{}),!s&&a&&(0,U.jsx)(mu,{className:`size-4`}),!(s||a)&&(0,U.jsx)(su,{className:`size-4`})]})]})},EB=Zn(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function DB({className:e,variant:t=`default`,render:n,...r}){return Ju({defaultTagName:`span`,props:$t({className:H(EB({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var OB=Object.defineProperty,kB=Object.getOwnPropertyDescriptor,AB=Object.getOwnPropertyNames,jB=Object.prototype.hasOwnProperty,MB=(e,t)=>{let n={};for(var r in e)OB(n,r,{get:e[r],enumerable:!0});return t||OB(n,Symbol.toStringTag,{value:`Module`}),n},NB=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=AB(t),a=0,o=i.length,s;a<o;a++)s=i[a],!jB.call(e,s)&&s!==n&&OB(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=kB(t,s))||r.enumerable});return e},PB=(e,t,n)=>(NB(e,t,`default`),n&&NB(n,t,`default`)),FB=[{id:`abap`,name:`ABAP`,import:(()=>N(()=>import(`./abap-wT6fgqwv.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>N(()=>import(`./actionscript-3-CqcHpPYj.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>N(()=>import(`./ada-DWE3Hn4E.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>N(()=>import(`./angular-html-BNkY0l6I.js`).then(e=>e.n),__vite__mapDeps([182,1,183,184,185])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>N(()=>import(`./angular-ts-BJR7ZmZ4.js`),__vite__mapDeps([186,182,1,183,184,185,187])))},{id:`apache`,name:`Apache Conf`,import:(()=>N(()=>import(`./apache-LRTUP4r3.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>N(()=>import(`./apex-Cr4FccGl.js`),[]))},{id:`apl`,name:`APL`,import:(()=>N(()=>import(`./apl-Cwj0kSUr.js`),__vite__mapDeps([188,184,1,183,185,189,190,191])))},{id:`applescript`,name:`AppleScript`,import:(()=>N(()=>import(`./applescript-DyQiO9JU.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>N(()=>import(`./ara-Cf-OWd2S.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>N(()=>import(`./asciidoc-gocbKcVK.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>N(()=>import(`./asm-C3meb5HY.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>N(()=>import(`./astro--s34HbNO.js`),__vite__mapDeps([192,184,1,185,189,193,194,195])))},{id:`awk`,name:`AWK`,import:(()=>N(()=>import(`./awk-BcT6nIdN.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>N(()=>import(`./ballerina-BCARR-zK.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>N(()=>import(`./bat-_yaRjWOb.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>N(()=>import(`./beancount-BPESBMS9.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>N(()=>import(`./berry-BSLE-Sf8.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>N(()=>import(`./bibtex-CvUWWCVx.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>N(()=>import(`./bicep--vcqqALZ.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>N(()=>import(`./bird2-Clclqgh6.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>N(()=>import(`./blade-CA0lh7nk.js`),__vite__mapDeps([196,184,1,197,183,185,189,198,190,191])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>N(()=>import(`./bsl-Bq5qFzpU.js`),__vite__mapDeps([199,200])))},{id:`c`,name:`C`,import:(()=>N(()=>import(`./c-BwwtBtD9.js`).then(e=>e.n),__vite__mapDeps([201,1])))},{id:`c3`,name:`C3`,import:(()=>N(()=>import(`./c3-BYD8LEiv.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>N(()=>import(`./cadence-BwAD7vSC.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>N(()=>import(`./cairo-Cn9-ZKRa.js`),__vite__mapDeps([202,203])))},{id:`clarity`,name:`Clarity`,import:(()=>N(()=>import(`./clarity-BeQd5TQD.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>N(()=>import(`./clojure-Csdo0vb_.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>N(()=>import(`./cmake-Cf0q7ddg.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>N(()=>import(`./cobol-DC9HzFj-.js`),__vite__mapDeps([204,183,1,184,185,191])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>N(()=>import(`./codeowners-CUEzlC7R.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>N(()=>import(`./codeql-DxHyogQt.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>N(()=>import(`./coffee-BXAFJg0r.js`),__vite__mapDeps([205,185,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>N(()=>import(`./common-lisp-WLb-tAda.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>N(()=>import(`./coq-DFtMD6Wn.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>N(()=>import(`./cpp-DKSsqshA.js`).then(e=>e.n),__vite__mapDeps([206,1,207,201,208,198])))},{id:`crystal`,name:`Crystal`,import:(()=>N(()=>import(`./crystal-IeOtgHp5.js`),__vite__mapDeps([209,201,1,184,183,185,210,198])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>N(()=>import(`./csharp-BsEjf_Dq.js`),[]))},{id:`css`,name:`CSS`,import:(()=>N(()=>import(`./css-BwJx5n-d.js`).then(e=>e.n),__vite__mapDeps([184,1])))},{id:`csv`,name:`CSV`,import:(()=>N(()=>import(`./csv-DTSgNSaP.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>N(()=>import(`./cue-BEmVIZmd.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>N(()=>import(`./cypher-CncQVhvU.js`),[]))},{id:`d`,name:`D`,import:(()=>N(()=>import(`./d-BzUSBVex.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>N(()=>import(`./dart-BBu3nkcE.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>N(()=>import(`./dax-DcLVz9_9.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>N(()=>import(`./desktop-DS2PdvoU.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>N(()=>import(`./diff-aUYk5Qys.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>N(()=>import(`./docker-12Lj1QUD.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>N(()=>import(`./dotenv-D-P4bzvl.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>N(()=>import(`./dream-maker-C_j5A0r7.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>N(()=>import(`./edge-DvUIs6yL.js`),__vite__mapDeps([211,197,183,1,184,185,195])))},{id:`elixir`,name:`Elixir`,import:(()=>N(()=>import(`./elixir-uf320cNm.js`),__vite__mapDeps([212,183,1,184,185])))},{id:`elm`,name:`Elm`,import:(()=>N(()=>import(`./elm-C0jRU6CE.js`),__vite__mapDeps([213,207,1,201])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>N(()=>import(`./emacs-lisp-W54LT7rh.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>N(()=>import(`./erb-IQLcm3Em.js`),__vite__mapDeps([214,183,1,184,185,215,201,206,207,208,198,216,217,194,195,218,219,210,190,191,220])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>N(()=>import(`./erlang-CzlD_Joo.js`),__vite__mapDeps([221,222])))},{id:`fennel`,name:`Fennel`,import:(()=>N(()=>import(`./fennel-DK82-oso.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>N(()=>import(`./fish-CbJVJzQj.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>N(()=>import(`./fluent-Cug5cOL1.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>N(()=>import(`./fortran-fixed-form-CT90EtSp.js`),__vite__mapDeps([223,224])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>N(()=>import(`./fortran-free-form-amHz32Zw.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>N(()=>import(`./fsharp-LasxezlU.js`),__vite__mapDeps([225,222])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>N(()=>import(`./gdresource-XqgPdfiE.js`),__vite__mapDeps([226,227,228])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>N(()=>import(`./gdscript-t_G6VYpv.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>N(()=>import(`./gdshader-DqZaHh4E.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>N(()=>import(`./genie-CIJtFlZK.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>N(()=>import(`./gherkin-CalidqLY.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>N(()=>import(`./git-commit-CZBgPolw.js`),__vite__mapDeps([229,230])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>N(()=>import(`./git-rebase-SvuYB-yx.js`),__vite__mapDeps([231,210,1])))},{id:`gleam`,name:`Gleam`,import:(()=>N(()=>import(`./gleam-D-2cpXVX.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>N(()=>import(`./glimmer-js-BRM4xWAn.js`),__vite__mapDeps([232,184,1,183,185,195])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>N(()=>import(`./glimmer-ts-q2S6_FNL.js`),__vite__mapDeps([233,184,1,183,185,195])))},{id:`glsl`,name:`GLSL`,import:(()=>N(()=>import(`./glsl-DBjPQFVZ.js`).then(e=>e.n),__vite__mapDeps([207,1,201])))},{id:`gn`,name:`GN`,import:(()=>N(()=>import(`./gn-C1cC4xLc.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>N(()=>import(`./gnuplot-2Gp459mV.js`),[]))},{id:`go`,name:`Go`,import:(()=>N(()=>import(`./go-BA1q0q8h.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>N(()=>import(`./graphql-COm4gzYD.js`).then(e=>e.n),__vite__mapDeps([216,1,185,217,194,195])))},{id:`groovy`,name:`Groovy`,import:(()=>N(()=>import(`./groovy-BlIa-VfI.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>N(()=>import(`./hack-D776y6TN.js`),__vite__mapDeps([234,183,1,184,185,198])))},{id:`haml`,name:`Ruby Haml`,import:(()=>N(()=>import(`./haml-BDLQGKJ5.js`).then(e=>e.n),__vite__mapDeps([218,1,184,185])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>N(()=>import(`./handlebars-CIxBD-3g.js`),__vite__mapDeps([235,184,1,183,185,220])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>N(()=>import(`./haskell-Da8UeSv-.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>N(()=>import(`./haxe-mcKlcxBa.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>N(()=>import(`./hcl-BdZcx5JX.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>N(()=>import(`./hjson-pFXYbN4t.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>N(()=>import(`./hlsl-Z0II0KR8.js`),[]))},{id:`html`,name:`HTML`,import:(()=>N(()=>import(`./html-Be5Uf2PY.js`).then(e=>e.n),__vite__mapDeps([183,1,184,185])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>N(()=>import(`./html-derivative-DwTv3LQJ.js`),__vite__mapDeps([197,183,1,184,185])))},{id:`http`,name:`HTTP`,import:(()=>N(()=>import(`./http-BoUyJiuw.js`),__vite__mapDeps([236,216,1,185,217,194,195,189,210,190,191])))},{id:`hurl`,name:`Hurl`,import:(()=>N(()=>import(`./hurl-BrO1xhi5.js`),__vite__mapDeps([237,238,216,1,185,217,194,195,190,191])))},{id:`hxml`,name:`HXML`,import:(()=>N(()=>import(`./hxml-e5uS5jTD.js`),__vite__mapDeps([239,240])))},{id:`hy`,name:`Hy`,import:(()=>N(()=>import(`./hy-BVbDMDcG.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>N(()=>import(`./imba-DRM6LLS5.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>N(()=>import(`./ini-2KCnNvmz.js`),[]))},{id:`java`,name:`Java`,import:(()=>N(()=>import(`./java-CQxQB19a.js`).then(e=>e.n),__vite__mapDeps([191,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>N(()=>import(`./javascript-DMa1awvA.js`).then(e=>e.n),__vite__mapDeps([185,1])))},{id:`jinja`,name:`Jinja`,import:(()=>N(()=>import(`./jinja-Brxwu6oJ.js`),__vite__mapDeps([241,183,1,184,185])))},{id:`jison`,name:`Jison`,import:(()=>N(()=>import(`./jison-EXcEtIQd.js`),__vite__mapDeps([242,185,1])))},{id:`json`,name:`JSON`,import:(()=>N(()=>import(`./json-DTmumXbw.js`).then(e=>e.n),__vite__mapDeps([189,1])))},{id:`json5`,name:`JSON5`,import:(()=>N(()=>import(`./json5-CJeEJPTg.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>N(()=>import(`./jsonc-C1haTBsf.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>N(()=>import(`./jsonl-wQ8-AJgs.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>N(()=>import(`./jsonnet-BrEjY3Xh.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>N(()=>import(`./jssm-C6LgYbOs.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>N(()=>import(`./jsx-CjPAAfVI.js`).then(e=>e.n),__vite__mapDeps([217,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>N(()=>import(`./julia-ClaFus-7.js`),__vite__mapDeps([243,206,1,207,201,208,198,185,203,244])))},{id:`just`,name:`Just`,import:(()=>N(()=>import(`./just-i-NvfbL-.js`),__vite__mapDeps([245,185,1,246,184,183,198,190,191,203,215,201,206,207,208,216,217,194,195,218,219,210,220])))},{id:`kdl`,name:`KDL`,import:(()=>N(()=>import(`./kdl-BrLEivmb.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>N(()=>import(`./kotlin-BO2FUnDB.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>N(()=>import(`./kusto-Cev1yiq9.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>N(()=>import(`./latex-CJqFaM_A.js`),__vite__mapDeps([247,248,244,1])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>N(()=>import(`./lean-BLS3Xk2w.js`),[]))},{id:`less`,name:`Less`,import:(()=>N(()=>import(`./less-BXmcsqcq.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>N(()=>import(`./liquid-C-yRtTgD.js`),__vite__mapDeps([249,184,1,183,185,189])))},{id:`llvm`,name:`LLVM IR`,import:(()=>N(()=>import(`./llvm-C_wLnJgX.js`),[]))},{id:`log`,name:`Log file`,import:(()=>N(()=>import(`./log-Cg8pvmWi.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>N(()=>import(`./logo-C9-kEvPW.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>N(()=>import(`./lua-YdeG1vR1.js`).then(e=>e.n),__vite__mapDeps([219,1,201])))},{id:`luau`,name:`Luau`,import:(()=>N(()=>import(`./luau-CMEm2VzY.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>N(()=>import(`./make-DBpJE-Z8.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>N(()=>import(`./markdown-B7ZTAu7B.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>N(()=>import(`./marko-C28Bend9.js`),__vite__mapDeps([250,184,1,251,187,195])))},{id:`matlab`,name:`MATLAB`,import:(()=>N(()=>import(`./matlab-C7MYlMSn.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>N(()=>import(`./mdc-D4DkjJGD.js`),__vite__mapDeps([252,197,183,1,184,185,222,220])))},{id:`mdx`,name:`MDX`,import:(()=>N(()=>import(`./mdx-FkOOX3Dq.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>N(()=>import(`./mermaid-C_9qw5it.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>N(()=>import(`./mipsasm-Dmi1AZOT.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>N(()=>import(`./mojo-C6z7mry2.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>N(()=>import(`./moonbit-CEeNIoB4.js`),[]))},{id:`move`,name:`Move`,import:(()=>N(()=>import(`./move-bALfKUa7.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>N(()=>import(`./narrat-DX4JlAWT.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>N(()=>import(`./nextflow-BUrFV5aB.js`),__vite__mapDeps([253,254])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>N(()=>import(`./nextflow-groovy-CKQWtRkO.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>N(()=>import(`./nginx-BzrYdIS_.js`),__vite__mapDeps([255,219,1,201])))},{id:`nim`,name:`Nim`,import:(()=>N(()=>import(`./nim-BAdKQO6U.js`),__vite__mapDeps([256,201,1,184,207,183,185,222,190,191])))},{id:`nix`,name:`Nix`,import:(()=>N(()=>import(`./nix-B1jThkGj.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>N(()=>import(`./nushell-L6DbJTuL.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>N(()=>import(`./objective-c-CTZ4bR2U.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>N(()=>import(`./objective-cpp-Dm1YDIdA.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>N(()=>import(`./ocaml-B3n__LGy.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>N(()=>import(`./odin-DmqZ8n3i.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>N(()=>import(`./openscad-DTFB9Sj6.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>N(()=>import(`./pascal-RcT1dQYN.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>N(()=>import(`./perl-BMPsT4bZ.js`),__vite__mapDeps([246,184,1,183,185,198,190,191])))},{id:`php`,name:`PHP`,import:(()=>N(()=>import(`./php-0S5_LhYZ.js`),__vite__mapDeps([257,184,1,183,185,189,198,190,191])))},{id:`pkl`,name:`Pkl`,import:(()=>N(()=>import(`./pkl-Dr4yLQ_o.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>N(()=>import(`./plsql-pFcO4WZ0.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>N(()=>import(`./po-BkZ0_HvY.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>N(()=>import(`./polar-DHK3q8FF.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>N(()=>import(`./postcss-Bv7WzijA.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>N(()=>import(`./powerquery-DpaU_hW9.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>N(()=>import(`./powershell-_Rqc0MGP.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>N(()=>import(`./prisma-wyegE8us.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>N(()=>import(`./prolog-DspHCURv.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>N(()=>import(`./proto-BOBiNGf5.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>N(()=>import(`./pug-DCZyheX4.js`),__vite__mapDeps([258,184,1,183,185])))},{id:`puppet`,name:`Puppet`,import:(()=>N(()=>import(`./puppet-DfLvV8h2.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>N(()=>import(`./purescript-BY5ZSOZy.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>N(()=>import(`./python-B758mMeg.js`),[]))},{id:`qml`,name:`QML`,import:(()=>N(()=>import(`./qml-DLa2zzL2.js`),__vite__mapDeps([259,185,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>N(()=>import(`./qmldir-C75bpHvy.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>N(()=>import(`./qss-DcLTlbLd.js`),[]))},{id:`r`,name:`R`,import:(()=>N(()=>import(`./r-C2wIHWmU.js`).then(e=>e.n),__vite__mapDeps([244,1])))},{id:`racket`,name:`Racket`,import:(()=>N(()=>import(`./racket-DTye_5qn.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>N(()=>import(`./raku-uJXBXkV0.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>N(()=>import(`./razor-CIU_5PCa.js`),__vite__mapDeps([260,261,183,1,184,185])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>N(()=>import(`./reg-DkTIaX7a.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>N(()=>import(`./regexp-oKAhWQ7Q.js`).then(e=>e.n),__vite__mapDeps([208,1])))},{id:`rel`,name:`Rel`,import:(()=>N(()=>import(`./rel-B0jumCjt.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>N(()=>import(`./riscv-DtaWMlo0.js`),[]))},{id:`ron`,name:`RON`,import:(()=>N(()=>import(`./ron-BCPxwJD6.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>N(()=>import(`./rosmsg-CPG8X-D5.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>N(()=>import(`./rst-Cof_t7QZ.js`),__vite__mapDeps([262,263,206,1,207,201,208,198,197,183,184,185,203,215,216,217,194,195,218,219,210,190,191,220])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>N(()=>import(`./ruby-o2UFtTKv.js`),__vite__mapDeps([215,201,1,206,207,208,198,184,216,185,217,194,195,218,183,219,210,190,191,220])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>N(()=>import(`./rust-CxfW3ePx.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>N(()=>import(`./sas-hJL2y9ck.js`),__vite__mapDeps([264,198,1])))},{id:`sass`,name:`Sass`,import:(()=>N(()=>import(`./sass-D-7bxo_L.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>N(()=>import(`./scala-DyUsfHNc.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>N(()=>import(`./scheme-ROgrwiO-.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>N(()=>import(`./scss-Cs20-D4S.js`).then(e=>e.n),__vite__mapDeps([187,1,184])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>N(()=>import(`./sdbl-B1EAQWpp.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>N(()=>import(`./shaderlab-Byjk0kH7.js`),__vite__mapDeps([265,266])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>N(()=>import(`./shellscript-FTtRH7a6.js`).then(e=>e.n),__vite__mapDeps([210,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>N(()=>import(`./shellsession-Dsazo7ie.js`),__vite__mapDeps([267,210,1])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>N(()=>import(`./smalltalk-B-1waXvA.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>N(()=>import(`./solidity-DYxwp0om.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>N(()=>import(`./soy-D05E5TYG.js`),__vite__mapDeps([268,183,1,184,185])))},{id:`sparql`,name:`SPARQL`,import:(()=>N(()=>import(`./sparql-CawLnniT.js`),__vite__mapDeps([269,270])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>N(()=>import(`./splunk-jK6-Sr06.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>N(()=>import(`./sql-2nD5KprC.js`).then(e=>e.n),__vite__mapDeps([198,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>N(()=>import(`./ssh-config-Bimb9LVr.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>N(()=>import(`./stata-gi0HO22o.js`),__vite__mapDeps([271,198,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>N(()=>import(`./stylus-B2DgJRJw.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>N(()=>import(`./surrealql-C1OjlKtP.js`),__vite__mapDeps([272,185,1])))},{id:`svelte`,name:`Svelte`,import:(()=>N(()=>import(`./svelte-lCoYOeOH.js`),__vite__mapDeps([273,184,1,185,193,195])))},{id:`swift`,name:`Swift`,import:(()=>N(()=>import(`./swift-ChEH2nFL.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>N(()=>import(`./system-verilog-DoVBMhJ8.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>N(()=>import(`./systemd--Ux4VAYD.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>N(()=>import(`./talonscript-DQNx9nak.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>N(()=>import(`./tasl-Bwy_Y9uD.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>N(()=>import(`./tcl-Drea-2jA.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>N(()=>import(`./templ-Be5BnDnr.js`),__vite__mapDeps([274,184,1,275,185])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>N(()=>import(`./terraform-4rS5HoFk.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>N(()=>import(`./tex-BBX4cNm_.js`),__vite__mapDeps([248,244,1])))},{id:`toml`,name:`TOML`,import:(()=>N(()=>import(`./toml-tSgOSv42.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>N(()=>import(`./ts-tags-BdYhOUUe.js`),__vite__mapDeps([276,184,1,207,201,183,185,198,195,190,191])))},{id:`tsv`,name:`TSV`,import:(()=>N(()=>import(`./tsv-BmL4O1Zx.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>N(()=>import(`./tsx-CfScc0-T.js`).then(e=>e.n),__vite__mapDeps([194,1])))},{id:`turtle`,name:`Turtle`,import:(()=>N(()=>import(`./turtle-2DYvssFL.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>N(()=>import(`./twig-DVDO78vU.js`),__vite__mapDeps([277,184,1,185,257,183,189,198,190,191,203,215,201,206,207,208,216,217,194,195,218,219,210,220,187])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>N(()=>import(`./typescript-x0tnfxi7.js`).then(e=>e.n),__vite__mapDeps([195,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>N(()=>import(`./typespec-DkCEO45F.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>N(()=>import(`./typst-DAZdb2n6.js`),[]))},{id:`v`,name:`V`,import:(()=>N(()=>import(`./v-B_wsb4C1.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>N(()=>import(`./vala-BDBNS784.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>N(()=>import(`./vb-CuOoJSSa.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>N(()=>import(`./verilog-BCcOvOcc.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>N(()=>import(`./vhdl-CI8PoqeM.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>N(()=>import(`./viml-B66dNP1B.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>N(()=>import(`./vue-Bm4Rs_rd.js`),__vite__mapDeps([278,184,1,197,183,185,189,195])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>N(()=>import(`./vue-html-Idq00pHJ.js`),__vite__mapDeps([279,185,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>N(()=>import(`./vue-vine-DNdsuI61.js`),__vite__mapDeps([280,184,1,185,251,193,187,281])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>N(()=>import(`./vyper-dNodzEa8.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>N(()=>import(`./wasm-d6SE2_qm.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>N(()=>import(`./wenyan-D0h8Uz55.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>N(()=>import(`./wgsl-vKs_vsvQ.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>N(()=>import(`./wikitext-BIWsPJit.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>N(()=>import(`./wit-6vmKi2H3.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>N(()=>import(`./wolfram-zoNg6F1a.js`),[]))},{id:`xml`,name:`XML`,import:(()=>N(()=>import(`./xml-C1p67_Oq.js`).then(e=>e.n),__vite__mapDeps([190,1,191])))},{id:`xsl`,name:`XSL`,import:(()=>N(()=>import(`./xsl-DcNV5e8y.js`),__vite__mapDeps([282,190,1,191])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>N(()=>import(`./yaml-Dz3CpChp.js`).then(e=>e.n),__vite__mapDeps([220,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>N(()=>import(`./zenscript-BxircxDx.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>N(()=>import(`./zig-DD79WQtz.js`),[]))}],IB=Object.fromEntries(FB.map(e=>[e.id,e.import])),LB=Object.fromEntries(FB.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),RB={...IB,...LB},zB=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>N(()=>import(`./andromeeda-DpQ-y-Jt.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>N(()=>import(`./aurora-x-BYcXaCIg.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>N(()=>import(`./ayu-dark-CLZPoccg.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>N(()=>import(`./ayu-light-CTyRQdS2.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>N(()=>import(`./ayu-mirage-DjqfqZdo.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-frappe-hr0HKoFX.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>N(()=>import(`./catppuccin-latte-DXEIYlFO.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-macchiato-B2zST7sA.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-mocha-CvrdnYv9.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>N(()=>import(`./dark-plus-mysFNRq2.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>N(()=>import(`./dracula-C-eRNn4o.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>N(()=>import(`./dracula-soft-CBB1BI7O.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>N(()=>import(`./everforest-dark-B_ISUDeh.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>N(()=>import(`./everforest-light-CNUYa354.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>N(()=>import(`./github-dark-BG2xX0wa.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>N(()=>import(`./github-dark-default-tDp_EOBs.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>N(()=>import(`./github-dark-dimmed-DlSfPwW2.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>N(()=>import(`./github-dark-high-contrast-qZM7j5KB.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>N(()=>import(`./github-light-CnvWTiyb.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>N(()=>import(`./github-light-default-Dy6OAt2Q.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>N(()=>import(`./github-light-high-contrast-1BHQCOPl.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-hard-BMIwVwaJ.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-medium-DxfuBW3n.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-soft-_NSslDDi.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-hard-CP5MIsL9.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-medium-BTMursH0.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-soft-Bv6zFoVX.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>N(()=>import(`./horizon-CufN8DyP.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>N(()=>import(`./horizon-bright-5qoQVyIY.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>N(()=>import(`./houston-DOFkQwep.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>N(()=>import(`./kanagawa-dragon-6UCcJpLw.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>N(()=>import(`./kanagawa-lotus-DOmfpsRg.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>N(()=>import(`./kanagawa-wave-CpxmPE7N.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>N(()=>import(`./laserwave-BlEkf-eH.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>N(()=>import(`./light-plus-DS6zriYl.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>N(()=>import(`./material-theme-BsXH-Mss.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>N(()=>import(`./material-theme-darker-CW9OlIeY.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>N(()=>import(`./material-theme-lighter-D2PAh0Kw.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>N(()=>import(`./material-theme-ocean-Vz6DBVi3.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>N(()=>import(`./material-theme-palenight-D-GleP3G.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>N(()=>import(`./min-dark-BowNvxk2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>N(()=>import(`./min-light-x8oWUmbL.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>N(()=>import(`./monokai-BQ4e_Hn0.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>N(()=>import(`./night-owl-D4PQd726.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>N(()=>import(`./night-owl-light-BQo_YHll.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>N(()=>import(`./nord-35quHUKo.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>N(()=>import(`./one-dark-pro-16_UaUig.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>N(()=>import(`./one-light-B-GGjWn5.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>N(()=>import(`./plastic-hp2Nry0R.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>N(()=>import(`./poimandres-BcTrxj7f.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>N(()=>import(`./red-rs3HE3re.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>N(()=>import(`./rose-pine-CNryoqGi.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>N(()=>import(`./rose-pine-dawn-C-gJOQVP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>N(()=>import(`./rose-pine-moon-BdXSXpZh.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>N(()=>import(`./slack-dark-DnmSY72G.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>N(()=>import(`./slack-ochin-q97gHjcd.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>N(()=>import(`./snazzy-light-C8yWDN2g.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>N(()=>import(`./solarized-dark-ClVDEMJZ.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>N(()=>import(`./solarized-light-Bts6CUIP.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>N(()=>import(`./synthwave-84-DwSLbgAm.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>N(()=>import(`./tokyo-night-C9MqaxIn.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>N(()=>import(`./vesper-CliZ6Pkm.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>N(()=>import(`./vitesse-black-0bGIaCfD.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>N(()=>import(`./vitesse-dark-Dk-RSXq-.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>N(()=>import(`./vitesse-light-BUsA5RhG.js`),[]))}].map(e=>[e.id,e.import])),BB=r({createOnigurumaEngine:()=>mV,getDefaultWasmLoader:()=>pV,loadWasm:()=>sV,setDefaultWasmLoader:()=>fV}),VB=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function HB(){return 2147483648}function UB(){return typeof performance<`u`?performance.now():Date.now()}var WB=(e,t)=>e+(t-e%t)%t;async function GB(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=HB();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,WB(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:UB,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var KB=Object.defineProperty,qB=(e,t,n)=>t in e?KB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JB=(e,t,n)=>qB(e,typeof t==`symbol`?t:t+``,n),YB=null;function XB(e){throw new VB(e.UTF8ToString(e.getLastOnigError()))}var ZB=class e{constructor(t){JB(this,`utf16Length`),JB(this,`utf8Length`),JB(this,`utf16Value`),JB(this,`utf8Value`),JB(this,`utf16OffsetToUtf8`),JB(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},QB=class e{constructor(t){if(JB(this,`id`,++e.LAST_ID),JB(this,`_onigBinding`),JB(this,`content`),JB(this,`utf16Length`),JB(this,`utf8Length`),JB(this,`utf16OffsetToUtf8`),JB(this,`utf8OffsetToUtf16`),JB(this,`ptr`),!YB)throw new VB(`Must invoke loadWasm first.`);this._onigBinding=YB,this.content=t;let n=new ZB(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=YB.omalloc(1e4),e._sharedPtrInUse=!0,YB.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(YB)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};JB(QB,`LAST_ID`,0),JB(QB,`_sharedPtr`,0),JB(QB,`_sharedPtrInUse`,!1);var $B=QB,eV=class{constructor(e){if(JB(this,`_onigBinding`),JB(this,`_ptr`),!YB)throw new VB(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new ZB(e[r]);t[r]=i.createString(YB),n[r]=i.utf8Length}let r=YB.omalloc(4*e.length);YB.HEAPU32.set(t,r/4);let i=YB.omalloc(4*e.length);YB.HEAPU32.set(n,i/4);let a=YB.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)YB.ofree(t[n]);YB.ofree(i),YB.ofree(r),a===0&&XB(YB),this._onigBinding=YB,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new $B(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function tV(e){return typeof e.instantiator==`function`}function nV(e){return typeof e.default==`function`}function rV(e){return e.data!==void 0}function iV(e){return typeof Response<`u`&&e instanceof Response}function aV(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var oV;function sV(e){if(oV)return oV;async function t(){YB=await GB(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),tV(n)?n=await n.instantiator(t):nV(n)?n=await n.default(t):(rV(n)&&(n=n.data),iV(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await lV(n)(t):await uV(n)(t):aV(n)||n instanceof WebAssembly.Module?n=await cV(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await cV(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return oV=t(),oV}function cV(e){return t=>WebAssembly.instantiate(e,t)}function lV(e){return t=>WebAssembly.instantiateStreaming(e,t)}function uV(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var dV;function fV(e){dV=e}function pV(){return dV}async function mV(e){return e&&await sV(e),{createScanner(e){return new eV(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new $B(e)}}}var hV=MB({});PB(hV,BB);var gV=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function _V(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function vV(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function yV(e){return Array.isArray(e)?e:[e]}async function bV(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function xV(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function SV(e){return e===`ansi`||xV(e)}function CV(e){return e===`none`}function wV(e){return CV(e)}function TV(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var EV={light:`#333333`,dark:`#bbbbbb`},DV={light:`#fffffe`,dark:`#1e1e1e`},OV=`__shiki_resolved`;function kV(e){if(e?.[OV])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?EV.light:EV.dark,n||=t.type===`light`?DV.light:DV.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,OV,{enumerable:!1,writable:!1,value:!0}),t}async function AV(e){return Array.from(new Set((await Promise.all(e.filter(e=>!SV(e)).map(async e=>await bV(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function jV(e){return(await Promise.all(e.map(async e=>wV(e)?null:kV(await bV(e))))).filter(e=>!!e)}function MV(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new gV(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var NV=class extends Cm{_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=kV(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=tp.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=MV(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new gV(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},PV=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},FV=0;function IV(e){FV+=1,e.warnings!==!1&&FV>=10&&FV%10==0&&console.warn(`[Shiki] ${FV} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new gV("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(kV),i=new NV(new PV(e.engine,n),r,n,e.langAlias),a;function o(t){return MV(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new gV(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new gV(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await AV(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await jV(e))}function g(){if(t)throw new gV(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--FV)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function LV(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([jV(e.themes||[]),AV(e.langs||[]),e.engine]);return IV({...e,themes:t,langs:n,engine:r})}var RV=new WeakMap;function zV(e,t){RV.set(e,t)}function BV(e){return RV.get(e)}var VV=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(yV(n).map(e=>[e,wm])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return HV(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function HV(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function UV(e,t){if(!(e instanceof VV))throw new gV(`Invalid grammar state`);return e.getInternalStack(t)}function WV(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(xV(e.resolveLangAlias(n.lang||`text`))||CV(r))return TV(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new gV(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new gV(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return KV(t,o,i,a,n)}function GV(...e){if(e.length===2)return BV(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(xV(i)||CV(a))throw new gV(`Plain language does not have grammar state`);if(i===`ansi`)throw new gV(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new VV(qV(n,c,o,s,r).stateStack,c.name,o.name)}function KV(e,t,n,r,i){let a=qV(e,t,n,r,i),o=new VV(a.stateStack,t.name,n.name);return zV(a.tokens,o),a.tokens}function qV(e,t,n,r,i){let a=_V(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=TV(e),l=i.grammarState?UV(i.grammarState,n.name)??wm:i.grammarContextCode==null?wm:qV(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=vV(r[mp.getForeground(s)],a),l=mp.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?JV(t.scopes):YV(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function JV(e){return e.map(e=>({scopeName:e}))}function YV(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:QV(e,i,t.slice(0,r))}}return n}function XV(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function ZV(e,t,n){if(!XV(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)XV(e[r],n[i])&&--r,--i;return r===-1}function QV(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(ZV(e,t,n)){r.push(a);break}return r}function $V(e,t,n,r=WV){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:BV(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=eH(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new VV(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&zV(s,c),s}function eH(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}function tH(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function nH(e){let t=TV(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function rH(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var iH=`light-dark()`,aH=[`color`,`background-color`];function oH(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function sH(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?oH(e,t):e})):e}function cH(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>lH(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&aH.includes(a))if(r===iH&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new gV('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function lH(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&cp.Italic&&(t[`font-style`]=`italic`),e.fontStyle&cp.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&cp.Underline&&n.push(`underline`),e.fontStyle&cp.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function uH(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function dH(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=nH(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new gV(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}else{let t=n.lines[e.line];if(t===void 0)throw new gV(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new gV(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));fH(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return sH(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new gV(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=pH(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new gV(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new gV(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&tH(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function fH(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new gV(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new gV(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function pH(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(pH).join(``):``}var mH=[dH()];function hH(e){let t=gH(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...mH]}function gH(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var _H=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],vH={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function yH(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function bH(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function xH(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)vH[r]&&t.push({type:`setDecoration`,value:vH[r]});else if(r<=29){let e=vH[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:_H[r-30]}});else if(r===38){let n=bH(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:_H[r-40]}});else if(r===48){let n=bH(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:_H[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:_H[r-100+8]}})}return t}function SH(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=yH(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=xH(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var CH={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function wH(e=CH){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<_H.length;e++)r.push(t(_H[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var TH={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function EH(e,t,n){let r=_V(e,n),i=TV(t),a=wH(Object.fromEntries(_H.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||TH[t]]}))),o=SH();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=vV(i,r),o=vV(o,r),n.decorations.has(`dim`)&&(i=DH(i));let s=cp.None;return n.decorations.has(`bold`)&&(s|=cp.Bold),n.decorations.has(`italic`)&&(s|=cp.Italic),n.decorations.has(`underline`)&&(s|=cp.Underline),n.decorations.has(`strikethrough`)&&(s|=cp.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function DH(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function OH(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!xV(r)&&!CV(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return EH(r,t,n)}return WV(e,t,n)}function kH(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new gV("`themes` option must not be empty");let p=$V(e,t,n,OH);if(c=BV(p),l&&iH!==l&&!f.find(e=>e.color===l))throw new gV(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>cH(e,h,u,l,d))),c&&zV(a,c);let g=f.map(e=>_V(e.theme,n));i=AH(f,m,g,u,l,`fg`,d),r=AH(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=_V(n.theme,n);a=OH(e,t,n);let l=e.getTheme(n.theme);r=vV(l.bg,s),i=vV(l.fg,s),o=l.name,c=BV(a)}else throw new gV("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function AH(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=vV(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===iH&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new gV('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${vV(t[r][a],n[r])||`inherit`}, ${vV(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function jH(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>jH(e,t,n),codeToTokens:(t,n)=>kH(e,t,n)}){let i=t;for(let e of hH(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=kH(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=NH(a):d===`never`&&(a=PH(a)),f&&(a=FH(a));let p={...r,get source(){return i}};for(let e of hH(n))a=e.tokens?.call(p,a)||a;return MH(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function MH(e,t,n,r=BV(e)){let i=hH(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:tH,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
176
|
+
</iframe>`,`putIntoIFrame`),OT=I((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,uT);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function kT(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}I(kT,`sandboxedIframe`);var AT=I((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),jT=I(async function(e,t,n){Gw();let r=xT(t);t=r.code;let i=Ce();te.debug(i),t.length>(i?.maxTextSize??oT)&&(t=sT);let a=`#`+e,o=`i`+e,s=`#`+o,c=`d`+e,l=`#`+c,u=I(()=>{let e=ne(f?s:l).node();e&&`remove`in e&&e.remove()},`removeTempElements`),d=ne(`body`),f=i.securityLevel===cT,p=i.securityLevel===lT,m=i.fontFamily;n===void 0?(AT(document,e,c,o),f?(d=ne(kT(ne(`body`),o).nodes()[0].contentDocument.body),d.node().style.margin=0):d=ne(`body`),OT(d,e,c)):(n&&(n.innerHTML=``),f?(d=ne(kT(ne(n),o).nodes()[0].contentDocument.body),d.node().style.margin=0):d=ne(n),OT(d,e,c,`font-family: ${m}`,dT));let h,g;try{h=await Xw.fromText(t,{title:r.title})}catch(e){if(i.suppressErrorRendering)throw u(),e;h=await Xw.fromText(`error`),g=e}let _=d.select(l).node(),v=h.type,y=_.firstChild,b=y.firstChild,x=h.renderer.getClasses?.(t,h),S=TT(i,v,x,a),C=document.createElement(`style`);C.innerHTML=S,y.insertBefore(C,b);try{await h.renderer.draw(t,e,`11.14.0`,h)}catch(n){throw i.suppressErrorRendering?u():mw.draw(t,e,`11.14.0`),n}let w=d.select(`${l} svg`),T=h.db.getAccTitle?.(),E=h.db.getAccDescription?.();PT(v,w,T,E),d.select(`[id="${e}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,fT);let D=d.select(l).node().innerHTML;if(te.debug(`config.arrowMarkerAbsolute`,i.arrowMarkerAbsolute),D=ET(D,f,he(i.arrowMarkerAbsolute)),f){let e=d.select(l+` svg`).node();D=DT(D,e)}else p||(D=de.sanitize(D,{ADD_TAGS:yT,ADD_ATTR:bT,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Qw(),g)throw g;return u(),{diagramType:v,svg:D,bindFunctions:h.db.bindFunctions}},`render`);function MT(e={}){let t=ye({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||={},t.themeVariables.fontFamily=t.fontFamily),we(t),t?.theme&&t.theme in ue?t.themeVariables=ue[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=ue.default.getThemeVariables(t.themeVariables)),F((typeof t==`object`?ie(t):ce()).logLevel),Gw()}I(MT,`initialize`);var NT=I((e,t={})=>{let{code:n}=iT(e);return Xw.fromText(n,t)},`getDiagramFromText`);function PT(e,t,n,r){Jw(t,e),Yw(t,n,r,t.attr(`id`))}I(PT,`addA11yInfo`);var FT=Object.freeze({render:jT,parse:ST,getDiagramFromText:NT,initialize:MT,getConfig:Ce,setConfig:L,getSiteConfig:ce,updateSiteConfig:le,reset:I(()=>{re()},`reset`),globalReset:I(()=>{re(ge)},`globalReset`),defaultConfig:ge});F(Ce().logLevel),re(Ce());var IT=I((e,t,n)=>{te.warn(e),Ee(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),LT=I(async function(e={querySelector:`.mermaid`}){try{await RT(e)}catch(t){if(Ee(t)&&te.error(t.str),YT.parseError&&YT.parseError(t),!e.suppressErrors)throw te.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),RT=I(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:`.mermaid`}){let r=FT.getConfig();te.debug(`${e?``:`No `}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);te.debug(`Found ${i.length} diagrams`),r?.startOnLoad!==void 0&&(te.debug(`Start On Load: `+r?.startOnLoad),FT.updateSiteConfig({startOnLoad:r?.startOnLoad}));let a=new De.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed),o,s=[];for(let t of Array.from(i)){if(te.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let n=`mermaid-${a.next()}`;o=t.innerHTML,o=Fe(De.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,`<br/>`);let r=De.detectInit(o);r&&te.debug(`Detected early reinit: `,r);try{let{svg:r,bindFunctions:i}=await JT(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){IT(e,s,YT.parseError)}}if(s.length>0)throw s[0]},`runThrowsErrors`),zT=I(function(e){FT.initialize(e)},`initialize`),BT=I(async function(e,t,n){te.warn(`mermaid.init is deprecated. Please use run instead.`),e&&zT(e);let r={postRenderCallback:n,querySelector:`.mermaid`};typeof t==`string`?r.querySelector=t:t&&(t instanceof HTMLElement?r.nodes=[t]:r.nodes=t),await LT(r)},`init`),VT=I(async(e,{lazyLoad:t=!0}={})=>{Gw(),oe(...e),t===!1&&await Kw()},`registerExternalDiagrams`),HT=I(function(){if(YT.startOnLoad){let{startOnLoad:e}=FT.getConfig();e&&YT.run().catch(e=>te.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,HT,!1);var UT=I(function(e){YT.parseError=e},`setParseErrorHandler`),WT=[],GT=!1,KT=I(async()=>{if(!GT){for(GT=!0;WT.length>0;){let e=WT.shift();if(e)try{await e()}catch(e){te.error(`Error executing queue`,e)}}GT=!1}},`executeQueue`),qT=I(async(e,t)=>new Promise((n,r)=>{let i=I(()=>new Promise((i,a)=>{FT.parse(e,t).then(e=>{i(e),n(e)},e=>{te.error(`Error parsing`,e),YT.parseError?.(e),a(e),r(e)})}),`performCall`);WT.push(i),KT().catch(r)}),`parse`),JT=I((e,t,n)=>new Promise((r,i)=>{let a=I(()=>new Promise((a,o)=>{FT.render(e,t,n).then(e=>{a(e),r(e)},e=>{te.error(`Error parsing`,e),YT.parseError?.(e),o(e),i(e)})}),`performCall`);WT.push(a),KT().catch(i)}),`render`),YT={startOnLoad:!0,mermaidAPI:FT,parse:qT,render:JT,init:BT,run:LT,registerExternalDiagrams:VT,registerLayoutLoaders:Ie,initialize:zT,parseError:void 0,contentLoaded:HT,setParseErrorHandler:UT,detectType:pe,registerIconPacks:Pe,getRegisteredDiagramsMetadata:I(()=>Object.keys(ve).map(e=>({id:e})),`getRegisteredDiagramsMetadata`)},XT=YT,ZT={startOnLoad:!1,theme:`default`,securityLevel:`strict`,fontFamily:`monospace`,suppressErrorRendering:!0};function QT(e={}){let t=!1,n={...ZT,...e.config},r={initialize(r){n={...ZT,...e.config,...r},XT.initialize(n),t=!0},async render(e,r){return t||=(XT.initialize(n),!0),await XT.render(e,r)}};return{name:`mermaid`,type:`diagram`,language:`mermaid`,getMermaid(e){return e&&r.initialize(e),r}}}var $T=QT(),eE=({className:e,from:t,...n})=>(0,U.jsx)(`div`,{className:H(`group flex w-full max-w-[95%] flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant self-start`,e),...n}),tE=({children:e,className:t,...n})=>(0,U.jsx)(`div`,{className:H(`is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-left group-[.is-assistant]:text-foreground`,t),...n,children:e}),nE=({className:e,children:t,...n})=>(0,U.jsx)(`div`,{className:H(`flex items-center gap-1`,e),...n,children:t}),rE=({tooltip:e,children:t,label:n,variant:r=`ghost`,size:i=`icon-sm`,...a})=>{let o=(0,U.jsxs)($n,{size:i,type:`button`,variant:r,...a,children:[t,(0,U.jsx)(`span`,{className:`sr-only`,children:n||e})]});return e?(0,U.jsx)(vd,{children:(0,U.jsxs)(yd,{children:[(0,U.jsx)(bd,{render:o}),(0,U.jsx)(xd,{children:(0,U.jsx)(`p`,{children:e})})]})}):o},iE=(0,z.createContext)(null),aE=()=>{let e=(0,z.useContext)(iE);if(!e)throw Error(`MessageBranch components must be used within MessageBranch`);return e},oE=({defaultBranch:e=0,onBranchChange:t,className:n,...r})=>{let[i,a]=(0,z.useState)(e),[o,s]=(0,z.useState)([]),c=(0,z.useCallback)(e=>{a(e),t?.(e)},[t]),l=(0,z.useCallback)(()=>{c(i>0?i-1:o.length-1)},[i,o.length,c]),u=(0,z.useCallback)(()=>{c(i<o.length-1?i+1:0)},[i,o.length,c]),d=(0,z.useMemo)(()=>({branches:o,currentBranch:i,goToNext:u,goToPrevious:l,setBranches:s,totalBranches:o.length}),[o,i,u,l]);return(0,U.jsx)(iE.Provider,{value:d,children:(0,U.jsx)(`div`,{className:H(`grid w-full gap-2 [&>div]:pb-0`,n),...r})})},sE=({children:e,...t})=>{let{currentBranch:n,setBranches:r,branches:i}=aE(),a=(0,z.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return(0,z.useEffect)(()=>{i.length!==a.length&&r(a)},[a,i,r]),a.map((e,r)=>(0,U.jsx)(`div`,{className:H(`grid gap-2 overflow-hidden [&>div]:pb-0`,r===n?`block`:`hidden`),...t,children:e},e.key))},cE={cjk:Bf,code:Bx,math:BS,mermaid:$T},lE=(0,z.memo)(({className:e,...t})=>(0,U.jsx)(D,{className:H(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),plugins:cE,...t}),(e,t)=>e.children===t.children&&t.isAnimating===e.isAnimating);lE.displayName=`MessageResponse`;var uE=({messageId:e,rating:t,onRate:n,disabled:r})=>{let[i,a]=(0,z.useState)(null),[o,s]=(0,z.useState)(``),c=t?.rating,l=(0,z.useCallback)(r=>{let i=c===r?0:r;i===0?(n(e,0),a(null),s(``)):(a(i),s(t?.comment??``))},[c,e,n,t?.comment]),u=(0,z.useCallback)(()=>{i!==null&&(n(e,i,o.trim()||void 0),a(null),s(``))},[o,e,n,i]),d=(0,z.useCallback)(()=>{i!==null&&(n(e,i),a(null),s(``))},[e,n,i]),f=i??c;return(0,U.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,U.jsxs)(nE,{children:[(0,U.jsx)(rE,{tooltip:`Thumbs up`,onClick:()=>l(1),variant:f===1?`default`:`ghost`,disabled:r,children:(0,U.jsx)(gu,{className:`size-4`})}),(0,U.jsx)(rE,{tooltip:`Thumbs down`,onClick:()=>l(-1),variant:f===-1?`default`:`ghost`,disabled:r,children:(0,U.jsx)(hu,{className:`size-4`})})]}),i!==null&&(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border bg-background p-3 text-sm shadow-sm`,children:[(0,U.jsx)(`textarea`,{autoFocus:!0,className:`w-full resize-none rounded border-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground`,placeholder:`Add a comment (optional)`,rows:2,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&u(),e.key===`Escape`&&d()}}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(`button`,{className:`text-xs text-muted-foreground hover:text-foreground transition-colors`,onClick:d,children:`Skip`}),(0,U.jsx)(`button`,{className:`rounded bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground hover:bg-primary/90 transition-colors`,onClick:u,children:`Submit`})]})]})]})},dE=globalThis?.document?z.useLayoutEffect:()=>{},fE=z.useInsertionEffect||dE;function pE({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=mE({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=z.useRef(e!==void 0);z.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,z.useCallback(t=>{if(s){let n=hE(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function mE({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return fE(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function hE(e){return typeof e==`function`}var gE=z.createContext(void 0);function _E(e){let t=z.useContext(gE);if(e===!1&&t===void 0)throw Error(hn(27));return t}var vE={..._l,...mc},yE=z.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=_E(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Hn(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:vE,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),bE=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{store:c}=_E(),l=c.useState(`open`);function u(e){l&&c.setOpen(!1,Ur(Fr,e.nativeEvent))}let{getButtonProps:d,buttonRef:f}=yn({disabled:i,native:a});return Hn(`button`,e,{state:{disabled:i},ref:[t,f],props:[{onClick:u},s,d]})}),xE=z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=_E(),c=vl(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Hn(`p`,e,{ref:t,props:[{id:c},o]})}),SE=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),CE=function(e){return e[e.open=cl.open]=`open`,e[e.closed=cl.closed]=`closed`,e[e.startingStyle=cl.startingStyle]=`startingStyle`,e[e.endingStyle=cl.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),wE=z.createContext(void 0);function TE(){let e=z.useContext(wE);if(e===void 0)throw Error(hn(26));return e}var EE=`ArrowUp`,DE=`ArrowDown`,OE=`ArrowLeft`,kE=`ArrowRight`,AE=`Home`,jE=new Set([OE,kE]),ME=new Set([EE,DE]),NE=new Set([...jE,...ME]);new Set([...NE,AE,`End`]);var PE=new Set([EE,DE,OE,kE,AE,`End`]),FE={..._l,...mc,nestedDialogOpen(e){return e?{[CE.nestedDialogOpen]:``}:null}},IE=z.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,style:o,...s}=e,{store:c}=_E(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`);TE(),gc({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});function S(e){return e===`touch`?c.context.popupRef.current:!0}let C=i===void 0?S:i,w=Hn(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:g>0},props:[f,{"aria-labelledby":y??void 0,"aria-describedby":l??void 0,role:x,tabIndex:-1,hidden:!m,onKeyDown(e){PE.has(e.key)&&e.stopPropagation()},style:{[SE.nestedDialogs]:g}},s],ref:[t,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:FE});return(0,U.jsx)(wo,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:r,modal:p!==!1,restoreFocus:`popup`,children:w})}),LE=z.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,U.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),RE=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=_E(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,U.jsx)(wE.Provider,{value:n,children:(0,U.jsxs)(ro,{ref:t,...r,children:[a&&o===!0&&(0,U.jsx)(LE,{ref:i.context.internalBackdropRef,inert:Ml(!s)}),e.children]})}):null}),zE={},BE={},VE=``;function HE(e){if(typeof document>`u`)return!1;let t=ti(e);return xt(t).innerWidth-t.documentElement.clientWidth>0}function UE(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=ti(e),n=t.documentElement,r=t.body,i=Dt(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function WE(e){let t=ti(e),n=t.documentElement,r=t.body,i=Dt(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function GE(e){let t=ti(e),n=t.documentElement,r=t.body,i=xt(n),a=0,o=0,s=!1,c=$r.create();if(ur&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,zE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},VE=n.style.scrollBehavior,BE={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Dt(n)?n:r;if(s=UE(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,zE),Object.assign(r.style,BE),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=VE)}function d(){u(),c.request(l)}l();let f=qr(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var KE=new class{lockCount=0;restore=null;timeoutLock=ir.create();timeoutUnlock=ir.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=ti(e).documentElement,n=xt(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=Pn;return}this.restore=dr||!HE(e)?WE(e):GE(e)}};function qE(e=!0,t=null){V(()=>{if(e)return KE.acquire(t)},[e,t])}function JE(e){let t=z.useRef(``),n=z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:z.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function YE(e,t){let n=z.useRef(e),r=B(t);V(()=>{n.current!==e&&r(n.current)},[e,r]),V(()=>{n.current=e},[e])}function XE(e){let[t,n]=z.useState(null),r=B((t,r)=>{e||n(r||(dr?`touch`:``))});YE(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=JE(r);return z.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function ZE(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`),o=t.useState(`disablePointerDismissal`),s=t.useState(`modal`),c=t.useState(`popupElement`),{openMethod:l,triggerProps:u}=XE(a);yc(t);let{forceUnmount:d}=bc(a,t),f=B(e=>{let n=Ur(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=z.useCallback(()=>{t.setOpen(!1,f(Hr))},[t,f]);z.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Oc({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[h,g]=z.useState(0),[_,v]=z.useState(0),y=h===0,b=Zc(m),x=Mo(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=mi(e);if(y&&!o){let e=n;return s&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||pi(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:y});qE(a&&s===!0,c);let{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=zc([b,x]);t.useContextCallback(`onNestedDialogOpen`,(e,t)=>{g(e),v(t)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0),v(0)}),z.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(h+1,_+ +!!i),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[i,a,h,_,n]);let T=z.useMemo(()=>S(u),[S,u]),E=z.useMemo(()=>w(u),[w,u]),D=z.useMemo(()=>C(),[C]);t.useSyncedValues({openMethod:l,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:m,nestedOpenDialogCount:h,nestedOpenDrawerCount:_})}var QE={...Tc,modal:W(e=>e.modal),nested:W(e=>e.nested),nestedOpenDialogCount:W(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:W(e=>e.nestedOpenDrawerCount),disablePointerDismissal:W(e=>e.disablePointerDismissal),openMethod:W(e=>e.openMethod),descriptionElementId:W(e=>e.descriptionElementId),titleElementId:W(e=>e.titleElementId),viewportElement:W(e=>e.viewportElement),role:W(e=>e.role)},$E=class e extends sc{constructor(e){super(eD(e),{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new xc,onOpenChange:void 0,onOpenChangeComplete:void 0},QE)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};static useStore(t,n){let r=Gt(()=>new e(n)).current;return t??r}};function eD(e={}){return{...Cc(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}var tD=z.createContext(!1);function nD(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=_E(!0),p=z.useContext(tD),m=!!f,h=$E.useStore(l?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:m});er(()=>{n===void 0&&h.state.open===!1&&r===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp(`openProp`,n),h.useControlledProp(`triggerIdProp`,u),h.useSyncedValues({disablePointerDismissal:o,nested:m,modal:s}),h.useContextCallback(`onOpenChange`,i),h.useContextCallback(`onOpenChangeComplete`,a);let g=h.useState(`payload`);ZE({store:h,actionsRef:c,parentContext:f?.store.context,isDrawer:p,onOpenChange:i,triggerIdProp:u});let _=z.useMemo(()=>({store:h}),[h]);return(0,U.jsx)(tD.Provider,{value:!1,children:(0,U.jsx)(gE.Provider,{value:_,children:typeof t==`function`?t({payload:g}):t})})}var rD=z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=_E(),c=vl(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Hn(`h2`,e,{ref:t,props:[{id:c},o]})}),iD=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,payload:s,handle:c,style:l,...u}=e,d=_E(!0),f=c?.store??d?.store;if(!f)throw Error(hn(79));let p=vl(o),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=z.useRef(null),{registerTrigger:_,isMountedByThisTrigger:v}=vc(p,g,f,{payload:s}),{getButtonProps:y,buttonRef:b}=yn({disabled:i,native:a}),x=zc([To(m,{enabled:m!=null})]),S={disabled:i,open:h},C=f.useState(`triggerProps`,v);return Hn(`button`,e,{state:S,ref:[b,t,_,g],props:[x.getReferenceProps(),C,{[Rn]:``,id:p},u,y],stateAttributesMapping:hl})});function aD({...e}){return(0,U.jsx)(nD,{"data-slot":`dialog`,...e})}function oD({...e}){return(0,U.jsx)(iD,{"data-slot":`dialog-trigger`,...e})}function sD({...e}){return(0,U.jsx)(RE,{"data-slot":`dialog-portal`,...e})}function cD({className:e,...t}){return(0,U.jsx)(yE,{"data-slot":`dialog-overlay`,className:H(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function lD({className:e,children:t,showCloseButton:n=!0,...r}){return(0,U.jsxs)(sD,{children:[(0,U.jsx)(cD,{}),(0,U.jsxs)(IE,{"data-slot":`dialog-content`,className:H(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,U.jsxs)(bE,{"data-slot":`dialog-close`,render:(0,U.jsx)($n,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,U.jsx)(bu,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function uD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-header`,className:H(`flex flex-col gap-2`,e),...t})}function dD({className:e,showCloseButton:t=!1,children:n,...r}){return(0,U.jsxs)(`div`,{"data-slot":`dialog-footer`,className:H(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,U.jsx)(bE,{render:(0,U.jsx)($n,{variant:`outline`}),children:`Close`})]})}function fD({className:e,...t}){return(0,U.jsx)(rD,{"data-slot":`dialog-title`,className:H(`text-base leading-none font-medium`,e),...t})}var pD=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),mD={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},hD={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},gD={disabled:!1,...hD},_D={valid(e){return e===null?null:e?{[pD.valid]:``}:{[pD.invalid]:``}}},vD=z.createContext({invalid:void 0,name:void 0,validityData:{state:mD,errors:[],error:``,value:``,initialValue:null},setValidityData:Pn,disabled:void 0,touched:hD.touched,setTouched:Pn,dirty:hD.dirty,setDirty:Pn,filled:hD.filled,setFilled:Pn,focused:hD.focused,setFocused:Pn,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:gD,markedDirtyRef:{current:!1},registerFieldControl:Pn,validation:{getValidationProps:(e=In)=>e,getInputValidationProps:(e=In)=>e,inputRef:{current:null},commit:async()=>{}}});function yD(e=!0){let t=z.useContext(vD);if(t.setValidityData===Pn&&!e)throw Error(hn(28));return t}var bD=z.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Pn,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function xD(){return z.useContext(bD)}var SD=z.createContext({controlId:void 0,registerControlId:Pn,labelId:void 0,setLabelId:Pn,messageIds:[],setMessageIds:Pn,getDescriptionProps:e=>e});function CD(){return z.useContext(SD)}function wD({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=z.useRef(e!==void 0),[a,o]=z.useState(t);return[i?e:a,z.useCallback(e=>{i||o(e)},[])]}function TD(e,t){let{enabled:n=!0,getValue:r,id:i,value:a}=t,{registerFieldControl:o}=yD(),s=z.useRef(null);s.current||=Symbol(),V(()=>{let t=s.current;if(!(!t||!n))return o(t,{controlRef:e,getValue:r,id:i,value:a}),()=>{o(t,void 0)}},[e,n,r,i,o,a])}function ED(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=CD(),o=vl(t),s=n?i:void 0,c=Gt(()=>Symbol(`labelable-control`)),l=z.useRef(!1),u=z.useRef(t!=null),d=B(()=>{!l.current||a===Pn||(l.current=!1,a(c.current,void 0))});return V(()=>{if(a===Pn)return;let e;if(n){let n=r?.current;e=wt(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),z.useEffect(()=>d,[d]),i??o}var DD=z.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:S}=yD(),C=h||s,w=m??a,T={...p,disabled:C},{labelId:E}=CD(),D=ED({id:i});V(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?b(!0):e&&o===``&&b(!1)},[S.inputRef,b,o]);let O=z.useRef(null);V(()=>{u&&O.current===fi(ti(O.current))&&y(!0)},[u,y]);let[k]=wD({controlled:o,default:l,name:`FieldControl`,state:`value`}),A=o!==void 0,j=A?k:void 0,M=B(()=>S.inputRef.current?.value);return TD(S.inputRef,{id:D,value:j,getValue:M}),Hn(`input`,e,{ref:[t,O],state:T,props:[{id:D,disabled:C,name:w,ref:S.inputRef,"aria-labelledby":E,autoFocus:u,...A?{value:j}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,Ur(kr,e.nativeEvent)),_(t!==v.initialValue),b(t!==``)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),S.commit(e.currentTarget.value))}},S.getInputValidationProps(),f],stateAttributesMapping:_D})}),OD=z.forwardRef(function(e,t){return(0,U.jsx)(DD,{ref:t,...e})});function kD({className:e,type:t,...n}){return(0,U.jsx)(OD,{type:t,"data-slot":`input`,className:H(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function AD({className:e,...t}){return(0,U.jsx)(`textarea`,{"data-slot":`textarea`,className:H(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function jD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:H(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var MD=Zn(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function ND({className:e,align:t=`inline-start`,...n}){return(0,U.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:H(MD({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var PD=Zn(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function FD({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,U.jsx)($n,{type:t,"data-size":r,variant:n,className:H(PD({size:r}),e),...i})}function ID({className:e,...t}){return(0,U.jsx)(AD,{"data-slot":`input-group-control`,className:H(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}var LD=z.createContext(void 0);function RD(e){let t=z.useContext(LD);if(t===void 0&&!e)throw Error(hn(33));return t}var zD=z.createContext(void 0);function BD(e){let t=z.useContext(zD);if(t===void 0&&!e)throw Error(hn(36));return t}var VD=z.createContext(void 0);function HD(e=!0){let t=z.useContext(VD);if(t===void 0&&!e)throw Error(hn(25));return t}function UD(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=HD(!0),d=u!==void 0;return z.useMemo(()=>({id:r,role:`menuitem`,tabIndex:n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:Pr})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||d&&!mr&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!d||e.button===2)&&(!c||c.type===`regular-item`)&&s.current.click()}}),[t,n,r,l,i,a,o,s,u,d,c])}var WD={type:`regular-item`};function GD(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=z.useRef(null),{getButtonProps:d,buttonRef:f}=yn({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=UD({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=z.useCallback(e=>$t(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=Sn(u,f);return z.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var KD=z.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function qD(){return z.useContext(KD)}var JD=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function YD(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=qD(),f=z.useRef(-1),[p,m]=z.useState(a??(i===JD.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=z.useRef(null),g=z.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return V(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),V(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),z.useMemo(()=>({ref:g,index:p}),[p,g])}var XD=z.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=YD({label:a}),f=RD(!0),p=vl(i),{store:m}=BD(),h=m.useState(`isActive`,d.index),g=m.useState(`itemProps`),{getItemProps:_,itemRef:v}=GD({closeOnClick:c,disabled:s,highlighted:h,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:WD});return Hn(`div`,e,{state:{disabled:s,highlighted:h},props:[g,u,_],ref:[v,t,d.ref]})}),ZD=z.createContext(void 0);function QD(e){let t=z.useContext(ZD);if(t===void 0&&!e)throw Error(hn(69));return t}var $D={..._l,...mc},eO=z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=BD(),{side:c,align:l}=RD(),u=QD(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`activeTriggerElement`),w=_.type===`context-menu`;gc({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),z.useEffect(()=>{function e(e){s.setOpen(!1,Ur(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]);let T=s.useState(`hoverEnabled`),E=s.useState(`disabled`);Ic(b,{enabled:T&&!E&&!w&&_.type!==`menubar`,closeDelay:S});let D={transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},O=z.useCallback(e=>{s.set(`popupElement`,e)},[s]),k=Hn(`div`,e,{state:D,ref:[t,s.context.popupRef,O],stateAttributesMapping:$D,props:[p,{onKeyDown(e){u&&PE.has(e.key)&&e.stopPropagation()}},Al(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||w;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),(0,U.jsx)(wo,{context:b,modal:w,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:C,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),tO=z.createContext(void 0);function nO(){let e=z.useContext(tO);if(e===void 0)throw Error(hn(32));return e}var rO=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=BD();return i.useState(`mounted`)||n?(0,U.jsx)(tO.Provider,{value:n,children:(0,U.jsx)(ro,{ref:t,...r})}):null});function iO(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=B(i),o=z.useRef(0),s=Gt(oO).current,c=Gt(aO).current,[l,u]=z.useState(0),d=z.useRef(l),f=B((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=B(e=>{c.delete(e),d.current+=1,u(d.current)}),m=z.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(sO).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);V(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),V(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),V(()=>()=>{n.current=[]},[n]),V(()=>()=>{r&&(r.current=[])},[r]);let h=B(e=>(s.add(e),()=>{s.delete(e)}));V(()=>{s.forEach(e=>e(m))},[s,m]);let g=z.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,U.jsx)(KD.Provider,{value:g,children:t})}function aO(){return new Map}function oO(){return new Set}function sO(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var cO=20;function lO(e,t,n,r){let[i,a]=z.useState(!1);V(()=>{if(!e||!t||n==null){a(!1);return}let r=ti(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-cO)},[e,t,n]),qE(e&&(!t||i),r)}var uO=z.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=zn,style:g,..._}=e,{store:v}=BD(),y=nO(),b=HD(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`hasViewport`),ee=v.useState(`lastOpenChangeReason`),N=v.useState(`floatingNodeId`),P=v.useState(`floatingParentNodeId`),F=S.useState(`domReferenceElement`),te=z.useRef(null),I=hc(A,!1,!1),ne=n,re=c,ie=l,L=s,ae=h;x.type===`context-menu`&&(ne=n??x.context?.anchor,L??=`start`,!o&&L!==`center`&&(ie=e.alignOffset??2,re=e.sideOffset??-5));let R=o,oe=L;x.type===`menu`?(R??=`inline-end`,oe??=`start`,ae=e.collisionAvoidance??Bn):x.type===`menubar`&&(R??=`bottom`,oe??=`start`);let se=x.type===`context-menu`,ce=Ol({anchor:ne,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:R,sideOffset:re,align:oe,alignOffset:ie,arrowPadding:se?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:N,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:ae,shiftCrossAxis:se&&!(`side`in ae&&ae.side===`flip`),externalTree:C,adaptiveOrigin:M?Tl:void 0});z.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===N&&v.set(`hoverEnabled`,!1),e.nodeId!==N&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,Ur(Br)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,N]),z.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,Ur(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let le=ar();z.useEffect(()=>{T||le.clear()},[T,le]),z.useEffect(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`)))if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?le.isStarted()||le.start(e,()=>{v.setOpen(!1,Ur(Br))}):v.setOpen(!1,Ur(Br))}else le.clear()}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,le]),z.useEffect(()=>{let e={open:T,nodeId:N,parentNodeId:P,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,N,P]),V(()=>{let e=F,t=te.current;if(e&&(te.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return I(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[F,I,v]);let ue={open:T,side:ce.side,align:ce.align,anchorHidden:ce.anchorHidden,nested:x.type===`menu`,instant:j},de=x.type===`menubar`&&x.context.modal;lO(T&&(de||E&&ee!==`trigger-hover`),D===`touch`,A,O);let fe=jl(e,ue,{styles:ce.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),pe=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&ee!==`trigger-hover`||x.type===`menubar`&&x.context.modal),me=null;return x.type===`menubar`?me=x.context.contentElement:x.type===void 0&&(me=O),(0,U.jsxs)(LD.Provider,{value:ce,children:[pe&&(0,U.jsx)(LE,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:Ml(!T),cutout:me}),(0,U.jsx)(fo,{id:N,children:(0,U.jsx)(iO,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:fe})})]})}),dO=z.createContext(null);function fO(e){let t=z.useContext(dO);if(t===null&&!e)throw Error(hn(5));return t}var pO={...Tc,disabled:W(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:W(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),openMethod:W(e=>e.openMethod),allowMouseEnter:W(e=>e.allowMouseEnter),stickIfOpen:W(e=>e.stickIfOpen),parent:W(e=>e.parent),rootId:W(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:W(e=>e.activeIndex),isActive:W((e,t)=>e.activeIndex===t),hoverEnabled:W(e=>e.hoverEnabled),instantType:W(e=>e.instantType),lastOpenChangeReason:W(e=>e.openChangeReason),floatingTreeRoot:W(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:W(e=>e.floatingNodeId),floatingParentNodeId:W(e=>e.floatingParentNodeId),itemProps:W(e=>e.itemProps),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport),keyboardEventRelay:W(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},mO=class e extends sc{constructor(e){super({...hO(),...e},{positionerRef:z.createRef(),popupRef:z.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:z.createRef(),beforeContentFocusGuardRef:z.createRef(),onOpenChangeComplete:void 0,triggerElements:new xc},pO),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);t===i&&n===a&&r===o||(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=Gt(()=>new e(n)).current;return t??r}unsubscribeParentListener=null};function hO(){return{...Cc(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ao,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:In,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}var gO=z.createContext(void 0);function _O(){return z.useContext(gO)}var vO=Xs(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=HD(!0),_=BD(!0),v=fO(!0),y=_O(),b=z.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=mO.useStore(f?.store,{open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b});er(()=>{n===void 0&&x.state.open===!1&&a===!0&&x.update({open:!0,activeTriggerId:m})}),x.useControlledProp(`openProp`,n),x.useControlledProp(`triggerIdProp`,p),x.useContextCallback(`onOpenChangeComplete`,i);let S=x.useState(`floatingTreeRoot`),C=uo(S),w=co();V(()=>{g&&!_?x.update({parent:{type:`context-menu`,context:g},floatingNodeId:C,floatingParentNodeId:w}):_&&x.update({floatingNodeId:C,floatingParentNodeId:w})},[g,_,C,w,x]);let T=x.useState(`open`),E=x.useState(`activeTriggerElement`),D=x.useState(`positionerElement`),O=x.useState(`hoverEnabled`),k=x.useState(`disabled`),A=x.useState(`lastOpenChangeReason`),j=x.useState(`parent`),M=x.useState(`activeIndex`),ee=x.useState(`payload`),N=x.useState(`floatingParentNodeId`),P=z.useRef(null),F=N!=null,{openMethod:te,triggerProps:I}=XE(T);x.useSyncedValues({disabled:o,modal:j.type===void 0?s:void 0,openMethod:te,rootId:Qa()}),yc(x);let{forceUnmount:ne}=bc(T,x,()=>{x.update({allowMouseEnter:!1,stickIfOpen:!0})}),re=z.useRef(j.type!==`context-menu`),ie=ar();z.useEffect(()=>{if(T||(P.current=null),j.type===`context-menu`){if(!T){ie.clear(),re.current=!1;return}ie.start(500,()=>{re.current=!0})}},[ie,T,j.type]),V(()=>{!T&&!O&&x.set(`hoverEnabled`,!0)},[T,O,x]);let L=z.useRef(!0),ae=ar(),R=B((e,t)=>{let n=t.reason;if(T===e&&t.trigger===E&&A===n||(t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=E??void 0),r?.(e,t),t.isCanceled))return;x.state.floatingRootContext.dispatchOpenChange(e,t);let i=t.event;if(e===!1&&i?.type===`click`&&i.pointerType===`touch`&&!L.current)return;if(!e&&M!==null){let e=x.context.itemDomElements.current[M];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===`trigger-focus`?(L.current=!1,ae.start(300,()=>{L.current=!0})):(L.current=!0,ae.clear());let a=(n===`trigger-press`||n===`item-press`)&&i.detail===0&&i?.isTrusted,o=!e&&(n===`escape-key`||n==null),s={open:e,openChangeReason:n};P.current=t.event??null;let c=t.trigger?.id??null;(c||e)&&(s.activeTriggerId=c,s.activeTriggerElement=t.trigger??null),x.update(s),j.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?x.set(`instantType`,`group`):a||o?x.set(`instantType`,a?`click`:`dismiss`):x.set(`instantType`,void 0)}),oe=z.useCallback(e=>{let t=Ur(e);return t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},t},[x]),se=z.useCallback(()=>{x.setOpen(!1,oe(Hr))},[x,oe]);z.useImperativeHandle(u,()=>({unmount:ne,close:se}),[ne,se]);let ce;j.type===`context-menu`&&(ce=j.context),z.useImperativeHandle(ce?.positionerRef,()=>D,[D]),z.useImperativeHandle(ce?.actionsRef,()=>({setOpen:R}),[R]);let le=Oc({popupStore:x,onOpenChange:R}),ue=le.context.events;z.useEffect(()=>{let e=({open:e,eventDetails:t})=>R(e,t);return ue.on(`setOpen`,e),()=>{ue?.off(`setOpen`,e)}},[ue,R]);let de=Mo(le,{enabled:!k,bubbles:{escapeKey:d&&j.type===`menu`},outsidePress(){return j.type!==`context-menu`||P.current?.type===`contextmenu`?!0:re.current},externalTree:F?S:void 0}),fe=Zc(le,{role:`menu`}),pe=bl(),me=z.useCallback(e=>{x.select(`activeIndex`)!==e&&x.set(`activeIndex`,e)},[x]),he=Yc(le,{enabled:!k,listRef:x.context.itemDomElements,activeIndex:M,nested:j.type!==void 0,loopFocus:c,orientation:l,parentOrientation:j.type===`menubar`?j.context.orientation:void 0,rtl:pe===`rtl`,disabledIndices:Fn,onNavigate:me,openOnArrowKeyDown:j.type!==`context-menu`,externalTree:F?S:void 0,focusItemOnHover:h}),ge=z.useCallback(e=>{x.context.typingRef.current=e},[x]),{getReferenceProps:_e,getFloatingProps:ve,getItemProps:ye,getTriggerProps:be}=zc([de,fe,he,Qc(le,{listRef:x.context.itemLabels,elementsRef:x.context.itemDomElements,activeIndex:M,resetMs:500,onMatch:e=>{T&&e!==M&&x.set(`activeIndex`,e)},onTypingChange:ge})]),xe=z.useMemo(()=>{let e=$t(_e(),{onMouseMove(){x.set(`allowMouseEnter`,!0)}},I);return delete e.role,e},[_e,x,I]),Se=z.useMemo(()=>{let e=be();if(!e)return e;let t=$t(e,I);return delete t.role,delete t[`aria-controls`],t},[be,I]),Ce=z.useMemo(()=>ve({onMouseMove(){x.set(`allowMouseEnter`,!0),j.type===`menu`&&x.set(`hoverEnabled`,!1)},onClick(){x.select(`hoverEnabled`)&&x.set(`hoverEnabled`,!1)},onKeyDown(e){let t=x.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}}),[ve,j.type,x]),we=z.useMemo(()=>ye(),[ye]);x.useSyncedValues({floatingRootContext:le,activeTriggerProps:xe,inactiveTriggerProps:Se,popupProps:Ce,itemProps:we});let Te=z.useMemo(()=>({store:x,parent:b}),[x,b]),Ee=(0,U.jsx)(zD.Provider,{value:Te,children:typeof t==`function`?t({payload:ee}):t});return j.type===void 0||j.type===`context-menu`?(0,U.jsx)(po,{externalTree:S,children:Ee}):Ee});function yO(e){let t=e.getBoundingClientRect(),n=xt(e),r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function bO(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=_n(),{ref:i,index:a}=YD(e),o=n===a,s=z.useRef(null),c=Sn(i,s);return{compositeProps:z.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}function xO(e){let{render:t,className:n,style:r,state:i=In,props:a=Fn,refs:o=Fn,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=bO({metadata:s});return Hn(l,e,{state:i,ref:[...o,f],props:[d,...a,u],stateAttributesMapping:c})}function SO(e){if(Tt(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!Lt(e))return SO(Bt(e))}function CO(e,t){let n=z.useRef(null);return{preFocusGuardRef:n,handlePreFocusGuardFocus:B(t=>{He.flushSync(()=>{e.setOpen(!1,Ur(Ir,t.nativeEvent,t.currentTarget))}),Oa(n.current)?.focus()}),handleFocusTargetFocus:B(n=>{let r=e.select(`positionerElement`);if(r&&ka(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{He.flushSync(()=>{e.setOpen(!1,Ur(Ir,n.nativeEvent,n.currentTarget))});let i=Da(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&pi(r,i);){let e=i;if(i=wa(i),i===e)break}i?.focus()}})}}function wO(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=z.useRef(!1);return z.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,ti(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:In,[t,n,r])}var TO=2,EO=Zs(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,openOnHover:s,delay:c=100,closeDelay:l=0,handle:u,payload:d,style:f,...p}=e,m=BD(!0),h=u?.store??m?.store;if(!h)throw Error(hn(85));let g=vl(o),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=z.useRef(null),x=OO(),S=_n(!0),C=lo(),w=z.useMemo(()=>C??new ao,[C]),{registerTrigger:T,isMountedByThisTrigger:E}=vc(g,b,h,{payload:d,closeDelay:l,parent:x,floatingTreeRoot:w,floatingNodeId:uo(w),floatingParentNodeId:co(),keyboardEventRelay:S?.relayKeyboardEvent}),D=x.type===`menubar`,O=h.useState(`disabled`),k=i||O||D&&x.context.disabled,{getButtonProps:A,buttonRef:j}=yn({disabled:k,native:a});z.useEffect(()=>{!y&&x.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,x.type]);let M=z.useRef(null),ee=ar(),N=B(e=>{if(!M.current)return;ee.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(pi(M.current,t)||pi(h.select(`positionerElement`),t)||t===M.current||t!=null&&SO(t)===h.select(`rootId`))return;let n=yO(M.current);e.clientX>=n.left-TO&&e.clientX<=n.right+TO&&e.clientY>=n.top-TO&&e.clientY<=n.bottom+TO||w.events.emit(`close`,{domEvent:e,reason:zr})});z.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&ti(M.current).addEventListener(`mouseup`,N,{once:!0})},[y,N,h]);let P=D&&x.context.hasSubmenuOpen,F=Rc(v,{enabled:(s??P)&&!k&&x.type!==`context-menu`&&(!D||P&&!E),handleClose:ol({blockPointerEvents:!D}),mouseOnly:!0,move:!1,restMs:x.type===void 0?c:void 0,delay:{close:l},triggerElementRef:b,externalTree:w,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),te=DO(y,h.select(`lastOpenChangeReason`)),I=To(v,{enabled:!k&&x.type!==`context-menu`,event:y&&D?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:x.type===void 0?te:!1}),ne=Ac(v,{enabled:!k&&P}),re=wO({open:y,enabled:D,mouseDownAction:`open`}),ie=zc([I,ne]),L={disabled:k,open:y},ae=h.useState(`triggerProps`,E),R=[M,t,j,T,b],oe=[ie.getReferenceProps(),F??In,ae,{"aria-haspopup":`menu`,id:g,onMouseDown:e=>{h.select(`open`)||(ee.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),ti(e.currentTarget).addEventListener(`mouseup`,N,{once:!0}))}},D?{role:`menuitem`}:{},re,p,A],{preFocusGuardRef:se,handlePreFocusGuardFocus:ce,handleFocusTargetFocus:le}=CO(h,b),ue=Hn(`button`,e,{enabled:!D,stateAttributesMapping:gl,state:L,ref:R,props:oe});return D?(0,U.jsx)(xO,{tag:`button`,render:n,className:r,style:f,state:L,refs:R,props:oe,stateAttributesMapping:gl}):y?(0,U.jsxs)(z.Fragment,{children:[(0,U.jsx)(ai,{ref:se,onFocus:ce},`${g}-pre-focus-guard`),(0,U.jsx)(z.Fragment,{children:ue},g),(0,U.jsx)(ai,{ref:h.context.triggerFocusTargetRef,onFocus:le},`${g}-post-focus-guard`)]}):(0,U.jsx)(z.Fragment,{children:ue},g)});function DO(e,t){let n=ar(),[r,i]=z.useState(!1);return V(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function OO(){let e=HD(!0),t=BD(!0),n=fO(!0);return z.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}function kO({...e}){return(0,U.jsx)(vO,{"data-slot":`dropdown-menu`,...e})}function AO({...e}){return(0,U.jsx)(EO,{"data-slot":`dropdown-menu-trigger`,...e})}function jO({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,U.jsx)(rO,{children:(0,U.jsx)(uO,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,U.jsx)(eO,{"data-slot":`dropdown-menu-content`,className:H(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function MO({className:e,inset:t,variant:n=`default`,...r}){return(0,U.jsx)(XD,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:H(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function NO(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function PO(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function FO(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function IO(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(FO(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function LO(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?PO(e.value):PO(e)}W(e=>e.id),W(e=>e.labelId),W(e=>e.modal),W(e=>e.multiple),W(e=>e.items),W(e=>e.itemToStringLabel),W(e=>e.itemToStringValue),W(e=>e.isItemEqualToValue),W(e=>e.value),W(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:LO(t,r)!==``}),W((e,t)=>t?IO(e.items):!1),W(e=>e.open),W(e=>e.mounted),W(e=>e.forceMount),W(e=>e.transitionStatus),W(e=>e.openMethod),W(e=>e.activeIndex),W(e=>e.selectedIndex),W((e,t)=>e.activeIndex===t),W((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>NO(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:NO(n,i,r)}),W((e,t)=>e.selectedIndex===t),W(e=>e.popupProps),W(e=>e.triggerProps),W(e=>e.triggerElement),W(e=>e.positionerElement),W(e=>e.listElement),W(e=>e.scrollUpArrowVisible),W(e=>e.scrollDownArrowVisible),W(e=>e.hasScrollArrows);function RO({className:e,...t}){return(0,U.jsx)(iu,{role:`status`,"aria-label":`Loading`,className:H(`size-4 animate-spin`,e),...t})}var zO=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,BO=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=zO[n[e]&63];return t},VO=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}},HO=(0,z.createContext)(null),UO=(0,z.createContext)(null),WO=()=>(0,z.useContext)(HO),GO=()=>(0,z.useContext)(UO),KO=(0,z.createContext)(null),qO=()=>{let e=GO(),t=(0,z.useContext)(KO)??e;if(!t)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return t},JO=(0,z.createContext)(null),YO=({label:e=`Add photos or files`,...t})=>{let n=qO(),r=(0,z.useCallback)(()=>{n.openFileDialog()},[n]);return(0,U.jsxs)(MO,{...t,closeOnClick:!1,onClick:r,children:[(0,U.jsx)(nu,{className:`mr-2 size-4`}),` `,e]})},XO=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:o,onError:s,onSubmit:c,children:l,...u})=>{let d=WO(),f=!!d,p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)([]),_=f?d.attachments.files:h,[v,y]=(0,z.useState)([]),b=(0,z.useRef)(_);(0,z.useEffect)(()=>{b.current=_},[_]);let x=(0,z.useCallback)(()=>{p.current?.click()},[]),S=(0,z.useCallback)(e=>!t||t.trim()===``?!0: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,z.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:!0);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:BO(),mediaType:e.type,type:`file`,url:URL.createObjectURL(e)});return[...e,...i]})},[S,a,o,s]),w=(0,z.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,z.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:!0);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,z.useCallback)(()=>f?d?.attachments.clear():g(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[f,d]),D=(0,z.useCallback)(()=>y([]),[]),O=f?T:C,k=f?d.attachments.remove:w,A=f?d.attachments.openFileDialog:x,j=(0,z.useCallback)(()=>{E(),D()},[E,D]);(0,z.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,z.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value=``)},[_,i]),(0,z.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&&O(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[O,r]),(0,z.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&&O(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[O,r]),(0,z.useEffect)(()=>()=>{if(!f)for(let e of b.current)e.url&&URL.revokeObjectURL(e.url)},[f]);let M=(0,z.useCallback)(e=>{e.currentTarget.files&&O(e.currentTarget.files),e.currentTarget.value=``},[O]),ee=(0,z.useMemo)(()=>({add:O,clear:E,fileInputRef:p,files:_.map(e=>({...e,id:e.id})),openFileDialog:A,remove:k}),[_,O,k,E,A]),N=(0,z.useMemo)(()=>({add:e=>{let t=Array.isArray(e)?e:[e];y(e=>[...e,...t.map(e=>({...e,id:BO()}))])},clear:D,remove:e=>{y(t=>t.filter(t=>t.id!==e))},sources:v}),[v,D]),P=(0,z.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,...t})=>{if(t.url?.startsWith(`blob:`)){let e=await VO(t.url);return{...t,url:e??t.url}}return t})),text:n},e);if(t instanceof Promise)try{await t,j(),f&&d.textInput.clear()}catch{}else j(),f&&d.textInput.clear()}catch{}},[f,d,_,c,j]),F=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{accept:t,"aria-label":`Upload files`,className:`hidden`,multiple:n,onChange:M,ref:p,title:`Upload files`,type:`file`}),(0,U.jsx)(`form`,{className:H(`w-full`,e),onSubmit:P,ref:m,...u,children:(0,U.jsx)(jD,{className:`overflow-hidden`,children:l})})]}),te=(0,U.jsx)(JO.Provider,{value:N,children:F});return(0,U.jsx)(KO.Provider,{value:ee,children:te})},ZO=({className:e,...t})=>(0,U.jsx)(`div`,{className:H(`contents`,e),...t}),QO=({onChange:e,onKeyDown:t,className:n,placeholder:r=`What would you like to know?`,...i})=>{let a=WO(),o=qO(),[s,c]=(0,z.useState)(!1),l=(0,z.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,z.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,z.useCallback)(()=>c(!1),[]),f=(0,z.useCallback)(()=>c(!0),[]),p=a?{onChange:t=>{a.textInput.setInput(t.currentTarget.value),e?.(t)},value:a.textInput.value}:{onChange:e};return(0,U.jsx)(ID,{className:H(`field-sizing-content max-h-48 min-h-16`,n),name:`message`,onCompositionEnd:d,onCompositionStart:f,onKeyDown:l,onPaste:u,placeholder:r,...i,...p})},$O=({className:e,...t})=>(0,U.jsx)(ND,{align:`block-end`,className:H(`order-first flex-wrap gap-1`,e),...t}),ek=({className:e,...t})=>(0,U.jsx)(ND,{align:`block-end`,className:H(`justify-between gap-1`,e),...t}),tk=({className:e,...t})=>(0,U.jsx)(`div`,{className:H(`flex min-w-0 items-center gap-1`,e),...t}),nk=({variant:e=`ghost`,className:t,size:n,tooltip:r,...i})=>{let a=n??(z.Children.count(i.children)>1?`sm`:`icon-sm`),o=(0,U.jsx)(FD,{className:H(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,U.jsxs)(yd,{children:[(0,U.jsx)(bd,{children:o}),(0,U.jsxs)(xd,{side:l,children:[s,c&&(0,U.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:c})]})]})},rk=e=>(0,U.jsx)(kO,{...e}),ik=({className:e,children:t,...n})=>(0,U.jsx)(AO,{render:(0,U.jsx)(nk,{className:e,...n}),children:t??(0,U.jsx)(uu,{className:`size-4`})}),ak=({className:e,...t})=>(0,U.jsx)(jO,{align:`start`,className:H(e),...t}),ok=({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,U.jsx)(Zl,{className:`size-4`});r===`submitted`?l=(0,U.jsx)(RO,{}):r===`streaming`?l=(0,U.jsx)(mu,{className:`size-4`}):r===`error`&&(l=(0,U.jsx)(bu,{className:`size-4`}));let u=(0,z.useCallback)(e=>{if(c&&i){e.preventDefault(),i();return}a?.(e)},[c,i,a]);return(0,U.jsx)(FD,{"aria-label":c?`Stop`:`Submit`,className:H(e),onClick:u,size:n,type:c&&i?`button`:`submit`,variant:t,...s,children:o??l})};function sk(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,a=t!==void 0,[o,s]=wD({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:c,setMounted:l,transitionStatus:u}=uc(o,!0,!0),[d,f]=z.useState(o),[{height:p,width:m},h]=z.useState({height:void 0,width:void 0}),g=vl(),[_,v]=z.useState(),y=_??g,[b,x]=z.useState(!1),[S,C]=z.useState(!1),w=z.useRef(null),T=z.useRef(null),E=z.useRef(null),D=z.useRef(null),O=hc(D,!1),k=B(e=>{let t=!o,n=Ur(Ar,e.nativeEvent);if(r(t,n),n.isCanceled)return;let i=D.current;T.current===`css-animation`&&i!=null&&i.style.removeProperty(`animation-name`),!b&&!S&&(T.current!=null&&T.current!==`css-animation`&&!c&&t&&l(!0),T.current===`css-animation`&&(!d&&t&&f(!0),!c&&t&&l(!0))),s(t),T.current===`none`&&c&&!t&&l(!1)});return V(()=>{a&&T.current===`none`&&!o&&l(!1)},[a,o,t,l]),z.useMemo(()=>({abortControllerRef:w,animationTypeRef:T,disabled:i,handleTrigger:k,height:p,mounted:c,open:o,panelId:y,panelRef:D,runOnceAnimationsFinish:O,setDimensions:h,setHiddenUntilFound:x,setKeepMounted:C,setMounted:l,setOpen:s,setPanelIdState:v,setVisible:f,transitionDimensionRef:E,transitionStatus:u,visible:d,width:m}),[w,T,i,k,p,c,o,y,D,O,h,x,C,l,s,f,E,u,d,m])}var ck=z.createContext(void 0);function lk(){let e=z.useContext(ck);if(e===void 0)throw Error(hn(15));return e}var uk=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=dc.startingStyle]=`startingStyle`,e[e.endingStyle=dc.endingStyle]=`endingStyle`,e}({}),dk=function(e){return e.panelOpen=`data-panel-open`,e}({}),fk={[uk.open]:``},pk={[uk.closed]:``},mk={open(e){return e?{[dk.panelOpen]:``}:null}},hk={open(e){return e?fk:pk},...mc},gk=z.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=B(o),d=sk({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=z.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=z.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=Hn(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:hk});return(0,U.jsx)(ck.Provider,{value:p,children:m})}),_k={...mk,...mc},vk=z.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=lk(),{className:s,disabled:c=o,id:l,render:u,nativeButton:d=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=yn({disabled:c,focusableWhenDisabled:!0,native:d}),g=z.useMemo(()=>({"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i}),[n,r,i]);return Hn(`button`,e,{state:a,ref:[t,h],props:[g,p,m],stateAttributesMapping:_k})}),yk=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e}({});function bk(e){let{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:i,hiddenUntilFound:a,keepMounted:o,id:s,mounted:c,onOpenChange:l,open:u,panelRef:d,runOnceAnimationsFinish:f,setDimensions:p,setMounted:m,setOpen:h,setVisible:g,transitionDimensionRef:_,visible:v,width:y}=e,b=z.useRef(!1),x=z.useRef(null),S=z.useRef(u),C=z.useRef(u),w=ei(),T=z.useMemo(()=>n.current===`css-animation`?!v:!u&&!c,[u,c,v,n]),E=Sn(r,d,B(e=>{if(!e)return;if(n.current==null||_.current==null){let t=getComputedStyle(e),r=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;r&&i||(t.animationName===`none`&&t.transitionDuration!==`0s`?n.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?n.current=`css-animation`:n.current=`none`),e.getAttribute(yk.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?_.current=`width`:_.current=`height`}if(n.current!==`css-transition`)return;(i===void 0||y===void 0)&&(p({height:e.scrollHeight,width:e.scrollWidth}),C.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,r=-1;return t=$r.request(()=>{C.current=!1,r=$r.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{$r.cancel(t),$r.cancel(r)}}));return V(()=>{if(n.current!==`css-transition`)return;let e=d.current;if(!e)return;let r=-1;if(t.current!=null&&(t.current.abort(),t.current=null),u){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`)}),!C.current&&!o&&e.setAttribute(uk.startingStyle,``),p({height:e.scrollHeight,width:e.scrollWidth}),r=$r.request(()=>{Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;p({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let r=n.signal,i=null,a=uk.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,f(()=>{p({height:0,width:0}),e.style.removeProperty(`content-visibility`),m(!1),t.current===n&&(t.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),w.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{$r.cancel(r)}},[t,n,w,a,o,c,u,d,f,p,m]),V(()=>{if(n.current!==`css-animation`)return;let e=d.current;e&&(x.current=e.style.animationName||x.current,e.style.setProperty(`animation-name`,`none`),p({height:e.scrollHeight,width:e.scrollWidth}),!S.current&&!b.current&&e.style.removeProperty(`animation-name`),u?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),g(!0)):(t.current=new AbortController,f(()=>{m(!1),g(!1),t.current=null},t.current.signal)))},[t,n,u,d,f,p,m,g,v]),nr(()=>{let e=$r.request(()=>{S.current=!1});return()=>$r.cancel(e)}),V(()=>{if(!a)return;let e=d.current;if(!e)return;let t=-1,n=-1;return u&&b.current&&(e.style.transitionDuration=`0s`,p({height:e.scrollHeight,width:e.scrollWidth}),t=$r.request(()=>{b.current=!1,n=$r.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{$r.cancel(t),$r.cancel(n)}},[a,u,d,p]),V(()=>{let e=d.current;e&&a&&T&&(e.setAttribute(`hidden`,`until-found`),n.current===`css-transition`&&e.setAttribute(uk.startingStyle,``))},[a,T,n,d]),z.useEffect(function(){let e=d.current;if(!e)return;function t(e){b.current=!0,h(!0),l(!0,Ur(kr,e))}return qr(e,`beforematch`,t)},[l,d,h]),z.useMemo(()=>({props:{hidden:T,id:s,ref:E}}),[T,s,E])}var xk=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),Sk=z.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{abortControllerRef:l,animationTypeRef:u,height:d,mounted:f,onOpenChange:p,open:m,panelId:h,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setHiddenUntilFound:y,setKeepMounted:b,setMounted:x,setPanelIdState:S,setOpen:C,setVisible:w,state:T,transitionDimensionRef:E,visible:D,width:O,transitionStatus:k}=lk(),A=r??!1,j=i??!1;V(()=>{if(o)return S(o),()=>{S(void 0)}},[o,S]),V(()=>{y(A)},[y,A]),V(()=>{b(j)},[b,j]);let{props:M}=bk({abortControllerRef:l,animationTypeRef:u,externalRef:t,height:d,hiddenUntilFound:A,id:h,keepMounted:j,mounted:f,onOpenChange:p,open:m,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setMounted:x,setOpen:C,setVisible:w,transitionDimensionRef:E,visible:D,width:O});gc({open:m&&k===`idle`,ref:g,onComplete(){m&&v({height:void 0,width:void 0})}});let ee=Hn(`div`,e,{state:z.useMemo(()=>({...T,transitionStatus:k}),[T,k]),ref:[t,g],props:[M,{style:{[xk.collapsiblePanelHeight]:d===void 0?`auto`:`${d}px`,[xk.collapsiblePanelWidth]:O===void 0?`auto`:`${O}px`}},c],stateAttributesMapping:hk});return j||A||f?ee:null});function Ck({...e}){return(0,U.jsx)(gk,{"data-slot":`collapsible`,...e})}function wk({...e}){return(0,U.jsx)(vk,{"data-slot":`collapsible-trigger`,...e})}function Tk({...e}){return(0,U.jsx)(Sk,{"data-slot":`collapsible-content`,...e})}var Ek=(0,z.createContext)({});function Dk(e){let t=(0,z.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ok=typeof window<`u`?z.useLayoutEffect:z.useEffect,kk=(0,z.createContext)(null);function Ak(e,t){e.indexOf(t)===-1&&e.push(t)}function jk(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Mk=(e,t,n)=>n>t?t:n<e?e:n,Nk={},Pk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Fk(e){return typeof e==`object`&&!!e}var Ik=e=>/^0[^.\s]+$/u.test(e);function Lk(e){let t;return()=>(t===void 0&&(t=e()),t)}var Rk=e=>e,zk=(e,t)=>n=>t(e(n)),Bk=(...e)=>e.reduce(zk),Vk=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},Hk=class{constructor(){this.subscriptions=[]}add(e){return Ak(this.subscriptions,e),()=>jk(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}},Uk=e=>e*1e3,Wk=e=>e/1e3;function Gk(e,t){return t?1e3/t*e:0}var Kk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,qk=1e-7,Jk=12;function Yk(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Kk(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>qk&&++s<Jk);return o}function Xk(e,t,n,r){if(e===t&&n===r)return Rk;let i=t=>Yk(t,0,1,e,n);return e=>e===0||e===1?e:Kk(i(e),t,r)}var Zk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Qk=e=>t=>1-e(1-t),$k=Xk(.33,1.53,.69,.99),eA=Qk($k),tA=Zk(eA),nA=e=>e>=1?1:(e*=2)<1?.5*eA(e):.5*(2-2**(-10*(e-1))),rA=e=>1-Math.sin(Math.acos(e)),iA=Qk(rA),aA=Zk(rA),oA=Xk(.42,0,1,1),sA=Xk(0,0,.58,1),cA=Xk(.42,0,.58,1),lA=e=>Array.isArray(e)&&typeof e[0]!=`number`,uA=e=>Array.isArray(e)&&typeof e[0]==`number`,dA={linear:Rk,easeIn:oA,easeInOut:cA,easeOut:sA,circIn:rA,circInOut:aA,circOut:iA,backIn:eA,backInOut:tA,backOut:$k,anticipate:nA},fA=e=>typeof e==`string`,pA=e=>{if(uA(e)){e.length;let[t,n,r,i]=e;return Xk(t,n,r,i)}else if(fA(e))return dA[e],`${e}`,dA[e];return e},mA=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],hA={value:null,addProjectionMetrics:null};function gA(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&hA.value&&hA.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var _A=40;function vA(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=mA.reduce((e,n)=>(e[n]=gA(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Nk.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,_A),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:mA.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<mA.length;t++)o[mA[t]].cancel(e)},state:i,steps:o}}var{schedule:yA,cancel:bA,state:xA,steps:SA}=vA(typeof requestAnimationFrame<`u`?requestAnimationFrame:Rk,!0),CA;function wA(){CA=void 0}var TA={now:()=>(CA===void 0&&TA.set(xA.isProcessing||Nk.useManualTiming?xA.timestamp:performance.now()),CA),set:e=>{CA=e,queueMicrotask(wA)}},EA={layout:0,mainThread:0,waapi:0},DA=e=>t=>typeof t==`string`&&t.startsWith(e),OA=DA(`--`),kA=DA(`var(--`),AA=e=>kA(e)?jA.test(e.split(`/*`)[0].trim()):!1,jA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function MA(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var NA={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},PA={...NA,transform:e=>Mk(0,1,e)},FA={...NA,default:1},IA=e=>Math.round(e*1e5)/1e5,LA=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function RA(e){return e==null}var zA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,BA=(e,t)=>n=>!!(typeof n==`string`&&zA.test(n)&&n.startsWith(e)||t&&!RA(n)&&Object.prototype.hasOwnProperty.call(n,t)),VA=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(LA);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},HA=e=>Mk(0,255,e),UA={...NA,transform:e=>Math.round(HA(e))},WA={test:BA(`rgb`,`red`),parse:VA(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+UA.transform(e)+`, `+UA.transform(t)+`, `+UA.transform(n)+`, `+IA(PA.transform(r))+`)`};function GA(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 KA={test:BA(`#`),parse:GA,transform:WA.transform},qA=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),JA=qA(`deg`),YA=qA(`%`),K=qA(`px`),XA=qA(`vh`),ZA=qA(`vw`),QA={...YA,parse:e=>YA.parse(e)/100,transform:e=>YA.transform(e*100)},$A={test:BA(`hsl`,`hue`),parse:VA(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+YA.transform(IA(t))+`, `+YA.transform(IA(n))+`, `+IA(PA.transform(r))+`)`},ej={test:e=>WA.test(e)||KA.test(e)||$A.test(e),parse:e=>WA.test(e)?WA.parse(e):$A.test(e)?$A.parse(e):KA.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?WA.transform(e):$A.transform(e),getAnimatableNone:e=>{let t=ej.parse(e);return t.alpha=0,ej.transform(t)}},tj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function nj(e){return isNaN(e)&&typeof e==`string`&&(e.match(LA)?.length||0)+(e.match(tj)?.length||0)>0}var rj=`number`,ij=`color`,aj=`var`,oj=`var(`,sj="${}",cj=/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 lj(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(cj,e=>(ej.test(e)?(r.color.push(a),i.push(ij),n.push(ej.parse(e))):e.startsWith(oj)?(r.var.push(a),i.push(aj),n.push(e)):(r.number.push(a),i.push(rj),n.push(parseFloat(e))),++a,sj)).split(sj),indexes:r,types:i}}function uj(e){return lj(e).values}function dj({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];e===rj?i+=IA(r[a]):e===ij?i+=ej.transform(r[a]):i+=r[a]}return i}}function fj(e){return dj(lj(e))}var pj=e=>typeof e==`number`?0:ej.test(e)?ej.getAnimatableNone(e):e,mj=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:pj(e);function hj(e){let t=lj(e);return dj(t)(t.values.map((e,n)=>mj(e,t.split[n])))}var gj={test:nj,parse:uj,createTransformer:fj,getAnimatableNone:hj};function _j(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 vj({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=_j(s,r,e+1/3),a=_j(s,r,e),o=_j(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function yj(e,t){return n=>n>0?t:e}var bj=(e,t,n)=>e+(t-e)*n,xj=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Sj=[KA,WA,$A],Cj=e=>Sj.find(t=>t.test(e));function wj(e){let t=Cj(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===$A&&(n=vj(n)),n}var Tj=(e,t)=>{let n=wj(e),r=wj(t);if(!n||!r)return yj(e,t);let i={...n};return e=>(i.red=xj(n.red,r.red,e),i.green=xj(n.green,r.green,e),i.blue=xj(n.blue,r.blue,e),i.alpha=bj(n.alpha,r.alpha,e),WA.transform(i))},Ej=new Set([`none`,`hidden`]);function Dj(e,t){return Ej.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Oj(e,t){return n=>bj(e,t,n)}function kj(e){return typeof e==`number`?Oj:typeof e==`string`?AA(e)?yj:ej.test(e)?Tj:Nj:Array.isArray(e)?Aj:typeof e==`object`?ej.test(e)?Tj:jj:yj}function Aj(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>kj(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function jj(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=kj(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Mj(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]];n[i]=e.values[o]??0,r[a]++}return n}var Nj=(e,t)=>{let n=gj.createTransformer(t),r=lj(e),i=lj(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?Ej.has(e)&&!i.values.length||Ej.has(t)&&!r.values.length?Dj(e,t):Bk(Aj(Mj(r,i),i.values),n):(`${e}${t}`,yj(e,t))};function Pj(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?bj(e,t,n):kj(e)(e,t)}var Fj=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>yA.update(t,e),stop:()=>bA(t),now:()=>xA.isProcessing?xA.timestamp:TA.now()}},Ij=(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)})`},Lj=2e4;function Rj(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 zj(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Rj(r),Lj);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Wk(i)}}var Bj={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 Vj(e,t){return e*Math.sqrt(1-t*t)}var Hj=12;function Uj(e,t,n){let r=n;for(let n=1;n<Hj;n++)r-=e(r)/t(r);return r}var Wj=.001;function Gj({duration:e=Bj.duration,bounce:t=Bj.bounce,velocity:n=Bj.velocity,mass:r=Bj.mass}){let i,a;Bj.maxDuration;let o=1-t;o=Mk(Bj.minDamping,Bj.maxDamping,o),e=Mk(Bj.minDuration,Bj.maxDuration,Wk(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Vj(t,o),c=Math.exp(-i);return Wj-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=Vj(t**2,o);return(-i(t)+Wj>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-Wj+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Uj(i,a,s);if(e=Uk(e),isNaN(c))return{stiffness:Bj.stiffness,damping:Bj.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Kj=[`duration`,`bounce`],qj=[`stiffness`,`damping`,`mass`];function Jj(e,t){return t.some(t=>e[t]!==void 0)}function Yj(e){let t={velocity:Bj.velocity,stiffness:Bj.stiffness,damping:Bj.damping,mass:Bj.mass,isResolvedFromDuration:!1,...e};if(!Jj(e,qj)&&Jj(e,Kj))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Mk(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Bj.mass,stiffness:i,damping:a}}else{let n=Gj({...e,velocity:0});t={...t,...n,mass:Bj.mass},t.isResolvedFromDuration=!0}return t}function Xj(e=Bj.visualDuration,t=Bj.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}=Yj({...n,velocity:-Wk(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Wk(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?Bj.restSpeed.granular:Bj.restSpeed.default,i||=v?Bj.restDelta.granular:Bj.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Vj(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(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=>Uk(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=Uk(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=Uk(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(Rj(T),Lj),t=Ij(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Xj.applyToOptions=e=>{let t=zj(e,100,Xj);return e.ease=t.ease,e.duration=Uk(t.duration),e.type=`keyframes`,e};var Zj=5;function Qj(e,t,n){let r=Math.max(t-Zj,0);return Gk(n-e(r),t-r)}function $j({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=Xj({keyframes:[f.value,m(f.value)],velocity:Qj(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 eM(e,t,n){let r=[],i=n||Nk.mix||Pj,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Bk(Array.isArray(t)?t[n]||Rk:t,a)),r.push(a)}return r}function tM(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=eM(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=Vk(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Mk(e[0],e[a-1],t)):l}function nM(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Vk(0,t,r);e.push(bj(n,1,i))}}function rM(e){let t=[0];return nM(t,e.length-1),t}function iM(e,t){return e.map(e=>e*t)}function aM(e,t){return e.map(()=>t||cA).splice(0,e.length-1)}function oM({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=lA(r)?r.map(pA):pA(r),a={done:!1,value:t[0]},o=tM(iM(n&&n.length===t.length?n:rM(t),e),t,{ease:Array.isArray(i)?i:aM(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var sM=e=>e!==null;function cM(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(sM),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var lM={decay:$j,inertia:$j,tween:oM,keyframes:oM,spring:Xj};function uM(e){typeof e.type==`string`&&(e.type=lM[e.type])}var dM=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)}},fM=e=>e/100,pM=class extends dM{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!==TA.now()&&this.tick(TA.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},EA.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;uM(e);let{type:t=oM,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||oM;s!==oM&&typeof o[0]!=`number`&&(this.mixKeyframes=Bk(fM,Pj(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=Rj(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.holdTime===null?this.currentTime=t:this.currentTime=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=Mk(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!==$j&&(b.value=cM(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 Wk(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Wk(e)}get time(){return Wk(this.currentTime)}set time(e){e=Uk(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 Qj(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(TA.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Wk(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Fj,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(TA.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,EA.mainThread--}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 mM(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var hM=e=>e*180/Math.PI,gM=e=>vM(hM(Math.atan2(e[1],e[0]))),_M={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gM,rotateZ:gM,skewX:e=>hM(Math.atan(e[1])),skewY:e=>hM(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vM=e=>(e%=360,e<0&&(e+=360),e),yM=gM,bM=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xM=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),SM={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bM,scaleY:xM,scale:e=>(bM(e)+xM(e))/2,rotateX:e=>vM(hM(Math.atan2(e[6],e[5]))),rotateY:e=>vM(hM(Math.atan2(-e[2],e[0]))),rotateZ:yM,rotate:yM,skewX:e=>hM(Math.atan(e[4])),skewY:e=>hM(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function CM(e){return+!!e.includes(`scale`)}function wM(e,t){if(!e||e===`none`)return CM(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=SM,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_M,i=t}if(!i)return CM(t);let a=r[t],o=i[1].split(`,`).map(EM);return typeof a==`function`?a(o):o[a]}var TM=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return wM(n,t)};function EM(e){return parseFloat(e.trim())}var DM=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],OM=new Set(DM),kM=e=>e===NA||e===K,AM=new Set([`x`,`y`,`z`]),jM=DM.filter(e=>!AM.has(e));function MM(e){let t=[];return jM.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var NM={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})=>wM(t,`x`),y:(e,{transform:t})=>wM(t,`y`)};NM.translateX=NM.x,NM.translateY=NM.y;var PM=new Set,FM=!1,IM=!1,LM=!1;function RM(){if(IM){let e=Array.from(PM).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=MM(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)})}IM=!1,FM=!1,PM.forEach(e=>e.complete(LM)),PM.clear()}function zM(){PM.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(IM=!0)})}function BM(){LM=!0,zM(),RM(),LM=!1}var VM=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?(PM.add(this),FM||(FM=!0,yA.read(zM),yA.resolveKeyframes(RM))):(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])}mM(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),PM.delete(this)}cancel(){this.state===`scheduled`&&(PM.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},HM=e=>e.startsWith(`--`);function UM(e,t,n){HM(t)?e.style.setProperty(t,n):e.style[t]=n}var WM={};function GM(e,t){let n=Lk(e);return()=>WM[t]??n()}var KM=GM(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),qM=GM(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),JM=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,YM={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:JM([0,.65,.55,1]),circOut:JM([.55,0,1,.45]),backIn:JM([.31,.01,.66,-.59]),backOut:JM([.33,1.53,.69,.99])};function XM(e,t){if(e)return typeof e==`function`?qM()?Ij(e,t):`ease-out`:uA(e)?JM(e):Array.isArray(e)?e.map(e=>XM(e,t)||YM.easeOut):YM[e]}function ZM(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=XM(s,i);Array.isArray(d)&&(u.easing=d),hA.value&&EA.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return hA.value&&p.finished.finally(()=>{EA.waapi--}),p}function QM(e){return typeof e==`function`&&`applyToOptions`in e}function $M({type:e,...t}){return QM(e)&&qM()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var eN=class extends dM{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=$M(e);this.animation=ZM(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=cM(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),UM(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 Wk(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Wk(e)}get time(){return Wk(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Uk(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&&KM()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Rk):r(this)}},tN={anticipate:nA,backInOut:tA,circInOut:aA};function nN(e){return e in tN}function rN(e){typeof e.ease==`string`&&nN(e.ease)&&(e.ease=tN[e.ease])}var iN=10,aN=class extends eN{constructor(e){rN(e),uM(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 pM({...a,autoplay:!1}),s=Math.max(iN,TA.now()-this.startTime),c=Mk(0,iN,s-iN),l=o.sample(s).value,{name:u}=this.options;i&&u&&UM(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},oN=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(gj.test(e)||e===`0`)&&!e.startsWith(`url(`));function sN(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 cN(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=oN(i,t),s=oN(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:sN(e)||(n===`spring`||QM(n))&&r}function lN(e){e.duration=0,e.type=`keyframes`}var uN=new Set([`opacity`,`clipPath`,`filter`,`transform`]),dN=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function fN(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&dN.test(e[t]))return!0;return!1}var pN=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),mN=Lk(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function hN(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return mN()&&n&&(uN.has(n)||pN.has(n)&&fN(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var gN=40,_N=class extends dM{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=TA.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||VM)(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=TA.now();let u=!0;cN(e,i,a,o)||(u=!1,(Nk.instantAnimations||!s)&&l?.(cM(e,n,t)),e[0]=e[e.length-1],lN(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>gN?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&hN(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new aN({...d,element:p})}catch{m=new pM(d)}else m=new pM(d);m.finished.then(()=>{this.notifyFinished()}).catch(Rk),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(),BM()),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 vN(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 yN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bN(e){let t=yN.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function xN(e,t,n=1){`${e}`;let[r,i]=bN(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Pk(e)?parseFloat(e):e}return AA(i)?xN(i,t,n+1):i}var SN={type:`spring`,stiffness:500,damping:25,restSpeed:10},CN=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),wN={type:`keyframes`,duration:.8},TN={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},EN=(e,{keyframes:t})=>t.length>2?wN:OM.has(e)?e.startsWith(`scale`)?CN(t[1]):SN:TN;function DN(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function ON(e,t){let n=e?.[t]??e?.default??e;return n===e?n:DN(n,e)}var kN=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function AN(e){for(let t in e)if(!kN.has(t))return!0;return!1}var jN=(e,t,n,r={},i,a)=>o=>{let s=ON(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Uk(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};AN(s)||Object.assign(u,EN(e,u)),u.duration&&=Uk(u.duration),u.repeatDelay&&=Uk(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(lN(u),u.delay===0&&(d=!0)),(Nk.instantAnimations||Nk.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,lN(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=cM(u.keyframes,s);if(e!==void 0){yA.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new pM(u):new _N(u)};function MN(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function NN(e,t,n,r){if(typeof t==`function`){let[i,a]=MN(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]=MN(r);t=t(n===void 0?e.custom:n,i,a)}return t}function PN(e,t,n){let r=e.getProps();return NN(r,t,n===void 0?r.custom:n,e)}var FN=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...DM]),IN=30,LN=e=>!isNaN(parseFloat(e)),RN={current:void 0},zN=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=TA.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=TA.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=LN(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 Hk);let n=this.events[e].add(t);return e===`change`?()=>{n(),yA.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 RN.current&&RN.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=TA.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>IN)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,IN);return Gk(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 BN(e,t){return new zN(e,t)}var VN=e=>Array.isArray(e);function HN(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,BN(n))}function UN(e){return VN(e)?e[e.length-1]||0:e}function WN(e,t){let{transitionEnd:n={},transition:r={},...i}=PN(e,t)||{};i={...i,...n};for(let t in i)HN(e,t,UN(i[t]))}var GN=e=>!!(e&&e.getVelocity);function KN(e){return!!(GN(e)&&e.add)}function qN(e,t){let n=e.getValue(`willChange`);if(KN(n))return n.add(t);if(!n&&Nk.WillChange){let n=new Nk.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function JN(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var YN=`data-`+JN(`framerAppearId`);function XN(e){return e.props[YN]}function ZN({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function QN(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?DN(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&ZN(d,t))continue;let o={delay:n,...ON(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){yA.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=XN(e);if(n){let e=window.MotionHandoffAnimation(n,t,yA);e!==null&&(o.startTime=e,f=!0)}}qN(e,t);let p=l??e.shouldReduceMotion;r.start(jN(t,r,i,p&&FN.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>yA.update(()=>{o&&WN(e,o)});u.length?Promise.all(u).then(t):t()}return u}function $N(e,t,n={}){let r=PN(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(QN(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return eP(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())}else return Promise.all([a(),o(n.delay)])}function eP(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($N(c,t,{...o,delay:n+(typeof r==`function`?0:r)+vN(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function tP(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>$N(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=$N(e,t,n);else{let i=typeof t==`function`?PN(e,t,n.custom):t;r=Promise.all(QN(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var nP={test:e=>e===`auto`,parse:e=>e},rP=e=>t=>t.test(e),iP=[NA,K,YA,JA,ZA,XA,nP],aP=e=>iP.find(rP(e));function oP(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||Ik(e)}var sP=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function cP(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(LA)||[];if(!r)return e;let i=n.replace(r,``),a=+!!sP.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var lP=/\b([a-z-]*)\(.*?\)/gu,uP={...gj,getAnimatableNone:e=>{let t=e.match(lP);return t?t.map(cP).join(` `):e}},dP={...gj,getAnimatableNone:e=>{let t=gj.parse(e);return gj.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},fP={...NA,transform:Math.round},pP={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,top:K,right:K,bottom:K,left:K,inset:K,insetBlock:K,insetBlockStart:K,insetBlockEnd:K,insetInline:K,insetInlineStart:K,insetInlineEnd:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,paddingBlock:K,paddingBlockStart:K,paddingBlockEnd:K,paddingInline:K,paddingInlineStart:K,paddingInlineEnd:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,marginBlock:K,marginBlockStart:K,marginBlockEnd:K,marginInline:K,marginInlineStart:K,marginInlineEnd:K,fontSize:K,backgroundPositionX:K,backgroundPositionY:K,rotate:JA,rotateX:JA,rotateY:JA,rotateZ:JA,scale:FA,scaleX:FA,scaleY:FA,scaleZ:FA,skew:JA,skewX:JA,skewY:JA,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:PA,originX:QA,originY:QA,originZ:K,zIndex:fP,fillOpacity:PA,strokeOpacity:PA,numOctaves:fP},mP={...pP,color:ej,backgroundColor:ej,outlineColor:ej,fill:ej,stroke:ej,borderColor:ej,borderTopColor:ej,borderRightColor:ej,borderBottomColor:ej,borderLeftColor:ej,filter:uP,WebkitFilter:uP,mask:dP,WebkitMask:dP},hP=e=>mP[e],gP=new Set([uP,dP]);function _P(e,t){let n=hP(e);return gP.has(n)||(n=gj),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var vP=new Set([`auto`,`none`,`0`]);function yP(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!vP.has(t)&&lj(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=_P(n,i)}var bP=class extends VM{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(),AA(r))){let i=xN(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!FN.has(n)||e.length!==2)return;let[r,i]=e,a=aP(r),o=aP(i);if(MA(r)!==MA(i)&&NM[n]){this.needsMeasurement=!0;return}if(a!==o)if(kM(a)&&kM(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else NM[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||oP(e[t]))&&n.push(t);n.length&&yP(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=NM[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]=NM[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()}};function xP(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 SP=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function CP(e){return Fk(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:wP,cancel:TP}=vA(queueMicrotask,!1),EP={x:!1,y:!1};function DP(){return EP.x||EP.y}function OP(e){return e===`x`||e===`y`?EP[e]?null:(EP[e]=!0,()=>{EP[e]=!1}):EP.x||EP.y?null:(EP.x=EP.y=!0,()=>{EP.x=EP.y=!1})}function kP(e,t){let n=xP(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function AP(e){return!(e.pointerType===`touch`||DP())}function jP(e,t,n={}){let[r,i,a]=kP(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(!AP(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 MP=(e,t)=>t?e===t?!0:MP(e,t.parentElement):!1,NP=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,PP=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function FP(e){return PP.has(e.tagName)||e.isContentEditable===!0}var IP=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function LP(e){return IP.has(e.tagName)||e.isContentEditable===!0}var RP=new WeakSet;function zP(e){return t=>{t.key===`Enter`&&e(t)}}function BP(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var VP=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=zP(()=>{if(RP.has(n))return;BP(n,`down`);let e=zP(()=>{BP(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>BP(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function HP(e){return NP(e)&&!DP()}var UP=new WeakSet;function WP(e,t,n={}){let[r,i,a]=kP(e,n),o=e=>{let r=e.currentTarget;if(!HP(e)||UP.has(e))return;RP.add(r),n.stopPropagation&&UP.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),RP.has(r)&&RP.delete(r),HP(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||MP(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),CP(e)&&(e.addEventListener(`focus`,e=>VP(e,i)),!FP(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function GP(e){return Fk(e)&&`ownerSVGElement`in e}var KP=new WeakMap,qP,JP=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:GP(r)&&`getBBox`in r?r.getBBox()[t]:r[n],YP=JP(`inline`,`width`,`offsetWidth`),XP=JP(`block`,`height`,`offsetHeight`);function ZP({target:e,borderBoxSize:t}){KP.get(e)?.forEach(n=>{n(e,{get width(){return YP(e,t)},get height(){return XP(e,t)}})})}function QP(e){e.forEach(ZP)}function $P(){typeof ResizeObserver>`u`||(qP=new ResizeObserver(QP))}function eF(e,t){qP||$P();let n=xP(e);return n.forEach(e=>{let n=KP.get(e);n||(n=new Set,KP.set(e,n)),n.add(t),qP?.observe(e)}),()=>{n.forEach(e=>{let n=KP.get(e);n?.delete(t),n?.size||qP?.unobserve(e)})}}var tF=new Set,nF;function rF(){nF=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};tF.forEach(t=>t(e))},window.addEventListener(`resize`,nF)}function iF(e){return tF.add(e),nF||rF(),()=>{tF.delete(e),!tF.size&&typeof nF==`function`&&(window.removeEventListener(`resize`,nF),nF=void 0)}}function aF(e,t){return typeof e==`function`?iF(e):eF(e,t)}function oF(e){return GP(e)&&e.tagName===`svg`}var sF=[...iP,ej,gj],cF=e=>sF.find(rP(e)),lF=()=>({translate:0,scale:1,origin:0,originPoint:0}),uF=()=>({x:lF(),y:lF()}),dF=()=>({min:0,max:0}),fF=()=>({x:dF(),y:dF()}),pF=new WeakMap;function mF(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function hF(e){return typeof e==`string`||Array.isArray(e)}var gF=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],_F=[`initial`,...gF];function vF(e){return mF(e.animate)||_F.some(t=>hF(e[t]))}function yF(e){return!!(vF(e)||e.variants)}function bF(e,t,n){for(let r in t){let i=t[r],a=n[r];if(GN(i))e.addValue(r,i);else if(GN(a))e.addValue(r,BN(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,BN(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var xF={current:null},SF={current:!1},CF=typeof window<`u`;function wF(){if(SF.current=!0,CF)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>xF.current=e.matches;e.addEventListener(`change`,t),t()}else xF.current=!1}var TF=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],EF={};function DF(e){EF=e}function OF(){return EF}var kF=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=VM,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=TA.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,yA.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=vF(t),this.isVariantNode=yF(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&&GN(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,pF.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:(SF.current||wF(),this.shouldReduceMotion=xF.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(),bA(this.notifyUpdate),bA(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&&uN.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new eN({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Uk(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=OM.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&yA.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(),t.owner&&t.stop()})}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 EF){let t=EF[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):fF()}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<TF.length;t++){let n=TF[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=bF(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=BN(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`&&(Pk(n)||Ik(n))?n=parseFloat(n):!cF(n)&&gj.test(t)&&(n=_P(e,t)),this.setBaseTarget(e,GN(n)?n.get():n)),GN(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=NN(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&&!GN(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 Hk),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){wP.render(this.render)}},AF=class extends kF{constructor(){super(...arguments),this.KeyframeResolver=bP}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;GN(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},jF=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function MF({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function NF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function PF(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 FF(e){return e===void 0||e===1}function IF({scale:e,scaleX:t,scaleY:n}){return!FF(e)||!FF(t)||!FF(n)}function LF(e){return IF(e)||RF(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function RF(e){return zF(e.x)||zF(e.y)}function zF(e){return e&&e!==`0%`}function BF(e,t,n){return n+t*(e-n)}function VF(e,t,n,r,i){return i!==void 0&&(e=BF(e,i,r)),BF(e,n,r)+t}function HF(e,t=0,n=1,r,i){e.min=VF(e.min,t,n,r,i),e.max=VF(e.max,t,n,r,i)}function UF(e,{x:t,y:n}){HF(e.x,t.translate,t.scale,t.originPoint),HF(e.y,n.translate,n.scale,n.originPoint)}var WF=.999999999999,GF=1.0000000000001;function KF(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&&(qF(e.x,-a.scroll.offset.x),qF(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,UF(e,o)),r&&LF(a.latestValues)&&XF(e,a.latestValues,a.layout?.layoutBox))}t.x<GF&&t.x>WF&&(t.x=1),t.y<GF&&t.y>WF&&(t.y=1)}function qF(e,t){e.min+=t,e.max+=t}function JF(e,t,n,r,i=.5){HF(e,t,n,bj(e.min,e.max,i),r)}function YF(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function XF(e,t,n){let r=n??e;JF(e.x,YF(t.x,r.x),t.scaleX,t.scale,t.originX),JF(e.y,YF(t.y,r.y),t.scaleY,t.scale,t.originY)}function ZF(e,t){return MF(PF(e.getBoundingClientRect(),t))}function QF(e,t,n){let r=ZF(e,n),{scroll:i}=t;return i&&(qF(r.x,i.offset.x),qF(r.y,i.offset.y)),r}var $F={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},eI=DM.length;function tI(e,t,n){let r=``,i=!0;for(let a=0;a<eI;a++){let o=DM[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=SP(s,pP[o]);if(!c){i=!1;let t=$F[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function nI(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(OM.has(e)){o=!0;continue}else if(OA(e)){i[e]=n;continue}else{let t=SP(n,pP[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=tI(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 rI(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 iI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var aI={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(K.test(e))e=parseFloat(e);else return e;return`${iI(e,t.target.x)}% ${iI(e,t.target.y)}%`}},oI={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=gj.parse(e);if(i.length>5)return r;let a=gj.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=bj(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},sI={borderRadius:{...aI,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:aI,borderTopRightRadius:aI,borderBottomLeftRadius:aI,borderBottomRightRadius:aI,boxShadow:oI};function cI(e,{layout:t,layoutId:n}){return OM.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!sI[e]||e===`opacity`)}function lI(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(GN(r[t])||i&&GN(i[t])||cI(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function uI(e){return window.getComputedStyle(e)}var dI=class extends AF{constructor(){super(...arguments),this.type=`html`,this.renderInstance=rI}readValueFromInstance(e,t){if(OM.has(t))return this.projection?.isProjecting?CM(t):TM(e,t);{let n=uI(e),r=(OA(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return ZF(e,t)}build(e,t,n){nI(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return lI(e,t,n)}},fI={offset:`stroke-dashoffset`,array:`stroke-dasharray`},pI={offset:`strokeDashoffset`,array:`strokeDasharray`};function mI(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?fI:pI;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var hI=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function gI(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(nI(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 hI)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&&mI(d,i,a,o,!1)}var _I=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`]),vI=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function yI(e,t,n,r){rI(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(_I.has(n)?n:JN(n),t.attrs[n])}function bI(e,t,n){let r=lI(e,t,n);for(let n in e)if(GN(e[n])||GN(t[n])){let t=DM.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var xI=class extends AF{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=fF}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(OM.has(t)){let e=hP(t);return e&&e.default||0}return t=_I.has(t)?t:JN(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return bI(e,t,n)}build(e,t,n){gI(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){yI(e,t,n,r)}mount(e){this.isSVGTag=vI(e.tagName),super.mount(e)}},SI=_F.length;function CI(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&CI(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<SI;n++){let r=_F[n],i=e.props[r];(hF(i)||i===!1)&&(t[r]=i)}return t}function wI(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 TI=[...gF].reverse(),EI=gF.length;function DI(e){return t=>Promise.all(t.map(({animation:t,options:n})=>tP(e,t,n)))}function OI(e){let t=DI(e),n=jI(),r=!0,i=!1,a=t=>(n,r)=>{let i=PN(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=CI(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<EI;t++){let p=TI[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=hF(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||mF(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=kI(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=VN(t)&&VN(n)?!wI(t,n):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 D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=PN(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=vN(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=PN(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=jI(),i=!0}}}function kI(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!wI(t,e):!1}function AI(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function jI(){return{animate:AI(!0),whileInView:AI(),whileHover:AI(),whileTap:AI(),whileDrag:AI(),whileFocus:AI(),exit:AI()}}function MI(e,t){e.min=t.min,e.max=t.max}function NI(e,t){MI(e.x,t.x),MI(e.y,t.y)}function PI(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var FI=1e-4,II=1-FI,LI=1+FI,RI=.01,zI=0-RI,BI=0+RI;function VI(e){return e.max-e.min}function HI(e,t,n){return Math.abs(e-t)<=n}function UI(e,t,n,r=.5){e.origin=r,e.originPoint=bj(t.min,t.max,e.origin),e.scale=VI(n)/VI(t),e.translate=bj(n.min,n.max,e.origin)-e.originPoint,(e.scale>=II&&e.scale<=LI||isNaN(e.scale))&&(e.scale=1),(e.translate>=zI&&e.translate<=BI||isNaN(e.translate))&&(e.translate=0)}function WI(e,t,n,r){UI(e.x,t.x,n.x,r?r.originX:void 0),UI(e.y,t.y,n.y,r?r.originY:void 0)}function GI(e,t,n,r=0){e.min=(r?bj(n.min,n.max,r):n.min)+t.min,e.max=e.min+VI(t)}function KI(e,t,n,r){GI(e.x,t.x,n.x,r?.x),GI(e.y,t.y,n.y,r?.y)}function qI(e,t,n,r=0){let i=r?bj(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+VI(t)}function JI(e,t,n,r){qI(e.x,t.x,n.x,r?.x),qI(e.y,t.y,n.y,r?.y)}function YI(e,t,n,r,i){return e-=t,e=BF(e,1/n,r),i!==void 0&&(e=BF(e,1/i,r)),e}function XI(e,t=0,n=1,r=.5,i,a=e,o=e){if(YA.test(t)&&(t=parseFloat(t),t=bj(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=bj(a.min,a.max,r);e===a&&(s-=t),e.min=YI(e.min,t,n,s,i),e.max=YI(e.max,t,n,s,i)}function ZI(e,t,[n,r,i],a,o){XI(e,t[n],t[r],t[i],t.scale,a,o)}var QI=[`x`,`scaleX`,`originX`],$I=[`y`,`scaleY`,`originY`];function eL(e,t,n,r){ZI(e.x,t,QI,n?n.x:void 0,r?r.x:void 0),ZI(e.y,t,$I,n?n.y:void 0,r?r.y:void 0)}function tL(e){return e.translate===0&&e.scale===1}function nL(e){return tL(e.x)&&tL(e.y)}function rL(e,t){return e.min===t.min&&e.max===t.max}function iL(e,t){return rL(e.x,t.x)&&rL(e.y,t.y)}function aL(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oL(e,t){return aL(e.x,t.x)&&aL(e.y,t.y)}function sL(e){return VI(e.x)/VI(e.y)}function cL(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function lL(e){return[e(`x`),e(`y`)]}function uL(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,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}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 dL=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],fL=dL.length,pL=e=>typeof e==`string`?parseFloat(e):e,mL=e=>typeof e==`number`||K.test(e);function hL(e,t,n,r,i,a){i?(e.opacity=bj(0,n.opacity??1,_L(r)),e.opacityExit=bj(t.opacity??1,0,vL(r))):a&&(e.opacity=bj(t.opacity??1,n.opacity??1,r));for(let i=0;i<fL;i++){let a=dL[i],o=gL(t,a),s=gL(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||mL(o)===mL(s)?(e[a]=Math.max(bj(pL(o),pL(s),r),0),(YA.test(s)||YA.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=bj(t.rotate||0,n.rotate||0,r))}function gL(e,t){return e[t]===void 0?e.borderRadius:e[t]}var _L=yL(0,.5,iA),vL=yL(.5,.95,Rk);function yL(e,t,n){return r=>r<e?0:r>t?1:n(Vk(e,t,r))}function bL(e,t,n){let r=GN(e)?e:BN(e);return r.start(jN(``,r,t,n)),r.animation}function xL(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var SL=(e,t)=>e.depth-t.depth,CL=class{constructor(){this.children=[],this.isDirty=!1}add(e){Ak(this.children,e),this.isDirty=!0}remove(e){jk(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(SL),this.isDirty=!1,this.children.forEach(e)}};function wL(e,t){let n=TA.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(bA(r),e(a-t))};return yA.setup(r,!0),()=>bA(r)}function TL(e){return GN(e)?e.get():e}var EL=class{constructor(){this.members=[]}add(e){Ak(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&&(jk(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(jk(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)}},DL={hasAnimatedSinceResize:!0,hasEverUpdated:!1},OL={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},kL=[``,`X`,`Y`,`Z`],AL=1e3,jL=0;function ML(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function NL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=XN(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,yA,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&NL(r)}function PL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=jL++,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,hA.value&&(OL.nodes=OL.calculatedTargetDeltas=OL.calculatedProjections=0),this.nodes.forEach(LL),this.nodes.forEach(KL),this.nodes.forEach(qL),this.nodes.forEach(RL),hA.addProjectionMetrics&&hA.addProjectionMetrics(OL)},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 CL)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Hk),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=GP(t)&&!oF(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;yA.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=wL(i,250),DL.hasAnimatedSinceResize&&(DL.hasAnimatedSinceResize=!1,this.nodes.forEach(GL)))})}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()||eR,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!oL(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={...ON(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||GL(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(),bA(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(JL),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&&NL(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(VL),this.nodes.forEach(BL);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(HL);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(UL),this.nodes.forEach(WL),this.nodes.forEach(FL),this.nodes.forEach(IL)):this.nodes.forEach(HL),this.clearAllSnapshots();let e=TA.now();xA.delta=Mk(0,1e3/60,e-xA.timestamp),xA.timestamp=e,xA.isProcessing=!0,SA.update.process(xA),SA.preRender.process(xA),SA.render.process(xA),xA.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wP.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zL),this.sharedNodes.forEach(YL)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,yA.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){yA.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!VI(this.snapshot.measuredBox.x)&&!VI(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||=fF(),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&&!nL(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||LF(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)),iR(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return fF();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(oR))){let{scroll:e}=this.root;e&&(qF(t.x,e.offset.x),qF(t.y,e.offset.y))}return t}removeElementScroll(e){let t=fF();if(NI(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&&NI(t,e),qF(t.x,i.offset.x),qF(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||fF();NI(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&&(qF(r.x,-n.scroll.offset.x),qF(r.y,-n.scroll.offset.y)),LF(n.latestValues)&&XF(r,n.latestValues,n.layout?.layoutBox)}return LF(this.latestValues)&&XF(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=fF();NI(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!LF(n.latestValues))continue;let r;n.instance&&(IF(n.latestValues)&&n.updateSnapshot(),r=fF(),NI(r,n.measurePageBox())),eL(t,n.latestValues,n.snapshot?.layoutBox,r)}return LF(this.latestValues)&&eL(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?!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!==xA.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=xA.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=fF(),this.targetWithTransforms=fF()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),KI(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):NI(this.target,this.layout.layoutBox),UF(this.target,this.targetDelta)):NI(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),hA.value&&OL.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||IF(this.parent.latestValues)||RF(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=fF(),this.relativeTargetOrigin=fF(),JI(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),NI(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===xA.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;NI(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;KF(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=fF());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(PI(this.prevProjectionDelta.x,this.projectionDelta.x),PI(this.prevProjectionDelta.y,this.projectionDelta.y)),WI(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!cL(this.projectionDelta.x,this.prevProjectionDelta.x)||!cL(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),hA.value&&OL.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=uF(),this.projectionDelta=uF(),this.projectionDeltaWithTransform=uF()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=uF();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=fF(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some($L));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;XL(a.x,e.x,n),XL(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(JI(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),QL(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&iL(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=fF(),NI(d,this.relativeTarget)),s&&(this.animationValues=i,hL(i,r,this.latestValues,n,u,l)),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&&=(bA(this.pendingAnimation),void 0),this.pendingAnimation=yA.update(()=>{DL.hasAnimatedSinceResize=!0,EA.layout++,this.motionValue||=BN(0),this.motionValue.jump(0,!1),this.currentAnimation=bL(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{EA.layout--},onComplete:()=>{EA.layout--,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(AL),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&&aR(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||fF();let t=VI(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=VI(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}NI(t,n),XF(t,i),WI(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new EL),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:!0}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&&ML(`z`,e,r,this.animationValues);for(let t=0;t<kL.length;t++)ML(`rotate${kL[t]}`,e,r,this.animationValues),ML(`skew${kL[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=TL(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=TL(t?.pointerEvents)||``),this.hasProjected&&!LF(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=uL(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`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in sI){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=sI[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?TL(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(BL),this.root.sharedNodes.clear()}}}function FL(e){e.updateLayout()}function IL(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`)lL(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=VI(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;MI(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else aR(i,t.layoutBox,n)&&lL(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=VI(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=uF();WI(o,n,t.layoutBox);let s=uF();a?WI(s,e.applyTransform(r,!0),t.measuredBox):WI(s,n,t.layoutBox);let c=!nL(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=fF();JI(s,t.layoutBox,i.layoutBox,o);let c=fF();JI(c,n,a.layoutBox,o),oL(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 LL(e){hA.value&&OL.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 RL(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zL(e){e.clearSnapshot()}function BL(e){e.clearMeasurements()}function VL(e){e.isLayoutDirty=!0,e.updateLayout()}function HL(e){e.isLayoutDirty=!1}function UL(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function WL(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function GL(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function KL(e){e.resolveTargetDelta()}function qL(e){e.calcProjection()}function JL(e){e.resetSkewAndRotation()}function YL(e){e.removeLeadSnapshot()}function XL(e,t,n){e.translate=bj(t.translate,0,n),e.scale=bj(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ZL(e,t,n,r){e.min=bj(t.min,n.min,r),e.max=bj(t.max,n.max,r)}function QL(e,t,n,r){ZL(e.x,t.x,n.x,r),ZL(e.y,t.y,n.y,r)}function $L(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var eR={duration:.45,ease:[.4,0,.1,1]},tR=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nR=tR(`applewebkit/`)&&!tR(`chrome/`)?Math.round:Rk;function rR(e){e.min=nR(e.min),e.max=nR(e.max)}function iR(e){rR(e.x),rR(e.y)}function aR(e,t,n){return e===`position`||e===`preserve-aspect`&&!HI(sL(t),sL(n),.2)}function oR(e){return e!==e.root&&e.scroll?.wasRoot}var sR=PL({attachResizeListener:(e,t)=>xL(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),cR={current:void 0},lR=PL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!cR.current){let e=new sR({});e.mount(window),e.setOptions({layoutScroll:!0}),cR.current=e}return cR.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),uR=(0,z.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function dR(e=!0){let t=(0,z.useContext)(kk);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,z.useId)();(0,z.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,z.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var fR=(0,z.createContext)({strict:!1}),pR={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`]},mR=!1;function hR(){if(mR)return;let e={};for(let t in pR)e[t]={isEnabled:e=>pR[t].some(t=>!!e[t])};DF(e),mR=!0}function gR(){return hR(),OF()}function _R(e){let t=gR();for(let n in e)t[n]={...t[n],...e[n]};DF(t)}var vR=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 yR(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||vR.has(e)}var bR=r({default:()=>xR}),xR,SR=t((()=>{throw xR={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),CR=e=>!yR(e);function wR(e){typeof e==`function`&&(CR=t=>t.startsWith(`on`)?!yR(t):e(t))}try{wR((SR(),e(bR)).default)}catch{}function TR(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||GN(e[i])||(CR(i)||n===!0&&yR(i)||!t&&!yR(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var ER=(0,z.createContext)({});function DR(e,t){if(vF(e)){let{initial:t,animate:n}=e;return{initial:t===!1||hF(t)?t:void 0,animate:hF(n)?n:void 0}}return e.inherit===!1?{}:t}function OR(e){let{initial:t,animate:n}=DR(e,(0,z.useContext)(ER));return(0,z.useMemo)(()=>({initial:t,animate:n}),[kR(t),kR(n)])}function kR(e){return Array.isArray(e)?e.join(` `):e}var AR=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jR(e,t,n){for(let r in t)!GN(t[r])&&!cI(r,n)&&(e[r]=t[r])}function MR({transformTemplate:e},t){return(0,z.useMemo)(()=>{let n=AR();return nI(n,t,e),Object.assign({},n.vars,n.style)},[t])}function NR(e,t){let n=e.style||{},r={};return jR(r,n,e),Object.assign(r,MR(e,t)),r}function PR(e,t){let n={},r=NR(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 FR=()=>({...AR(),attrs:{}});function IR(e,t,n,r){let i=(0,z.useMemo)(()=>{let n=FR();return gI(n,t,vI(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};jR(t,e.style,e),i.style={...t,...i.style}}return i}var LR=[`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 RR(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(LR.indexOf(e)>-1||/[A-Z]/u.test(e))}function zR(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??RR(e)?IR:PR)(t,r,i,e),c=TR(t,typeof e==`string`,a),l=e===z.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,z.useMemo)(()=>GN(u)?u.get():u,[u]);return(0,z.createElement)(e,{...l,children:d})}function BR({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:VR(n,r,i,e),renderState:t()}}function VR(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=TL(a[e]);let{initial:o,animate:s}=e,c=vF(e),l=yF(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`&&!mF(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=NN(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 HR=e=>(t,n)=>{let r=(0,z.useContext)(ER),i=(0,z.useContext)(kk),a=()=>BR(e,t,r,i);return n?a():Dk(a)},UR=HR({scrapeMotionValuesFromProps:lI,createRenderState:AR}),WR=HR({scrapeMotionValuesFromProps:bI,createRenderState:FR}),GR=Symbol.for(`motionComponentSymbol`);function KR(e,t,n){let r=(0,z.useRef)(n);(0,z.useInsertionEffect)(()=>{r.current=n});let i=(0,z.useRef)(null);return(0,z.useCallback)(n=>{n&&e.onMount?.(n);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&&(n?t.mount(n):t.unmount())},[t])}var qR=(0,z.createContext)({});function JR(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function YR(e,t,n,r,i,a){let{visualElement:o}=(0,z.useContext)(ER),s=(0,z.useContext)(fR),c=(0,z.useContext)(kk),l=(0,z.useContext)(uR),u=l.reducedMotion,d=l.skipAnimations,f=(0,z.useRef)(null),p=(0,z.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,z.useContext)(qR);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&XR(f.current,n,i,h);let g=(0,z.useRef)(!1);(0,z.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[YN],v=(0,z.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Ok(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,z.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function XR(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:ZR(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&JR(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function ZR(e){if(e)return e.options.allowProjection===!1?ZR(e.parent):e.projection}function QR(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&_R(r);let a=n?n===`svg`:RR(e),o=a?WR:UR;function s(n,s){let c,l={...(0,z.useContext)(uR),...n,layoutId:$R(n)},{isStatic:u}=l,d=OR(n),f=o(n,u);if(!u&&typeof window<`u`){ez(l,r);let t=tz(l);c=t.MeasureLayout,d.visualElement=YR(e,f,l,i,t.ProjectionNode,a)}return(0,U.jsxs)(ER.Provider,{value:d,children:[c&&d.visualElement?(0,U.jsx)(c,{visualElement:d.visualElement,...l}):null,zR(e,n,KR(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,z.forwardRef)(s);return c[GR]=e,c}function $R({layoutId:e}){let t=(0,z.useContext)(Ek).id;return t&&e!==void 0?t+`-`+e:e}function ez(e,t){(0,z.useContext)(fR).strict}function tz(e){let{drag:t,layout:n}=gR();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function nz(e,t){if(typeof Proxy>`u`)return QR;let n=new Map,r=(n,r)=>QR(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,QR(a,void 0,e,t)),n.get(a))})}var rz=(e,t)=>t.isSVG??RR(e)?new xI(t):new dI(t,{allowProjection:e!==z.Fragment}),iz=class extends jF{constructor(e){super(e),e.animationState||=OI(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();mF(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?.()}},az=0,oz={animation:{Feature:iz},exit:{Feature:class extends jF{constructor(){super(...arguments),this.id=az++,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`){let n=PN(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 sz(e){return{point:{x:e.pageX,y:e.pageY}}}var cz=e=>t=>NP(t)&&e(t,sz(t));function lz(e,t,n,r){return xL(e,t,cz(n),r)}var uz=({current:e})=>e?e.ownerDocument.defaultView:null,dz=(e,t)=>Math.abs(e-t);function fz(e,t){let n=dz(e.x,t.x),r=dz(e.y,t.y);return Math.sqrt(n**2+r**2)}var pz=new Set([`auto`,`scroll`]),mz=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=hz(this.lastRawMoveEventInfo,this.transformPagePoint));let e=_z(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=fz(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=xA;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=hz(t,this.transformPagePoint),yA.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=_z(e.type===`pointercancel`?this.lastMoveEventInfo:hz(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!NP(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=hz(sz(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=xA;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,_z(s,this.history)),this.removeListeners=Bk(lz(this.contextWindow,`pointermove`,this.handlePointerMove),lz(this.contextWindow,`pointerup`,this.handlePointerUp),lz(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(pz.has(e.overflowX)||pz.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),yA.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),bA(this.updatePoint)}};function hz(e,t){return t?{point:t(e.point)}:e}function gz(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _z({point:e},t){return{point:e,delta:gz(e,yz(t)),offset:gz(e,vz(t)),velocity:bz(t,.1)}}function vz(e){return e[0]}function yz(e){return e[e.length-1]}function bz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=yz(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Uk(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Uk(t)*2&&(r=e[1]);let a=Wk(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 xz(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?bj(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?bj(n,e,r.max):Math.min(e,n)),e}function Sz(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 Cz(e,{top:t,left:n,bottom:r,right:i}){return{x:Sz(e.x,n,i),y:Sz(e.y,t,r)}}function wz(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 Tz(e,t){return{x:wz(e.x,t.x),y:wz(e.y,t.y)}}function Ez(e,t){let n=.5,r=VI(e),i=VI(t);return i>r?n=Vk(t.min,t.max-r,e.min):r>i&&(n=Vk(e.min,e.max-i,t.min)),Mk(0,1,n)}function Dz(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 Oz=.35;function kz(e=Oz){return e===!1?e=0:e===!0&&(e=Oz),{x:Az(e,`left`,`right`),y:Az(e,`top`,`bottom`)}}function Az(e,t,n){return{min:jz(e,t),max:jz(e,n)}}function jz(e,t){return typeof e==`number`?e:e[t]||0}var Mz=new WeakMap,Nz=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=fF(),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(sz(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=OP(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),lL(e=>{let t=this.getAxisMotionValue(e).get()||0;if(YA.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=VI(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&yA.update(()=>i(e,t),!1,!0),qN(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=Lz(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&&yA.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 mz(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:uz(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&&yA.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||!Iz(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=xz(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&&JR(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Cz(n.layoutBox,e):this.constraints=!1,this.elastic=kz(t),r!==this.constraints&&!JR(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&lL(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Dz(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!JR(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=QF(n,r.root,this.visualElement.getTransformPagePoint()),a=Tz(r.layout.layoutBox,i);if(t){let e=t(NF(a));this.hasMutatedConstraints=!!e,e&&(a=MF(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=lL(o=>{if(!Iz(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 qN(this.visualElement,e),n.start(jN(e,n,0,t,this.visualElement,!1))}stopAnimation(){lL(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){lL(t=>{let{drag:n}=this.getProps();if(!Iz(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]-bj(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!JR(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};lL(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Ez({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(),lL(t=>{if(!Iz(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(bj(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Mz.set(this.visualElement,this);let e=this.visualElement.current,t=lz(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&LP(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();JR(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Fz(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),yA.read(r);let o=xL(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(lL(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=Oz,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Pz(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Fz(e,t,n){let r=aF(e,Pz(n)),i=aF(t,Pz(n));return()=>{r(),i()}}function Iz(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Lz(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Rz=class extends jF{constructor(e){super(e),this.removeGroupControls=Rk,this.removeListeners=Rk,this.controls=new Nz(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Rk}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()}},zz=e=>(t,n)=>{e&&yA.update(()=>e(t,n),!1,!0)},Bz=class extends jF{constructor(){super(...arguments),this.removePointerDownListener=Rk}onPointerDown(e){this.session=new mz(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:uz(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:zz(e),onStart:zz(t),onMove:zz(n),onEnd:(e,t)=>{delete this.session,r&&yA.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=lz(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Vz=!1,Hz=class extends z.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),Vz&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),DL.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}),Vz=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||yA.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(),wP.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Vz=!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 Uz(e){let[t,n]=dR(),r=(0,z.useContext)(Ek);return(0,U.jsx)(Hz,{...e,layoutGroup:r,switchLayoutGroup:(0,z.useContext)(qR),isPresent:t,safeToRemove:n})}var Wz={pan:{Feature:Bz},drag:{Feature:Rz,ProjectionNode:lR,MeasureLayout:Uz}};function Gz(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&yA.postRender(()=>i(t,sz(t)))}var Kz=class extends jF{mount(){let{current:e}=this.node;e&&(this.unmount=jP(e,(e,t)=>(Gz(this.node,t,`Start`),e=>Gz(this.node,e,`End`))))}unmount(){}},qz=class extends jF{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=Bk(xL(this.node.current,`focus`,()=>this.onFocus()),xL(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Jz(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&&yA.postRender(()=>i(t,sz(t)))}var Yz=class extends jF{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=WP(e,(e,t)=>(Jz(this.node,t,`Start`),(e,{success:t})=>Jz(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Xz=new WeakMap,Zz=new WeakMap,Qz=e=>{let t=Xz.get(e.target);t&&t(e)},$z=e=>{e.forEach(Qz)};function eB({root:e,...t}){let n=e||document;Zz.has(n)||Zz.set(n,{});let r=Zz.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver($z,{root:e,...t})),r[i]}function tB(e,t,n){let r=eB(t);return Xz.set(e,n),r.observe(e),()=>{Xz.delete(e),r.unobserve(e)}}var nB={some:0,all:1},rB=class extends jF{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:nB[r]};this.stopObserver=tB(this.node.current,a,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)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(iB(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function iB({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var aB={inView:{Feature:rB},tap:{Feature:Yz},focus:{Feature:qz},hover:{Feature:Kz}},oB={layout:{ProjectionNode:lR,MeasureLayout:Uz}},sB=nz({...oz,...aB,...Wz,...oB},rz),cB=new Map,lB=e=>{let t=cB.get(e);return t||(t=sB.create(e),cB.set(e,t)),t},uB=(0,z.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=lB(t),o=(0,z.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,U.jsx)(a,{animate:{backgroundPosition:`0% center`},className:H(`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})}),dB=(0,z.createContext)(null),fB=()=>{let e=(0,z.useContext)(dB);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e},pB=1e3,mB=1e3,hB=(0,z.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]=pE({defaultProp:c,onChange:i,prop:n}),[f,p]=pE({defaultProp:void 0,prop:a}),m=(0,z.useRef)(t),[h,g]=(0,z.useState)(!1),_=(0,z.useRef)(null);(0,z.useEffect)(()=>{t?(m.current=!0,_.current===null&&(_.current=Date.now())):_.current!==null&&(p(Math.ceil((Date.now()-_.current)/mB)),_.current=null)},[t,p]),(0,z.useEffect)(()=>{t&&!u&&!l&&d(!0)},[t,u,d,l]),(0,z.useEffect)(()=>{if(m.current&&!t&&u&&!h){let e=setTimeout(()=>{d(!1),g(!0)},pB);return()=>clearTimeout(e)}},[t,u,d,h]);let v=(0,z.useCallback)(e=>{d(e)},[d]),y=(0,z.useMemo)(()=>({duration:f,isOpen:u,isStreaming:t,setIsOpen:d}),[f,u,t,d]);return(0,U.jsx)(dB.Provider,{value:y,children:(0,U.jsx)(Ck,{className:H(`not-prose mb-4`,e),onOpenChange:v,open:u,...s,children:o})})}),gB=(e,t)=>e||t===0?(0,U.jsx)(uB,{duration:1,children:`Thinking...`}):t===void 0?(0,U.jsx)(`p`,{children:`Thought for a few seconds`}):(0,U.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]}),_B=(0,z.memo)(({className:e,children:t,getThinkingMessage:n=gB,...r})=>{let{isStreaming:i,isOpen:a,duration:o}=fB();return(0,U.jsx)(wk,{className:H(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...r,children:t??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Wl,{className:`size-4`}),n(i,o),(0,U.jsx)(Gl,{className:H(`size-4 transition-transform`,a?`rotate-180`:`rotate-0`)})]})})}),vB={cjk:Bf,code:Bx,math:BS,mermaid:$T},yB=(0,z.memo)(({className:e,children:t,...n})=>(0,U.jsx)(Tk,{className:H(`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,U.jsx)(D,{plugins:vB,children:t})}));hB.displayName=`Reasoning`,_B.displayName=`ReasoningTrigger`,yB.displayName=`ReasoningContent`;var bB=({className:e,...t})=>(0,U.jsx)(Ck,{className:H(`not-prose mb-4 text-primary text-xs`,e),...t}),xB=({className:e,count:t,children:n,...r})=>(0,U.jsx)(wk,{className:H(`flex items-center gap-2`,e),...r,children:n??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`font-medium`,children:[`Used `,t,` sources`]}),(0,U.jsx)(Gl,{className:`h-4 w-4`})]})}),SB=({className:e,...t})=>(0,U.jsx)(Tk,{className:H(`mt-3 flex w-fit flex-col gap-2`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),CB=({href:e,title:t,children:n,...r})=>(0,U.jsx)(`a`,{className:`flex items-center gap-2`,href:e,rel:`noreferrer`,target:`_blank`,...r,children:n??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ul,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`block font-medium`,children:t})]})}),wB=()=>typeof window>`u`?`none`:`SpeechRecognition`in window||`webkitSpeechRecognition`in window?`speech-recognition`:`MediaRecorder`in window&&`mediaDevices`in navigator?`media-recorder`:`none`,TB=({className:e,onTranscriptionChange:t,onAudioRecorded:n,lang:r=`en-US`,...i})=>{let[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(!1),[l]=(0,z.useState)(wB),[u,d]=(0,z.useState)(!1),f=(0,z.useRef)(null),p=(0,z.useRef)(null),m=(0,z.useRef)(null),h=(0,z.useRef)([]),g=(0,z.useRef)(t),_=(0,z.useRef)(n);g.current=t,_.current=n,(0,z.useEffect)(()=>{if(l!==`speech-recognition`)return;let e=new(window.SpeechRecognition||window.webkitSpeechRecognition);e.continuous=!0,e.interimResults=!0,e.lang=r;let t=()=>{o(!0)},n=()=>{o(!1)},i=e=>{let t=e,n=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let r=t.results[e];r.isFinal&&(n+=r[0]?.transcript??``)}n&&g.current?.(n)},a=()=>{o(!1)};return e.addEventListener(`start`,t),e.addEventListener(`end`,n),e.addEventListener(`result`,i),e.addEventListener(`error`,a),f.current=e,d(!0),()=>{e.removeEventListener(`start`,t),e.removeEventListener(`end`,n),e.removeEventListener(`result`,i),e.removeEventListener(`error`,a),e.stop(),f.current=null,d(!1)}},[l,r]),(0,z.useEffect)(()=>()=>{if(p.current?.state===`recording`&&p.current.stop(),m.current)for(let e of m.current.getTracks())e.stop()},[]);let v=(0,z.useCallback)(async()=>{if(_.current)try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});m.current=e;let t=new MediaRecorder(e);h.current=[],t.addEventListener(`dataavailable`,e=>{e.data.size>0&&h.current.push(e.data)}),t.addEventListener(`stop`,async()=>{for(let t of e.getTracks())t.stop();m.current=null;let t=new Blob(h.current,{type:`audio/webm`});if(t.size>0&&_.current){c(!0);try{let e=await _.current(t);e&&g.current?.(e)}catch{}finally{c(!1)}}}),t.addEventListener(`error`,()=>{o(!1);for(let t of e.getTracks())t.stop();m.current=null}),p.current=t,t.start(),o(!0)}catch{o(!1)}},[]),y=(0,z.useCallback)(()=>{p.current?.state===`recording`&&p.current.stop(),o(!1)},[]),b=(0,z.useCallback)(()=>{l===`speech-recognition`&&f.current?a?f.current.stop():f.current.start():l===`media-recorder`&&(a?y():v())},[l,a,v,y]),x=l===`none`||l===`speech-recognition`&&!u||l===`media-recorder`&&!n||s;return(0,U.jsxs)(`div`,{className:`relative inline-flex items-center justify-center`,children:[a&&[0,1,2].map(e=>(0,U.jsx)(`div`,{className:`absolute inset-0 animate-ping rounded-full border-2 border-red-400/30`,style:{animationDelay:`${e*.3}s`,animationDuration:`2s`}},e)),(0,U.jsxs)($n,{className:H(`relative z-10 rounded-full transition-all duration-300`,a?`bg-destructive text-white hover:bg-destructive/80 hover:text-white`:`bg-primary text-primary-foreground hover:bg-primary/80 hover:text-primary-foreground`,e),disabled:x,onClick:b,...i,children:[s&&(0,U.jsx)(RO,{}),!s&&a&&(0,U.jsx)(mu,{className:`size-4`}),!(s||a)&&(0,U.jsx)(su,{className:`size-4`})]})]})},EB=Zn(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function DB({className:e,variant:t=`default`,render:n,...r}){return Ju({defaultTagName:`span`,props:$t({className:H(EB({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var OB=Object.defineProperty,kB=Object.getOwnPropertyDescriptor,AB=Object.getOwnPropertyNames,jB=Object.prototype.hasOwnProperty,MB=(e,t)=>{let n={};for(var r in e)OB(n,r,{get:e[r],enumerable:!0});return t||OB(n,Symbol.toStringTag,{value:`Module`}),n},NB=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=AB(t),a=0,o=i.length,s;a<o;a++)s=i[a],!jB.call(e,s)&&s!==n&&OB(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=kB(t,s))||r.enumerable});return e},PB=(e,t,n)=>(NB(e,t,`default`),n&&NB(n,t,`default`)),FB=[{id:`abap`,name:`ABAP`,import:(()=>N(()=>import(`./abap-wT6fgqwv.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>N(()=>import(`./actionscript-3-CqcHpPYj.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>N(()=>import(`./ada-DWE3Hn4E.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>N(()=>import(`./angular-html-BNkY0l6I.js`).then(e=>e.n),__vite__mapDeps([182,1,183,184,185])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>N(()=>import(`./angular-ts-BJR7ZmZ4.js`),__vite__mapDeps([186,182,1,183,184,185,187])))},{id:`apache`,name:`Apache Conf`,import:(()=>N(()=>import(`./apache-LRTUP4r3.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>N(()=>import(`./apex-Cr4FccGl.js`),[]))},{id:`apl`,name:`APL`,import:(()=>N(()=>import(`./apl-Cwj0kSUr.js`),__vite__mapDeps([188,184,1,183,185,189,190,191])))},{id:`applescript`,name:`AppleScript`,import:(()=>N(()=>import(`./applescript-DyQiO9JU.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>N(()=>import(`./ara-Cf-OWd2S.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>N(()=>import(`./asciidoc-gocbKcVK.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>N(()=>import(`./asm-C3meb5HY.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>N(()=>import(`./astro--s34HbNO.js`),__vite__mapDeps([192,184,1,185,189,193,194,195])))},{id:`awk`,name:`AWK`,import:(()=>N(()=>import(`./awk-BcT6nIdN.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>N(()=>import(`./ballerina-BCARR-zK.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>N(()=>import(`./bat-_yaRjWOb.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>N(()=>import(`./beancount-BPESBMS9.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>N(()=>import(`./berry-BSLE-Sf8.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>N(()=>import(`./bibtex-CvUWWCVx.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>N(()=>import(`./bicep--vcqqALZ.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>N(()=>import(`./bird2-Clclqgh6.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>N(()=>import(`./blade-CA0lh7nk.js`),__vite__mapDeps([196,184,1,197,183,185,189,198,190,191])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>N(()=>import(`./bsl-Bq5qFzpU.js`),__vite__mapDeps([199,200])))},{id:`c`,name:`C`,import:(()=>N(()=>import(`./c-BwwtBtD9.js`).then(e=>e.n),__vite__mapDeps([201,1])))},{id:`c3`,name:`C3`,import:(()=>N(()=>import(`./c3-BYD8LEiv.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>N(()=>import(`./cadence-BwAD7vSC.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>N(()=>import(`./cairo-Cn9-ZKRa.js`),__vite__mapDeps([202,203])))},{id:`clarity`,name:`Clarity`,import:(()=>N(()=>import(`./clarity-BeQd5TQD.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>N(()=>import(`./clojure-Csdo0vb_.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>N(()=>import(`./cmake-Cf0q7ddg.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>N(()=>import(`./cobol-DC9HzFj-.js`),__vite__mapDeps([204,183,1,184,185,191])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>N(()=>import(`./codeowners-CUEzlC7R.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>N(()=>import(`./codeql-DxHyogQt.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>N(()=>import(`./coffee-BXAFJg0r.js`),__vite__mapDeps([205,185,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>N(()=>import(`./common-lisp-WLb-tAda.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>N(()=>import(`./coq-DFtMD6Wn.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>N(()=>import(`./cpp-DKSsqshA.js`).then(e=>e.n),__vite__mapDeps([206,1,207,201,208,198])))},{id:`crystal`,name:`Crystal`,import:(()=>N(()=>import(`./crystal-IeOtgHp5.js`),__vite__mapDeps([209,201,1,184,183,185,210,198])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>N(()=>import(`./csharp-BsEjf_Dq.js`),[]))},{id:`css`,name:`CSS`,import:(()=>N(()=>import(`./css-BwJx5n-d.js`).then(e=>e.n),__vite__mapDeps([184,1])))},{id:`csv`,name:`CSV`,import:(()=>N(()=>import(`./csv-DTSgNSaP.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>N(()=>import(`./cue-BEmVIZmd.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>N(()=>import(`./cypher-CncQVhvU.js`),[]))},{id:`d`,name:`D`,import:(()=>N(()=>import(`./d-BzUSBVex.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>N(()=>import(`./dart-BBu3nkcE.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>N(()=>import(`./dax-DcLVz9_9.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>N(()=>import(`./desktop-DS2PdvoU.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>N(()=>import(`./diff-aUYk5Qys.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>N(()=>import(`./docker-12Lj1QUD.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>N(()=>import(`./dotenv-D-P4bzvl.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>N(()=>import(`./dream-maker-C_j5A0r7.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>N(()=>import(`./edge-DvUIs6yL.js`),__vite__mapDeps([211,197,183,1,184,185,195])))},{id:`elixir`,name:`Elixir`,import:(()=>N(()=>import(`./elixir-uf320cNm.js`),__vite__mapDeps([212,183,1,184,185])))},{id:`elm`,name:`Elm`,import:(()=>N(()=>import(`./elm-C0jRU6CE.js`),__vite__mapDeps([213,207,1,201])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>N(()=>import(`./emacs-lisp-W54LT7rh.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>N(()=>import(`./erb-IQLcm3Em.js`),__vite__mapDeps([214,183,1,184,185,215,201,206,207,208,198,216,217,194,195,218,219,210,190,191,220])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>N(()=>import(`./erlang-CzlD_Joo.js`),__vite__mapDeps([221,222])))},{id:`fennel`,name:`Fennel`,import:(()=>N(()=>import(`./fennel-DK82-oso.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>N(()=>import(`./fish-CbJVJzQj.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>N(()=>import(`./fluent-Cug5cOL1.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>N(()=>import(`./fortran-fixed-form-CT90EtSp.js`),__vite__mapDeps([223,224])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>N(()=>import(`./fortran-free-form-amHz32Zw.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>N(()=>import(`./fsharp-LasxezlU.js`),__vite__mapDeps([225,222])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>N(()=>import(`./gdresource-XqgPdfiE.js`),__vite__mapDeps([226,227,228])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>N(()=>import(`./gdscript-t_G6VYpv.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>N(()=>import(`./gdshader-DqZaHh4E.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>N(()=>import(`./genie-CIJtFlZK.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>N(()=>import(`./gherkin-CalidqLY.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>N(()=>import(`./git-commit-CZBgPolw.js`),__vite__mapDeps([229,230])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>N(()=>import(`./git-rebase-SvuYB-yx.js`),__vite__mapDeps([231,210,1])))},{id:`gleam`,name:`Gleam`,import:(()=>N(()=>import(`./gleam-D-2cpXVX.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>N(()=>import(`./glimmer-js-BRM4xWAn.js`),__vite__mapDeps([232,184,1,183,185,195])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>N(()=>import(`./glimmer-ts-q2S6_FNL.js`),__vite__mapDeps([233,184,1,183,185,195])))},{id:`glsl`,name:`GLSL`,import:(()=>N(()=>import(`./glsl-DBjPQFVZ.js`).then(e=>e.n),__vite__mapDeps([207,1,201])))},{id:`gn`,name:`GN`,import:(()=>N(()=>import(`./gn-C1cC4xLc.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>N(()=>import(`./gnuplot-2Gp459mV.js`),[]))},{id:`go`,name:`Go`,import:(()=>N(()=>import(`./go-BA1q0q8h.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>N(()=>import(`./graphql-COm4gzYD.js`).then(e=>e.n),__vite__mapDeps([216,1,185,217,194,195])))},{id:`groovy`,name:`Groovy`,import:(()=>N(()=>import(`./groovy-BlIa-VfI.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>N(()=>import(`./hack-D776y6TN.js`),__vite__mapDeps([234,183,1,184,185,198])))},{id:`haml`,name:`Ruby Haml`,import:(()=>N(()=>import(`./haml-BDLQGKJ5.js`).then(e=>e.n),__vite__mapDeps([218,1,184,185])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>N(()=>import(`./handlebars-CIxBD-3g.js`),__vite__mapDeps([235,184,1,183,185,220])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>N(()=>import(`./haskell-Da8UeSv-.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>N(()=>import(`./haxe-mcKlcxBa.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>N(()=>import(`./hcl-BdZcx5JX.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>N(()=>import(`./hjson-pFXYbN4t.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>N(()=>import(`./hlsl-Z0II0KR8.js`),[]))},{id:`html`,name:`HTML`,import:(()=>N(()=>import(`./html-Be5Uf2PY.js`).then(e=>e.n),__vite__mapDeps([183,1,184,185])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>N(()=>import(`./html-derivative-DwTv3LQJ.js`),__vite__mapDeps([197,183,1,184,185])))},{id:`http`,name:`HTTP`,import:(()=>N(()=>import(`./http-BoUyJiuw.js`),__vite__mapDeps([236,216,1,185,217,194,195,189,210,190,191])))},{id:`hurl`,name:`Hurl`,import:(()=>N(()=>import(`./hurl-BrO1xhi5.js`),__vite__mapDeps([237,238,216,1,185,217,194,195,190,191])))},{id:`hxml`,name:`HXML`,import:(()=>N(()=>import(`./hxml-e5uS5jTD.js`),__vite__mapDeps([239,240])))},{id:`hy`,name:`Hy`,import:(()=>N(()=>import(`./hy-BVbDMDcG.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>N(()=>import(`./imba-DRM6LLS5.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>N(()=>import(`./ini-2KCnNvmz.js`),[]))},{id:`java`,name:`Java`,import:(()=>N(()=>import(`./java-CQxQB19a.js`).then(e=>e.n),__vite__mapDeps([191,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>N(()=>import(`./javascript-DMa1awvA.js`).then(e=>e.n),__vite__mapDeps([185,1])))},{id:`jinja`,name:`Jinja`,import:(()=>N(()=>import(`./jinja-Brxwu6oJ.js`),__vite__mapDeps([241,183,1,184,185])))},{id:`jison`,name:`Jison`,import:(()=>N(()=>import(`./jison-EXcEtIQd.js`),__vite__mapDeps([242,185,1])))},{id:`json`,name:`JSON`,import:(()=>N(()=>import(`./json-DTmumXbw.js`).then(e=>e.n),__vite__mapDeps([189,1])))},{id:`json5`,name:`JSON5`,import:(()=>N(()=>import(`./json5-CJeEJPTg.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>N(()=>import(`./jsonc-C1haTBsf.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>N(()=>import(`./jsonl-wQ8-AJgs.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>N(()=>import(`./jsonnet-BrEjY3Xh.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>N(()=>import(`./jssm-C6LgYbOs.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>N(()=>import(`./jsx-CjPAAfVI.js`).then(e=>e.n),__vite__mapDeps([217,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>N(()=>import(`./julia-ClaFus-7.js`),__vite__mapDeps([243,206,1,207,201,208,198,185,203,244])))},{id:`just`,name:`Just`,import:(()=>N(()=>import(`./just-i-NvfbL-.js`),__vite__mapDeps([245,185,1,246,184,183,198,190,191,203,215,201,206,207,208,216,217,194,195,218,219,210,220])))},{id:`kdl`,name:`KDL`,import:(()=>N(()=>import(`./kdl-BrLEivmb.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>N(()=>import(`./kotlin-BO2FUnDB.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>N(()=>import(`./kusto-Cev1yiq9.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>N(()=>import(`./latex-CJqFaM_A.js`),__vite__mapDeps([247,248,244,1])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>N(()=>import(`./lean-BLS3Xk2w.js`),[]))},{id:`less`,name:`Less`,import:(()=>N(()=>import(`./less-BXmcsqcq.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>N(()=>import(`./liquid-C-yRtTgD.js`),__vite__mapDeps([249,184,1,183,185,189])))},{id:`llvm`,name:`LLVM IR`,import:(()=>N(()=>import(`./llvm-C_wLnJgX.js`),[]))},{id:`log`,name:`Log file`,import:(()=>N(()=>import(`./log-Cg8pvmWi.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>N(()=>import(`./logo-C9-kEvPW.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>N(()=>import(`./lua-YdeG1vR1.js`).then(e=>e.n),__vite__mapDeps([219,1,201])))},{id:`luau`,name:`Luau`,import:(()=>N(()=>import(`./luau-CMEm2VzY.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>N(()=>import(`./make-DBpJE-Z8.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>N(()=>import(`./markdown-B7ZTAu7B.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>N(()=>import(`./marko-C28Bend9.js`),__vite__mapDeps([250,184,1,251,187,195])))},{id:`matlab`,name:`MATLAB`,import:(()=>N(()=>import(`./matlab-C7MYlMSn.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>N(()=>import(`./mdc-D4DkjJGD.js`),__vite__mapDeps([252,197,183,1,184,185,222,220])))},{id:`mdx`,name:`MDX`,import:(()=>N(()=>import(`./mdx-FkOOX3Dq.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>N(()=>import(`./mermaid-C_9qw5it.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>N(()=>import(`./mipsasm-Dmi1AZOT.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>N(()=>import(`./mojo-C6z7mry2.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>N(()=>import(`./moonbit-CEeNIoB4.js`),[]))},{id:`move`,name:`Move`,import:(()=>N(()=>import(`./move-bALfKUa7.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>N(()=>import(`./narrat-DX4JlAWT.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>N(()=>import(`./nextflow-BUrFV5aB.js`),__vite__mapDeps([253,254])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>N(()=>import(`./nextflow-groovy-CKQWtRkO.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>N(()=>import(`./nginx-BzrYdIS_.js`),__vite__mapDeps([255,219,1,201])))},{id:`nim`,name:`Nim`,import:(()=>N(()=>import(`./nim-BAdKQO6U.js`),__vite__mapDeps([256,201,1,184,207,183,185,222,190,191])))},{id:`nix`,name:`Nix`,import:(()=>N(()=>import(`./nix-B1jThkGj.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>N(()=>import(`./nushell-L6DbJTuL.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>N(()=>import(`./objective-c-CTZ4bR2U.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>N(()=>import(`./objective-cpp-Dm1YDIdA.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>N(()=>import(`./ocaml-B3n__LGy.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>N(()=>import(`./odin-DmqZ8n3i.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>N(()=>import(`./openscad-DTFB9Sj6.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>N(()=>import(`./pascal-RcT1dQYN.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>N(()=>import(`./perl-BMPsT4bZ.js`),__vite__mapDeps([246,184,1,183,185,198,190,191])))},{id:`php`,name:`PHP`,import:(()=>N(()=>import(`./php-0S5_LhYZ.js`),__vite__mapDeps([257,184,1,183,185,189,198,190,191])))},{id:`pkl`,name:`Pkl`,import:(()=>N(()=>import(`./pkl-Dr4yLQ_o.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>N(()=>import(`./plsql-pFcO4WZ0.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>N(()=>import(`./po-BkZ0_HvY.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>N(()=>import(`./polar-DHK3q8FF.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>N(()=>import(`./postcss-Bv7WzijA.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>N(()=>import(`./powerquery-DpaU_hW9.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>N(()=>import(`./powershell-_Rqc0MGP.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>N(()=>import(`./prisma-wyegE8us.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>N(()=>import(`./prolog-DspHCURv.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>N(()=>import(`./proto-BOBiNGf5.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>N(()=>import(`./pug-DCZyheX4.js`),__vite__mapDeps([258,184,1,183,185])))},{id:`puppet`,name:`Puppet`,import:(()=>N(()=>import(`./puppet-DfLvV8h2.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>N(()=>import(`./purescript-BY5ZSOZy.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>N(()=>import(`./python-B758mMeg.js`),[]))},{id:`qml`,name:`QML`,import:(()=>N(()=>import(`./qml-DLa2zzL2.js`),__vite__mapDeps([259,185,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>N(()=>import(`./qmldir-C75bpHvy.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>N(()=>import(`./qss-DcLTlbLd.js`),[]))},{id:`r`,name:`R`,import:(()=>N(()=>import(`./r-C2wIHWmU.js`).then(e=>e.n),__vite__mapDeps([244,1])))},{id:`racket`,name:`Racket`,import:(()=>N(()=>import(`./racket-DTye_5qn.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>N(()=>import(`./raku-uJXBXkV0.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>N(()=>import(`./razor-CIU_5PCa.js`),__vite__mapDeps([260,261,183,1,184,185])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>N(()=>import(`./reg-DkTIaX7a.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>N(()=>import(`./regexp-oKAhWQ7Q.js`).then(e=>e.n),__vite__mapDeps([208,1])))},{id:`rel`,name:`Rel`,import:(()=>N(()=>import(`./rel-B0jumCjt.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>N(()=>import(`./riscv-DtaWMlo0.js`),[]))},{id:`ron`,name:`RON`,import:(()=>N(()=>import(`./ron-BCPxwJD6.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>N(()=>import(`./rosmsg-CPG8X-D5.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>N(()=>import(`./rst-Cof_t7QZ.js`),__vite__mapDeps([262,263,206,1,207,201,208,198,197,183,184,185,203,215,216,217,194,195,218,219,210,190,191,220])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>N(()=>import(`./ruby-o2UFtTKv.js`),__vite__mapDeps([215,201,1,206,207,208,198,184,216,185,217,194,195,218,183,219,210,190,191,220])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>N(()=>import(`./rust-CxfW3ePx.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>N(()=>import(`./sas-hJL2y9ck.js`),__vite__mapDeps([264,198,1])))},{id:`sass`,name:`Sass`,import:(()=>N(()=>import(`./sass-D-7bxo_L.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>N(()=>import(`./scala-DyUsfHNc.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>N(()=>import(`./scheme-ROgrwiO-.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>N(()=>import(`./scss-Cs20-D4S.js`).then(e=>e.n),__vite__mapDeps([187,1,184])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>N(()=>import(`./sdbl-B1EAQWpp.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>N(()=>import(`./shaderlab-Byjk0kH7.js`),__vite__mapDeps([265,266])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>N(()=>import(`./shellscript-FTtRH7a6.js`).then(e=>e.n),__vite__mapDeps([210,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>N(()=>import(`./shellsession-Dsazo7ie.js`),__vite__mapDeps([267,210,1])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>N(()=>import(`./smalltalk-B-1waXvA.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>N(()=>import(`./solidity-DYxwp0om.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>N(()=>import(`./soy-D05E5TYG.js`),__vite__mapDeps([268,183,1,184,185])))},{id:`sparql`,name:`SPARQL`,import:(()=>N(()=>import(`./sparql-CawLnniT.js`),__vite__mapDeps([269,270])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>N(()=>import(`./splunk-jK6-Sr06.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>N(()=>import(`./sql-2nD5KprC.js`).then(e=>e.n),__vite__mapDeps([198,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>N(()=>import(`./ssh-config-Bimb9LVr.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>N(()=>import(`./stata-gi0HO22o.js`),__vite__mapDeps([271,198,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>N(()=>import(`./stylus-B2DgJRJw.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>N(()=>import(`./surrealql-C1OjlKtP.js`),__vite__mapDeps([272,185,1])))},{id:`svelte`,name:`Svelte`,import:(()=>N(()=>import(`./svelte-lCoYOeOH.js`),__vite__mapDeps([273,184,1,185,193,195])))},{id:`swift`,name:`Swift`,import:(()=>N(()=>import(`./swift-ChEH2nFL.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>N(()=>import(`./system-verilog-DoVBMhJ8.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>N(()=>import(`./systemd--Ux4VAYD.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>N(()=>import(`./talonscript-DQNx9nak.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>N(()=>import(`./tasl-Bwy_Y9uD.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>N(()=>import(`./tcl-Drea-2jA.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>N(()=>import(`./templ-Be5BnDnr.js`),__vite__mapDeps([274,184,1,275,185])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>N(()=>import(`./terraform-4rS5HoFk.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>N(()=>import(`./tex-BBX4cNm_.js`),__vite__mapDeps([248,244,1])))},{id:`toml`,name:`TOML`,import:(()=>N(()=>import(`./toml-tSgOSv42.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>N(()=>import(`./ts-tags-BdYhOUUe.js`),__vite__mapDeps([276,184,1,207,201,183,185,198,195,190,191])))},{id:`tsv`,name:`TSV`,import:(()=>N(()=>import(`./tsv-BmL4O1Zx.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>N(()=>import(`./tsx-CfScc0-T.js`).then(e=>e.n),__vite__mapDeps([194,1])))},{id:`turtle`,name:`Turtle`,import:(()=>N(()=>import(`./turtle-2DYvssFL.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>N(()=>import(`./twig-DVDO78vU.js`),__vite__mapDeps([277,184,1,185,257,183,189,198,190,191,203,215,201,206,207,208,216,217,194,195,218,219,210,220,187])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>N(()=>import(`./typescript-x0tnfxi7.js`).then(e=>e.n),__vite__mapDeps([195,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>N(()=>import(`./typespec-DkCEO45F.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>N(()=>import(`./typst-DAZdb2n6.js`),[]))},{id:`v`,name:`V`,import:(()=>N(()=>import(`./v-B_wsb4C1.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>N(()=>import(`./vala-BDBNS784.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>N(()=>import(`./vb-CuOoJSSa.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>N(()=>import(`./verilog-BCcOvOcc.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>N(()=>import(`./vhdl-CI8PoqeM.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>N(()=>import(`./viml-B66dNP1B.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>N(()=>import(`./vue-Bm4Rs_rd.js`),__vite__mapDeps([278,184,1,197,183,185,189,195])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>N(()=>import(`./vue-html-Idq00pHJ.js`),__vite__mapDeps([279,185,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>N(()=>import(`./vue-vine-DNdsuI61.js`),__vite__mapDeps([280,184,1,185,251,193,187,281])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>N(()=>import(`./vyper-dNodzEa8.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>N(()=>import(`./wasm-d6SE2_qm.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>N(()=>import(`./wenyan-D0h8Uz55.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>N(()=>import(`./wgsl-vKs_vsvQ.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>N(()=>import(`./wikitext-BIWsPJit.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>N(()=>import(`./wit-6vmKi2H3.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>N(()=>import(`./wolfram-zoNg6F1a.js`),[]))},{id:`xml`,name:`XML`,import:(()=>N(()=>import(`./xml-C1p67_Oq.js`).then(e=>e.n),__vite__mapDeps([190,1,191])))},{id:`xsl`,name:`XSL`,import:(()=>N(()=>import(`./xsl-DcNV5e8y.js`),__vite__mapDeps([282,190,1,191])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>N(()=>import(`./yaml-Dz3CpChp.js`).then(e=>e.n),__vite__mapDeps([220,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>N(()=>import(`./zenscript-BxircxDx.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>N(()=>import(`./zig-DD79WQtz.js`),[]))}],IB=Object.fromEntries(FB.map(e=>[e.id,e.import])),LB=Object.fromEntries(FB.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),RB={...IB,...LB},zB=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>N(()=>import(`./andromeeda-DpQ-y-Jt.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>N(()=>import(`./aurora-x-BYcXaCIg.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>N(()=>import(`./ayu-dark-CLZPoccg.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>N(()=>import(`./ayu-light-CTyRQdS2.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>N(()=>import(`./ayu-mirage-DjqfqZdo.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-frappe-hr0HKoFX.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>N(()=>import(`./catppuccin-latte-DXEIYlFO.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-macchiato-B2zST7sA.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-mocha-CvrdnYv9.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>N(()=>import(`./dark-plus-mysFNRq2.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>N(()=>import(`./dracula-C-eRNn4o.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>N(()=>import(`./dracula-soft-CBB1BI7O.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>N(()=>import(`./everforest-dark-B_ISUDeh.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>N(()=>import(`./everforest-light-CNUYa354.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>N(()=>import(`./github-dark-BG2xX0wa.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>N(()=>import(`./github-dark-default-tDp_EOBs.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>N(()=>import(`./github-dark-dimmed-DlSfPwW2.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>N(()=>import(`./github-dark-high-contrast-qZM7j5KB.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>N(()=>import(`./github-light-CnvWTiyb.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>N(()=>import(`./github-light-default-Dy6OAt2Q.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>N(()=>import(`./github-light-high-contrast-1BHQCOPl.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-hard-BMIwVwaJ.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-medium-DxfuBW3n.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-soft-_NSslDDi.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-hard-CP5MIsL9.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-medium-BTMursH0.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-soft-Bv6zFoVX.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>N(()=>import(`./horizon-CufN8DyP.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>N(()=>import(`./horizon-bright-5qoQVyIY.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>N(()=>import(`./houston-DOFkQwep.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>N(()=>import(`./kanagawa-dragon-6UCcJpLw.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>N(()=>import(`./kanagawa-lotus-DOmfpsRg.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>N(()=>import(`./kanagawa-wave-CpxmPE7N.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>N(()=>import(`./laserwave-BlEkf-eH.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>N(()=>import(`./light-plus-DS6zriYl.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>N(()=>import(`./material-theme-BsXH-Mss.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>N(()=>import(`./material-theme-darker-CW9OlIeY.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>N(()=>import(`./material-theme-lighter-D2PAh0Kw.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>N(()=>import(`./material-theme-ocean-Vz6DBVi3.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>N(()=>import(`./material-theme-palenight-D-GleP3G.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>N(()=>import(`./min-dark-BowNvxk2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>N(()=>import(`./min-light-x8oWUmbL.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>N(()=>import(`./monokai-BQ4e_Hn0.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>N(()=>import(`./night-owl-D4PQd726.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>N(()=>import(`./night-owl-light-BQo_YHll.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>N(()=>import(`./nord-35quHUKo.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>N(()=>import(`./one-dark-pro-16_UaUig.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>N(()=>import(`./one-light-B-GGjWn5.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>N(()=>import(`./plastic-hp2Nry0R.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>N(()=>import(`./poimandres-BcTrxj7f.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>N(()=>import(`./red-rs3HE3re.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>N(()=>import(`./rose-pine-CNryoqGi.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>N(()=>import(`./rose-pine-dawn-C-gJOQVP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>N(()=>import(`./rose-pine-moon-BdXSXpZh.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>N(()=>import(`./slack-dark-DnmSY72G.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>N(()=>import(`./slack-ochin-q97gHjcd.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>N(()=>import(`./snazzy-light-C8yWDN2g.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>N(()=>import(`./solarized-dark-ClVDEMJZ.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>N(()=>import(`./solarized-light-Bts6CUIP.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>N(()=>import(`./synthwave-84-DwSLbgAm.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>N(()=>import(`./tokyo-night-C9MqaxIn.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>N(()=>import(`./vesper-CliZ6Pkm.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>N(()=>import(`./vitesse-black-0bGIaCfD.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>N(()=>import(`./vitesse-dark-Dk-RSXq-.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>N(()=>import(`./vitesse-light-BUsA5RhG.js`),[]))}].map(e=>[e.id,e.import])),BB=r({createOnigurumaEngine:()=>mV,getDefaultWasmLoader:()=>pV,loadWasm:()=>sV,setDefaultWasmLoader:()=>fV}),VB=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function HB(){return 2147483648}function UB(){return typeof performance<`u`?performance.now():Date.now()}var WB=(e,t)=>e+(t-e%t)%t;async function GB(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=HB();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,WB(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:UB,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var KB=Object.defineProperty,qB=(e,t,n)=>t in e?KB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JB=(e,t,n)=>qB(e,typeof t==`symbol`?t:t+``,n),YB=null;function XB(e){throw new VB(e.UTF8ToString(e.getLastOnigError()))}var ZB=class e{constructor(t){JB(this,`utf16Length`),JB(this,`utf8Length`),JB(this,`utf16Value`),JB(this,`utf8Value`),JB(this,`utf16OffsetToUtf8`),JB(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},QB=class e{constructor(t){if(JB(this,`id`,++e.LAST_ID),JB(this,`_onigBinding`),JB(this,`content`),JB(this,`utf16Length`),JB(this,`utf8Length`),JB(this,`utf16OffsetToUtf8`),JB(this,`utf8OffsetToUtf16`),JB(this,`ptr`),!YB)throw new VB(`Must invoke loadWasm first.`);this._onigBinding=YB,this.content=t;let n=new ZB(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=YB.omalloc(1e4),e._sharedPtrInUse=!0,YB.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(YB)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};JB(QB,`LAST_ID`,0),JB(QB,`_sharedPtr`,0),JB(QB,`_sharedPtrInUse`,!1);var $B=QB,eV=class{constructor(e){if(JB(this,`_onigBinding`),JB(this,`_ptr`),!YB)throw new VB(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new ZB(e[r]);t[r]=i.createString(YB),n[r]=i.utf8Length}let r=YB.omalloc(4*e.length);YB.HEAPU32.set(t,r/4);let i=YB.omalloc(4*e.length);YB.HEAPU32.set(n,i/4);let a=YB.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)YB.ofree(t[n]);YB.ofree(i),YB.ofree(r),a===0&&XB(YB),this._onigBinding=YB,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new $B(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function tV(e){return typeof e.instantiator==`function`}function nV(e){return typeof e.default==`function`}function rV(e){return e.data!==void 0}function iV(e){return typeof Response<`u`&&e instanceof Response}function aV(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var oV;function sV(e){if(oV)return oV;async function t(){YB=await GB(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),tV(n)?n=await n.instantiator(t):nV(n)?n=await n.default(t):(rV(n)&&(n=n.data),iV(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await lV(n)(t):await uV(n)(t):aV(n)||n instanceof WebAssembly.Module?n=await cV(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await cV(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return oV=t(),oV}function cV(e){return t=>WebAssembly.instantiate(e,t)}function lV(e){return t=>WebAssembly.instantiateStreaming(e,t)}function uV(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var dV;function fV(e){dV=e}function pV(){return dV}async function mV(e){return e&&await sV(e),{createScanner(e){return new eV(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new $B(e)}}}var hV=MB({});PB(hV,BB);var gV=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function _V(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function vV(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function yV(e){return Array.isArray(e)?e:[e]}async function bV(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function xV(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function SV(e){return e===`ansi`||xV(e)}function CV(e){return e===`none`}function wV(e){return CV(e)}function TV(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var EV={light:`#333333`,dark:`#bbbbbb`},DV={light:`#fffffe`,dark:`#1e1e1e`},OV=`__shiki_resolved`;function kV(e){if(e?.[OV])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?EV.light:EV.dark,n||=t.type===`light`?DV.light:DV.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,OV,{enumerable:!1,writable:!1,value:!0}),t}async function AV(e){return Array.from(new Set((await Promise.all(e.filter(e=>!SV(e)).map(async e=>await bV(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function jV(e){return(await Promise.all(e.map(async e=>wV(e)?null:kV(await bV(e))))).filter(e=>!!e)}function MV(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new gV(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var NV=class extends Cm{_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=kV(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=tp.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=MV(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new gV(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},PV=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},FV=0;function IV(e){FV+=1,e.warnings!==!1&&FV>=10&&FV%10==0&&console.warn(`[Shiki] ${FV} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new gV("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(kV),i=new NV(new PV(e.engine,n),r,n,e.langAlias),a;function o(t){return MV(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new gV(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new gV(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await AV(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await jV(e))}function g(){if(t)throw new gV(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--FV)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function LV(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([jV(e.themes||[]),AV(e.langs||[]),e.engine]);return IV({...e,themes:t,langs:n,engine:r})}var RV=new WeakMap;function zV(e,t){RV.set(e,t)}function BV(e){return RV.get(e)}var VV=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(yV(n).map(e=>[e,wm])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return HV(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function HV(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function UV(e,t){if(!(e instanceof VV))throw new gV(`Invalid grammar state`);return e.getInternalStack(t)}function WV(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(xV(e.resolveLangAlias(n.lang||`text`))||CV(r))return TV(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new gV(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new gV(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return KV(t,o,i,a,n)}function GV(...e){if(e.length===2)return BV(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(xV(i)||CV(a))throw new gV(`Plain language does not have grammar state`);if(i===`ansi`)throw new gV(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new VV(qV(n,c,o,s,r).stateStack,c.name,o.name)}function KV(e,t,n,r,i){let a=qV(e,t,n,r,i),o=new VV(a.stateStack,t.name,n.name);return zV(a.tokens,o),a.tokens}function qV(e,t,n,r,i){let a=_V(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=TV(e),l=i.grammarState?UV(i.grammarState,n.name)??wm:i.grammarContextCode==null?wm:qV(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=vV(r[mp.getForeground(s)],a),l=mp.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?JV(t.scopes):YV(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function JV(e){return e.map(e=>({scopeName:e}))}function YV(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:QV(e,i,t.slice(0,r))}}return n}function XV(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function ZV(e,t,n){if(!XV(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)XV(e[r],n[i])&&--r,--i;return r===-1}function QV(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(ZV(e,t,n)){r.push(a);break}return r}function $V(e,t,n,r=WV){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:BV(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=eH(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new VV(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&zV(s,c),s}function eH(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}function tH(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function nH(e){let t=TV(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function rH(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var iH=`light-dark()`,aH=[`color`,`background-color`];function oH(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function sH(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?oH(e,t):e})):e}function cH(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>lH(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&aH.includes(a))if(r===iH&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new gV('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function lH(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&cp.Italic&&(t[`font-style`]=`italic`),e.fontStyle&cp.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&cp.Underline&&n.push(`underline`),e.fontStyle&cp.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function uH(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function dH(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=nH(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new gV(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}else{let t=n.lines[e.line];if(t===void 0)throw new gV(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new gV(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));fH(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return sH(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new gV(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=pH(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new gV(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new gV(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&tH(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function fH(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new gV(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new gV(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function pH(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(pH).join(``):``}var mH=[dH()];function hH(e){let t=gH(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...mH]}function gH(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var _H=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],vH={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function yH(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function bH(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function xH(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)vH[r]&&t.push({type:`setDecoration`,value:vH[r]});else if(r<=29){let e=vH[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:_H[r-30]}});else if(r===38){let n=bH(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:_H[r-40]}});else if(r===48){let n=bH(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:_H[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:_H[r-100+8]}})}return t}function SH(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=yH(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=xH(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var CH={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function wH(e=CH){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<_H.length;e++)r.push(t(_H[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var TH={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function EH(e,t,n){let r=_V(e,n),i=TV(t),a=wH(Object.fromEntries(_H.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||TH[t]]}))),o=SH();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=vV(i,r),o=vV(o,r),n.decorations.has(`dim`)&&(i=DH(i));let s=cp.None;return n.decorations.has(`bold`)&&(s|=cp.Bold),n.decorations.has(`italic`)&&(s|=cp.Italic),n.decorations.has(`underline`)&&(s|=cp.Underline),n.decorations.has(`strikethrough`)&&(s|=cp.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function DH(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function OH(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!xV(r)&&!CV(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return EH(r,t,n)}return WV(e,t,n)}function kH(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new gV("`themes` option must not be empty");let p=$V(e,t,n,OH);if(c=BV(p),l&&iH!==l&&!f.find(e=>e.color===l))throw new gV(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>cH(e,h,u,l,d))),c&&zV(a,c);let g=f.map(e=>_V(e.theme,n));i=AH(f,m,g,u,l,`fg`,d),r=AH(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=_V(n.theme,n);a=OH(e,t,n);let l=e.getTheme(n.theme);r=vV(l.bg,s),i=vV(l.fg,s),o=l.name,c=BV(a)}else throw new gV("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function AH(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=vV(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===iH&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new gV('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${vV(t[r][a],n[r])||`inherit`}, ${vV(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function jH(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>jH(e,t,n),codeToTokens:(t,n)=>kH(e,t,n)}){let i=t;for(let e of hH(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=kH(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=NH(a):d===`never`&&(a=PH(a)),f&&(a=FH(a));let p={...r,get source(){return i}};for(let e of hH(n))a=e.tokens?.call(p,a)||a;return MH(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function MH(e,t,n,r=BV(e)){let i=hH(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:tH,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
177
177
|
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=uH(a.htmlStyle||lH(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&zV(m,r),m}function NH(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&cp.Underline||i.fontStyle&cp.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function PH(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function FH(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=uH(e.htmlStyle||lH(e)),i=uH(n.htmlStyle||lH(n)),a=e.fontStyle&&(e.fontStyle&cp.Underline||e.fontStyle&cp.Strikethrough),o=n.fontStyle&&(n.fontStyle&cp.Underline||n.fontStyle&cp.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var IH=Bh;function LH(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>jH(e,t,n),codeToTokens:(t,n)=>kH(e,t,n)},i=IH(jH(e,t,n,r));for(let e of hH(n))i=e.postprocess?.call(r,i,n)||i;return i}async function RH(e){let t=await LV(e);return{getLastGrammarState:(...e)=>GV(t,...e),codeToTokensBase:(e,n)=>OH(t,e,n),codeToTokensWithThemes:(e,n)=>$V(t,e,n),codeToTokens:(e,n)=>kH(t,e,n),codeToHast:(e,n)=>jH(t,e,n),codeToHtml:(e,n)=>LH(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function zH(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,SV(n))return[];let r=t[n];if(!r)throw new gV(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(wV(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new gV(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await RH({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function BH(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function VH(e,t){let n=BH(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var HH=zH({langs:RB,themes:zB,engine:()=>(0,hV.createOnigurumaEngine)(N(()=>import(`./wasm-DBgC86Vn.js`),[]))}),{codeToHtml:UH,codeToHast:WH,codeToTokens:GH,codeToTokensBase:KH,codeToTokensWithThemes:qH,getSingletonHighlighter:JH,getLastGrammarState:YH}=VH(HH,{guessEmbeddedLanguages:rH}),XH=e=>e&&e&1,ZH=e=>e&&e&2,QH=e=>e&&e&4,$H=e=>e.map((e,t)=>({key:`line-${t}`,tokens:e.map((e,n)=>({key:`line-${t}-${n}`,token:e}))})),eU=({token:e})=>(0,U.jsx)(`span`,{className:`dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)]`,style:{backgroundColor:e.bgColor,color:e.color,fontStyle:XH(e.fontStyle)?`italic`:void 0,fontWeight:ZH(e.fontStyle)?`bold`:void 0,textDecoration:QH(e.fontStyle)?`underline`:void 0,...e.htmlStyle},children:e.content}),tU=H(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-8`,`before:mr-4`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),nU=({keyedLine:e,showLineNumbers:t})=>(0,U.jsx)(`span`,{className:t?tU:`block`,children:e.tokens.length===0?`
|
|
178
178
|
`:e.tokens.map(({token:e,key:t})=>(0,U.jsx)(eU,{token:e},t))}),rU=(0,z.createContext)({code:``}),iU=new Map,aU=new Map,oU=new Map,sU=(e,t)=>{let n=e.slice(0,100),r=e.length>100?e.slice(-100):``;return`${t}:${e.length}:${n}:${r}`},cU=e=>{let t=iU.get(e);if(t)return t;let n=HH({langs:[e],themes:[`github-light`,`github-dark`]});return iU.set(e,n),n},lU=e=>({bg:`transparent`,fg:`inherit`,tokens:e.split(`
|
|
179
179
|
`).map(e=>e===``?[]:[{color:`inherit`,content:e}])}),uU=(e,t,n)=>{let r=sU(e,t);return aU.get(r)||(n&&(oU.has(r)||oU.set(r,new Set),oU.get(r)?.add(n)),cU(t).then(n=>{let i=n.getLoadedLanguages().includes(t)?t:`text`,a=n.codeToTokens(e,{lang:i,themes:{dark:`github-dark`,light:`github-light`}}),o={bg:a.bg??`transparent`,fg:a.fg??`inherit`,tokens:a.tokens};aU.set(r,o);let s=oU.get(r);if(s){for(let e of s)e(o);oU.delete(r)}}).catch(e=>{console.error(`Failed to highlight code:`,e),oU.delete(r)}),null)},dU=(0,z.memo)(({tokenized:e,showLineNumbers:t,className:n})=>{let r=(0,z.useMemo)(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]),i=(0,z.useMemo)(()=>$H(e.tokens),[e.tokens]);return(0,U.jsx)(`pre`,{className:H(`dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm`,n),style:r,children:(0,U.jsx)(`code`,{className:H(`font-mono text-sm`,t&&`[counter-increment:line_0] [counter-reset:line]`),children:i.map(e=>(0,U.jsx)(nU,{keyedLine:e,showLineNumbers:t},e.key))})})},(e,t)=>e.tokenized===t.tokenized&&e.showLineNumbers===t.showLineNumbers&&e.className===t.className);dU.displayName=`CodeBlockBody`;var fU=({className:e,language:t,style:n,...r})=>(0,U.jsx)(`div`,{className:H(`group relative w-full overflow-hidden rounded-md border bg-background text-foreground`,e),"data-language":t,style:{containIntrinsicSize:`auto 200px`,contentVisibility:`auto`,...n},...r}),pU=({code:e,language:t,showLineNumbers:n=!1})=>{let r=(0,z.useMemo)(()=>lU(e),[e]),i=(0,z.useMemo)(()=>uU(e,t)??r,[e,t,r]),[a,o]=(0,z.useState)(null),s=(0,z.useRef)({code:e,language:t});return(s.current.code!==e||s.current.language!==t)&&(s.current={code:e,language:t},o(null)),(0,z.useEffect)(()=>{let n=!1;return uU(e,t,e=>{n||o(e)}),()=>{n=!0}},[e,t]),(0,U.jsx)(`div`,{className:`relative overflow-auto`,children:(0,U.jsx)(dU,{showLineNumbers:n,tokenized:a??i})})},mU=({code:e,language:t,showLineNumbers:n=!1,className:r,children:i,...a})=>{let o=(0,z.useMemo)(()=>({code:e}),[e]);return(0,U.jsx)(rU.Provider,{value:o,children:(0,U.jsxs)(fU,{className:r,language:t,...a,children:[i,(0,U.jsx)(pU,{code:e,language:t,showLineNumbers:n})]})})},hU=({className:e,...t})=>(0,U.jsx)(Ck,{className:H(`group not-prose mb-4 w-full rounded-md border`,e),...t}),gU={"approval-requested":`Awaiting Approval`,"approval-responded":`Responded`,"input-available":`Running`,"input-streaming":`Pending`,"output-available":`Completed`,"output-denied":`Denied`,"output-error":`Error`},_U={"approval-requested":(0,U.jsx)(Xl,{className:`size-4 text-yellow-600`}),"approval-responded":(0,U.jsx)(Kl,{className:`size-4 text-blue-600`}),"input-available":(0,U.jsx)(Xl,{className:`size-4 animate-pulse`}),"input-streaming":(0,U.jsx)(Jl,{className:`size-4`}),"output-available":(0,U.jsx)(Kl,{className:`size-4 text-green-600`}),"output-denied":(0,U.jsx)(ql,{className:`size-4 text-orange-600`}),"output-error":(0,U.jsx)(ql,{className:`size-4 text-red-600`})},vU=e=>(0,U.jsxs)(DB,{className:`gap-1.5 rounded-full text-xs`,variant:`secondary`,children:[_U[e],gU[e]]}),yU=({className:e,title:t,type:n,state:r,toolName:i,...a})=>{let o=n===`dynamic-tool`?i:n.split(`-`).slice(1).join(`-`);return(0,U.jsxs)(wk,{className:H(`flex w-full items-center justify-between gap-4 p-3`,e),...a,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(yu,{className:`size-4 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`font-medium text-sm`,children:t??o}),vU(r)]}),(0,U.jsx)(Gl,{className:`size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]})},bU=({className:e,...t})=>(0,U.jsx)(Tk,{className:H(`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-4 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),xU=({className:e,input:t,...n})=>(0,U.jsxs)(`div`,{className:H(`space-y-2 overflow-hidden`,e),...n,children:[(0,U.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:`Parameters`}),(0,U.jsx)(`div`,{className:`rounded-md bg-muted/50`,children:(0,U.jsx)(mU,{code:JSON.stringify(t,null,2),language:`json`})})]}),SU=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let i=(0,U.jsx)(`div`,{children:t});return typeof t==`object`&&!(0,z.isValidElement)(t)?i=(0,U.jsx)(mU,{code:JSON.stringify(t,null,2),language:`json`}):typeof t==`string`&&(i=(0,U.jsx)(mU,{code:t,language:`json`})),(0,U.jsxs)(`div`,{className:H(`space-y-2`,e),...r,children:[(0,U.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:n?`Error`:`Result`}),(0,U.jsxs)(`div`,{className:H(`overflow-x-auto rounded-md text-xs [&_table]:w-full`,n?`bg-destructive/10 text-destructive`:`bg-muted/50 text-foreground`),children:[n&&(0,U.jsx)(`div`,{children:n}),i]})]})},CU=function(e){return e.CF_AGENT_CHAT_MESSAGES=`cf_agent_chat_messages`,e.CF_AGENT_USE_CHAT_REQUEST=`cf_agent_use_chat_request`,e.CF_AGENT_USE_CHAT_RESPONSE=`cf_agent_use_chat_response`,e.CF_AGENT_CHAT_CLEAR=`cf_agent_chat_clear`,e.CF_AGENT_CHAT_REQUEST_CANCEL=`cf_agent_chat_request_cancel`,e.CF_AGENT_STREAM_RESUMING=`cf_agent_stream_resuming`,e.CF_AGENT_STREAM_RESUME_ACK=`cf_agent_stream_resume_ack`,e.CF_AGENT_STREAM_RESUME_REQUEST=`cf_agent_stream_resume_request`,e.CF_AGENT_STREAM_RESUME_NONE=`cf_agent_stream_resume_none`,e.CF_AGENT_TOOL_RESULT=`cf_agent_tool_result`,e.CF_AGENT_MESSAGE_UPDATED=`cf_agent_message_updated`,e.CF_AGENT_TOOL_APPROVAL=`cf_agent_tool_approval`,e}({}),wU=`vercel.ai.error`,TU=Symbol.for(wU),EU,DU,OU=class e extends (DU=Error,EU=TU,DU){constructor({name:e,message:t,cause:n}){super(t),this[EU]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,wU)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};function kU(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var AU=`AI_InvalidArgumentError`,jU=`vercel.ai.error.${AU}`,MU=Symbol.for(jU),NU,PU,FU=class extends (PU=OU,NU=MU,PU){constructor({message:e,cause:t,argument:n}){super({name:AU,message:e,cause:t}),this[NU]=!0,this.argument=n}static isInstance(e){return OU.hasMarker(e,jU)}},IU=`AI_JSONParseError`,LU=`vercel.ai.error.${IU}`,RU=Symbol.for(LU),zU,BU,VU=class extends (BU=OU,zU=RU,BU){constructor({text:e,cause:t}){super({name:IU,message:`JSON parsing failed: Text: ${e}.
|
|
@@ -317,7 +317,7 @@ const partysocket = new PartySocket({
|
|
|
317
317
|
|
|
318
318
|
---
|
|
319
319
|
|
|
320
|
-
`),f=u.some(Y1),p=!t&&!f&&l.length>0;return(0,U.jsx)(eE,{from:e.role,children:(0,U.jsxs)(`div`,{children:[s.length>0&&(0,U.jsxs)(bB,{children:[(0,U.jsx)(xB,{count:s.length}),(0,U.jsx)(SB,{children:s.map((e,t)=>e.type===`source-url`?(0,U.jsx)(CB,{href:e.url,title:e.title??e.url},t):(0,U.jsx)(CB,{href:`#${e.sourceId}`,title:e.title},t))})]}),(0,U.jsx)(tE,{children:p?(0,U.jsx)(lE,{children:d}):(0,U.jsxs)(U.Fragment,{children:[d&&r&&(0,U.jsxs)(hB,{defaultOpen:!1,isStreaming:t,children:[(0,U.jsx)(_B,{}),(0,U.jsx)(yB,{children:d})]}),u.map((e,r)=>(0,U.jsx)(k2,{isStreaming:t,part:e,partIndex:r,showTools:n},r))]})}),e.role===`assistant`&&i&&o&&(0,U.jsx)(uE,{messageId:e.id,rating:a,onRate:o})]})})}var j2=({attachment:e,onRemove:t})=>(0,U.jsxs)(ku,{data:e,onRemove:(0,z.useCallback)(()=>{t(e.id)},[t,e.id]),children:[(0,U.jsx)(Au,{}),(0,U.jsx)(ju,{})]}),M2=()=>{let e=qO(),t=(0,z.useCallback)(t=>{e.remove(t)},[e]);return e.files.length===0?null:(0,U.jsx)(Ou,{variant:`inline`,children:e.files.map(e=>(0,U.jsx)(j2,{attachment:e,onRemove:t},e.id))})},N2=({chatId:e,host:t,agentName:n,agentUrl:r,authToken:i,body:a,query:o,welcomeMessage:s,onAgentChange:c,onConnectionStatusChange:l,onRetry:u,onUnauthorized:d,showTools:f=!0,showReasoning:p=!0,showRatings:m=!0})=>{let[h,g]=(0,z.useState)(``),[_,v]=(0,z.useState)(!1),[y,b]=(0,z.useState)({}),{agent:x,chat:S,connectionStatus:C}=O2({agent:n,host:t,chatId:e,authToken:i,toolContext:a??{},connectionParams:o??{},onConnectionStatusChange:l,welcomeMessage:s,onClose:e=>{e.code>=3e3&&d?.(e.reason??``)}});(0,z.useEffect)(()=>(c?.(x),()=>{c?.(null)}),[x,c]),(0,z.useEffect)(()=>{x&&C===`connected`&&x.call(`getMessageRatings`).then(e=>{e&&typeof e==`object`&&b(e)}).catch(()=>{})},[x,C]);let{messages:w,sendMessage:T,status:E,stop:D}=S,O=(0,z.useMemo)(()=>w.filter(e=>e.role!==`system`),[w]),k=(0,z.useCallback)(e=>{let t=!!e.text?.trim(),n=!!e.files?.length;if(!(t||n))return;let r=[];if(e.text?.trim()&&r.push({type:`text`,text:e.text.trim()}),e.files?.length)for(let t of e.files)r.push({type:`text`,text:`[Attachment: ${t.filename??`file`}]`});T({role:`user`,parts:r}),g(``),e.files?.length&&rt.success(`Files attached`,{description:`${e.files.length} file(s) attached to message`})},[T]),A=(0,z.useCallback)(e=>{g(t=>t?`${t} ${e}`:e)},[]),j=(0,z.useCallback)(e=>{g(e.target.value)},[]),M=(0,z.useCallback)(()=>{v(e=>!e)},[]),ee=(0,z.useCallback)(async(e,t)=>{if(b(n=>({...n,[e]:t})),x)try{await x.call(`rateMessage`,[e,t])}catch(e){console.error(`[Chatbot] Failed to rate message`,e)}},[x]),N=(0,z.useMemo)(()=>String(E)===`idle`||String(E)===`ready`?`ready`:E===`submitted`||E===`streaming`||E===`error`?E:`ready`,[E]),P=(0,z.useMemo)(()=>{if(N!==`submitted`&&N!==`streaming`)return!1;let e=O.at(-1);if(!e||e.role===`user`)return!0;if(e.role===`assistant`){let t=e.parts?.some(e=>e.type===`text`),n=e.parts?.some(e=>e.type===`reasoning`);return!t&&!n}return!1},[N,O]),F=(0,z.useMemo)(()=>!h.trim()||N===`streaming`||N===`submitted`,[h,N]);return C===`connecting`?(0,U.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-3 text-muted-foreground`,children:[(0,U.jsx)(`div`,{className:`h-6 w-6 rounded-full border-2 border-zinc-300 border-t-zinc-600 animate-spin`}),(0,U.jsx)(`p`,{className:`text-sm`,children:`Connecting to agent...`})]}):C===`disconnected`?(0,U.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(`div`,{className:`h-10 w-10 rounded-full bg-red-50 flex items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Unable to connect`}),r&&(0,U.jsxs)(`p`,{className:`text-xs text-muted-foreground max-w-xs`,children:[`Could not reach `,(0,U.jsx)(`span`,{className:`font-mono`,children:r}),`. Check the URL and make sure the agent is running.`]})]}),u&&(0,U.jsx)(`button`,{className:`text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground transition-colors`,onClick:u,children:`Try again`})]}):(0,U.jsxs)(`div`,{className:`relative flex size-full flex-col divide-y overflow-hidden`,children:[(0,U.jsxs)(Gu,{children:[(0,U.jsxs)(Ku,{children:[O.map((e,t)=>(0,U.jsx)(oE,{defaultBranch:0,children:(0,U.jsx)(sE,{children:(0,U.jsx)(A2,{isStreaming:N===`streaming`&&t===O.length-1,message:e,showTools:f,showReasoning:p,showRatings:m,rating:y[e.id],onRate:ee})})},e.id)),P&&(0,U.jsx)(eE,{from:`assistant`,children:(0,U.jsx)(tE,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground text-sm`,children:[(0,U.jsx)(RO,{className:`size-3.5 shrink-0`}),(0,U.jsx)(`span`,{children:`Thinking...`})]})})})]}),(0,U.jsx)(qu,{})]}),(0,U.jsx)(`div`,{className:`grid shrink-0 gap-4 pt-4`,children:(0,U.jsx)(`div`,{className:`w-full px-4 pb-4`,children:(0,U.jsxs)(XO,{globalDrop:!0,multiple:!0,onSubmit:k,children:[(0,U.jsx)($O,{children:(0,U.jsx)(M2,{})}),(0,U.jsx)(ZO,{children:(0,U.jsx)(QO,{onChange:j,value:h})}),(0,U.jsxs)(ek,{children:[(0,U.jsxs)(tk,{children:[(0,U.jsxs)(rk,{children:[(0,U.jsx)(ik,{}),(0,U.jsx)(ak,{children:(0,U.jsx)(YO,{})})]}),(0,U.jsx)(TB,{className:`shrink-0`,onTranscriptionChange:A,size:`icon-sm`,variant:`ghost`}),(0,U.jsxs)(nk,{onClick:M,variant:_?`default`:`ghost`,children:[(0,U.jsx)(tu,{size:16}),(0,U.jsx)(`span`,{children:`Search`})]})]}),(0,U.jsx)(ok,{disabled:F,onStop:D,status:N})]})]})})})]})};function P2({className:e,size:t=`default`,...n}){return(0,U.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:H(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function F2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-header`,className:H(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function I2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-title`,className:H(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function L2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-description`,className:H(`text-sm text-muted-foreground`,e),...t})}function R2({...e}){return(0,U.jsx)(nD,{"data-slot":`sheet`,...e})}function z2({...e}){return(0,U.jsx)(iD,{"data-slot":`sheet-trigger`,...e})}function B2({...e}){return(0,U.jsx)(RE,{"data-slot":`sheet-portal`,...e})}function V2({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,U.jsx)(B2,{children:(0,U.jsxs)(IE,{"data-slot":`sheet-content`,"data-side":n,className:H(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,U.jsx)(bE,{"data-slot":`sheet-close`,render:(0,U.jsxs)($n,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,U.jsx)(bu,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})})}function H2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sheet-header`,className:H(`flex flex-col gap-0.5 p-4`,e),...t})}function U2({className:e,...t}){return(0,U.jsx)(rD,{"data-slot":`sheet-title`,className:H(`cn-font-heading text-base font-medium text-foreground`,e),...t})}function W2({className:e,...t}){return(0,U.jsx)(xE,{"data-slot":`sheet-description`,className:H(`text-sm text-muted-foreground`,e),...t})}function G2(e){return!e||typeof e!=`object`?!1:`durable_object_name`in e||`title`in e||`summary`in e||`created_at`in e||`updated_at`in e}function K2(e){return Array.isArray(e)?{rows:e.filter(G2),supported:!0}:{rows:[],supported:!1}}function q2(e){if(e==null||e===``)return`Unknown time`;let t=new Date(e);return Number.isNaN(t.getTime())?`Unknown time`:new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(t)}function J2(e){let t=e?.trim();return t?t.length>180?`${t.slice(0,177)}...`:t:`No summary available yet.`}function Y2(e){return e.title?.trim()||`Untitled conversation`}function X2(e){let t=e.indexOf(`:`);return t===-1?e:e.slice(t+1)}function Z2({agent:e,connectionStatus:t,currentChatId:n,onConversationClick:r}){let[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)([]),[c,l]=(0,z.useState)(`disconnected`),[u,d]=(0,z.useState)(null),[f,p]=(0,z.useState)(null),m=(0,z.useMemo)(()=>t===`unauthorized`?{title:`Unauthorized`,description:`Reconnect with valid credentials to load conversations.`}:{title:`Disconnected`,description:`Connect to the agent to load conversations for the active identity.`},[t]),h=(0,z.useCallback)(async()=>{if(!e){l(t===`unauthorized`?`unauthorized`:`disconnected`),d(null);return}if(t!==`connected`){l(t===`unauthorized`?`unauthorized`:`disconnected`),d(null);return}l(`loading`),d(null);try{let{rows:t,supported:n}=K2(await e.call(`getConversations`));s(t),p(new Date().toISOString()),l(n?t.length>0?`ready`:`empty`:`unsupported`)}catch(e){d(e instanceof Error?e.message:String(e)),l(`error`)}},[e,t]);return(0,z.useEffect)(()=>{if(t===`connected`&&e&&!i){h();return}if(i){if(t===`connected`&&e){h();return}l(t===`unauthorized`?`unauthorized`:`disconnected`),d(null)}},[i,t,h]),(0,U.jsxs)(R2,{open:i,onOpenChange:a,children:[(0,U.jsxs)(yd,{children:[(0,U.jsx)(bd,{render:(0,U.jsx)(z2,{render:(0,U.jsx)($n,{"aria-label":`Conversation history`,title:`Conversation history`,size:`icon-sm`,variant:`outline`,className:`relative`})}),children:(0,U.jsx)(ou,{className:`size-4`})}),(0,U.jsx)(xd,{children:(0,U.jsx)(`p`,{children:`Conversation history`})})]}),(0,U.jsxs)(V2,{className:`gap-0`,children:[(0,U.jsxs)(H2,{children:[(0,U.jsxs)(U2,{children:[`Conversation history`,(0,U.jsx)($n,{"aria-label":`Refresh conversations`,className:`absolute top-3 right-10`,onClick:()=>void h(),size:`icon-sm`,variant:`ghost`,children:(0,U.jsx)(du,{className:`size-4`})})]}),(0,U.jsx)(W2,{children:`Recent conversations for the connected identity.`})]}),(0,U.jsx)(`div`,{className:`border-b px-4 pb-3 text-xs text-muted-foreground`,children:f?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(Yl,{className:`size-3.5`}),`Last refreshed`,` `,new Intl.DateTimeFormat(void 0,{timeStyle:`short`}).format(new Date(f))]}):(0,U.jsx)(`span`,{children:`Open the panel to load conversations from the current session.`})}),(0,U.jsxs)(`div`,{className:`overflow-y-auto`,children:[c===`loading`&&(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center px-4`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,U.jsx)(RO,{className:`size-4`}),`Loading conversations...`]})}),c===`unauthorized`||c===`disconnected`?(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center px-4`,children:(0,U.jsx)(P2,{size:`sm`,className:`w-full border-dashed`,children:(0,U.jsxs)(F2,{children:[(0,U.jsx)(I2,{className:`text-sm`,children:m.title}),(0,U.jsx)(L2,{children:m.description})]})})}):null,c===`error`?(0,U.jsxs)(`div`,{className:` items-center justify-center p-4`,children:[(0,U.jsx)(`p`,{className:`text-red-600`,children:`Could not load conversations`}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:u??`An unexpected error occurred while loading the conversation list.`}),(0,U.jsx)($n,{onClick:()=>void h(),size:`sm`,variant:`outline`,children:`Retry`})]}):null,c===`empty`?(0,U.jsxs)(`div`,{className:` items-center justify-center p-4`,children:[(0,U.jsx)(`p`,{children:`No conversations yet`}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This identity has not created any saved conversations.`})]}):null,c===`unsupported`?(0,U.jsxs)(`div`,{className:` items-center justify-center p-4`,children:[(0,U.jsx)(`p`,{children:`Conversations unavailable`}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This agent does not expose saved conversations for the current identity.`})]}):null,c===`ready`?(0,U.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:o.map((e,t)=>{let i=X2(e.durable_object_name??``);return(0,U.jsx)(`article`,{className:[`rounded-lg border bg-card p-3 shadow-sm transition-shadow hover:shadow-md cursor-pointer`,n&&i===n?`ring-2 ring-primary border-primary`:``].filter(Boolean).join(` `),onClick:()=>{a(!1),r(i)},children:(0,U.jsxs)(`div`,{className:`flex flex-col justify-between gap-2`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex gap-x-2 items-center`,children:[(0,U.jsx)(`h3`,{className:`truncate text-sm font-medium`,children:Y2(e)}),(0,U.jsx)(`time`,{className:`shrink-0 text-[11px] text-muted-foreground ml-auto`,children:q2(e.updated_at)})]}),(0,U.jsx)(`p`,{className:`mt-1 line-clamp-3 text-xs leading-relaxed text-muted-foreground`,children:J2(e.summary)})]})},e.durable_object_name??`${e.updated_at??t}`)})}):null]})]})]})}var Q2=z.createContext(void 0);function $2(e){let t=z.useContext(Q2);if(t===void 0&&!e)throw Error(hn(47));return t}function e4(){return{...Cc(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var t4={...Tc,disabled:W(e=>e.disabled),instantType:W(e=>e.instantType),openMethod:W(e=>e.openMethod),openChangeReason:W(e=>e.openChangeReason),modal:W(e=>e.modal),focusManagerModal:W(e=>e.focusManagerModal),stickIfOpen:W(e=>e.stickIfOpen),titleElementId:W(e=>e.titleElementId),descriptionElementId:W(e=>e.descriptionElementId),openOnHover:W(e=>e.openOnHover),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport)},n4=class e extends sc{constructor(e){let t={...e4(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:z.createRef(),beforeContentFocusGuardRef:z.createRef(),stickIfOpenTimeout:new ir,triggerElements:new xc},t4)}setOpen=(e,t)=>{let n=t.reason===jr,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let a=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),He.flushSync(a)):a(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=Gt(()=>new e(n)).current,i=t??r;return nr(r.disposeEffect),i}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function r4({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=n4.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});er(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:p,triggerProps:m}=XE(d);yc(u);let{forceUnmount:h}=bc(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});z.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let g=z.useCallback(e=>{let t=Ur(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),_=z.useCallback(()=>{u.setOpen(!1,g(Hr))},[u,g]);z.useImperativeHandle(e.actionsRef,()=>({unmount:h,close:_}),[h,_]);let v=Oc({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:y,getFloatingProps:b,getTriggerProps:x}=zc([Mo(v,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),Zc(v)]),S=z.useMemo(()=>y(m),[y,m]),C=z.useMemo(()=>x(m),[x,m]),w=z.useMemo(()=>b(),[b]);u.useSyncedValues({modal:o,openMethod:p,activeTriggerProps:S,inactiveTriggerProps:C,popupProps:w,floatingRootContext:v,nested:co()!=null});let T=z.useMemo(()=>({store:u}),[u]);return(0,U.jsx)(Q2.Provider,{value:T,children:typeof t==`function`?t({payload:f}):t})}function i4(e){return $2(!0)?(0,U.jsx)(r4,{props:e}):(0,U.jsx)(po,{children:(0,U.jsx)(r4,{props:e})})}var a4=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,style:f,...p}=e,m=$2(!0),h=o?.store??m?.store;if(!h)throw Error(hn(74));let g=vl(d),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=z.useRef(null),{registerTrigger:x,isMountedByThisTrigger:S}=vc(g,b,h,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),C=h.useState(`openChangeReason`),w=h.useState(`stickIfOpen`),T=h.useState(`openMethod`),E=h.useState(`focusManagerModal`),D=Rc(v,{enabled:v!=null&&c&&(T!==`touch`||C!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:ol(),restMs:l,delay:{close:u},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=zc([To(v,{enabled:v!=null,stickIfOpen:w})]),k=h.useState(`triggerProps`,S),A={disabled:i,open:y},{getButtonProps:j,buttonRef:M}=yn({disabled:i,native:a}),ee=z.useMemo(()=>({open(e){return e&&C===`trigger-press`?gl.open(e):hl.open(e)}}),[C]),N=Hn(`button`,e,{state:A,ref:[M,t,x,b],props:[O.getReferenceProps(),D,k,{[Rn]:``,id:g},p,j],stateAttributesMapping:ee}),{preFocusGuardRef:P,handlePreFocusGuardFocus:F,handleFocusTargetFocus:te}=CO(h,b);return _&&!E?(0,U.jsxs)(z.Fragment,{children:[(0,U.jsx)(ai,{ref:P,onFocus:F}),(0,U.jsx)(z.Fragment,{children:N},g),(0,U.jsx)(ai,{ref:h.context.triggerFocusTargetRef,onFocus:te})]}):(0,U.jsx)(z.Fragment,{children:N},g)}),o4=z.createContext(void 0);function s4(){let e=z.useContext(o4);if(e===void 0)throw Error(hn(45));return e}var c4=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=$2();return i.useState(`mounted`)||n?(0,U.jsx)(o4.Provider,{value:n,children:(0,U.jsx)(ro,{ref:t,...r})}):null}),l4=z.createContext(void 0);function u4(){let e=z.useContext(l4);if(!e)throw Error(hn(46));return e}var d4=z.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Bn,style:g,..._}=e,{store:v}=$2(),y=s4(),b=uo(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`hasViewport`),M=z.useRef(null),ee=hc(O,!1,!1),N=Ol({anchor:i,floatingRootContext:x,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:y,nodeId:b,collisionAvoidance:h,adaptiveOrigin:j?Tl:void 0}),P=x.useState(`domReferenceElement`);V(()=>{let e=P,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return ee(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,ee,v]);let F={open:C,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:k};lO(C&&E===!0&&w!==`trigger-hover`,D===`touch`,O,T);let te=z.useCallback(e=>{v.set(`positionerElement`,e)},[v]),I=jl(e,F,{styles:N.positionerStyles,transitionStatus:A,props:_,refs:[t,te],hidden:!S,inert:!C});return(0,U.jsxs)(l4.Provider,{value:N,children:[S&&E===!0&&w!==`trigger-hover`&&(0,U.jsx)(LE,{ref:v.context.internalBackdropRef,inert:Ml(!C),cutout:T}),(0,U.jsx)(fo,{id:b,children:I})]})}),f4=z.createContext(void 0);function p4(){let[e,t]=z.useState(0),n=B(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:z.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function m4(e){let{value:t,children:n}=e;return(0,U.jsx)(f4.Provider,{value:t,children:n})}var h4={..._l,...mc},g4=z.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,style:o,...s}=e,{store:c}=$2(),l=u4(),u=QD(!0)!=null,{context:d,hasClosePart:f}=p4(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`);gc({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}});let T=c.useState(`disabled`),E=c.useState(`openOnHover`),D=c.useState(`closeDelay`);Ic(w,{enabled:E&&!T,closeDelay:D});function O(e){return e===`touch`?c.context.popupRef.current:!0}let k=i===void 0?O:i,A={open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},j=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,j);let M=z.useCallback(e=>{c.set(`popupElement`,e)},[c]),ee=Hn(`div`,e,{state:A,ref:[t,c.context.popupRef,M],props:[_,{"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&PE.has(e.key)&&e.stopPropagation()}},Al(g),s],stateAttributesMapping:h4});return(0,U.jsx)(wo,{context:w,openInteractionType:m,modal:j,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:Tt(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,U.jsx)(m4,{value:d,children:ee})})});function _4({...e}){return(0,U.jsx)(i4,{"data-slot":`popover`,...e})}function v4({...e}){return(0,U.jsx)(a4,{"data-slot":`popover-trigger`,...e})}function y4({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,U.jsx)(c4,{children:(0,U.jsx)(d4,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,U.jsx)(g4,{"data-slot":`popover-content`,className:H(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}var b4=z.createContext(void 0);function x4(){let e=z.useContext(b4);if(e===void 0)throw Error(hn(63));return e}var S4=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),C4={..._D,checked(e){return e?{[S4.checked]:``}:{[S4.unchecked]:``}}};function w4(e,t,n,r=!0,i){let[a,o]=z.useState(),s=vl(i?`${i}-label`:void 0),c=e??t??a;return V(()=>{let i=e||t||!r?void 0:T4(n.current,s);a!==i&&o(i)}),c}function T4(e,t){let n=E4(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function E4(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var D4=z.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:b}=xD(),{state:x,setTouched:S,setDirty:C,validityData:w,setFilled:T,setFocused:E,shouldValidateOnChange:D,validationMode:O,disabled:k,name:A,validation:j}=yD(),{labelId:M}=CD(),ee=k||m,N=A??l,P=B(d),F=z.useRef(null),te=Sn(F,c,j.inputRef),I=z.useRef(null),ne=vl(),re=ED({id:s,implicit:!1,controlRef:I}),ie=u?void 0:re,[L,ae]=wD({controlled:n,default:!!i,name:`Switch`,state:`checked`});TD(I,{id:ne,value:L}),V(()=>{F.current&&T(F.current.checked)},[F,T]),YE(L,()=>{b(N),C(L!==w.initialValue),T(L),D()?j.commit(L):j.commit(L,!0)});let{getButtonProps:R,buttonRef:oe}=yn({disabled:ee,native:u}),se=w4(a,M,F,!u,ie),ce={id:u?re:ne,role:`switch`,"aria-checked":L,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":se,onFocus(){ee||E(!0)},onBlur(){let e=F.current;!e||ee||(S(!0),E(!1),O===`onBlur`&&j.commit(e.checked))},onClick(e){f||ee||(e.preventDefault(),F.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},le=z.useMemo(()=>$t({checked:L,disabled:ee,form:o,id:ie,name:N,required:p,style:N?ii:ri,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:te,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=Ur(kr,e.nativeEvent);P?.(t,n),!n.isCanceled&&ae(t)},onFocus(){I.current?.focus()}},j.getInputValidationProps,_===void 0?In:{value:_}),[L,ee,o,te,ie,N,P,f,p,ae,j,_]),ue=z.useMemo(()=>({...x,checked:L,disabled:ee,readOnly:f,required:p}),[x,L,ee,f,p]),de=Hn(`span`,e,{state:ue,ref:[t,I,oe],props:[ce,j.getValidationProps,y,R],stateAttributesMapping:C4});return(0,U.jsxs)(b4.Provider,{value:ue,children:[de,!L&&N&&g!==void 0&&(0,U.jsx)(`input`,{type:`hidden`,form:o,name:N,value:g}),(0,U.jsx)(`input`,{...le,suppressHydrationWarning:!0})]})}),O4=z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=yD(),s=x4();return Hn(`span`,e,{state:{...o,...s},ref:t,stateAttributesMapping:C4,props:a})});function k4({className:e,size:t=`default`,...n}){return(0,U.jsx)(D4,{"data-slot":`switch`,"data-size":t,className:H(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,U.jsx)(O4,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}var A4=class extends z.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,U.jsx)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4 text-muted-foreground`,children:(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(`div`,{className:`h-10 w-10 rounded-full bg-red-50 flex items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Something went wrong`}),(0,U.jsx)(`p`,{className:`text-xs max-w-xs`,children:`Could not connect to the agent. Check the URL above and try again.`})]})}):this.props.children}};function j4(e){try{let t=JSON.parse(e);return typeof t==`object`&&!!t&&Object.keys(t).length>0}catch{return!1}}var M4=`{
|
|
320
|
+
`),f=u.some(Y1),p=!t&&!f&&l.length>0;return(0,U.jsx)(eE,{from:e.role,children:(0,U.jsxs)(`div`,{children:[s.length>0&&(0,U.jsxs)(bB,{children:[(0,U.jsx)(xB,{count:s.length}),(0,U.jsx)(SB,{children:s.map((e,t)=>e.type===`source-url`?(0,U.jsx)(CB,{href:e.url,title:e.title??e.url},t):(0,U.jsx)(CB,{href:`#${e.sourceId}`,title:e.title},t))})]}),(0,U.jsx)(tE,{children:p?(0,U.jsx)(lE,{children:d}):(0,U.jsxs)(U.Fragment,{children:[d&&r&&(0,U.jsxs)(hB,{defaultOpen:!1,isStreaming:t,children:[(0,U.jsx)(_B,{}),(0,U.jsx)(yB,{children:d})]}),u.map((e,r)=>(0,U.jsx)(k2,{isStreaming:t,part:e,partIndex:r,showTools:n},r))]})}),e.role===`assistant`&&i&&o&&(0,U.jsx)(uE,{messageId:e.id,rating:a,onRate:o})]})})}var j2=({attachment:e,onRemove:t})=>(0,U.jsxs)(ku,{data:e,onRemove:(0,z.useCallback)(()=>{t(e.id)},[t,e.id]),children:[(0,U.jsx)(Au,{}),(0,U.jsx)(ju,{})]}),M2=()=>{let e=qO(),t=(0,z.useCallback)(t=>{e.remove(t)},[e]);return e.files.length===0?null:(0,U.jsx)(Ou,{variant:`inline`,children:e.files.map(e=>(0,U.jsx)(j2,{attachment:e,onRemove:t},e.id))})},N2=({chatId:e,host:t,agentName:n,agentUrl:r,authToken:i,body:a,query:o,welcomeMessage:s,onAgentChange:c,onConnectionStatusChange:l,onRetry:u,onUnauthorized:d,showTools:f=!0,showReasoning:p=!0,showRatings:m=!0})=>{let[h,g]=(0,z.useState)(``),[_,v]=(0,z.useState)(!1),[y,b]=(0,z.useState)({}),{agent:x,chat:S,connectionStatus:C}=O2({agent:n,host:t,chatId:e,authToken:i,toolContext:a??{},connectionParams:o??{},onConnectionStatusChange:l,welcomeMessage:s,onClose:e=>{e.code>=3e3&&d?.(e.reason??``)}});(0,z.useEffect)(()=>(c?.(x),()=>{c?.(null)}),[x,c]),(0,z.useEffect)(()=>{x&&C===`connected`&&x.call(`getMessageRatings`).then(e=>{e&&typeof e==`object`&&b(e)}).catch(e=>{console.error(`[Chatbot] Failed to load ratings`,e)})},[x,C]);let{messages:w,sendMessage:T,status:E,stop:D}=S,O=(0,z.useMemo)(()=>w.filter(e=>e.role!==`system`),[w]),k=(0,z.useCallback)(e=>{let t=!!e.text?.trim(),n=!!e.files?.length;if(!(t||n))return;let r=[];if(e.text?.trim()&&r.push({type:`text`,text:e.text.trim()}),e.files?.length)for(let t of e.files)r.push({type:`text`,text:`[Attachment: ${t.filename??`file`}]`});T({role:`user`,parts:r}),g(``),e.files?.length&&rt.success(`Files attached`,{description:`${e.files.length} file(s) attached to message`})},[T]),A=(0,z.useCallback)(e=>{g(t=>t?`${t} ${e}`:e)},[]),j=(0,z.useCallback)(e=>{g(e.target.value)},[]),M=(0,z.useCallback)(()=>{v(e=>!e)},[]),ee=(0,z.useCallback)(async(e,t,n)=>{if(b(r=>({...r,[e]:{rating:t,comment:n}})),x)try{await x.call(`rateMessage`,[e,t,n])}catch(e){console.error(`[Chatbot] Failed to rate message`,e)}},[x]),N=(0,z.useMemo)(()=>String(E)===`idle`||String(E)===`ready`?`ready`:E===`submitted`||E===`streaming`||E===`error`?E:`ready`,[E]),P=(0,z.useMemo)(()=>{if(N!==`submitted`&&N!==`streaming`)return!1;let e=O.at(-1);if(!e||e.role===`user`)return!0;if(e.role===`assistant`){let t=e.parts?.some(e=>e.type===`text`),n=e.parts?.some(e=>e.type===`reasoning`);return!t&&!n}return!1},[N,O]),F=(0,z.useMemo)(()=>!h.trim()||N===`streaming`||N===`submitted`,[h,N]);return C===`connecting`?(0,U.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-3 text-muted-foreground`,children:[(0,U.jsx)(`div`,{className:`h-6 w-6 rounded-full border-2 border-zinc-300 border-t-zinc-600 animate-spin`}),(0,U.jsx)(`p`,{className:`text-sm`,children:`Connecting to agent...`})]}):C===`disconnected`?(0,U.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(`div`,{className:`h-10 w-10 rounded-full bg-red-50 flex items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Unable to connect`}),r&&(0,U.jsxs)(`p`,{className:`text-xs text-muted-foreground max-w-xs`,children:[`Could not reach `,(0,U.jsx)(`span`,{className:`font-mono`,children:r}),`. Check the URL and make sure the agent is running.`]})]}),u&&(0,U.jsx)(`button`,{className:`text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground transition-colors`,onClick:u,children:`Try again`})]}):(0,U.jsxs)(`div`,{className:`relative flex size-full flex-col divide-y overflow-hidden`,children:[(0,U.jsxs)(Gu,{children:[(0,U.jsxs)(Ku,{children:[O.map((e,t)=>(0,U.jsx)(oE,{defaultBranch:0,children:(0,U.jsx)(sE,{children:(0,U.jsx)(A2,{isStreaming:N===`streaming`&&t===O.length-1,message:e,showTools:f,showReasoning:p,showRatings:m,rating:y[e.id],onRate:ee})})},e.id)),P&&(0,U.jsx)(eE,{from:`assistant`,children:(0,U.jsx)(tE,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground text-sm`,children:[(0,U.jsx)(RO,{className:`size-3.5 shrink-0`}),(0,U.jsx)(`span`,{children:`Thinking...`})]})})})]}),(0,U.jsx)(qu,{})]}),(0,U.jsx)(`div`,{className:`grid shrink-0 gap-4 pt-4`,children:(0,U.jsx)(`div`,{className:`w-full px-4 pb-4`,children:(0,U.jsxs)(XO,{globalDrop:!0,multiple:!0,onSubmit:k,children:[(0,U.jsx)($O,{children:(0,U.jsx)(M2,{})}),(0,U.jsx)(ZO,{children:(0,U.jsx)(QO,{onChange:j,value:h})}),(0,U.jsxs)(ek,{children:[(0,U.jsxs)(tk,{children:[(0,U.jsxs)(rk,{children:[(0,U.jsx)(ik,{}),(0,U.jsx)(ak,{children:(0,U.jsx)(YO,{})})]}),(0,U.jsx)(TB,{className:`shrink-0`,onTranscriptionChange:A,size:`icon-sm`,variant:`ghost`}),(0,U.jsxs)(nk,{onClick:M,variant:_?`default`:`ghost`,children:[(0,U.jsx)(tu,{size:16}),(0,U.jsx)(`span`,{children:`Search`})]})]}),(0,U.jsx)(ok,{disabled:F,onStop:D,status:N})]})]})})})]})};function P2({className:e,size:t=`default`,...n}){return(0,U.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:H(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function F2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-header`,className:H(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function I2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-title`,className:H(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function L2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-description`,className:H(`text-sm text-muted-foreground`,e),...t})}function R2({...e}){return(0,U.jsx)(nD,{"data-slot":`sheet`,...e})}function z2({...e}){return(0,U.jsx)(iD,{"data-slot":`sheet-trigger`,...e})}function B2({...e}){return(0,U.jsx)(RE,{"data-slot":`sheet-portal`,...e})}function V2({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,U.jsx)(B2,{children:(0,U.jsxs)(IE,{"data-slot":`sheet-content`,"data-side":n,className:H(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,U.jsx)(bE,{"data-slot":`sheet-close`,render:(0,U.jsxs)($n,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,U.jsx)(bu,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})})}function H2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sheet-header`,className:H(`flex flex-col gap-0.5 p-4`,e),...t})}function U2({className:e,...t}){return(0,U.jsx)(rD,{"data-slot":`sheet-title`,className:H(`cn-font-heading text-base font-medium text-foreground`,e),...t})}function W2({className:e,...t}){return(0,U.jsx)(xE,{"data-slot":`sheet-description`,className:H(`text-sm text-muted-foreground`,e),...t})}function G2(e){return!e||typeof e!=`object`?!1:`durable_object_name`in e||`title`in e||`summary`in e||`created_at`in e||`updated_at`in e}function K2(e){return Array.isArray(e)?{rows:e.filter(G2),supported:!0}:{rows:[],supported:!1}}function q2(e){if(e==null||e===``)return`Unknown time`;let t=new Date(e);return Number.isNaN(t.getTime())?`Unknown time`:new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(t)}function J2(e){let t=e?.trim();return t?t.length>180?`${t.slice(0,177)}...`:t:`No summary available yet.`}function Y2(e){return e.title?.trim()||`Untitled conversation`}function X2(e){let t=e.indexOf(`:`);return t===-1?e:e.slice(t+1)}function Z2({agent:e,connectionStatus:t,currentChatId:n,onConversationClick:r}){let[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)([]),[c,l]=(0,z.useState)(`disconnected`),[u,d]=(0,z.useState)(null),[f,p]=(0,z.useState)(null),m=(0,z.useMemo)(()=>t===`unauthorized`?{title:`Unauthorized`,description:`Reconnect with valid credentials to load conversations.`}:{title:`Disconnected`,description:`Connect to the agent to load conversations for the active identity.`},[t]),h=(0,z.useCallback)(async()=>{if(!e){l(t===`unauthorized`?`unauthorized`:`disconnected`),d(null);return}if(t!==`connected`){l(t===`unauthorized`?`unauthorized`:`disconnected`),d(null);return}l(`loading`),d(null);try{let{rows:t,supported:n}=K2(await e.call(`getConversations`));s(t),p(new Date().toISOString()),l(n?t.length>0?`ready`:`empty`:`unsupported`)}catch(e){d(e instanceof Error?e.message:String(e)),l(`error`)}},[e,t]);return(0,z.useEffect)(()=>{if(t===`connected`&&e&&!i){h();return}if(i){if(t===`connected`&&e){h();return}l(t===`unauthorized`?`unauthorized`:`disconnected`),d(null)}},[i,t,h]),(0,U.jsxs)(R2,{open:i,onOpenChange:a,children:[(0,U.jsxs)(yd,{children:[(0,U.jsx)(bd,{render:(0,U.jsx)(z2,{render:(0,U.jsx)($n,{"aria-label":`Conversation history`,title:`Conversation history`,size:`icon-sm`,variant:`outline`,className:`relative`})}),children:(0,U.jsx)(ou,{className:`size-4`})}),(0,U.jsx)(xd,{children:(0,U.jsx)(`p`,{children:`Conversation history`})})]}),(0,U.jsxs)(V2,{className:`gap-0`,children:[(0,U.jsxs)(H2,{children:[(0,U.jsxs)(U2,{children:[`Conversation history`,(0,U.jsx)($n,{"aria-label":`Refresh conversations`,className:`absolute top-3 right-10`,onClick:()=>void h(),size:`icon-sm`,variant:`ghost`,children:(0,U.jsx)(du,{className:`size-4`})})]}),(0,U.jsx)(W2,{children:`Recent conversations for the connected identity.`})]}),(0,U.jsx)(`div`,{className:`border-b px-4 pb-3 text-xs text-muted-foreground`,children:f?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(Yl,{className:`size-3.5`}),`Last refreshed`,` `,new Intl.DateTimeFormat(void 0,{timeStyle:`short`}).format(new Date(f))]}):(0,U.jsx)(`span`,{children:`Open the panel to load conversations from the current session.`})}),(0,U.jsxs)(`div`,{className:`overflow-y-auto`,children:[c===`loading`&&(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center px-4`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,U.jsx)(RO,{className:`size-4`}),`Loading conversations...`]})}),c===`unauthorized`||c===`disconnected`?(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center px-4`,children:(0,U.jsx)(P2,{size:`sm`,className:`w-full border-dashed`,children:(0,U.jsxs)(F2,{children:[(0,U.jsx)(I2,{className:`text-sm`,children:m.title}),(0,U.jsx)(L2,{children:m.description})]})})}):null,c===`error`?(0,U.jsxs)(`div`,{className:` items-center justify-center p-4`,children:[(0,U.jsx)(`p`,{className:`text-red-600`,children:`Could not load conversations`}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:u??`An unexpected error occurred while loading the conversation list.`}),(0,U.jsx)($n,{onClick:()=>void h(),size:`sm`,variant:`outline`,children:`Retry`})]}):null,c===`empty`?(0,U.jsxs)(`div`,{className:` items-center justify-center p-4`,children:[(0,U.jsx)(`p`,{children:`No conversations yet`}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This identity has not created any saved conversations.`})]}):null,c===`unsupported`?(0,U.jsxs)(`div`,{className:` items-center justify-center p-4`,children:[(0,U.jsx)(`p`,{children:`Conversations unavailable`}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This agent does not expose saved conversations for the current identity.`})]}):null,c===`ready`?(0,U.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:o.map((e,t)=>{let i=X2(e.durable_object_name??``);return(0,U.jsx)(`article`,{className:[`rounded-lg border bg-card p-3 shadow-sm transition-shadow hover:shadow-md cursor-pointer`,n&&i===n?`ring-2 ring-primary border-primary`:``].filter(Boolean).join(` `),onClick:()=>{a(!1),r(i)},children:(0,U.jsxs)(`div`,{className:`flex flex-col justify-between gap-2`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex gap-x-2 items-center`,children:[(0,U.jsx)(`h3`,{className:`truncate text-sm font-medium`,children:Y2(e)}),(0,U.jsx)(`time`,{className:`shrink-0 text-[11px] text-muted-foreground ml-auto`,children:q2(e.updated_at)})]}),(0,U.jsx)(`p`,{className:`mt-1 line-clamp-3 text-xs leading-relaxed text-muted-foreground`,children:J2(e.summary)})]})},e.durable_object_name??`${e.updated_at??t}`)})}):null]})]})]})}var Q2=z.createContext(void 0);function $2(e){let t=z.useContext(Q2);if(t===void 0&&!e)throw Error(hn(47));return t}function e4(){return{...Cc(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var t4={...Tc,disabled:W(e=>e.disabled),instantType:W(e=>e.instantType),openMethod:W(e=>e.openMethod),openChangeReason:W(e=>e.openChangeReason),modal:W(e=>e.modal),focusManagerModal:W(e=>e.focusManagerModal),stickIfOpen:W(e=>e.stickIfOpen),titleElementId:W(e=>e.titleElementId),descriptionElementId:W(e=>e.descriptionElementId),openOnHover:W(e=>e.openOnHover),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport)},n4=class e extends sc{constructor(e){let t={...e4(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:z.createRef(),beforeContentFocusGuardRef:z.createRef(),stickIfOpenTimeout:new ir,triggerElements:new xc},t4)}setOpen=(e,t)=>{let n=t.reason===jr,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let a=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),He.flushSync(a)):a(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=Gt(()=>new e(n)).current,i=t??r;return nr(r.disposeEffect),i}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function r4({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=n4.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});er(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:p,triggerProps:m}=XE(d);yc(u);let{forceUnmount:h}=bc(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});z.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let g=z.useCallback(e=>{let t=Ur(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),_=z.useCallback(()=>{u.setOpen(!1,g(Hr))},[u,g]);z.useImperativeHandle(e.actionsRef,()=>({unmount:h,close:_}),[h,_]);let v=Oc({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:y,getFloatingProps:b,getTriggerProps:x}=zc([Mo(v,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),Zc(v)]),S=z.useMemo(()=>y(m),[y,m]),C=z.useMemo(()=>x(m),[x,m]),w=z.useMemo(()=>b(),[b]);u.useSyncedValues({modal:o,openMethod:p,activeTriggerProps:S,inactiveTriggerProps:C,popupProps:w,floatingRootContext:v,nested:co()!=null});let T=z.useMemo(()=>({store:u}),[u]);return(0,U.jsx)(Q2.Provider,{value:T,children:typeof t==`function`?t({payload:f}):t})}function i4(e){return $2(!0)?(0,U.jsx)(r4,{props:e}):(0,U.jsx)(po,{children:(0,U.jsx)(r4,{props:e})})}var a4=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,style:f,...p}=e,m=$2(!0),h=o?.store??m?.store;if(!h)throw Error(hn(74));let g=vl(d),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=z.useRef(null),{registerTrigger:x,isMountedByThisTrigger:S}=vc(g,b,h,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),C=h.useState(`openChangeReason`),w=h.useState(`stickIfOpen`),T=h.useState(`openMethod`),E=h.useState(`focusManagerModal`),D=Rc(v,{enabled:v!=null&&c&&(T!==`touch`||C!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:ol(),restMs:l,delay:{close:u},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=zc([To(v,{enabled:v!=null,stickIfOpen:w})]),k=h.useState(`triggerProps`,S),A={disabled:i,open:y},{getButtonProps:j,buttonRef:M}=yn({disabled:i,native:a}),ee=z.useMemo(()=>({open(e){return e&&C===`trigger-press`?gl.open(e):hl.open(e)}}),[C]),N=Hn(`button`,e,{state:A,ref:[M,t,x,b],props:[O.getReferenceProps(),D,k,{[Rn]:``,id:g},p,j],stateAttributesMapping:ee}),{preFocusGuardRef:P,handlePreFocusGuardFocus:F,handleFocusTargetFocus:te}=CO(h,b);return _&&!E?(0,U.jsxs)(z.Fragment,{children:[(0,U.jsx)(ai,{ref:P,onFocus:F}),(0,U.jsx)(z.Fragment,{children:N},g),(0,U.jsx)(ai,{ref:h.context.triggerFocusTargetRef,onFocus:te})]}):(0,U.jsx)(z.Fragment,{children:N},g)}),o4=z.createContext(void 0);function s4(){let e=z.useContext(o4);if(e===void 0)throw Error(hn(45));return e}var c4=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=$2();return i.useState(`mounted`)||n?(0,U.jsx)(o4.Provider,{value:n,children:(0,U.jsx)(ro,{ref:t,...r})}):null}),l4=z.createContext(void 0);function u4(){let e=z.useContext(l4);if(!e)throw Error(hn(46));return e}var d4=z.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Bn,style:g,..._}=e,{store:v}=$2(),y=s4(),b=uo(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`hasViewport`),M=z.useRef(null),ee=hc(O,!1,!1),N=Ol({anchor:i,floatingRootContext:x,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:y,nodeId:b,collisionAvoidance:h,adaptiveOrigin:j?Tl:void 0}),P=x.useState(`domReferenceElement`);V(()=>{let e=P,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return ee(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,ee,v]);let F={open:C,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:k};lO(C&&E===!0&&w!==`trigger-hover`,D===`touch`,O,T);let te=z.useCallback(e=>{v.set(`positionerElement`,e)},[v]),I=jl(e,F,{styles:N.positionerStyles,transitionStatus:A,props:_,refs:[t,te],hidden:!S,inert:!C});return(0,U.jsxs)(l4.Provider,{value:N,children:[S&&E===!0&&w!==`trigger-hover`&&(0,U.jsx)(LE,{ref:v.context.internalBackdropRef,inert:Ml(!C),cutout:T}),(0,U.jsx)(fo,{id:b,children:I})]})}),f4=z.createContext(void 0);function p4(){let[e,t]=z.useState(0),n=B(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:z.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function m4(e){let{value:t,children:n}=e;return(0,U.jsx)(f4.Provider,{value:t,children:n})}var h4={..._l,...mc},g4=z.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,style:o,...s}=e,{store:c}=$2(),l=u4(),u=QD(!0)!=null,{context:d,hasClosePart:f}=p4(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`);gc({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}});let T=c.useState(`disabled`),E=c.useState(`openOnHover`),D=c.useState(`closeDelay`);Ic(w,{enabled:E&&!T,closeDelay:D});function O(e){return e===`touch`?c.context.popupRef.current:!0}let k=i===void 0?O:i,A={open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},j=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,j);let M=z.useCallback(e=>{c.set(`popupElement`,e)},[c]),ee=Hn(`div`,e,{state:A,ref:[t,c.context.popupRef,M],props:[_,{"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&PE.has(e.key)&&e.stopPropagation()}},Al(g),s],stateAttributesMapping:h4});return(0,U.jsx)(wo,{context:w,openInteractionType:m,modal:j,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:Tt(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,U.jsx)(m4,{value:d,children:ee})})});function _4({...e}){return(0,U.jsx)(i4,{"data-slot":`popover`,...e})}function v4({...e}){return(0,U.jsx)(a4,{"data-slot":`popover-trigger`,...e})}function y4({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,U.jsx)(c4,{children:(0,U.jsx)(d4,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,U.jsx)(g4,{"data-slot":`popover-content`,className:H(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}var b4=z.createContext(void 0);function x4(){let e=z.useContext(b4);if(e===void 0)throw Error(hn(63));return e}var S4=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),C4={..._D,checked(e){return e?{[S4.checked]:``}:{[S4.unchecked]:``}}};function w4(e,t,n,r=!0,i){let[a,o]=z.useState(),s=vl(i?`${i}-label`:void 0),c=e??t??a;return V(()=>{let i=e||t||!r?void 0:T4(n.current,s);a!==i&&o(i)}),c}function T4(e,t){let n=E4(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function E4(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var D4=z.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:b}=xD(),{state:x,setTouched:S,setDirty:C,validityData:w,setFilled:T,setFocused:E,shouldValidateOnChange:D,validationMode:O,disabled:k,name:A,validation:j}=yD(),{labelId:M}=CD(),ee=k||m,N=A??l,P=B(d),F=z.useRef(null),te=Sn(F,c,j.inputRef),I=z.useRef(null),ne=vl(),re=ED({id:s,implicit:!1,controlRef:I}),ie=u?void 0:re,[L,ae]=wD({controlled:n,default:!!i,name:`Switch`,state:`checked`});TD(I,{id:ne,value:L}),V(()=>{F.current&&T(F.current.checked)},[F,T]),YE(L,()=>{b(N),C(L!==w.initialValue),T(L),D()?j.commit(L):j.commit(L,!0)});let{getButtonProps:R,buttonRef:oe}=yn({disabled:ee,native:u}),se=w4(a,M,F,!u,ie),ce={id:u?re:ne,role:`switch`,"aria-checked":L,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":se,onFocus(){ee||E(!0)},onBlur(){let e=F.current;!e||ee||(S(!0),E(!1),O===`onBlur`&&j.commit(e.checked))},onClick(e){f||ee||(e.preventDefault(),F.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},le=z.useMemo(()=>$t({checked:L,disabled:ee,form:o,id:ie,name:N,required:p,style:N?ii:ri,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:te,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=Ur(kr,e.nativeEvent);P?.(t,n),!n.isCanceled&&ae(t)},onFocus(){I.current?.focus()}},j.getInputValidationProps,_===void 0?In:{value:_}),[L,ee,o,te,ie,N,P,f,p,ae,j,_]),ue=z.useMemo(()=>({...x,checked:L,disabled:ee,readOnly:f,required:p}),[x,L,ee,f,p]),de=Hn(`span`,e,{state:ue,ref:[t,I,oe],props:[ce,j.getValidationProps,y,R],stateAttributesMapping:C4});return(0,U.jsxs)(b4.Provider,{value:ue,children:[de,!L&&N&&g!==void 0&&(0,U.jsx)(`input`,{type:`hidden`,form:o,name:N,value:g}),(0,U.jsx)(`input`,{...le,suppressHydrationWarning:!0})]})}),O4=z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=yD(),s=x4();return Hn(`span`,e,{state:{...o,...s},ref:t,stateAttributesMapping:C4,props:a})});function k4({className:e,size:t=`default`,...n}){return(0,U.jsx)(D4,{"data-slot":`switch`,"data-size":t,className:H(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,U.jsx)(O4,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}var A4=class extends z.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,U.jsx)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4 text-muted-foreground`,children:(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(`div`,{className:`h-10 w-10 rounded-full bg-red-50 flex items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Something went wrong`}),(0,U.jsx)(`p`,{className:`text-xs max-w-xs`,children:`Could not connect to the agent. Check the URL above and try again.`})]})}):this.props.children}};function j4(e){try{let t=JSON.parse(e);return typeof t==`object`&&!!t&&Object.keys(t).length>0}catch{return!1}}var M4=`{
|
|
321
321
|
"currentDateTime": "2026-04-13T11:57:17.858Z",
|
|
322
322
|
"tokens": {
|
|
323
323
|
"X-Economic-Token": "token_123"
|